@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
  import * as React from 'react';
4
4
  import React__default, { useRef } from 'react';
@@ -3097,6 +3097,7 @@ var Param;
3097
3097
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
3098
3098
  Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
3099
3099
  Param["PrimaryAction"] = "primaryAction";
3100
+ Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
3100
3101
  })(Param || (Param = {}));
3101
3102
  /**
3102
3103
  * ThoughtSpot application pages include actions and menu commands
@@ -7628,7 +7629,7 @@ class AnswerService {
7628
7629
  async getTML() {
7629
7630
  const { object } = await this.executeQuery(getAnswerTML, {});
7630
7631
  const edoc = object[0].edoc;
7631
- const YAML = await import('./index-m9UtENc9.js');
7632
+ const YAML = await import('./index-DeFzsyFF.js');
7632
7633
  const parsedDoc = YAML.parse(edoc);
7633
7634
  return {
7634
7635
  answer: {
@@ -15348,7 +15349,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15348
15349
  return e;
15349
15350
  }
15350
15351
 
15351
- 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};
15352
+ 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};
15352
15353
 
15353
15354
  /**
15354
15355
  * Reloads the ThoughtSpot iframe.
@@ -17117,7 +17118,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17117
17118
  responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
17118
17119
  };
17119
17120
  this.setIframeHeightForNonEmbedLiveboard = (data) => {
17120
- const { height: frameHeight, ...restParams } = this.viewConfig.frameParams || {};
17121
+ const { height: frameHeight } = this.viewConfig.frameParams || {};
17121
17122
  const liveboardRelatedRoutes = [
17122
17123
  '/pinboard/',
17123
17124
  '/insights/pinboard/',
@@ -17412,12 +17413,6 @@ const addPreviewStylesIfNotPresent = () => {
17412
17413
  * @summary Liveboard & visualization embed
17413
17414
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
17414
17415
  */
17415
- const liveboardHeightWhitelistedRoutes = [
17416
- '/embed/viz/',
17417
- '/embed/insights/viz/',
17418
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
17419
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
17420
- ];
17421
17416
  /**
17422
17417
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
17423
17418
  * waits for the authentication to complete, so you need not wait for
@@ -17434,7 +17429,6 @@ const liveboardHeightWhitelistedRoutes = [
17434
17429
  * @group Embed components
17435
17430
  */
17436
17431
  let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17437
- // eslint-disable-next-line no-useless-constructor
17438
17432
  constructor(domSelector, viewConfig) {
17439
17433
  viewConfig.embedComponentType = 'LiveboardEmbed';
17440
17434
  super(domSelector, viewConfig);
@@ -17452,13 +17446,30 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17452
17446
  responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
17453
17447
  };
17454
17448
  this.setIframeHeightForNonEmbedLiveboard = (data) => {
17455
- const routePath = data.data.currentPath;
17456
- if (liveboardHeightWhitelistedRoutes.some((path) => routePath.startsWith(path))) {
17449
+ const { height: frameHeight } = this.viewConfig.frameParams || {};
17450
+ const liveboardRelatedRoutes = [
17451
+ '/pinboard/',
17452
+ '/insights/pinboard/',
17453
+ '/schedules/',
17454
+ '/embed/viz/',
17455
+ '/embed/insights/viz/',
17456
+ '/liveboard/',
17457
+ '/insights/liveboard/',
17458
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
17459
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
17460
+ ];
17461
+ if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
17462
+ // Ignore the height reset of the frame, if the navigation is
17463
+ // only within the liveboard page.
17457
17464
  return;
17458
17465
  }
17459
- this.setIFrameHeight(this.defaultHeight);
17466
+ this.setIFrameHeight(frameHeight || this.defaultHeight);
17460
17467
  };
17461
17468
  if (this.viewConfig.fullHeight === true) {
17469
+ if (this.viewConfig.vizId) {
17470
+ logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
17471
+ 'Using full height with vizId might lead to unexpected behavior.');
17472
+ }
17462
17473
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17463
17474
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17464
17475
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
@@ -17674,6 +17685,465 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17674
17685
  }
17675
17686
  };
17676
17687
 
17688
+ const createConversation = `
17689
+ mutation CreateConversation($params: Input_convassist_CreateConversationRequest) {
17690
+ ConvAssist__createConversation(request: $params) {
17691
+ convId
17692
+ initialCtx {
17693
+ type
17694
+ tsAnsCtx {
17695
+ sessionId
17696
+ genNo
17697
+ stateKey {
17698
+ transactionId
17699
+ generationNumber
17700
+ }
17701
+ worksheet {
17702
+ worksheetId
17703
+ worksheetName
17704
+ }
17705
+ }
17706
+ }
17707
+ }
17708
+ }
17709
+ `;
17710
+ const sendMessage = `
17711
+ query SendMessage($params: Input_convassist_SendMessageRequest) {
17712
+ ConvAssist__sendMessage(request: $params) {
17713
+ responses {
17714
+ timestamp
17715
+ msgId
17716
+ data {
17717
+ asstRespData {
17718
+ tool
17719
+ asstRespText
17720
+ nlsAnsData {
17721
+ sageQuerySuggestions {
17722
+ sageQueryTokens {
17723
+ additions {
17724
+ phrase {
17725
+ isCompletePhrase
17726
+ numTokens
17727
+ phraseType
17728
+ startIndex
17729
+ __typename
17730
+ }
17731
+ tokens {
17732
+ token
17733
+ dataType
17734
+ typeEnum
17735
+ guid
17736
+ tokenMetadata {
17737
+ name
17738
+ __typename
17739
+ }
17740
+ __typename
17741
+ }
17742
+ __typename
17743
+ }
17744
+ phrases {
17745
+ isCompletePhrase
17746
+ numTokens
17747
+ phraseType
17748
+ startIndex
17749
+ __typename
17750
+ }
17751
+ removals {
17752
+ phrase {
17753
+ isCompletePhrase
17754
+ numTokens
17755
+ phraseType
17756
+ startIndex
17757
+ __typename
17758
+ }
17759
+ tokens {
17760
+ token
17761
+ dataType
17762
+ typeEnum
17763
+ guid
17764
+ tokenMetadata {
17765
+ name
17766
+ __typename
17767
+ }
17768
+ __typename
17769
+ }
17770
+ __typename
17771
+ }
17772
+ tokens {
17773
+ token
17774
+ dataType
17775
+ typeEnum
17776
+ guid
17777
+ tokenMetadata {
17778
+ name
17779
+ __typename
17780
+ }
17781
+ __typename
17782
+ }
17783
+ __typename
17784
+ }
17785
+ llmReasoning {
17786
+ assumptions
17787
+ clarifications
17788
+ interpretation
17789
+ __typename
17790
+ }
17791
+ tokens
17792
+ tmlTokens
17793
+ worksheetId
17794
+ tokens
17795
+ description
17796
+ title
17797
+ tmlTokens
17798
+ cached
17799
+ sqlQuery
17800
+ sessionId
17801
+ genNo
17802
+ formulaInfo {
17803
+ name
17804
+ expression
17805
+ __typename
17806
+ }
17807
+ tmlPhrases
17808
+ ambiguousPhrases {
17809
+ alternativePhrases {
17810
+ phraseType
17811
+ token {
17812
+ token
17813
+ dataType
17814
+ typeEnum
17815
+ guid
17816
+ tokenMetadata {
17817
+ name
17818
+ __typename
17819
+ }
17820
+ __typename
17821
+ }
17822
+ __typename
17823
+ }
17824
+ ambiguityType
17825
+ token {
17826
+ token
17827
+ dataType
17828
+ typeEnum
17829
+ guid
17830
+ tokenMetadata {
17831
+ name
17832
+ __typename
17833
+ }
17834
+ __typename
17835
+ }
17836
+ __typename
17837
+ }
17838
+ ambiguousTokens {
17839
+ alternativeTokens {
17840
+ token
17841
+ dataType
17842
+ typeEnum
17843
+ guid
17844
+ tokenMetadata {
17845
+ name
17846
+ deprecatedTableGuid
17847
+ deprecatedTableName
17848
+ isFormula
17849
+ rootTables {
17850
+ created
17851
+ description
17852
+ guid
17853
+ indexVersion
17854
+ modified
17855
+ name
17856
+ __typename
17857
+ }
17858
+ schemaTableUserDefinedName
17859
+ table {
17860
+ created
17861
+ description
17862
+ guid
17863
+ indexVersion
17864
+ modified
17865
+ name
17866
+ __typename
17867
+ }
17868
+ __typename
17869
+ }
17870
+ __typename
17871
+ }
17872
+ ambiguityType
17873
+ token {
17874
+ token
17875
+ dataType
17876
+ typeEnum
17877
+ guid
17878
+ tokenMetadata {
17879
+ name
17880
+ __typename
17881
+ }
17882
+ __typename
17883
+ }
17884
+ __typename
17885
+ }
17886
+ stateKey {
17887
+ transactionId
17888
+ generationNumber
17889
+ transactionId
17890
+ __typename
17891
+ }
17892
+ subQueries {
17893
+ tokens
17894
+ cohortConfig {
17895
+ anchorColumnId
17896
+ cohortAnswerGuid
17897
+ cohortGroupingType
17898
+ cohortGuid
17899
+ cohortType
17900
+ combineNonGroupValues
17901
+ description
17902
+ groupExcludedQueryValues
17903
+ hideExcludedQueryValues
17904
+ isEditable
17905
+ name
17906
+ nullOutputValue
17907
+ returnColumnId
17908
+ __typename
17909
+ }
17910
+ formulas {
17911
+ name
17912
+ expression
17913
+ __typename
17914
+ }
17915
+ __typename
17916
+ }
17917
+ visualizationSuggestion {
17918
+ chartType
17919
+ displayMode
17920
+ axisConfigs {
17921
+ category
17922
+ color
17923
+ hidden
17924
+ size
17925
+ sort
17926
+ x
17927
+ y
17928
+ __typename
17929
+ }
17930
+ usersVizIntentApplied
17931
+ customChartConfigs {
17932
+ dimensions {
17933
+ columns
17934
+ key
17935
+ __typename
17936
+ }
17937
+ key
17938
+ __typename
17939
+ }
17940
+ customChartGuid
17941
+ __typename
17942
+ }
17943
+ tableData {
17944
+ columnDataLite {
17945
+ columnId
17946
+ columnDataType
17947
+ dataValue
17948
+ columnName
17949
+ __typename
17950
+ }
17951
+ __typename
17952
+ }
17953
+ warningType
17954
+ cached
17955
+ __typename
17956
+ }
17957
+ debugInfo {
17958
+ fewShotExamples {
17959
+ chartType
17960
+ id
17961
+ mappingId
17962
+ nlQuery
17963
+ nlQueryConcepts
17964
+ sageQuery
17965
+ scope
17966
+ sql
17967
+ tml
17968
+ __typename
17969
+ }
17970
+ __typename
17971
+ }
17972
+ __typename
17973
+ }
17974
+ __typename
17975
+ }
17976
+ errorData {
17977
+ tool
17978
+ errCode
17979
+ errTxt
17980
+ toolErrCode
17981
+ __typename
17982
+ }
17983
+ __typename
17984
+ }
17985
+ type
17986
+ __typename
17987
+ }
17988
+ prevCtx {
17989
+ genNo
17990
+ sessionId
17991
+ __typename
17992
+ }
17993
+ __typename
17994
+ }
17995
+ }
17996
+ `;
17997
+
17998
+ class Conversation {
17999
+ constructor(thoughtSpotHost, worksheetId) {
18000
+ this.thoughtSpotHost = thoughtSpotHost;
18001
+ this.worksheetId = worksheetId;
18002
+ this.inProgress = null;
18003
+ this.inProgress = this.init();
18004
+ }
18005
+ async init() {
18006
+ const { convId } = await this.createConversation();
18007
+ this.conversationId = convId;
18008
+ }
18009
+ createConversation() {
18010
+ return this.executeQuery(createConversation, {
18011
+ params: {
18012
+ initialCtx: {
18013
+ tsWorksheetCtx: {
18014
+ worksheet: {
18015
+ worksheetId: this.worksheetId,
18016
+ },
18017
+ },
18018
+ type: 'TS_WORKSHEET',
18019
+ },
18020
+ userInfo: {
18021
+ tenantUrl: `${this.thoughtSpotHost}/prism`,
18022
+ },
18023
+ },
18024
+ });
18025
+ }
18026
+ async sendMessage(userMessage) {
18027
+ await this.inProgress;
18028
+ try {
18029
+ const { responses } = await this.executeQuery(sendMessage, {
18030
+ params: {
18031
+ convId: this.conversationId,
18032
+ headers: [],
18033
+ msg: {
18034
+ data: {
18035
+ userCmdData: {
18036
+ cmdText: userMessage,
18037
+ nlsData: {
18038
+ worksheetId: this.worksheetId,
18039
+ questionType: 'ANSWER_SPEC_GENERATION',
18040
+ },
18041
+ },
18042
+ },
18043
+ msgId: crypto.randomUUID(),
18044
+ type: 'USER_COMMAND',
18045
+ },
18046
+ },
18047
+ });
18048
+ const data = responses[0].data;
18049
+ return {
18050
+ data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18051
+ error: null,
18052
+ };
18053
+ }
18054
+ catch (error) {
18055
+ return { error };
18056
+ }
18057
+ }
18058
+ async executeQuery(query, variables) {
18059
+ return graphqlQuery({
18060
+ query,
18061
+ variables,
18062
+ thoughtSpotHost: this.thoughtSpotHost,
18063
+ isCompositeQuery: false,
18064
+ });
18065
+ }
18066
+ }
18067
+
18068
+ class ConversationMessage extends TsEmbed {
18069
+ constructor(container, viewConfig) {
18070
+ viewConfig.embedComponentType = 'bodyless-conversation';
18071
+ super(container, viewConfig);
18072
+ this.viewConfig = viewConfig;
18073
+ }
18074
+ getIframeSrc() {
18075
+ var _a;
18076
+ const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18077
+ const path = 'conv-assist-answer';
18078
+ const queryParams = this.getBaseQueryParams();
18079
+ queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18080
+ queryParams[Param.isSpotterAgentEmbed] = true;
18081
+ let query = '';
18082
+ const queryParamsString = getQueryParamString(queryParams, true);
18083
+ if (queryParamsString) {
18084
+ query = `?${queryParamsString}`;
18085
+ }
18086
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams({
18087
+ sessionId,
18088
+ genNo,
18089
+ acSessionId,
18090
+ acGenNo,
18091
+ });
18092
+ return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18093
+ }
18094
+ async render() {
18095
+ await super.render();
18096
+ const src = this.getIframeSrc();
18097
+ await this.renderIFrame(src);
18098
+ return this;
18099
+ }
18100
+ }
18101
+ /**
18102
+ * Create a conversation embed, which can be integrated inside
18103
+ * chatbots or other conversational interfaces.
18104
+ * @example
18105
+ * ```js
18106
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
18107
+ *
18108
+ * const conversation = new SpotterAgentEmbed({
18109
+ * worksheetId: 'worksheetId',
18110
+ * });
18111
+ *
18112
+ * const { container, error } = await conversation.sendMessage('show me sales by region');
18113
+ *
18114
+ * // append the container to the DOM
18115
+ * document.body.appendChild(container); // or to any other element
18116
+ * ```
18117
+ * @group Embed components
18118
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18119
+ */
18120
+ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
18121
+ constructor(viewConfig) {
18122
+ this.viewConfig = viewConfig;
18123
+ const embedConfig = getEmbedConfig();
18124
+ this.conversationService = new Conversation(embedConfig.thoughtSpotHost, viewConfig.worksheetId);
18125
+ }
18126
+ async sendMessage(userMessage) {
18127
+ const { data, error } = await this.conversationService.sendMessage(userMessage);
18128
+ if (error) {
18129
+ return { error };
18130
+ }
18131
+ const container = document.createElement('div');
18132
+ if (this.viewConfig.containerClassName) {
18133
+ container.className = this.viewConfig.containerClassName;
18134
+ }
18135
+ const embed = new ConversationMessage(container, {
18136
+ ...this.viewConfig,
18137
+ sessionId: data.sessionId,
18138
+ genNo: data.genNo,
18139
+ acSessionId: data.stateKey.transactionId,
18140
+ acGenNo: data.stateKey.generationNumber,
18141
+ });
18142
+ await embed.render();
18143
+ return { container, viz: embed };
18144
+ }
18145
+ };
18146
+
17677
18147
  /**
17678
18148
  *
17679
18149
  * @param props
@@ -17722,7 +18192,7 @@ var isUndefined_1 = isUndefined;
17722
18192
  * @group Embed components
17723
18193
  * @example
17724
18194
  * ```js
17725
- * const conversation = new ConversationEmbed('#tsEmbed', {
18195
+ * const conversation = new SpotterEmbed('#tsEmbed', {
17726
18196
  * worksheetId: 'worksheetId',
17727
18197
  * searchOptions: {
17728
18198
  * searchQuery: 'searchQuery',
@@ -17730,9 +18200,9 @@ var isUndefined_1 = isUndefined;
17730
18200
  * });
17731
18201
  * conversation.render();
17732
18202
  * ```
17733
- * @version SDK: 1.33.1 | ThoughtSpot: 10.5.0.cl
18203
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
17734
18204
  */
17735
- let ConversationEmbed$1 = class ConversationEmbed extends TsEmbed {
18205
+ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
17736
18206
  constructor(container, viewConfig) {
17737
18207
  viewConfig.embedComponentType = 'conversation';
17738
18208
  super(container, viewConfig);
@@ -17778,6 +18248,30 @@ let ConversationEmbed$1 = class ConversationEmbed extends TsEmbed {
17778
18248
  await this.renderIFrame(src);
17779
18249
  return this;
17780
18250
  }
18251
+ };
18252
+ /**
18253
+ * Embed ThoughtSpot AI Conversation.
18254
+ * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18255
+ * Use {@link SpotterEmbed} instead
18256
+ * @group Embed components
18257
+ * @example
18258
+ * ```js
18259
+ * const conversation = new SpotterEmbed('#tsEmbed', {
18260
+ * worksheetId: 'worksheetId',
18261
+ * searchOptions: {
18262
+ * searchQuery: 'searchQuery',
18263
+ * },
18264
+ * });
18265
+ * conversation.render();
18266
+ * ```
18267
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18268
+ */
18269
+ let ConversationEmbed$1 = class ConversationEmbed extends SpotterEmbed$1 {
18270
+ constructor(container, viewConfig) {
18271
+ viewConfig.embedComponentType = 'conversation';
18272
+ super(container, viewConfig);
18273
+ this.viewConfig = viewConfig;
18274
+ }
17781
18275
  };
17782
18276
 
17783
18277
  const componentFactory = (EmbedConstructor,
@@ -17994,6 +18488,24 @@ const PreRenderedSageEmbed = componentFactory(SageEmbed$1, true);
17994
18488
  * @example
17995
18489
  * ```tsx
17996
18490
  * function Sage() {
18491
+ * return <SpotterEmbed
18492
+ * worksheetId="<worksheet-id-here>"
18493
+ * searchOptions={{
18494
+ * searchQuery: "<search query to start with>"
18495
+ * }}
18496
+ * ... other view config props or event listeners.
18497
+ * />
18498
+ * }
18499
+ * ```
18500
+ */
18501
+ const SpotterEmbed = componentFactory(SpotterEmbed$1);
18502
+ /**
18503
+ * React component for LLM based conversation BI.
18504
+ * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18505
+ * Use {@link SpotterEmbed} instead
18506
+ * @example
18507
+ * ```tsx
18508
+ * function Sage() {
17997
18509
  * return <ConversationEmbed
17998
18510
  * worksheetId="<worksheet-id-here>"
17999
18511
  * searchOptions={{
@@ -18005,10 +18517,60 @@ const PreRenderedSageEmbed = componentFactory(SageEmbed$1, true);
18005
18517
  * ```
18006
18518
  */
18007
18519
  const ConversationEmbed = componentFactory(ConversationEmbed$1);
18520
+ /**
18521
+ * React component for SpotterAgent embed, which can be integrated inside
18522
+ * chatbots or other conversational interfaces.
18523
+ * @example
18524
+ * ```tsx
18525
+ * function SpotterAgent() {
18526
+ * const ref = useRef();
18527
+ *
18528
+ * const handleSendMessage = async () => {
18529
+ * const { container, error } = await ref.current.sendMessage('show me sales by region');
18530
+ * if (container) {
18531
+ * document.body.appendChild(container);
18532
+ * }
18533
+ * };
18534
+ *
18535
+ * return (
18536
+ * <div>
18537
+ * <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
18538
+ * <button onClick={handleSendMessage}>Send Message</button>
18539
+ * </div>
18540
+ * );
18541
+ * }
18542
+ * ```
18543
+ */
18544
+ const SpotterAgentEmbed = React__default.forwardRef((props, ref) => {
18545
+ const { className, ...restProps } = props;
18546
+ const serviceRef = useRef(null);
18547
+ useDeepCompareEffect(() => {
18548
+ if (serviceRef.current) {
18549
+ serviceRef.current = null;
18550
+ }
18551
+ const configProps = {
18552
+ ...restProps,
18553
+ ...(className ? { containerClassName: className } : {})
18554
+ };
18555
+ serviceRef.current = new SpotterAgentEmbed$1(configProps);
18556
+ if (ref) {
18557
+ if (typeof ref === 'function') {
18558
+ ref(serviceRef.current);
18559
+ }
18560
+ else {
18561
+ ref.current = serviceRef.current;
18562
+ }
18563
+ }
18564
+ return () => {
18565
+ serviceRef.current = null;
18566
+ };
18567
+ }, [props]);
18568
+ return null;
18569
+ });
18008
18570
  /**
18009
18571
  * React component for PreRendered Conversation embed.
18010
18572
  *
18011
- * PreRenderedConversationEmbed will preRender the ConversationEmbed and will be hidden by
18573
+ * PreRenderedConversationEmbed will preRender the SpotterEmbed and will be hidden by
18012
18574
  * default.
18013
18575
  *
18014
18576
  * SageEmbed with preRenderId passed will call showPreRender on the embed.
@@ -18019,11 +18581,11 @@ const ConversationEmbed = componentFactory(ConversationEmbed$1);
18019
18581
  * }
18020
18582
  * ```
18021
18583
  * function MyComponent() {
18022
- * return <ConversationEmbed preRenderId="someId" worksheetId="id" />
18584
+ * return <SpotterEmbed preRenderId="someId" worksheetId="id" />
18023
18585
  * }
18024
18586
  * ```
18025
18587
  */
18026
- const PreRenderedConversationEmbed = componentFactory(ConversationEmbed$1, true);
18588
+ const PreRenderedConversationEmbed = componentFactory(SpotterEmbed$1, true);
18027
18589
  /**
18028
18590
  * Get a reference to the embed component to trigger events on the component.
18029
18591
  * @example
@@ -18065,4 +18627,4 @@ function useInit(config) {
18065
18627
  return ref;
18066
18628
  }
18067
18629
 
18068
- export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, getSessionInfo, useEmbedRef, useInit };
18630
+ export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, getSessionInfo, useEmbedRef, useInit };