@thoughtspot/visual-embed-sdk 1.37.1 → 1.38.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 (114) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +1 -1
  3. package/cjs/src/embed/app.js +1 -1
  4. package/cjs/src/embed/app.js.map +1 -1
  5. package/cjs/src/embed/bodyless-conversation.d.ts +44 -9
  6. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  7. package/cjs/src/embed/bodyless-conversation.js +35 -5
  8. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  9. package/cjs/src/embed/bodyless-conversation.spec.js +290 -5
  10. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  11. package/cjs/src/embed/conversation.d.ts +40 -11
  12. package/cjs/src/embed/conversation.d.ts.map +1 -1
  13. package/cjs/src/embed/conversation.js +29 -4
  14. package/cjs/src/embed/conversation.js.map +1 -1
  15. package/cjs/src/embed/conversation.spec.js +7 -7
  16. package/cjs/src/embed/conversation.spec.js.map +1 -1
  17. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  18. package/cjs/src/embed/liveboard.js +21 -10
  19. package/cjs/src/embed/liveboard.js.map +1 -1
  20. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  21. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  22. package/cjs/src/index.d.ts +4 -4
  23. package/cjs/src/index.d.ts.map +1 -1
  24. package/cjs/src/index.js +5 -1
  25. package/cjs/src/index.js.map +1 -1
  26. package/cjs/src/react/all-types-export.d.ts +1 -1
  27. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  28. package/cjs/src/react/all-types-export.js +3 -1
  29. package/cjs/src/react/all-types-export.js.map +1 -1
  30. package/cjs/src/react/index.d.ts +53 -5
  31. package/cjs/src/react/index.d.ts.map +1 -1
  32. package/cjs/src/react/index.js +73 -4
  33. package/cjs/src/react/index.js.map +1 -1
  34. package/cjs/src/react/index.spec.js +94 -0
  35. package/cjs/src/react/index.spec.js.map +1 -1
  36. package/cjs/src/types.d.ts +2 -1
  37. package/cjs/src/types.d.ts.map +1 -1
  38. package/cjs/src/types.js +1 -0
  39. package/cjs/src/types.js.map +1 -1
  40. package/dist/{index-m9UtENc9.js → index-DeFzsyFF.js} +1 -1
  41. package/dist/index-NZYq1Tu3.js +7370 -0
  42. package/dist/src/embed/bodyless-conversation.d.ts +44 -9
  43. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  44. package/dist/src/embed/conversation.d.ts +40 -11
  45. package/dist/src/embed/conversation.d.ts.map +1 -1
  46. package/dist/src/embed/liveboard.d.ts.map +1 -1
  47. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  48. package/dist/src/index.d.ts +4 -4
  49. package/dist/src/index.d.ts.map +1 -1
  50. package/dist/src/react/all-types-export.d.ts +1 -1
  51. package/dist/src/react/all-types-export.d.ts.map +1 -1
  52. package/dist/src/react/index.d.ts +53 -5
  53. package/dist/src/react/index.d.ts.map +1 -1
  54. package/dist/src/types.d.ts +2 -1
  55. package/dist/src/types.d.ts.map +1 -1
  56. package/dist/tsembed-react.es.js +583 -21
  57. package/dist/tsembed-react.js +583 -19
  58. package/dist/tsembed.es.js +86 -22
  59. package/dist/tsembed.js +92 -26
  60. package/dist/visual-embed-sdk-react-full.d.ts +184 -72
  61. package/dist/visual-embed-sdk-react.d.ts +184 -72
  62. package/dist/visual-embed-sdk.d.ts +87 -22
  63. package/lib/package.json +1 -1
  64. package/lib/src/embed/app.js +1 -1
  65. package/lib/src/embed/app.js.map +1 -1
  66. package/lib/src/embed/bodyless-conversation.d.ts +44 -9
  67. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  68. package/lib/src/embed/bodyless-conversation.js +33 -4
  69. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  70. package/lib/src/embed/bodyless-conversation.spec.js +292 -7
  71. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  72. package/lib/src/embed/conversation.d.ts +40 -11
  73. package/lib/src/embed/conversation.d.ts.map +1 -1
  74. package/lib/src/embed/conversation.js +27 -3
  75. package/lib/src/embed/conversation.js.map +1 -1
  76. package/lib/src/embed/conversation.spec.js +8 -8
  77. package/lib/src/embed/conversation.spec.js.map +1 -1
  78. package/lib/src/embed/liveboard.d.ts.map +1 -1
  79. package/lib/src/embed/liveboard.js +21 -10
  80. package/lib/src/embed/liveboard.js.map +1 -1
  81. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  82. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  83. package/lib/src/index.d.ts +4 -4
  84. package/lib/src/index.d.ts.map +1 -1
  85. package/lib/src/index.js +4 -4
  86. package/lib/src/index.js.map +1 -1
  87. package/lib/src/react/all-types-export.d.ts +1 -1
  88. package/lib/src/react/all-types-export.d.ts.map +1 -1
  89. package/lib/src/react/all-types-export.js +1 -1
  90. package/lib/src/react/all-types-export.js.map +1 -1
  91. package/lib/src/react/index.d.ts +53 -5
  92. package/lib/src/react/index.d.ts.map +1 -1
  93. package/lib/src/react/index.js +73 -4
  94. package/lib/src/react/index.js.map +1 -1
  95. package/lib/src/react/index.spec.js +96 -2
  96. package/lib/src/react/index.spec.js.map +1 -1
  97. package/lib/src/types.d.ts +2 -1
  98. package/lib/src/types.d.ts.map +1 -1
  99. package/lib/src/types.js +1 -0
  100. package/lib/src/types.js.map +1 -1
  101. package/lib/src/visual-embed-sdk.d.ts +90 -25
  102. package/package.json +1 -1
  103. package/src/embed/app.ts +1 -1
  104. package/src/embed/bodyless-conversation.spec.ts +314 -7
  105. package/src/embed/bodyless-conversation.ts +53 -8
  106. package/src/embed/conversation.spec.ts +16 -16
  107. package/src/embed/conversation.ts +44 -11
  108. package/src/embed/liveboard.ts +25 -10
  109. package/src/embed/ts-embed.spec.ts +0 -2
  110. package/src/index.ts +16 -5
  111. package/src/react/all-types-export.ts +2 -0
  112. package/src/react/index.spec.tsx +157 -1
  113. package/src/react/index.tsx +98 -11
  114. package/src/types.ts +1 -0
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.37.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.38.0-alpha.1 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -2982,6 +2982,7 @@ var Param;
2982
2982
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2983
2983
  Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
2984
2984
  Param["PrimaryAction"] = "primaryAction";
2985
+ Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
2985
2986
  })(Param || (Param = {}));
2986
2987
  /**
2987
2988
  * ThoughtSpot application pages include actions and menu commands
@@ -7513,7 +7514,7 @@ class AnswerService {
7513
7514
  async getTML() {
7514
7515
  const { object } = await this.executeQuery(getAnswerTML, {});
7515
7516
  const edoc = object[0].edoc;
7516
- const YAML = await import('./index-m9UtENc9.js');
7517
+ const YAML = await import('./index-DeFzsyFF.js');
7517
7518
  const parsedDoc = YAML.parse(edoc);
7518
7519
  return {
7519
7520
  answer: {
@@ -15399,7 +15400,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15399
15400
  return e;
15400
15401
  }
15401
15402
 
15402
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.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/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.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","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.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","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@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/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.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",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.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-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",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:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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","embedded","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$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],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};
15403
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.38.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/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.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","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.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","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@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/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.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",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.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-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",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:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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","embedded","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$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],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};
15403
15404
 
15404
15405
  /**
15405
15406
  * Reloads the ThoughtSpot iframe.
@@ -16842,7 +16843,7 @@ class AppEmbed extends V1Embed {
16842
16843
  responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
16843
16844
  };
16844
16845
  this.setIframeHeightForNonEmbedLiveboard = (data) => {
16845
- const { height: frameHeight, ...restParams } = this.viewConfig.frameParams || {};
16846
+ const { height: frameHeight } = this.viewConfig.frameParams || {};
16846
16847
  const liveboardRelatedRoutes = [
16847
16848
  '/pinboard/',
16848
16849
  '/insights/pinboard/',
@@ -17137,12 +17138,6 @@ const addPreviewStylesIfNotPresent = () => {
17137
17138
  * @summary Liveboard & visualization embed
17138
17139
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
17139
17140
  */
17140
- const liveboardHeightWhitelistedRoutes = [
17141
- '/embed/viz/',
17142
- '/embed/insights/viz/',
17143
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
17144
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
17145
- ];
17146
17141
  /**
17147
17142
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
17148
17143
  * waits for the authentication to complete, so you need not wait for
@@ -17159,7 +17154,6 @@ const liveboardHeightWhitelistedRoutes = [
17159
17154
  * @group Embed components
17160
17155
  */
17161
17156
  class LiveboardEmbed extends V1Embed {
17162
- // eslint-disable-next-line no-useless-constructor
17163
17157
  constructor(domSelector, viewConfig) {
17164
17158
  viewConfig.embedComponentType = 'LiveboardEmbed';
17165
17159
  super(domSelector, viewConfig);
@@ -17177,13 +17171,30 @@ class LiveboardEmbed extends V1Embed {
17177
17171
  responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
17178
17172
  };
17179
17173
  this.setIframeHeightForNonEmbedLiveboard = (data) => {
17180
- const routePath = data.data.currentPath;
17181
- if (liveboardHeightWhitelistedRoutes.some((path) => routePath.startsWith(path))) {
17174
+ const { height: frameHeight } = this.viewConfig.frameParams || {};
17175
+ const liveboardRelatedRoutes = [
17176
+ '/pinboard/',
17177
+ '/insights/pinboard/',
17178
+ '/schedules/',
17179
+ '/embed/viz/',
17180
+ '/embed/insights/viz/',
17181
+ '/liveboard/',
17182
+ '/insights/liveboard/',
17183
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
17184
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
17185
+ ];
17186
+ if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
17187
+ // Ignore the height reset of the frame, if the navigation is
17188
+ // only within the liveboard page.
17182
17189
  return;
17183
17190
  }
17184
- this.setIFrameHeight(this.defaultHeight);
17191
+ this.setIFrameHeight(frameHeight || this.defaultHeight);
17185
17192
  };
17186
17193
  if (this.viewConfig.fullHeight === true) {
17194
+ if (this.viewConfig.vizId) {
17195
+ logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
17196
+ 'Using full height with vizId might lead to unexpected behavior.');
17197
+ }
17187
17198
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17188
17199
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17189
17200
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
@@ -18046,6 +18057,7 @@ class ConversationMessage extends TsEmbed {
18046
18057
  const path = 'conv-assist-answer';
18047
18058
  const queryParams = this.getBaseQueryParams();
18048
18059
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18060
+ queryParams[Param.isSpotterAgentEmbed] = true;
18049
18061
  let query = '';
18050
18062
  const queryParamsString = getQueryParamString(queryParams, true);
18051
18063
  if (queryParamsString) {
@@ -18071,9 +18083,9 @@ class ConversationMessage extends TsEmbed {
18071
18083
  * chatbots or other conversational interfaces.
18072
18084
  * @example
18073
18085
  * ```js
18074
- * import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
18086
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
18075
18087
  *
18076
- * const conversation = new BodylessConversation({
18088
+ * const conversation = new SpotterAgentEmbed({
18077
18089
  * worksheetId: 'worksheetId',
18078
18090
  * });
18079
18091
  *
@@ -18083,9 +18095,9 @@ class ConversationMessage extends TsEmbed {
18083
18095
  * document.body.appendChild(container); // or to any other element
18084
18096
  * ```
18085
18097
  * @group Embed components
18086
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
18098
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18087
18099
  */
18088
- class BodylessConversation {
18100
+ class SpotterAgentEmbed {
18089
18101
  constructor(viewConfig) {
18090
18102
  this.viewConfig = viewConfig;
18091
18103
  const embedConfig = getEmbedConfig();
@@ -18097,6 +18109,9 @@ class BodylessConversation {
18097
18109
  return { error };
18098
18110
  }
18099
18111
  const container = document.createElement('div');
18112
+ if (this.viewConfig.containerClassName) {
18113
+ container.className = this.viewConfig.containerClassName;
18114
+ }
18100
18115
  const embed = new ConversationMessage(container, {
18101
18116
  ...this.viewConfig,
18102
18117
  sessionId: data.sessionId,
@@ -18107,6 +18122,31 @@ class BodylessConversation {
18107
18122
  await embed.render();
18108
18123
  return { container, viz: embed };
18109
18124
  }
18125
+ }
18126
+ /**
18127
+ * Create a conversation embed, which can be integrated inside
18128
+ * chatbots or other conversational interfaces.
18129
+ * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18130
+ * Use {@link SpotterAgentEmbed} instead
18131
+ * @example
18132
+ * ```js
18133
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
18134
+ *
18135
+ * const conversation = new SpotterAgentEmbed({
18136
+ * worksheetId: 'worksheetId',
18137
+ * });
18138
+ *
18139
+ * const { container, error } = await conversation.sendMessage('show me sales by region');
18140
+ *
18141
+ * // append the container to the DOM
18142
+ * document.body.appendChild(container); // or to any other element
18143
+ * ```
18144
+ * @group Embed components
18145
+ */
18146
+ class BodylessConversation extends SpotterAgentEmbed {
18147
+ constructor(viewConfig) {
18148
+ super(viewConfig);
18149
+ }
18110
18150
  }
18111
18151
 
18112
18152
  /**
@@ -18137,7 +18177,7 @@ var isUndefined_1 = isUndefined;
18137
18177
  * @group Embed components
18138
18178
  * @example
18139
18179
  * ```js
18140
- * const conversation = new ConversationEmbed('#tsEmbed', {
18180
+ * const conversation = new SpotterEmbed('#tsEmbed', {
18141
18181
  * worksheetId: 'worksheetId',
18142
18182
  * searchOptions: {
18143
18183
  * searchQuery: 'searchQuery',
@@ -18145,9 +18185,9 @@ var isUndefined_1 = isUndefined;
18145
18185
  * });
18146
18186
  * conversation.render();
18147
18187
  * ```
18148
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
18188
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18149
18189
  */
18150
- class ConversationEmbed extends TsEmbed {
18190
+ class SpotterEmbed extends TsEmbed {
18151
18191
  constructor(container, viewConfig) {
18152
18192
  viewConfig.embedComponentType = 'conversation';
18153
18193
  super(container, viewConfig);
@@ -18193,6 +18233,30 @@ class ConversationEmbed extends TsEmbed {
18193
18233
  await this.renderIFrame(src);
18194
18234
  return this;
18195
18235
  }
18236
+ }
18237
+ /**
18238
+ * Embed ThoughtSpot AI Conversation.
18239
+ * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18240
+ * Use {@link SpotterEmbed} instead
18241
+ * @group Embed components
18242
+ * @example
18243
+ * ```js
18244
+ * const conversation = new SpotterEmbed('#tsEmbed', {
18245
+ * worksheetId: 'worksheetId',
18246
+ * searchOptions: {
18247
+ * searchQuery: 'searchQuery',
18248
+ * },
18249
+ * });
18250
+ * conversation.render();
18251
+ * ```
18252
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18253
+ */
18254
+ class ConversationEmbed extends SpotterEmbed {
18255
+ constructor(container, viewConfig) {
18256
+ viewConfig.embedComponentType = 'conversation';
18257
+ super(container, viewConfig);
18258
+ this.viewConfig = viewConfig;
18259
+ }
18196
18260
  }
18197
18261
 
18198
18262
  /**
@@ -18778,4 +18842,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
18778
18842
  return result;
18779
18843
  };
18780
18844
 
18781
- export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePageSearchBarMode, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
18845
+ export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.37.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.38.0-alpha.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -2988,6 +2988,7 @@
2988
2988
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2989
2989
  Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
2990
2990
  Param["PrimaryAction"] = "primaryAction";
2991
+ Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
2991
2992
  })(Param || (Param = {}));
2992
2993
  /**
2993
2994
  * ThoughtSpot application pages include actions and menu commands
@@ -15405,7 +15406,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15405
15406
  return e;
15406
15407
  }
15407
15408
 
15408
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.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/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.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","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.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","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@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/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.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",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.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-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",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:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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","embedded","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$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],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};
15409
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.38.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/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.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","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.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","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@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/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.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",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.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-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",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:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};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","embedded","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$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],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};
15409
15410
 
15410
15411
  /**
15411
15412
  * Reloads the ThoughtSpot iframe.
@@ -16803,7 +16804,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16803
16804
  * Define the version of the primary navbar
16804
16805
  * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
16805
16806
  */
16806
- var PrimaryNavbarVersion;
16807
+ exports.PrimaryNavbarVersion = void 0;
16807
16808
  (function (PrimaryNavbarVersion) {
16808
16809
  /**
16809
16810
  * Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
@@ -16811,19 +16812,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16811
16812
  * It serves as the foundational version of the PrimaryNavBar.
16812
16813
  */
16813
16814
  PrimaryNavbarVersion["Sliding"] = "v3";
16814
- })(PrimaryNavbarVersion || (PrimaryNavbarVersion = {}));
16815
+ })(exports.PrimaryNavbarVersion || (exports.PrimaryNavbarVersion = {}));
16815
16816
  /**
16816
16817
  * Define the version of the home page
16817
16818
  * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
16818
16819
  */
16819
- var HomePage;
16820
+ exports.HomePage = void 0;
16820
16821
  (function (HomePage) {
16821
16822
  /**
16822
16823
  * Modular (v2) introduces the updated Modular Home Experience.
16823
16824
  * It serves as the foundational version of the home page.
16824
16825
  */
16825
16826
  HomePage["Modular"] = "v2";
16826
- })(HomePage || (HomePage = {}));
16827
+ })(exports.HomePage || (exports.HomePage = {}));
16827
16828
  /**
16828
16829
  * Embeds full ThoughtSpot experience in a host application.
16829
16830
  * @group Embed components
@@ -16848,7 +16849,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16848
16849
  responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
16849
16850
  };
16850
16851
  this.setIframeHeightForNonEmbedLiveboard = (data) => {
16851
- const { height: frameHeight, ...restParams } = this.viewConfig.frameParams || {};
16852
+ const { height: frameHeight } = this.viewConfig.frameParams || {};
16852
16853
  const liveboardRelatedRoutes = [
16853
16854
  '/pinboard/',
16854
16855
  '/insights/pinboard/',
@@ -16955,12 +16956,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16955
16956
  }
16956
16957
  if (discoveryExperience) {
16957
16958
  // primaryNavbarVersion v3 will enabled the new left navigation
16958
- if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
16959
+ if (discoveryExperience.primaryNavbarVersion === exports.PrimaryNavbarVersion.Sliding) {
16959
16960
  params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
16960
16961
  }
16961
16962
  // homePage v2 will enable the modular home page
16962
16963
  // and it will override the modularHomeExperience value
16963
- if (discoveryExperience.homePage === HomePage.Modular) {
16964
+ if (discoveryExperience.homePage === exports.HomePage.Modular) {
16964
16965
  params[Param.ModularHomeExperienceEnabled] = true;
16965
16966
  }
16966
16967
  }
@@ -17143,12 +17144,6 @@ query GetEurekaVizSnapshots(
17143
17144
  * @summary Liveboard & visualization embed
17144
17145
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
17145
17146
  */
17146
- const liveboardHeightWhitelistedRoutes = [
17147
- '/embed/viz/',
17148
- '/embed/insights/viz/',
17149
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
17150
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
17151
- ];
17152
17147
  /**
17153
17148
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
17154
17149
  * waits for the authentication to complete, so you need not wait for
@@ -17165,7 +17160,6 @@ query GetEurekaVizSnapshots(
17165
17160
  * @group Embed components
17166
17161
  */
17167
17162
  class LiveboardEmbed extends V1Embed {
17168
- // eslint-disable-next-line no-useless-constructor
17169
17163
  constructor(domSelector, viewConfig) {
17170
17164
  viewConfig.embedComponentType = 'LiveboardEmbed';
17171
17165
  super(domSelector, viewConfig);
@@ -17183,13 +17177,30 @@ query GetEurekaVizSnapshots(
17183
17177
  responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
17184
17178
  };
17185
17179
  this.setIframeHeightForNonEmbedLiveboard = (data) => {
17186
- const routePath = data.data.currentPath;
17187
- if (liveboardHeightWhitelistedRoutes.some((path) => routePath.startsWith(path))) {
17180
+ const { height: frameHeight } = this.viewConfig.frameParams || {};
17181
+ const liveboardRelatedRoutes = [
17182
+ '/pinboard/',
17183
+ '/insights/pinboard/',
17184
+ '/schedules/',
17185
+ '/embed/viz/',
17186
+ '/embed/insights/viz/',
17187
+ '/liveboard/',
17188
+ '/insights/liveboard/',
17189
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
17190
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
17191
+ ];
17192
+ if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
17193
+ // Ignore the height reset of the frame, if the navigation is
17194
+ // only within the liveboard page.
17188
17195
  return;
17189
17196
  }
17190
- this.setIFrameHeight(this.defaultHeight);
17197
+ this.setIFrameHeight(frameHeight || this.defaultHeight);
17191
17198
  };
17192
17199
  if (this.viewConfig.fullHeight === true) {
17200
+ if (this.viewConfig.vizId) {
17201
+ logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
17202
+ 'Using full height with vizId might lead to unexpected behavior.');
17203
+ }
17193
17204
  this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17194
17205
  this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17195
17206
  this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
@@ -18052,6 +18063,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18052
18063
  const path = 'conv-assist-answer';
18053
18064
  const queryParams = this.getBaseQueryParams();
18054
18065
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18066
+ queryParams[Param.isSpotterAgentEmbed] = true;
18055
18067
  let query = '';
18056
18068
  const queryParamsString = getQueryParamString(queryParams, true);
18057
18069
  if (queryParamsString) {
@@ -18077,9 +18089,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18077
18089
  * chatbots or other conversational interfaces.
18078
18090
  * @example
18079
18091
  * ```js
18080
- * import { BodylessConversation } from '@thoughtspot/visual-embed-sdk';
18092
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
18081
18093
  *
18082
- * const conversation = new BodylessConversation({
18094
+ * const conversation = new SpotterAgentEmbed({
18083
18095
  * worksheetId: 'worksheetId',
18084
18096
  * });
18085
18097
  *
@@ -18089,9 +18101,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18089
18101
  * document.body.appendChild(container); // or to any other element
18090
18102
  * ```
18091
18103
  * @group Embed components
18092
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
18104
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18093
18105
  */
18094
- class BodylessConversation {
18106
+ class SpotterAgentEmbed {
18095
18107
  constructor(viewConfig) {
18096
18108
  this.viewConfig = viewConfig;
18097
18109
  const embedConfig = getEmbedConfig();
@@ -18103,6 +18115,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18103
18115
  return { error };
18104
18116
  }
18105
18117
  const container = document.createElement('div');
18118
+ if (this.viewConfig.containerClassName) {
18119
+ container.className = this.viewConfig.containerClassName;
18120
+ }
18106
18121
  const embed = new ConversationMessage(container, {
18107
18122
  ...this.viewConfig,
18108
18123
  sessionId: data.sessionId,
@@ -18113,6 +18128,31 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18113
18128
  await embed.render();
18114
18129
  return { container, viz: embed };
18115
18130
  }
18131
+ }
18132
+ /**
18133
+ * Create a conversation embed, which can be integrated inside
18134
+ * chatbots or other conversational interfaces.
18135
+ * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18136
+ * Use {@link SpotterAgentEmbed} instead
18137
+ * @example
18138
+ * ```js
18139
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
18140
+ *
18141
+ * const conversation = new SpotterAgentEmbed({
18142
+ * worksheetId: 'worksheetId',
18143
+ * });
18144
+ *
18145
+ * const { container, error } = await conversation.sendMessage('show me sales by region');
18146
+ *
18147
+ * // append the container to the DOM
18148
+ * document.body.appendChild(container); // or to any other element
18149
+ * ```
18150
+ * @group Embed components
18151
+ */
18152
+ class BodylessConversation extends SpotterAgentEmbed {
18153
+ constructor(viewConfig) {
18154
+ super(viewConfig);
18155
+ }
18116
18156
  }
18117
18157
 
18118
18158
  /**
@@ -18143,7 +18183,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18143
18183
  * @group Embed components
18144
18184
  * @example
18145
18185
  * ```js
18146
- * const conversation = new ConversationEmbed('#tsEmbed', {
18186
+ * const conversation = new SpotterEmbed('#tsEmbed', {
18147
18187
  * worksheetId: 'worksheetId',
18148
18188
  * searchOptions: {
18149
18189
  * searchQuery: 'searchQuery',
@@ -18151,9 +18191,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18151
18191
  * });
18152
18192
  * conversation.render();
18153
18193
  * ```
18154
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
18194
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18155
18195
  */
18156
- class ConversationEmbed extends TsEmbed {
18196
+ class SpotterEmbed extends TsEmbed {
18157
18197
  constructor(container, viewConfig) {
18158
18198
  viewConfig.embedComponentType = 'conversation';
18159
18199
  super(container, viewConfig);
@@ -18199,6 +18239,30 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18199
18239
  await this.renderIFrame(src);
18200
18240
  return this;
18201
18241
  }
18242
+ }
18243
+ /**
18244
+ * Embed ThoughtSpot AI Conversation.
18245
+ * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18246
+ * Use {@link SpotterEmbed} instead
18247
+ * @group Embed components
18248
+ * @example
18249
+ * ```js
18250
+ * const conversation = new SpotterEmbed('#tsEmbed', {
18251
+ * worksheetId: 'worksheetId',
18252
+ * searchOptions: {
18253
+ * searchQuery: 'searchQuery',
18254
+ * },
18255
+ * });
18256
+ * conversation.render();
18257
+ * ```
18258
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18259
+ */
18260
+ class ConversationEmbed extends SpotterEmbed {
18261
+ constructor(container, viewConfig) {
18262
+ viewConfig.embedComponentType = 'conversation';
18263
+ super(container, viewConfig);
18264
+ this.viewConfig = viewConfig;
18265
+ }
18202
18266
  }
18203
18267
 
18204
18268
  /**
@@ -26196,6 +26260,8 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
26196
26260
  exports.SageEmbed = SageEmbed;
26197
26261
  exports.SearchBarEmbed = SearchBarEmbed;
26198
26262
  exports.SearchEmbed = SearchEmbed;
26263
+ exports.SpotterAgentEmbed = SpotterAgentEmbed;
26264
+ exports.SpotterEmbed = SpotterEmbed;
26199
26265
  exports.createLiveboardWithAnswers = createLiveboardWithAnswers;
26200
26266
  exports.executeTML = executeTML;
26201
26267
  exports.exportTML = exportTML;