@thoughtspot/visual-embed-sdk 1.17.2-customcss → 1.18.0-alpha.1

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 (51) hide show
  1. package/CHANGELOG.md +4 -8
  2. package/README.md +1 -1
  3. package/dist/src/embed/app.d.ts +2 -2
  4. package/dist/src/embed/liveboard.d.ts +2 -2
  5. package/dist/src/embed/search-bar.d.ts +3 -2
  6. package/dist/src/embed/search.d.ts +2 -6
  7. package/dist/src/embed/ts-embed.d.ts +2 -97
  8. package/dist/src/react/util.d.ts +1 -2
  9. package/dist/src/types.d.ts +198 -11
  10. package/dist/src/utils.d.ts +2 -2
  11. package/dist/tsembed.es.js +131 -31
  12. package/dist/tsembed.js +131 -31
  13. package/lib/package.json +8 -4
  14. package/lib/src/embed/app.d.ts +2 -2
  15. package/lib/src/embed/app.js +1 -1
  16. package/lib/src/embed/app.js.map +1 -1
  17. package/lib/src/embed/base.js +3 -3
  18. package/lib/src/embed/liveboard.d.ts +2 -2
  19. package/lib/src/embed/liveboard.js.map +1 -1
  20. package/lib/src/embed/search-bar.d.ts +3 -2
  21. package/lib/src/embed/search-bar.js +1 -1
  22. package/lib/src/embed/search-bar.js.map +1 -1
  23. package/lib/src/embed/search.d.ts +2 -6
  24. package/lib/src/embed/search.js +2 -2
  25. package/lib/src/embed/search.js.map +1 -1
  26. package/lib/src/embed/ts-embed.d.ts +2 -97
  27. package/lib/src/embed/ts-embed.js +11 -11
  28. package/lib/src/embed/ts-embed.js.map +1 -1
  29. package/lib/src/embed/ts-embed.spec.js +31 -1
  30. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  31. package/lib/src/react/util.d.ts +1 -2
  32. package/lib/src/react/util.js.map +1 -1
  33. package/lib/src/types.d.ts +198 -11
  34. package/lib/src/types.js +98 -6
  35. package/lib/src/types.js.map +1 -1
  36. package/lib/src/utils.d.ts +2 -2
  37. package/lib/src/utils.js +16 -8
  38. package/lib/src/utils.js.map +1 -1
  39. package/lib/src/visual-embed-sdk.d.ts +209 -120
  40. package/package.json +8 -4
  41. package/src/embed/app.ts +8 -2
  42. package/src/embed/base.ts +3 -3
  43. package/src/embed/liveboard.ts +2 -1
  44. package/src/embed/search-bar.tsx +3 -3
  45. package/src/embed/search.ts +8 -7
  46. package/src/embed/ts-embed.spec.ts +39 -1
  47. package/src/embed/ts-embed.ts +16 -108
  48. package/src/react/index.tsx +2 -2
  49. package/src/react/util.ts +1 -2
  50. package/src/types.ts +199 -11
  51. package/src/utils.ts +19 -7
@@ -133,14 +133,22 @@ 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
+ const customCssFromEmbedConfig = embedConfig.customCssUrl;
138
+ const customizationsFromViewConfig = viewConfig.customizations ||
139
+ viewConfig.customisations;
140
+ let customizations = embedConfig.customizations ||
141
+ embedConfig.customisations;
142
+ customizations = customizations || {};
143
+ customizations.style = customizations.style || {};
144
+ customizations.style.customCSSUrl =
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;
151
+ return customizations;
144
152
  };
145
153
  /**
146
154
  * Gets a reference to the DOM node given
@@ -680,7 +688,10 @@ var HostEvent;
680
688
  * Triggers the Pin action on an embedded object
681
689
  * @param - incase of Liveboard embed, takes in an object with vizId as a key
682
690
  * can be left empty for search and visualization embeds
683
- * @example liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
691
+ * @example
692
+ * liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
693
+ * vizEmbed.trigger(HostEvent.Pin)
694
+ * searchEmbed.trigger(HostEvent.Pin)
684
695
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
685
696
  */
686
697
  HostEvent["Pin"] = "pin";
@@ -727,8 +738,11 @@ var HostEvent;
727
738
  */
728
739
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
729
740
  /**
730
- * Triggers the Make a copy action on a Liveboard
731
- * @example liveboardEmbed.trigger(HostEvent.MakeACopy)
741
+ * Triggers the Make a copy action on a Liveboard, search or visualization
742
+ * @example
743
+ * liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
744
+ * vizEmbed.trigger(HostEvent.MakeACopy)
745
+ * searchEmbed.trigger(HostEvent.MakeACopy)
732
746
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
733
747
  */
734
748
  HostEvent["MakeACopy"] = "makeACopy";
@@ -792,15 +806,74 @@ var HostEvent;
792
806
  /**
793
807
  * Get TML for the current search.
794
808
  * @example searchEmbed.trigger(HostEvent.GetTML)
795
- * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
809
+ * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
796
810
  */
797
811
  HostEvent["GetTML"] = "getTML";
812
+ /**
813
+ * Triggers the ShowUnderlyingData action on visualization or search
814
+ * @param - an object with vizId as a key
815
+ * @example
816
+ * liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
817
+ * vizEmbed.trigger(HostEvent.ShowUnderlyingData)
818
+ * searchEmbed.trigger(HostEvent.ShowUnderlyingData)
819
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
820
+ */
821
+ HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
822
+ /**
823
+ * Triggers the Delete action on visualization or search
824
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
825
+ * can be left empty for search and visualization embeds
826
+ * @example
827
+ * liveboardEmbed.trigger(HostEvent.Delete, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
828
+ * vizEmbed.trigger(HostEvent.Delete)
829
+ * searchEmbed.trigger(HostEvent.Delete)
830
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
831
+ */
832
+ HostEvent["Delete"] = "delete";
833
+ /**
834
+ * Triggers the SpotIQAnalyze action on visualization or search
835
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
836
+ * can be left empty for search and visualization embeds
837
+ * @example
838
+ * liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
839
+ * vizEmbed.trigger(HostEvent.SpotIQAnalyze)
840
+ * searchEmbed.trigger(HostEvent.SpotIQAnalyze)
841
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
842
+ */
843
+ HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
844
+ /**
845
+ * Triggers the Download action on visualization or search when Displaymode is Chart
846
+ * @example
847
+ * liveboardEmbed.trigger(HostEvent.Download, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
848
+ * vizEmbed.trigger(HostEvent.Download)
849
+ * searchEmbed.trigger(HostEvent.Download)
850
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
851
+ */
852
+ HostEvent["Download"] = "download";
853
+ /**
854
+ * Triggers the downloadAsCSV action on visualization or search when Displaymode is Table
855
+ * @example
856
+ * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
857
+ * vizEmbed.trigger(HostEvent.DownloadAsCsv)
858
+ * searchEmbed.trigger(HostEvent.DownloadAsCsv)
859
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
860
+ */
861
+ HostEvent["DownloadAsCsv"] = "downloadAsCSV";
862
+ /**
863
+ * Triggers the downloadAsXLSX action on visualization or search when Displaymode is Table
864
+ * @example
865
+ * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
866
+ * vizEmbed.trigger(HostEvent.DownloadAsXlsx)
867
+ * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
868
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
869
+ */
870
+ HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
798
871
  /**
799
872
  * Triggers the Share action on a liveboard or answer
800
873
  * @example
801
874
  * liveboardEmbed.trigger(HostEvent.Share)
802
875
  * searchEmbed.trigger(HostEvent.Share)
803
- * @version SDK: 1.19.0 | Thoughtspot: 9.0.0.cl, 9.0.1-sw
876
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
804
877
  */
805
878
  HostEvent["Share"] = "share";
806
879
  /**
@@ -808,9 +881,36 @@ var HostEvent;
808
881
  * @example
809
882
  * liveboardEmbed.trigger(HostEvent.Save)
810
883
  * searchEmbed.trigger(HostEvent.Save)
811
- * @version SDK: 1.19.0 | Thoughtspot: 9.0.0.cl, 9.0.1-sw
884
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
812
885
  */
813
886
  HostEvent["Save"] = "save";
887
+ /**
888
+ * Triggers the SyncToSheets action on visualization
889
+ * @param - an object with vizId as a key
890
+ * @example
891
+ * liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
892
+ * vizEmbed.trigger(HostEvent.SyncToSheets)
893
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
894
+ */
895
+ HostEvent["SyncToSheets"] = "sync-to-sheets";
896
+ /**
897
+ * Triggers the SyncToOtherApps action on visualization
898
+ * @param - an object with vizId as a key
899
+ * @example
900
+ * liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
901
+ * vizEmbed.trigger(HostEvent.SyncToOtherApps)
902
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
903
+ */
904
+ HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
905
+ /**
906
+ * Triggers the ManagePipelines action on visualization
907
+ * @param - an object with vizId as a key
908
+ * @example
909
+ * liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
910
+ * vizEmbed.trigger(HostEvent.ManagePipelines)
911
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
912
+ */
913
+ HostEvent["ManagePipelines"] = "manage-pipeline";
814
914
  })(HostEvent || (HostEvent = {}));
815
915
  /**
816
916
  * The different visual modes that the data sources panel within
@@ -9054,9 +9154,9 @@ const init = (embedConfig) => {
9054
9154
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
9055
9155
  authType: config.authType,
9056
9156
  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) !=
9157
+ usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
9158
+ 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,
9159
+ 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
9160
  null,
9061
9161
  });
9062
9162
  if (config.callPrefetch) {
@@ -9276,7 +9376,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
9276
9376
  });
9277
9377
  }
9278
9378
 
9279
- var name="@thoughtspot/visual-embed-sdk";var version="1.17.2-customcss";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};
9379
+ var name="@thoughtspot/visual-embed-sdk";var version="1.18.0-alpha.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports={".":"./lib/src/index.js","./react":{"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};
9280
9380
 
9281
9381
  /**
9282
9382
  * Copyright (c) 2022
@@ -9321,7 +9421,9 @@ class TsEmbed {
9321
9421
  this.appInitCb = (_, responder) => {
9322
9422
  responder({
9323
9423
  type: EmbedEvent.APP_INIT,
9324
- data: { customisations: getCustomisations(this.embedConfig) },
9424
+ data: {
9425
+ customisations: getCustomisations(this.embedConfig, this.viewConfig),
9426
+ },
9325
9427
  });
9326
9428
  };
9327
9429
  /**
@@ -9432,7 +9534,7 @@ class TsEmbed {
9432
9534
  * @returns queryParams
9433
9535
  */
9434
9536
  getBaseQueryParams() {
9435
- var _a;
9537
+ var _a, _b;
9436
9538
  const queryParams = {};
9437
9539
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
9438
9540
  // The below check is needed because TS Cloud firewall, blocks localhost/127.0.0.1
@@ -9453,18 +9555,16 @@ class TsEmbed {
9453
9555
  if (this.embedConfig.authType === AuthType.EmbeddedSSO) {
9454
9556
  queryParams[Param.ForceSAMLAutoRedirect] = true;
9455
9557
  }
9456
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, customCssUrl, } = this.viewConfig;
9558
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, customizations, } = this.viewConfig;
9457
9559
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
9458
9560
  this.handleError('You cannot have both hidden actions and visible actions');
9459
9561
  return queryParams;
9460
9562
  }
9461
- // TODO remove this
9462
- if (this.embedConfig.customCssUrl) {
9463
- queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
9464
- }
9465
- // If you need to override customCSS URL for a specific embed liveboard
9466
- if (customCssUrl) {
9467
- queryParams[Param.CustomCSSUrl] = customCssUrl;
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;
9468
9568
  }
9469
9569
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
9470
9570
  queryParams[Param.DisableActions] = disabledActions;
@@ -9723,7 +9823,7 @@ class TsEmbed {
9723
9823
  * @param messageType The event type
9724
9824
  * @param data The payload to send with the message
9725
9825
  */
9726
- trigger(messageType, data) {
9826
+ trigger(messageType, data = {}) {
9727
9827
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
9728
9828
  return processTrigger(this.iFrame, messageType, this.thoughtSpotHost, data);
9729
9829
  }
@@ -10140,7 +10240,7 @@ class SearchEmbed extends TsEmbed {
10140
10240
  */
10141
10241
  getIFrameSrc(answerId, dataSources) {
10142
10242
  var _a;
10143
- const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
10243
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
10144
10244
  const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
10145
10245
  const queryParams = this.getBaseQueryParams();
10146
10246
  queryParams[Param.HideActions] = [
@@ -10197,7 +10297,7 @@ class SearchEmbed extends TsEmbed {
10197
10297
  * Embed ThoughtSpot search bar
10198
10298
  *
10199
10299
  * @Category Search Embed
10200
- * @version: SDK: 1.17.0 | ThoughtSpot 8.10.0.cl, 9.0.1-sw
10300
+ * @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
10201
10301
  */
10202
10302
  class SearchBarEmbed extends TsEmbed {
10203
10303
  constructor(domSelector, viewConfig) {
package/dist/tsembed.js CHANGED
@@ -139,14 +139,22 @@
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
+ const customCssFromEmbedConfig = embedConfig.customCssUrl;
144
+ const customizationsFromViewConfig = viewConfig.customizations ||
145
+ viewConfig.customisations;
146
+ let customizations = embedConfig.customizations ||
147
+ embedConfig.customisations;
148
+ customizations = customizations || {};
149
+ customizations.style = customizations.style || {};
150
+ customizations.style.customCSSUrl =
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;
157
+ return customizations;
150
158
  };
151
159
  /**
152
160
  * Gets a reference to the DOM node given
@@ -661,7 +669,10 @@
661
669
  * Triggers the Pin action on an embedded object
662
670
  * @param - incase of Liveboard embed, takes in an object with vizId as a key
663
671
  * can be left empty for search and visualization embeds
664
- * @example liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
672
+ * @example
673
+ * liveboardEmbed.trigger(HostEvent.Pin, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
674
+ * vizEmbed.trigger(HostEvent.Pin)
675
+ * searchEmbed.trigger(HostEvent.Pin)
665
676
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
666
677
  */
667
678
  HostEvent["Pin"] = "pin";
@@ -708,8 +719,11 @@
708
719
  */
709
720
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
710
721
  /**
711
- * Triggers the Make a copy action on a Liveboard
712
- * @example liveboardEmbed.trigger(HostEvent.MakeACopy)
722
+ * Triggers the Make a copy action on a Liveboard, search or visualization
723
+ * @example
724
+ * liveboardEmbed.trigger(HostEvent.MakeACopy, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
725
+ * vizEmbed.trigger(HostEvent.MakeACopy)
726
+ * searchEmbed.trigger(HostEvent.MakeACopy)
713
727
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
714
728
  */
715
729
  HostEvent["MakeACopy"] = "makeACopy";
@@ -773,15 +787,74 @@
773
787
  /**
774
788
  * Get TML for the current search.
775
789
  * @example searchEmbed.trigger(HostEvent.GetTML)
776
- * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
790
+ * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl
777
791
  */
778
792
  HostEvent["GetTML"] = "getTML";
793
+ /**
794
+ * Triggers the ShowUnderlyingData action on visualization or search
795
+ * @param - an object with vizId as a key
796
+ * @example
797
+ * liveboardEmbed.trigger(HostEvent.ShowUnderlyingData, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
798
+ * vizEmbed.trigger(HostEvent.ShowUnderlyingData)
799
+ * searchEmbed.trigger(HostEvent.ShowUnderlyingData)
800
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
801
+ */
802
+ HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
803
+ /**
804
+ * Triggers the Delete action on visualization or search
805
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
806
+ * can be left empty for search and visualization embeds
807
+ * @example
808
+ * liveboardEmbed.trigger(HostEvent.Delete, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
809
+ * vizEmbed.trigger(HostEvent.Delete)
810
+ * searchEmbed.trigger(HostEvent.Delete)
811
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
812
+ */
813
+ HostEvent["Delete"] = "delete";
814
+ /**
815
+ * Triggers the SpotIQAnalyze action on visualization or search
816
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
817
+ * can be left empty for search and visualization embeds
818
+ * @example
819
+ * liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
820
+ * vizEmbed.trigger(HostEvent.SpotIQAnalyze)
821
+ * searchEmbed.trigger(HostEvent.SpotIQAnalyze)
822
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
823
+ */
824
+ HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
825
+ /**
826
+ * Triggers the Download action on visualization or search when Displaymode is Chart
827
+ * @example
828
+ * liveboardEmbed.trigger(HostEvent.Download, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
829
+ * vizEmbed.trigger(HostEvent.Download)
830
+ * searchEmbed.trigger(HostEvent.Download)
831
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
832
+ */
833
+ HostEvent["Download"] = "download";
834
+ /**
835
+ * Triggers the downloadAsCSV action on visualization or search when Displaymode is Table
836
+ * @example
837
+ * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
838
+ * vizEmbed.trigger(HostEvent.DownloadAsCsv)
839
+ * searchEmbed.trigger(HostEvent.DownloadAsCsv)
840
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
841
+ */
842
+ HostEvent["DownloadAsCsv"] = "downloadAsCSV";
843
+ /**
844
+ * Triggers the downloadAsXLSX action on visualization or search when Displaymode is Table
845
+ * @example
846
+ * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
847
+ * vizEmbed.trigger(HostEvent.DownloadAsXlsx)
848
+ * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
849
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
850
+ */
851
+ HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
779
852
  /**
780
853
  * Triggers the Share action on a liveboard or answer
781
854
  * @example
782
855
  * liveboardEmbed.trigger(HostEvent.Share)
783
856
  * searchEmbed.trigger(HostEvent.Share)
784
- * @version SDK: 1.19.0 | Thoughtspot: 9.0.0.cl, 9.0.1-sw
857
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
785
858
  */
786
859
  HostEvent["Share"] = "share";
787
860
  /**
@@ -789,9 +862,36 @@
789
862
  * @example
790
863
  * liveboardEmbed.trigger(HostEvent.Save)
791
864
  * searchEmbed.trigger(HostEvent.Save)
792
- * @version SDK: 1.19.0 | Thoughtspot: 9.0.0.cl, 9.0.1-sw
865
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
793
866
  */
794
867
  HostEvent["Save"] = "save";
868
+ /**
869
+ * Triggers the SyncToSheets action on visualization
870
+ * @param - an object with vizId as a key
871
+ * @example
872
+ * liveboardEmbed.trigger(HostEvent.SyncToSheets, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
873
+ * vizEmbed.trigger(HostEvent.SyncToSheets)
874
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
875
+ */
876
+ HostEvent["SyncToSheets"] = "sync-to-sheets";
877
+ /**
878
+ * Triggers the SyncToOtherApps action on visualization
879
+ * @param - an object with vizId as a key
880
+ * @example
881
+ * liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
882
+ * vizEmbed.trigger(HostEvent.SyncToOtherApps)
883
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
884
+ */
885
+ HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
886
+ /**
887
+ * Triggers the ManagePipelines action on visualization
888
+ * @param - an object with vizId as a key
889
+ * @example
890
+ * liveboardEmbed.trigger(HostEvent.ManagePipelines, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
891
+ * vizEmbed.trigger(HostEvent.ManagePipelines)
892
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1-sw
893
+ */
894
+ HostEvent["ManagePipelines"] = "manage-pipeline";
795
895
  })(exports.HostEvent || (exports.HostEvent = {}));
796
896
  (function (DataSourceVisualMode) {
797
897
  /**
@@ -9020,9 +9120,9 @@
9020
9120
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
9021
9121
  authType: config.authType,
9022
9122
  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) !=
9123
+ usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
9124
+ 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,
9125
+ 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
9126
  null,
9027
9127
  });
9028
9128
  if (config.callPrefetch) {
@@ -9242,7 +9342,7 @@
9242
9342
  });
9243
9343
  }
9244
9344
 
9245
- var name="@thoughtspot/visual-embed-sdk";var version="1.17.2-customcss";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};
9345
+ var name="@thoughtspot/visual-embed-sdk";var version="1.18.0-alpha.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**"];var exports$1={".":"./lib/src/index.js","./react":{"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};
9246
9346
 
9247
9347
  /**
9248
9348
  * Copyright (c) 2022
@@ -9287,7 +9387,9 @@
9287
9387
  this.appInitCb = (_, responder) => {
9288
9388
  responder({
9289
9389
  type: exports.EmbedEvent.APP_INIT,
9290
- data: { customisations: getCustomisations(this.embedConfig) },
9390
+ data: {
9391
+ customisations: getCustomisations(this.embedConfig, this.viewConfig),
9392
+ },
9291
9393
  });
9292
9394
  };
9293
9395
  /**
@@ -9398,7 +9500,7 @@
9398
9500
  * @returns queryParams
9399
9501
  */
9400
9502
  getBaseQueryParams() {
9401
- var _a;
9503
+ var _a, _b;
9402
9504
  const queryParams = {};
9403
9505
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
9404
9506
  // The below check is needed because TS Cloud firewall, blocks localhost/127.0.0.1
@@ -9419,18 +9521,16 @@
9419
9521
  if (this.embedConfig.authType === exports.AuthType.EmbeddedSSO) {
9420
9522
  queryParams[Param.ForceSAMLAutoRedirect] = true;
9421
9523
  }
9422
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, customCssUrl, } = this.viewConfig;
9524
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, showAlerts, additionalFlags, locale, customizations, } = this.viewConfig;
9423
9525
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
9424
9526
  this.handleError('You cannot have both hidden actions and visible actions');
9425
9527
  return queryParams;
9426
9528
  }
9427
- // TODO remove this
9428
- if (this.embedConfig.customCssUrl) {
9429
- queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
9430
- }
9431
- // If you need to override customCSS URL for a specific embed liveboard
9432
- if (customCssUrl) {
9433
- queryParams[Param.CustomCSSUrl] = customCssUrl;
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;
9434
9534
  }
9435
9535
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
9436
9536
  queryParams[Param.DisableActions] = disabledActions;
@@ -9689,7 +9789,7 @@
9689
9789
  * @param messageType The event type
9690
9790
  * @param data The payload to send with the message
9691
9791
  */
9692
- trigger(messageType, data) {
9792
+ trigger(messageType, data = {}) {
9693
9793
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
9694
9794
  return processTrigger(this.iFrame, messageType, this.thoughtSpotHost, data);
9695
9795
  }
@@ -10101,7 +10201,7 @@
10101
10201
  */
10102
10202
  getIFrameSrc(answerId, dataSources) {
10103
10203
  var _a;
10104
- const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
10204
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
10105
10205
  const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
10106
10206
  const queryParams = this.getBaseQueryParams();
10107
10207
  queryParams[Param.HideActions] = [
@@ -10158,7 +10258,7 @@
10158
10258
  * Embed ThoughtSpot search bar
10159
10259
  *
10160
10260
  * @Category Search Embed
10161
- * @version: SDK: 1.17.0 | ThoughtSpot 8.10.0.cl, 9.0.1-sw
10261
+ * @version: SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1-sw
10162
10262
  */
10163
10263
  class SearchBarEmbed extends TsEmbed {
10164
10264
  constructor(domSelector, viewConfig) {
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.17.2-customcss",
3
+ "version": "1.18.0-alpha.1",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -12,12 +12,16 @@
12
12
  ],
13
13
  "exports": {
14
14
  ".": "./lib/src/index.js",
15
- "./react": "./lib/src/react/index.js"
15
+ "./react": {
16
+ "import": "./lib/src/react/index.js",
17
+ "require": "./cjs/src/react.index.js",
18
+ "types": "./lib/src/react/index.d.ts"
19
+ }
16
20
  },
17
21
  "scripts": {
18
22
  "lint": "eslint 'src/**'",
19
23
  "lint:fix": "eslint 'src/**/*.*' --fix",
20
- "tsc": "tsc -p . --incremental false",
24
+ "tsc": "tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",
21
25
  "start": "gatsby develop",
22
26
  "build:gatsby": "npm run clean:gatsby && gatsby build --prefix-paths",
23
27
  "build:gatsby:noprefix": "npm run clean:gatsby && gatsby build",
@@ -117,7 +121,7 @@
117
121
  "typedoc": "0.21.6",
118
122
  "typedoc-neo-theme": "^1.1.0",
119
123
  "typedoc-plugin-toc-group": "0.0.5",
120
- "typescript": "^4.1.0",
124
+ "typescript": "^4.9.4",
121
125
  "url-search-params-polyfill": "^8.1.0",
122
126
  "util": "^0.12.4"
123
127
  },
@@ -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.