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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +20 -0
  2. package/cjs/package.json +5 -3
  3. package/cjs/src/embed/liveboard.d.ts +24 -0
  4. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  5. package/cjs/src/embed/liveboard.js +30 -0
  6. package/cjs/src/embed/liveboard.js.map +1 -1
  7. package/cjs/src/embed/liveboard.spec.js +31 -0
  8. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  9. package/cjs/src/embed/ts-embed.d.ts +7 -1
  10. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  11. package/cjs/src/embed/ts-embed.js +12 -3
  12. package/cjs/src/embed/ts-embed.js.map +1 -1
  13. package/cjs/src/embed/ts-embed.spec.js +16 -3
  14. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  15. package/cjs/src/types.d.ts +15 -1
  16. package/cjs/src/types.d.ts.map +1 -1
  17. package/cjs/src/types.js +2 -1
  18. package/cjs/src/types.js.map +1 -1
  19. package/cjs/src/utils/global-styles.d.ts +2 -0
  20. package/cjs/src/utils/global-styles.d.ts.map +1 -0
  21. package/cjs/src/utils/global-styles.js +44 -0
  22. package/cjs/src/utils/global-styles.js.map +1 -0
  23. package/cjs/src/utils/graphql/preview-service.d.ts +3 -0
  24. package/cjs/src/utils/graphql/preview-service.d.ts.map +1 -0
  25. package/cjs/src/utils/graphql/preview-service.js +30 -0
  26. package/cjs/src/utils/graphql/preview-service.js.map +1 -0
  27. package/dist/src/embed/liveboard.d.ts +24 -0
  28. package/dist/src/embed/liveboard.d.ts.map +1 -1
  29. package/dist/src/embed/ts-embed.d.ts +7 -1
  30. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  31. package/dist/src/types.d.ts +15 -1
  32. package/dist/src/types.d.ts.map +1 -1
  33. package/dist/src/utils/global-styles.d.ts +2 -0
  34. package/dist/src/utils/global-styles.d.ts.map +1 -0
  35. package/dist/src/utils/graphql/preview-service.d.ts +3 -0
  36. package/dist/src/utils/graphql/preview-service.d.ts.map +1 -0
  37. package/dist/tsembed-react.es.js +108 -5
  38. package/dist/tsembed-react.js +108 -5
  39. package/dist/tsembed.es.js +108 -5
  40. package/dist/tsembed.js +108 -5
  41. package/dist/visual-embed-sdk-react-full.d.ts +45 -2
  42. package/dist/visual-embed-sdk-react.d.ts +45 -2
  43. package/dist/visual-embed-sdk.d.ts +45 -2
  44. package/lib/package.json +5 -3
  45. package/lib/src/embed/liveboard.d.ts +24 -0
  46. package/lib/src/embed/liveboard.d.ts.map +1 -1
  47. package/lib/src/embed/liveboard.js +30 -0
  48. package/lib/src/embed/liveboard.js.map +1 -1
  49. package/lib/src/embed/liveboard.spec.js +31 -0
  50. package/lib/src/embed/liveboard.spec.js.map +1 -1
  51. package/lib/src/embed/ts-embed.d.ts +7 -1
  52. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  53. package/lib/src/embed/ts-embed.js +12 -3
  54. package/lib/src/embed/ts-embed.js.map +1 -1
  55. package/lib/src/embed/ts-embed.spec.js +16 -3
  56. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  57. package/lib/src/types.d.ts +15 -1
  58. package/lib/src/types.d.ts.map +1 -1
  59. package/lib/src/types.js +2 -1
  60. package/lib/src/types.js.map +1 -1
  61. package/lib/src/utils/global-styles.d.ts +2 -0
  62. package/lib/src/utils/global-styles.d.ts.map +1 -0
  63. package/lib/src/utils/global-styles.js +40 -0
  64. package/lib/src/utils/global-styles.js.map +1 -0
  65. package/lib/src/utils/graphql/preview-service.d.ts +3 -0
  66. package/lib/src/utils/graphql/preview-service.d.ts.map +1 -0
  67. package/lib/src/utils/graphql/preview-service.js +26 -0
  68. package/lib/src/utils/graphql/preview-service.js.map +1 -0
  69. package/lib/src/visual-embed-sdk.d.ts +45 -2
  70. package/package.json +5 -3
  71. package/src/embed/liveboard.spec.ts +34 -0
  72. package/src/embed/liveboard.ts +61 -1
  73. package/src/embed/ts-embed.spec.ts +18 -3
  74. package/src/embed/ts-embed.ts +14 -4
  75. package/src/types.ts +29 -14
  76. package/src/utils/global-styles.ts +40 -0
  77. package/src/utils/graphql/preview-service.ts +31 -0
@@ -3361,8 +3361,9 @@ var Action;
3361
3361
  * ```js
3362
3362
  * hiddenAction: [Action.CreateLiveboard]
3363
3363
  * disabledActions: [Action.CreateLiveboard]
3364
+ * ```
3364
3365
  *
3365
- * @version SDK: 1.31.1 | Thoughtspot: 10.1.0.cl
3366
+ * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
3366
3367
  */
3367
3368
  Action["CreateLiveboard"] = "CreateLiveboard";
3368
3369
  /**
@@ -13997,7 +13998,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
13997
13998
  });
13998
13999
  }
13999
14000
 
14000
- var name="@thoughtspot/visual-embed-sdk";var version="1.32.0-alpha.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",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-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","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","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"};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":"^46.9.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",tslib:"^2.5.3","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","@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/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","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","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-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"46 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};
14001
+ var name="@thoughtspot/visual-embed-sdk";var version="1.32.0-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",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-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","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","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.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",tslib:"^2.5.3","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","@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/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","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","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-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"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",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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"46 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};
14001
14002
 
14002
14003
  /**
14003
14004
  * Copyright (c) 2022
@@ -14254,7 +14255,7 @@ class TsEmbed {
14254
14255
  * @param query
14255
14256
  */
14256
14257
  getEmbedBasePath(query) {
14257
- let queryString = query;
14258
+ let queryString = (query.startsWith('?')) ? query : `?${query}`;
14258
14259
  if (this.shouldEncodeUrlQueryParams) {
14259
14260
  queryString = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString.substr(1))}`;
14260
14261
  }
@@ -14701,7 +14702,7 @@ class TsEmbed {
14701
14702
  isRegisteredBySDK,
14702
14703
  });
14703
14704
  if (this.isRendered) {
14704
- this.handleError('Please register event handlers before calling render');
14705
+ logger.warn('Please register event handlers before calling render');
14705
14706
  }
14706
14707
  const callbacks = this.eventHandlerMap.get(messageType) || [];
14707
14708
  callbacks.push({ options, callback });
@@ -14972,6 +14973,13 @@ class TsEmbed {
14972
14973
  class V1Embed extends TsEmbed {
14973
14974
  constructor(domSelector, viewConfig) {
14974
14975
  super(domSelector, viewConfig);
14976
+ /**
14977
+ * Only for testing purposes.
14978
+ *
14979
+ * @hidden
14980
+ */
14981
+ // eslint-disable-next-line camelcase
14982
+ this.test__executeCallbacks = this.executeCallbacks;
14975
14983
  this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
14976
14984
  }
14977
14985
  /**
@@ -14994,7 +15002,9 @@ class V1Embed extends TsEmbed {
14994
15002
  const filterQuery = getFilterQuery(runtimeFilters || []);
14995
15003
  queryString = [filterQuery, queryString].filter(Boolean).join('&');
14996
15004
  }
14997
- return this.getV1EmbedBasePath(queryString);
15005
+ return (this.viewConfig.enableV2Shell_experimental)
15006
+ ? this.getEmbedBasePath(queryString)
15007
+ : this.getV1EmbedBasePath(queryString);
14998
15008
  }
14999
15009
  /**
15000
15010
  * @inheritdoc
@@ -15275,6 +15285,71 @@ class AppEmbed extends V1Embed {
15275
15285
  }
15276
15286
  }
15277
15287
 
15288
+ /* eslint-disable quotes */
15289
+ const getPreviewQuery = `
15290
+ query GetEurekaVizSnapshots(
15291
+ $vizId: String!, $liveboardId: String!) {
15292
+ getEurekaVizSnapshot(
15293
+ id: $vizId
15294
+ reportBookId: $liveboardId
15295
+ reportBookType: "PINBOARD_ANSWER_BOOK"
15296
+ version: 9999999
15297
+ ) {
15298
+ id
15299
+ vizContent
15300
+ snapshotType
15301
+ createdMs
15302
+ }
15303
+ }
15304
+ `;
15305
+ async function getPreview(thoughtSpotHost, vizId, liveboardId) {
15306
+ return graphqlQuery({
15307
+ query: getPreviewQuery,
15308
+ variables: { vizId, liveboardId },
15309
+ thoughtSpotHost,
15310
+ });
15311
+ }
15312
+
15313
+ const addPreviewStylesIfNotPresent = () => {
15314
+ const styleEl = document.getElementById('ts-preview-style');
15315
+ if (styleEl) {
15316
+ return;
15317
+ }
15318
+ const previewStyles = `
15319
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
15320
+ <style id="ts-preview-style">
15321
+ .ts-viz-preview-loader {
15322
+ position: absolute;
15323
+ top: 0;
15324
+ left: 0;
15325
+ right: 0;
15326
+ bottom: 0;
15327
+ display: flex;
15328
+ justify-content: center;
15329
+ align-items: center;
15330
+ background: linear-gradient(-45deg, #eee 40%, #fafafa 50%, #eee 60%);
15331
+ background-size: 300%;
15332
+ background-position-x: 100%;
15333
+ animation: shimmer 1s infinite linear;
15334
+ z-index: 999;
15335
+ filter: grayscale(0.7);
15336
+ }
15337
+
15338
+ @keyframes shimmer {
15339
+ to {
15340
+ background-position-x: 0%
15341
+ }
15342
+ }
15343
+
15344
+ .ts-viz-preview-loader .table-module__fullContainer {
15345
+ width: 100%;
15346
+ height: 100%;
15347
+ }
15348
+ </style>
15349
+ `;
15350
+ document.head.insertAdjacentHTML('beforeend', previewStyles);
15351
+ };
15352
+
15278
15353
  /**
15279
15354
  * Copyright (c) 2022
15280
15355
  *
@@ -15417,6 +15492,33 @@ class LiveboardEmbed extends V1Embed {
15417
15492
  super.trigger(HostEvent.Navigate, path);
15418
15493
  }
15419
15494
  }
15495
+ async showPreviewLoader() {
15496
+ if (!this.viewConfig.showPreviewLoader || !this.viewConfig.vizId) {
15497
+ return;
15498
+ }
15499
+ try {
15500
+ const preview = await getPreview(this.thoughtSpotHost, this.viewConfig.vizId, this.viewConfig.liveboardId);
15501
+ if (!preview.vizContent) {
15502
+ return;
15503
+ }
15504
+ addPreviewStylesIfNotPresent();
15505
+ const div = document.createElement('div');
15506
+ div.innerHTML = `
15507
+ <div class=ts-viz-preview-loader>
15508
+ ${preview.vizContent}
15509
+ </div>
15510
+ `;
15511
+ const previewDiv = div.firstElementChild;
15512
+ this.el.appendChild(previewDiv);
15513
+ this.el.style.position = 'relative';
15514
+ this.on(EmbedEvent.Data, () => {
15515
+ previewDiv.remove();
15516
+ });
15517
+ }
15518
+ catch (error) {
15519
+ console.error('Error fetching preview', error);
15520
+ }
15521
+ }
15420
15522
  beforePrerenderVisible() {
15421
15523
  var _a;
15422
15524
  const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
@@ -15461,6 +15563,7 @@ class LiveboardEmbed extends V1Embed {
15461
15563
  super.render();
15462
15564
  const src = this.getIFrameSrc();
15463
15565
  await this.renderV1Embed(src);
15566
+ this.showPreviewLoader();
15464
15567
  return this;
15465
15568
  }
15466
15569
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
package/dist/tsembed.js CHANGED
@@ -3259,8 +3259,9 @@
3259
3259
  * ```js
3260
3260
  * hiddenAction: [Action.CreateLiveboard]
3261
3261
  * disabledActions: [Action.CreateLiveboard]
3262
+ * ```
3262
3263
  *
3263
- * @version SDK: 1.31.1 | Thoughtspot: 10.1.0.cl
3264
+ * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
3264
3265
  */
3265
3266
  Action["CreateLiveboard"] = "CreateLiveboard";
3266
3267
  /**
@@ -13873,7 +13874,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
13873
13874
  });
13874
13875
  }
13875
13876
 
13876
- var name="@thoughtspot/visual-embed-sdk";var version="1.32.0-alpha.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$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",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-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","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","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"};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":"^46.9.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",tslib:"^2.5.3","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","@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/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","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","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-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"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","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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"46 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};
13877
+ var name="@thoughtspot/visual-embed-sdk";var version="1.32.0-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$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",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-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","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","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.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",tslib:"^2.5.3","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","@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/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","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","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-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"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",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,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"46 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};
13877
13878
 
13878
13879
  /**
13879
13880
  * Copyright (c) 2022
@@ -14130,7 +14131,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14130
14131
  * @param query
14131
14132
  */
14132
14133
  getEmbedBasePath(query) {
14133
- let queryString = query;
14134
+ let queryString = (query.startsWith('?')) ? query : `?${query}`;
14134
14135
  if (this.shouldEncodeUrlQueryParams) {
14135
14136
  queryString = `?base64UrlEncodedFlags=${getEncodedQueryParamsString(queryString.substr(1))}`;
14136
14137
  }
@@ -14577,7 +14578,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14577
14578
  isRegisteredBySDK,
14578
14579
  });
14579
14580
  if (this.isRendered) {
14580
- this.handleError('Please register event handlers before calling render');
14581
+ logger.warn('Please register event handlers before calling render');
14581
14582
  }
14582
14583
  const callbacks = this.eventHandlerMap.get(messageType) || [];
14583
14584
  callbacks.push({ options, callback });
@@ -14848,6 +14849,13 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14848
14849
  class V1Embed extends TsEmbed {
14849
14850
  constructor(domSelector, viewConfig) {
14850
14851
  super(domSelector, viewConfig);
14852
+ /**
14853
+ * Only for testing purposes.
14854
+ *
14855
+ * @hidden
14856
+ */
14857
+ // eslint-disable-next-line camelcase
14858
+ this.test__executeCallbacks = this.executeCallbacks;
14851
14859
  this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
14852
14860
  }
14853
14861
  /**
@@ -14870,7 +14878,9 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
14870
14878
  const filterQuery = getFilterQuery(runtimeFilters || []);
14871
14879
  queryString = [filterQuery, queryString].filter(Boolean).join('&');
14872
14880
  }
14873
- return this.getV1EmbedBasePath(queryString);
14881
+ return (this.viewConfig.enableV2Shell_experimental)
14882
+ ? this.getEmbedBasePath(queryString)
14883
+ : this.getV1EmbedBasePath(queryString);
14874
14884
  }
14875
14885
  /**
14876
14886
  * @inheritdoc
@@ -15146,6 +15156,71 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15146
15156
  }
15147
15157
  }
15148
15158
 
15159
+ /* eslint-disable quotes */
15160
+ const getPreviewQuery = `
15161
+ query GetEurekaVizSnapshots(
15162
+ $vizId: String!, $liveboardId: String!) {
15163
+ getEurekaVizSnapshot(
15164
+ id: $vizId
15165
+ reportBookId: $liveboardId
15166
+ reportBookType: "PINBOARD_ANSWER_BOOK"
15167
+ version: 9999999
15168
+ ) {
15169
+ id
15170
+ vizContent
15171
+ snapshotType
15172
+ createdMs
15173
+ }
15174
+ }
15175
+ `;
15176
+ async function getPreview(thoughtSpotHost, vizId, liveboardId) {
15177
+ return graphqlQuery({
15178
+ query: getPreviewQuery,
15179
+ variables: { vizId, liveboardId },
15180
+ thoughtSpotHost,
15181
+ });
15182
+ }
15183
+
15184
+ const addPreviewStylesIfNotPresent = () => {
15185
+ const styleEl = document.getElementById('ts-preview-style');
15186
+ if (styleEl) {
15187
+ return;
15188
+ }
15189
+ const previewStyles = `
15190
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
15191
+ <style id="ts-preview-style">
15192
+ .ts-viz-preview-loader {
15193
+ position: absolute;
15194
+ top: 0;
15195
+ left: 0;
15196
+ right: 0;
15197
+ bottom: 0;
15198
+ display: flex;
15199
+ justify-content: center;
15200
+ align-items: center;
15201
+ background: linear-gradient(-45deg, #eee 40%, #fafafa 50%, #eee 60%);
15202
+ background-size: 300%;
15203
+ background-position-x: 100%;
15204
+ animation: shimmer 1s infinite linear;
15205
+ z-index: 999;
15206
+ filter: grayscale(0.7);
15207
+ }
15208
+
15209
+ @keyframes shimmer {
15210
+ to {
15211
+ background-position-x: 0%
15212
+ }
15213
+ }
15214
+
15215
+ .ts-viz-preview-loader .table-module__fullContainer {
15216
+ width: 100%;
15217
+ height: 100%;
15218
+ }
15219
+ </style>
15220
+ `;
15221
+ document.head.insertAdjacentHTML('beforeend', previewStyles);
15222
+ };
15223
+
15149
15224
  /**
15150
15225
  * Copyright (c) 2022
15151
15226
  *
@@ -15288,6 +15363,33 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15288
15363
  super.trigger(exports.HostEvent.Navigate, path);
15289
15364
  }
15290
15365
  }
15366
+ async showPreviewLoader() {
15367
+ if (!this.viewConfig.showPreviewLoader || !this.viewConfig.vizId) {
15368
+ return;
15369
+ }
15370
+ try {
15371
+ const preview = await getPreview(this.thoughtSpotHost, this.viewConfig.vizId, this.viewConfig.liveboardId);
15372
+ if (!preview.vizContent) {
15373
+ return;
15374
+ }
15375
+ addPreviewStylesIfNotPresent();
15376
+ const div = document.createElement('div');
15377
+ div.innerHTML = `
15378
+ <div class=ts-viz-preview-loader>
15379
+ ${preview.vizContent}
15380
+ </div>
15381
+ `;
15382
+ const previewDiv = div.firstElementChild;
15383
+ this.el.appendChild(previewDiv);
15384
+ this.el.style.position = 'relative';
15385
+ this.on(exports.EmbedEvent.Data, () => {
15386
+ previewDiv.remove();
15387
+ });
15388
+ }
15389
+ catch (error) {
15390
+ console.error('Error fetching preview', error);
15391
+ }
15392
+ }
15291
15393
  beforePrerenderVisible() {
15292
15394
  var _a;
15293
15395
  const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
@@ -15332,6 +15434,7 @@ mutation RemoveColumns($session: BachSessionIdInput!, $logicalColumnIds: [GUID!]
15332
15434
  super.render();
15333
15435
  const src = this.getIFrameSrc();
15334
15436
  await this.renderV1Embed(src);
15437
+ this.showPreviewLoader();
15335
15438
  return this;
15336
15439
  }
15337
15440
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
@@ -1393,6 +1393,29 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
1393
1393
  * ```
1394
1394
  */
1395
1395
  enable2ColumnLayout?: boolean;
1396
+ /**
1397
+ * Show a preview image of the visualization before the visualization loads.
1398
+ * Only works for visualizations embeds with a viz id.
1399
+ *
1400
+ * Also, viz snashot should be enabled in the ThoughtSpot instance.
1401
+ * Contact ThoughtSpot support to enable this feature.
1402
+ *
1403
+ * Since, this will show preview images, be careful that it may show
1404
+ * undesired data to the user when using row level security.
1405
+ *
1406
+ * @example
1407
+ * ```js
1408
+ * const embed = new LiveboardEmbed('#embed-container', {
1409
+ * liveboardId: 'liveboard-id',
1410
+ * vizId: 'viz-id',
1411
+ * showPreviewLoader: true,
1412
+ * });
1413
+ * embed.render();
1414
+ * ```
1415
+ *
1416
+ * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
1417
+ */
1418
+ showPreviewLoader?: boolean;
1396
1419
  }
1397
1420
  /**
1398
1421
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
@@ -2793,6 +2816,19 @@ export interface ViewConfig {
2793
2816
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl
2794
2817
  */
2795
2818
  excludeRuntimeParametersfromURL?: boolean;
2819
+ /**
2820
+ * Enable the V2 shell. This can provide performance benefits
2821
+ * due to a lighterweight shell.
2822
+ * @example
2823
+ * ```js
2824
+ * const embed = new LiveboardEmbed('#embed', {
2825
+ * liveboardId: '123',
2826
+ * enableV2Shell_experimental: true
2827
+ * });
2828
+ * ```
2829
+ * @version SDK: 1.31.2 | ThoughtSpot: 10.0.0.cl
2830
+ */
2831
+ enableV2Shell_experimental?: boolean;
2796
2832
  }
2797
2833
  /**
2798
2834
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -5709,8 +5745,9 @@ export declare enum Action {
5709
5745
  * ```js
5710
5746
  * hiddenAction: [Action.CreateLiveboard]
5711
5747
  * disabledActions: [Action.CreateLiveboard]
5748
+ * ```
5712
5749
  *
5713
- * @version SDK: 1.31.1 | Thoughtspot: 10.1.0.cl
5750
+ * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
5714
5751
  */
5715
5752
  CreateLiveboard = "CreateLiveboard",
5716
5753
  /**
@@ -6496,7 +6533,7 @@ export declare class TsEmbed {
6496
6533
  /**
6497
6534
  * The DOM node where the ThoughtSpot app is to be embedded.
6498
6535
  */
6499
- protected el: Element;
6536
+ protected el: HTMLElement;
6500
6537
  /**
6501
6538
  * The key to store the embed instance in the DOM node
6502
6539
  */
@@ -6750,5 +6787,11 @@ export declare class V1Embed extends TsEmbed {
6750
6787
  * ```
6751
6788
  */
6752
6789
  on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype;
6790
+ /**
6791
+ * Only for testing purposes.
6792
+ *
6793
+ * @hidden
6794
+ */
6795
+ test__executeCallbacks: (eventType: EmbedEvent, data: any, eventPort?: void | MessagePort) => void;
6753
6796
  }
6754
6797
 
@@ -1383,6 +1383,29 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
1383
1383
  * ```
1384
1384
  */
1385
1385
  enable2ColumnLayout?: boolean;
1386
+ /**
1387
+ * Show a preview image of the visualization before the visualization loads.
1388
+ * Only works for visualizations embeds with a viz id.
1389
+ *
1390
+ * Also, viz snashot should be enabled in the ThoughtSpot instance.
1391
+ * Contact ThoughtSpot support to enable this feature.
1392
+ *
1393
+ * Since, this will show preview images, be careful that it may show
1394
+ * undesired data to the user when using row level security.
1395
+ *
1396
+ * @example
1397
+ * ```js
1398
+ * const embed = new LiveboardEmbed('#embed-container', {
1399
+ * liveboardId: 'liveboard-id',
1400
+ * vizId: 'viz-id',
1401
+ * showPreviewLoader: true,
1402
+ * });
1403
+ * embed.render();
1404
+ * ```
1405
+ *
1406
+ * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
1407
+ */
1408
+ showPreviewLoader?: boolean;
1386
1409
  }
1387
1410
  /**
1388
1411
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
@@ -2425,6 +2448,19 @@ export interface ViewConfig {
2425
2448
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl
2426
2449
  */
2427
2450
  excludeRuntimeParametersfromURL?: boolean;
2451
+ /**
2452
+ * Enable the V2 shell. This can provide performance benefits
2453
+ * due to a lighterweight shell.
2454
+ * @example
2455
+ * ```js
2456
+ * const embed = new LiveboardEmbed('#embed', {
2457
+ * liveboardId: '123',
2458
+ * enableV2Shell_experimental: true
2459
+ * });
2460
+ * ```
2461
+ * @version SDK: 1.31.2 | ThoughtSpot: 10.0.0.cl
2462
+ */
2463
+ enableV2Shell_experimental?: boolean;
2428
2464
  }
2429
2465
  /**
2430
2466
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -5341,8 +5377,9 @@ export declare enum Action {
5341
5377
  * ```js
5342
5378
  * hiddenAction: [Action.CreateLiveboard]
5343
5379
  * disabledActions: [Action.CreateLiveboard]
5380
+ * ```
5344
5381
  *
5345
- * @version SDK: 1.31.1 | Thoughtspot: 10.1.0.cl
5382
+ * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
5346
5383
  */
5347
5384
  CreateLiveboard = "CreateLiveboard",
5348
5385
  /**
@@ -5559,7 +5596,7 @@ export declare class TsEmbed {
5559
5596
  /**
5560
5597
  * The DOM node where the ThoughtSpot app is to be embedded.
5561
5598
  */
5562
- protected el: Element;
5599
+ protected el: HTMLElement;
5563
5600
  /**
5564
5601
  * The key to store the embed instance in the DOM node
5565
5602
  */
@@ -5813,6 +5850,12 @@ export declare class V1Embed extends TsEmbed {
5813
5850
  * ```
5814
5851
  */
5815
5852
  on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype;
5853
+ /**
5854
+ * Only for testing purposes.
5855
+ *
5856
+ * @hidden
5857
+ */
5858
+ test__executeCallbacks: (eventType: EmbedEvent, data: any, eventPort?: void | MessagePort) => void;
5816
5859
  }
5817
5860
 
5818
5861
  export interface executeTMLInput {
@@ -812,6 +812,29 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
812
812
  * ```
813
813
  */
814
814
  enable2ColumnLayout?: boolean;
815
+ /**
816
+ * Show a preview image of the visualization before the visualization loads.
817
+ * Only works for visualizations embeds with a viz id.
818
+ *
819
+ * Also, viz snashot should be enabled in the ThoughtSpot instance.
820
+ * Contact ThoughtSpot support to enable this feature.
821
+ *
822
+ * Since, this will show preview images, be careful that it may show
823
+ * undesired data to the user when using row level security.
824
+ *
825
+ * @example
826
+ * ```js
827
+ * const embed = new LiveboardEmbed('#embed-container', {
828
+ * liveboardId: 'liveboard-id',
829
+ * vizId: 'viz-id',
830
+ * showPreviewLoader: true,
831
+ * });
832
+ * embed.render();
833
+ * ```
834
+ *
835
+ * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
836
+ */
837
+ showPreviewLoader?: boolean;
815
838
  }
816
839
  /**
817
840
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
@@ -2419,6 +2442,19 @@ export interface ViewConfig {
2419
2442
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl
2420
2443
  */
2421
2444
  excludeRuntimeParametersfromURL?: boolean;
2445
+ /**
2446
+ * Enable the V2 shell. This can provide performance benefits
2447
+ * due to a lighterweight shell.
2448
+ * @example
2449
+ * ```js
2450
+ * const embed = new LiveboardEmbed('#embed', {
2451
+ * liveboardId: '123',
2452
+ * enableV2Shell_experimental: true
2453
+ * });
2454
+ * ```
2455
+ * @version SDK: 1.31.2 | ThoughtSpot: 10.0.0.cl
2456
+ */
2457
+ enableV2Shell_experimental?: boolean;
2422
2458
  }
2423
2459
  /**
2424
2460
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -5335,8 +5371,9 @@ export enum Action {
5335
5371
  * ```js
5336
5372
  * hiddenAction: [Action.CreateLiveboard]
5337
5373
  * disabledActions: [Action.CreateLiveboard]
5374
+ * ```
5338
5375
  *
5339
- * @version SDK: 1.31.1 | Thoughtspot: 10.1.0.cl
5376
+ * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
5340
5377
  */
5341
5378
  CreateLiveboard = "CreateLiveboard",
5342
5379
  /**
@@ -6268,7 +6305,7 @@ export class TsEmbed {
6268
6305
  /**
6269
6306
  * The DOM node where the ThoughtSpot app is to be embedded.
6270
6307
  */
6271
- protected el: Element;
6308
+ protected el: HTMLElement;
6272
6309
  /**
6273
6310
  * The key to store the embed instance in the DOM node
6274
6311
  */
@@ -6522,5 +6559,11 @@ export class V1Embed extends TsEmbed {
6522
6559
  * ```
6523
6560
  */
6524
6561
  on(messageType: EmbedEvent, callback: MessageCallback, options?: MessageOptions): typeof TsEmbed.prototype;
6562
+ /**
6563
+ * Only for testing purposes.
6564
+ *
6565
+ * @hidden
6566
+ */
6567
+ test__executeCallbacks: (eventType: EmbedEvent, data: any, eventPort?: void | MessagePort) => void;
6525
6568
  }
6526
6569