@thoughtspot/visual-embed-sdk 1.35.12 → 1.35.14

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 (132) hide show
  1. package/cjs/package.json +1 -2
  2. package/cjs/src/auth.d.ts +2 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +3 -1
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/embed/app.d.ts.map +1 -1
  7. package/cjs/src/embed/app.js +2 -0
  8. package/cjs/src/embed/app.js.map +1 -1
  9. package/cjs/src/embed/conversation.d.ts +44 -0
  10. package/cjs/src/embed/conversation.d.ts.map +1 -1
  11. package/cjs/src/embed/conversation.js +10 -1
  12. package/cjs/src/embed/conversation.js.map +1 -1
  13. package/cjs/src/embed/conversation.spec.js +36 -0
  14. package/cjs/src/embed/conversation.spec.js.map +1 -1
  15. package/cjs/src/embed/hostEventClient/contracts.d.ts +3 -3
  16. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  17. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  18. package/cjs/src/embed/hostEventClient/host-event-client.js +6 -1
  19. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  20. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  21. package/cjs/src/embed/liveboard.js +8 -2
  22. package/cjs/src/embed/liveboard.js.map +1 -1
  23. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  24. package/cjs/src/embed/search-bar.js +4 -2
  25. package/cjs/src/embed/search-bar.js.map +1 -1
  26. package/cjs/src/embed/search.d.ts.map +1 -1
  27. package/cjs/src/embed/search.js +4 -2
  28. package/cjs/src/embed/search.js.map +1 -1
  29. package/cjs/src/embed/search.spec.js +56 -3
  30. package/cjs/src/embed/search.spec.js.map +1 -1
  31. package/cjs/src/embed/ts-embed.d.ts +6 -0
  32. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  33. package/cjs/src/embed/ts-embed.js +38 -13
  34. package/cjs/src/embed/ts-embed.js.map +1 -1
  35. package/cjs/src/embed/ts-embed.spec.js +132 -130
  36. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  37. package/cjs/src/types.d.ts +43 -17
  38. package/cjs/src/types.d.ts.map +1 -1
  39. package/cjs/src/types.js +35 -7
  40. package/cjs/src/types.js.map +1 -1
  41. package/cjs/src/utils/processData.d.ts.map +1 -1
  42. package/cjs/src/utils/processData.js +9 -2
  43. package/cjs/src/utils/processData.js.map +1 -1
  44. package/cjs/src/utils/processData.spec.js +51 -0
  45. package/cjs/src/utils/processData.spec.js.map +1 -1
  46. package/dist/index-B3hd6DTM.js +7370 -0
  47. package/dist/index-vxW97_xb.js +7370 -0
  48. package/dist/src/auth.d.ts +2 -1
  49. package/dist/src/auth.d.ts.map +1 -1
  50. package/dist/src/embed/app.d.ts.map +1 -1
  51. package/dist/src/embed/conversation.d.ts +44 -0
  52. package/dist/src/embed/conversation.d.ts.map +1 -1
  53. package/dist/src/embed/hostEventClient/contracts.d.ts +3 -3
  54. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  55. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  56. package/dist/src/embed/liveboard.d.ts.map +1 -1
  57. package/dist/src/embed/search-bar.d.ts.map +1 -1
  58. package/dist/src/embed/search.d.ts.map +1 -1
  59. package/dist/src/embed/ts-embed.d.ts +6 -0
  60. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  61. package/dist/src/types.d.ts +43 -17
  62. package/dist/src/types.d.ts.map +1 -1
  63. package/dist/src/utils/processData.d.ts.map +1 -1
  64. package/dist/tsembed-react.es.js +122 -34
  65. package/dist/tsembed-react.js +121 -33
  66. package/dist/tsembed.es.js +122 -34
  67. package/dist/tsembed.js +121 -33
  68. package/dist/visual-embed-sdk-react-full.d.ts +92 -21
  69. package/dist/visual-embed-sdk-react.d.ts +92 -21
  70. package/dist/visual-embed-sdk.d.ts +92 -21
  71. package/lib/package.json +1 -2
  72. package/lib/src/auth.d.ts +2 -1
  73. package/lib/src/auth.d.ts.map +1 -1
  74. package/lib/src/auth.js +3 -1
  75. package/lib/src/auth.js.map +1 -1
  76. package/lib/src/embed/app.d.ts.map +1 -1
  77. package/lib/src/embed/app.js +2 -0
  78. package/lib/src/embed/app.js.map +1 -1
  79. package/lib/src/embed/conversation.d.ts +44 -0
  80. package/lib/src/embed/conversation.d.ts.map +1 -1
  81. package/lib/src/embed/conversation.js +10 -1
  82. package/lib/src/embed/conversation.js.map +1 -1
  83. package/lib/src/embed/conversation.spec.js +36 -0
  84. package/lib/src/embed/conversation.spec.js.map +1 -1
  85. package/lib/src/embed/hostEventClient/contracts.d.ts +3 -3
  86. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  87. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  88. package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
  89. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  90. package/lib/src/embed/liveboard.d.ts.map +1 -1
  91. package/lib/src/embed/liveboard.js +8 -2
  92. package/lib/src/embed/liveboard.js.map +1 -1
  93. package/lib/src/embed/search-bar.d.ts.map +1 -1
  94. package/lib/src/embed/search-bar.js +4 -2
  95. package/lib/src/embed/search-bar.js.map +1 -1
  96. package/lib/src/embed/search.d.ts.map +1 -1
  97. package/lib/src/embed/search.js +4 -2
  98. package/lib/src/embed/search.js.map +1 -1
  99. package/lib/src/embed/search.spec.js +56 -3
  100. package/lib/src/embed/search.spec.js.map +1 -1
  101. package/lib/src/embed/ts-embed.d.ts +6 -0
  102. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  103. package/lib/src/embed/ts-embed.js +38 -13
  104. package/lib/src/embed/ts-embed.js.map +1 -1
  105. package/lib/src/embed/ts-embed.spec.js +133 -131
  106. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  107. package/lib/src/types.d.ts +43 -17
  108. package/lib/src/types.d.ts.map +1 -1
  109. package/lib/src/types.js +35 -7
  110. package/lib/src/types.js.map +1 -1
  111. package/lib/src/utils/processData.d.ts.map +1 -1
  112. package/lib/src/utils/processData.js +9 -2
  113. package/lib/src/utils/processData.js.map +1 -1
  114. package/lib/src/utils/processData.spec.js +51 -0
  115. package/lib/src/utils/processData.spec.js.map +1 -1
  116. package/lib/src/visual-embed-sdk.d.ts +92 -21
  117. package/package.json +1 -2
  118. package/src/auth.ts +3 -1
  119. package/src/embed/app.ts +2 -0
  120. package/src/embed/conversation.spec.ts +52 -3
  121. package/src/embed/conversation.ts +60 -1
  122. package/src/embed/hostEventClient/contracts.ts +3 -3
  123. package/src/embed/hostEventClient/host-event-client.ts +7 -1
  124. package/src/embed/liveboard.ts +9 -4
  125. package/src/embed/search-bar.tsx +6 -4
  126. package/src/embed/search.spec.ts +71 -3
  127. package/src/embed/search.ts +6 -5
  128. package/src/embed/ts-embed.spec.ts +153 -180
  129. package/src/embed/ts-embed.ts +46 -30
  130. package/src/types.ts +44 -15
  131. package/src/utils/processData.spec.ts +63 -0
  132. package/src/utils/processData.ts +12 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.12 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.14 */
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
4
 
@@ -1038,6 +1038,11 @@ var EmbedEvent;
1038
1038
  * @hidden
1039
1039
  */
1040
1040
  EmbedEvent["AuthFailure"] = "ThoughtspotAuthFailure";
1041
+ /**
1042
+ * ThoughtSpot failed to re validate the auth session.
1043
+ * @hidden
1044
+ */
1045
+ EmbedEvent["IdleSessionTimeout"] = "IdleSessionTimeout";
1041
1046
  /**
1042
1047
  * ThoughtSpot failed to validate the auth session.
1043
1048
  * @hidden
@@ -1761,6 +1766,19 @@ var EmbedEvent;
1761
1766
  * @version SDK: 1.35.12 | ThoughtSpot: 10.7.0.cl
1762
1767
  */
1763
1768
  EmbedEvent["TableVizRendered"] = "TableVizRendered";
1769
+ /**
1770
+ * Emitted when the liveboard is created from pin modal or liveboard list page.
1771
+ * You can use this event as a hook to trigger
1772
+ * other events on liveboard creation.
1773
+ *
1774
+ * ```js
1775
+ * liveboardEmbed.on(EmbedEvent.CreateLiveboard, (payload) => {
1776
+ * console.log('payload', payload);
1777
+ * })
1778
+ *```
1779
+ * @version SDK : 1.36.0 | ThoughtSpot : 10.8.0.cl
1780
+ */
1781
+ EmbedEvent["CreateLiveboard"] = "createLiveboard";
1764
1782
  })(EmbedEvent || (EmbedEvent = {}));
1765
1783
  /**
1766
1784
  * Event types that can be triggered by the host application
@@ -2767,6 +2785,7 @@ var Param;
2767
2785
  Param["HideResult"] = "hideResult";
2768
2786
  Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
2769
2787
  Param["Tag"] = "tag";
2788
+ Param["AutoLogin"] = "autoLogin";
2770
2789
  Param["searchTokenString"] = "searchTokenString";
2771
2790
  Param["executeSearch"] = "executeSearch";
2772
2791
  Param["fullHeight"] = "isFullHeightPinboard";
@@ -2849,10 +2868,10 @@ var Param;
2849
2868
  Param["SpotterEnabled"] = "isSpotterExperienceEnabled";
2850
2869
  Param["IsUnifiedSearchExperienceEnabled"] = "isUnifiedSearchExperienceEnabled";
2851
2870
  Param["OverrideOrgId"] = "orgId";
2852
- Param["EnableFlipTooltipToContextMenu"] = "flipTooltipToContextMenuEnabled";
2853
2871
  Param["OauthPollingInterval"] = "oAuthPollingInterval";
2854
2872
  Param["IsForceRedirect"] = "isForceRedirect";
2855
2873
  Param["DataSourceId"] = "dataSourceId";
2874
+ Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2856
2875
  })(Param || (Param = {}));
2857
2876
  /**
2858
2877
  * ThoughtSpot application pages include actions and menu commands
@@ -4059,10 +4078,17 @@ var ContextMenuTriggerOptions;
4059
4078
  ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
4060
4079
  ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
4061
4080
  })(ContextMenuTriggerOptions || (ContextMenuTriggerOptions = {}));
4081
+ /**
4082
+ * Enum options to show or suppress Visual Embed SDK and
4083
+ * ThoughtSpot application logs in the console output.
4084
+ * This attribute doesn't support suppressing
4085
+ * browser warnings or errors.
4086
+ */
4062
4087
  var LogLevel;
4063
4088
  (function (LogLevel) {
4064
4089
  /**
4065
- * No logs will be logged in the console.
4090
+ * No application or SDK-related logs will be logged
4091
+ * in the console output.
4066
4092
  * @example
4067
4093
  * ```js
4068
4094
  * init({
@@ -4074,7 +4100,7 @@ var LogLevel;
4074
4100
  */
4075
4101
  LogLevel["SILENT"] = "SILENT";
4076
4102
  /**
4077
- * Only ERROR logs will be logged in the console.
4103
+ * Log only errors in the console output.
4078
4104
  * @example
4079
4105
  * ```js
4080
4106
  * init({
@@ -4086,7 +4112,7 @@ var LogLevel;
4086
4112
  */
4087
4113
  LogLevel["ERROR"] = "ERROR";
4088
4114
  /**
4089
- * Only WARN and ERROR logs will be logged in the console.
4115
+ * Log only warnings and errors in the console output.
4090
4116
  * @example
4091
4117
  * ```js
4092
4118
  * init({
@@ -4098,7 +4124,8 @@ var LogLevel;
4098
4124
  */
4099
4125
  LogLevel["WARN"] = "WARN";
4100
4126
  /**
4101
- * Only INFO, WARN, and ERROR logs will be logged in the console.
4127
+ * Log only the information alerts, warnings, and errors
4128
+ * in the console output.
4102
4129
  * @example
4103
4130
  * ```js
4104
4131
  * init({
@@ -4110,7 +4137,8 @@ var LogLevel;
4110
4137
  */
4111
4138
  LogLevel["INFO"] = "INFO";
4112
4139
  /**
4113
- * Only DEBUG, INFO, WARN, and ERROR logs will be logged in the console.
4140
+ * Log debug messages, warnings, information alerts,
4141
+ * and errors in the console output.
4114
4142
  * @example
4115
4143
  * ```js
4116
4144
  * init({
@@ -4122,7 +4150,7 @@ var LogLevel;
4122
4150
  */
4123
4151
  LogLevel["DEBUG"] = "DEBUG";
4124
4152
  /**
4125
- * All logs will be logged in the console.
4153
+ * All logs will be logged in the browser console.
4126
4154
  * @example
4127
4155
  * ```js
4128
4156
  * init({
@@ -7300,7 +7328,7 @@ class AnswerService {
7300
7328
  async getTML() {
7301
7329
  const { object } = await this.executeQuery(getAnswerTML, {});
7302
7330
  const edoc = object[0].edoc;
7303
- const YAML = await import('./index-D-9WUCUl.js');
7331
+ const YAML = await import('./index-vxW97_xb.js');
7304
7332
  const parsedDoc = YAML.parse(edoc);
7305
7333
  return {
7306
7334
  answer: {
@@ -14145,6 +14173,7 @@ var AuthFailureType;
14145
14173
  AuthFailureType["NO_COOKIE_ACCESS"] = "NO_COOKIE_ACCESS";
14146
14174
  AuthFailureType["EXPIRY"] = "EXPIRY";
14147
14175
  AuthFailureType["OTHER"] = "OTHER";
14176
+ AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
14148
14177
  })(AuthFailureType || (AuthFailureType = {}));
14149
14178
  /**
14150
14179
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -14450,7 +14479,8 @@ const doOIDCAuth = async (embedConfig) => {
14450
14479
  ? `${thoughtSpotHost}/v2/#/embed/saml-complete`
14451
14480
  : getRedirectUrl(window.location.href, SSO_REDIRECTION_MARKER_GUID, embedConfig.redirectPath);
14452
14481
  // bring back the page to the same URL
14453
- const ssoEndPoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
14482
+ const baseEndpoint = `${EndPoints.OIDC_LOGIN_TEMPLATE(encodeURIComponent(ssoRedirectUrl))}`;
14483
+ const ssoEndPoint = `${baseEndpoint}${baseEndpoint.includes('?') ? '&' : '?'}forceSAMLAutoRedirect=true`;
14454
14484
  await doSSOAuth(embedConfig, ssoEndPoint);
14455
14485
  return loggedInStatus;
14456
14486
  };
@@ -14597,8 +14627,15 @@ function processNoCookieAccess(e, containerEl) {
14597
14627
  * @param containerEl
14598
14628
  */
14599
14629
  function processAuthFailure(e, containerEl) {
14600
- const { loginFailedMessage, authType, disableLoginFailurePage } = getEmbedConfig();
14601
- if (authType !== AuthType.None && !disableLoginFailurePage) {
14630
+ const { loginFailedMessage, authType, disableLoginFailurePage, autoLogin, } = getEmbedConfig();
14631
+ if (autoLogin
14632
+ && (authType === AuthType.TrustedAuthToken
14633
+ || authType === AuthType.TrustedAuthTokenCookieless)) {
14634
+ // eslint-disable-next-line no-param-reassign
14635
+ containerEl.innerHTML = loginFailedMessage;
14636
+ notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
14637
+ }
14638
+ else if (authType !== AuthType.None && !disableLoginFailurePage) {
14602
14639
  // eslint-disable-next-line no-param-reassign
14603
14640
  containerEl.innerHTML = loginFailedMessage;
14604
14641
  notifyAuthFailure(AuthFailureType.OTHER);
@@ -14643,7 +14680,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
14643
14680
  return e;
14644
14681
  }
14645
14682
 
14646
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.12";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={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",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":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.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","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","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};
14683
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.14";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={algoliasearch:"^4.10.5",classnames:"^2.3.1",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.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":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.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","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","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};
14647
14684
 
14648
14685
  /**
14649
14686
  * Reloads the ThoughtSpot iframe.
@@ -14768,7 +14805,12 @@ class HostEventClient {
14768
14805
  if (!payload || !('newVizName' in payload)) {
14769
14806
  return this.hostEventFallback(HostEvent.Pin, payload);
14770
14807
  }
14771
- return this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, payload);
14808
+ const formattedPayload = {
14809
+ ...payload,
14810
+ pinboardId: payload.liveboardId,
14811
+ newPinboardName: payload.newLiveboardName,
14812
+ };
14813
+ return this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
14772
14814
  }
14773
14815
  async handleSaveAnswerEvent(payload) {
14774
14816
  var _a, _b, _c, _d;
@@ -14887,12 +14929,37 @@ class TsEmbed {
14887
14929
  }
14888
14930
  notifyAuthFailure(AuthFailureType.EXPIRY);
14889
14931
  };
14932
+ /**
14933
+ * Auto Login and send updated authToken to the iFrame to avoid user session logout
14934
+ * @param _
14935
+ * @param responder
14936
+ */
14937
+ this.idleSessionTimeout = (_, responder) => {
14938
+ handleAuth().then(async () => {
14939
+ let authToken = '';
14940
+ try {
14941
+ authToken = await getAuthenticationToken(this.embedConfig);
14942
+ responder({
14943
+ type: EmbedEvent.IdleSessionTimeout,
14944
+ data: { authToken },
14945
+ });
14946
+ }
14947
+ catch (e) {
14948
+ logger$3.error(`${ERROR_MESSAGE.INVALID_TOKEN_ERROR} Error : ${e === null || e === void 0 ? void 0 : e.message}`);
14949
+ processAuthFailure(e, this.isPreRendered ? this.preRenderWrapper : this.el);
14950
+ }
14951
+ }).catch((e) => {
14952
+ logger$3.error(`Auto Login failed, Error : ${e === null || e === void 0 ? void 0 : e.message}`);
14953
+ });
14954
+ notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
14955
+ };
14890
14956
  /**
14891
14957
  * Register APP_INIT event and sendback init payload
14892
14958
  */
14893
14959
  this.registerAppInit = () => {
14894
14960
  this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
14895
14961
  this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
14962
+ this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
14896
14963
  };
14897
14964
  this.showPreRenderByDefault = false;
14898
14965
  this.validatePreRenderViewConfig = (viewConfig) => {
@@ -15075,7 +15142,7 @@ class TsEmbed {
15075
15142
  * @param query
15076
15143
  */
15077
15144
  getEmbedBasePath(query) {
15078
- let queryString = (query.startsWith('?')) ? query : `?${query}`;
15145
+ let queryString = query.startsWith('?') ? query : `?${query}`;
15079
15146
  if (this.shouldEncodeUrlQueryParams) {
15080
15147
  queryString = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString.substr(1))}`;
15081
15148
  }
@@ -15090,20 +15157,22 @@ class TsEmbed {
15090
15157
  * @returns queryParams
15091
15158
  */
15092
15159
  getBaseQueryParams(queryParams = {}) {
15093
- var _a, _b, _c;
15160
+ var _a, _b;
15094
15161
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
15095
15162
  // The below check is needed because TS Cloud firewall, blocks
15096
15163
  // localhost/127.0.0.1 in any url param.
15097
15164
  if (hostAppUrl.includes('localhost') || hostAppUrl.includes('127.0.0.1')) {
15098
15165
  hostAppUrl = 'local-host';
15099
15166
  }
15167
+ const blockNonEmbedFullAppAccess = (_b = this.embedConfig.blockNonEmbedFullAppAccess) !== null && _b !== void 0 ? _b : true;
15100
15168
  queryParams[Param.EmbedApp] = true;
15101
15169
  queryParams[Param.HostAppUrl] = encodeURIComponent(hostAppUrl);
15102
15170
  queryParams[Param.ViewPortHeight] = window.innerHeight;
15103
15171
  queryParams[Param.ViewPortWidth] = window.innerWidth;
15104
15172
  queryParams[Param.Version] = version;
15105
15173
  queryParams[Param.AuthType] = this.embedConfig.authType;
15106
- queryParams[Param.blockNonEmbedFullAppAccess] = (_b = this.embedConfig.blockNonEmbedFullAppAccess) !== null && _b !== void 0 ? _b : true;
15174
+ queryParams[Param.blockNonEmbedFullAppAccess] = blockNonEmbedFullAppAccess;
15175
+ queryParams[Param.AutoLogin] = this.embedConfig.autoLogin;
15107
15176
  if (this.embedConfig.disableLoginRedirect === true || this.embedConfig.autoLogin === true) {
15108
15177
  queryParams[Param.DisableLoginRedirect] = true;
15109
15178
  }
@@ -15125,15 +15194,12 @@ class TsEmbed {
15125
15194
  if (this.embedConfig.currencyFormat) {
15126
15195
  queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
15127
15196
  }
15128
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, enableFlipTooltipToContextMenu = false, } = this.viewConfig;
15197
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, } = this.viewConfig;
15129
15198
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
15130
15199
  const additionalFlags = {
15131
15200
  ...additionalFlagsFromInit,
15132
15201
  ...additionalFlagsFromView,
15133
15202
  };
15134
- if (enableFlipTooltipToContextMenu) {
15135
- queryParams[Param.EnableFlipTooltipToContextMenu] = enableFlipTooltipToContextMenu;
15136
- }
15137
15203
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
15138
15204
  this.handleError('You cannot have both hidden actions and visible actions');
15139
15205
  return queryParams;
@@ -15172,8 +15238,8 @@ class TsEmbed {
15172
15238
  else if (contextMenuTrigger === ContextMenuTriggerOptions.BOTH_CLICKS) {
15173
15239
  queryParams[Param.ContextMenuTrigger] = 'both';
15174
15240
  }
15175
- const spriteUrl = (customizations === null || customizations === void 0 ? void 0 : customizations.iconSpriteUrl)
15176
- || ((_c = this.embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.iconSpriteUrl);
15241
+ const embedCustomizations = this.embedConfig.customizations;
15242
+ const spriteUrl = (customizations === null || customizations === void 0 ? void 0 : customizations.iconSpriteUrl) || (embedCustomizations === null || embedCustomizations === void 0 ? void 0 : embedCustomizations.iconSpriteUrl);
15177
15243
  if (spriteUrl) {
15178
15244
  queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
15179
15245
  }
@@ -15245,7 +15311,8 @@ class TsEmbed {
15245
15311
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
15246
15312
  // @ts-ignore
15247
15313
  iFrame.allow = 'clipboard-read; clipboard-write; fullscreen;';
15248
- const { height: frameHeight, width: frameWidth, ...restParams } = this.viewConfig.frameParams || {};
15314
+ const frameParams = this.viewConfig.frameParams;
15315
+ const { height: frameHeight, width: frameWidth, ...restParams } = frameParams || {};
15249
15316
  const width = getCssDimension(frameWidth || DEFAULT_EMBED_WIDTH);
15250
15317
  const height = getCssDimension(frameHeight || DEFAULT_EMBED_HEIGHT);
15251
15318
  setAttributes(iFrame, restParams);
@@ -15350,8 +15417,8 @@ class TsEmbed {
15350
15417
  }
15351
15418
  connectPreRendered() {
15352
15419
  const preRenderIds = this.getPreRenderIds();
15353
- this.preRenderWrapper = this.preRenderWrapper
15354
- || document.getElementById(preRenderIds.wrapper);
15420
+ const preRenderWrapperElement = document.getElementById(preRenderIds.wrapper);
15421
+ this.preRenderWrapper = this.preRenderWrapper || preRenderWrapperElement;
15355
15422
  this.preRenderChild = this.preRenderChild || document.getElementById(preRenderIds.child);
15356
15423
  if (this.preRenderWrapper && this.preRenderChild) {
15357
15424
  this.isPreRendered = true;
@@ -15853,7 +15920,7 @@ class V1Embed extends TsEmbed {
15853
15920
  const filterQuery = getFilterQuery(runtimeFilters || []);
15854
15921
  queryString = [filterQuery, queryString].filter(Boolean).join('&');
15855
15922
  }
15856
- return (this.viewConfig.enableV2Shell_experimental)
15923
+ return this.viewConfig.enableV2Shell_experimental
15857
15924
  ? this.getEmbedBasePath(queryString)
15858
15925
  : this.getV1EmbedBasePath(queryString);
15859
15926
  }
@@ -15908,8 +15975,10 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
15908
15975
  if (dataSource) {
15909
15976
  queryParams[Param.DataSources] = `["${dataSource}"]`;
15910
15977
  }
15911
- if ((searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) && !excludeSearchTokenStringFromURL) {
15912
- queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
15978
+ if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) {
15979
+ if (!excludeSearchTokenStringFromURL) {
15980
+ queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
15981
+ }
15913
15982
  if (searchOptions.executeSearch) {
15914
15983
  queryParams[Param.executeSearch] = true;
15915
15984
  }
@@ -16112,8 +16181,10 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
16112
16181
  if (dataSource) {
16113
16182
  queryParams[Param.DataSources] = `["${dataSource}"]`;
16114
16183
  }
16115
- if ((searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) && !excludeSearchTokenStringFromURL) {
16116
- queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
16184
+ if (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchTokenString) {
16185
+ if (!excludeSearchTokenStringFromURL) {
16186
+ queryParams[Param.searchTokenString] = encodeURIComponent(searchOptions.searchTokenString);
16187
+ }
16117
16188
  if (searchOptions.executeSearch) {
16118
16189
  queryParams[Param.executeSearch] = true;
16119
16190
  }
@@ -16308,6 +16379,8 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
16308
16379
  '/embed/insights/viz/',
16309
16380
  '/liveboard/',
16310
16381
  '/insights/liveboard/',
16382
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
16383
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
16311
16384
  ];
16312
16385
  if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
16313
16386
  // Ignore the height reset of the frame, if the navigation is
@@ -16569,6 +16642,12 @@ const addPreviewStylesIfNotPresent = () => {
16569
16642
  * @summary Liveboard & visualization embed
16570
16643
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
16571
16644
  */
16645
+ const liveboardHeightWhitelistedRoutes = [
16646
+ '/embed/viz/',
16647
+ '/embed/insights/viz/',
16648
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
16649
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
16650
+ ];
16572
16651
  /**
16573
16652
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
16574
16653
  * waits for the authentication to complete, so you need not wait for
@@ -16603,8 +16682,8 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
16603
16682
  responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
16604
16683
  };
16605
16684
  this.setIframeHeightForNonEmbedLiveboard = (data) => {
16606
- if (data.data.currentPath.startsWith('/embed/viz/')
16607
- || data.data.currentPath.startsWith('/embed/insights/viz/')) {
16685
+ const routePath = data.data.currentPath;
16686
+ if (liveboardHeightWhitelistedRoutes.some((path) => routePath.startsWith(path))) {
16608
16687
  return;
16609
16688
  }
16610
16689
  this.setIFrameHeight(this.defaultHeight);
@@ -16888,7 +16967,7 @@ let ConversationEmbed$1 = class ConversationEmbed extends TsEmbed {
16888
16967
  this.viewConfig = viewConfig;
16889
16968
  }
16890
16969
  getIframeSrc() {
16891
- const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, } = this.viewConfig;
16970
+ const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
16892
16971
  const path = 'insights/conv-assist';
16893
16972
  if (!worksheetId) {
16894
16973
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
@@ -16901,6 +16980,15 @@ let ConversationEmbed$1 = class ConversationEmbed extends TsEmbed {
16901
16980
  if (!isUndefined_1(hideSourceSelection)) {
16902
16981
  queryParams[Param.HideSourceSelection] = !!hideSourceSelection;
16903
16982
  }
16983
+ if (!isUndefined_1(dataPanelV2)) {
16984
+ queryParams[Param.DataPanelV2Enabled] = !!dataPanelV2;
16985
+ }
16986
+ if (!isUndefined_1(showSpotterLimitations)) {
16987
+ queryParams[Param.ShowSpotterLimitations] = !!showSpotterLimitations;
16988
+ }
16989
+ if (!isUndefined_1(hideSampleQuestions)) {
16990
+ queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
16991
+ }
16904
16992
  let query = '';
16905
16993
  const queryParamsString = getQueryParamString(queryParams, true);
16906
16994
  if (queryParamsString) {