@thoughtspot/visual-embed-sdk 1.35.5-hostEvent.3 → 1.35.5-hostEvent.5

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 (33) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/embed/hostEventClient/contracts.d.ts +2 -0
  3. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  4. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  5. package/cjs/src/embed/hostEventClient/host-event-client.js +6 -1
  6. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  7. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +20 -4
  8. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  9. package/dist/index-CoQfqaHj.js +7370 -0
  10. package/dist/index-DYBx8SuE.js +7370 -0
  11. package/dist/src/embed/hostEventClient/contracts.d.ts +2 -0
  12. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  13. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  14. package/dist/tsembed-react.es.js +9 -4
  15. package/dist/tsembed-react.js +8 -3
  16. package/dist/tsembed.es.js +9 -4
  17. package/dist/tsembed.js +8 -3
  18. package/dist/visual-embed-sdk-react-full.d.ts +2 -0
  19. package/dist/visual-embed-sdk-react.d.ts +2 -0
  20. package/dist/visual-embed-sdk.d.ts +2 -0
  21. package/lib/package.json +1 -1
  22. package/lib/src/embed/hostEventClient/contracts.d.ts +2 -0
  23. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  24. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  25. package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
  26. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  27. package/lib/src/embed/hostEventClient/host-event-client.spec.js +20 -4
  28. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  29. package/lib/src/visual-embed-sdk.d.ts +2 -0
  30. package/package.json +1 -1
  31. package/src/embed/hostEventClient/contracts.ts +2 -0
  32. package/src/embed/hostEventClient/host-event-client.spec.ts +23 -7
  33. package/src/embed/hostEventClient/host-event-client.ts +5 -1
@@ -33,6 +33,8 @@ export type UiPassthroughContractBase = {
33
33
  };
34
34
  response: {
35
35
  answerId: string;
36
+ saveResponse: any;
37
+ shareResponse?: any;
36
38
  errors?: any;
37
39
  };
38
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,oBAAY,kBAAkB;IAC5B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,wBAAwB,6BAA6B;IACrD,0BAA0B,+BAA+B;IACzD,mBAAmB,wBAAwB;IAC3C,qBAAqB,0BAA0B;CAChD;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,EAAE;QACrC,OAAO,EAAE;YACP,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,UAAU,EAAE,MAAM,CAAC;YACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;YAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;QACF,QAAQ,EAAE;YACR,UAAU,EAAE,MAAM,CAAC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;IACF,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE;QAC/B,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,EAAE,MAAM,CAAC;YACpB,KAAK,EAAE,MAAM,CAAC;YACd,cAAc,CAAC,EAAE,O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version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EACvD,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IAC1B,eAAe,EAAE,MAAM,CAAC;gBAEZ,eAAe,EAAE,MAAM;IAItB,uBAAuB,CAAC,mBAAmB,SAAS,kBAAkB,EAC/E,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,0BAA0B,CAAC,mBAAmB,CAAC;IASrC,+BAA+B,CAAC,mBAAmB,SAAS,kBAAkB,EACvF,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,OAAO,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAmBzC,iBAAiB,CAC1B,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAC3D,OAAO,CAAC,GAAG,CAAC;IAIF,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAC7C,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;CAezC"}
1
+ {"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EACvD,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IAC1B,eAAe,EAAE,MAAM,CAAC;gBAEZ,eAAe,EAAE,MAAM;IAItB,uBAAuB,CAAC,mBAAmB,SAAS,kBAAkB,EAC/E,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,0BAA0B,CAAC,mBAAmB,CAAC;IASrC,+BAA+B,CAAC,mBAAmB,SAAS,kBAAkB,EACvF,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,OAAO,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAmBzC,iBAAiB,CAC1B,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAC3D,OAAO,CAAC,GAAG,CAAC;IAIF,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAC7C,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;CAmBzC"}
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.5 */
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
4
 
@@ -7160,7 +7160,7 @@ class AnswerService {
7160
7160
  async getTML() {
7161
7161
  const { object } = await this.executeQuery(getAnswerTML, {});
7162
7162
  const edoc = object[0].edoc;
7163
- const YAML = await import('./index-CENLvayL.js');
7163
+ const YAML = await import('./index-DYBx8SuE.js');
7164
7164
  const parsedDoc = YAML.parse(edoc);
7165
7165
  return {
7166
7166
  answer: {
@@ -14503,7 +14503,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
14503
14503
  return e;
14504
14504
  }
14505
14505
 
14506
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14506
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.5";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14507
14507
 
14508
14508
  /**
14509
14509
  * Reloads the ThoughtSpot iframe.
@@ -14603,11 +14603,16 @@ class HostEventClient {
14603
14603
  return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
14604
14604
  }
14605
14605
  async executeHostEvent(iFrame, hostEvent, payload) {
14606
+ var _a, _b, _c, _d;
14606
14607
  if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
14607
14608
  return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
14608
14609
  }
14609
14610
  if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
14610
- return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14611
+ const data = await this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14612
+ return {
14613
+ ...data,
14614
+ answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
14615
+ };
14611
14616
  }
14612
14617
  // fallback for save answer is Save
14613
14618
  if (hostEvent === HostEvent.SaveAnswer)
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.5 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
@@ -14525,7 +14525,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14525
14525
  return e;
14526
14526
  }
14527
14527
 
14528
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14528
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.5";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14529
14529
 
14530
14530
  /**
14531
14531
  * Reloads the ThoughtSpot iframe.
@@ -14625,11 +14625,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14625
14625
  return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
14626
14626
  }
14627
14627
  async executeHostEvent(iFrame, hostEvent, payload) {
14628
+ var _a, _b, _c, _d;
14628
14629
  if (hostEvent === exports.HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
14629
14630
  return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
14630
14631
  }
14631
14632
  if (hostEvent === exports.HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
14632
- return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14633
+ const data = await this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14634
+ return {
14635
+ ...data,
14636
+ answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
14637
+ };
14633
14638
  }
14634
14639
  // fallback for save answer is Save
14635
14640
  if (hostEvent === exports.HostEvent.SaveAnswer)
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.5 */
2
2
  function _mergeNamespaces(n, m) {
3
3
  m.forEach(function (e) {
4
4
  e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
@@ -7059,7 +7059,7 @@ class AnswerService {
7059
7059
  async getTML() {
7060
7060
  const { object } = await this.executeQuery(getAnswerTML, {});
7061
7061
  const edoc = object[0].edoc;
7062
- const YAML = await import('./index-CENLvayL.js');
7062
+ const YAML = await import('./index-DYBx8SuE.js');
7063
7063
  const parsedDoc = YAML.parse(edoc);
7064
7064
  return {
7065
7065
  answer: {
@@ -14745,7 +14745,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
14745
14745
  return e;
14746
14746
  }
14747
14747
 
14748
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14748
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.5";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14749
14749
 
14750
14750
  /**
14751
14751
  * Reloads the ThoughtSpot iframe.
@@ -14845,11 +14845,16 @@ class HostEventClient {
14845
14845
  return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
14846
14846
  }
14847
14847
  async executeHostEvent(iFrame, hostEvent, payload) {
14848
+ var _a, _b, _c, _d;
14848
14849
  if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
14849
14850
  return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
14850
14851
  }
14851
14852
  if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
14852
- return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14853
+ const data = await this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
14854
+ return {
14855
+ ...data,
14856
+ answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
14857
+ };
14853
14858
  }
14854
14859
  // fallback for save answer is Save
14855
14860
  if (hostEvent === HostEvent.SaveAnswer)
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.35.5-hostEvent.5 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -14751,7 +14751,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14751
14751
  return e;
14752
14752
  }
14753
14753
 
14754
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14754
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.35.5-hostEvent.5";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","eslint-plugin-comment-length":"1.7.3","eslint-plugin-jsdoc":"^46.9.0","fs-extra":"^10.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
14755
14755
 
14756
14756
  /**
14757
14757
  * Reloads the ThoughtSpot iframe.
@@ -14851,11 +14851,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
14851
14851
  return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
14852
14852
  }
14853
14853
  async executeHostEvent(iFrame, hostEvent, payload) {
14854
+ var _a, _b, _c, _d;
14854
14855
  if (hostEvent === exports.HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
14855
14856
  return this.handleUiPassthroughForHostEvent(iFrame, exports.UiPassthroughEvent.addVizToPinboard, payload);
14856
14857
  }
14857
14858
  if (hostEvent === exports.HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
14858
- return this.handleUiPassthroughForHostEvent(iFrame, exports.UiPassthroughEvent.saveAnswer, payload);
14859
+ const data = await this.handleUiPassthroughForHostEvent(iFrame, exports.UiPassthroughEvent.saveAnswer, payload);
14860
+ return {
14861
+ ...data,
14862
+ answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
14863
+ };
14859
14864
  }
14860
14865
  // fallback for save answer is Save
14861
14866
  if (hostEvent === exports.HostEvent.SaveAnswer)
@@ -7360,6 +7360,8 @@ export type UiPassthroughContractBase = {
7360
7360
  };
7361
7361
  response: {
7362
7362
  answerId: string;
7363
+ saveResponse: any;
7364
+ shareResponse?: any;
7363
7365
  errors?: any;
7364
7366
  };
7365
7367
  };
@@ -6596,6 +6596,8 @@ export type UiPassthroughContractBase = {
6596
6596
  };
6597
6597
  response: {
6598
6598
  answerId: string;
6599
+ saveResponse: any;
6600
+ shareResponse?: any;
6599
6601
  errors?: any;
6600
6602
  };
6601
6603
  };
@@ -7095,6 +7095,8 @@ export type UiPassthroughContractBase = {
7095
7095
  };
7096
7096
  response: {
7097
7097
  answerId: string;
7098
+ saveResponse: any;
7099
+ shareResponse?: any;
7098
7100
  errors?: any;
7099
7101
  };
7100
7102
  };
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.35.5-hostEvent.3",
3
+ "version": "1.35.5-hostEvent.5",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -33,6 +33,8 @@ export type UiPassthroughContractBase = {
33
33
  };
34
34
  response: {
35
35
  answerId: string;
36
+ saveResponse: any;
37
+ shareResponse?: any;
36
38
  errors?: any;
37
39
  };
38
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.d.ts","s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,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC;CACvD,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,UAAU,SAAS,SAAS,IACvD,UAAU,SAAS,MAAM,wBAAwB,GACjD,WAAW,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAEhF,MAAM,MAAM,iBAAiB,CAAC,UAAU,SAAS,SAAS,IACxD,UAAU,SAAS,MAAM,wBAAwB,GACjD;IACE,KAAK,CAAC,EAAE,qBAAqB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAA;CACpE,GACC,GAAG,CAAC"}
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,oBAAY,kBAAkB;IAC5B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,wBAAwB,6BAA6B;IACrD,0BAA0B,+BAA+B;IACzD,mBAAmB,wBAAwB;IAC3C,qBAAqB,0BAA0B;CAChD;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,EAAE;QACrC,OAAO,EAAE;YACP,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,UAAU,EAAE,MAAM,CAAC;YACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;YAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,eAAe,CAAC,EAAE,MAAM,CAAC;YACzB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;QACF,QAAQ,EAAE;YACR,UAAU,EAAE,MAAM,CAAC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;IACF,CAAC,kBAAkB,CAAC,UAAU,CAAC,EA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AC;AACnI,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,yBAAyB,IAAI,WAAW,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAErI,MAAM,MAAM,0BAA0B,CAAC,OAAO,SAAS,MAAM,yBAAyB,IACpF,OAAO,CAAC,KAAK,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvC,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC,CAAC,CAAA;AAEL,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC;IACrD,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC;CACvD,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,UAAU,SAAS,SAAS,IACvD,UAAU,SAAS,MAAM,wBAAwB,GACjD,WAAW,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAEhF,MAAM,MAAM,iBAAiB,CAAC,UAAU,SAAS,SAAS,IACxD,UAAU,SAAS,MAAM,wBAAwB,GACjD;IACE,KAAK,CAAC,EAAE,qBAAqB,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAA;CACpE,GACC,GAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EACvD,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IAC1B,eAAe,EAAE,MAAM,CAAC;gBAEZ,eAAe,EAAE,MAAM;IAItB,uBAAuB,CAAC,mBAAmB,SAAS,kBAAkB,EAC/E,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,0BAA0B,CAAC,mBAAmB,CAAC;IASrC,+BAA+B,CAAC,mBAAmB,SAAS,kBAAkB,EACvF,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,OAAO,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAmBzC,iBAAiB,CAC1B,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAC3D,OAAO,CAAC,GAAG,CAAC;IAIF,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAC7C,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;CAezC"}
1
+ {"version":3,"file":"host-event-client.d.ts","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EACvD,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IAC1B,eAAe,EAAE,MAAM,CAAC;gBAEZ,eAAe,EAAE,MAAM;IAItB,uBAAuB,CAAC,mBAAmB,SAAS,kBAAkB,EAC/E,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,0BAA0B,CAAC,mBAAmB,CAAC;IASrC,+BAA+B,CAAC,mBAAmB,SAAS,kBAAkB,EACvF,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,CAAC,mBAAmB,CAAC,GACtD,OAAO,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAmBzC,iBAAiB,CAC1B,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAC3D,OAAO,CAAC,GAAG,CAAC;IAIF,gBAAgB,CAAC,CAAC,SAAS,SAAS,EAC7C,MAAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;CAmBzC"}
@@ -31,11 +31,16 @@ export class HostEventClient {
31
31
  return processTrigger(iFrame, hostEvent, this.thoughtSpotHost, data);
32
32
  }
33
33
  async executeHostEvent(iFrame, hostEvent, payload) {
34
+ var _a, _b, _c, _d;
34
35
  if (hostEvent === HostEvent.Pin && (payload === null || payload === void 0 ? void 0 : payload.newVizName)) {
35
36
  return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.addVizToPinboard, payload);
36
37
  }
37
38
  if (hostEvent === HostEvent.SaveAnswer && (payload === null || payload === void 0 ? void 0 : payload.name)) {
38
- return this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
39
+ const data = await this.handleUiPassthroughForHostEvent(iFrame, UiPassthroughEvent.saveAnswer, payload);
40
+ return {
41
+ ...data,
42
+ answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
43
+ };
39
44
  }
40
45
  // fallback for save answer is Save
41
46
  if (hostEvent === HostEvent.SaveAnswer)
@@ -1 +1 @@
1
- {"version":3,"file":"host-event-client.js","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAEH,kBAAkB,GAGrB,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,eAAe;IAG1B,YAAY,eAAuB;QAC/B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAChC,MAAyB,EACzB,OAA4B,EAC5B,UAAqD;QAErD,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,aAAa,EAAE,IAAI,CAAC,eAAe,EAAE;YACpF,IAAI,EAAE,OAAO;YACb,UAAU;SACb,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACf,CAAC;IAEM,KAAK,CAAC,+BAA+B,CACxC,MAAyB,EACzB,OAA4B,EAC5B,UAAqD;;QAErD,MAAM,QAAQ,GAAG,MAAA,MAAA,CAAC,MAAM,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,0CAC5E,MAAM,mDAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAE7C,IAAI,CAAC,QAAQ,EAAE;YACX,MAAM,KAAK,GAAG,kBAAkB,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;YAC7F,4CAA4C;YAC5C,MAAM,EAAE,KAAK,EAAE,CAAC;SACnB;QAED,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,KAAI,MAAC,QAAQ,CAAC,KAAa,0CAAE,MAAM,CAAA,CAAC;QACjE,IAAI,MAAM,EAAE;YACZ,4CAA4C;YACxC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC;SACnC;QAED,OAAO,EAAE,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC1B,MAAyB,EAAE,SAAoB,EAAE,IAAS;QAE1D,OAAO,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAEM,KAAK,CAAC,gBAAgB,CACzB,MAAyB,EACzB,SAAoB,EACpB,OAA6B;QAE7B,IAAI,SAAS,KAAK,SAAS,CAAC,GAAG,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAA,EAAE;YACpD,OAAO,IAAI,CAAC,+BAA+B,CACvC,MAAM,EAAE,kBAAkB,CAAC,gBAAgB,EAAE,OAAO,CACvD,CAAC;SACL;QACD,IAAI,SAAS,KAAK,SAAS,CAAC,UAAU,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,EAAE;YACrD,OAAO,IAAI,CAAC,+BAA+B,CACvC,MAAM,EAAE,kBAAkB,CAAC,UAAU,EAAE,OAAO,CACjD,CAAC;SACL;QACD,mCAAmC;QACnC,IAAI,SAAS,KAAK,SAAS,CAAC,UAAU;YAAE,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;QACnE,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF"}
1
+ {"version":3,"file":"host-event-client.js","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc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CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC1B,MAAyB,EAAE,SAAoB,EAAE,IAAS;QAE1D,OAAO,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IAEM,KAAK,CAAC,gBAAgB,CACzB,MAAyB,EACzB,SAAoB,EACpB,OAA6B;;QAE7B,IAAI,SAAS,KAAK,SAAS,CAAC,GAAG,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAA,EAAE;YACpD,OAAO,IAAI,CAAC,+BAA+B,CACvC,MAAM,EAAE,kBAAkB,CAAC,gBAAgB,EAAE,OAAO,CACvD,CAAC;SACL;QACD,IAAI,SAAS,KAAK,SAAS,CAAC,UAAU,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAA,EAAE;YACrD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,+BAA+B,CACnD,MAAM,EAAE,kBAAkB,CAAC,UAAU,EAAE,OAAO,CACjD,CAAC;YACF,OAAO;gBACH,GAAG,IAAI;gBACP,QAAQ,EAAE,MAAA,MAAA,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,0CAAE,IAAI,0CAAE,YAAY,0CAAE,MAAM,0CAAE,EAAE;aAC/D,CAAC;SACL;QACD,mCAAmC;QACnC,IAAI,SAAS,KAAK,SAAS,CAAC,UAAU;YAAE,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;QACnE,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF"}
@@ -116,11 +116,27 @@ describe('HostEventClient', () => {
116
116
  description: 'Test Description',
117
117
  vizId: 'testVizId',
118
118
  };
119
- const mockResponse = { answerId: 'testAnswerId' };
120
- jest.spyOn(client, 'handleUiPassthroughForHostEvent').mockResolvedValue(mockResponse);
119
+ const mockResponse = [{
120
+ value: {
121
+ saveResponse: {
122
+ data: {
123
+ Answer__save: {
124
+ answer: {
125
+ id: 'newAnswer',
126
+ },
127
+ },
128
+ },
129
+ },
130
+ },
131
+ refId: 'testVizId',
132
+ }];
133
+ mockProcessTrigger.mockResolvedValue(mockResponse);
121
134
  const result = await client.executeHostEvent(getIFrameEl(), hostEvent, payload);
122
- expect(client.handleUiPassthroughForHostEvent).toHaveBeenCalledWith(null, UiPassthroughEvent.saveAnswer, payload);
123
- expect(result).toEqual(mockResponse);
135
+ expect(mockProcessTrigger).toHaveBeenCalledWith(null, 'UiPassthrough', 'http://localhost', {
136
+ parameters: payload,
137
+ type: 'saveAnswer',
138
+ });
139
+ expect(result).toEqual({ answerId: 'newAnswer', ...mockResponse[0].value });
124
140
  });
125
141
  it('should call hostEventFallback for unmapped events', async () => {
126
142
  const { client } = createHostEventClient();
@@ -1 +1 @@
1
- {"version":3,"file":"host-event-client.spec.js","sourceRoot":"","sources":["../../../../src/embed/hostEventClient/host-event-client.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACH,kBAAkB,GAIrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;AAExC,MAAM,kBAAkB,GAAG,cAA2B,CAAC;AAEvD,MAAM,qBAAqB,GAAG,GAAG,EAAE;IAC/B,MAAM,UAAU,GAAG,WAAW,EAAE,CAAC;IACjC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;IAC/C,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACxD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,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AC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;YACvD,MAAM,EAAE,MAAM,EAAE,GAAG,qBAAqB,EAAE,CAAC;YAC3C,MAAM,SAAS,GAAG,SAAS,CAAC,UAAU,CAAC;YACvC,MAAM,OAAO,GAAuC,EAAS,CAAC;YAC9D,MAAM,YAAY,GAAG;gBACjB,KAAK,EAAE;oBACH,UAAU,EAAE,cAAc;oBAC1B,KAAK,EAAE,SAAS;oBAChB,KAAK,EAAE,WAAW;iBACrB;aACJ,CAAC;YAEF,kBAAkB,CAAC,iBAAiB,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;YAErD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;YAEhF,MAAM,CAAC,kBAAkB,CAAC,CAAC,oBAAoB,CAC3C,WAAW,EAAE,EACb,SAAS,CAAC,IAAI,EACd,kBAAkB,EAClB,EAAE,CACL,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -7179,6 +7179,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/hostEventClient/contracts' {
7179
7179
  };
7180
7180
  response: {
7181
7181
  answerId: string;
7182
+ saveResponse: any;
7183
+ shareResponse?: any;
7182
7184
  errors?: any;
7183
7185
  };
7184
7186
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thoughtspot/visual-embed-sdk",
3
- "version": "1.35.5-hostEvent.3",
3
+ "version": "1.35.5-hostEvent.5",
4
4
  "description": "ThoughtSpot Embed SDK",
5
5
  "module": "lib/src/index.js",
6
6
  "main": "dist/tsembed.js",
@@ -35,6 +35,8 @@ export type UiPassthroughContractBase = {
35
35
  };
36
36
  response: {
37
37
  answerId: string,
38
+ saveResponse: any;
39
+ shareResponse?: any;
38
40
  errors?: any;
39
41
  };
40
42
  };
@@ -155,17 +155,33 @@ describe('HostEventClient', () => {
155
155
  description: 'Test Description',
156
156
  vizId: 'testVizId',
157
157
  };
158
- const mockResponse = { answerId: 'testAnswerId' };
159
- jest.spyOn(client, 'handleUiPassthroughForHostEvent').mockResolvedValue(mockResponse);
160
-
158
+ const mockResponse = [{
159
+ value: {
160
+ saveResponse: {
161
+ data: {
162
+ Answer__save: {
163
+ answer: {
164
+ id: 'newAnswer',
165
+ },
166
+ },
167
+ },
168
+ },
169
+ },
170
+ refId: 'testVizId',
171
+ }];
172
+ mockProcessTrigger.mockResolvedValue(mockResponse);
161
173
  const result = await client.executeHostEvent(getIFrameEl(), hostEvent, payload);
162
174
 
163
- expect(client.handleUiPassthroughForHostEvent).toHaveBeenCalledWith(
175
+ expect(mockProcessTrigger).toHaveBeenCalledWith(
164
176
  null,
165
- UiPassthroughEvent.saveAnswer,
166
- payload,
177
+ 'UiPassthrough',
178
+ 'http://localhost',
179
+ {
180
+ parameters: payload,
181
+ type: 'saveAnswer',
182
+ },
167
183
  );
168
- expect(result).toEqual(mockResponse);
184
+ expect(result).toEqual({ answerId: 'newAnswer', ...mockResponse[0].value });
169
185
  });
170
186
 
171
187
  it('should call hostEventFallback for unmapped events', async () => {
@@ -67,9 +67,13 @@ export class HostEventClient {
67
67
  );
68
68
  }
69
69
  if (hostEvent === HostEvent.SaveAnswer && payload?.name) {
70
- return this.handleUiPassthroughForHostEvent(
70
+ const data = await this.handleUiPassthroughForHostEvent(
71
71
  iFrame, UiPassthroughEvent.saveAnswer, payload,
72
72
  );
73
+ return {
74
+ ...data,
75
+ answerId: data?.saveResponse?.data?.Answer__save?.answer?.id,
76
+ };
73
77
  }
74
78
  // fallback for save answer is Save
75
79
  if (hostEvent === HostEvent.SaveAnswer) hostEvent = HostEvent.Save;