@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
package/lib/src/utils.js CHANGED
@@ -133,14 +133,30 @@ export const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) =
133
133
  }
134
134
  return false;
135
135
  };
136
- export 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
+ export 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
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,cAA+B,EAAU,EAAE;IACtE,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,EAAE;QACzC,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;YACtD,MAAM,KAAK,GAAG,UAAU,GAAG,CAAC,CAAC;YAC7B,MAAM,UAAU,GAAG,EAAE,CAAC;YACtB,UAAU,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YACpD,UAAU,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;YACjD,UAAU,CAAC,IAAI,CACX,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACjE,CAAC;YAEF,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,OAAO,CAAC,IAAI,CAA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C,aAAa,CAAC,WAAW,CAAC;QACrC,CAAC,CAAC,WAAW,CAAC;AACtB,CAAC"}
@@ -33,8 +33,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
33
33
  * @module
34
34
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
35
35
  */
36
- import { DOMSelector } from '@thoughtspot/visual-embed-sdk/types';
37
- import { V1Embed, ViewConfig } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
36
+ import { DOMSelector, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
37
+ import { V1Embed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
38
38
  /**
39
39
  * Pages within the ThoughtSpot app that can be embedded.
40
40
  */
@@ -215,8 +215,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
215
215
  * @summary Liveboard & visualization embed
216
216
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
217
217
  */
218
- import { DOMSelector, HostEvent } from '@thoughtspot/visual-embed-sdk/types';
219
- import { V1Embed, ViewConfig } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
218
+ import { DOMSelector, HostEvent, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
219
+ import { V1Embed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
220
220
  /**
221
221
  * The configuration for the embedded Liveboard or visualization page view.
222
222
  * @Category Liveboards and Charts
@@ -320,8 +320,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
320
320
  * @summary Search embed
321
321
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
322
322
  */
323
- import { DOMSelector, Action } from '@thoughtspot/visual-embed-sdk/types';
324
- import { ViewConfig, TsEmbed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
323
+ import { DOMSelector, Action, ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
324
+ import { TsEmbed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
325
325
  /**
326
326
  * Configuration for search options
327
327
  */
@@ -410,7 +410,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/search' {
410
410
  }
411
411
 
412
412
  declare module '@thoughtspot/visual-embed-sdk/embed/search-bar' {
413
- import { TsEmbed, ViewConfig } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
413
+ import { ViewConfig } from '@thoughtspot/visual-embed-sdk/types';
414
+ import { TsEmbed } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
414
415
  import { SearchOptions } from '@thoughtspot/visual-embed-sdk/embed/search';
415
416
  export interface SearchBarViewConfig extends ViewConfig {
416
417
  /**
@@ -597,11 +598,11 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
597
598
  }
598
599
  interface CustomStyles {
599
600
  customCSSUrl?: string;
600
- customCss?: customCssInterface;
601
+ customCSS?: customCssInterface;
601
602
  }
602
603
  export interface CustomisationsInterface {
603
- style: CustomStyles;
604
- content: {
604
+ style?: CustomStyles;
605
+ content?: {
605
606
  [key: string]: string;
606
607
  };
607
608
  }
@@ -741,7 +742,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
741
742
  *
742
743
  * @version SDK: 1.17.0 | ThoughtSpot: 8.9.0.cl
743
744
  */
744
- customisations?: CustomisationsInterface;
745
+ customizations?: CustomisationsInterface;
745
746
  /**
746
747
  * For noRedirect SSO Auth, we need a button which the user
747
748
  * click to trigger the flow. This is the containing element
@@ -757,6 +758,101 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
757
758
  */
758
759
  authTriggerText?: string;
759
760
  }
761
+ export interface LayoutConfig {
762
+ }
763
+ /**
764
+ * Embedded iFrame configuration
765
+ */
766
+ export interface FrameParams {
767
+ /**
768
+ * The width of the iFrame (unit is pixels if numeric).
769
+ */
770
+ width?: number | string;
771
+ /**
772
+ * The height of the iFrame (unit is pixels if numeric).
773
+ */
774
+ height?: number | string;
775
+ /**
776
+ * This parameters will be passed on the iframe
777
+ * as is.
778
+ */
779
+ [key: string]: string | number | boolean | undefined;
780
+ }
781
+ /**
782
+ * The configuration object for an embedded view.
783
+ */
784
+ export interface ViewConfig {
785
+ /**
786
+ * @hidden
787
+ */
788
+ layoutConfig?: LayoutConfig;
789
+ /**
790
+ * The <b>width</b> and <b>height</b> dimensions to render an embedded object inside your app. Specify the values in pixels or percentage.
791
+ */
792
+ frameParams?: FrameParams;
793
+ /**
794
+ * @hidden
795
+ */
796
+ theme?: string;
797
+ /**
798
+ * @hidden
799
+ */
800
+ styleSheet__unstable?: string;
801
+ /**
802
+ * The list of actions to disable from the primary menu, more menu
803
+ * (...), and the contextual menu.
804
+ */
805
+ disabledActions?: Action[];
806
+ /**
807
+ * The tooltip to display for disabled actions.
808
+ */
809
+ disabledActionReason?: string;
810
+ /**
811
+ * The list of actions to hide from the primary menu, more menu
812
+ * (...), and the contextual menu.
813
+ */
814
+ hiddenActions?: Action[];
815
+ /**
816
+ * The list of actions to display from the primary menu, more menu
817
+ * (...), and the contextual menu.
818
+ * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
819
+ */
820
+ visibleActions?: Action[];
821
+ /**
822
+ * Show alert messages and toast messages in the embedded view.
823
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
824
+ */
825
+ showAlerts?: boolean;
826
+ /**
827
+ * The list of runtime filters to apply to a search answer,
828
+ * visualization, or Liveboard.
829
+ */
830
+ runtimeFilters?: RuntimeFilter[];
831
+ /**
832
+ * The locale/language to use for the embedded view.
833
+ * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1-sw
834
+ */
835
+ locale?: string;
836
+ /**
837
+ * This is an object (key/val) of override flags which will be applied
838
+ * to the internal embedded object. This can be used to add any
839
+ * URL flag.
840
+ * Warning: This option is for advanced use only and is used internally
841
+ * to control embed behavior in non-regular ways. We do not publish the
842
+ * list of supported keys and values associated with each.
843
+ * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
844
+ */
845
+ additionalFlags?: {
846
+ [key: string]: string | number | boolean;
847
+ };
848
+ /**
849
+ * Dynamic CSSUrl and customCSS to be injected in the loaded application.
850
+ * You would also need to set `style-src` in the CSP settings.
851
+ * @version SDK: 1.17.2 | ThoughtSpot: 8.4.1-sw, 8.4.0.cl
852
+ * @default ''
853
+ */
854
+ customizations?: CustomisationsInterface;
855
+ }
760
856
  /**
761
857
  * MessagePayload: Embed event payload: message type, data and status (start/end)
762
858
  */
@@ -1623,99 +1719,11 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
1623
1719
  * @summary Base classes
1624
1720
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
1625
1721
  */
1626
- import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig, MessageOptions } from '@thoughtspot/visual-embed-sdk/types';
1722
+ import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, EmbedConfig, MessageOptions, ViewConfig, FrameParams } from '@thoughtspot/visual-embed-sdk/types';
1627
1723
  /**
1628
1724
  * Global prefix for all Thoughtspot postHash Params.
1629
1725
  */
1630
1726
  export const THOUGHTSPOT_PARAM_PREFIX = "ts-";
1631
- export interface LayoutConfig {
1632
- }
1633
- /**
1634
- * Embedded iFrame configuration
1635
- */
1636
- export interface FrameParams {
1637
- /**
1638
- * The width of the iFrame (unit is pixels if numeric).
1639
- */
1640
- width?: number | string;
1641
- /**
1642
- * The height of the iFrame (unit is pixels if numeric).
1643
- */
1644
- height?: number | string;
1645
- /**
1646
- * This parameters will be passed on the iframe
1647
- * as is.
1648
- */
1649
- [key: string]: string | number | boolean | undefined;
1650
- }
1651
- /**
1652
- * The configuration object for an embedded view.
1653
- */
1654
- export interface ViewConfig {
1655
- /**
1656
- * @hidden
1657
- */
1658
- layoutConfig?: LayoutConfig;
1659
- /**
1660
- * The <b>width</b> and <b>height</b> dimensions to render an embedded object inside your app. Specify the values in pixels or percentage.
1661
- */
1662
- frameParams?: FrameParams;
1663
- /**
1664
- * @hidden
1665
- */
1666
- theme?: string;
1667
- /**
1668
- * @hidden
1669
- */
1670
- styleSheet__unstable?: string;
1671
- /**
1672
- * The list of actions to disable from the primary menu, more menu
1673
- * (...), and the contextual menu.
1674
- */
1675
- disabledActions?: Action[];
1676
- /**
1677
- * The tooltip to display for disabled actions.
1678
- */
1679
- disabledActionReason?: string;
1680
- /**
1681
- * The list of actions to hide from the primary menu, more menu
1682
- * (...), and the contextual menu.
1683
- */
1684
- hiddenActions?: Action[];
1685
- /**
1686
- * The list of actions to display from the primary menu, more menu
1687
- * (...), and the contextual menu.
1688
- * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
1689
- */
1690
- visibleActions?: Action[];
1691
- /**
1692
- * Show alert messages and toast messages in the embedded view.
1693
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
1694
- */
1695
- showAlerts?: boolean;
1696
- /**
1697
- * The list of runtime filters to apply to a search answer,
1698
- * visualization, or Liveboard.
1699
- */
1700
- runtimeFilters?: RuntimeFilter[];
1701
- /**
1702
- * The locale/language to use for the embedded view.
1703
- * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1-sw
1704
- */
1705
- locale?: string;
1706
- /**
1707
- * This is an object (key/val) of override flags which will be applied
1708
- * to the internal embedded object. This can be used to add any
1709
- * URL flag.
1710
- * Warning: This option is for advanced use only and is used internally
1711
- * to control embed behavior in non-regular ways. We do not publish the
1712
- * list of supported keys and values associated with each.
1713
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
1714
- */
1715
- additionalFlags?: {
1716
- [key: string]: string | number | boolean;
1717
- };
1718
- }
1719
1727
  /**
1720
1728
  * Base class for embedding v2 experience
1721
1729
  * Note: the v2 version of ThoughtSpot Blink is built on the new stack:
package/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",
package/src/embed/app.ts CHANGED
@@ -10,8 +10,14 @@
10
10
  */
11
11
 
12
12
  import { getFilterQuery, getQueryParamString } from '../utils';
13
- import { Param, RuntimeFilter, DOMSelector, HostEvent } from '../types';
14
- import { V1Embed, ViewConfig } from './ts-embed';
13
+ import {
14
+ Param,
15
+ RuntimeFilter,
16
+ DOMSelector,
17
+ HostEvent,
18
+ ViewConfig,
19
+ } from '../types';
20
+ import { V1Embed } from './ts-embed';
15
21
 
16
22
  /**
17
23
  * Pages within the ThoughtSpot app that can be embedded.
package/src/embed/base.ts CHANGED
@@ -171,11 +171,11 @@ export const init = (embedConfig: EmbedConfig): EventEmitter => {
171
171
  authType: config.authType,
172
172
  host: config.thoughtSpotHost,
173
173
  usedCustomizationSheet:
174
- embedConfig.customisations?.style?.customCSSUrl != null,
174
+ embedConfig.customizations?.style?.customCSSUrl != null,
175
175
  usedCustomizationVariables:
176
- embedConfig.customisations?.style?.customCss?.variables != null,
176
+ embedConfig.customizations?.style?.customCSS?.variables != null,
177
177
  usedCustomizationRules:
178
- embedConfig.customisations?.style?.customCss?.rules_UNSTABLE !=
178
+ embedConfig.customizations?.style?.customCSS?.rules_UNSTABLE !=
179
179
  null,
180
180
  });
181
181
 
@@ -17,9 +17,10 @@ import {
17
17
  RuntimeFilter,
18
18
  DOMSelector,
19
19
  HostEvent,
20
+ ViewConfig,
20
21
  } from '../types';
21
22
  import { getFilterQuery, getQueryParamString } from '../utils';
22
- import { V1Embed, ViewConfig } from './ts-embed';
23
+ import { V1Embed } from './ts-embed';
23
24
 
24
25
  /**
25
26
  * The configuration for the embedded Liveboard or visualization page view.
@@ -1,6 +1,6 @@
1
- import { DOMSelector, Param, Action } from '../types';
1
+ import { DOMSelector, Param, Action, ViewConfig } from '../types';
2
2
  import { getQueryParamString } from '../utils';
3
- import { TsEmbed, ViewConfig } from './ts-embed';
3
+ import { TsEmbed } from './ts-embed';
4
4
  import { SearchOptions } from './search';
5
5
 
6
6
  export interface SearchBarViewConfig extends ViewConfig {
@@ -7,9 +7,15 @@
7
7
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
8
8
  */
9
9
 
10
- import { DataSourceVisualMode, DOMSelector, Param, Action } from '../types';
10
+ import {
11
+ DataSourceVisualMode,
12
+ DOMSelector,
13
+ Param,
14
+ Action,
15
+ ViewConfig,
16
+ } from '../types';
11
17
  import { getQueryParamString, checkReleaseVersionInBeta } from '../utils';
12
- import { ViewConfig, TsEmbed } from './ts-embed';
18
+ import { TsEmbed } from './ts-embed';
13
19
  import { version } from '../../package.json';
14
20
  import { ERROR_MESSAGE } from '../errors';
15
21
  import { getAuthPromise, getEmbedConfig } from './base';
@@ -43,11 +43,20 @@ beforeAll(() => {
43
43
 
44
44
  const customisations = {
45
45
  style: {
46
+ customCSS: {},
46
47
  customCSSUrl: 'http://localhost:3000',
47
48
  },
48
49
  content: {},
49
50
  };
50
51
 
52
+ const customisationsView = {
53
+ style: {
54
+ customCSS: {},
55
+ customCSSUrl: 'http://localhost:8000',
56
+ },
57
+ content: {},
58
+ };
59
+
51
60
  describe('Unit test case for ts embed', () => {
52
61
  const mockMixPanelEvent = jest.spyOn(
53
62
  mixpanelInstance,
@@ -66,7 +75,8 @@ describe('Unit test case for ts embed', () => {
66
75
  init({
67
76
  thoughtSpotHost: 'tshost',
68
77
  authType: AuthType.None,
69
- customisations,
78
+ customizations: customisations,
79
+ customCssUrl: 'http://localhost:5000',
70
80
  });
71
81
  });
72
82
 
@@ -94,6 +104,36 @@ describe('Unit test case for ts embed', () => {
94
104
  });
95
105
  });
96
106
 
107
+ test('verify Customisations from viewConfig', async () => {
108
+ const mockEmbedEventPayload = {
109
+ type: EmbedEvent.APP_INIT,
110
+ data: {},
111
+ };
112
+ const searchEmbed = new SearchEmbed(getRootEl(), {
113
+ ...defaultViewConfig,
114
+ customizations: customisationsView,
115
+ });
116
+ searchEmbed.render();
117
+ const mockPort: any = {
118
+ postMessage: jest.fn(),
119
+ };
120
+ await executeAfterWait(() => {
121
+ const iframe = getIFrameEl();
122
+ postMessageToParent(
123
+ iframe.contentWindow,
124
+ mockEmbedEventPayload,
125
+ mockPort,
126
+ );
127
+ });
128
+ expect(mockPort.postMessage).toHaveBeenCalledWith({
129
+ type: EmbedEvent.APP_INIT,
130
+ data: { customisations: customisationsView },
131
+ });
132
+ expect(getIFrameSrc()).toContain(
133
+ `customCssUrl=${customisationsView.style.customCSSUrl}`,
134
+ );
135
+ });
136
+
97
137
  test('when Embed event status have start status', (done) => {
98
138
  const mockEmbedEventPayload = {
99
139
  type: EmbedEvent.Save,
@@ -30,12 +30,13 @@ import {
30
30
  EmbedEvent,
31
31
  MessageCallback,
32
32
  Action,
33
- RuntimeFilter,
34
33
  Param,
35
34
  EmbedConfig,
36
35
  MessageOptions,
37
36
  MessagePayload,
38
37
  MessageCallbackObj,
38
+ ViewConfig,
39
+ FrameParams,
39
40
  } from '../types';
40
41
  import { uploadMixpanelEvent, MIXPANEL_EVENT } from '../mixpanel-service';
41
42
  import { processEventData } from '../utils/processData';
@@ -60,96 +61,6 @@ const V1EventMap = {
60
61
  [EmbedEvent.Data]: [EmbedEvent.V1Data],
61
62
  };
62
63
 
63
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
64
- export interface LayoutConfig {}
65
-
66
- /**
67
- * Embedded iFrame configuration
68
- */
69
- export interface FrameParams {
70
- /**
71
- * The width of the iFrame (unit is pixels if numeric).
72
- */
73
- width?: number | string;
74
- /**
75
- * The height of the iFrame (unit is pixels if numeric).
76
- */
77
- height?: number | string;
78
- /**
79
- * This parameters will be passed on the iframe
80
- * as is.
81
- */
82
- [key: string]: string | number | boolean | undefined;
83
- }
84
-
85
- /**
86
- * The configuration object for an embedded view.
87
- */
88
- export interface ViewConfig {
89
- /**
90
- * @hidden
91
- */
92
- layoutConfig?: LayoutConfig;
93
- /**
94
- * The <b>width</b> and <b>height</b> dimensions to render an embedded object inside your app. Specify the values in pixels or percentage.
95
- */
96
- frameParams?: FrameParams;
97
- /**
98
- * @hidden
99
- */
100
- theme?: string;
101
- /**
102
- * @hidden
103
- */
104
- // eslint-disable-next-line camelcase
105
- styleSheet__unstable?: string;
106
- /**
107
- * The list of actions to disable from the primary menu, more menu
108
- * (...), and the contextual menu.
109
- */
110
- disabledActions?: Action[];
111
- /**
112
- * The tooltip to display for disabled actions.
113
- */
114
- disabledActionReason?: string;
115
- /**
116
- * The list of actions to hide from the primary menu, more menu
117
- * (...), and the contextual menu.
118
- */
119
- hiddenActions?: Action[];
120
- /**
121
- * The list of actions to display from the primary menu, more menu
122
- * (...), and the contextual menu.
123
- * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1-sw
124
- */
125
- visibleActions?: Action[];
126
- /**
127
- * Show alert messages and toast messages in the embedded view.
128
- * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1-sw
129
- */
130
- showAlerts?: boolean;
131
- /**
132
- * The list of runtime filters to apply to a search answer,
133
- * visualization, or Liveboard.
134
- */
135
- runtimeFilters?: RuntimeFilter[];
136
- /**
137
- * The locale/language to use for the embedded view.
138
- * @version SDK: 1.9.4 | ThoughtSpot 8.1.0.cl, 8.4.1-sw
139
- */
140
- locale?: string;
141
- /**
142
- * This is an object (key/val) of override flags which will be applied
143
- * to the internal embedded object. This can be used to add any
144
- * URL flag.
145
- * Warning: This option is for advanced use only and is used internally
146
- * to control embed behavior in non-regular ways. We do not publish the
147
- * list of supported keys and values associated with each.
148
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
149
- */
150
- additionalFlags?: { [key: string]: string | number | boolean };
151
- }
152
-
153
64
  /**
154
65
  * Base class for embedding v2 experience
155
66
  * Note: the v2 version of ThoughtSpot Blink is built on the new stack:
@@ -310,7 +221,12 @@ export class TsEmbed {
310
221
  private appInitCb = (_: any, responder: any) => {
311
222
  responder({
312
223
  type: EmbedEvent.APP_INIT,
313
- data: { customisations: getCustomisations(this.embedConfig) },
224
+ data: {
225
+ customisations: getCustomisations(
226
+ this.embedConfig,
227
+ this.viewConfig,
228
+ ),
229
+ },
314
230
  });
315
231
  };
316
232
 
@@ -369,10 +285,6 @@ export class TsEmbed {
369
285
  ) {
370
286
  queryParams[Param.DisableLoginRedirect] = true;
371
287
  }
372
- // TODO remove this
373
- if (this.embedConfig.customCssUrl) {
374
- queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
375
- }
376
288
  if (this.embedConfig.authType === AuthType.EmbeddedSSO) {
377
289
  queryParams[Param.ForceSAMLAutoRedirect] = true;
378
290
  }
@@ -385,6 +297,7 @@ export class TsEmbed {
385
297
  showAlerts,
386
298
  additionalFlags,
387
299
  locale,
300
+ customizations,
388
301
  } = this.viewConfig;
389
302
 
390
303
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
@@ -394,6 +307,15 @@ export class TsEmbed {
394
307
  return queryParams;
395
308
  }
396
309
 
310
+ // TODO remove embedConfig.customCssUrl
311
+ const cssUrlParam =
312
+ customizations?.style?.customCSSUrl ||
313
+ this.embedConfig.customCssUrl;
314
+
315
+ if (cssUrlParam) {
316
+ queryParams[Param.CustomCSSUrl] = cssUrlParam;
317
+ }
318
+
397
319
  if (disabledActions?.length) {
398
320
  queryParams[Param.DisableActions] = disabledActions;
399
321
  }
@@ -10,9 +10,9 @@ import {
10
10
  LiveboardEmbed as _LiveboardEmbed,
11
11
  LiveboardViewConfig,
12
12
  } from '../embed/liveboard';
13
- import { TsEmbed, ViewConfig } from '../embed/ts-embed';
13
+ import { TsEmbed } from '../embed/ts-embed';
14
14
 
15
- import { EmbedEvent } from '../types';
15
+ import { EmbedEvent, ViewConfig } from '../types';
16
16
  import { EmbedProps, getViewPropsAndListeners } from './util';
17
17
 
18
18
  const componentFactory = <
package/src/react/util.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
 
4
3
  // eslint-disable-next-line prettier/prettier
5
4
  export type EmbedEventHandlers = { [key in keyof typeof EmbedEvent as `on${Capitalize<key>}`]?: MessageCallback };