@thoughtspot/visual-embed-sdk 1.21.0-react.2 → 1.21.0-sage.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 (91) hide show
  1. package/cjs/package.json +5 -5
  2. package/cjs/src/embed/nls.spec.d.ts +1 -0
  3. package/cjs/src/embed/nls.spec.d.ts.map +1 -0
  4. package/cjs/src/embed/nls.spec.js +1 -0
  5. package/cjs/src/embed/nls.spec.js.map +1 -0
  6. package/cjs/src/embed/sage-fullscreen.d.ts +87 -0
  7. package/cjs/src/embed/sage-fullscreen.d.ts.map +1 -0
  8. package/cjs/src/embed/sage-fullscreen.js +114 -0
  9. package/cjs/src/embed/sage-fullscreen.js.map +1 -0
  10. package/cjs/src/embed/sage.d.ts +104 -0
  11. package/cjs/src/embed/sage.d.ts.map +1 -0
  12. package/cjs/src/embed/sage.js +119 -0
  13. package/cjs/src/embed/sage.js.map +1 -0
  14. package/cjs/src/errors.d.ts +1 -0
  15. package/cjs/src/errors.d.ts.map +1 -1
  16. package/cjs/src/errors.js +1 -0
  17. package/cjs/src/errors.js.map +1 -1
  18. package/cjs/src/index.d.ts +2 -1
  19. package/cjs/src/index.d.ts.map +1 -1
  20. package/cjs/src/index.js +3 -1
  21. package/cjs/src/index.js.map +1 -1
  22. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  23. package/cjs/src/mixpanel-service.js +6 -11
  24. package/cjs/src/mixpanel-service.js.map +1 -1
  25. package/cjs/src/react/index.d.ts +9 -5
  26. package/cjs/src/react/index.d.ts.map +1 -1
  27. package/cjs/src/react/index.js +3 -1
  28. package/cjs/src/react/index.js.map +1 -1
  29. package/cjs/src/types.d.ts +9 -1
  30. package/cjs/src/types.d.ts.map +1 -1
  31. package/cjs/src/types.js +4 -0
  32. package/cjs/src/types.js.map +1 -1
  33. package/dist/src/embed/sage-fullscreen.d.ts +87 -0
  34. package/dist/src/embed/sage-fullscreen.d.ts.map +1 -0
  35. package/dist/src/embed/sage.d.ts +104 -0
  36. package/dist/src/embed/sage.d.ts.map +1 -0
  37. package/dist/src/errors.d.ts +1 -0
  38. package/dist/src/errors.d.ts.map +1 -1
  39. package/dist/src/index.d.ts +2 -1
  40. package/dist/src/index.d.ts.map +1 -1
  41. package/dist/src/mixpanel-service.d.ts.map +1 -1
  42. package/dist/src/react/index.d.ts +9 -5
  43. package/dist/src/react/index.d.ts.map +1 -1
  44. package/dist/src/types.d.ts +9 -1
  45. package/dist/src/types.d.ts.map +1 -1
  46. package/dist/tsembed-react.es.js +126 -13
  47. package/dist/tsembed-react.js +126 -12
  48. package/dist/tsembed.es.js +125 -13
  49. package/dist/tsembed.js +125 -12
  50. package/dist/visual-embed-sdk-react-full.d.ts +99 -3
  51. package/dist/visual-embed-sdk.d.ts +95 -2
  52. package/lib/package.json +5 -5
  53. package/lib/src/embed/nls.spec.d.ts +1 -0
  54. package/lib/src/embed/nls.spec.d.ts.map +1 -0
  55. package/lib/src/embed/nls.spec.js +1 -0
  56. package/lib/src/embed/nls.spec.js.map +1 -0
  57. package/lib/src/embed/sage-fullscreen.d.ts +87 -0
  58. package/lib/src/embed/sage-fullscreen.d.ts.map +1 -0
  59. package/lib/src/embed/sage-fullscreen.js +110 -0
  60. package/lib/src/embed/sage-fullscreen.js.map +1 -0
  61. package/lib/src/embed/sage.d.ts +104 -0
  62. package/lib/src/embed/sage.d.ts.map +1 -0
  63. package/lib/src/embed/sage.js +115 -0
  64. package/lib/src/embed/sage.js.map +1 -0
  65. package/lib/src/errors.d.ts +1 -0
  66. package/lib/src/errors.d.ts.map +1 -1
  67. package/lib/src/errors.js +1 -0
  68. package/lib/src/errors.js.map +1 -1
  69. package/lib/src/index.d.ts +2 -1
  70. package/lib/src/index.d.ts.map +1 -1
  71. package/lib/src/index.js +2 -1
  72. package/lib/src/index.js.map +1 -1
  73. package/lib/src/mixpanel-service.d.ts.map +1 -1
  74. package/lib/src/mixpanel-service.js +6 -11
  75. package/lib/src/mixpanel-service.js.map +1 -1
  76. package/lib/src/react/index.d.ts +9 -5
  77. package/lib/src/react/index.d.ts.map +1 -1
  78. package/lib/src/react/index.js +2 -0
  79. package/lib/src/react/index.js.map +1 -1
  80. package/lib/src/types.d.ts +9 -1
  81. package/lib/src/types.d.ts.map +1 -1
  82. package/lib/src/types.js +4 -0
  83. package/lib/src/types.js.map +1 -1
  84. package/package.json +5 -5
  85. package/src/embed/sage.ts +193 -0
  86. package/src/errors.ts +1 -0
  87. package/src/index.ts +2 -0
  88. package/src/mixpanel-service.ts +6 -10
  89. package/src/react/index.tsx +10 -1
  90. package/src/types.ts +8 -0
  91. package/dist/visual-embed-sdk-react.d.ts +0 -2781
@@ -1638,6 +1638,10 @@ var Param;
1638
1638
  Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
1639
1639
  Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
1640
1640
  Param["HideOrgSwitcher"] = "orgSwitcherHidden";
1641
+ Param["IsSageEmbed"] = "isSageEmbed";
1642
+ Param["HideWorksheetSelector"] = "hideWorksheetSelector";
1643
+ Param["DisableWorksheetChange"] = "disableWorksheetChange";
1644
+ Param["HideEurekaResults"] = "hideEurekaResults";
1641
1645
  })(Param || (Param = {}));
1642
1646
  /**
1643
1647
  * The list of actions that can be performed on visual ThoughtSpot
@@ -1896,6 +1900,7 @@ const ERROR_MESSAGE = {
1896
1900
  LIVEBOARD_VIZ_ID_VALIDATION: 'Please provide either liveboardId or pinboardId',
1897
1901
  TRIGGER_TIMED_OUT: 'Trigger timedout in getting response',
1898
1902
  SEARCHEMBED_BETA_WRANING_MESSAGE: 'Search Embed is in Beta in this release.',
1903
+ SAGE_EMBED_BETA_WARNING_MESSAGE: 'Sage Embed is in Beta in this release.',
1899
1904
  };
1900
1905
 
1901
1906
  /**
@@ -7988,18 +7993,13 @@ function initMixpanel(sessionInfo) {
7988
7993
  // userGUID
7989
7994
  const isPublicCluster = !!sessionInfo.isPublicUser;
7990
7995
  const token = sessionInfo.mixpanelToken;
7991
- try {
7992
- if (token) {
7993
- mixpanel_cjs.init(token);
7994
- if (!isPublicCluster) {
7995
- mixpanel_cjs.identify(sessionInfo.userGUID);
7996
- }
7997
- isMixpanelInitialized = true;
7998
- emptyQueue();
7996
+ if (token) {
7997
+ mixpanel_cjs.init(token);
7998
+ if (!isPublicCluster) {
7999
+ mixpanel_cjs.identify(sessionInfo.userGUID);
7999
8000
  }
8000
- }
8001
- catch (e) {
8002
- console.error('Error initializing mixpanel', e);
8001
+ isMixpanelInitialized = true;
8002
+ emptyQueue();
8003
8003
  }
8004
8004
  }
8005
8005
 
@@ -26662,7 +26662,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
26662
26662
  });
26663
26663
  }
26664
26664
 
26665
- var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-react.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:"./dist/tsembed.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"}};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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run bundle-dts-react-full; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.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","@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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,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};
26665
+ var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-sage.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:"./dist/tsembed.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/index.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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run bundle-dts-react-full; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.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","@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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,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};
26666
26666
 
26667
26667
  /**
26668
26668
  * Copyright (c) 2022
@@ -27438,6 +27438,118 @@ class SearchBarEmbed extends TsEmbed {
27438
27438
  }
27439
27439
  }
27440
27440
 
27441
+ /**
27442
+ * Copyright (c) 2022
27443
+ *
27444
+ * Embed ThoughtSpot Sage
27445
+ *
27446
+ * @summary TS Sage embed
27447
+ * @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
27448
+ */
27449
+ const HiddenActionItemByDefaultForSageEmbed = [
27450
+ Action.Save,
27451
+ Action.Pin,
27452
+ Action.EditACopy,
27453
+ Action.SaveAsView,
27454
+ Action.UpdateTML,
27455
+ Action.EditTML,
27456
+ Action.AnswerDelete,
27457
+ ];
27458
+ /**
27459
+ * Embed ThoughtSpot search
27460
+ *
27461
+ * @group Embed components
27462
+ */
27463
+ class SageEmbed extends V1Embed {
27464
+ // eslint-disable-next-line no-useless-constructor
27465
+ constructor(domSelector, viewConfig) {
27466
+ super(domSelector, viewConfig);
27467
+ this.defaultHeight = 500;
27468
+ /**
27469
+ * Set the iframe height as per the computed height received
27470
+ * from the ThoughtSpot app.
27471
+ *
27472
+ * @param {MessagePayload} data The event payload
27473
+ */
27474
+ this.updateIFrameHeight = (data) => {
27475
+ this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
27476
+ };
27477
+ this.embedIframeCenter = (data, responder) => {
27478
+ const obj = this.getIframeCenter();
27479
+ responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
27480
+ };
27481
+ this.setIframeHeightForNonEmbedLiveboard = (data) => {
27482
+ if (!data.data.currentPath.startsWith('/embed/viz/')) {
27483
+ this.setIFrameHeight(this.defaultHeight);
27484
+ }
27485
+ };
27486
+ if (this.viewConfig.fullHeight === true) {
27487
+ this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
27488
+ this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
27489
+ this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
27490
+ }
27491
+ }
27492
+ /**
27493
+ * Constructs a map of parameters to be passed on to the
27494
+ * embedded Eureka or Sage search page.
27495
+ *
27496
+ * @returns {string} query string
27497
+ */
27498
+ getEmbedParams() {
27499
+ var _a, _b;
27500
+ const { hideEurekaResults, isSageEmbed, disableWorksheetChange, hideWorksheetSelector, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, fullHeight, } = this.viewConfig;
27501
+ const params = {};
27502
+ params[Param.EmbedApp] = true;
27503
+ params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
27504
+ params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
27505
+ params[Param.HideApplicationSwitcher] = !!hideApplicationSwitcher;
27506
+ params[Param.HideOrgSwitcher] = !!hideOrgSwitcher;
27507
+ params[Param.HideActions] = [...((_a = params[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
27508
+ params[Param.HideActions] = [
27509
+ ...((_b = params[Param.HideActions]) !== null && _b !== void 0 ? _b : []),
27510
+ ...HiddenActionItemByDefaultForSageEmbed,
27511
+ ];
27512
+ if (fullHeight === true) {
27513
+ params[Param.fullHeight] = true;
27514
+ }
27515
+ if (hideEurekaResults) {
27516
+ params[Param.HideEurekaResults] = true;
27517
+ }
27518
+ if (isSageEmbed) {
27519
+ params[Param.IsSageEmbed] = true;
27520
+ }
27521
+ if (disableWorksheetChange) {
27522
+ params[Param.DisableWorksheetChange] = true;
27523
+ }
27524
+ if (hideWorksheetSelector) {
27525
+ params[Param.HideWorksheetSelector] = true;
27526
+ }
27527
+ return getQueryParamString(params, true);
27528
+ }
27529
+ /**
27530
+ * Construct the URL of the embedded ThoughtSpot sage to be
27531
+ * loaded in the iframe
27532
+ *
27533
+ * @returns {string} iframe url
27534
+ */
27535
+ getIFrameSrc() {
27536
+ const path = 'eureka';
27537
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams();
27538
+ return `${this.getRootIframeSrc()}/embed/${path}${tsPostHashParams}`;
27539
+ }
27540
+ /**
27541
+ * Render the embedded ThoughtSpot Sage
27542
+ *
27543
+ * @returns {SageEmbed} Eureka/Sage embed
27544
+ */
27545
+ render() {
27546
+ super.render();
27547
+ const src = this.getIFrameSrc();
27548
+ this.renderV1Embed(src);
27549
+ return this;
27550
+ }
27551
+ }
27552
+
27441
27553
  /**
27442
27554
  * Copyright (c) 2022
27443
27555
  *
@@ -28022,6 +28134,7 @@ const PinboardEmbed = LiveboardEmbed$1;
28022
28134
  * ```
28023
28135
  */
28024
28136
  const SearchBarEmbed$1 = componentFactory(SearchBarEmbed);
28137
+ const SageEmbed$1 = componentFactory(SageEmbed);
28025
28138
  /**
28026
28139
  * Get a reference to the embed component to trigger events on the component.
28027
28140
  *
@@ -28041,4 +28154,4 @@ const SearchBarEmbed$1 = componentFactory(SearchBarEmbed);
28041
28154
  */
28042
28155
  const useEmbedRef = () => React.useRef(null);
28043
28156
 
28044
- export { Action, AppEmbed$1 as AppEmbed, EmbedEvent, HostEvent, LiveboardEmbed$1 as LiveboardEmbed, Page, PinboardEmbed, RuntimeFilterOp, SearchBarEmbed$1 as SearchBarEmbed, SearchEmbed$1 as SearchEmbed, useEmbedRef };
28157
+ export { Action, AppEmbed$1 as AppEmbed, EmbedEvent, HostEvent, LiveboardEmbed$1 as LiveboardEmbed, Page, PinboardEmbed, RuntimeFilterOp, SageEmbed$1 as SageEmbed, SearchBarEmbed$1 as SearchBarEmbed, SearchEmbed$1 as SearchEmbed, useEmbedRef };
@@ -1595,6 +1595,10 @@
1595
1595
  Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
1596
1596
  Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
1597
1597
  Param["HideOrgSwitcher"] = "orgSwitcherHidden";
1598
+ Param["IsSageEmbed"] = "isSageEmbed";
1599
+ Param["HideWorksheetSelector"] = "hideWorksheetSelector";
1600
+ Param["DisableWorksheetChange"] = "disableWorksheetChange";
1601
+ Param["HideEurekaResults"] = "hideEurekaResults";
1598
1602
  })(Param || (Param = {}));
1599
1603
  (function (Action) {
1600
1604
  Action["Save"] = "save";
@@ -1834,6 +1838,7 @@
1834
1838
  LIVEBOARD_VIZ_ID_VALIDATION: 'Please provide either liveboardId or pinboardId',
1835
1839
  TRIGGER_TIMED_OUT: 'Trigger timedout in getting response',
1836
1840
  SEARCHEMBED_BETA_WRANING_MESSAGE: 'Search Embed is in Beta in this release.',
1841
+ SAGE_EMBED_BETA_WARNING_MESSAGE: 'Sage Embed is in Beta in this release.',
1837
1842
  };
1838
1843
 
1839
1844
  /**
@@ -7926,18 +7931,13 @@
7926
7931
  // userGUID
7927
7932
  const isPublicCluster = !!sessionInfo.isPublicUser;
7928
7933
  const token = sessionInfo.mixpanelToken;
7929
- try {
7930
- if (token) {
7931
- mixpanel_cjs.init(token);
7932
- if (!isPublicCluster) {
7933
- mixpanel_cjs.identify(sessionInfo.userGUID);
7934
- }
7935
- isMixpanelInitialized = true;
7936
- emptyQueue();
7934
+ if (token) {
7935
+ mixpanel_cjs.init(token);
7936
+ if (!isPublicCluster) {
7937
+ mixpanel_cjs.identify(sessionInfo.userGUID);
7937
7938
  }
7938
- }
7939
- catch (e) {
7940
- console.error('Error initializing mixpanel', e);
7939
+ isMixpanelInitialized = true;
7940
+ emptyQueue();
7941
7941
  }
7942
7942
  }
7943
7943
 
@@ -26600,7 +26600,7 @@
26600
26600
  });
26601
26601
  }
26602
26602
 
26603
- var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-react.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$1={".":{"import":"./lib/src/index.js",require:"./dist/tsembed.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"}};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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run bundle-dts-react-full; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.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","@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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,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};
26603
+ var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-sage.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:"./dist/tsembed.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/index.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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run bundle-dts-react-full; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.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","@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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,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};
26604
26604
 
26605
26605
  /**
26606
26606
  * Copyright (c) 2022
@@ -27376,6 +27376,118 @@
27376
27376
  }
27377
27377
  }
27378
27378
 
27379
+ /**
27380
+ * Copyright (c) 2022
27381
+ *
27382
+ * Embed ThoughtSpot Sage
27383
+ *
27384
+ * @summary TS Sage embed
27385
+ * @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
27386
+ */
27387
+ const HiddenActionItemByDefaultForSageEmbed = [
27388
+ exports.Action.Save,
27389
+ exports.Action.Pin,
27390
+ exports.Action.EditACopy,
27391
+ exports.Action.SaveAsView,
27392
+ exports.Action.UpdateTML,
27393
+ exports.Action.EditTML,
27394
+ exports.Action.AnswerDelete,
27395
+ ];
27396
+ /**
27397
+ * Embed ThoughtSpot search
27398
+ *
27399
+ * @group Embed components
27400
+ */
27401
+ class SageEmbed extends V1Embed {
27402
+ // eslint-disable-next-line no-useless-constructor
27403
+ constructor(domSelector, viewConfig) {
27404
+ super(domSelector, viewConfig);
27405
+ this.defaultHeight = 500;
27406
+ /**
27407
+ * Set the iframe height as per the computed height received
27408
+ * from the ThoughtSpot app.
27409
+ *
27410
+ * @param {MessagePayload} data The event payload
27411
+ */
27412
+ this.updateIFrameHeight = (data) => {
27413
+ this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
27414
+ };
27415
+ this.embedIframeCenter = (data, responder) => {
27416
+ const obj = this.getIframeCenter();
27417
+ responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
27418
+ };
27419
+ this.setIframeHeightForNonEmbedLiveboard = (data) => {
27420
+ if (!data.data.currentPath.startsWith('/embed/viz/')) {
27421
+ this.setIFrameHeight(this.defaultHeight);
27422
+ }
27423
+ };
27424
+ if (this.viewConfig.fullHeight === true) {
27425
+ this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
27426
+ this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
27427
+ this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
27428
+ }
27429
+ }
27430
+ /**
27431
+ * Constructs a map of parameters to be passed on to the
27432
+ * embedded Eureka or Sage search page.
27433
+ *
27434
+ * @returns {string} query string
27435
+ */
27436
+ getEmbedParams() {
27437
+ var _a, _b;
27438
+ const { hideEurekaResults, isSageEmbed, disableWorksheetChange, hideWorksheetSelector, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, fullHeight, } = this.viewConfig;
27439
+ const params = {};
27440
+ params[Param.EmbedApp] = true;
27441
+ params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
27442
+ params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
27443
+ params[Param.HideApplicationSwitcher] = !!hideApplicationSwitcher;
27444
+ params[Param.HideOrgSwitcher] = !!hideOrgSwitcher;
27445
+ params[Param.HideActions] = [...((_a = params[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
27446
+ params[Param.HideActions] = [
27447
+ ...((_b = params[Param.HideActions]) !== null && _b !== void 0 ? _b : []),
27448
+ ...HiddenActionItemByDefaultForSageEmbed,
27449
+ ];
27450
+ if (fullHeight === true) {
27451
+ params[Param.fullHeight] = true;
27452
+ }
27453
+ if (hideEurekaResults) {
27454
+ params[Param.HideEurekaResults] = true;
27455
+ }
27456
+ if (isSageEmbed) {
27457
+ params[Param.IsSageEmbed] = true;
27458
+ }
27459
+ if (disableWorksheetChange) {
27460
+ params[Param.DisableWorksheetChange] = true;
27461
+ }
27462
+ if (hideWorksheetSelector) {
27463
+ params[Param.HideWorksheetSelector] = true;
27464
+ }
27465
+ return getQueryParamString(params, true);
27466
+ }
27467
+ /**
27468
+ * Construct the URL of the embedded ThoughtSpot sage to be
27469
+ * loaded in the iframe
27470
+ *
27471
+ * @returns {string} iframe url
27472
+ */
27473
+ getIFrameSrc() {
27474
+ const path = 'eureka';
27475
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams();
27476
+ return `${this.getRootIframeSrc()}/embed/${path}${tsPostHashParams}`;
27477
+ }
27478
+ /**
27479
+ * Render the embedded ThoughtSpot Sage
27480
+ *
27481
+ * @returns {SageEmbed} Eureka/Sage embed
27482
+ */
27483
+ render() {
27484
+ super.render();
27485
+ const src = this.getIFrameSrc();
27486
+ this.renderV1Embed(src);
27487
+ return this;
27488
+ }
27489
+ }
27490
+
27379
27491
  /**
27380
27492
  * Copyright (c) 2022
27381
27493
  *
@@ -27955,6 +28067,7 @@
27955
28067
  * ```
27956
28068
  */
27957
28069
  const SearchBarEmbed$1 = componentFactory(SearchBarEmbed);
28070
+ const SageEmbed$1 = componentFactory(SageEmbed);
27958
28071
  /**
27959
28072
  * Get a reference to the embed component to trigger events on the component.
27960
28073
  *
@@ -27977,6 +28090,7 @@
27977
28090
  exports.AppEmbed = AppEmbed$1;
27978
28091
  exports.LiveboardEmbed = LiveboardEmbed$1;
27979
28092
  exports.PinboardEmbed = PinboardEmbed;
28093
+ exports.SageEmbed = SageEmbed$1;
27980
28094
  exports.SearchBarEmbed = SearchBarEmbed$1;
27981
28095
  exports.SearchEmbed = SearchEmbed$1;
27982
28096
  exports.useEmbedRef = useEmbedRef;
@@ -1479,6 +1479,10 @@ var Param;
1479
1479
  Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
1480
1480
  Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
1481
1481
  Param["HideOrgSwitcher"] = "orgSwitcherHidden";
1482
+ Param["IsSageEmbed"] = "isSageEmbed";
1483
+ Param["HideWorksheetSelector"] = "hideWorksheetSelector";
1484
+ Param["DisableWorksheetChange"] = "disableWorksheetChange";
1485
+ Param["HideEurekaResults"] = "hideEurekaResults";
1482
1486
  })(Param || (Param = {}));
1483
1487
  /**
1484
1488
  * The list of actions that can be performed on visual ThoughtSpot
@@ -1737,6 +1741,7 @@ const ERROR_MESSAGE = {
1737
1741
  LIVEBOARD_VIZ_ID_VALIDATION: 'Please provide either liveboardId or pinboardId',
1738
1742
  TRIGGER_TIMED_OUT: 'Trigger timedout in getting response',
1739
1743
  SEARCHEMBED_BETA_WRANING_MESSAGE: 'Search Embed is in Beta in this release.',
1744
+ SAGE_EMBED_BETA_WARNING_MESSAGE: 'Sage Embed is in Beta in this release.',
1740
1745
  };
1741
1746
 
1742
1747
  /**
@@ -7829,18 +7834,13 @@ function initMixpanel(sessionInfo) {
7829
7834
  // userGUID
7830
7835
  const isPublicCluster = !!sessionInfo.isPublicUser;
7831
7836
  const token = sessionInfo.mixpanelToken;
7832
- try {
7833
- if (token) {
7834
- mixpanel_cjs.init(token);
7835
- if (!isPublicCluster) {
7836
- mixpanel_cjs.identify(sessionInfo.userGUID);
7837
- }
7838
- isMixpanelInitialized = true;
7839
- emptyQueue();
7837
+ if (token) {
7838
+ mixpanel_cjs.init(token);
7839
+ if (!isPublicCluster) {
7840
+ mixpanel_cjs.identify(sessionInfo.userGUID);
7840
7841
  }
7841
- }
7842
- catch (e) {
7843
- console.error('Error initializing mixpanel', e);
7842
+ isMixpanelInitialized = true;
7843
+ emptyQueue();
7844
7844
  }
7845
7845
  }
7846
7846
 
@@ -27509,7 +27509,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
27509
27509
  });
27510
27510
  }
27511
27511
 
27512
- var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-react.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:"./dist/tsembed.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"}};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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run bundle-dts-react-full; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.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","@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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,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};
27512
+ var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-sage.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:"./dist/tsembed.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/index.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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run bundle-dts-react-full; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};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","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.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","@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/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","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","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.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"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,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};
27513
27513
 
27514
27514
  /**
27515
27515
  * Copyright (c) 2022
@@ -28765,4 +28765,116 @@ class SearchBarEmbed extends TsEmbed {
28765
28765
  }
28766
28766
  }
28767
28767
 
28768
- export { Action, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, ContextMenuTriggerOptions, DataSourceVisualMode, EmbedEvent, HostEvent, LiveboardEmbed, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SearchBarEmbed, SearchEmbed, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, init, logout$1 as logout, prefetch };
28768
+ /**
28769
+ * Copyright (c) 2022
28770
+ *
28771
+ * Embed ThoughtSpot Sage
28772
+ *
28773
+ * @summary TS Sage embed
28774
+ * @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
28775
+ */
28776
+ const HiddenActionItemByDefaultForSageEmbed = [
28777
+ Action.Save,
28778
+ Action.Pin,
28779
+ Action.EditACopy,
28780
+ Action.SaveAsView,
28781
+ Action.UpdateTML,
28782
+ Action.EditTML,
28783
+ Action.AnswerDelete,
28784
+ ];
28785
+ /**
28786
+ * Embed ThoughtSpot search
28787
+ *
28788
+ * @group Embed components
28789
+ */
28790
+ class SageEmbed extends V1Embed {
28791
+ // eslint-disable-next-line no-useless-constructor
28792
+ constructor(domSelector, viewConfig) {
28793
+ super(domSelector, viewConfig);
28794
+ this.defaultHeight = 500;
28795
+ /**
28796
+ * Set the iframe height as per the computed height received
28797
+ * from the ThoughtSpot app.
28798
+ *
28799
+ * @param {MessagePayload} data The event payload
28800
+ */
28801
+ this.updateIFrameHeight = (data) => {
28802
+ this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
28803
+ };
28804
+ this.embedIframeCenter = (data, responder) => {
28805
+ const obj = this.getIframeCenter();
28806
+ responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
28807
+ };
28808
+ this.setIframeHeightForNonEmbedLiveboard = (data) => {
28809
+ if (!data.data.currentPath.startsWith('/embed/viz/')) {
28810
+ this.setIFrameHeight(this.defaultHeight);
28811
+ }
28812
+ };
28813
+ if (this.viewConfig.fullHeight === true) {
28814
+ this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
28815
+ this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
28816
+ this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
28817
+ }
28818
+ }
28819
+ /**
28820
+ * Constructs a map of parameters to be passed on to the
28821
+ * embedded Eureka or Sage search page.
28822
+ *
28823
+ * @returns {string} query string
28824
+ */
28825
+ getEmbedParams() {
28826
+ var _a, _b;
28827
+ const { hideEurekaResults, isSageEmbed, disableWorksheetChange, hideWorksheetSelector, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, fullHeight, } = this.viewConfig;
28828
+ const params = {};
28829
+ params[Param.EmbedApp] = true;
28830
+ params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
28831
+ params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
28832
+ params[Param.HideApplicationSwitcher] = !!hideApplicationSwitcher;
28833
+ params[Param.HideOrgSwitcher] = !!hideOrgSwitcher;
28834
+ params[Param.HideActions] = [...((_a = params[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
28835
+ params[Param.HideActions] = [
28836
+ ...((_b = params[Param.HideActions]) !== null && _b !== void 0 ? _b : []),
28837
+ ...HiddenActionItemByDefaultForSageEmbed,
28838
+ ];
28839
+ if (fullHeight === true) {
28840
+ params[Param.fullHeight] = true;
28841
+ }
28842
+ if (hideEurekaResults) {
28843
+ params[Param.HideEurekaResults] = true;
28844
+ }
28845
+ if (isSageEmbed) {
28846
+ params[Param.IsSageEmbed] = true;
28847
+ }
28848
+ if (disableWorksheetChange) {
28849
+ params[Param.DisableWorksheetChange] = true;
28850
+ }
28851
+ if (hideWorksheetSelector) {
28852
+ params[Param.HideWorksheetSelector] = true;
28853
+ }
28854
+ return getQueryParamString(params, true);
28855
+ }
28856
+ /**
28857
+ * Construct the URL of the embedded ThoughtSpot sage to be
28858
+ * loaded in the iframe
28859
+ *
28860
+ * @returns {string} iframe url
28861
+ */
28862
+ getIFrameSrc() {
28863
+ const path = 'eureka';
28864
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams();
28865
+ return `${this.getRootIframeSrc()}/embed/${path}${tsPostHashParams}`;
28866
+ }
28867
+ /**
28868
+ * Render the embedded ThoughtSpot Sage
28869
+ *
28870
+ * @returns {SageEmbed} Eureka/Sage embed
28871
+ */
28872
+ render() {
28873
+ super.render();
28874
+ const src = this.getIFrameSrc();
28875
+ this.renderV1Embed(src);
28876
+ return this;
28877
+ }
28878
+ }
28879
+
28880
+ export { Action, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, ContextMenuTriggerOptions, DataSourceVisualMode, EmbedEvent, HostEvent, LiveboardEmbed, Page, PinboardEmbed, PrefetchFeatures, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, init, logout$1 as logout, prefetch };