@thoughtspot/visual-embed-sdk 1.8.0-alpha.2 → 1.8.0-plugins.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/dist/src/embed/pinboard.d.ts +91 -0
- package/dist/src/embed/ts-embed.d.ts +9 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/types.d.ts +27 -2
- package/dist/src/utils/plugin.d.ts +0 -0
- package/dist/src/v1/api.d.ts +19 -0
- package/dist/tsembed.es.js +32 -2
- package/dist/tsembed.js +32 -2
- package/lib/package.json +2 -2
- package/lib/src/embed/pinboard.d.ts +91 -0
- package/lib/src/embed/pinboard.js +110 -0
- package/lib/src/embed/pinboard.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts +9 -1
- package/lib/src/embed/ts-embed.js +13 -0
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/types.d.ts +27 -2
- package/lib/src/types.js +19 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/plugin.d.ts +0 -0
- package/lib/src/utils/plugin.js +1 -0
- package/lib/src/utils/plugin.js.map +1 -0
- package/lib/src/visual-embed-sdk.d.ts +37 -5
- package/package.json +2 -2
- package/src/embed/ts-embed.ts +23 -0
- package/src/index.ts +2 -0
- package/src/types.ts +30 -1
- package/src/utils/plugin.ts +2 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021
|
|
3
|
+
*
|
|
4
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
5
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
6
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
7
|
+
*
|
|
8
|
+
* @summary Pinboard & visualization embed
|
|
9
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
|
+
*/
|
|
11
|
+
import { DOMSelector } from '../types';
|
|
12
|
+
import { V1Embed, ViewConfig } from './ts-embed';
|
|
13
|
+
/**
|
|
14
|
+
* The configuration for the embedded pinboard or visualization page view.
|
|
15
|
+
* @Category Pinboards and Charts
|
|
16
|
+
*/
|
|
17
|
+
export interface PinboardViewConfig extends ViewConfig {
|
|
18
|
+
/**
|
|
19
|
+
* If set to true, the embedded object container dynamically resizes
|
|
20
|
+
* according to the height of the pinboard.
|
|
21
|
+
*/
|
|
22
|
+
fullHeight?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* This is the minimum height(in pixels) for a full height pinboard.
|
|
25
|
+
* Setting this height helps resolves issues with empty pinboards and
|
|
26
|
+
* other screens navigable from a pinboard.
|
|
27
|
+
* @default 500
|
|
28
|
+
* * _since 1.5.0_
|
|
29
|
+
*/
|
|
30
|
+
defaultHeight?: number;
|
|
31
|
+
/**
|
|
32
|
+
* If set to true, the context menu in visualizations will be enabled.
|
|
33
|
+
*/
|
|
34
|
+
enableVizTransformations?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The pinboard to display in the embedded view.
|
|
37
|
+
*/
|
|
38
|
+
pinboardId: string;
|
|
39
|
+
/**
|
|
40
|
+
* The visualization within the pinboard to display.
|
|
41
|
+
*/
|
|
42
|
+
vizId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* If set to true, all filter chips from a
|
|
45
|
+
* pinboard page will be read-only (no X buttons)
|
|
46
|
+
*/
|
|
47
|
+
preventPinboardFilterRemoval?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* An array of vizids which should be visible when this pinboard loads.
|
|
50
|
+
* The ids not in this array are hidden from the pinboard.
|
|
51
|
+
* _since: 1.6.0_
|
|
52
|
+
*/
|
|
53
|
+
pinboardVisibleVizs?: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
57
|
+
* @Category Pinboards and Charts
|
|
58
|
+
*/
|
|
59
|
+
export declare class PinboardEmbed extends V1Embed {
|
|
60
|
+
protected viewConfig: PinboardViewConfig;
|
|
61
|
+
private defaultHeight;
|
|
62
|
+
constructor(domSelector: DOMSelector, viewConfig: PinboardViewConfig);
|
|
63
|
+
/**
|
|
64
|
+
* Construct a map of params to be passed on to the
|
|
65
|
+
* embedded pinboard or visualization.
|
|
66
|
+
*/
|
|
67
|
+
private getEmbedParams;
|
|
68
|
+
/**
|
|
69
|
+
* Construct the URL of the embedded ThoughtSpot pinboard or visualization
|
|
70
|
+
* to be loaded within the iframe.
|
|
71
|
+
* @param pinboardId The GUID of the pinboard.
|
|
72
|
+
* @param vizId The optional GUID of a visualization within the pinboard.
|
|
73
|
+
* @param runtimeFilters A list of runtime filters to be applied to
|
|
74
|
+
* the pinboard or visualization on load.
|
|
75
|
+
*/
|
|
76
|
+
private getIFrameSrc;
|
|
77
|
+
/**
|
|
78
|
+
* Set the iframe height as per the computed height received
|
|
79
|
+
* from the ThoughtSpot app.
|
|
80
|
+
* @param data The event payload
|
|
81
|
+
*/
|
|
82
|
+
private updateIFrameHeight;
|
|
83
|
+
private embedIframeCenter;
|
|
84
|
+
private handleRouteChangeFullHeightPinboard;
|
|
85
|
+
/**
|
|
86
|
+
* Render an embedded ThoughtSpot pinboard or visualization
|
|
87
|
+
* @param renderOptions An object specifying the pinboard ID,
|
|
88
|
+
* visualization ID and the runtime filters.
|
|
89
|
+
*/
|
|
90
|
+
render(): PinboardEmbed;
|
|
91
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @summary Base classes
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig } from '../types';
|
|
9
|
+
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig, Plugin } from '../types';
|
|
10
10
|
export interface LayoutConfig {
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -76,6 +76,13 @@ export interface ViewConfig {
|
|
|
76
76
|
additionalFlags?: {
|
|
77
77
|
[key: string]: string | number | boolean;
|
|
78
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Provide a list of plugins, the plugins are executed in the order
|
|
81
|
+
* provided below,
|
|
82
|
+
*
|
|
83
|
+
* @version alpha
|
|
84
|
+
*/
|
|
85
|
+
plugins?: Plugin[];
|
|
79
86
|
}
|
|
80
87
|
/**
|
|
81
88
|
* Base class for embedding v2 experience
|
|
@@ -121,6 +128,7 @@ export declare class TsEmbed {
|
|
|
121
128
|
*/
|
|
122
129
|
private shouldEncodeUrlQueryParams;
|
|
123
130
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
131
|
+
private registerPlugins;
|
|
124
132
|
/**
|
|
125
133
|
* Gets a reference to the root DOM node where
|
|
126
134
|
* the embedded content will appear.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ import { AppEmbed, Page, AppViewConfig } from './embed/app';
|
|
|
11
11
|
import { init, prefetch } from './embed/base';
|
|
12
12
|
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from './embed/liveboard';
|
|
13
13
|
import { SearchEmbed, SearchViewConfig } from './embed/search';
|
|
14
|
-
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig } from './types';
|
|
15
|
-
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, };
|
|
14
|
+
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, Plugin } from './types';
|
|
15
|
+
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, Plugin, };
|
package/dist/src/types.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ export interface EmbedConfig {
|
|
|
122
122
|
queueMultiRenders?: boolean;
|
|
123
123
|
/**
|
|
124
124
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
125
|
+
* You would also need to set `style-src` in the CSP settings.
|
|
125
126
|
* @version 1.6.0 or later
|
|
126
127
|
* @default ''
|
|
127
128
|
*/
|
|
@@ -273,12 +274,24 @@ export declare enum EmbedEvent {
|
|
|
273
274
|
* @return data - The answer or Liveboard data
|
|
274
275
|
*/
|
|
275
276
|
CustomAction = "customAction",
|
|
277
|
+
/**
|
|
278
|
+
* A click has been triggered on table/chart
|
|
279
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
280
|
+
* @version 1.10.0
|
|
281
|
+
*/
|
|
282
|
+
VizPointClick = "vizPointClick",
|
|
276
283
|
/**
|
|
277
284
|
* A double click has been triggered on table/chart
|
|
278
285
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
279
286
|
* @version 1.5.0 or later
|
|
280
287
|
*/
|
|
281
288
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
289
|
+
/**
|
|
290
|
+
* Event troggered when rendering a chart, call the supplied
|
|
291
|
+
* callback with the config overrides.
|
|
292
|
+
* @version 1.10.0
|
|
293
|
+
*/
|
|
294
|
+
GetVizConfigOverrides = "getVizConfigOverrides",
|
|
282
295
|
/**
|
|
283
296
|
* An error has occurred.
|
|
284
297
|
* @return error - An error object or message
|
|
@@ -379,11 +392,17 @@ export declare enum HostEvent {
|
|
|
379
392
|
*/
|
|
380
393
|
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
381
394
|
/**
|
|
382
|
-
* Update the runtime filters
|
|
395
|
+
* Update the runtime filters. The runtime filters passed here are extended
|
|
396
|
+
* on to the existing runtime filters if they exist.
|
|
383
397
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
384
398
|
* @version 1.8.0 or later
|
|
385
399
|
*/
|
|
386
|
-
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
400
|
+
UpdateRuntimeFilters = "UpdateRuntimeFilters",
|
|
401
|
+
/**
|
|
402
|
+
* Highlight the point in the chart defined by the InputPoint passed.
|
|
403
|
+
* @verion 1.10.0
|
|
404
|
+
*/
|
|
405
|
+
HighlightPoint = "HighlightPoint"
|
|
387
406
|
}
|
|
388
407
|
/**
|
|
389
408
|
* The different visual modes that the data sources panel within
|
|
@@ -535,3 +554,9 @@ export declare enum OperationType {
|
|
|
535
554
|
export interface AnswerServiceType {
|
|
536
555
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
537
556
|
}
|
|
557
|
+
export interface Plugin {
|
|
558
|
+
name: string;
|
|
559
|
+
handlers: {
|
|
560
|
+
[key in EmbedEvent]: (payload: any) => void;
|
|
561
|
+
};
|
|
562
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright: ThoughtSpot Inc. 2012-2016
|
|
3
|
+
* Author: Shashank Singh (sunny@thoughtspot.com)
|
|
4
|
+
*
|
|
5
|
+
* @fileoverview ThoughtSpot Javascript API for use of ThoughtSpot in external webpages.
|
|
6
|
+
*/
|
|
7
|
+
import { AuthType } from '../types';
|
|
8
|
+
export declare enum Events {
|
|
9
|
+
THOUGHTSPOT_AUTH_EXPIRED = "ThoughtspotAuthExpired",
|
|
10
|
+
EXPORT_VIZ_DATA_TO_PARENT = "exportVizDataToParent",
|
|
11
|
+
ALERT = "alert",
|
|
12
|
+
EXPORT_VIZ_DATA_TO_CHILD = "exportVizDataToChild",
|
|
13
|
+
GET_DATA = "getData"
|
|
14
|
+
}
|
|
15
|
+
declare type Callback = (...args: any[]) => void;
|
|
16
|
+
declare function checkIfLoggedIn(tsHost: string, callback: Callback): void;
|
|
17
|
+
declare function initialize(onInitialized: Callback, onAuthExpiration: Callback, _thoughtspotHost: string, authType: AuthType): void;
|
|
18
|
+
declare function notifyOnAuthExpiration(): void;
|
|
19
|
+
export { initialize, checkIfLoggedIn, notifyOnAuthExpiration };
|
package/dist/tsembed.es.js
CHANGED
|
@@ -271,12 +271,24 @@ var EmbedEvent;
|
|
|
271
271
|
* @return data - The answer or Liveboard data
|
|
272
272
|
*/
|
|
273
273
|
EmbedEvent["CustomAction"] = "customAction";
|
|
274
|
+
/**
|
|
275
|
+
* A click has been triggered on table/chart
|
|
276
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
277
|
+
* @version 1.10.0
|
|
278
|
+
*/
|
|
279
|
+
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
274
280
|
/**
|
|
275
281
|
* A double click has been triggered on table/chart
|
|
276
282
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
277
283
|
* @version 1.5.0 or later
|
|
278
284
|
*/
|
|
279
285
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
286
|
+
/**
|
|
287
|
+
* Event troggered when rendering a chart, call the supplied
|
|
288
|
+
* callback with the config overrides.
|
|
289
|
+
* @version 1.10.0
|
|
290
|
+
*/
|
|
291
|
+
EmbedEvent["GetVizConfigOverrides"] = "getVizConfigOverrides";
|
|
280
292
|
/**
|
|
281
293
|
* An error has occurred.
|
|
282
294
|
* @return error - An error object or message
|
|
@@ -379,11 +391,17 @@ var HostEvent;
|
|
|
379
391
|
*/
|
|
380
392
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
381
393
|
/**
|
|
382
|
-
* Update the runtime filters
|
|
394
|
+
* Update the runtime filters. The runtime filters passed here are extended
|
|
395
|
+
* on to the existing runtime filters if they exist.
|
|
383
396
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
384
397
|
* @version 1.8.0 or later
|
|
385
398
|
*/
|
|
386
399
|
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
400
|
+
/**
|
|
401
|
+
* Highlight the point in the chart defined by the InputPoint passed.
|
|
402
|
+
* @verion 1.10.0
|
|
403
|
+
*/
|
|
404
|
+
HostEvent["HighlightPoint"] = "HighlightPoint";
|
|
387
405
|
})(HostEvent || (HostEvent = {}));
|
|
388
406
|
/**
|
|
389
407
|
* The different visual modes that the data sources panel within
|
|
@@ -8894,7 +8912,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
8894
8912
|
}
|
|
8895
8913
|
}
|
|
8896
8914
|
|
|
8897
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.8.0-
|
|
8915
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.8.0-plugins.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 plugins","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};
|
|
8898
8916
|
|
|
8899
8917
|
/**
|
|
8900
8918
|
* Copyright (c) 2022
|
|
@@ -8937,6 +8955,7 @@ class TsEmbed {
|
|
|
8937
8955
|
this.isError = false;
|
|
8938
8956
|
this.viewConfig = viewConfig;
|
|
8939
8957
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
8958
|
+
this.registerPlugins(viewConfig === null || viewConfig === void 0 ? void 0 : viewConfig.plugins);
|
|
8940
8959
|
if (!this.embedConfig.suppressNoCookieAccessAlert) {
|
|
8941
8960
|
this.on(EmbedEvent.NoCookieAccess, () => {
|
|
8942
8961
|
// eslint-disable-next-line no-alert
|
|
@@ -8944,6 +8963,17 @@ class TsEmbed {
|
|
|
8944
8963
|
});
|
|
8945
8964
|
}
|
|
8946
8965
|
}
|
|
8966
|
+
registerPlugins(plugins) {
|
|
8967
|
+
if (!plugins) {
|
|
8968
|
+
return;
|
|
8969
|
+
}
|
|
8970
|
+
plugins.forEach((plugin) => {
|
|
8971
|
+
Object.keys(plugin.handlers).forEach((eventName) => {
|
|
8972
|
+
const listener = plugin[eventName];
|
|
8973
|
+
this.on(eventName, listener);
|
|
8974
|
+
});
|
|
8975
|
+
});
|
|
8976
|
+
}
|
|
8947
8977
|
/**
|
|
8948
8978
|
* Gets a reference to the root DOM node where
|
|
8949
8979
|
* the embedded content will appear.
|
package/dist/tsembed.js
CHANGED
|
@@ -261,12 +261,24 @@
|
|
|
261
261
|
* @return data - The answer or Liveboard data
|
|
262
262
|
*/
|
|
263
263
|
EmbedEvent["CustomAction"] = "customAction";
|
|
264
|
+
/**
|
|
265
|
+
* A click has been triggered on table/chart
|
|
266
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
267
|
+
* @version 1.10.0
|
|
268
|
+
*/
|
|
269
|
+
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
264
270
|
/**
|
|
265
271
|
* A double click has been triggered on table/chart
|
|
266
272
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
267
273
|
* @version 1.5.0 or later
|
|
268
274
|
*/
|
|
269
275
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
276
|
+
/**
|
|
277
|
+
* Event troggered when rendering a chart, call the supplied
|
|
278
|
+
* callback with the config overrides.
|
|
279
|
+
* @version 1.10.0
|
|
280
|
+
*/
|
|
281
|
+
EmbedEvent["GetVizConfigOverrides"] = "getVizConfigOverrides";
|
|
270
282
|
/**
|
|
271
283
|
* An error has occurred.
|
|
272
284
|
* @return error - An error object or message
|
|
@@ -360,11 +372,17 @@
|
|
|
360
372
|
*/
|
|
361
373
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
362
374
|
/**
|
|
363
|
-
* Update the runtime filters
|
|
375
|
+
* Update the runtime filters. The runtime filters passed here are extended
|
|
376
|
+
* on to the existing runtime filters if they exist.
|
|
364
377
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
365
378
|
* @version 1.8.0 or later
|
|
366
379
|
*/
|
|
367
380
|
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
381
|
+
/**
|
|
382
|
+
* Highlight the point in the chart defined by the InputPoint passed.
|
|
383
|
+
* @verion 1.10.0
|
|
384
|
+
*/
|
|
385
|
+
HostEvent["HighlightPoint"] = "HighlightPoint";
|
|
368
386
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
369
387
|
(function (DataSourceVisualMode) {
|
|
370
388
|
/**
|
|
@@ -8863,7 +8881,7 @@
|
|
|
8863
8881
|
}
|
|
8864
8882
|
}
|
|
8865
8883
|
|
|
8866
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.8.0-
|
|
8884
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.8.0-plugins.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 plugins","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};
|
|
8867
8885
|
|
|
8868
8886
|
/**
|
|
8869
8887
|
* Copyright (c) 2022
|
|
@@ -8906,6 +8924,7 @@
|
|
|
8906
8924
|
this.isError = false;
|
|
8907
8925
|
this.viewConfig = viewConfig;
|
|
8908
8926
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
8927
|
+
this.registerPlugins(viewConfig === null || viewConfig === void 0 ? void 0 : viewConfig.plugins);
|
|
8909
8928
|
if (!this.embedConfig.suppressNoCookieAccessAlert) {
|
|
8910
8929
|
this.on(exports.EmbedEvent.NoCookieAccess, () => {
|
|
8911
8930
|
// eslint-disable-next-line no-alert
|
|
@@ -8913,6 +8932,17 @@
|
|
|
8913
8932
|
});
|
|
8914
8933
|
}
|
|
8915
8934
|
}
|
|
8935
|
+
registerPlugins(plugins) {
|
|
8936
|
+
if (!plugins) {
|
|
8937
|
+
return;
|
|
8938
|
+
}
|
|
8939
|
+
plugins.forEach((plugin) => {
|
|
8940
|
+
Object.keys(plugin.handlers).forEach((eventName) => {
|
|
8941
|
+
const listener = plugin[eventName];
|
|
8942
|
+
this.on(eventName, listener);
|
|
8943
|
+
});
|
|
8944
|
+
});
|
|
8945
|
+
}
|
|
8916
8946
|
/**
|
|
8917
8947
|
* Gets a reference to the root DOM node where
|
|
8918
8948
|
* the embedded content will appear.
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.8.0-
|
|
3
|
+
"version": "1.8.0-plugins.2",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"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",
|
|
35
35
|
"posttest": "cat ./coverage/lcov.info | coveralls",
|
|
36
36
|
"prepublishOnly": "npm run test; npm run tsc; npm run bundle-dts; npm run build",
|
|
37
|
-
"publish-dev": "npm publish --tag
|
|
37
|
+
"publish-dev": "npm publish --tag plugins",
|
|
38
38
|
"publish-prod": "npm publish --tag latest"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021
|
|
3
|
+
*
|
|
4
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
5
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
6
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
7
|
+
*
|
|
8
|
+
* @summary Pinboard & visualization embed
|
|
9
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
|
+
*/
|
|
11
|
+
import { DOMSelector } from '../types';
|
|
12
|
+
import { V1Embed, ViewConfig } from './ts-embed';
|
|
13
|
+
/**
|
|
14
|
+
* The configuration for the embedded pinboard or visualization page view.
|
|
15
|
+
* @Category Pinboards and Charts
|
|
16
|
+
*/
|
|
17
|
+
export interface PinboardViewConfig extends ViewConfig {
|
|
18
|
+
/**
|
|
19
|
+
* If set to true, the embedded object container dynamically resizes
|
|
20
|
+
* according to the height of the pinboard.
|
|
21
|
+
*/
|
|
22
|
+
fullHeight?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* This is the minimum height(in pixels) for a full height pinboard.
|
|
25
|
+
* Setting this height helps resolves issues with empty pinboards and
|
|
26
|
+
* other screens navigable from a pinboard.
|
|
27
|
+
* @default 500
|
|
28
|
+
* * _since 1.5.0_
|
|
29
|
+
*/
|
|
30
|
+
defaultHeight?: number;
|
|
31
|
+
/**
|
|
32
|
+
* If set to true, the context menu in visualizations will be enabled.
|
|
33
|
+
*/
|
|
34
|
+
enableVizTransformations?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The pinboard to display in the embedded view.
|
|
37
|
+
*/
|
|
38
|
+
pinboardId: string;
|
|
39
|
+
/**
|
|
40
|
+
* The visualization within the pinboard to display.
|
|
41
|
+
*/
|
|
42
|
+
vizId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* If set to true, all filter chips from a
|
|
45
|
+
* pinboard page will be read-only (no X buttons)
|
|
46
|
+
*/
|
|
47
|
+
preventPinboardFilterRemoval?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* An array of vizids which should be visible when this pinboard loads.
|
|
50
|
+
* The ids not in this array are hidden from the pinboard.
|
|
51
|
+
* _since: 1.6.0_
|
|
52
|
+
*/
|
|
53
|
+
pinboardVisibleVizs?: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
57
|
+
* @Category Pinboards and Charts
|
|
58
|
+
*/
|
|
59
|
+
export declare class PinboardEmbed extends V1Embed {
|
|
60
|
+
protected viewConfig: PinboardViewConfig;
|
|
61
|
+
private defaultHeight;
|
|
62
|
+
constructor(domSelector: DOMSelector, viewConfig: PinboardViewConfig);
|
|
63
|
+
/**
|
|
64
|
+
* Construct a map of params to be passed on to the
|
|
65
|
+
* embedded pinboard or visualization.
|
|
66
|
+
*/
|
|
67
|
+
private getEmbedParams;
|
|
68
|
+
/**
|
|
69
|
+
* Construct the URL of the embedded ThoughtSpot pinboard or visualization
|
|
70
|
+
* to be loaded within the iframe.
|
|
71
|
+
* @param pinboardId The GUID of the pinboard.
|
|
72
|
+
* @param vizId The optional GUID of a visualization within the pinboard.
|
|
73
|
+
* @param runtimeFilters A list of runtime filters to be applied to
|
|
74
|
+
* the pinboard or visualization on load.
|
|
75
|
+
*/
|
|
76
|
+
private getIFrameSrc;
|
|
77
|
+
/**
|
|
78
|
+
* Set the iframe height as per the computed height received
|
|
79
|
+
* from the ThoughtSpot app.
|
|
80
|
+
* @param data The event payload
|
|
81
|
+
*/
|
|
82
|
+
private updateIFrameHeight;
|
|
83
|
+
private embedIframeCenter;
|
|
84
|
+
private handleRouteChangeFullHeightPinboard;
|
|
85
|
+
/**
|
|
86
|
+
* Render an embedded ThoughtSpot pinboard or visualization
|
|
87
|
+
* @param renderOptions An object specifying the pinboard ID,
|
|
88
|
+
* visualization ID and the runtime filters.
|
|
89
|
+
*/
|
|
90
|
+
render(): PinboardEmbed;
|
|
91
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021
|
|
3
|
+
*
|
|
4
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
5
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
6
|
+
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
7
|
+
*
|
|
8
|
+
* @summary Pinboard & visualization embed
|
|
9
|
+
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
|
+
*/
|
|
11
|
+
import { ERROR_MESSAGE } from '../errors';
|
|
12
|
+
import { EmbedEvent, Param, } from '../types';
|
|
13
|
+
import { getFilterQuery, getQueryParamString } from '../utils';
|
|
14
|
+
import { V1Embed } from './ts-embed';
|
|
15
|
+
/**
|
|
16
|
+
* Embed a ThoughtSpot pinboard or visualization
|
|
17
|
+
* @Category Pinboards and Charts
|
|
18
|
+
*/
|
|
19
|
+
export class PinboardEmbed extends V1Embed {
|
|
20
|
+
// eslint-disable-next-line no-useless-constructor
|
|
21
|
+
constructor(domSelector, viewConfig) {
|
|
22
|
+
super(domSelector, viewConfig);
|
|
23
|
+
this.defaultHeight = 500;
|
|
24
|
+
/**
|
|
25
|
+
* Set the iframe height as per the computed height received
|
|
26
|
+
* from the ThoughtSpot app.
|
|
27
|
+
* @param data The event payload
|
|
28
|
+
*/
|
|
29
|
+
this.updateIFrameHeight = (data) => {
|
|
30
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
31
|
+
};
|
|
32
|
+
this.embedIframeCenter = (data, responder) => {
|
|
33
|
+
const obj = this.getIframeCenter();
|
|
34
|
+
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
35
|
+
};
|
|
36
|
+
this.handleRouteChangeFullHeightPinboard = (data) => {
|
|
37
|
+
if (data.data.canvasState !== 'EMBED' &&
|
|
38
|
+
data.data.canvasState !== 'pinboard') {
|
|
39
|
+
this.setIFrameHeight(this.defaultHeight);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Construct a map of params to be passed on to the
|
|
45
|
+
* embedded pinboard or visualization.
|
|
46
|
+
*/
|
|
47
|
+
getEmbedParams() {
|
|
48
|
+
const params = this.getBaseQueryParams();
|
|
49
|
+
const { enableVizTransformations, fullHeight, preventPinboardFilterRemoval, defaultHeight, pinboardVisibleVizs, } = this.viewConfig;
|
|
50
|
+
if (fullHeight === true) {
|
|
51
|
+
params[Param.fullHeight] = true;
|
|
52
|
+
}
|
|
53
|
+
if (defaultHeight) {
|
|
54
|
+
this.defaultHeight = defaultHeight;
|
|
55
|
+
}
|
|
56
|
+
if (enableVizTransformations !== undefined) {
|
|
57
|
+
params[Param.EnableVizTransformations] = enableVizTransformations.toString();
|
|
58
|
+
}
|
|
59
|
+
if (preventPinboardFilterRemoval) {
|
|
60
|
+
params[Param.preventPinboardFilterRemoval] = true;
|
|
61
|
+
}
|
|
62
|
+
if (pinboardVisibleVizs) {
|
|
63
|
+
params[Param.PinboardVisibleVizs] = pinboardVisibleVizs;
|
|
64
|
+
}
|
|
65
|
+
params[Param.livedBoardEmbed] = true;
|
|
66
|
+
const queryParams = getQueryParamString(params, true);
|
|
67
|
+
return queryParams;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Construct the URL of the embedded ThoughtSpot pinboard or visualization
|
|
71
|
+
* to be loaded within the iframe.
|
|
72
|
+
* @param pinboardId The GUID of the pinboard.
|
|
73
|
+
* @param vizId The optional GUID of a visualization within the pinboard.
|
|
74
|
+
* @param runtimeFilters A list of runtime filters to be applied to
|
|
75
|
+
* the pinboard or visualization on load.
|
|
76
|
+
*/
|
|
77
|
+
getIFrameSrc(pinboardId, vizId, runtimeFilters) {
|
|
78
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
79
|
+
const queryParams = this.getEmbedParams();
|
|
80
|
+
const queryString = [filterQuery, queryParams]
|
|
81
|
+
.filter(Boolean)
|
|
82
|
+
.join('&');
|
|
83
|
+
let url = `${this.getV1EmbedBasePath(queryString, true, false, false)}/viz/${pinboardId}`;
|
|
84
|
+
if (vizId) {
|
|
85
|
+
url = `${url}/${vizId}`;
|
|
86
|
+
}
|
|
87
|
+
return url;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Render an embedded ThoughtSpot pinboard or visualization
|
|
91
|
+
* @param renderOptions An object specifying the pinboard ID,
|
|
92
|
+
* visualization ID and the runtime filters.
|
|
93
|
+
*/
|
|
94
|
+
render() {
|
|
95
|
+
const { pinboardId, vizId, runtimeFilters } = this.viewConfig;
|
|
96
|
+
if (!pinboardId && !vizId) {
|
|
97
|
+
this.handleError(ERROR_MESSAGE.PINBOARD_VIZ_ID_VALIDATION);
|
|
98
|
+
}
|
|
99
|
+
if (this.viewConfig.fullHeight === true) {
|
|
100
|
+
this.on(EmbedEvent.RouteChange, this.handleRouteChangeFullHeightPinboard);
|
|
101
|
+
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
102
|
+
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
103
|
+
}
|
|
104
|
+
super.render();
|
|
105
|
+
const src = this.getIFrameSrc(pinboardId, vizId, runtimeFilters);
|
|
106
|
+
this.renderV1Embed(src);
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=pinboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pinboard.js","sourceRoot":"","sources":["../../../src/embed/pinboard.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,U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AAC,KAAK,EAAE;YACvB,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;SAC9D;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,UAAU,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;QACjE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @summary Base classes
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig } from '../types';
|
|
9
|
+
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig, Plugin } from '../types';
|
|
10
10
|
export interface LayoutConfig {
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -76,6 +76,13 @@ export interface ViewConfig {
|
|
|
76
76
|
additionalFlags?: {
|
|
77
77
|
[key: string]: string | number | boolean;
|
|
78
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Provide a list of plugins, the plugins are executed in the order
|
|
81
|
+
* provided below,
|
|
82
|
+
*
|
|
83
|
+
* @version alpha
|
|
84
|
+
*/
|
|
85
|
+
plugins?: Plugin[];
|
|
79
86
|
}
|
|
80
87
|
/**
|
|
81
88
|
* Base class for embedding v2 experience
|
|
@@ -121,6 +128,7 @@ export declare class TsEmbed {
|
|
|
121
128
|
*/
|
|
122
129
|
private shouldEncodeUrlQueryParams;
|
|
123
130
|
constructor(domSelector: DOMSelector, viewConfig?: ViewConfig);
|
|
131
|
+
private registerPlugins;
|
|
124
132
|
/**
|
|
125
133
|
* Gets a reference to the root DOM node where
|
|
126
134
|
* the embedded content will appear.
|
|
@@ -12,6 +12,7 @@ import { EmbedEvent, Param, } from '../types';
|
|
|
12
12
|
import { uploadMixpanelEvent, MIXPANEL_EVENT } from '../mixpanel-service';
|
|
13
13
|
import { getProcessData } from '../utils/processData';
|
|
14
14
|
import { processTrigger } from '../utils/processTrigger';
|
|
15
|
+
// eslint-disable-next-line import/no-cycle
|
|
15
16
|
import pkgInfo from '../../package.json';
|
|
16
17
|
import { getAuthPromise, getEmbedConfig, renderInQueue } from './base';
|
|
17
18
|
const { version } = pkgInfo;
|
|
@@ -47,6 +48,7 @@ export class TsEmbed {
|
|
|
47
48
|
this.isError = false;
|
|
48
49
|
this.viewConfig = viewConfig;
|
|
49
50
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
51
|
+
this.registerPlugins(viewConfig === null || viewConfig === void 0 ? void 0 : viewConfig.plugins);
|
|
50
52
|
if (!this.embedConfig.suppressNoCookieAccessAlert) {
|
|
51
53
|
this.on(EmbedEvent.NoCookieAccess, () => {
|
|
52
54
|
// eslint-disable-next-line no-alert
|
|
@@ -54,6 +56,17 @@ export class TsEmbed {
|
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
}
|
|
59
|
+
registerPlugins(plugins) {
|
|
60
|
+
if (!plugins) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
plugins.forEach((plugin) => {
|
|
64
|
+
Object.keys(plugin.handlers).forEach((eventName) => {
|
|
65
|
+
const listener = plugin[eventName];
|
|
66
|
+
this.on(eventName, listener);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
57
70
|
/**
|
|
58
71
|
* Gets a reference to the root DOM node where
|
|
59
72
|
* the embedded content will appear.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-embed.js","sourceRoot":"","sources":["../../../src/embed/ts-embed.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACH,2BAA2B,EAC3B,eAAe,EACf,YAAY,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EACH,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EAGH,UAAU,EAIV,KAAK,GAER,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,UAAU,GAAG;IACf,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;CACzC,CAAC;AA0EF;;;;GAIG;AACH,MAAM,OAAO,OAAO;IAmDhB,YAAY,WAAwB,EAAE,UAAuB;QAR7D;;;;;WAKG;QACK,+BAA0B,GAAG,KAAK,CAAC;QAGvC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACvC,qBAAqB;QACrB,IAAI,CAAC,WAAW,GAAG,cAAc,EAAE,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,kBAAkB,C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AAC;QACF,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACI,MAAM;QACT,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAEvB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED;;;;GAIG;AACH,MAAM,OAAO,OAAQ,SAAQ,OAAO;IAGhC,YAAY,WAAwB,EAAE,UAAsB;QACxD,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,SAAiB;QACrC,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;IAED,YAAY;IACL,EAAE,CACL,WAAuB,EACvB,QAAyB;QAEzB,MAAM,SAAS,GAAG,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAE3D,OAAO,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;CACJ"}
|
package/lib/src/index.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ import { AppEmbed, Page, AppViewConfig } from './embed/app';
|
|
|
11
11
|
import { init, prefetch } from './embed/base';
|
|
12
12
|
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from './embed/liveboard';
|
|
13
13
|
import { SearchEmbed, SearchViewConfig } from './embed/search';
|
|
14
|
-
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig } from './types';
|
|
15
|
-
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, };
|
|
14
|
+
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, Plugin } from './types';
|
|
15
|
+
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, Plugin, };
|
package/lib/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAiB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACH,aAAa,EAEb,cAAc,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACH,QAAQ,EAER,eAAe,EACf,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAiB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACH,aAAa,EAEb,cAAc,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACH,QAAQ,EAER,eAAe,EACf,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,MAAM,GAGT,MAAM,SAAS,CAAC;AAEjB,OAAO,EACH,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,aAAa,EACb,cAAc,EACd,QAAQ;AACR,QAAQ;AACR,IAAI,EACJ,QAAQ,EAER,eAAe,EACf,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,MAAM,GAMT,CAAC"}
|
package/lib/src/types.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ export interface EmbedConfig {
|
|
|
122
122
|
queueMultiRenders?: boolean;
|
|
123
123
|
/**
|
|
124
124
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
125
|
+
* You would also need to set `style-src` in the CSP settings.
|
|
125
126
|
* @version 1.6.0 or later
|
|
126
127
|
* @default ''
|
|
127
128
|
*/
|
|
@@ -273,12 +274,24 @@ export declare enum EmbedEvent {
|
|
|
273
274
|
* @return data - The answer or Liveboard data
|
|
274
275
|
*/
|
|
275
276
|
CustomAction = "customAction",
|
|
277
|
+
/**
|
|
278
|
+
* A click has been triggered on table/chart
|
|
279
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
280
|
+
* @version 1.10.0
|
|
281
|
+
*/
|
|
282
|
+
VizPointClick = "vizPointClick",
|
|
276
283
|
/**
|
|
277
284
|
* A double click has been triggered on table/chart
|
|
278
285
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
279
286
|
* @version 1.5.0 or later
|
|
280
287
|
*/
|
|
281
288
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
289
|
+
/**
|
|
290
|
+
* Event troggered when rendering a chart, call the supplied
|
|
291
|
+
* callback with the config overrides.
|
|
292
|
+
* @version 1.10.0
|
|
293
|
+
*/
|
|
294
|
+
GetVizConfigOverrides = "getVizConfigOverrides",
|
|
282
295
|
/**
|
|
283
296
|
* An error has occurred.
|
|
284
297
|
* @return error - An error object or message
|
|
@@ -379,11 +392,17 @@ export declare enum HostEvent {
|
|
|
379
392
|
*/
|
|
380
393
|
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
381
394
|
/**
|
|
382
|
-
* Update the runtime filters
|
|
395
|
+
* Update the runtime filters. The runtime filters passed here are extended
|
|
396
|
+
* on to the existing runtime filters if they exist.
|
|
383
397
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
384
398
|
* @version 1.8.0 or later
|
|
385
399
|
*/
|
|
386
|
-
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
400
|
+
UpdateRuntimeFilters = "UpdateRuntimeFilters",
|
|
401
|
+
/**
|
|
402
|
+
* Highlight the point in the chart defined by the InputPoint passed.
|
|
403
|
+
* @verion 1.10.0
|
|
404
|
+
*/
|
|
405
|
+
HighlightPoint = "HighlightPoint"
|
|
387
406
|
}
|
|
388
407
|
/**
|
|
389
408
|
* The different visual modes that the data sources panel within
|
|
@@ -535,3 +554,9 @@ export declare enum OperationType {
|
|
|
535
554
|
export interface AnswerServiceType {
|
|
536
555
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
537
556
|
}
|
|
557
|
+
export interface Plugin {
|
|
558
|
+
name: string;
|
|
559
|
+
handlers: {
|
|
560
|
+
[key in EmbedEvent]: (payload: any) => void;
|
|
561
|
+
};
|
|
562
|
+
}
|
package/lib/src/types.js
CHANGED
|
@@ -159,12 +159,24 @@ export var EmbedEvent;
|
|
|
159
159
|
* @return data - The answer or Liveboard data
|
|
160
160
|
*/
|
|
161
161
|
EmbedEvent["CustomAction"] = "customAction";
|
|
162
|
+
/**
|
|
163
|
+
* A click has been triggered on table/chart
|
|
164
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
165
|
+
* @version 1.10.0
|
|
166
|
+
*/
|
|
167
|
+
EmbedEvent["VizPointClick"] = "vizPointClick";
|
|
162
168
|
/**
|
|
163
169
|
* A double click has been triggered on table/chart
|
|
164
170
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
165
171
|
* @version 1.5.0 or later
|
|
166
172
|
*/
|
|
167
173
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
174
|
+
/**
|
|
175
|
+
* Event troggered when rendering a chart, call the supplied
|
|
176
|
+
* callback with the config overrides.
|
|
177
|
+
* @version 1.10.0
|
|
178
|
+
*/
|
|
179
|
+
EmbedEvent["GetVizConfigOverrides"] = "getVizConfigOverrides";
|
|
168
180
|
/**
|
|
169
181
|
* An error has occurred.
|
|
170
182
|
* @return error - An error object or message
|
|
@@ -267,11 +279,17 @@ export var HostEvent;
|
|
|
267
279
|
*/
|
|
268
280
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
269
281
|
/**
|
|
270
|
-
* Update the runtime filters
|
|
282
|
+
* Update the runtime filters. The runtime filters passed here are extended
|
|
283
|
+
* on to the existing runtime filters if they exist.
|
|
271
284
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
272
285
|
* @version 1.8.0 or later
|
|
273
286
|
*/
|
|
274
287
|
HostEvent["UpdateRuntimeFilters"] = "UpdateRuntimeFilters";
|
|
288
|
+
/**
|
|
289
|
+
* Highlight the point in the chart defined by the InputPoint passed.
|
|
290
|
+
* @verion 1.10.0
|
|
291
|
+
*/
|
|
292
|
+
HostEvent["HighlightPoint"] = "HighlightPoint";
|
|
275
293
|
})(HostEvent || (HostEvent = {}));
|
|
276
294
|
/**
|
|
277
295
|
* The different visual modes that the data sources panel within
|
package/lib/src/types.js.map
CHANGED
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GA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ACvB,6BAAmB,CAAA;IACnB,6BAAmB,CAAA;IACnB,mCAAyB,CAAA;IACzB,uBAAa,CAAA;IACb,iCAAuB,CAAA;IACvB,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;IACnB,+BAAqB,CAAA;IACrB,2BAAiB,CAAA;IACjB,mDAAyC,CAAA;IACzC;;OAEG;IACH,uCAA6B,CAAA;IAC7B,wCAA8B,CAAA;IAC9B,6CAAmC,CAAA;IACnC,2DAAiD,CAAA;IACjD,qBAAW,CAAA;IACX,uCAA6B,CAAA;IAC7B,uCAA6B,CAAA;IAC7B,6BAAmB,CAAA;IACnB,oDAA0C,CAAA;IAC1C,oDAA0C,CAAA;IAC1C,iEAAuD,CAAA;IACvD,yDAA+C,CAAA;IAC/C,8CAAoC,CAAA;IACpC,wDAA8C,CAAA;IAC9C,mDAAyC,CAAA;IACzC,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;IAC/B,qDAA2C,CAAA;IAC3C;;OAEG;IACH,mCAAyB,CAAA;IACzB;;OAEG;IACH,yCAA+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"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/utils/plugin.ts"],"names":[],"mappings":""}
|
|
@@ -14,8 +14,8 @@ declare module '@thoughtspot/visual-embed-sdk' {
|
|
|
14
14
|
import { init, prefetch } from '@thoughtspot/visual-embed-sdk/embed/base';
|
|
15
15
|
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from '@thoughtspot/visual-embed-sdk/embed/liveboard';
|
|
16
16
|
import { SearchEmbed, SearchViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search';
|
|
17
|
-
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig } from '@thoughtspot/visual-embed-sdk/types';
|
|
18
|
-
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, };
|
|
17
|
+
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, Plugin } from '@thoughtspot/visual-embed-sdk/types';
|
|
18
|
+
export { init, prefetch, SearchEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, SearchViewConfig, LiveboardViewConfig, AppViewConfig, Plugin, };
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
@@ -439,6 +439,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
439
439
|
queueMultiRenders?: boolean;
|
|
440
440
|
/**
|
|
441
441
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
442
|
+
* You would also need to set `style-src` in the CSP settings.
|
|
442
443
|
* @version 1.6.0 or later
|
|
443
444
|
* @default ''
|
|
444
445
|
*/
|
|
@@ -590,12 +591,24 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
590
591
|
* @return data - The answer or Liveboard data
|
|
591
592
|
*/
|
|
592
593
|
CustomAction = "customAction",
|
|
594
|
+
/**
|
|
595
|
+
* A click has been triggered on table/chart
|
|
596
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
597
|
+
* @version 1.10.0
|
|
598
|
+
*/
|
|
599
|
+
VizPointClick = "vizPointClick",
|
|
593
600
|
/**
|
|
594
601
|
* A double click has been triggered on table/chart
|
|
595
602
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
596
603
|
* @version 1.5.0 or later
|
|
597
604
|
*/
|
|
598
605
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
606
|
+
/**
|
|
607
|
+
* Event troggered when rendering a chart, call the supplied
|
|
608
|
+
* callback with the config overrides.
|
|
609
|
+
* @version 1.10.0
|
|
610
|
+
*/
|
|
611
|
+
GetVizConfigOverrides = "getVizConfigOverrides",
|
|
599
612
|
/**
|
|
600
613
|
* An error has occurred.
|
|
601
614
|
* @return error - An error object or message
|
|
@@ -696,11 +709,17 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
696
709
|
*/
|
|
697
710
|
SetVisibleVizs = "SetPinboardVisibleVizs",
|
|
698
711
|
/**
|
|
699
|
-
* Update the runtime filters
|
|
712
|
+
* Update the runtime filters. The runtime filters passed here are extended
|
|
713
|
+
* on to the existing runtime filters if they exist.
|
|
700
714
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
701
715
|
* @version 1.8.0 or later
|
|
702
716
|
*/
|
|
703
|
-
UpdateRuntimeFilters = "UpdateRuntimeFilters"
|
|
717
|
+
UpdateRuntimeFilters = "UpdateRuntimeFilters",
|
|
718
|
+
/**
|
|
719
|
+
* Highlight the point in the chart defined by the InputPoint passed.
|
|
720
|
+
* @verion 1.10.0
|
|
721
|
+
*/
|
|
722
|
+
HighlightPoint = "HighlightPoint"
|
|
704
723
|
}
|
|
705
724
|
/**
|
|
706
725
|
* The different visual modes that the data sources panel within
|
|
@@ -852,6 +871,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
852
871
|
export interface AnswerServiceType {
|
|
853
872
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
854
873
|
}
|
|
874
|
+
export interface Plugin {
|
|
875
|
+
name: string;
|
|
876
|
+
handlers: {
|
|
877
|
+
[key in EmbedEvent]: (payload: any) => void;
|
|
878
|
+
};
|
|
879
|
+
}
|
|
855
880
|
}
|
|
856
881
|
|
|
857
882
|
declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
@@ -863,7 +888,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
863
888
|
* @summary Base classes
|
|
864
889
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
865
890
|
*/
|
|
866
|
-
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig } from '@thoughtspot/visual-embed-sdk/types';
|
|
891
|
+
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig, Plugin } from '@thoughtspot/visual-embed-sdk/types';
|
|
867
892
|
export interface LayoutConfig {
|
|
868
893
|
}
|
|
869
894
|
/**
|
|
@@ -933,6 +958,13 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
933
958
|
additionalFlags?: {
|
|
934
959
|
[key: string]: string | number | boolean;
|
|
935
960
|
};
|
|
961
|
+
/**
|
|
962
|
+
* Provide a list of plugins, the plugins are executed in the order
|
|
963
|
+
* provided below,
|
|
964
|
+
*
|
|
965
|
+
* @version alpha
|
|
966
|
+
*/
|
|
967
|
+
plugins?: Plugin[];
|
|
936
968
|
}
|
|
937
969
|
/**
|
|
938
970
|
* Base class for embedding v2 experience
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.8.0-
|
|
3
|
+
"version": "1.8.0-plugins.2",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"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",
|
|
35
35
|
"posttest": "cat ./coverage/lcov.info | coveralls",
|
|
36
36
|
"prepublishOnly": "npm run test; npm run tsc; npm run bundle-dts; npm run build",
|
|
37
|
-
"publish-dev": "npm publish --tag
|
|
37
|
+
"publish-dev": "npm publish --tag plugins",
|
|
38
38
|
"publish-prod": "npm publish --tag latest"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/src/embed/ts-embed.ts
CHANGED
|
@@ -28,10 +28,12 @@ import {
|
|
|
28
28
|
RuntimeFilter,
|
|
29
29
|
Param,
|
|
30
30
|
EmbedConfig,
|
|
31
|
+
Plugin,
|
|
31
32
|
} from '../types';
|
|
32
33
|
import { uploadMixpanelEvent, MIXPANEL_EVENT } from '../mixpanel-service';
|
|
33
34
|
import { getProcessData } from '../utils/processData';
|
|
34
35
|
import { processTrigger } from '../utils/processTrigger';
|
|
36
|
+
// eslint-disable-next-line import/no-cycle
|
|
35
37
|
import pkgInfo from '../../package.json';
|
|
36
38
|
import { getAuthPromise, getEmbedConfig, renderInQueue } from './base';
|
|
37
39
|
|
|
@@ -117,6 +119,13 @@ export interface ViewConfig {
|
|
|
117
119
|
* @version 1.8.0
|
|
118
120
|
*/
|
|
119
121
|
additionalFlags?: { [key: string]: string | number | boolean };
|
|
122
|
+
/**
|
|
123
|
+
* Provide a list of plugins, the plugins are executed in the order
|
|
124
|
+
* provided below,
|
|
125
|
+
*
|
|
126
|
+
* @version alpha
|
|
127
|
+
*/
|
|
128
|
+
plugins?: Plugin[];
|
|
120
129
|
}
|
|
121
130
|
|
|
122
131
|
/**
|
|
@@ -185,6 +194,8 @@ export class TsEmbed {
|
|
|
185
194
|
this.isError = false;
|
|
186
195
|
this.viewConfig = viewConfig;
|
|
187
196
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
197
|
+
this.registerPlugins(viewConfig?.plugins);
|
|
198
|
+
|
|
188
199
|
if (!this.embedConfig.suppressNoCookieAccessAlert) {
|
|
189
200
|
this.on(EmbedEvent.NoCookieAccess, () => {
|
|
190
201
|
// eslint-disable-next-line no-alert
|
|
@@ -195,6 +206,18 @@ export class TsEmbed {
|
|
|
195
206
|
}
|
|
196
207
|
}
|
|
197
208
|
|
|
209
|
+
private registerPlugins(plugins: Plugin[]) {
|
|
210
|
+
if (!plugins) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
plugins.forEach((plugin) => {
|
|
214
|
+
Object.keys(plugin.handlers).forEach((eventName: EmbedEvent) => {
|
|
215
|
+
const listener = plugin[eventName];
|
|
216
|
+
this.on(eventName, listener);
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
|
|
198
221
|
/**
|
|
199
222
|
* Gets a reference to the root DOM node where
|
|
200
223
|
* the embedded content will appear.
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -135,6 +135,7 @@ export interface EmbedConfig {
|
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
138
|
+
* You would also need to set `style-src` in the CSP settings.
|
|
138
139
|
* @version 1.6.0 or later
|
|
139
140
|
* @default ''
|
|
140
141
|
*/
|
|
@@ -294,12 +295,27 @@ export enum EmbedEvent {
|
|
|
294
295
|
* @return data - The answer or Liveboard data
|
|
295
296
|
*/
|
|
296
297
|
CustomAction = 'customAction',
|
|
298
|
+
/**
|
|
299
|
+
* A click has been triggered on table/chart
|
|
300
|
+
* @return ContextMenuInputPoints - data point that is double clicked
|
|
301
|
+
* @version 1.10.0
|
|
302
|
+
*/
|
|
303
|
+
VizPointClick = 'vizPointClick',
|
|
304
|
+
|
|
297
305
|
/**
|
|
298
306
|
* A double click has been triggered on table/chart
|
|
299
307
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
300
308
|
* @version 1.5.0 or later
|
|
301
309
|
*/
|
|
302
310
|
VizPointDoubleClick = 'vizPointDoubleClick',
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Event troggered when rendering a chart, call the supplied
|
|
314
|
+
* callback with the config overrides.
|
|
315
|
+
* @version 1.10.0
|
|
316
|
+
*/
|
|
317
|
+
GetVizConfigOverrides = 'getVizConfigOverrides',
|
|
318
|
+
|
|
303
319
|
/**
|
|
304
320
|
* An error has occurred.
|
|
305
321
|
* @return error - An error object or message
|
|
@@ -402,11 +418,17 @@ export enum HostEvent {
|
|
|
402
418
|
*/
|
|
403
419
|
SetVisibleVizs = 'SetPinboardVisibleVizs',
|
|
404
420
|
/**
|
|
405
|
-
* Update the runtime filters
|
|
421
|
+
* Update the runtime filters. The runtime filters passed here are extended
|
|
422
|
+
* on to the existing runtime filters if they exist.
|
|
406
423
|
* @param - {@link RuntimeFilter}[] an array of {@link RuntimeFilter} Types.
|
|
407
424
|
* @version 1.8.0 or later
|
|
408
425
|
*/
|
|
409
426
|
UpdateRuntimeFilters = 'UpdateRuntimeFilters',
|
|
427
|
+
/**
|
|
428
|
+
* Highlight the point in the chart defined by the InputPoint passed.
|
|
429
|
+
* @verion 1.10.0
|
|
430
|
+
*/
|
|
431
|
+
HighlightPoint = 'HighlightPoint',
|
|
410
432
|
}
|
|
411
433
|
|
|
412
434
|
/**
|
|
@@ -565,3 +587,10 @@ export enum OperationType {
|
|
|
565
587
|
export interface AnswerServiceType {
|
|
566
588
|
getAnswer?: (offset: number, batchSize: number) => any;
|
|
567
589
|
}
|
|
590
|
+
|
|
591
|
+
export interface Plugin {
|
|
592
|
+
name: string;
|
|
593
|
+
handlers: {
|
|
594
|
+
[key in EmbedEvent]: (payload: any) => void;
|
|
595
|
+
};
|
|
596
|
+
}
|