@thoughtspot/visual-embed-sdk 1.18.0-alpha.0 → 1.18.0-alpha.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/app.d.ts +2 -2
- package/dist/src/embed/liveboard.d.ts +2 -2
- package/dist/src/embed/search-bar.d.ts +3 -6
- package/dist/src/embed/search.d.ts +2 -2
- package/dist/src/embed/ts-embed.d.ts +1 -89
- package/dist/src/react/util.d.ts +1 -2
- package/dist/src/types.d.ts +95 -0
- package/dist/src/utils.d.ts +2 -2
- package/dist/tsembed.es.js +22 -11
- package/dist/tsembed.js +22 -11
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +2 -2
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +2 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +3 -6
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +2 -2
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +1 -89
- package/lib/src/embed/ts-embed.js +11 -7
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +30 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/react/index.spec.js +1 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/react/util.d.ts +1 -2
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/types.d.ts +95 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +2 -2
- package/lib/src/utils.js +10 -3
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +105 -101
- package/package.json +1 -1
- package/src/embed/app.ts +8 -2
- package/src/embed/liveboard.ts +2 -1
- package/src/embed/search-bar.tsx +12 -7
- package/src/embed/search.ts +8 -2
- package/src/embed/ts-embed.spec.ts +38 -0
- package/src/embed/ts-embed.ts +18 -96
- package/src/react/index.spec.tsx +0 -1
- package/src/react/index.tsx +2 -2
- package/src/react/util.ts +1 -2
- package/src/types.ts +97 -0
- package/src/utils.ts +12 -2
package/dist/src/embed/app.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
10
|
*/
|
|
11
|
-
import { DOMSelector } from '../types';
|
|
12
|
-
import { V1Embed
|
|
11
|
+
import { DOMSelector, ViewConfig } from '../types';
|
|
12
|
+
import { V1Embed } from './ts-embed';
|
|
13
13
|
/**
|
|
14
14
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
15
15
|
*/
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @summary Liveboard & visualization embed
|
|
9
9
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
10
|
*/
|
|
11
|
-
import { DOMSelector, HostEvent } from '../types';
|
|
12
|
-
import { V1Embed
|
|
11
|
+
import { DOMSelector, HostEvent, ViewConfig } from '../types';
|
|
12
|
+
import { V1Embed } from './ts-embed';
|
|
13
13
|
/**
|
|
14
14
|
* The configuration for the embedded Liveboard or visualization page view.
|
|
15
15
|
* @Category Liveboards and Charts
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ViewConfig } from '../types';
|
|
2
|
+
import { TsEmbed } from './ts-embed';
|
|
2
3
|
import { SearchOptions } from './search';
|
|
3
|
-
export interface SearchBarViewConfig extends ViewConfig {
|
|
4
|
-
/**
|
|
5
|
-
* If set to true, hides the data sources panel.
|
|
6
|
-
*/
|
|
7
|
-
hideDataSources?: boolean;
|
|
4
|
+
export interface SearchBarViewConfig extends Omit<ViewConfig, 'disabledActions' | 'hiddenActions' | 'visibleActions' | 'disabledActionReason' | 'runtimeFilters' | 'showAlerts'> {
|
|
8
5
|
/**
|
|
9
6
|
* The array of data source GUIDs to set on load.
|
|
10
7
|
*/
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @summary Search embed
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { DOMSelector, Action } from '../types';
|
|
10
|
-
import {
|
|
9
|
+
import { DOMSelector, Action, ViewConfig } from '../types';
|
|
10
|
+
import { TsEmbed } from './ts-embed';
|
|
11
11
|
/**
|
|
12
12
|
* Configuration for search options
|
|
13
13
|
*/
|
|
@@ -6,99 +6,11 @@
|
|
|
6
6
|
* @summary Base classes
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback,
|
|
9
|
+
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, EmbedConfig, MessageOptions, ViewConfig, FrameParams } from '../types';
|
|
10
10
|
/**
|
|
11
11
|
* Global prefix for all Thoughtspot postHash Params.
|
|
12
12
|
*/
|
|
13
13
|
export declare const THOUGHTSPOT_PARAM_PREFIX = "ts-";
|
|
14
|
-
export interface LayoutConfig {
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Embedded iFrame configuration
|
|
18
|
-
*/
|
|
19
|
-
export interface FrameParams {
|
|
20
|
-
/**
|
|
21
|
-
* The width of the iFrame (unit is pixels if numeric).
|
|
22
|
-
*/
|
|
23
|
-
width?: number | string;
|
|
24
|
-
/**
|
|
25
|
-
* The height of the iFrame (unit is pixels if numeric).
|
|
26
|
-
*/
|
|
27
|
-
height?: number | string;
|
|
28
|
-
/**
|
|
29
|
-
* This parameters will be passed on the iframe
|
|
30
|
-
* as is.
|
|
31
|
-
*/
|
|
32
|
-
[key: string]: string | number | boolean | undefined;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* The configuration object for an embedded view.
|
|
36
|
-
*/
|
|
37
|
-
export interface ViewConfig {
|
|
38
|
-
/**
|
|
39
|
-
* @hidden
|
|
40
|
-
*/
|
|
41
|
-
layoutConfig?: LayoutConfig;
|
|
42
|
-
/**
|
|
43
|
-
* The <b>width</b> and <b>height</b> dimensions to render an embedded object inside your app. Specify the values in pixels or percentage.
|
|
44
|
-
*/
|
|
45
|
-
frameParams?: FrameParams;
|
|
46
|
-
/**
|
|
47
|
-
* @hidden
|
|
48
|
-
*/
|
|
49
|
-
theme?: string;
|
|
50
|
-
/**
|
|
51
|
-
* @hidden
|
|
52
|
-
*/
|
|
53
|
-
styleSheet__unstable?: string;
|
|
54
|
-
/**
|
|
55
|
-
* The list of actions to disable from the primary menu, more menu
|
|
56
|
-
* (...), and the contextual menu.
|
|
57
|
-
*/
|
|
58
|
-
disabledActions?: Action[];
|
|
59
|
-
/**
|
|
60
|
-
* The tooltip to display for disabled actions.
|
|
61
|
-
*/
|
|
62
|
-
disabledActionReason?: string;
|
|
63
|
-
/**
|
|
64
|
-
* The list of actions to hide from the primary menu, more menu
|
|
65
|
-
* (...), and the contextual menu.
|
|
66
|
-
*/
|
|
67
|
-
hiddenActions?: Action[];
|
|
68
|
-
/**
|
|
69
|
-
* The list of actions to display from the primary menu, more menu
|
|
70
|
-
* (...), and the contextual menu.
|
|
71
|
-
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
72
|
-
*/
|
|
73
|
-
visibleActions?: Action[];
|
|
74
|
-
/**
|
|
75
|
-
* Show alert messages and toast messages in the embedded view.
|
|
76
|
-
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
77
|
-
*/
|
|
78
|
-
showAlerts?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* The list of runtime filters to apply to a search answer,
|
|
81
|
-
* visualization, or Liveboard.
|
|
82
|
-
*/
|
|
83
|
-
runtimeFilters?: RuntimeFilter[];
|
|
84
|
-
/**
|
|
85
|
-
* The locale/language to use for the embedded view.
|
|
86
|
-
* @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1-sw
|
|
87
|
-
*/
|
|
88
|
-
locale?: string;
|
|
89
|
-
/**
|
|
90
|
-
* This is an object (key/val) of override flags which will be applied
|
|
91
|
-
* to the internal embedded object. This can be used to add any
|
|
92
|
-
* URL flag.
|
|
93
|
-
* Warning: This option is for advanced use only and is used internally
|
|
94
|
-
* to control embed behavior in non-regular ways. We do not publish the
|
|
95
|
-
* list of supported keys and values associated with each.
|
|
96
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
97
|
-
*/
|
|
98
|
-
additionalFlags?: {
|
|
99
|
-
[key: string]: string | number | boolean;
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
14
|
/**
|
|
103
15
|
* Base class for embedding v2 experience
|
|
104
16
|
* Note: the v2 version of ThoughtSpot Blink is built on the new stack:
|
package/dist/src/react/util.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { EmbedEvent, MessageCallback } from '../types';
|
|
2
|
-
import { ViewConfig } from '../embed/ts-embed';
|
|
1
|
+
import { EmbedEvent, MessageCallback, ViewConfig } from '../types';
|
|
3
2
|
export type EmbedEventHandlers = {
|
|
4
3
|
[key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
|
|
5
4
|
};
|
package/dist/src/types.d.ts
CHANGED
|
@@ -242,6 +242,101 @@ export interface EmbedConfig {
|
|
|
242
242
|
*/
|
|
243
243
|
authTriggerText?: string;
|
|
244
244
|
}
|
|
245
|
+
export interface LayoutConfig {
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Embedded iFrame configuration
|
|
249
|
+
*/
|
|
250
|
+
export interface FrameParams {
|
|
251
|
+
/**
|
|
252
|
+
* The width of the iFrame (unit is pixels if numeric).
|
|
253
|
+
*/
|
|
254
|
+
width?: number | string;
|
|
255
|
+
/**
|
|
256
|
+
* The height of the iFrame (unit is pixels if numeric).
|
|
257
|
+
*/
|
|
258
|
+
height?: number | string;
|
|
259
|
+
/**
|
|
260
|
+
* This parameters will be passed on the iframe
|
|
261
|
+
* as is.
|
|
262
|
+
*/
|
|
263
|
+
[key: string]: string | number | boolean | undefined;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* The configuration object for an embedded view.
|
|
267
|
+
*/
|
|
268
|
+
export interface ViewConfig {
|
|
269
|
+
/**
|
|
270
|
+
* @hidden
|
|
271
|
+
*/
|
|
272
|
+
layoutConfig?: LayoutConfig;
|
|
273
|
+
/**
|
|
274
|
+
* The <b>width</b> and <b>height</b> dimensions to render an embedded object inside your app. Specify the values in pixels or percentage.
|
|
275
|
+
*/
|
|
276
|
+
frameParams?: FrameParams;
|
|
277
|
+
/**
|
|
278
|
+
* @hidden
|
|
279
|
+
*/
|
|
280
|
+
theme?: string;
|
|
281
|
+
/**
|
|
282
|
+
* @hidden
|
|
283
|
+
*/
|
|
284
|
+
styleSheet__unstable?: string;
|
|
285
|
+
/**
|
|
286
|
+
* The list of actions to disable from the primary menu, more menu
|
|
287
|
+
* (...), and the contextual menu.
|
|
288
|
+
*/
|
|
289
|
+
disabledActions?: Action[];
|
|
290
|
+
/**
|
|
291
|
+
* The tooltip to display for disabled actions.
|
|
292
|
+
*/
|
|
293
|
+
disabledActionReason?: string;
|
|
294
|
+
/**
|
|
295
|
+
* The list of actions to hide from the primary menu, more menu
|
|
296
|
+
* (...), and the contextual menu.
|
|
297
|
+
*/
|
|
298
|
+
hiddenActions?: Action[];
|
|
299
|
+
/**
|
|
300
|
+
* The list of actions to display from the primary menu, more menu
|
|
301
|
+
* (...), and the contextual menu.
|
|
302
|
+
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
|
|
303
|
+
*/
|
|
304
|
+
visibleActions?: Action[];
|
|
305
|
+
/**
|
|
306
|
+
* Show alert messages and toast messages in the embedded view.
|
|
307
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
|
|
308
|
+
*/
|
|
309
|
+
showAlerts?: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* The list of runtime filters to apply to a search answer,
|
|
312
|
+
* visualization, or Liveboard.
|
|
313
|
+
*/
|
|
314
|
+
runtimeFilters?: RuntimeFilter[];
|
|
315
|
+
/**
|
|
316
|
+
* The locale/language to use for the embedded view.
|
|
317
|
+
* @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1-sw
|
|
318
|
+
*/
|
|
319
|
+
locale?: string;
|
|
320
|
+
/**
|
|
321
|
+
* This is an object (key/val) of override flags which will be applied
|
|
322
|
+
* to the internal embedded object. This can be used to add any
|
|
323
|
+
* URL flag.
|
|
324
|
+
* Warning: This option is for advanced use only and is used internally
|
|
325
|
+
* to control embed behavior in non-regular ways. We do not publish the
|
|
326
|
+
* list of supported keys and values associated with each.
|
|
327
|
+
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
328
|
+
*/
|
|
329
|
+
additionalFlags?: {
|
|
330
|
+
[key: string]: string | number | boolean;
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Dynamic CSSUrl and customCSS to be injected in the loaded application.
|
|
334
|
+
* You would also need to set `style-src` in the CSP settings.
|
|
335
|
+
* @version SDK: 1.17.2 | ThoughtSpot: 8.4.1-sw, 8.4.0.cl
|
|
336
|
+
* @default ''
|
|
337
|
+
*/
|
|
338
|
+
customizations?: CustomisationsInterface;
|
|
339
|
+
}
|
|
245
340
|
/**
|
|
246
341
|
* MessagePayload: Embed event payload: message type, data and status (start/end)
|
|
247
342
|
*/
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @summary Utils
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { EmbedConfig, QueryParams, RuntimeFilter, CustomisationsInterface, DOMSelector } from './types';
|
|
9
|
+
import { EmbedConfig, QueryParams, RuntimeFilter, CustomisationsInterface, DOMSelector, ViewConfig } from './types';
|
|
10
10
|
/**
|
|
11
11
|
* Construct a runtime filters query string from the given filters.
|
|
12
12
|
* Refer to the following docs for more details on runtime filter syntax:
|
|
@@ -43,7 +43,7 @@ export declare const setAttributes: (element: HTMLElement, attributes: {
|
|
|
43
43
|
[key: string]: string | number | boolean;
|
|
44
44
|
}) => void;
|
|
45
45
|
export declare const checkReleaseVersionInBeta: (releaseVersion: string, suppressBetaWarning: boolean) => boolean;
|
|
46
|
-
export declare const getCustomisations: (embedConfig: EmbedConfig) => CustomisationsInterface;
|
|
46
|
+
export declare const getCustomisations: (embedConfig: EmbedConfig, viewConfig: ViewConfig) => CustomisationsInterface;
|
|
47
47
|
/**
|
|
48
48
|
* Gets a reference to the DOM node given
|
|
49
49
|
* a selector.
|
package/dist/tsembed.es.js
CHANGED
|
@@ -133,14 +133,21 @@ const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
|
|
|
133
133
|
}
|
|
134
134
|
return false;
|
|
135
135
|
};
|
|
136
|
-
const getCustomisations = (embedConfig) => {
|
|
137
|
-
const
|
|
136
|
+
const getCustomisations = (embedConfig, viewConfig) => {
|
|
137
|
+
const customCssFromEmbedConfig = embedConfig.customCssUrl;
|
|
138
|
+
const customizationsFromViewConfig = viewConfig.customizations ||
|
|
139
|
+
viewConfig.customisations;
|
|
138
140
|
let customizations = embedConfig.customizations ||
|
|
139
141
|
embedConfig.customisations;
|
|
140
142
|
customizations = customizations || {};
|
|
141
143
|
customizations.style = customizations.style || {};
|
|
142
144
|
customizations.style.customCSSUrl =
|
|
143
|
-
|
|
145
|
+
(customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style.customCSSUrl) ||
|
|
146
|
+
customizations.style.customCSSUrl ||
|
|
147
|
+
customCssFromEmbedConfig;
|
|
148
|
+
customizations.style.customCSS =
|
|
149
|
+
(customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style.customCSS) ||
|
|
150
|
+
customizations.style.customCSS;
|
|
144
151
|
return customizations;
|
|
145
152
|
};
|
|
146
153
|
/**
|
|
@@ -9369,7 +9376,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
9369
9376
|
});
|
|
9370
9377
|
}
|
|
9371
9378
|
|
|
9372
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.18.0-alpha.
|
|
9379
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.18.0-alpha.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":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",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 --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/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",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","use-deep-compare-effect":"^1.8.1"};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.13.1","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.9.4","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};
|
|
9373
9380
|
|
|
9374
9381
|
/**
|
|
9375
9382
|
* Copyright (c) 2022
|
|
@@ -9414,7 +9421,9 @@ class TsEmbed {
|
|
|
9414
9421
|
this.appInitCb = (_, responder) => {
|
|
9415
9422
|
responder({
|
|
9416
9423
|
type: EmbedEvent.APP_INIT,
|
|
9417
|
-
data: {
|
|
9424
|
+
data: {
|
|
9425
|
+
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
9426
|
+
},
|
|
9418
9427
|
});
|
|
9419
9428
|
};
|
|
9420
9429
|
/**
|
|
@@ -9525,7 +9534,7 @@ class TsEmbed {
|
|
|
9525
9534
|
* @returns queryParams
|
|
9526
9535
|
*/
|
|
9527
9536
|
getBaseQueryParams() {
|
|
9528
|
-
var _a;
|
|
9537
|
+
var _a, _b;
|
|
9529
9538
|
const queryParams = {};
|
|
9530
9539
|
let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
|
|
9531
9540
|
// The below check is needed because TS Cloud firewall, blocks localhost/127.0.0.1
|
|
@@ -9543,18 +9552,20 @@ class TsEmbed {
|
|
|
9543
9552
|
this.embedConfig.autoLogin === true) {
|
|
9544
9553
|
queryParams[Param.DisableLoginRedirect] = true;
|
|
9545
9554
|
}
|
|
9546
|
-
// TODO remove this
|
|
9547
|
-
if (this.embedConfig.customCssUrl) {
|
|
9548
|
-
queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
|
|
9549
|
-
}
|
|
9550
9555
|
if (this.embedConfig.authType === AuthType.EmbeddedSSO) {
|
|
9551
9556
|
queryParams[Param.ForceSAMLAutoRedirect] = true;
|
|
9552
9557
|
}
|
|
9553
|
-
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, } = this.viewConfig;
|
|
9558
|
+
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, customizations, } = this.viewConfig;
|
|
9554
9559
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
9555
9560
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
9556
9561
|
return queryParams;
|
|
9557
9562
|
}
|
|
9563
|
+
// TODO remove embedConfig.customCssUrl
|
|
9564
|
+
const cssUrlParam = ((_b = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) ||
|
|
9565
|
+
this.embedConfig.customCssUrl;
|
|
9566
|
+
if (cssUrlParam) {
|
|
9567
|
+
queryParams[Param.CustomCSSUrl] = cssUrlParam;
|
|
9568
|
+
}
|
|
9558
9569
|
if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
|
|
9559
9570
|
queryParams[Param.DisableActions] = disabledActions;
|
|
9560
9571
|
}
|
package/dist/tsembed.js
CHANGED
|
@@ -139,14 +139,21 @@
|
|
|
139
139
|
}
|
|
140
140
|
return false;
|
|
141
141
|
};
|
|
142
|
-
const getCustomisations = (embedConfig) => {
|
|
143
|
-
const
|
|
142
|
+
const getCustomisations = (embedConfig, viewConfig) => {
|
|
143
|
+
const customCssFromEmbedConfig = embedConfig.customCssUrl;
|
|
144
|
+
const customizationsFromViewConfig = viewConfig.customizations ||
|
|
145
|
+
viewConfig.customisations;
|
|
144
146
|
let customizations = embedConfig.customizations ||
|
|
145
147
|
embedConfig.customisations;
|
|
146
148
|
customizations = customizations || {};
|
|
147
149
|
customizations.style = customizations.style || {};
|
|
148
150
|
customizations.style.customCSSUrl =
|
|
149
|
-
|
|
151
|
+
(customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style.customCSSUrl) ||
|
|
152
|
+
customizations.style.customCSSUrl ||
|
|
153
|
+
customCssFromEmbedConfig;
|
|
154
|
+
customizations.style.customCSS =
|
|
155
|
+
(customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style.customCSS) ||
|
|
156
|
+
customizations.style.customCSS;
|
|
150
157
|
return customizations;
|
|
151
158
|
};
|
|
152
159
|
/**
|
|
@@ -9335,7 +9342,7 @@
|
|
|
9335
9342
|
});
|
|
9336
9343
|
}
|
|
9337
9344
|
|
|
9338
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.18.0-alpha.
|
|
9345
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.18.0-alpha.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":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",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 --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/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",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","use-deep-compare-effect":"^1.8.1"};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.13.1","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.9.4","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};
|
|
9339
9346
|
|
|
9340
9347
|
/**
|
|
9341
9348
|
* Copyright (c) 2022
|
|
@@ -9380,7 +9387,9 @@
|
|
|
9380
9387
|
this.appInitCb = (_, responder) => {
|
|
9381
9388
|
responder({
|
|
9382
9389
|
type: exports.EmbedEvent.APP_INIT,
|
|
9383
|
-
data: {
|
|
9390
|
+
data: {
|
|
9391
|
+
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
9392
|
+
},
|
|
9384
9393
|
});
|
|
9385
9394
|
};
|
|
9386
9395
|
/**
|
|
@@ -9491,7 +9500,7 @@
|
|
|
9491
9500
|
* @returns queryParams
|
|
9492
9501
|
*/
|
|
9493
9502
|
getBaseQueryParams() {
|
|
9494
|
-
var _a;
|
|
9503
|
+
var _a, _b;
|
|
9495
9504
|
const queryParams = {};
|
|
9496
9505
|
let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
|
|
9497
9506
|
// The below check is needed because TS Cloud firewall, blocks localhost/127.0.0.1
|
|
@@ -9509,18 +9518,20 @@
|
|
|
9509
9518
|
this.embedConfig.autoLogin === true) {
|
|
9510
9519
|
queryParams[Param.DisableLoginRedirect] = true;
|
|
9511
9520
|
}
|
|
9512
|
-
// TODO remove this
|
|
9513
|
-
if (this.embedConfig.customCssUrl) {
|
|
9514
|
-
queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
|
|
9515
|
-
}
|
|
9516
9521
|
if (this.embedConfig.authType === exports.AuthType.EmbeddedSSO) {
|
|
9517
9522
|
queryParams[Param.ForceSAMLAutoRedirect] = true;
|
|
9518
9523
|
}
|
|
9519
|
-
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, } = this.viewConfig;
|
|
9524
|
+
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, customizations, } = this.viewConfig;
|
|
9520
9525
|
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
9521
9526
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
9522
9527
|
return queryParams;
|
|
9523
9528
|
}
|
|
9529
|
+
// TODO remove embedConfig.customCssUrl
|
|
9530
|
+
const cssUrlParam = ((_b = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) ||
|
|
9531
|
+
this.embedConfig.customCssUrl;
|
|
9532
|
+
if (cssUrlParam) {
|
|
9533
|
+
queryParams[Param.CustomCSSUrl] = cssUrlParam;
|
|
9534
|
+
}
|
|
9524
9535
|
if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
|
|
9525
9536
|
queryParams[Param.DisableActions] = disabledActions;
|
|
9526
9537
|
}
|
package/lib/package.json
CHANGED
package/lib/src/embed/app.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
10
|
*/
|
|
11
|
-
import { DOMSelector } from '../types';
|
|
12
|
-
import { V1Embed
|
|
11
|
+
import { DOMSelector, ViewConfig } from '../types';
|
|
12
|
+
import { V1Embed } from './ts-embed';
|
|
13
13
|
/**
|
|
14
14
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
15
15
|
*/
|
package/lib/src/embed/app.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
10
|
*/
|
|
11
11
|
import { getFilterQuery, getQueryParamString } from '../utils';
|
|
12
|
-
import { Param, HostEvent } from '../types';
|
|
12
|
+
import { Param, HostEvent, } from '../types';
|
|
13
13
|
import { V1Embed } from './ts-embed';
|
|
14
14
|
/**
|
|
15
15
|
* Pages within the ThoughtSpot app that can be embedded.
|
package/lib/src/embed/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/embed/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/embed/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EACH,KAAK,EAGL,SAAS,GAEZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,IA6BX;AA7BD,WAAY,IAAI;IACZ;;OAEG;IACH,qBAAa,CAAA;IACb;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,iCAAyB,CAAA;IACzB;;OAEG;IACH,+BAAuB,CAAA;IACvB;;OAEG;IACH,qBAAa,CAAA;IACb;;OAEG;IACH,yBAAiB,CAAA;AACrB,CAAC,EA7BW,IAAI,KAAJ,IAAI,QA6Bf;AAmDD;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,OAAO;IAGjC,kDAAkD;IAClD,YAAY,WAAwB,EAAE,UAAyB;QAC3D,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACK,cAAc;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACzC,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAE1D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,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,GACd,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAClC,GAAG,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC;SACpD;IACL,CAAC;IAED;;;;OAIG;IACI,MAAM;QACT,KAAK,CAAC,MAAM,EAAE,CAAC;QAEf,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QACzD,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACrE,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACzD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @summary Liveboard & visualization embed
|
|
9
9
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
10
10
|
*/
|
|
11
|
-
import { DOMSelector, HostEvent } from '../types';
|
|
12
|
-
import { V1Embed
|
|
11
|
+
import { DOMSelector, HostEvent, ViewConfig } from '../types';
|
|
12
|
+
import { V1Embed } from './ts-embed';
|
|
13
13
|
/**
|
|
14
14
|
* The configuration for the embedded Liveboard or visualization page view.
|
|
15
15
|
* @Category Liveboards and Charts
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"liveboard.js","sourceRoot":"","sources":["../../../src/embed/liveboard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AC,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,CACzB,WAAW,EACX,KAAK,EACL,cAAc,EACd,WAAW,CACd,CAAC;QACF,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAExB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;CAAG"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ViewConfig } from '../types';
|
|
2
|
+
import { TsEmbed } from './ts-embed';
|
|
2
3
|
import { SearchOptions } from './search';
|
|
3
|
-
export interface SearchBarViewConfig extends ViewConfig {
|
|
4
|
-
/**
|
|
5
|
-
* If set to true, hides the data sources panel.
|
|
6
|
-
*/
|
|
7
|
-
hideDataSources?: boolean;
|
|
4
|
+
export interface SearchBarViewConfig extends Omit<ViewConfig, 'disabledActions' | 'hiddenActions' | 'visibleActions' | 'disabledActionReason' | 'runtimeFilters' | 'showAlerts'> {
|
|
8
5
|
/**
|
|
9
6
|
* The array of data source GUIDs to set on load.
|
|
10
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar.js","sourceRoot":"","sources":["../../../src/embed/search-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,
|
|
1
|
+
{"version":3,"file":"search-bar.js","sourceRoot":"","sources":["../../../src/embed/search-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,EAAsB,MAAM,UAAU,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,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACjE,IAAI,iBAAiB,EAAE;YACnB,KAAK,GAAG,IAAI,iBAAiB,EAAE,CAAC;SACnC;QACD,MAAM,gBAAgB,GAAG,IAAI,CAAC,2BAA2B,EAAE,CAAC;QAE5D,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,gBAAgB,EAAE,CAAC;IACxE,CAAC;IAED;;OAEG;IACI,MAAM;QACT,KAAK,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;QAExC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC3C,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @summary Search embed
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { DOMSelector, Action } from '../types';
|
|
10
|
-
import {
|
|
9
|
+
import { DOMSelector, Action, ViewConfig } from '../types';
|
|
10
|
+
import { TsEmbed } from './ts-embed';
|
|
11
11
|
/**
|
|
12
12
|
* Configuration for search options
|
|
13
13
|
*/
|
package/lib/src/embed/search.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @summary Search embed
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
|
-
import { DataSourceVisualMode, Param, Action } from '../types';
|
|
9
|
+
import { DataSourceVisualMode, Param, Action, } from '../types';
|
|
10
10
|
import { getQueryParamString, checkReleaseVersionInBeta } from '../utils';
|
|
11
11
|
import { TsEmbed } from './ts-embed';
|
|
12
12
|
import { ERROR_MESSAGE } from '../errors';
|