@thoughtspot/visual-embed-sdk 1.39.1 → 1.39.2-spotter-agent

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 (181) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/config.spec.js +9 -0
  3. package/cjs/src/config.spec.js.map +1 -1
  4. package/cjs/src/embed/app.d.ts.map +1 -1
  5. package/cjs/src/embed/app.js +2 -1
  6. package/cjs/src/embed/app.js.map +1 -1
  7. package/cjs/src/embed/app.spec.js +18 -8
  8. package/cjs/src/embed/app.spec.js.map +1 -1
  9. package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
  10. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  11. package/cjs/src/embed/bodyless-conversation.js +24 -4
  12. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  13. package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
  14. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  15. package/cjs/src/embed/conversation.spec.js +28 -0
  16. package/cjs/src/embed/conversation.spec.js.map +1 -1
  17. package/cjs/src/embed/embedConfig.d.ts +9 -7
  18. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  19. package/cjs/src/embed/embedConfig.js +9 -7
  20. package/cjs/src/embed/embedConfig.js.map +1 -1
  21. package/cjs/src/embed/liveboard.d.ts +0 -17
  22. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  23. package/cjs/src/embed/liveboard.js +2 -4
  24. package/cjs/src/embed/liveboard.js.map +1 -1
  25. package/cjs/src/embed/liveboard.spec.js +12 -11
  26. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  27. package/cjs/src/embed/ts-embed.d.ts +5 -0
  28. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  29. package/cjs/src/embed/ts-embed.js +16 -1
  30. package/cjs/src/embed/ts-embed.js.map +1 -1
  31. package/cjs/src/embed/ts-embed.spec.js +164 -0
  32. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  33. package/cjs/src/errors.d.ts +1 -0
  34. package/cjs/src/errors.d.ts.map +1 -1
  35. package/cjs/src/errors.js +1 -0
  36. package/cjs/src/errors.js.map +1 -1
  37. package/cjs/src/pages/embed-test.page.d.ts +8 -0
  38. package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
  39. package/cjs/src/pages/embed-test.page.js +20 -0
  40. package/cjs/src/pages/embed-test.page.js.map +1 -0
  41. package/cjs/src/pages/home.page.d.ts +6 -0
  42. package/cjs/src/pages/home.page.d.ts.map +1 -0
  43. package/cjs/src/pages/home.page.js +12 -0
  44. package/cjs/src/pages/home.page.js.map +1 -0
  45. package/cjs/src/pages/login.page.d.ts +15 -0
  46. package/cjs/src/pages/login.page.d.ts.map +1 -0
  47. package/cjs/src/pages/login.page.js +22 -0
  48. package/cjs/src/pages/login.page.js.map +1 -0
  49. package/cjs/src/react/all-types-export.d.ts +1 -1
  50. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  51. package/cjs/src/react/all-types-export.js +3 -2
  52. package/cjs/src/react/all-types-export.js.map +1 -1
  53. package/cjs/src/react/index.d.ts +71 -20
  54. package/cjs/src/react/index.d.ts.map +1 -1
  55. package/cjs/src/react/index.js +79 -42
  56. package/cjs/src/react/index.js.map +1 -1
  57. package/cjs/src/react/index.spec.js +436 -100
  58. package/cjs/src/react/index.spec.js.map +1 -1
  59. package/cjs/src/tests/auth.test.d.ts +1 -0
  60. package/cjs/src/tests/auth.test.d.ts.map +1 -0
  61. package/cjs/src/tests/auth.test.js +1 -0
  62. package/cjs/src/tests/auth.test.js.map +1 -0
  63. package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
  64. package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
  65. package/cjs/src/tests/e2e/auth.spec.js +54 -0
  66. package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
  67. package/cjs/src/types.d.ts +34 -2
  68. package/cjs/src/types.d.ts.map +1 -1
  69. package/cjs/src/types.js +17 -1
  70. package/cjs/src/types.js.map +1 -1
  71. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  72. package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
  73. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  74. package/cjs/src/utils.spec.js +25 -0
  75. package/cjs/src/utils.spec.js.map +1 -1
  76. package/dist/index-2QHwuA-G.js +7371 -0
  77. package/dist/index-Cj4BVGHL.js +7371 -0
  78. package/dist/index-DUaG1OG2.js +7447 -0
  79. package/dist/{index-JaFaxrvQ.js → index-DnIvX1FR.js} +1 -1
  80. package/dist/index-Fhk1V_Gw.js +7371 -0
  81. package/dist/index-OuiZF3zE.js +7371 -0
  82. package/dist/src/embed/app.d.ts.map +1 -1
  83. package/dist/src/embed/bodyless-conversation.d.ts +19 -7
  84. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  85. package/dist/src/embed/embedConfig.d.ts +9 -7
  86. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  87. package/dist/src/embed/liveboard.d.ts +0 -17
  88. package/dist/src/embed/liveboard.d.ts.map +1 -1
  89. package/dist/src/embed/ts-embed.d.ts +5 -0
  90. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  91. package/dist/src/errors.d.ts +1 -0
  92. package/dist/src/errors.d.ts.map +1 -1
  93. package/dist/src/react/all-types-export.d.ts +1 -1
  94. package/dist/src/react/all-types-export.d.ts.map +1 -1
  95. package/dist/src/react/index.d.ts +71 -20
  96. package/dist/src/react/index.d.ts.map +1 -1
  97. package/dist/src/types.d.ts +34 -2
  98. package/dist/src/types.d.ts.map +1 -1
  99. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  100. package/dist/tsembed-react.es.js +157 -68
  101. package/dist/tsembed-react.js +157 -66
  102. package/dist/tsembed.es.js +74 -20
  103. package/dist/tsembed.js +73 -19
  104. package/dist/visual-embed-sdk-react-full.d.ts +132 -52
  105. package/dist/visual-embed-sdk-react.d.ts +132 -52
  106. package/dist/visual-embed-sdk.d.ts +62 -33
  107. package/lib/package.json +1 -1
  108. package/lib/src/config.spec.js +9 -0
  109. package/lib/src/config.spec.js.map +1 -1
  110. package/lib/src/embed/app.d.ts.map +1 -1
  111. package/lib/src/embed/app.js +2 -1
  112. package/lib/src/embed/app.js.map +1 -1
  113. package/lib/src/embed/app.spec.js +19 -9
  114. package/lib/src/embed/app.spec.js.map +1 -1
  115. package/lib/src/embed/bodyless-conversation.d.ts +19 -7
  116. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  117. package/lib/src/embed/bodyless-conversation.js +23 -4
  118. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  119. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  120. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  121. package/lib/src/embed/conversation.spec.js +30 -2
  122. package/lib/src/embed/conversation.spec.js.map +1 -1
  123. package/lib/src/embed/embedConfig.d.ts +9 -7
  124. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  125. package/lib/src/embed/embedConfig.js +9 -7
  126. package/lib/src/embed/embedConfig.js.map +1 -1
  127. package/lib/src/embed/liveboard.d.ts +0 -17
  128. package/lib/src/embed/liveboard.d.ts.map +1 -1
  129. package/lib/src/embed/liveboard.js +2 -4
  130. package/lib/src/embed/liveboard.js.map +1 -1
  131. package/lib/src/embed/liveboard.spec.js +12 -11
  132. package/lib/src/embed/liveboard.spec.js.map +1 -1
  133. package/lib/src/embed/ts-embed.d.ts +5 -0
  134. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  135. package/lib/src/embed/ts-embed.js +16 -1
  136. package/lib/src/embed/ts-embed.js.map +1 -1
  137. package/lib/src/embed/ts-embed.spec.js +164 -0
  138. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  139. package/lib/src/errors.d.ts +1 -0
  140. package/lib/src/errors.d.ts.map +1 -1
  141. package/lib/src/errors.js +1 -0
  142. package/lib/src/errors.js.map +1 -1
  143. package/lib/src/react/all-types-export.d.ts +1 -1
  144. package/lib/src/react/all-types-export.d.ts.map +1 -1
  145. package/lib/src/react/all-types-export.js +1 -1
  146. package/lib/src/react/all-types-export.js.map +1 -1
  147. package/lib/src/react/index.d.ts +71 -20
  148. package/lib/src/react/index.d.ts.map +1 -1
  149. package/lib/src/react/index.js +79 -43
  150. package/lib/src/react/index.js.map +1 -1
  151. package/lib/src/react/index.spec.js +439 -103
  152. package/lib/src/react/index.spec.js.map +1 -1
  153. package/lib/src/types.d.ts +34 -2
  154. package/lib/src/types.d.ts.map +1 -1
  155. package/lib/src/types.js +17 -1
  156. package/lib/src/types.js.map +1 -1
  157. package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  158. package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
  159. package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  160. package/lib/src/utils.spec.js +26 -1
  161. package/lib/src/utils.spec.js.map +1 -1
  162. package/lib/src/visual-embed-sdk.d.ts +62 -33
  163. package/package.json +1 -1
  164. package/src/config.spec.ts +11 -0
  165. package/src/embed/app.spec.ts +36 -23
  166. package/src/embed/app.ts +2 -0
  167. package/src/embed/bodyless-conversation.spec.ts +9 -203
  168. package/src/embed/bodyless-conversation.ts +24 -10
  169. package/src/embed/conversation.spec.ts +40 -2
  170. package/src/embed/embedConfig.ts +10 -8
  171. package/src/embed/liveboard.spec.ts +5 -4
  172. package/src/embed/liveboard.ts +2 -22
  173. package/src/embed/ts-embed.spec.ts +225 -0
  174. package/src/embed/ts-embed.ts +19 -0
  175. package/src/errors.ts +1 -0
  176. package/src/react/all-types-export.ts +2 -1
  177. package/src/react/index.spec.tsx +556 -157
  178. package/src/react/index.tsx +117 -51
  179. package/src/types.ts +75 -43
  180. package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
  181. package/src/utils.spec.ts +29 -0
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.39.2-spotter-agent */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
@@ -2830,7 +2830,7 @@
2830
2830
  Param["DataSourceId"] = "dataSourceId";
2831
2831
  Param["preAuthCache"] = "preAuthCache";
2832
2832
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2833
- Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
2833
+ Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
2834
2834
  Param["PrimaryAction"] = "primaryAction";
2835
2835
  Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
2836
2836
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
@@ -4056,6 +4056,22 @@
4056
4056
  * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
4057
4057
  */
4058
4058
  Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
4059
+ /**
4060
+ * Action ID for hide or disable the
4061
+ * Spotter in conversation training widget.
4062
+ * The Add to Coaching feature is currently in beta
4063
+ * and is disabled by default on embed deployments.
4064
+ * To enable this feature on your instance,
4065
+ * contact ThoughtSpot Support.
4066
+ * @example
4067
+ * ```js
4068
+ * hiddenAction: [Action.InConversationTraining]
4069
+ * disabledActions: [Action.InConversationTraining]
4070
+ *
4071
+ * ```
4072
+ * @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
4073
+ */
4074
+ Action["InConversationTraining"] = "InConversationTraining";
4059
4075
  })(exports.Action || (exports.Action = {}));
4060
4076
  var PrefetchFeatures;
4061
4077
  (function (PrefetchFeatures) {
@@ -6891,6 +6907,7 @@
6891
6907
  CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
6892
6908
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
6893
6909
  RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
6910
+ SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
6894
6911
  };
6895
6912
 
6896
6913
  const EndPoints = {
@@ -7098,13 +7115,14 @@
7098
7115
  *
7099
7116
  * @example
7100
7117
  * ```js
7118
+ * import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
7119
+ * // Call the getInitConfig method to retrieve the embed configuration
7101
7120
  * const config = getInitConfig();
7121
+ * // Log the configuration settings
7102
7122
  * console.log(config);
7103
7123
  * ```
7104
- * @example
7105
- *
7106
- * Returns the `EmbedConfig` object, which
7107
- * contains the configuration settings used to
7124
+ * Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
7125
+ * object, which contains the configuration settings used to
7108
7126
  * initialize the SDK, including the following:
7109
7127
  *
7110
7128
  * - `thoughtSpotHost` - ThoughtSpot host URL
@@ -7113,9 +7131,10 @@
7113
7131
  * - `customizations` - Style, text, and icon customization settings
7114
7132
  * that were applied during the SDK initialization.
7115
7133
  *
7116
- * For a comprehensive list of embed configuration settings,
7117
- * see link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[Developer Documentation].
7134
+ * The following JSON output shows the embed configuration
7135
+ * settings returned from the code in the previous example:
7118
7136
  *
7137
+ * @example
7119
7138
  * ```json
7120
7139
  * {
7121
7140
  * "thoughtSpotHost": "https://{ThoughtSpot-Host}",
@@ -7137,7 +7156,7 @@
7137
7156
  * "authTriggerContainer": "#your-own-div"
7138
7157
  * }
7139
7158
  * ```
7140
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.cl, and later
7159
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
7141
7160
  * @group Global methods
7142
7161
  */
7143
7162
  const getEmbedConfig = () => getValueFromWindow(configKey) || {};
@@ -15513,7 +15532,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15513
15532
  return e;
15514
15533
  }
15515
15534
 
15516
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.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};
15535
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-spotter-agent";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};
15517
15536
 
15518
15537
  /**
15519
15538
  * Reloads the ThoughtSpot iframe.
@@ -15911,10 +15930,25 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15911
15930
  // - cached auth info would be for wrong org
15912
15931
  // - info call response changes for each different overrideOrgId
15913
15932
  // 2. disablePreauthCache is explicitly set to true
15933
+ // 3. FullAppEmbed has primary navbar visible since:
15934
+ // - primary navbar requires fresh auth state for navigation
15935
+ // - cached auth may not reflect current user permissions
15914
15936
  const isDisabled = (this.viewConfig.overrideOrgId !== undefined
15915
- || this.embedConfig.disablePreauthCache === true);
15937
+ || this.embedConfig.disablePreauthCache === true
15938
+ || this.isFullAppEmbedWithVisiblePrimaryNavbar());
15916
15939
  return !isDisabled;
15917
15940
  }
15941
+ /**
15942
+ * Checks if current embed is FullAppEmbed with visible primary navbar
15943
+ * @returns boolean
15944
+ */
15945
+ isFullAppEmbedWithVisiblePrimaryNavbar() {
15946
+ const appViewConfig = this.viewConfig;
15947
+ // Check if this is a FullAppEmbed (AppEmbed)
15948
+ // showPrimaryNavbar defaults to true if not explicitly set to false
15949
+ return (appViewConfig.embedComponentType === 'AppEmbed'
15950
+ && appViewConfig.showPrimaryNavbar === true);
15951
+ }
15918
15952
  /**
15919
15953
  * fix for ts7.sep.cl
15920
15954
  * will be removed for ts7.oct.cl
@@ -17376,7 +17410,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17376
17410
  getEmbedParams() {
17377
17411
  const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17378
17412
  /* eslint-disable-next-line max-len */
17379
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17413
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17380
17414
  let params = {};
17381
17415
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17382
17416
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17392,6 +17426,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17392
17426
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
17393
17427
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17394
17428
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17429
+ params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
17395
17430
  params = this.getBaseQueryParams(params);
17396
17431
  if (hideObjectSearch) {
17397
17432
  params[Param.HideObjectSearch] = !!hideObjectSearch;
@@ -17711,7 +17746,7 @@ query GetEurekaVizSnapshots(
17711
17746
  getEmbedParams() {
17712
17747
  let params = {};
17713
17748
  params = this.getBaseQueryParams(params);
17714
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17749
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17715
17750
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
17716
17751
  || this.viewConfig.preventPinboardFilterRemoval;
17717
17752
  if (fullHeight === true) {
@@ -17763,9 +17798,6 @@ query GetEurekaVizSnapshots(
17763
17798
  if (dataSourceId !== undefined) {
17764
17799
  params[Param.DataSourceId] = dataSourceId;
17765
17800
  }
17766
- if (coverAndFilterOptionInPDF !== undefined) {
17767
- params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17768
- }
17769
17801
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
17770
17802
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
17771
17803
  }
@@ -17776,6 +17808,7 @@ query GetEurekaVizSnapshots(
17776
17808
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17777
17809
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17778
17810
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17811
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17779
17812
  const queryParams = getQueryParamString(params, true);
17780
17813
  return queryParams;
17781
17814
  }
@@ -18279,6 +18312,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18279
18312
  });
18280
18313
  const data = responses[0].data;
18281
18314
  return {
18315
+ convId: this.conversationId,
18316
+ messageId: responses[0].msgId,
18282
18317
  data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18283
18318
  error: null,
18284
18319
  };
@@ -18297,7 +18332,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18297
18332
  }
18298
18333
  }
18299
18334
 
18300
- class ConversationMessage extends TsEmbed {
18335
+ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
18301
18336
  constructor(container, viewConfig) {
18302
18337
  viewConfig.embedComponentType = 'bodyless-conversation';
18303
18338
  super(container, viewConfig);
@@ -18329,7 +18364,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18329
18364
  await this.renderIFrame(src);
18330
18365
  return this;
18331
18366
  }
18332
- }
18367
+ };
18333
18368
  /**
18334
18369
  * Create a conversation embed, which can be integrated inside
18335
18370
  * chatbots or other conversational interfaces.
@@ -18349,7 +18384,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18349
18384
  * @group Embed components
18350
18385
  * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18351
18386
  */
18352
- let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
18387
+ class SpotterAgentEmbed {
18353
18388
  constructor(viewConfig) {
18354
18389
  this.viewConfig = viewConfig;
18355
18390
  const embedConfig = getEmbedConfig();
@@ -18361,10 +18396,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18361
18396
  return { error };
18362
18397
  }
18363
18398
  const container = document.createElement('div');
18364
- if (this.viewConfig.containerClassName) {
18365
- container.className = this.viewConfig.containerClassName;
18366
- }
18367
- const embed = new ConversationMessage(container, {
18399
+ const embed = new ConversationMessage$1(container, {
18368
18400
  ...this.viewConfig,
18369
18401
  sessionId: data.sessionId,
18370
18402
  genNo: data.genNo,
@@ -18374,7 +18406,29 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18374
18406
  await embed.render();
18375
18407
  return { container, viz: embed };
18376
18408
  }
18377
- };
18409
+ /**
18410
+ * Send a message to the conversation service and return only the data.
18411
+ * @param userMessage - The message to send to the conversation service.
18412
+ * @returns The data from the conversation service.
18413
+ */
18414
+ async sendMessageData(userMessage) {
18415
+ try {
18416
+ const { data, error } = await this.conversationService.sendMessage(userMessage);
18417
+ if (error) {
18418
+ return { error };
18419
+ }
18420
+ return { data: {
18421
+ sessionId: data.sessionId,
18422
+ genNo: data.genNo,
18423
+ acSessionId: data.stateKey.transactionId,
18424
+ acGenNo: data.stateKey.generationNumber,
18425
+ } };
18426
+ }
18427
+ catch (error) {
18428
+ return { error: error };
18429
+ }
18430
+ }
18431
+ }
18378
18432
 
18379
18433
  /**
18380
18434
  *
@@ -18749,55 +18803,34 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18749
18803
  * ```
18750
18804
  */
18751
18805
  const ConversationEmbed = componentFactory(ConversationEmbed$1);
18806
+ const ConversationMessage = componentFactory(ConversationMessage$1);
18752
18807
  /**
18753
- * React component for SpotterAgent embed, which can be integrated inside
18754
- * chatbots or other conversational interfaces.
18808
+ * React component for displaying individual conversation messages from SpotterAgent.
18809
+ *
18810
+ * This component renders a single message response from your ThoughtSpot conversation,
18811
+ * showing charts, visualizations, or text responses based on the user's query.
18812
+ *
18755
18813
  * @example
18756
18814
  * ```tsx
18757
- * function SpotterAgent() {
18758
- * const ref = useRef();
18815
+ * const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
18816
+ * const result = await sendMessage('show me sales by region');
18759
18817
  *
18760
- * const handleSendMessage = async () => {
18761
- * const { container, error } = await ref.current.sendMessage('show me sales by region');
18762
- * if (container) {
18763
- * document.body.appendChild(container);
18764
- * }
18765
- * };
18818
+ * if (!result.error) {
18819
+ * // Simple usage - just pass the message data
18820
+ * <SpotterMessage message={result.message} />
18766
18821
  *
18767
- * return (
18768
- * <div>
18769
- * <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
18770
- * <button onClick={handleSendMessage}>Send Message</button>
18771
- * </div>
18772
- * );
18822
+ * // With optional query for context
18823
+ * <SpotterMessage
18824
+ * message={result.message}
18825
+ * query={result.query}
18826
+ * />
18773
18827
  * }
18774
18828
  * ```
18829
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
18775
18830
  */
18776
- const SpotterAgentEmbed = React.forwardRef((props, ref) => {
18777
- const { className, ...restProps } = props;
18778
- const serviceRef = React.useRef(null);
18779
- useDeepCompareEffect(() => {
18780
- if (serviceRef.current) {
18781
- serviceRef.current = null;
18782
- }
18783
- const configProps = {
18784
- ...restProps,
18785
- ...(className ? { containerClassName: className } : {})
18786
- };
18787
- serviceRef.current = new SpotterAgentEmbed$1(configProps);
18788
- if (ref) {
18789
- if (typeof ref === 'function') {
18790
- ref(serviceRef.current);
18791
- }
18792
- else {
18793
- ref.current = serviceRef.current;
18794
- }
18795
- }
18796
- return () => {
18797
- serviceRef.current = null;
18798
- };
18799
- }, [props]);
18800
- return null;
18831
+ const SpotterMessage = React.forwardRef((props, ref) => {
18832
+ const { message, query: _, ...otherProps } = props;
18833
+ return (React.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
18801
18834
  });
18802
18835
  /**
18803
18836
  * React component for PreRendered Conversation embed.
@@ -18857,6 +18890,62 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18857
18890
  ref.current = authEE;
18858
18891
  }, [config]);
18859
18892
  return ref;
18893
+ }
18894
+ /**
18895
+ * React hook for interacting with SpotterAgent AI conversations.
18896
+ *
18897
+ * This hook provides a sendMessage function that allows you to send natural language
18898
+ * queries to your data and get back AI-generated responses with visualizations.
18899
+ *
18900
+ * @param config - Configuration object containing worksheetId and other options
18901
+ * @returns Object with sendMessage function that returns conversation results
18902
+ * @example
18903
+ * ```tsx
18904
+ * const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
18905
+ *
18906
+ * const handleQuery = async () => {
18907
+ * const result = await sendMessage('show me sales by region');
18908
+ *
18909
+ * if (!result.error) {
18910
+ * // Display the message response
18911
+ * <SpotterMessage message={result.message} />
18912
+ * } else {
18913
+ * console.error('Error:', result.error);
18914
+ * }
18915
+ * };
18916
+ * ```
18917
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
18918
+ */
18919
+ function useSpotterAgent(config) {
18920
+ const serviceRef = React.useRef(null);
18921
+ useDeepCompareEffect(() => {
18922
+ if (serviceRef.current) {
18923
+ serviceRef.current = null;
18924
+ }
18925
+ serviceRef.current = new SpotterAgentEmbed(config);
18926
+ return () => {
18927
+ serviceRef.current = null;
18928
+ };
18929
+ }, [config]);
18930
+ const sendMessage = React.useCallback(async (query) => {
18931
+ if (!serviceRef.current) {
18932
+ return { error: new Error(ERROR_MESSAGE.SPOTTER_AGENT_NOT_INITIALIZED) };
18933
+ }
18934
+ const result = await serviceRef.current.sendMessageData(query);
18935
+ if (result.error) {
18936
+ return { error: result.error };
18937
+ }
18938
+ return {
18939
+ query: query,
18940
+ message: {
18941
+ ...result.data,
18942
+ worksheetId: config.worksheetId,
18943
+ },
18944
+ };
18945
+ }, [config.worksheetId]);
18946
+ return {
18947
+ sendMessage,
18948
+ };
18860
18949
  }
18861
18950
 
18862
18951
  const ALIAS = Symbol.for('yaml.alias');
@@ -26263,6 +26352,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
26263
26352
 
26264
26353
  exports.AppEmbed = AppEmbed;
26265
26354
  exports.ConversationEmbed = ConversationEmbed;
26355
+ exports.ConversationMessage = ConversationMessage;
26266
26356
  exports.LiveboardEmbed = LiveboardEmbed;
26267
26357
  exports.PinboardEmbed = PinboardEmbed;
26268
26358
  exports.PreRenderedAppEmbed = PreRenderedAppEmbed;
@@ -26275,10 +26365,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
26275
26365
  exports.SageEmbed = SageEmbed;
26276
26366
  exports.SearchBarEmbed = SearchBarEmbed;
26277
26367
  exports.SearchEmbed = SearchEmbed;
26278
- exports.SpotterAgentEmbed = SpotterAgentEmbed;
26279
26368
  exports.SpotterEmbed = SpotterEmbed;
26369
+ exports.SpotterMessage = SpotterMessage;
26280
26370
  exports.getSessionInfo = getSessionInfo;
26281
26371
  exports.useEmbedRef = useEmbedRef;
26282
26372
  exports.useInit = useInit;
26373
+ exports.useSpotterAgent = useSpotterAgent;
26283
26374
 
26284
26375
  }));