@thoughtspot/visual-embed-sdk 1.9.1 → 1.9.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.
package/README.md CHANGED
@@ -1,11 +1,10 @@
1
-
2
1
  <p align="center">
3
2
  <img src="https://raw.githubusercontent.com/thoughtspot/visual-embed-sdk/main/static/doc-images/images/TS-Logo-black-no-bg.svg" width=100 align="center" alt="ThoughtSpot" />
4
3
  </p>
5
4
 
6
5
  <br/>
7
6
 
8
- # ThoughtSpot Visual Embed SDK [![Coverage Status](https://coveralls.io/repos/github/ts-blink/embed-sdk/badge.svg?branch=main)](https://coveralls.io/github/ts-blink/embed-sdk?branch=main) ![npm (scoped with tag)](https://img.shields.io/npm/v/@thoughtspot/visual-embed-sdk) [![](https://data.jsdelivr.com/v1/package/npm/@thoughtspot/visual-embed-sdk/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@thoughtspot/visual-embed-sdk)
7
+ # ThoughtSpot Visual Embed SDK [![Coverage Status](https://coveralls.io/repos/github/ts-blink/embed-sdk/badge.svg?branch=main)](https://coveralls.io/github/ts-blink/embed-sdk?branch=main) ![npm (scoped with tag)](https://img.shields.io/npm/v/@thoughtspot/visual-embed-sdk) [![](https://data.jsdelivr.com/v1/package/npm/@thoughtspot/visual-embed-sdk/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@thoughtspot/visual-embed-sdk)
9
8
 
10
9
  SDK to embed ThoughtSpot into your web apps.
11
10
 
@@ -28,11 +27,16 @@ The SDK is written in TypeScript and is also provided both as ES Module (ESM) an
28
27
  import * as TsEmbedSDK from '@thoughtspot/visual-embed-sdk';
29
28
 
30
29
  // NPM <script>
31
- <script src='https://cdn.jsdelivr.net/npm/@thoughtspot/visual-embed-sdk/dist/tsembed.js'></script>
30
+ <script src="https://cdn.jsdelivr.net/npm/@thoughtspot/visual-embed-sdk/dist/tsembed.js"></script>;
32
31
 
33
32
  // ES6 from web
34
- import { LiveboardEmbed, AuthType, init } from 'https://cdn.jsdelivr.net/npm/@thoughtspot/visual-embed-sdk/dist/tsembed.es.js';
33
+ import {
34
+ LiveboardEmbed,
35
+ AuthType,
36
+ init,
37
+ } from 'https://cdn.jsdelivr.net/npm/@thoughtspot/visual-embed-sdk/dist/tsembed.es.js';
35
38
  ```
39
+
36
40
  <br/>
37
41
 
38
42
  ## Live Playground
@@ -43,8 +47,8 @@ Visit our [code playground](https://try-everywhere.thoughtspot.cloud/v2/#/everyw
43
47
 
44
48
  ## Full API Reference
45
49
 
46
- - Detailed [developer guide](https://try-everywhere.thoughtspot.cloud/v2/#/everywhere/documentation/en/?pageid=getting-started).
47
- - Please visit our [API reference docs](https://developers.thoughtspot.com/docs/typedoc/modules.html).
50
+ - Detailed [developer guide](https://try-everywhere.thoughtspot.cloud/v2/#/everywhere/documentation/en/?pageid=getting-started).
51
+ - Please visit our [API reference docs](https://developers.thoughtspot.com/docs/typedoc/modules.html).
48
52
 
49
53
  <br/>
50
54
 
@@ -55,7 +59,7 @@ liveboards, visualizations or the even full app version.
55
59
 
56
60
  ### Embedded Search
57
61
 
58
- ```js
62
+ ```js
59
63
  // NPM
60
64
  import { SearchEmbed, AuthType, init } from '@thoughtspot/visual-embed-sdk';
61
65
  // or ES6
@@ -117,15 +121,13 @@ init({
117
121
  authType: AuthType.None,
118
122
  });
119
123
 
120
- const appEmbed = new AppEmbed(
121
- document.getElementById('ts-embed'),
122
- {
123
- frameParams: {
124
- width: '100%',
125
- height: '100%',
126
- },
127
- pageId: Page.Data,
128
- });
124
+ const appEmbed = new AppEmbed(document.getElementById('ts-embed'), {
125
+ frameParams: {
126
+ width: '100%',
127
+ height: '100%',
128
+ },
129
+ pageId: Page.Data,
130
+ });
129
131
 
130
132
  appEmbed.render();
131
133
  ```
@@ -136,6 +138,7 @@ All the above flavors of embedding are also provided as React components for you
136
138
  The constructor options are passed as props and the event listeners can be attached using `on<EventName>` convention.
137
139
 
138
140
  ### Search Component
141
+
139
142
  ```js
140
143
  import { init } from '@thoughtspot/visual-embed-sdk';
141
144
  import { SearchEmbed } from '@thoughtspot/visual-embed-sdk/react';
@@ -153,12 +156,39 @@ const MyComponent = ({ dataSources }) => {
153
156
  const onCustomAction = (actionEvent) => {
154
157
  // Do something with actionEvent.
155
158
  };
156
-
157
- return <SearchEmbed dataSources={dataSources} onCustomAction={onCustomAction} />
158
- }
159
+
160
+ return (
161
+ <SearchEmbed
162
+ dataSources={dataSources}
163
+ onCustomAction={onCustomAction}
164
+ />
165
+ );
166
+ };
167
+ ```
168
+
169
+ ### Triggering events on React components
170
+
171
+ ```jsx
172
+ import { HostEvent } from '@thoughtspot/visual-embed-sdk';
173
+ import { LiveboardEmbed, useEmbedRef } from '@thoughtspot/visual-embed-sdk/react';
174
+
175
+ const MyComponent = () => {
176
+ const embedRef = useEmbedRef();
177
+ const onLiveboardRendered = () => {
178
+ embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
179
+ };
180
+
181
+ return (
182
+ <LiveboardEmbed
183
+ ref={embedRef}
184
+ liveboardId="<liveboard-guid>"
185
+ onLiveboardRendered={onLiveboardRendered}
186
+ />
187
+ );
188
+ };
159
189
  ```
160
190
 
161
- ###
191
+ ###
162
192
 
163
193
  <br/>
164
194
  <br/>
@@ -12,7 +12,7 @@ export declare const getAuthPromise: () => Promise<void>;
12
12
  */
13
13
  export declare const prefetch: (url?: string) => void;
14
14
  /**
15
- * Initialize the ThoughtSpot embed settings globally and perform
15
+ * Initialize the ThoughtSpot embed SDK globally and perform
16
16
  * authentication if applicable.
17
17
  * @param embedConfig The configuration object containing ThoughtSpot host,
18
18
  * authentication mechanism and so on.
@@ -51,6 +51,13 @@ export interface LiveboardViewConfig extends ViewConfig {
51
51
  * Liveboard page will be read-only (no X buttons)
52
52
  */
53
53
  preventLiveboardFilterRemoval?: boolean;
54
+ /**
55
+ * Array of viz ids which should be visible when the liveboard
56
+ * first renders. This can be changed by triggering the "SetVisibleVizs"
57
+ * event.
58
+ * @version 1.9.1 or later
59
+ */
60
+ visibleVizs?: string[];
54
61
  /**
55
62
  * To support backward compatibilty
56
63
  * @hidden
@@ -1,16 +1,18 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { SearchViewConfig } from '../embed/search';
3
3
  import { AppViewConfig } from '../embed/app';
4
4
  import { LiveboardViewConfig } from '../embed/liveboard';
5
+ import { TsEmbed } from '../embed/ts-embed';
5
6
  import { EmbedProps } from './util';
6
7
  interface SearchProps extends EmbedProps, SearchViewConfig {
7
8
  }
8
- export declare const SearchEmbed: (props: SearchProps) => JSX.Element;
9
+ export declare const SearchEmbed: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<TsEmbed>>;
9
10
  interface AppProps extends EmbedProps, AppViewConfig {
10
11
  }
11
- export declare const AppEmbed: (props: AppProps) => JSX.Element;
12
+ export declare const AppEmbed: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<TsEmbed>>;
12
13
  interface LiveboardProps extends EmbedProps, LiveboardViewConfig {
13
14
  }
14
- export declare const LiveboardEmbed: (props: LiveboardProps) => JSX.Element;
15
- export declare const PinboardEmbed: (props: LiveboardProps) => JSX.Element;
15
+ export declare const LiveboardEmbed: React.ForwardRefExoticComponent<LiveboardProps & React.RefAttributes<TsEmbed>>;
16
+ export declare const PinboardEmbed: React.ForwardRefExoticComponent<LiveboardProps & React.RefAttributes<TsEmbed>>;
17
+ export declare const useEmbedRef: () => React.MutableRefObject<TsEmbed>;
16
18
  export {};
@@ -1,7 +1,7 @@
1
1
  import { EmbedEvent, MessageCallback } from '../types';
2
2
  import { ViewConfig } from '../embed/ts-embed';
3
3
  export declare type EmbedEventHandlers = {
4
- [key in EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
4
+ [key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
5
5
  };
6
6
  export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
7
7
  className?: string;
@@ -342,7 +342,14 @@ export declare enum EmbedEvent {
342
342
  * Emitted when any modal is closed in the app
343
343
  * @version 1.6.0 or later
344
344
  */
345
- DialogClose = "dialog-close"
345
+ DialogClose = "dialog-close",
346
+ /**
347
+ * Emitted when a liveboard has completed rendering,
348
+ * this event can be used as a hook to trigger events on the
349
+ * rendered liveboard
350
+ * @version 1.9.1 or later
351
+ */
352
+ LiveboardRendered = "PinboardRendered"
346
353
  }
347
354
  /**
348
355
  * Event types that can be triggered by the host application
@@ -440,7 +447,8 @@ export declare enum Param {
440
447
  ViewPortHeight = "viewPortHeight",
441
448
  ViewPortWidth = "viewPortWidth",
442
449
  VisibleActions = "visibleAction",
443
- CustomCSSUrl = "customCssUrl"
450
+ CustomCSSUrl = "customCssUrl",
451
+ visibleVizs = "pinboardVisibleVizs"
444
452
  }
445
453
  /**
446
454
  * The list of actions that can be performed on visual ThoughtSpot
@@ -335,6 +335,13 @@ var EmbedEvent;
335
335
  * @version 1.6.0 or later
336
336
  */
337
337
  EmbedEvent["DialogClose"] = "dialog-close";
338
+ /**
339
+ * Emitted when a liveboard has completed rendering,
340
+ * this event can be used as a hook to trigger events on the
341
+ * rendered liveboard
342
+ * @version 1.9.1 or later
343
+ */
344
+ EmbedEvent["LiveboardRendered"] = "PinboardRendered";
338
345
  })(EmbedEvent || (EmbedEvent = {}));
339
346
  /**
340
347
  * Event types that can be triggered by the host application
@@ -439,6 +446,7 @@ var Param;
439
446
  Param["ViewPortWidth"] = "viewPortWidth";
440
447
  Param["VisibleActions"] = "visibleAction";
441
448
  Param["CustomCSSUrl"] = "customCssUrl";
449
+ Param["visibleVizs"] = "pinboardVisibleVizs";
442
450
  })(Param || (Param = {}));
443
451
  /**
444
452
  * The list of actions that can be performed on visual ThoughtSpot
@@ -8746,7 +8754,7 @@ const prefetch = (url) => {
8746
8754
  }
8747
8755
  };
8748
8756
  /**
8749
- * Initialize the ThoughtSpot embed settings globally and perform
8757
+ * Initialize the ThoughtSpot embed SDK globally and perform
8750
8758
  * authentication if applicable.
8751
8759
  * @param embedConfig The configuration object containing ThoughtSpot host,
8752
8760
  * authentication mechanism and so on.
@@ -8900,7 +8908,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
8900
8908
  }
8901
8909
  }
8902
8910
 
8903
- var name="@thoughtspot/visual-embed-sdk";var version="1.9.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1","mixpanel-browser":"^2.41.0"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
8911
+ var name="@thoughtspot/visual-embed-sdk";var version="1.9.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1","mixpanel-browser":"^2.41.0"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
8904
8912
 
8905
8913
  /**
8906
8914
  * Copyright (c) 2022
@@ -9526,7 +9534,7 @@ class LiveboardEmbed extends V1Embed {
9526
9534
  */
9527
9535
  getEmbedParams() {
9528
9536
  const params = this.getBaseQueryParams();
9529
- const { enableVizTransformations, fullHeight, defaultHeight, } = this.viewConfig;
9537
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, } = this.viewConfig;
9530
9538
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval ||
9531
9539
  this.viewConfig.preventPinboardFilterRemoval;
9532
9540
  if (fullHeight === true) {
@@ -9541,6 +9549,9 @@ class LiveboardEmbed extends V1Embed {
9541
9549
  if (preventLiveboardFilterRemoval) {
9542
9550
  params[Param.preventLiveboardFilterRemoval] = true;
9543
9551
  }
9552
+ if (visibleVizs) {
9553
+ params[Param.visibleVizs] = visibleVizs;
9554
+ }
9544
9555
  params[Param.livedBoardEmbed] = true;
9545
9556
  const queryParams = getQueryParamString(params, true);
9546
9557
  return queryParams;
package/dist/tsembed.js CHANGED
@@ -325,6 +325,13 @@
325
325
  * @version 1.6.0 or later
326
326
  */
327
327
  EmbedEvent["DialogClose"] = "dialog-close";
328
+ /**
329
+ * Emitted when a liveboard has completed rendering,
330
+ * this event can be used as a hook to trigger events on the
331
+ * rendered liveboard
332
+ * @version 1.9.1 or later
333
+ */
334
+ EmbedEvent["LiveboardRendered"] = "PinboardRendered";
328
335
  })(exports.EmbedEvent || (exports.EmbedEvent = {}));
329
336
  (function (HostEvent) {
330
337
  /**
@@ -414,6 +421,7 @@
414
421
  Param["ViewPortWidth"] = "viewPortWidth";
415
422
  Param["VisibleActions"] = "visibleAction";
416
423
  Param["CustomCSSUrl"] = "customCssUrl";
424
+ Param["visibleVizs"] = "pinboardVisibleVizs";
417
425
  })(Param || (Param = {}));
418
426
  (function (Action) {
419
427
  Action["Save"] = "save";
@@ -8715,7 +8723,7 @@
8715
8723
  }
8716
8724
  };
8717
8725
  /**
8718
- * Initialize the ThoughtSpot embed settings globally and perform
8726
+ * Initialize the ThoughtSpot embed SDK globally and perform
8719
8727
  * authentication if applicable.
8720
8728
  * @param embedConfig The configuration object containing ThoughtSpot host,
8721
8729
  * authentication mechanism and so on.
@@ -8869,7 +8877,7 @@
8869
8877
  }
8870
8878
  }
8871
8879
 
8872
- var name="@thoughtspot/visual-embed-sdk";var version="1.9.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports$1={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1","mixpanel-browser":"^2.41.0"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports$1,scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
8880
+ var name="@thoughtspot/visual-embed-sdk";var version="1.9.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports$1={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1","mixpanel-browser":"^2.41.0"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports$1,scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
8873
8881
 
8874
8882
  /**
8875
8883
  * Copyright (c) 2022
@@ -9490,7 +9498,7 @@
9490
9498
  */
9491
9499
  getEmbedParams() {
9492
9500
  const params = this.getBaseQueryParams();
9493
- const { enableVizTransformations, fullHeight, defaultHeight, } = this.viewConfig;
9501
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, } = this.viewConfig;
9494
9502
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval ||
9495
9503
  this.viewConfig.preventPinboardFilterRemoval;
9496
9504
  if (fullHeight === true) {
@@ -9505,6 +9513,9 @@
9505
9513
  if (preventLiveboardFilterRemoval) {
9506
9514
  params[Param.preventLiveboardFilterRemoval] = true;
9507
9515
  }
9516
+ if (visibleVizs) {
9517
+ params[Param.visibleVizs] = visibleVizs;
9518
+ }
9508
9519
  params[Param.livedBoardEmbed] = true;
9509
9520
  const queryParams = getQueryParamString(params, true);
9510
9521
  return queryParams;
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -12,7 +12,7 @@ export declare const getAuthPromise: () => Promise<void>;
12
12
  */
13
13
  export declare const prefetch: (url?: string) => void;
14
14
  /**
15
- * Initialize the ThoughtSpot embed settings globally and perform
15
+ * Initialize the ThoughtSpot embed SDK globally and perform
16
16
  * authentication if applicable.
17
17
  * @param embedConfig The configuration object containing ThoughtSpot host,
18
18
  * authentication mechanism and so on.
@@ -45,7 +45,7 @@ export const prefetch = (url) => {
45
45
  }
46
46
  };
47
47
  /**
48
- * Initialize the ThoughtSpot embed settings globally and perform
48
+ * Initialize the ThoughtSpot embed SDK globally and perform
49
49
  * authentication if applicable.
50
50
  * @param embedConfig The configuration object containing ThoughtSpot host,
51
51
  * authentication mechanism and so on.
@@ -51,6 +51,13 @@ export interface LiveboardViewConfig extends ViewConfig {
51
51
  * Liveboard page will be read-only (no X buttons)
52
52
  */
53
53
  preventLiveboardFilterRemoval?: boolean;
54
+ /**
55
+ * Array of viz ids which should be visible when the liveboard
56
+ * first renders. This can be changed by triggering the "SetVisibleVizs"
57
+ * event.
58
+ * @version 1.9.1 or later
59
+ */
60
+ visibleVizs?: string[];
54
61
  /**
55
62
  * To support backward compatibilty
56
63
  * @hidden
@@ -45,7 +45,7 @@ export class LiveboardEmbed extends V1Embed {
45
45
  */
46
46
  getEmbedParams() {
47
47
  const params = this.getBaseQueryParams();
48
- const { enableVizTransformations, fullHeight, defaultHeight, } = this.viewConfig;
48
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, } = this.viewConfig;
49
49
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval ||
50
50
  this.viewConfig.preventPinboardFilterRemoval;
51
51
  if (fullHeight === true) {
@@ -60,6 +60,9 @@ export class LiveboardEmbed extends V1Embed {
60
60
  if (preventLiveboardFilterRemoval) {
61
61
  params[Param.preventLiveboardFilterRemoval] = true;
62
62
  }
63
+ if (visibleVizs) {
64
+ params[Param.visibleVizs] = visibleVizs;
65
+ }
63
66
  params[Param.livedBoardEmbed] = true;
64
67
  const queryParams = getQueryParamString(params, true);
65
68
  return queryParams;
@@ -1 +1 @@
1
- {"version":3,"file":"liveboard.js","sourceRoot":"","sources":["../../../src/embed/liveboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACH,UAAU,EAEV,KAAK,GAIR,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAc,MAAM,YAAY,CAAC;AAkDjD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,OAAO;IAKvC,kDAAkD;IAClD,YAAY,WAAwB,EAAE,UAA+B;QACjE,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAJ3B,kBAAa,GAAG,GAAG,CAAC;QA0E5B;;;;WAIG;QACK,uBAAkB,GAAG,CAAC,IAAoB,EAAE,EAAE;YAClD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QAClE,CAAC,CAAC;QAEM,sBAAiB,GAAG,CAAC,IAAoB,EAAE,SAAc,EAAE,EAAE;YACjE,MAAM,GAAG,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YACnC,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,iBAAiB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACjE,CAAC,CAAC;QAEM,wCAAmC,GAAG,CAAC,IAAoB,EAAE,EAAE;YACnE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE;gBAClD,IAAI,C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,GAAG,IAAI,KAAK,EAAE,CAAC;SAC3B;QAED,OAAO,GAAG,CAAC;IACf,CAAC;IAsBD;;;;OAIG;IACI,MAAM;;QACT,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAClD,MAAM,WAAW,GACb,MAAA,IAAI,CAAC,UAAU,CAAC,WAAW,mCAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAE9D,IAAI,CAAC,WAAW,EAAE;YACd,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;SAC/D;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,KAAK,IAAI,EAAE;YACrC,IAAI,CAAC,EAAE,CACH,UAAU,CAAC,WAAW,EACtB,IAAI,CAAC,mCAAmC,CAC3C,CAAC;YACF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACzD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;SACjE;QAED,KAAK,CAAC,MAAM,EAAE,CAAC;QAEf,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;CAAG"}
@@ -155,5 +155,16 @@ describe('Liveboard/viz embed tests', () => {
155
155
  expect(onSpy).toHaveBeenCalledWith(EmbedEvent.EmbedHeight, expect.anything());
156
156
  });
157
157
  });
158
+ test('Should set the visible vizs', async () => {
159
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
160
+ ...defaultViewConfig,
161
+ liveboardId,
162
+ visibleVizs: ['abcd', 'pqrs'],
163
+ });
164
+ liveboardEmbed.render();
165
+ await executeAfterWait(() => {
166
+ expect(getIFrameSrc()).toBe(`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&pinboardVisibleVizs=[%22abcd%22,%22pqrs%22]${prefixParams}#/embed/viz/${liveboardId}`);
167
+ });
168
+ });
158
169
  });
159
170
  //# sourceMappingURL=liveboard.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"liveboard.spec.js","sourceRoot":"","sources":["../../../src/embed/liveboard.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EACH,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,SAAS,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,MAAM,iBAAiB,GAAG;IACtB,WAAW,EAAE;QACT,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,GAAG;KACd;CACJ,CAAC;AACF,MAAM,WAAW,GAAG,sCAAsC,CAAC;AAC3D,MAAM,KAAK,GAAG,sCAAsC,CAAC;AACrD,MAAM,eAAe,GAAG,QAAQ,CAAC;AACjC,MAAM,aAAa,GAAG,2EAA2E,OAAO,EAAE,CAAC;AAC3G,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAE9C,SAAS,CAAC,GAAG,EAAE;IACX,IAAI,CAAC;QACD,eAAe;QACf,QAAQ,EAAE,QAAQ,CAAC,IAAI;KAC1B,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACvC,UAAU,CAAC,GAAG,EAAE;QACZ,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,eAAe,EAAE,CAAC;IAChD,C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C,SAAS,EAAE,EAAE;YACnD,GAAG,iBAAiB;YACpB,WAAW;YACX,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;SACT,CAAC,CAAC;QAC1B,cAAc,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,gBAAgB,CAAC,GAAG,EAAE;YACxB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,CACvB,UAAU,eAAe,kBAAkB,aAAa,+CAA+C,YAAY,eAAe,WAAW,EAAE,CAClJ,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,16 +1,18 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { SearchViewConfig } from '../embed/search';
3
3
  import { AppViewConfig } from '../embed/app';
4
4
  import { LiveboardViewConfig } from '../embed/liveboard';
5
+ import { TsEmbed } from '../embed/ts-embed';
5
6
  import { EmbedProps } from './util';
6
7
  interface SearchProps extends EmbedProps, SearchViewConfig {
7
8
  }
8
- export declare const SearchEmbed: (props: SearchProps) => JSX.Element;
9
+ export declare const SearchEmbed: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<TsEmbed>>;
9
10
  interface AppProps extends EmbedProps, AppViewConfig {
10
11
  }
11
- export declare const AppEmbed: (props: AppProps) => JSX.Element;
12
+ export declare const AppEmbed: React.ForwardRefExoticComponent<AppProps & React.RefAttributes<TsEmbed>>;
12
13
  interface LiveboardProps extends EmbedProps, LiveboardViewConfig {
13
14
  }
14
- export declare const LiveboardEmbed: (props: LiveboardProps) => JSX.Element;
15
- export declare const PinboardEmbed: (props: LiveboardProps) => JSX.Element;
15
+ export declare const LiveboardEmbed: React.ForwardRefExoticComponent<LiveboardProps & React.RefAttributes<TsEmbed>>;
16
+ export declare const PinboardEmbed: React.ForwardRefExoticComponent<LiveboardProps & React.RefAttributes<TsEmbed>>;
17
+ export declare const useEmbedRef: () => React.MutableRefObject<TsEmbed>;
16
18
  export {};
@@ -3,7 +3,7 @@ import { SearchEmbed as _SearchEmbed } from '../embed/search';
3
3
  import { AppEmbed as _AppEmbed } from '../embed/app';
4
4
  import { LiveboardEmbed as _LiveboardEmbed, } from '../embed/liveboard';
5
5
  import { getViewPropsAndListeners } from './util';
6
- const componentFactory = (EmbedConstructor) => (props) => {
6
+ const componentFactory = (EmbedConstructor) => React.forwardRef((props, forwardedRef) => {
7
7
  const ref = React.useRef(null);
8
8
  const { className, ...embedProps } = props;
9
9
  const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
@@ -15,11 +15,18 @@ const componentFactory = (EmbedConstructor) => (props) => {
15
15
  tsEmbed.on(eventName, listeners[eventName]);
16
16
  });
17
17
  tsEmbed.render();
18
+ if (forwardedRef) {
19
+ // eslint-disable-next-line no-param-reassign
20
+ forwardedRef.current = tsEmbed;
21
+ }
18
22
  }, [embedProps]);
19
- return React.createElement("div", { "data-testid": "tsEmbed", className: className, ref: ref });
20
- };
23
+ return React.createElement("div", { "data-testid": "tsEmbed", ref: ref });
24
+ });
21
25
  export const SearchEmbed = componentFactory(_SearchEmbed);
22
26
  export const AppEmbed = componentFactory(_AppEmbed);
23
27
  export const LiveboardEmbed = componentFactory(_LiveboardEmbed);
24
28
  export const PinboardEmbed = componentFactory(_LiveboardEmbed);
29
+ export const useEmbedRef = () => {
30
+ return React.useRef(null);
31
+ };
25
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,IAAI,YAAY,EAAoB,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAiB,MAAM,cAAc,CAAC;AACpE,OAAO,EACH,cAAc,IAAI,eAAe,GAEpC,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAc,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAE9D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CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAItC,SAAS,CAAC,CAAC;AAIb,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAI5C,eAAe,CAAC,CAAC;AAEnB,MAAM,CAAC,MAAM,aAAa,GAAG,gBAAgB,CAI3C,eAAe,CAAC,CAAC;AAEnB,MAAM,CAAC,MAAM,WAAW,GAAG,GAAoC,EAAE;IAC7D,OAAO,KAAK,CAAC,MAAM,CAAU,IAAI,CAAC,CAAC;AACvC,CAAC,CAAC"}
@@ -2,10 +2,10 @@ import React from 'react';
2
2
  import '@testing-library/jest-dom';
3
3
  import '@testing-library/jest-dom/extend-expect';
4
4
  import { render, waitFor } from '@testing-library/react';
5
- import { getIFrameEl, getIFrameSrc, postMessageToParent, } from '../test/test-utils';
6
- import { SearchEmbed } from './index';
5
+ import { executeAfterWait, getIFrameEl, getIFrameSrc, postMessageToParent, } from '../test/test-utils';
6
+ import { SearchEmbed, LiveboardEmbed, useEmbedRef } from './index';
7
7
  import { AuthType, init } from '../index';
8
- import { EmbedEvent } from '../types';
8
+ import { EmbedEvent, HostEvent } from '../types';
9
9
  import { version } from '../../package.json';
10
10
  const thoughtSpotHost = 'localhost';
11
11
  beforeAll(() => {
@@ -21,12 +21,13 @@ describe('React Components', () => {
21
21
  await waitFor(() => getIFrameEl(container));
22
22
  expect(getIFrameSrc(container)).toBe(`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&hideAction=[%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&dataSourceMode=hide&useLastSelectedSources=false&isSearchEmbed=true#/embed/answer`);
23
23
  });
24
- it('Should attach event listeners', async () => {
24
+ it('Should attach event listeners', async (done) => {
25
25
  const userGUID = 'absfdfgd';
26
26
  const { container } = render(React.createElement(SearchEmbed, { onInit: (e) => {
27
27
  expect(e.data).toHaveProperty('timestamp');
28
28
  }, onAuthInit: (e) => {
29
29
  expect(e.data.userGUID).toEqual(userGUID);
30
+ done();
30
31
  } }));
31
32
  await waitFor(() => getIFrameEl(container));
32
33
  const iframe = getIFrameEl(container);
@@ -41,8 +42,36 @@ describe('React Components', () => {
41
42
  describe('AppEmbed', () => {
42
43
  //
43
44
  });
44
- describe('PinboardEmbed', () => {
45
+ describe('LiveboardEmbed', () => {
45
46
  //
47
+ it('Should be able to trigger events on the embed using refs', async () => {
48
+ const TestComponent = () => {
49
+ const embedRef = useEmbedRef();
50
+ const onLiveboardRendered = () => {
51
+ embedRef.current.trigger(HostEvent.SetVisibleVizs, [
52
+ 'viz1',
53
+ 'viz2',
54
+ ]);
55
+ };
56
+ return (React.createElement(LiveboardEmbed, { ref: embedRef, liveboardId: "abcd", onLiveboardRendered: onLiveboardRendered }));
57
+ };
58
+ const { container } = render(React.createElement(TestComponent, null));
59
+ await waitFor(() => getIFrameEl(container));
60
+ const iframe = getIFrameEl(container);
61
+ jest.spyOn(iframe.contentWindow, 'postMessage');
62
+ postMessageToParent(iframe.contentWindow, {
63
+ type: EmbedEvent.LiveboardRendered,
64
+ data: {
65
+ userGUID: 'abcd',
66
+ },
67
+ });
68
+ await executeAfterWait(() => {
69
+ expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith({
70
+ type: HostEvent.SetVisibleVizs,
71
+ data: ['viz1', 'viz2'],
72
+ }, `http://${thoughtSpotHost}`);
73
+ });
74
+ });
46
75
  });
47
76
  });
48
77
  //# sourceMappingURL=index.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../src/react/index.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,2BAA2B,CAAC;AACnC,OAAO,yCAAyC,CAAC;AACjD,OAAO,EAAsB,MAAM,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EACH,WAAW,EACX,YAAY,EACZ,mBAAmB,GACtB,MAAM,oBAA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,CAAC,oBAAoB,CACzD;oBACI,IAAI,EAAE,SAAS,CAAC,cAAc;oBAC9B,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;iBACzB,EACD,UAAU,eAAe,EAAE,CAC9B,CAAC;YACN,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { EmbedEvent, MessageCallback } from '../types';
2
2
  import { ViewConfig } from '../embed/ts-embed';
3
3
  export declare type EmbedEventHandlers = {
4
- [key in EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
4
+ [key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
5
5
  };
6
6
  export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
7
7
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/react/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,UAAU,CAAC;AAevD,MAAM,UAAU,wBAAwB,CAA6C,KAAQ;IACzF,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAC5B,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACV,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YACtB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAChC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;SACtD;aAAM;YACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC,EACD;QACI,UAAU,EAAE,EAAO;QACnB,SAAS,EAAE,EAAE;KAChB,CACJ,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/react/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,UAAU,CAAC;AAgBvD,MAAM,UAAU,wBAAwB,CAA6C,KAAQ;IACzF,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAC5B,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE;QACV,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YACtB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAChC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;SACtD;aAAM;YACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC,EACD;QACI,UAAU,EAAE,EAAO;QACnB,SAAS,EAAE,EAAE;KAChB,CACJ,CAAC;AACN,CAAC"}
@@ -342,7 +342,14 @@ export declare enum EmbedEvent {
342
342
  * Emitted when any modal is closed in the app
343
343
  * @version 1.6.0 or later
344
344
  */
345
- DialogClose = "dialog-close"
345
+ DialogClose = "dialog-close",
346
+ /**
347
+ * Emitted when a liveboard has completed rendering,
348
+ * this event can be used as a hook to trigger events on the
349
+ * rendered liveboard
350
+ * @version 1.9.1 or later
351
+ */
352
+ LiveboardRendered = "PinboardRendered"
346
353
  }
347
354
  /**
348
355
  * Event types that can be triggered by the host application
@@ -440,7 +447,8 @@ export declare enum Param {
440
447
  ViewPortHeight = "viewPortHeight",
441
448
  ViewPortWidth = "viewPortWidth",
442
449
  VisibleActions = "visibleAction",
443
- CustomCSSUrl = "customCssUrl"
450
+ CustomCSSUrl = "customCssUrl",
451
+ visibleVizs = "pinboardVisibleVizs"
444
452
  }
445
453
  /**
446
454
  * The list of actions that can be performed on visual ThoughtSpot
package/lib/src/types.js CHANGED
@@ -223,6 +223,13 @@ export var EmbedEvent;
223
223
  * @version 1.6.0 or later
224
224
  */
225
225
  EmbedEvent["DialogClose"] = "dialog-close";
226
+ /**
227
+ * Emitted when a liveboard has completed rendering,
228
+ * this event can be used as a hook to trigger events on the
229
+ * rendered liveboard
230
+ * @version 1.9.1 or later
231
+ */
232
+ EmbedEvent["LiveboardRendered"] = "PinboardRendered";
226
233
  })(EmbedEvent || (EmbedEvent = {}));
227
234
  /**
228
235
  * Event types that can be triggered by the host application
@@ -327,6 +334,7 @@ export var Param;
327
334
  Param["ViewPortWidth"] = "viewPortWidth";
328
335
  Param["VisibleActions"] = "visibleAction";
329
336
  Param["CustomCSSUrl"] = "customCssUrl";
337
+ Param["visibleVizs"] = "pinboardVisibleVizs";
330
338
  })(Param || (Param = {}));
331
339
  /**
332
340
  * The list of actions that can be performed on visual ThoughtSpot
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,QAwBX;AAxBD,WAAY,QAAQ;IAChB;;OAEG;IACH,yBAAa,CAAA;IACb;;OAEG;IACH,4BAAgB,CAAA;IAChB;;OAEG;IACH,6BAAiB,CAAA;IACjB;;OAEG;IACH,qCAAyB,CAAA;IACzB;;;;;OAKG;IACH,2BAAe,CAAA;AACnB,CAAC,EAxBW,QAAQ,KAAR,QAAQ,QAwBnB;AA2HD;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,eAyDX;AAzDD,WAAY,eAAe;IACvB;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,wCAAqB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A+B,CAAA;IAC/B;;OAEG;IACH,qDAA2C,CAAA;IAC3C;;OAEG;IACH,2CAAiC,CAAA;IACjC;;OAEG;IACH,qCAA2B,CAAA;AAC/B,CAAC,EAjFW,MAAM,KAAN,MAAM,QAiFjB;AAQD,qCAAqC;AACrC,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,sDAAqC,CAAA;IACrC,sEAAqD,CAAA;AACzD,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,QAwBX;AAxBD,WAAY,QAAQ;IAChB;;OAEG;IACH,yBAAa,CAAA;IACb;;OAEG;IACH,4BAAgB,CAAA;IAChB;;OAEG;IACH,6BAAiB,CAAA;IACjB;;OAEG;IACH,qCAAyB,CAAA;IACzB;;;;;OAKG;IACH,2BAAe,CAAA;AACnB,CAAC,EAxBW,QAAQ,KAAR,QAAQ,QAwBnB;AA2HD;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,eAyDX;AAzDD,WAAY,eAAe;IACvB;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,wCAAqB,CAAA;IACrB;;OAEG;IACH,8CAA2B,CAAA;IAC3B;;OAEG;IACH,0CAAuB,CAAA;IACvB;;OAEG;IACH,4CAAyB,CAAA;IACzB;;OAEG;IACH,4CAAyB,CAAA;IACzB;;OAEG;IACH,oCAAiB,CAAA;IACjB;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;AACb,CAAC,EAzDW,eAAe,KAAf,eAAe,Q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AAY,aAAa;IACrB,sDAAqC,CAAA;IACrC,sEAAqD,CAAA;AACzD,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
@@ -134,7 +134,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/base' {
134
134
  */
135
135
  export const prefetch: (url?: string) => void;
136
136
  /**
137
- * Initialize the ThoughtSpot embed settings globally and perform
137
+ * Initialize the ThoughtSpot embed SDK globally and perform
138
138
  * authentication if applicable.
139
139
  * @param embedConfig The configuration object containing ThoughtSpot host,
140
140
  * authentication mechanism and so on.
@@ -203,6 +203,13 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
203
203
  * Liveboard page will be read-only (no X buttons)
204
204
  */
205
205
  preventLiveboardFilterRemoval?: boolean;
206
+ /**
207
+ * Array of viz ids which should be visible when the liveboard
208
+ * first renders. This can be changed by triggering the "SetVisibleVizs"
209
+ * event.
210
+ * @version 1.9.1 or later
211
+ */
212
+ visibleVizs?: string[];
206
213
  /**
207
214
  * To support backward compatibilty
208
215
  * @hidden
@@ -665,7 +672,14 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
665
672
  * Emitted when any modal is closed in the app
666
673
  * @version 1.6.0 or later
667
674
  */
668
- DialogClose = "dialog-close"
675
+ DialogClose = "dialog-close",
676
+ /**
677
+ * Emitted when a liveboard has completed rendering,
678
+ * this event can be used as a hook to trigger events on the
679
+ * rendered liveboard
680
+ * @version 1.9.1 or later
681
+ */
682
+ LiveboardRendered = "PinboardRendered"
669
683
  }
670
684
  /**
671
685
  * Event types that can be triggered by the host application
@@ -763,7 +777,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
763
777
  ViewPortHeight = "viewPortHeight",
764
778
  ViewPortWidth = "viewPortWidth",
765
779
  VisibleActions = "visibleAction",
766
- CustomCSSUrl = "customCssUrl"
780
+ CustomCSSUrl = "customCssUrl",
781
+ visibleVizs = "pinboardVisibleVizs"
767
782
  }
768
783
  /**
769
784
  * The list of actions that can be performed on visual ThoughtSpot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
package/src/embed/base.ts CHANGED
@@ -52,7 +52,7 @@ export const prefetch = (url?: string): void => {
52
52
  };
53
53
 
54
54
  /**
55
- * Initialize the ThoughtSpot embed settings globally and perform
55
+ * Initialize the ThoughtSpot embed SDK globally and perform
56
56
  * authentication if applicable.
57
57
  * @param embedConfig The configuration object containing ThoughtSpot host,
58
58
  * authentication mechanism and so on.
@@ -196,4 +196,17 @@ describe('Liveboard/viz embed tests', () => {
196
196
  );
197
197
  });
198
198
  });
199
+ test('Should set the visible vizs', async () => {
200
+ const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
201
+ ...defaultViewConfig,
202
+ liveboardId,
203
+ visibleVizs: ['abcd', 'pqrs'],
204
+ } as LiveboardViewConfig);
205
+ liveboardEmbed.render();
206
+ await executeAfterWait(() => {
207
+ expect(getIFrameSrc()).toBe(
208
+ `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&pinboardVisibleVizs=[%22abcd%22,%22pqrs%22]${prefixParams}#/embed/viz/${liveboardId}`,
209
+ );
210
+ });
211
+ });
199
212
  });
@@ -62,6 +62,13 @@ export interface LiveboardViewConfig extends ViewConfig {
62
62
  * Liveboard page will be read-only (no X buttons)
63
63
  */
64
64
  preventLiveboardFilterRemoval?: boolean;
65
+ /**
66
+ * Array of viz ids which should be visible when the liveboard
67
+ * first renders. This can be changed by triggering the "SetVisibleVizs"
68
+ * event.
69
+ * @version 1.9.1 or later
70
+ */
71
+ visibleVizs?: string[];
65
72
  /**
66
73
  * To support backward compatibilty
67
74
  * @hidden
@@ -93,6 +100,7 @@ export class LiveboardEmbed extends V1Embed {
93
100
  enableVizTransformations,
94
101
  fullHeight,
95
102
  defaultHeight,
103
+ visibleVizs,
96
104
  } = this.viewConfig;
97
105
 
98
106
  const preventLiveboardFilterRemoval =
@@ -113,6 +121,9 @@ export class LiveboardEmbed extends V1Embed {
113
121
  if (preventLiveboardFilterRemoval) {
114
122
  params[Param.preventLiveboardFilterRemoval] = true;
115
123
  }
124
+ if (visibleVizs) {
125
+ params[Param.visibleVizs] = visibleVizs;
126
+ }
116
127
  params[Param.livedBoardEmbed] = true;
117
128
  const queryParams = getQueryParamString(params, true);
118
129
 
@@ -3,13 +3,14 @@ import '@testing-library/jest-dom';
3
3
  import '@testing-library/jest-dom/extend-expect';
4
4
  import { cleanup, fireEvent, render, waitFor } from '@testing-library/react';
5
5
  import {
6
+ executeAfterWait,
6
7
  getIFrameEl,
7
8
  getIFrameSrc,
8
9
  postMessageToParent,
9
10
  } from '../test/test-utils';
10
- import { SearchEmbed, AppEmbed, PinboardEmbed } from './index';
11
+ import { SearchEmbed, AppEmbed, LiveboardEmbed, useEmbedRef } from './index';
11
12
  import { AuthType, init } from '../index';
12
- import { EmbedEvent } from '../types';
13
+ import { EmbedEvent, HostEvent } from '../types';
13
14
  import { version } from '../../package.json';
14
15
 
15
16
  const thoughtSpotHost = 'localhost';
@@ -35,7 +36,7 @@ describe('React Components', () => {
35
36
  );
36
37
  });
37
38
 
38
- it('Should attach event listeners', async () => {
39
+ it('Should attach event listeners', async (done) => {
39
40
  const userGUID = 'absfdfgd';
40
41
  const { container } = render(
41
42
  <SearchEmbed
@@ -44,6 +45,7 @@ describe('React Components', () => {
44
45
  }}
45
46
  onAuthInit={(e) => {
46
47
  expect(e.data.userGUID).toEqual(userGUID);
48
+ done();
47
49
  }}
48
50
  />,
49
51
  );
@@ -63,7 +65,47 @@ describe('React Components', () => {
63
65
  //
64
66
  });
65
67
 
66
- describe('PinboardEmbed', () => {
68
+ describe('LiveboardEmbed', () => {
67
69
  //
70
+ it('Should be able to trigger events on the embed using refs', async () => {
71
+ const TestComponent = () => {
72
+ const embedRef = useEmbedRef();
73
+ const onLiveboardRendered = () => {
74
+ embedRef.current.trigger(HostEvent.SetVisibleVizs, [
75
+ 'viz1',
76
+ 'viz2',
77
+ ]);
78
+ };
79
+
80
+ return (
81
+ <LiveboardEmbed
82
+ ref={embedRef}
83
+ liveboardId="abcd"
84
+ onLiveboardRendered={onLiveboardRendered}
85
+ />
86
+ );
87
+ };
88
+
89
+ const { container } = render(<TestComponent />);
90
+
91
+ await waitFor(() => getIFrameEl(container));
92
+ const iframe = getIFrameEl(container);
93
+ jest.spyOn(iframe.contentWindow, 'postMessage');
94
+ postMessageToParent(iframe.contentWindow, {
95
+ type: EmbedEvent.LiveboardRendered,
96
+ data: {
97
+ userGUID: 'abcd',
98
+ },
99
+ });
100
+ await executeAfterWait(() => {
101
+ expect(iframe.contentWindow.postMessage).toHaveBeenCalledWith(
102
+ {
103
+ type: HostEvent.SetVisibleVizs,
104
+ data: ['viz1', 'viz2'],
105
+ },
106
+ `http://${thoughtSpotHost}`,
107
+ );
108
+ });
109
+ });
68
110
  });
69
111
  });
@@ -7,7 +7,7 @@ import {
7
7
  } from '../embed/liveboard';
8
8
  import { TsEmbed, ViewConfig } from '../embed/ts-embed';
9
9
 
10
- import { EmbedEvent, MessageCallback } from '../types';
10
+ import { EmbedEvent } from '../types';
11
11
  import { EmbedProps, getViewPropsAndListeners } from './util';
12
12
 
13
13
  const componentFactory = <
@@ -16,28 +16,35 @@ const componentFactory = <
16
16
  V extends ViewConfig
17
17
  >(
18
18
  EmbedConstructor: T,
19
- ) => (props: U) => {
20
- const ref = React.useRef<HTMLDivElement>(null);
21
- const { className, ...embedProps } = props;
22
- const { viewConfig, listeners } = getViewPropsAndListeners<
23
- Omit<U, 'className'>,
24
- V
25
- >(embedProps);
26
- React.useEffect(() => {
27
- const tsEmbed = new EmbedConstructor(ref!.current, {
28
- ...viewConfig,
29
- });
30
- Object.keys(listeners).forEach((eventName) => {
31
- tsEmbed.on(
32
- eventName as EmbedEvent,
33
- listeners[eventName as EmbedEvent],
34
- );
35
- });
36
- tsEmbed.render();
37
- }, [embedProps]);
19
+ ) =>
20
+ React.forwardRef<TsEmbed, U>(
21
+ (props: U, forwardedRef: React.MutableRefObject<TsEmbed>) => {
22
+ const ref = React.useRef<HTMLDivElement>(null);
23
+ const { className, ...embedProps } = props;
24
+ const { viewConfig, listeners } = getViewPropsAndListeners<
25
+ Omit<U, 'className'>,
26
+ V
27
+ >(embedProps);
28
+ React.useEffect(() => {
29
+ const tsEmbed = new EmbedConstructor(ref!.current, {
30
+ ...viewConfig,
31
+ });
32
+ Object.keys(listeners).forEach((eventName) => {
33
+ tsEmbed.on(
34
+ eventName as EmbedEvent,
35
+ listeners[eventName as EmbedEvent],
36
+ );
37
+ });
38
+ tsEmbed.render();
39
+ if (forwardedRef) {
40
+ // eslint-disable-next-line no-param-reassign
41
+ forwardedRef.current = tsEmbed;
42
+ }
43
+ }, [embedProps]);
38
44
 
39
- return <div data-testid="tsEmbed" className={className} ref={ref}></div>;
40
- };
45
+ return <div data-testid="tsEmbed" ref={ref}></div>;
46
+ },
47
+ );
41
48
 
42
49
  interface SearchProps extends EmbedProps, SearchViewConfig {}
43
50
 
@@ -68,3 +75,7 @@ export const PinboardEmbed = componentFactory<
68
75
  LiveboardProps,
69
76
  LiveboardViewConfig
70
77
  >(_LiveboardEmbed);
78
+
79
+ export const useEmbedRef = (): React.MutableRefObject<TsEmbed> => {
80
+ return React.useRef<TsEmbed>(null);
81
+ };
package/src/react/util.ts CHANGED
@@ -2,7 +2,8 @@ import { EmbedEvent, MessageCallback } from '../types';
2
2
  import { ViewConfig } from '../embed/ts-embed';
3
3
 
4
4
  // eslint-disable-next-line prettier/prettier
5
- export type EmbedEventHandlers = { [key in EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback };
5
+ export type EmbedEventHandlers = { [key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback };
6
+
6
7
 
7
8
  export interface EmbedProps extends ViewConfig, EmbedEventHandlers {
8
9
  className?: string;
package/src/types.ts CHANGED
@@ -364,6 +364,13 @@ export enum EmbedEvent {
364
364
  * @version 1.6.0 or later
365
365
  */
366
366
  DialogClose = 'dialog-close',
367
+ /**
368
+ * Emitted when a liveboard has completed rendering,
369
+ * this event can be used as a hook to trigger events on the
370
+ * rendered liveboard
371
+ * @version 1.9.1 or later
372
+ */
373
+ LiveboardRendered = 'PinboardRendered',
367
374
  }
368
375
 
369
376
  /**
@@ -468,6 +475,7 @@ export enum Param {
468
475
  ViewPortWidth = 'viewPortWidth',
469
476
  VisibleActions = 'visibleAction',
470
477
  CustomCSSUrl = 'customCssUrl',
478
+ visibleVizs = 'pinboardVisibleVizs',
471
479
  }
472
480
 
473
481
  /**