@thoughtspot/visual-embed-sdk 1.42.1-HE2 → 1.42.1-HE2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +2 -2
- package/cjs/src/embed/conversation.d.ts +2 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +4 -0
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +13 -2
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +14 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +4 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +6 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +2 -0
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +4 -0
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +2 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +4 -0
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +2 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +4 -0
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +13 -1
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/types.d.ts +10 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +9 -0
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +2 -1
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/dist/index-BFdRRz03.js +7371 -0
- package/dist/index-UY-4yjBN.js +7371 -0
- package/dist/src/embed/conversation.d.ts +2 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +13 -2
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +4 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +2 -0
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +2 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +2 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +10 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +2 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +69 -16
- package/dist/tsembed-react.js +68 -15
- package/dist/tsembed.es.js +69 -16
- package/dist/tsembed.js +68 -15
- package/dist/visual-embed-sdk-react-full.d.ts +53 -9
- package/dist/visual-embed-sdk-react.d.ts +53 -9
- package/dist/visual-embed-sdk.d.ts +53 -9
- package/lib/package.json +2 -2
- package/lib/src/embed/conversation.d.ts +2 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +4 -0
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +13 -2
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +13 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +4 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +6 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/sage.d.ts +2 -0
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +4 -0
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +2 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +4 -0
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +2 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +4 -0
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +13 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/types.d.ts +10 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +9 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +2 -1
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/package.json +2 -2
- package/src/embed/conversation.ts +7 -0
- package/src/embed/hostEventClient/contracts.ts +16 -3
- package/src/embed/hostEventClient/host-event-client.ts +7 -6
- package/src/embed/liveboard.ts +11 -4
- package/src/embed/sage.ts +6 -0
- package/src/embed/search-bar.tsx +6 -0
- package/src/embed/search.ts +7 -0
- package/src/embed/ts-embed.ts +18 -3
- package/src/types.ts +10 -0
- package/src/utils/processTrigger.ts +2 -1
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2 */
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2.0.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -3032,6 +3032,15 @@ var HostEvent;
|
|
|
3032
3032
|
* ```
|
|
3033
3033
|
*/
|
|
3034
3034
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3035
|
+
/**
|
|
3036
|
+
* @hidden
|
|
3037
|
+
* Triggers the get of the page context.
|
|
3038
|
+
* @example
|
|
3039
|
+
* ```js
|
|
3040
|
+
* liveboardEmbed.trigger(HostEvent.GetPageContext);
|
|
3041
|
+
* ```
|
|
3042
|
+
*/
|
|
3043
|
+
HostEvent["GetPageContext"] = "GetPageContext";
|
|
3035
3044
|
})(HostEvent || (HostEvent = {}));
|
|
3036
3045
|
/**
|
|
3037
3046
|
* The different visual modes that the data sources panel within
|
|
@@ -7369,6 +7378,29 @@ function isEmpty(value) {
|
|
|
7369
7378
|
|
|
7370
7379
|
var isEmpty_1 = isEmpty;
|
|
7371
7380
|
|
|
7381
|
+
var UIPassthroughEvent;
|
|
7382
|
+
(function (UIPassthroughEvent) {
|
|
7383
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7384
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7385
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7386
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7387
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7388
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7389
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7390
|
+
var ContextType;
|
|
7391
|
+
(function (ContextType) {
|
|
7392
|
+
ContextType["Search"] = "search";
|
|
7393
|
+
ContextType["Liveboard"] = "liveboard";
|
|
7394
|
+
ContextType["Answer"] = "answer";
|
|
7395
|
+
ContextType["Spotter"] = "spotter";
|
|
7396
|
+
ContextType["Default"] = "default";
|
|
7397
|
+
})(ContextType || (ContextType = {}));
|
|
7398
|
+
var PageType;
|
|
7399
|
+
(function (PageType) {
|
|
7400
|
+
PageType["PAGE"] = "page";
|
|
7401
|
+
PageType["DIALOG"] = "dialog";
|
|
7402
|
+
})(PageType || (PageType = {}));
|
|
7403
|
+
|
|
7372
7404
|
const ERROR_MESSAGE = {
|
|
7373
7405
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7374
7406
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
|
|
@@ -8300,7 +8332,7 @@ class AnswerService {
|
|
|
8300
8332
|
async getTML() {
|
|
8301
8333
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8302
8334
|
const edoc = object[0].edoc;
|
|
8303
|
-
const YAML = await import('./index-
|
|
8335
|
+
const YAML = await import('./index-BFdRRz03.js');
|
|
8304
8336
|
const parsedDoc = YAML.parse(edoc);
|
|
8305
8337
|
return {
|
|
8306
8338
|
answer: {
|
|
@@ -17473,7 +17505,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
17473
17505
|
return e;
|
|
17474
17506
|
}
|
|
17475
17507
|
|
|
17476
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run
|
|
17508
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2.0.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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 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};
|
|
17477
17509
|
|
|
17478
17510
|
/**
|
|
17479
17511
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17547,16 +17579,6 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
|
17547
17579
|
});
|
|
17548
17580
|
}
|
|
17549
17581
|
|
|
17550
|
-
var UIPassthroughEvent;
|
|
17551
|
-
(function (UIPassthroughEvent) {
|
|
17552
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17553
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17554
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17555
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17556
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17557
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17558
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17559
|
-
|
|
17560
17582
|
class HostEventClient {
|
|
17561
17583
|
constructor(iFrame) {
|
|
17562
17584
|
this.iFrame = iFrame;
|
|
@@ -18664,7 +18686,7 @@ class TsEmbed {
|
|
|
18664
18686
|
* @param {any} data The payload to send with the message
|
|
18665
18687
|
* @returns A promise that resolves with the response from the embedded app
|
|
18666
18688
|
*/
|
|
18667
|
-
async trigger(messageType, data = {}, context
|
|
18689
|
+
async trigger(messageType, data = {}, context) {
|
|
18668
18690
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
18669
18691
|
if (!this.isRendered) {
|
|
18670
18692
|
this.handleError('Please call render before triggering events');
|
|
@@ -18714,6 +18736,17 @@ class TsEmbed {
|
|
|
18714
18736
|
handleRenderForPrerender() {
|
|
18715
18737
|
return this.render();
|
|
18716
18738
|
}
|
|
18739
|
+
async getCurrentContext() {
|
|
18740
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
18741
|
+
const context = await this.trigger(HostEvent.GetPageContext, {});
|
|
18742
|
+
return context;
|
|
18743
|
+
});
|
|
18744
|
+
return {
|
|
18745
|
+
page: ContextType.Default,
|
|
18746
|
+
pageType: PageType.PAGE,
|
|
18747
|
+
objectIds: {},
|
|
18748
|
+
};
|
|
18749
|
+
}
|
|
18717
18750
|
/**
|
|
18718
18751
|
* Creates the preRender shell
|
|
18719
18752
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
@@ -19084,6 +19117,10 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
|
|
|
19084
19117
|
const defaultAppInitData = await super.getAppInitData();
|
|
19085
19118
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19086
19119
|
}
|
|
19120
|
+
async getCurrentContext() {
|
|
19121
|
+
const context = await super.getCurrentContext();
|
|
19122
|
+
return context;
|
|
19123
|
+
}
|
|
19087
19124
|
};
|
|
19088
19125
|
|
|
19089
19126
|
/**
|
|
@@ -19166,6 +19203,10 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
|
|
|
19166
19203
|
await this.renderV1Embed(src);
|
|
19167
19204
|
return this;
|
|
19168
19205
|
}
|
|
19206
|
+
async getCurrentContext() {
|
|
19207
|
+
const context = await super.getCurrentContext();
|
|
19208
|
+
return context;
|
|
19209
|
+
}
|
|
19169
19210
|
};
|
|
19170
19211
|
|
|
19171
19212
|
/**
|
|
@@ -19344,6 +19385,10 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
19344
19385
|
});
|
|
19345
19386
|
return this;
|
|
19346
19387
|
}
|
|
19388
|
+
async getCurrentContext() {
|
|
19389
|
+
const context = await super.getCurrentContext();
|
|
19390
|
+
return context;
|
|
19391
|
+
}
|
|
19347
19392
|
};
|
|
19348
19393
|
|
|
19349
19394
|
/**
|
|
@@ -20126,7 +20171,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20126
20171
|
* @param {any} data The payload to send with the message
|
|
20127
20172
|
* @returns A promise that resolves with the response from the embedded app
|
|
20128
20173
|
*/
|
|
20129
|
-
trigger(messageType, data = {}) {
|
|
20174
|
+
trigger(messageType, data = {}, context) {
|
|
20130
20175
|
const dataWithVizId = data;
|
|
20131
20176
|
if (messageType === HostEvent.SetActiveTab) {
|
|
20132
20177
|
this.setActiveTab(data);
|
|
@@ -20135,7 +20180,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20135
20180
|
if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
|
|
20136
20181
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
20137
20182
|
}
|
|
20138
|
-
return super.trigger(messageType, dataWithVizId);
|
|
20183
|
+
return super.trigger(messageType, dataWithVizId, context);
|
|
20139
20184
|
}
|
|
20140
20185
|
/**
|
|
20141
20186
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
@@ -20204,6 +20249,10 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
20204
20249
|
}
|
|
20205
20250
|
return url;
|
|
20206
20251
|
}
|
|
20252
|
+
async getCurrentContext() {
|
|
20253
|
+
const context = await super.getCurrentContext();
|
|
20254
|
+
return context;
|
|
20255
|
+
}
|
|
20207
20256
|
};
|
|
20208
20257
|
|
|
20209
20258
|
const createConversation = `
|
|
@@ -20817,6 +20866,10 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
20817
20866
|
await this.renderIFrame(src);
|
|
20818
20867
|
return this;
|
|
20819
20868
|
}
|
|
20869
|
+
async getCurrentContext() {
|
|
20870
|
+
const context = await super.getCurrentContext();
|
|
20871
|
+
return context;
|
|
20872
|
+
}
|
|
20820
20873
|
};
|
|
20821
20874
|
/**
|
|
20822
20875
|
* Embed ThoughtSpot AI Conversation.
|
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2 */
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2.0.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -3054,6 +3054,15 @@
|
|
|
3054
3054
|
* ```
|
|
3055
3055
|
*/
|
|
3056
3056
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3057
|
+
/**
|
|
3058
|
+
* @hidden
|
|
3059
|
+
* Triggers the get of the page context.
|
|
3060
|
+
* @example
|
|
3061
|
+
* ```js
|
|
3062
|
+
* liveboardEmbed.trigger(HostEvent.GetPageContext);
|
|
3063
|
+
* ```
|
|
3064
|
+
*/
|
|
3065
|
+
HostEvent["GetPageContext"] = "GetPageContext";
|
|
3057
3066
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3058
3067
|
/**
|
|
3059
3068
|
* The different visual modes that the data sources panel within
|
|
@@ -7391,6 +7400,29 @@
|
|
|
7391
7400
|
|
|
7392
7401
|
var isEmpty_1 = isEmpty$1;
|
|
7393
7402
|
|
|
7403
|
+
var UIPassthroughEvent;
|
|
7404
|
+
(function (UIPassthroughEvent) {
|
|
7405
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7406
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7407
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7408
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7409
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7410
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7411
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7412
|
+
var ContextType;
|
|
7413
|
+
(function (ContextType) {
|
|
7414
|
+
ContextType["Search"] = "search";
|
|
7415
|
+
ContextType["Liveboard"] = "liveboard";
|
|
7416
|
+
ContextType["Answer"] = "answer";
|
|
7417
|
+
ContextType["Spotter"] = "spotter";
|
|
7418
|
+
ContextType["Default"] = "default";
|
|
7419
|
+
})(ContextType || (ContextType = {}));
|
|
7420
|
+
var PageType;
|
|
7421
|
+
(function (PageType) {
|
|
7422
|
+
PageType["PAGE"] = "page";
|
|
7423
|
+
PageType["DIALOG"] = "dialog";
|
|
7424
|
+
})(PageType || (PageType = {}));
|
|
7425
|
+
|
|
7394
7426
|
const ERROR_MESSAGE = {
|
|
7395
7427
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7396
7428
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
|
|
@@ -17495,7 +17527,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17495
17527
|
return e;
|
|
17496
17528
|
}
|
|
17497
17529
|
|
|
17498
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run
|
|
17530
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2.0.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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 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};
|
|
17499
17531
|
|
|
17500
17532
|
/**
|
|
17501
17533
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17569,16 +17601,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17569
17601
|
});
|
|
17570
17602
|
}
|
|
17571
17603
|
|
|
17572
|
-
var UIPassthroughEvent;
|
|
17573
|
-
(function (UIPassthroughEvent) {
|
|
17574
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17575
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17576
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17577
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17578
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17579
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17580
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17581
|
-
|
|
17582
17604
|
class HostEventClient {
|
|
17583
17605
|
constructor(iFrame) {
|
|
17584
17606
|
this.iFrame = iFrame;
|
|
@@ -18686,7 +18708,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18686
18708
|
* @param {any} data The payload to send with the message
|
|
18687
18709
|
* @returns A promise that resolves with the response from the embedded app
|
|
18688
18710
|
*/
|
|
18689
|
-
async trigger(messageType, data = {}, context
|
|
18711
|
+
async trigger(messageType, data = {}, context) {
|
|
18690
18712
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
18691
18713
|
if (!this.isRendered) {
|
|
18692
18714
|
this.handleError('Please call render before triggering events');
|
|
@@ -18736,6 +18758,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18736
18758
|
handleRenderForPrerender() {
|
|
18737
18759
|
return this.render();
|
|
18738
18760
|
}
|
|
18761
|
+
async getCurrentContext() {
|
|
18762
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
18763
|
+
const context = await this.trigger(exports.HostEvent.GetPageContext, {});
|
|
18764
|
+
return context;
|
|
18765
|
+
});
|
|
18766
|
+
return {
|
|
18767
|
+
page: ContextType.Default,
|
|
18768
|
+
pageType: PageType.PAGE,
|
|
18769
|
+
objectIds: {},
|
|
18770
|
+
};
|
|
18771
|
+
}
|
|
18739
18772
|
/**
|
|
18740
18773
|
* Creates the preRender shell
|
|
18741
18774
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
@@ -19106,6 +19139,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19106
19139
|
const defaultAppInitData = await super.getAppInitData();
|
|
19107
19140
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19108
19141
|
}
|
|
19142
|
+
async getCurrentContext() {
|
|
19143
|
+
const context = await super.getCurrentContext();
|
|
19144
|
+
return context;
|
|
19145
|
+
}
|
|
19109
19146
|
};
|
|
19110
19147
|
|
|
19111
19148
|
/**
|
|
@@ -19188,6 +19225,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19188
19225
|
await this.renderV1Embed(src);
|
|
19189
19226
|
return this;
|
|
19190
19227
|
}
|
|
19228
|
+
async getCurrentContext() {
|
|
19229
|
+
const context = await super.getCurrentContext();
|
|
19230
|
+
return context;
|
|
19231
|
+
}
|
|
19191
19232
|
};
|
|
19192
19233
|
|
|
19193
19234
|
/**
|
|
@@ -19366,6 +19407,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19366
19407
|
});
|
|
19367
19408
|
return this;
|
|
19368
19409
|
}
|
|
19410
|
+
async getCurrentContext() {
|
|
19411
|
+
const context = await super.getCurrentContext();
|
|
19412
|
+
return context;
|
|
19413
|
+
}
|
|
19369
19414
|
};
|
|
19370
19415
|
|
|
19371
19416
|
/**
|
|
@@ -20148,7 +20193,7 @@ query GetEurekaVizSnapshots(
|
|
|
20148
20193
|
* @param {any} data The payload to send with the message
|
|
20149
20194
|
* @returns A promise that resolves with the response from the embedded app
|
|
20150
20195
|
*/
|
|
20151
|
-
trigger(messageType, data = {}) {
|
|
20196
|
+
trigger(messageType, data = {}, context) {
|
|
20152
20197
|
const dataWithVizId = data;
|
|
20153
20198
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
20154
20199
|
this.setActiveTab(data);
|
|
@@ -20157,7 +20202,7 @@ query GetEurekaVizSnapshots(
|
|
|
20157
20202
|
if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
|
|
20158
20203
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
20159
20204
|
}
|
|
20160
|
-
return super.trigger(messageType, dataWithVizId);
|
|
20205
|
+
return super.trigger(messageType, dataWithVizId, context);
|
|
20161
20206
|
}
|
|
20162
20207
|
/**
|
|
20163
20208
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
@@ -20226,6 +20271,10 @@ query GetEurekaVizSnapshots(
|
|
|
20226
20271
|
}
|
|
20227
20272
|
return url;
|
|
20228
20273
|
}
|
|
20274
|
+
async getCurrentContext() {
|
|
20275
|
+
const context = await super.getCurrentContext();
|
|
20276
|
+
return context;
|
|
20277
|
+
}
|
|
20229
20278
|
};
|
|
20230
20279
|
|
|
20231
20280
|
const createConversation = `
|
|
@@ -20839,6 +20888,10 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20839
20888
|
await this.renderIFrame(src);
|
|
20840
20889
|
return this;
|
|
20841
20890
|
}
|
|
20891
|
+
async getCurrentContext() {
|
|
20892
|
+
const context = await super.getCurrentContext();
|
|
20893
|
+
return context;
|
|
20894
|
+
}
|
|
20842
20895
|
};
|
|
20843
20896
|
/**
|
|
20844
20897
|
* Embed ThoughtSpot AI Conversation.
|
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2 */
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2.0.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -3334,6 +3334,15 @@ var HostEvent;
|
|
|
3334
3334
|
* ```
|
|
3335
3335
|
*/
|
|
3336
3336
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3337
|
+
/**
|
|
3338
|
+
* @hidden
|
|
3339
|
+
* Triggers the get of the page context.
|
|
3340
|
+
* @example
|
|
3341
|
+
* ```js
|
|
3342
|
+
* liveboardEmbed.trigger(HostEvent.GetPageContext);
|
|
3343
|
+
* ```
|
|
3344
|
+
*/
|
|
3345
|
+
HostEvent["GetPageContext"] = "GetPageContext";
|
|
3337
3346
|
})(HostEvent || (HostEvent = {}));
|
|
3338
3347
|
/**
|
|
3339
3348
|
* The different visual modes that the data sources panel within
|
|
@@ -7254,6 +7263,29 @@ function isEmpty(value) {
|
|
|
7254
7263
|
|
|
7255
7264
|
var isEmpty_1 = isEmpty;
|
|
7256
7265
|
|
|
7266
|
+
var UIPassthroughEvent;
|
|
7267
|
+
(function (UIPassthroughEvent) {
|
|
7268
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7269
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7270
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7271
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7272
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7273
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7274
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7275
|
+
var ContextType;
|
|
7276
|
+
(function (ContextType) {
|
|
7277
|
+
ContextType["Search"] = "search";
|
|
7278
|
+
ContextType["Liveboard"] = "liveboard";
|
|
7279
|
+
ContextType["Answer"] = "answer";
|
|
7280
|
+
ContextType["Spotter"] = "spotter";
|
|
7281
|
+
ContextType["Default"] = "default";
|
|
7282
|
+
})(ContextType || (ContextType = {}));
|
|
7283
|
+
var PageType;
|
|
7284
|
+
(function (PageType) {
|
|
7285
|
+
PageType["PAGE"] = "page";
|
|
7286
|
+
PageType["DIALOG"] = "dialog";
|
|
7287
|
+
})(PageType || (PageType = {}));
|
|
7288
|
+
|
|
7257
7289
|
const ERROR_MESSAGE = {
|
|
7258
7290
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7259
7291
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
|
|
@@ -8185,7 +8217,7 @@ class AnswerService {
|
|
|
8185
8217
|
async getTML() {
|
|
8186
8218
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8187
8219
|
const edoc = object[0].edoc;
|
|
8188
|
-
const YAML = await import('./index-
|
|
8220
|
+
const YAML = await import('./index-BFdRRz03.js');
|
|
8189
8221
|
const parsedDoc = YAML.parse(edoc);
|
|
8190
8222
|
return {
|
|
8191
8223
|
answer: {
|
|
@@ -17524,7 +17556,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
17524
17556
|
return e;
|
|
17525
17557
|
}
|
|
17526
17558
|
|
|
17527
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2";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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run
|
|
17559
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2.0.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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 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};
|
|
17528
17560
|
|
|
17529
17561
|
/**
|
|
17530
17562
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17598,16 +17630,6 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
|
17598
17630
|
});
|
|
17599
17631
|
}
|
|
17600
17632
|
|
|
17601
|
-
var UIPassthroughEvent;
|
|
17602
|
-
(function (UIPassthroughEvent) {
|
|
17603
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17604
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17605
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17606
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17607
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17608
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17609
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17610
|
-
|
|
17611
17633
|
class HostEventClient {
|
|
17612
17634
|
constructor(iFrame) {
|
|
17613
17635
|
this.iFrame = iFrame;
|
|
@@ -18715,7 +18737,7 @@ class TsEmbed {
|
|
|
18715
18737
|
* @param {any} data The payload to send with the message
|
|
18716
18738
|
* @returns A promise that resolves with the response from the embedded app
|
|
18717
18739
|
*/
|
|
18718
|
-
async trigger(messageType, data = {}, context
|
|
18740
|
+
async trigger(messageType, data = {}, context) {
|
|
18719
18741
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
18720
18742
|
if (!this.isRendered) {
|
|
18721
18743
|
this.handleError('Please call render before triggering events');
|
|
@@ -18765,6 +18787,17 @@ class TsEmbed {
|
|
|
18765
18787
|
handleRenderForPrerender() {
|
|
18766
18788
|
return this.render();
|
|
18767
18789
|
}
|
|
18790
|
+
async getCurrentContext() {
|
|
18791
|
+
this.executeAfterEmbedContainerLoaded(async () => {
|
|
18792
|
+
const context = await this.trigger(HostEvent.GetPageContext, {});
|
|
18793
|
+
return context;
|
|
18794
|
+
});
|
|
18795
|
+
return {
|
|
18796
|
+
page: ContextType.Default,
|
|
18797
|
+
pageType: PageType.PAGE,
|
|
18798
|
+
objectIds: {},
|
|
18799
|
+
};
|
|
18800
|
+
}
|
|
18768
18801
|
/**
|
|
18769
18802
|
* Creates the preRender shell
|
|
18770
18803
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
@@ -19842,7 +19875,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
19842
19875
|
* @param {any} data The payload to send with the message
|
|
19843
19876
|
* @returns A promise that resolves with the response from the embedded app
|
|
19844
19877
|
*/
|
|
19845
|
-
trigger(messageType, data = {}) {
|
|
19878
|
+
trigger(messageType, data = {}, context) {
|
|
19846
19879
|
const dataWithVizId = data;
|
|
19847
19880
|
if (messageType === HostEvent.SetActiveTab) {
|
|
19848
19881
|
this.setActiveTab(data);
|
|
@@ -19851,7 +19884,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
19851
19884
|
if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
|
|
19852
19885
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
19853
19886
|
}
|
|
19854
|
-
return super.trigger(messageType, dataWithVizId);
|
|
19887
|
+
return super.trigger(messageType, dataWithVizId, context);
|
|
19855
19888
|
}
|
|
19856
19889
|
/**
|
|
19857
19890
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
@@ -19920,6 +19953,10 @@ class LiveboardEmbed extends V1Embed {
|
|
|
19920
19953
|
}
|
|
19921
19954
|
return url;
|
|
19922
19955
|
}
|
|
19956
|
+
async getCurrentContext() {
|
|
19957
|
+
const context = await super.getCurrentContext();
|
|
19958
|
+
return context;
|
|
19959
|
+
}
|
|
19923
19960
|
}
|
|
19924
19961
|
/**
|
|
19925
19962
|
* @hidden
|
|
@@ -20103,6 +20140,10 @@ class SearchEmbed extends TsEmbed {
|
|
|
20103
20140
|
});
|
|
20104
20141
|
return this;
|
|
20105
20142
|
}
|
|
20143
|
+
async getCurrentContext() {
|
|
20144
|
+
const context = await super.getCurrentContext();
|
|
20145
|
+
return context;
|
|
20146
|
+
}
|
|
20106
20147
|
}
|
|
20107
20148
|
|
|
20108
20149
|
/**
|
|
@@ -20178,6 +20219,10 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
20178
20219
|
const defaultAppInitData = await super.getAppInitData();
|
|
20179
20220
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
20180
20221
|
}
|
|
20222
|
+
async getCurrentContext() {
|
|
20223
|
+
const context = await super.getCurrentContext();
|
|
20224
|
+
return context;
|
|
20225
|
+
}
|
|
20181
20226
|
}
|
|
20182
20227
|
|
|
20183
20228
|
const createConversation = `
|
|
@@ -20796,6 +20841,10 @@ class SpotterEmbed extends TsEmbed {
|
|
|
20796
20841
|
await this.renderIFrame(src);
|
|
20797
20842
|
return this;
|
|
20798
20843
|
}
|
|
20844
|
+
async getCurrentContext() {
|
|
20845
|
+
const context = await super.getCurrentContext();
|
|
20846
|
+
return context;
|
|
20847
|
+
}
|
|
20799
20848
|
}
|
|
20800
20849
|
/**
|
|
20801
20850
|
* Embed ThoughtSpot AI Conversation.
|
|
@@ -20902,6 +20951,10 @@ class SageEmbed extends V1Embed {
|
|
|
20902
20951
|
await this.renderV1Embed(src);
|
|
20903
20952
|
return this;
|
|
20904
20953
|
}
|
|
20954
|
+
async getCurrentContext() {
|
|
20955
|
+
const context = await super.getCurrentContext();
|
|
20956
|
+
return context;
|
|
20957
|
+
}
|
|
20905
20958
|
}
|
|
20906
20959
|
|
|
20907
20960
|
const getAnswerSessionFromQuery = `
|