@thoughtspot/visual-embed-sdk 1.37.0 → 1.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/auth.d.ts +9 -4
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +21 -0
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/auth.spec.js +48 -0
  7. package/cjs/src/auth.spec.js.map +1 -1
  8. package/cjs/src/embed/app.d.ts +99 -0
  9. package/cjs/src/embed/app.d.ts.map +1 -1
  10. package/cjs/src/embed/app.js +48 -3
  11. package/cjs/src/embed/app.js.map +1 -1
  12. package/cjs/src/embed/app.spec.js +61 -0
  13. package/cjs/src/embed/app.spec.js.map +1 -1
  14. package/cjs/src/embed/base.d.ts.map +1 -1
  15. package/cjs/src/embed/base.js +7 -0
  16. package/cjs/src/embed/base.js.map +1 -1
  17. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  18. package/cjs/src/embed/ts-embed.js +10 -5
  19. package/cjs/src/embed/ts-embed.js.map +1 -1
  20. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  21. package/cjs/src/embed/ts-embed.spec.js +105 -0
  22. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  23. package/cjs/src/types.d.ts +69 -4
  24. package/cjs/src/types.d.ts.map +1 -1
  25. package/cjs/src/types.js +54 -2
  26. package/cjs/src/types.js.map +1 -1
  27. package/cjs/src/utils/graphql/answerService/answerService.d.ts +35 -15
  28. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  29. package/cjs/src/utils/graphql/answerService/answerService.js +35 -15
  30. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  31. package/cjs/src/utils/processData.js +6 -4
  32. package/cjs/src/utils/processData.js.map +1 -1
  33. package/dist/{index-DnIvX1FR.js → index-m9UtENc9.js} +1 -1
  34. package/dist/src/auth.d.ts +9 -4
  35. package/dist/src/auth.d.ts.map +1 -1
  36. package/dist/src/embed/app.d.ts +99 -0
  37. package/dist/src/embed/app.d.ts.map +1 -1
  38. package/dist/src/embed/base.d.ts.map +1 -1
  39. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  40. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  41. package/dist/src/types.d.ts +69 -4
  42. package/dist/src/types.d.ts.map +1 -1
  43. package/dist/src/utils/graphql/answerService/answerService.d.ts +35 -15
  44. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  45. package/dist/tsembed-react.es.js +183 -31
  46. package/dist/tsembed-react.js +182 -30
  47. package/dist/tsembed.es.js +183 -31
  48. package/dist/tsembed.js +182 -30
  49. package/dist/visual-embed-sdk-react-full.d.ts +212 -23
  50. package/dist/visual-embed-sdk-react.d.ts +212 -23
  51. package/dist/visual-embed-sdk.d.ts +212 -23
  52. package/lib/package.json +2 -2
  53. package/lib/src/auth.d.ts +9 -4
  54. package/lib/src/auth.d.ts.map +1 -1
  55. package/lib/src/auth.js +21 -0
  56. package/lib/src/auth.js.map +1 -1
  57. package/lib/src/auth.spec.js +48 -0
  58. package/lib/src/auth.spec.js.map +1 -1
  59. package/lib/src/embed/app.d.ts +99 -0
  60. package/lib/src/embed/app.d.ts.map +1 -1
  61. package/lib/src/embed/app.js +47 -2
  62. package/lib/src/embed/app.js.map +1 -1
  63. package/lib/src/embed/app.spec.js +62 -1
  64. package/lib/src/embed/app.spec.js.map +1 -1
  65. package/lib/src/embed/base.d.ts.map +1 -1
  66. package/lib/src/embed/base.js +7 -0
  67. package/lib/src/embed/base.js.map +1 -1
  68. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  69. package/lib/src/embed/ts-embed.js +10 -5
  70. package/lib/src/embed/ts-embed.js.map +1 -1
  71. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  72. package/lib/src/embed/ts-embed.spec.js +105 -0
  73. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  74. package/lib/src/types.d.ts +69 -4
  75. package/lib/src/types.d.ts.map +1 -1
  76. package/lib/src/types.js +54 -2
  77. package/lib/src/types.js.map +1 -1
  78. package/lib/src/utils/graphql/answerService/answerService.d.ts +35 -15
  79. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  80. package/lib/src/utils/graphql/answerService/answerService.js +35 -15
  81. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  82. package/lib/src/utils/processData.js +6 -4
  83. package/lib/src/utils/processData.js.map +1 -1
  84. package/lib/src/visual-embed-sdk.d.ts +212 -23
  85. package/package.json +2 -2
  86. package/src/auth.spec.ts +52 -0
  87. package/src/auth.ts +25 -3
  88. package/src/embed/app.spec.ts +88 -0
  89. package/src/embed/app.ts +133 -0
  90. package/src/embed/base.ts +9 -0
  91. package/src/embed/ts-embed.spec.ts +130 -0
  92. package/src/embed/ts-embed.ts +10 -4
  93. package/src/types.ts +68 -3
  94. package/src/utils/graphql/answerService/answerService.ts +35 -15
  95. package/src/utils/processData.ts +6 -6
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.37.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.37.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -581,6 +581,18 @@
581
581
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
582
582
  */
583
583
  HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
584
+ /**
585
+ * Create new options in the insights left navigation,
586
+ * available when new navigation V3 is enabled.
587
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
588
+ */
589
+ HomeLeftNavItem["Create"] = "create";
590
+ /**
591
+ * Spotter option in the insights left navigation,
592
+ * available when new navigation V3 is enabled.
593
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
594
+ */
595
+ HomeLeftNavItem["Spotter"] = "spotter";
584
596
  })(exports.HomeLeftNavItem || (exports.HomeLeftNavItem = {}));
585
597
  /**
586
598
  * A map of the supported runtime filter operations
@@ -1993,9 +2005,12 @@
1993
2005
  * @example
1994
2006
  * ```js
1995
2007
  * searchEmbed.trigger(HostEvent.OpenFilter,
1996
- * { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
2008
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
2009
+ * ```
2010
+ * @example
2011
+ * ```js
1997
2012
  * LiveboardEmbed.trigger(HostEvent.OpenFilter,
1998
- * { columnId: '<column-GUID>'})
2013
+ * { column: {columnId: '<column-GUID>'}})
1999
2014
  * ```
2000
2015
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2001
2016
  */
@@ -2604,6 +2619,25 @@
2604
2619
  * }]
2605
2620
  * });
2606
2621
  * ```
2622
+ * If there are multiple columns with the same name, consider
2623
+ * using `WORKSHEET_NAME::COLUMN_NAME` format.
2624
+ *
2625
+ * @example
2626
+ *
2627
+ * ```js
2628
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2629
+ * filters: [{
2630
+ * column: "(Sample) Retail - Apparel::city",
2631
+ * oper: 'IN',
2632
+ * values: ["atlanta"]
2633
+ * },
2634
+ * {
2635
+ * column: "(Sample) Retail - Apparel::Region",
2636
+ * oper: 'IN',
2637
+ * values: ["West","Midwest"]
2638
+ * }]
2639
+ * });
2640
+ * ```
2607
2641
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2608
2642
  */
2609
2643
  HostEvent["UpdateFilters"] = "updateFilters";
@@ -2663,8 +2697,17 @@
2663
2697
  /**
2664
2698
  * Get the Answer session for a Search or
2665
2699
  * Liveboard visualization.
2700
+ *
2701
+ * Note: This event is not typically used directly. Instead, use the
2702
+ * `getAnswerService()` method on the embed instance to get an AnswerService
2703
+ * object that provides a more convenient interface for working with answers.
2704
+ *
2666
2705
  * @example
2667
2706
  * ```js
2707
+ * // Preferred way to get an AnswerService
2708
+ * const service = await embed.getAnswerService();
2709
+ *
2710
+ * // Alternative direct usage (not recommended)
2668
2711
  * const {session} = await embed.trigger(
2669
2712
  * HostEvent.GetAnswerSession, {
2670
2713
  * vizId: '123', // For Liveboard Visualization.
@@ -2672,6 +2715,10 @@
2672
2715
  * ```
2673
2716
  * @example
2674
2717
  * ```js
2718
+ * // Preferred way to get an AnswerService
2719
+ * const service = await embed.getAnswerService();
2720
+ *
2721
+ * // Alternative direct usage (not recommended)
2675
2722
  * const {session} = await embed.trigger( HostEvent.GetAnswerSession )
2676
2723
  * ```
2677
2724
  * @version SDK: 1.26.0 | ThoughtSpot: 9.10.0.cl, 10.1.0.sw
@@ -2880,6 +2927,10 @@
2880
2927
  Param["ShowInsertToSlide"] = "insertInToSlide";
2881
2928
  Param["PrimaryNavHidden"] = "primaryNavHidden";
2882
2929
  Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
2930
+ Param["NavigationVersion"] = "navigationVersion";
2931
+ Param["HideHamburger"] = "hideHamburger";
2932
+ Param["HideObjectSearch"] = "hideObjectSearch";
2933
+ Param["HideNotification"] = "hideNotification";
2883
2934
  Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
2884
2935
  Param["HideOrgSwitcher"] = "orgSwitcherHidden";
2885
2936
  Param["IsSageEmbed"] = "isSageEmbed";
@@ -2936,6 +2987,7 @@
2936
2987
  Param["preAuthCache"] = "preAuthCache";
2937
2988
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2938
2989
  Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
2990
+ Param["PrimaryAction"] = "primaryAction";
2939
2991
  })(Param || (Param = {}));
2940
2992
  /**
2941
2993
  * ThoughtSpot application pages include actions and menu commands
@@ -7173,29 +7225,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
7173
7225
  OperationType["GetTableWithHeadlineData"] = "GetTableWithHeadlineData";
7174
7226
  })(OperationType || (OperationType = {}));
7175
7227
  /**
7176
- * Class representing the answer service provided with the
7177
- * custom action payload. This service could be used to run
7178
- * graphql queries in the context of the answer on which the
7179
- * custom action was triggered.
7228
+ * AnswerService provides a simple way to work with ThoughtSpot Answers.
7229
+ *
7230
+ * This service allows you to interact with ThoughtSpot Answers programmatically,
7231
+ * making it easy to customize visualizations, filter data, and extract insights
7232
+ * directly from your application.
7233
+ *
7234
+ * You can use this service to:
7235
+ * - Add or remove columns from Answers (`addColumns`, `removeColumns`, `addColumnsByName`)
7236
+ * - Apply filters to Answers (`addFilter`)
7237
+ * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`, `fetchCSVBlob`, `fetchPNGBlob`)
7238
+ * - Get data for specific points in visualizations (`getUnderlyingDataForPoint`)
7239
+ * - Run custom queries (`executeQuery`)
7240
+ * - Add visualizations to liveboards (`addDisplayedVizToLiveboard`)
7241
+ *
7180
7242
  * @example
7181
7243
  * ```js
7182
- * embed.on(EmbedEvent.CustomAction, e => {
7183
- * const underlying = await e.answerService.getUnderlyingDataForPoint([
7184
- * 'col name 1'
7185
- * ]);
7186
- * const data = await underlying.fetchData(0, 100);
7187
- * })
7244
+ * // Get the answer service
7245
+ * embed.on(EmbedEvent.Data, async (e) => {
7246
+ * const service = await embed.getAnswerService();
7247
+ *
7248
+ * // Add columns to the answer
7249
+ * await service.addColumnsByName(["Sales", "Region"]);
7250
+ *
7251
+ * // Get the data
7252
+ * const data = await service.fetchData();
7253
+ * console.log(data);
7254
+ * });
7188
7255
  * ```
7256
+ *
7189
7257
  * @example
7190
7258
  * ```js
7191
- * embed.on(EmbedEvent.Data, async (e) => {
7192
- * const service = await embed.getAnswerService();
7193
- * await service.addColumns([
7194
- * "<column guid>"
7259
+ * // Get data for a point in a visualization
7260
+ * embed.on(EmbedEvent.CustomAction, async (e) => {
7261
+ * const underlying = await e.answerService.getUnderlyingDataForPoint([
7262
+ * 'Product Name',
7263
+ * 'Sales Amount'
7195
7264
  * ]);
7196
- * console.log(await service.fetchData());
7265
+ *
7266
+ * const data = await underlying.fetchData(0, 100);
7267
+ * console.log(data);
7197
7268
  * });
7198
7269
  * ```
7270
+ *
7199
7271
  * @version SDK: 1.25.0| ThoughtSpot: 9.10.0.cl
7200
7272
  * @group Events
7201
7273
  */
@@ -14471,6 +14543,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14471
14543
  AuthFailureType["EXPIRY"] = "EXPIRY";
14472
14544
  AuthFailureType["OTHER"] = "OTHER";
14473
14545
  AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
14546
+ AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
14474
14547
  })(exports.AuthFailureType || (exports.AuthFailureType = {}));
14475
14548
  /**
14476
14549
  * Enum for auth status emitted by the emitter returned from {@link init}.
@@ -14506,6 +14579,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14506
14579
  * @version SDK: 1.19.0
14507
14580
  */
14508
14581
  AuthStatus["WAITING_FOR_POPUP"] = "WAITING_FOR_POPUP";
14582
+ /**
14583
+ * Emitted when the SAML popup is closed without authentication
14584
+ */
14585
+ AuthStatus["SAML_POPUP_CLOSED_NO_AUTH"] = "SAML_POPUP_CLOSED_NO_AUTH";
14509
14586
  })(exports.AuthStatus || (exports.AuthStatus = {}));
14510
14587
  /**
14511
14588
  * Events which can be triggered on the emitter returned from {@link init}.
@@ -14726,14 +14803,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14726
14803
  * @param triggerText
14727
14804
  */
14728
14805
  async function samlPopupFlow(ssoURL, triggerContainer, triggerText) {
14806
+ let popupClosedCheck;
14729
14807
  const openPopup = () => {
14730
14808
  if (samlAuthWindow === null || samlAuthWindow.closed) {
14731
14809
  samlAuthWindow = window.open(ssoURL, '_blank', 'location=no,height=570,width=520,scrollbars=yes,status=yes');
14810
+ if (samlAuthWindow) {
14811
+ popupClosedCheck = setInterval(() => {
14812
+ if (samlAuthWindow.closed) {
14813
+ clearInterval(popupClosedCheck);
14814
+ if (samlCompletionPromise && !samlCompletionResolved) {
14815
+ authEE === null || authEE === void 0 ? void 0 : authEE.emit(exports.AuthStatus.SAML_POPUP_CLOSED_NO_AUTH);
14816
+ }
14817
+ }
14818
+ }, 500);
14819
+ }
14732
14820
  }
14733
14821
  else {
14734
14822
  samlAuthWindow.focus();
14735
14823
  }
14736
14824
  };
14825
+ let samlCompletionResolved = false;
14737
14826
  authEE === null || authEE === void 0 ? void 0 : authEE.emit(exports.AuthStatus.WAITING_FOR_POPUP);
14738
14827
  const containerEl = getDOMNode(triggerContainer);
14739
14828
  if (containerEl) {
@@ -14745,6 +14834,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14745
14834
  samlCompletionPromise = samlCompletionPromise || new Promise((resolve, reject) => {
14746
14835
  window.addEventListener('message', (e) => {
14747
14836
  if (e.data.type === exports.EmbedEvent.SAMLComplete) {
14837
+ samlCompletionResolved = true;
14838
+ if (popupClosedCheck) {
14839
+ clearInterval(popupClosedCheck);
14840
+ }
14748
14841
  e.source.close();
14749
14842
  resolve();
14750
14843
  }
@@ -14934,6 +15027,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14934
15027
  iFrame.style.width = '0';
14935
15028
  iFrame.style.height = '0';
14936
15029
  iFrame.style.border = '0';
15030
+ // Make it 'fixed' to keep it in a different stacking context.
15031
+ // This should solve the focus behaviours inside the iframe from
15032
+ // interfering with main body.
15033
+ iFrame.style.position = 'fixed';
15034
+ // Push it out of viewport.
15035
+ iFrame.style.top = '100vh';
15036
+ iFrame.style.left = '100vw';
14937
15037
  iFrame.classList.add('prefetchIframe');
14938
15038
  iFrame.classList.add(`prefetchIframeNum-${index}`);
14939
15039
  document.body.appendChild(iFrame);
@@ -15250,15 +15350,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15250
15350
  * @param containerEl
15251
15351
  */
15252
15352
  function processAuthFailure(e, containerEl) {
15353
+ var _a;
15253
15354
  const { loginFailedMessage, authType, disableLoginFailurePage, autoLogin, } = getEmbedConfig();
15254
- if (autoLogin
15255
- && (authType === exports.AuthType.TrustedAuthToken
15256
- || authType === exports.AuthType.TrustedAuthTokenCookieless)) {
15355
+ const isEmbeddedSSO = authType === exports.AuthType.EmbeddedSSO;
15356
+ const isTrustedAuth = authType === exports.AuthType.TrustedAuthToken || authType === exports.AuthType.TrustedAuthTokenCookieless;
15357
+ const isEmbeddedSSOInfoFailure = isEmbeddedSSO && ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.type) === exports.AuthFailureType.UNAUTHENTICATED_FAILURE;
15358
+ if (autoLogin && isTrustedAuth) {
15257
15359
  // eslint-disable-next-line no-param-reassign
15258
15360
  containerEl.innerHTML = loginFailedMessage;
15259
15361
  notifyAuthFailure(exports.AuthFailureType.IDLE_SESSION_TIMEOUT);
15260
15362
  }
15261
- else if (authType !== exports.AuthType.None && !disableLoginFailurePage) {
15363
+ else if (authType !== exports.AuthType.None && !disableLoginFailurePage && !isEmbeddedSSOInfoFailure) {
15262
15364
  // eslint-disable-next-line no-param-reassign
15263
15365
  containerEl.innerHTML = loginFailedMessage;
15264
15366
  notifyAuthFailure(exports.AuthFailureType.OTHER);
@@ -15303,7 +15405,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15303
15405
  return e;
15304
15406
  }
15305
15407
 
15306
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.0";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:"^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$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};
15408
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15307
15409
 
15308
15410
  /**
15309
15411
  * Reloads the ThoughtSpot iframe.
@@ -15537,11 +15639,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15537
15639
  * @param responder
15538
15640
  */
15539
15641
  this.updateAuthToken = async (_, responder) => {
15540
- const { autoLogin = false, authType } = this.embedConfig; // Set autoLogin default to false
15541
- if (authType === exports.AuthType.TrustedAuthTokenCookieless) {
15542
- let authToken = '';
15642
+ const { authType } = this.embedConfig;
15643
+ let { autoLogin } = this.embedConfig;
15644
+ // Default autoLogin: true for cookieless if undefined/null, otherwise false
15645
+ autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === exports.AuthType.TrustedAuthTokenCookieless);
15646
+ if (autoLogin && authType === exports.AuthType.TrustedAuthTokenCookieless) {
15543
15647
  try {
15544
- authToken = await getAuthenticationToken(this.embedConfig);
15648
+ const authToken = await getAuthenticationToken(this.embedConfig);
15545
15649
  responder({
15546
15650
  type: exports.EmbedEvent.AuthExpire,
15547
15651
  data: { authToken },
@@ -15840,7 +15944,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15840
15944
  if (this.embedConfig.currencyFormat) {
15841
15945
  queryParams[Param.CurrencyFormat] = this.embedConfig.currencyFormat;
15842
15946
  }
15843
- const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, } = this.viewConfig;
15947
+ const { disabledActions, disabledActionReason, hiddenActions, visibleActions, hiddenTabs, visibleTabs, showAlerts, additionalFlags: additionalFlagsFromView, locale, customizations, contextMenuTrigger, linkOverride, insertInToSlide, disableRedirectionLinksInNewTab, overrideOrgId, exposeTranslationIDs, primaryAction, } = this.viewConfig;
15844
15948
  const { additionalFlags: additionalFlagsFromInit } = this.embedConfig;
15845
15949
  const additionalFlags = {
15846
15950
  ...additionalFlagsFromInit,
@@ -15854,6 +15958,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15854
15958
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
15855
15959
  return queryParams;
15856
15960
  }
15961
+ if (primaryAction) {
15962
+ queryParams[Param.PrimaryAction] = primaryAction;
15963
+ }
15857
15964
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
15858
15965
  queryParams[Param.DisableActions] = disabledActions;
15859
15966
  }
@@ -16692,6 +16799,31 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16692
16799
  HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
16693
16800
  HomePageSearchBarMode["NONE"] = "none";
16694
16801
  })(exports.HomePageSearchBarMode || (exports.HomePageSearchBarMode = {}));
16802
+ /**
16803
+ * Define the version of the primary navbar
16804
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
16805
+ */
16806
+ var PrimaryNavbarVersion;
16807
+ (function (PrimaryNavbarVersion) {
16808
+ /**
16809
+ * Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
16810
+ * along with updates to the top navigation bar.
16811
+ * It serves as the foundational version of the PrimaryNavBar.
16812
+ */
16813
+ PrimaryNavbarVersion["Sliding"] = "v3";
16814
+ })(PrimaryNavbarVersion || (PrimaryNavbarVersion = {}));
16815
+ /**
16816
+ * Define the version of the home page
16817
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
16818
+ */
16819
+ var HomePage;
16820
+ (function (HomePage) {
16821
+ /**
16822
+ * Modular (v2) introduces the updated Modular Home Experience.
16823
+ * It serves as the foundational version of the home page.
16824
+ */
16825
+ HomePage["Modular"] = "v2";
16826
+ })(HomePage || (HomePage = {}));
16695
16827
  /**
16696
16828
  * Embeds full ThoughtSpot experience in a host application.
16697
16829
  * @group Embed components
@@ -16746,9 +16878,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16746
16878
  * embedded Liveboard or visualization.
16747
16879
  */
16748
16880
  getEmbedParams() {
16749
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, 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,
16881
+ 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,
16750
16882
  /* eslint-disable-next-line max-len */
16751
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
16883
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
16752
16884
  let params = {};
16753
16885
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
16754
16886
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -16765,6 +16897,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16765
16897
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
16766
16898
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
16767
16899
  params = this.getBaseQueryParams(params);
16900
+ if (hideObjectSearch) {
16901
+ params[Param.HideObjectSearch] = !!hideObjectSearch;
16902
+ }
16903
+ if (hideHamburger) {
16904
+ params[Param.HideHamburger] = !!hideHamburger;
16905
+ }
16906
+ if (hideNotification) {
16907
+ params[Param.HideNotification] = !!hideNotification;
16908
+ }
16768
16909
  if (fullHeight === true) {
16769
16910
  params[Param.fullHeight] = true;
16770
16911
  }
@@ -16812,6 +16953,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16812
16953
  /* eslint-disable-next-line max-len */
16813
16954
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
16814
16955
  }
16956
+ if (discoveryExperience) {
16957
+ // primaryNavbarVersion v3 will enabled the new left navigation
16958
+ if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
16959
+ params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
16960
+ }
16961
+ // homePage v2 will enable the modular home page
16962
+ // and it will override the modularHomeExperience value
16963
+ if (discoveryExperience.homePage === HomePage.Modular) {
16964
+ params[Param.ModularHomeExperienceEnabled] = true;
16965
+ }
16966
+ }
16815
16967
  const queryParams = getQueryParamString(params, true);
16816
16968
  return queryParams;
16817
16969
  }