@thoughtspot/visual-embed-sdk 1.39.2-alpha.1 → 1.39.2-alpha.2

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 (170) 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 +75 -15
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +68 -9
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +356 -4
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
  11. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  12. package/cjs/src/embed/bodyless-conversation.js +24 -4
  13. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
  15. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  16. package/cjs/src/embed/conversation.d.ts +2 -60
  17. package/cjs/src/embed/conversation.d.ts.map +1 -1
  18. package/cjs/src/embed/conversation.js +1 -9
  19. package/cjs/src/embed/conversation.js.map +1 -1
  20. package/cjs/src/embed/conversation.spec.js +0 -102
  21. package/cjs/src/embed/conversation.spec.js.map +1 -1
  22. package/cjs/src/embed/liveboard.d.ts +56 -0
  23. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  24. package/cjs/src/embed/liveboard.js +46 -0
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/embed/liveboard.spec.js +203 -0
  27. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  28. package/cjs/src/errors.d.ts +1 -0
  29. package/cjs/src/errors.d.ts.map +1 -1
  30. package/cjs/src/errors.js +1 -0
  31. package/cjs/src/errors.js.map +1 -1
  32. package/cjs/src/index.d.ts +2 -2
  33. package/cjs/src/index.d.ts.map +1 -1
  34. package/cjs/src/index.js +2 -1
  35. package/cjs/src/index.js.map +1 -1
  36. package/cjs/src/react/all-types-export.d.ts +1 -1
  37. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  38. package/cjs/src/react/all-types-export.js +3 -2
  39. package/cjs/src/react/all-types-export.js.map +1 -1
  40. package/cjs/src/react/index.d.ts +71 -20
  41. package/cjs/src/react/index.d.ts.map +1 -1
  42. package/cjs/src/react/index.js +79 -42
  43. package/cjs/src/react/index.js.map +1 -1
  44. package/cjs/src/react/index.spec.js +436 -100
  45. package/cjs/src/react/index.spec.js.map +1 -1
  46. package/cjs/src/types.d.ts +46 -4
  47. package/cjs/src/types.d.ts.map +1 -1
  48. package/cjs/src/types.js +28 -0
  49. package/cjs/src/types.js.map +1 -1
  50. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  51. package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
  52. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  53. package/cjs/src/utils/processTrigger.js +2 -1
  54. package/cjs/src/utils/processTrigger.js.map +1 -1
  55. package/cjs/src/utils.d.ts +6 -0
  56. package/cjs/src/utils.d.ts.map +1 -1
  57. package/cjs/src/utils.js +23 -3
  58. package/cjs/src/utils.js.map +1 -1
  59. package/cjs/src/utils.spec.js +237 -1
  60. package/cjs/src/utils.spec.js.map +1 -1
  61. package/dist/index-e3Uw3YFO.js +7371 -0
  62. package/dist/src/embed/app.d.ts +75 -15
  63. package/dist/src/embed/app.d.ts.map +1 -1
  64. package/dist/src/embed/bodyless-conversation.d.ts +19 -7
  65. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  66. package/dist/src/embed/conversation.d.ts +2 -60
  67. package/dist/src/embed/conversation.d.ts.map +1 -1
  68. package/dist/src/embed/liveboard.d.ts +56 -0
  69. package/dist/src/embed/liveboard.d.ts.map +1 -1
  70. package/dist/src/errors.d.ts +1 -0
  71. package/dist/src/errors.d.ts.map +1 -1
  72. package/dist/src/index.d.ts +2 -2
  73. package/dist/src/index.d.ts.map +1 -1
  74. package/dist/src/react/all-types-export.d.ts +1 -1
  75. package/dist/src/react/all-types-export.d.ts.map +1 -1
  76. package/dist/src/react/index.d.ts +71 -20
  77. package/dist/src/react/index.d.ts.map +1 -1
  78. package/dist/src/types.d.ts +46 -4
  79. package/dist/src/types.d.ts.map +1 -1
  80. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  81. package/dist/src/utils.d.ts +6 -0
  82. package/dist/src/utils.d.ts.map +1 -1
  83. package/dist/tsembed-react.es.js +276 -74
  84. package/dist/tsembed-react.js +276 -72
  85. package/dist/tsembed.es.js +194 -27
  86. package/dist/tsembed.js +192 -25
  87. package/dist/visual-embed-sdk-react-full.d.ts +246 -105
  88. package/dist/visual-embed-sdk-react.d.ts +246 -105
  89. package/dist/visual-embed-sdk.d.ts +176 -86
  90. package/lib/package.json +1 -1
  91. package/lib/src/config.spec.js +9 -0
  92. package/lib/src/config.spec.js.map +1 -1
  93. package/lib/src/embed/app.d.ts +75 -15
  94. package/lib/src/embed/app.d.ts.map +1 -1
  95. package/lib/src/embed/app.js +68 -9
  96. package/lib/src/embed/app.js.map +1 -1
  97. package/lib/src/embed/app.spec.js +357 -5
  98. package/lib/src/embed/app.spec.js.map +1 -1
  99. package/lib/src/embed/bodyless-conversation.d.ts +19 -7
  100. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  101. package/lib/src/embed/bodyless-conversation.js +23 -4
  102. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  103. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  104. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  105. package/lib/src/embed/conversation.d.ts +2 -60
  106. package/lib/src/embed/conversation.d.ts.map +1 -1
  107. package/lib/src/embed/conversation.js +2 -10
  108. package/lib/src/embed/conversation.js.map +1 -1
  109. package/lib/src/embed/conversation.spec.js +2 -104
  110. package/lib/src/embed/conversation.spec.js.map +1 -1
  111. package/lib/src/embed/liveboard.d.ts +56 -0
  112. package/lib/src/embed/liveboard.d.ts.map +1 -1
  113. package/lib/src/embed/liveboard.js +47 -1
  114. package/lib/src/embed/liveboard.js.map +1 -1
  115. package/lib/src/embed/liveboard.spec.js +203 -0
  116. package/lib/src/embed/liveboard.spec.js.map +1 -1
  117. package/lib/src/errors.d.ts +1 -0
  118. package/lib/src/errors.d.ts.map +1 -1
  119. package/lib/src/errors.js +1 -0
  120. package/lib/src/errors.js.map +1 -1
  121. package/lib/src/index.d.ts +2 -2
  122. package/lib/src/index.d.ts.map +1 -1
  123. package/lib/src/index.js +2 -2
  124. package/lib/src/index.js.map +1 -1
  125. package/lib/src/react/all-types-export.d.ts +1 -1
  126. package/lib/src/react/all-types-export.d.ts.map +1 -1
  127. package/lib/src/react/all-types-export.js +1 -1
  128. package/lib/src/react/all-types-export.js.map +1 -1
  129. package/lib/src/react/index.d.ts +71 -20
  130. package/lib/src/react/index.d.ts.map +1 -1
  131. package/lib/src/react/index.js +79 -43
  132. package/lib/src/react/index.js.map +1 -1
  133. package/lib/src/react/index.spec.js +439 -103
  134. package/lib/src/react/index.spec.js.map +1 -1
  135. package/lib/src/types.d.ts +46 -4
  136. package/lib/src/types.d.ts.map +1 -1
  137. package/lib/src/types.js +28 -0
  138. package/lib/src/types.js.map +1 -1
  139. package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  140. package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
  141. package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  142. package/lib/src/utils/processTrigger.js +2 -1
  143. package/lib/src/utils/processTrigger.js.map +1 -1
  144. package/lib/src/utils.d.ts +6 -0
  145. package/lib/src/utils.d.ts.map +1 -1
  146. package/lib/src/utils.js +21 -2
  147. package/lib/src/utils.js.map +1 -1
  148. package/lib/src/utils.spec.js +238 -2
  149. package/lib/src/utils.spec.js.map +1 -1
  150. package/lib/src/visual-embed-sdk.d.ts +178 -88
  151. package/package.json +1 -1
  152. package/src/config.spec.ts +11 -0
  153. package/src/embed/app.spec.ts +444 -4
  154. package/src/embed/app.ts +131 -27
  155. package/src/embed/bodyless-conversation.spec.ts +9 -203
  156. package/src/embed/bodyless-conversation.ts +24 -10
  157. package/src/embed/conversation.spec.ts +5 -131
  158. package/src/embed/conversation.ts +10 -82
  159. package/src/embed/liveboard.spec.ts +251 -1
  160. package/src/embed/liveboard.ts +97 -5
  161. package/src/errors.ts +1 -0
  162. package/src/index.ts +2 -0
  163. package/src/react/all-types-export.ts +2 -1
  164. package/src/react/index.spec.tsx +556 -157
  165. package/src/react/index.tsx +117 -51
  166. package/src/types.ts +42 -0
  167. package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
  168. package/src/utils/processTrigger.ts +1 -1
  169. package/src/utils.spec.ts +279 -2
  170. package/src/utils.ts +28 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.2-alpha.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.39.2-alpha.2 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -278,7 +278,6 @@ const getOperationNameFromQuery = (query) => {
278
278
  function removeTypename(obj) {
279
279
  if (!obj || typeof obj !== 'object')
280
280
  return obj;
281
- // eslint-disable-next-line no-restricted-syntax
282
281
  for (const key in obj) {
283
282
  if (key === '__typename') {
284
283
  delete obj[key];
@@ -307,7 +306,11 @@ const setStyleProperties = (element, styleProperties) => {
307
306
  if (!(element === null || element === void 0 ? void 0 : element.style))
308
307
  return;
309
308
  Object.keys(styleProperties).forEach((styleProperty) => {
310
- element.style[styleProperty] = styleProperties[styleProperty].toString();
309
+ const styleKey = styleProperty;
310
+ const value = styleProperties[styleKey];
311
+ if (value !== undefined) {
312
+ element.style[styleKey] = value.toString();
313
+ }
311
314
  });
312
315
  };
313
316
  /**
@@ -435,6 +438,22 @@ const handleExitPresentMode = async () => {
435
438
  }
436
439
  }
437
440
  logger$3.warn('Exit fullscreen API is not supported by this browser.');
441
+ };
442
+ const calculateVisibleElementData = (element) => {
443
+ const rect = element.getBoundingClientRect();
444
+ const windowHeight = window.innerHeight;
445
+ const windowWidth = window.innerWidth;
446
+ const frameRelativeTop = Math.max(rect.top, 0);
447
+ const frameRelativeLeft = Math.max(rect.left, 0);
448
+ const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
449
+ const frameRelativeRight = Math.min(windowWidth, rect.right);
450
+ const data = {
451
+ top: Math.max(0, rect.top * -1),
452
+ height: Math.max(0, frameRelativeBottom - frameRelativeTop),
453
+ left: Math.max(0, rect.left * -1),
454
+ width: Math.max(0, frameRelativeRight - frameRelativeLeft),
455
+ };
456
+ return data;
438
457
  };
439
458
 
440
459
  /**
@@ -653,6 +672,12 @@ var HomeLeftNavItem;
653
672
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
654
673
  */
655
674
  HomeLeftNavItem["Spotter"] = "spotter";
675
+ /**
676
+ * Favorites option in the insights left navigation,
677
+ * available when new navigation V3 is enabled.
678
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
679
+ */
680
+ HomeLeftNavItem["Favorites"] = "favorites";
656
681
  })(HomeLeftNavItem || (HomeLeftNavItem = {}));
657
682
  /**
658
683
  * A map of the supported runtime filter operations
@@ -1839,6 +1864,12 @@ var EmbedEvent;
1839
1864
  * @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
1840
1865
  */
1841
1866
  EmbedEvent["ExitPresentMode"] = "exitPresentMode";
1867
+ /**
1868
+ * Emitted when a user requests the full height lazy load data.
1869
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
1870
+ * @hidden
1871
+ */
1872
+ EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1842
1873
  })(EmbedEvent || (EmbedEvent = {}));
1843
1874
  /**
1844
1875
  * Event types that can be triggered by the host application
@@ -2923,6 +2954,19 @@ var HostEvent;
2923
2954
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2924
2955
  */
2925
2956
  HostEvent["ExitPresentMode"] = "exitPresentMode";
2957
+ /**
2958
+ * Triggers the full height lazy load data.
2959
+ * @example
2960
+ * ```js
2961
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
2962
+ * console.log(payload);
2963
+ * });
2964
+ * ```
2965
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2966
+ *
2967
+ * @hidden
2968
+ */
2969
+ HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
2926
2970
  })(HostEvent || (HostEvent = {}));
2927
2971
  /**
2928
2972
  * The different visual modes that the data sources panel within
@@ -3028,6 +3072,7 @@ var Param;
3028
3072
  Param["Query"] = "query";
3029
3073
  Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
3030
3074
  Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
3075
+ Param["ListPageVersion"] = "listpageVersion";
3031
3076
  Param["PendoTrackingKey"] = "additionalPendoKey";
3032
3077
  Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
3033
3078
  Param["IsProductTour"] = "isProductTour";
@@ -3066,6 +3111,8 @@ var Param;
3066
3111
  Param["PrimaryAction"] = "primaryAction";
3067
3112
  Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
3068
3113
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
3114
+ Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
3115
+ Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3069
3116
  })(Param || (Param = {}));
3070
3117
  /**
3071
3118
  * ThoughtSpot application pages include actions and menu commands
@@ -6770,6 +6817,7 @@ const ERROR_MESSAGE = {
6770
6817
  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',
6771
6818
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
6772
6819
  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',
6820
+ SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
6773
6821
  };
6774
6822
 
6775
6823
  const EndPoints = {
@@ -7660,7 +7708,7 @@ class AnswerService {
7660
7708
  async getTML() {
7661
7709
  const { object } = await this.executeQuery(getAnswerTML, {});
7662
7710
  const edoc = object[0].edoc;
7663
- const YAML = await import('./index-Dpf0rd6w.js');
7711
+ const YAML = await import('./index-e3Uw3YFO.js');
7664
7712
  const parsedDoc = YAML.parse(edoc);
7665
7713
  return {
7666
7714
  answer: {
@@ -15560,7 +15608,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15560
15608
  return e;
15561
15609
  }
15562
15610
 
15563
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-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};
15611
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-alpha.2";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};
15564
15612
 
15565
15613
  /**
15566
15614
  * Reloads the ThoughtSpot iframe.
@@ -15583,7 +15631,8 @@ const reload = (iFrame) => {
15583
15631
  * @param channel
15584
15632
  */
15585
15633
  function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
15586
- return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15634
+ var _a;
15635
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15587
15636
  }
15588
15637
  const TRIGGER_TIMEOUT = 30000;
15589
15638
  /**
@@ -16968,7 +17017,6 @@ class V1Embed extends TsEmbed {
16968
17017
  /**
16969
17018
  * Pages within the ThoughtSpot app that can be embedded.
16970
17019
  */
16971
- // eslint-disable-next-line no-shadow
16972
17020
  var Page;
16973
17021
  (function (Page) {
16974
17022
  /**
@@ -17054,16 +17102,46 @@ var HomePage;
17054
17102
  */
17055
17103
  HomePage["Modular"] = "v2";
17056
17104
  })(HomePage || (HomePage = {}));
17105
+ /**
17106
+ * Define the version of the list page
17107
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
17108
+ */
17109
+ var ListPage;
17110
+ (function (ListPage) {
17111
+ /**
17112
+ * List (v2) is the traditional List Experience.
17113
+ * It serves as the foundational version of the list page.
17114
+ */
17115
+ ListPage["List"] = "v2";
17116
+ /**
17117
+ * ListWithUXChanges (v3) introduces the new updated list page with UX changes.
17118
+ */
17119
+ ListPage["ListWithUXChanges"] = "v3";
17120
+ })(ListPage || (ListPage = {}));
17057
17121
  /**
17058
17122
  * Embeds full ThoughtSpot experience in a host application.
17059
17123
  * @group Embed components
17060
17124
  */
17061
17125
  class AppEmbed extends V1Embed {
17062
- // eslint-disable-next-line no-useless-constructor
17063
17126
  constructor(domSelector, viewConfig) {
17064
17127
  viewConfig.embedComponentType = 'AppEmbed';
17065
17128
  super(domSelector, viewConfig);
17066
17129
  this.defaultHeight = '100%';
17130
+ this.sendFullHeightLazyLoadData = () => {
17131
+ const data = calculateVisibleElementData(this.iFrame);
17132
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17133
+ };
17134
+ /**
17135
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17136
+ * It is used to send the visible coordinates data to the host application.
17137
+ * @param data The event payload
17138
+ * @param responder The responder function
17139
+ */
17140
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17141
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17142
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17143
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17144
+ };
17067
17145
  /**
17068
17146
  * Set the iframe height as per the computed height received
17069
17147
  * from the ThoughtSpot app.
@@ -17072,6 +17150,7 @@ class AppEmbed extends V1Embed {
17072
17150
  this.updateIFrameHeight = (data) => {
17073
17151
  var _a;
17074
17152
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
17153
+ this.sendFullHeightLazyLoadData();
17075
17154
  };
17076
17155
  this.embedIframeCenter = (data, responder) => {
17077
17156
  const obj = this.getIframeCenter();
@@ -17101,6 +17180,7 @@ class AppEmbed extends V1Embed {
17101
17180
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17102
17181
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17103
17182
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17183
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17104
17184
  }
17105
17185
  }
17106
17186
  /**
@@ -17108,9 +17188,7 @@ class AppEmbed extends V1Embed {
17108
17188
  * embedded Liveboard or visualization.
17109
17189
  */
17110
17190
  getEmbedParams() {
17111
- 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,
17112
- /* eslint-disable-next-line max-len */
17113
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17191
+ 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, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17114
17192
  let params = {};
17115
17193
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17116
17194
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17139,6 +17217,10 @@ class AppEmbed extends V1Embed {
17139
17217
  }
17140
17218
  if (fullHeight === true) {
17141
17219
  params[Param.fullHeight] = true;
17220
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17221
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17222
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17223
+ }
17142
17224
  }
17143
17225
  if (tag) {
17144
17226
  params[Param.Tag] = tag;
@@ -17159,7 +17241,6 @@ class AppEmbed extends V1Embed {
17159
17241
  params[Param.enableAskSage] = enableAskSage;
17160
17242
  }
17161
17243
  if (isOnBeforeGetVizDataInterceptEnabled) {
17162
- /* eslint-disable-next-line max-len */
17163
17244
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17164
17245
  }
17165
17246
  if (homePageSearchBarMode) {
@@ -17180,11 +17261,9 @@ class AppEmbed extends V1Embed {
17180
17261
  === DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
17181
17262
  || dataPanelCustomGroupsAccordionInitialState
17182
17263
  === DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
17183
- /* eslint-disable-next-line max-len */
17184
17264
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17185
17265
  }
17186
17266
  else {
17187
- /* eslint-disable-next-line max-len */
17188
17267
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
17189
17268
  }
17190
17269
  if (discoveryExperience) {
@@ -17197,6 +17276,10 @@ class AppEmbed extends V1Embed {
17197
17276
  if (discoveryExperience.homePage === HomePage.Modular) {
17198
17277
  params[Param.ModularHomeExperienceEnabled] = true;
17199
17278
  }
17279
+ // listPageVersion v3 will enable the new list page
17280
+ if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
17281
+ params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
17282
+ }
17200
17283
  }
17201
17284
  const queryParams = getQueryParamString(params, true);
17202
17285
  return queryParams;
@@ -17284,6 +17367,30 @@ class AppEmbed extends V1Embed {
17284
17367
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
17285
17368
  }
17286
17369
  }
17370
+ /**
17371
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17372
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17373
+ */
17374
+ destroy() {
17375
+ super.destroy();
17376
+ this.unregisterLazyLoadEvents();
17377
+ }
17378
+ postRender() {
17379
+ this.registerLazyLoadEvents();
17380
+ }
17381
+ registerLazyLoadEvents() {
17382
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17383
+ // TODO: Use passive: true, install modernizr to check for passive
17384
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17385
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData);
17386
+ }
17387
+ }
17388
+ unregisterLazyLoadEvents() {
17389
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17390
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17391
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17392
+ }
17393
+ }
17287
17394
  /**
17288
17395
  * Renders the embedded application pages in the ThoughtSpot app.
17289
17396
  * @param renderOptions An object containing the page ID
@@ -17293,6 +17400,7 @@ class AppEmbed extends V1Embed {
17293
17400
  await super.render();
17294
17401
  const src = this.getIFrameSrc();
17295
17402
  await this.renderV1Embed(src);
17403
+ this.postRender();
17296
17404
  return this;
17297
17405
  }
17298
17406
  }
@@ -17397,6 +17505,21 @@ class LiveboardEmbed extends V1Embed {
17397
17505
  viewConfig.embedComponentType = 'LiveboardEmbed';
17398
17506
  super(domSelector, viewConfig);
17399
17507
  this.defaultHeight = 500;
17508
+ this.sendFullHeightLazyLoadData = () => {
17509
+ const data = calculateVisibleElementData(this.iFrame);
17510
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17511
+ };
17512
+ /**
17513
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17514
+ * It is used to send the visible coordinates data to the host application.
17515
+ * @param data The event payload
17516
+ * @param responder The responder function
17517
+ */
17518
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17519
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17520
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17521
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17522
+ };
17400
17523
  /**
17401
17524
  * Set the iframe height as per the computed height received
17402
17525
  * from the ThoughtSpot app.
@@ -17404,6 +17527,7 @@ class LiveboardEmbed extends V1Embed {
17404
17527
  */
17405
17528
  this.updateIFrameHeight = (data) => {
17406
17529
  this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
17530
+ this.sendFullHeightLazyLoadData();
17407
17531
  };
17408
17532
  this.embedIframeCenter = (data, responder) => {
17409
17533
  const obj = this.getIframeCenter();
@@ -17437,6 +17561,7 @@ class LiveboardEmbed extends V1Embed {
17437
17561
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17438
17562
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17439
17563
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17564
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17440
17565
  }
17441
17566
  }
17442
17567
  /**
@@ -17451,6 +17576,10 @@ class LiveboardEmbed extends V1Embed {
17451
17576
  || this.viewConfig.preventPinboardFilterRemoval;
17452
17577
  if (fullHeight === true) {
17453
17578
  params[Param.fullHeight] = true;
17579
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17580
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17581
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17582
+ }
17454
17583
  }
17455
17584
  if (defaultHeight) {
17456
17585
  this.defaultHeight = defaultHeight;
@@ -17606,6 +17735,30 @@ class LiveboardEmbed extends V1Embed {
17606
17735
  }
17607
17736
  return super.trigger(messageType, dataWithVizId);
17608
17737
  }
17738
+ /**
17739
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17740
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17741
+ */
17742
+ destroy() {
17743
+ super.destroy();
17744
+ this.unregisterLazyLoadEvents();
17745
+ }
17746
+ postRender() {
17747
+ this.registerLazyLoadEvents();
17748
+ }
17749
+ registerLazyLoadEvents() {
17750
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17751
+ // TODO: Use passive: true, install modernizr to check for passive
17752
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17753
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData);
17754
+ }
17755
+ }
17756
+ unregisterLazyLoadEvents() {
17757
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17758
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17759
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17760
+ }
17761
+ }
17609
17762
  /**
17610
17763
  * Render an embedded ThoughtSpot Liveboard or visualization
17611
17764
  * @param renderOptions An object specifying the Liveboard ID,
@@ -17616,6 +17769,7 @@ class LiveboardEmbed extends V1Embed {
17616
17769
  const src = this.getIFrameSrc();
17617
17770
  await this.renderV1Embed(src);
17618
17771
  this.showPreviewLoader();
17772
+ this.postRender();
17619
17773
  return this;
17620
17774
  }
17621
17775
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
@@ -18267,6 +18421,8 @@ class Conversation {
18267
18421
  });
18268
18422
  const data = responses[0].data;
18269
18423
  return {
18424
+ convId: this.conversationId,
18425
+ messageId: responses[0].msgId,
18270
18426
  data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18271
18427
  error: null,
18272
18428
  };
@@ -18349,9 +18505,6 @@ class SpotterAgentEmbed {
18349
18505
  return { error };
18350
18506
  }
18351
18507
  const container = document.createElement('div');
18352
- if (this.viewConfig.containerClassName) {
18353
- container.className = this.viewConfig.containerClassName;
18354
- }
18355
18508
  const embed = new ConversationMessage(container, {
18356
18509
  ...this.viewConfig,
18357
18510
  sessionId: data.sessionId,
@@ -18362,6 +18515,28 @@ class SpotterAgentEmbed {
18362
18515
  await embed.render();
18363
18516
  return { container, viz: embed };
18364
18517
  }
18518
+ /**
18519
+ * Send a message to the conversation service and return only the data.
18520
+ * @param userMessage - The message to send to the conversation service.
18521
+ * @returns The data from the conversation service.
18522
+ */
18523
+ async sendMessageData(userMessage) {
18524
+ try {
18525
+ const { data, error } = await this.conversationService.sendMessage(userMessage);
18526
+ if (error) {
18527
+ return { error };
18528
+ }
18529
+ return { data: {
18530
+ sessionId: data.sessionId,
18531
+ genNo: data.genNo,
18532
+ acSessionId: data.stateKey.transactionId,
18533
+ acGenNo: data.stateKey.generationNumber,
18534
+ } };
18535
+ }
18536
+ catch (error) {
18537
+ return { error: error };
18538
+ }
18539
+ }
18365
18540
  }
18366
18541
  /**
18367
18542
  * Create a conversation embed, which can be integrated inside
@@ -18434,7 +18609,7 @@ class SpotterEmbed extends TsEmbed {
18434
18609
  this.viewConfig = viewConfig;
18435
18610
  }
18436
18611
  getIframeSrc() {
18437
- const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
18612
+ const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
18438
18613
  const path = 'insights/conv-assist';
18439
18614
  if (!worksheetId) {
18440
18615
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
@@ -18461,14 +18636,6 @@ class SpotterEmbed extends TsEmbed {
18461
18636
  if (queryParamsString) {
18462
18637
  query = `?${queryParamsString}`;
18463
18638
  }
18464
- const filterQuery = getFilterQuery(runtimeFilters || []);
18465
- if (filterQuery && !excludeRuntimeFiltersfromURL) {
18466
- query += `&${filterQuery}`;
18467
- }
18468
- const parameterQuery = getRuntimeParameters(runtimeParameters || []);
18469
- if (parameterQuery && !excludeRuntimeParametersfromURL) {
18470
- query += `&${parameterQuery}`;
18471
- }
18472
18639
  const tsPostHashParams = this.getThoughtSpotPostUrlParams({
18473
18640
  worksheet: worksheetId,
18474
18641
  query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
@@ -19092,4 +19259,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
19092
19259
  return result;
19093
19260
  };
19094
19261
 
19095
- export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, 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 };
19262
+ export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, ListPage, 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 };