@thoughtspot/visual-embed-sdk 1.17.2 → 1.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/src/embed/app.d.ts +2 -2
  2. package/dist/src/embed/liveboard.d.ts +2 -2
  3. package/dist/src/embed/search-bar.d.ts +2 -1
  4. package/dist/src/embed/search.d.ts +2 -2
  5. package/dist/src/embed/ts-embed.d.ts +1 -89
  6. package/dist/src/react/util.d.ts +1 -2
  7. package/dist/src/types.d.ts +99 -4
  8. package/dist/src/utils.d.ts +2 -2
  9. package/dist/tsembed.es.js +39 -19
  10. package/dist/tsembed.js +39 -19
  11. package/lib/package.json +1 -1
  12. package/lib/src/embed/app.d.ts +2 -2
  13. package/lib/src/embed/app.js +1 -1
  14. package/lib/src/embed/app.js.map +1 -1
  15. package/lib/src/embed/base.js +3 -3
  16. package/lib/src/embed/liveboard.d.ts +2 -2
  17. package/lib/src/embed/liveboard.js.map +1 -1
  18. package/lib/src/embed/search-bar.d.ts +2 -1
  19. package/lib/src/embed/search-bar.js.map +1 -1
  20. package/lib/src/embed/search.d.ts +2 -2
  21. package/lib/src/embed/search.js +1 -1
  22. package/lib/src/embed/search.js.map +1 -1
  23. package/lib/src/embed/ts-embed.d.ts +1 -89
  24. package/lib/src/embed/ts-embed.js +11 -7
  25. package/lib/src/embed/ts-embed.js.map +1 -1
  26. package/lib/src/embed/ts-embed.spec.js +33 -1
  27. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  28. package/lib/src/react/util.d.ts +1 -2
  29. package/lib/src/react/util.js.map +1 -1
  30. package/lib/src/types.d.ts +99 -4
  31. package/lib/src/types.js.map +1 -1
  32. package/lib/src/utils.d.ts +2 -2
  33. package/lib/src/utils.js +24 -8
  34. package/lib/src/utils.js.map +1 -1
  35. package/lib/src/visual-embed-sdk.d.ts +108 -100
  36. package/package.json +1 -1
  37. package/src/embed/app.ts +8 -2
  38. package/src/embed/base.ts +3 -3
  39. package/src/embed/liveboard.ts +2 -1
  40. package/src/embed/search-bar.tsx +2 -2
  41. package/src/embed/search.ts +8 -2
  42. package/src/embed/ts-embed.spec.ts +41 -1
  43. package/src/embed/ts-embed.ts +18 -96
  44. package/src/react/index.tsx +2 -2
  45. package/src/react/util.ts +1 -2
  46. package/src/types.ts +101 -4
  47. package/src/utils.ts +27 -7
@@ -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, ViewConfig } from './ts-embed';
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, ViewConfig } from './ts-embed';
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,4 +1,5 @@
1
- import { TsEmbed, ViewConfig } from './ts-embed';
1
+ import { ViewConfig } from '../types';
2
+ import { TsEmbed } from './ts-embed';
2
3
  import { SearchOptions } from './search';
3
4
  export interface SearchBarViewConfig extends ViewConfig {
4
5
  /**
@@ -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 { ViewConfig, TsEmbed } from './ts-embed';
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, Action, RuntimeFilter, EmbedConfig, MessageOptions } from '../types';
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:
@@ -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 declare type EmbedEventHandlers = {
4
3
  [key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback;
5
4
  };
@@ -82,11 +82,11 @@ interface customCssInterface {
82
82
  }
83
83
  interface CustomStyles {
84
84
  customCSSUrl?: string;
85
- customCss?: customCssInterface;
85
+ customCSS?: customCssInterface;
86
86
  }
87
87
  export interface CustomisationsInterface {
88
- style: CustomStyles;
89
- content: {
88
+ style?: CustomStyles;
89
+ content?: {
90
90
  [key: string]: string;
91
91
  };
92
92
  }
@@ -226,7 +226,7 @@ export interface EmbedConfig {
226
226
  *
227
227
  * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl
228
228
  */
229
- customisations?: CustomisationsInterface;
229
+ customizations?: CustomisationsInterface;
230
230
  /**
231
231
  * For noRedirect SSO Auth, we need a button which the user
232
232
  * click to trigger the flow. This is the containing element
@@ -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
  */
@@ -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.
@@ -133,14 +133,30 @@ const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
133
133
  }
134
134
  return false;
135
135
  };
136
- const getCustomisations = (embedConfig) => {
137
- const { customCssUrl } = embedConfig;
138
- let { customisations } = embedConfig;
139
- customisations = customisations || {};
140
- customisations.style = customisations.style || {};
141
- customisations.style.customCSSUrl =
142
- customisations.style.customCSSUrl || customCssUrl;
143
- return customisations;
136
+ const getCustomisations = (embedConfig, viewConfig) => {
137
+ var _a, _b, _c, _d;
138
+ const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
139
+ const customizationsFromViewConfig = viewConfig.customizations;
140
+ const customizationsFromEmbedConfig = embedConfig.customizations ||
141
+ embedConfig.customisations;
142
+ const customizations = {
143
+ style: {
144
+ ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style,
145
+ ...customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style,
146
+ customCSS: {
147
+ ...(_a = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _a === void 0 ? void 0 : _a.customCSS,
148
+ ...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
149
+ },
150
+ customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl) ||
151
+ ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl) ||
152
+ customCssUrlFromEmbedConfig,
153
+ },
154
+ content: {
155
+ ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
156
+ ...customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.content,
157
+ },
158
+ };
159
+ return customizations;
144
160
  };
145
161
  /**
146
162
  * Gets a reference to the DOM node given
@@ -9054,9 +9070,9 @@ const init = (embedConfig) => {
9054
9070
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
9055
9071
  authType: config.authType,
9056
9072
  host: config.thoughtSpotHost,
9057
- usedCustomizationSheet: ((_b = (_a = embedConfig.customisations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
9058
- usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customisations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCss) === null || _e === void 0 ? void 0 : _e.variables) != null,
9059
- usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customisations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCss) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
9073
+ usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
9074
+ usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
9075
+ usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
9060
9076
  null,
9061
9077
  });
9062
9078
  if (config.callPrefetch) {
@@ -9276,7 +9292,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
9276
9292
  });
9277
9293
  }
9278
9294
 
9279
- var name="@thoughtspot/visual-embed-sdk";var version="1.17.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 --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.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};
9295
+ var name="@thoughtspot/visual-embed-sdk";var version="1.17.3";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 --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.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};
9280
9296
 
9281
9297
  /**
9282
9298
  * Copyright (c) 2022
@@ -9321,7 +9337,9 @@ class TsEmbed {
9321
9337
  this.appInitCb = (_, responder) => {
9322
9338
  responder({
9323
9339
  type: EmbedEvent.APP_INIT,
9324
- data: { customisations: getCustomisations(this.embedConfig) },
9340
+ data: {
9341
+ customisations: getCustomisations(this.embedConfig, this.viewConfig),
9342
+ },
9325
9343
  });
9326
9344
  };
9327
9345
  /**
@@ -9432,7 +9450,7 @@ class TsEmbed {
9432
9450
  * @returns queryParams
9433
9451
  */
9434
9452
  getBaseQueryParams() {
9435
- var _a;
9453
+ var _a, _b;
9436
9454
  const queryParams = {};
9437
9455
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
9438
9456
  // The below check is needed because TS Cloud firewall, blocks localhost/127.0.0.1
@@ -9450,18 +9468,20 @@ class TsEmbed {
9450
9468
  this.embedConfig.autoLogin === true) {
9451
9469
  queryParams[Param.DisableLoginRedirect] = true;
9452
9470
  }
9453
- // TODO remove this
9454
- if (this.embedConfig.customCssUrl) {
9455
- queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
9456
- }
9457
9471
  if (this.embedConfig.authType === AuthType.EmbeddedSSO) {
9458
9472
  queryParams[Param.ForceSAMLAutoRedirect] = true;
9459
9473
  }
9460
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, } = this.viewConfig;
9474
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, customizations, } = this.viewConfig;
9461
9475
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
9462
9476
  this.handleError('You cannot have both hidden actions and visible actions');
9463
9477
  return queryParams;
9464
9478
  }
9479
+ // TODO remove embedConfig.customCssUrl
9480
+ const cssUrlParam = ((_b = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) ||
9481
+ this.embedConfig.customCssUrl;
9482
+ if (cssUrlParam) {
9483
+ queryParams[Param.CustomCSSUrl] = cssUrlParam;
9484
+ }
9465
9485
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
9466
9486
  queryParams[Param.DisableActions] = disabledActions;
9467
9487
  }
package/dist/tsembed.js CHANGED
@@ -139,14 +139,30 @@
139
139
  }
140
140
  return false;
141
141
  };
142
- const getCustomisations = (embedConfig) => {
143
- const { customCssUrl } = embedConfig;
144
- let { customisations } = embedConfig;
145
- customisations = customisations || {};
146
- customisations.style = customisations.style || {};
147
- customisations.style.customCSSUrl =
148
- customisations.style.customCSSUrl || customCssUrl;
149
- return customisations;
142
+ const getCustomisations = (embedConfig, viewConfig) => {
143
+ var _a, _b, _c, _d;
144
+ const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
145
+ const customizationsFromViewConfig = viewConfig.customizations;
146
+ const customizationsFromEmbedConfig = embedConfig.customizations ||
147
+ embedConfig.customisations;
148
+ const customizations = {
149
+ style: {
150
+ ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style,
151
+ ...customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style,
152
+ customCSS: {
153
+ ...(_a = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _a === void 0 ? void 0 : _a.customCSS,
154
+ ...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
155
+ },
156
+ customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl) ||
157
+ ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl) ||
158
+ customCssUrlFromEmbedConfig,
159
+ },
160
+ content: {
161
+ ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
162
+ ...customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.content,
163
+ },
164
+ };
165
+ return customizations;
150
166
  };
151
167
  /**
152
168
  * Gets a reference to the DOM node given
@@ -9020,9 +9036,9 @@
9020
9036
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
9021
9037
  authType: config.authType,
9022
9038
  host: config.thoughtSpotHost,
9023
- usedCustomizationSheet: ((_b = (_a = embedConfig.customisations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
9024
- usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customisations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCss) === null || _e === void 0 ? void 0 : _e.variables) != null,
9025
- usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customisations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCss) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
9039
+ usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
9040
+ usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
9041
+ usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
9026
9042
  null,
9027
9043
  });
9028
9044
  if (config.callPrefetch) {
@@ -9242,7 +9258,7 @@
9242
9258
  });
9243
9259
  }
9244
9260
 
9245
- var name="@thoughtspot/visual-embed-sdk";var version="1.17.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 --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.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};
9261
+ var name="@thoughtspot/visual-embed-sdk";var version="1.17.3";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 --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.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};
9246
9262
 
9247
9263
  /**
9248
9264
  * Copyright (c) 2022
@@ -9287,7 +9303,9 @@
9287
9303
  this.appInitCb = (_, responder) => {
9288
9304
  responder({
9289
9305
  type: exports.EmbedEvent.APP_INIT,
9290
- data: { customisations: getCustomisations(this.embedConfig) },
9306
+ data: {
9307
+ customisations: getCustomisations(this.embedConfig, this.viewConfig),
9308
+ },
9291
9309
  });
9292
9310
  };
9293
9311
  /**
@@ -9398,7 +9416,7 @@
9398
9416
  * @returns queryParams
9399
9417
  */
9400
9418
  getBaseQueryParams() {
9401
- var _a;
9419
+ var _a, _b;
9402
9420
  const queryParams = {};
9403
9421
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
9404
9422
  // The below check is needed because TS Cloud firewall, blocks localhost/127.0.0.1
@@ -9416,18 +9434,20 @@
9416
9434
  this.embedConfig.autoLogin === true) {
9417
9435
  queryParams[Param.DisableLoginRedirect] = true;
9418
9436
  }
9419
- // TODO remove this
9420
- if (this.embedConfig.customCssUrl) {
9421
- queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
9422
- }
9423
9437
  if (this.embedConfig.authType === exports.AuthType.EmbeddedSSO) {
9424
9438
  queryParams[Param.ForceSAMLAutoRedirect] = true;
9425
9439
  }
9426
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, } = this.viewConfig;
9440
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, customizations, } = this.viewConfig;
9427
9441
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
9428
9442
  this.handleError('You cannot have both hidden actions and visible actions');
9429
9443
  return queryParams;
9430
9444
  }
9445
+ // TODO remove embedConfig.customCssUrl
9446
+ const cssUrlParam = ((_b = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) ||
9447
+ this.embedConfig.customCssUrl;
9448
+ if (cssUrlParam) {
9449
+ queryParams[Param.CustomCSSUrl] = cssUrlParam;
9450
+ }
9431
9451
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
9432
9452
  queryParams[Param.DisableActions] = disabledActions;
9433
9453
  }
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.17.2",
3
+ "version": "1.17.3",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -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, ViewConfig } from './ts-embed';
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
  */
@@ -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.
@@ -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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,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"}
@@ -141,9 +141,9 @@ export const init = (embedConfig) => {
141
141
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
142
142
  authType: config.authType,
143
143
  host: config.thoughtSpotHost,
144
- usedCustomizationSheet: ((_b = (_a = embedConfig.customisations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
145
- usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customisations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCss) === null || _e === void 0 ? void 0 : _e.variables) != null,
146
- usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customisations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCss) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
144
+ usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
145
+ usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
146
+ usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) !=
147
147
  null,
148
148
  });
149
149
  if (config.callPrefetch) {
@@ -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, ViewConfig } from './ts-embed';
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