@thoughtspot/visual-embed-sdk 1.21.0-react.1 → 1.21.0-sage.0
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 +5 -5
- package/cjs/src/embed/nls.spec.d.ts +1 -0
- package/cjs/src/embed/nls.spec.d.ts.map +1 -0
- package/cjs/src/embed/nls.spec.js +1 -0
- package/cjs/src/embed/nls.spec.js.map +1 -0
- package/cjs/src/embed/sage-fullscreen.d.ts +87 -0
- package/cjs/src/embed/sage-fullscreen.d.ts.map +1 -0
- package/cjs/src/embed/sage-fullscreen.js +114 -0
- package/cjs/src/embed/sage-fullscreen.js.map +1 -0
- package/cjs/src/embed/sage.d.ts +79 -0
- package/cjs/src/embed/sage.d.ts.map +1 -0
- package/cjs/src/embed/sage.js +112 -0
- package/cjs/src/embed/sage.js.map +1 -0
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -1
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +3 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +6 -11
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/react/index.d.ts +9 -5
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +3 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/types.d.ts +9 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +4 -0
- package/cjs/src/types.js.map +1 -1
- package/dist/src/embed/sage-fullscreen.d.ts +87 -0
- package/dist/src/embed/sage-fullscreen.d.ts.map +1 -0
- package/dist/src/embed/sage.d.ts +79 -0
- package/dist/src/embed/sage.d.ts.map +1 -0
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +9 -5
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +9 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +119 -13
- package/dist/tsembed-react.js +119 -12
- package/dist/tsembed.es.js +118 -13
- package/dist/tsembed.js +118 -12
- package/dist/visual-embed-sdk-react-full.d.ts +74 -3
- package/dist/visual-embed-sdk.d.ts +70 -2
- package/lib/package.json +5 -5
- package/lib/src/embed/nls.spec.d.ts +1 -0
- package/lib/src/embed/nls.spec.d.ts.map +1 -0
- package/lib/src/embed/nls.spec.js +1 -0
- package/lib/src/embed/nls.spec.js.map +1 -0
- package/lib/src/embed/sage-fullscreen.d.ts +87 -0
- package/lib/src/embed/sage-fullscreen.d.ts.map +1 -0
- package/lib/src/embed/sage-fullscreen.js +110 -0
- package/lib/src/embed/sage-fullscreen.js.map +1 -0
- package/lib/src/embed/sage.d.ts +79 -0
- package/lib/src/embed/sage.d.ts.map +1 -0
- package/lib/src/embed/sage.js +108 -0
- package/lib/src/embed/sage.js.map +1 -0
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -1
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +6 -11
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/react/index.d.ts +9 -5
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +2 -0
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/types.d.ts +9 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +4 -0
- package/lib/src/types.js.map +1 -1
- package/package.json +5 -5
- package/src/embed/sage.ts +153 -0
- package/src/errors.ts +1 -0
- package/src/index.ts +2 -0
- package/src/mixpanel-service.ts +6 -10
- package/src/react/index.tsx +10 -1
- package/src/types.ts +8 -0
- package/dist/visual-embed-sdk-react.d.ts +0 -2781
package/dist/tsembed.js
CHANGED
|
@@ -1420,6 +1420,10 @@
|
|
|
1420
1420
|
Param["HideProfleAndHelp"] = "profileAndHelpInNavBarHidden";
|
|
1421
1421
|
Param["HideApplicationSwitcher"] = "applicationSwitcherHidden";
|
|
1422
1422
|
Param["HideOrgSwitcher"] = "orgSwitcherHidden";
|
|
1423
|
+
Param["IsSageEmbed"] = "isSageEmbed";
|
|
1424
|
+
Param["HideWorksheetSelector"] = "hideWorksheetSelector";
|
|
1425
|
+
Param["DisableWorksheetChange"] = "disableWorksheetChange";
|
|
1426
|
+
Param["HideEurekaResults"] = "hideEurekaResults";
|
|
1423
1427
|
})(Param || (Param = {}));
|
|
1424
1428
|
(function (Action) {
|
|
1425
1429
|
Action["Save"] = "save";
|
|
@@ -1654,6 +1658,7 @@
|
|
|
1654
1658
|
LIVEBOARD_VIZ_ID_VALIDATION: 'Please provide either liveboardId or pinboardId',
|
|
1655
1659
|
TRIGGER_TIMED_OUT: 'Trigger timedout in getting response',
|
|
1656
1660
|
SEARCHEMBED_BETA_WRANING_MESSAGE: 'Search Embed is in Beta in this release.',
|
|
1661
|
+
SAGE_EMBED_BETA_WARNING_MESSAGE: 'Sage Embed is in Beta in this release.',
|
|
1657
1662
|
};
|
|
1658
1663
|
|
|
1659
1664
|
/**
|
|
@@ -7746,18 +7751,13 @@
|
|
|
7746
7751
|
// userGUID
|
|
7747
7752
|
const isPublicCluster = !!sessionInfo.isPublicUser;
|
|
7748
7753
|
const token = sessionInfo.mixpanelToken;
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
mixpanel_cjs.identify(sessionInfo.userGUID);
|
|
7754
|
-
}
|
|
7755
|
-
isMixpanelInitialized = true;
|
|
7756
|
-
emptyQueue();
|
|
7754
|
+
if (token) {
|
|
7755
|
+
mixpanel_cjs.init(token);
|
|
7756
|
+
if (!isPublicCluster) {
|
|
7757
|
+
mixpanel_cjs.identify(sessionInfo.userGUID);
|
|
7757
7758
|
}
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
console.error('Error initializing mixpanel', e);
|
|
7759
|
+
isMixpanelInitialized = true;
|
|
7760
|
+
emptyQueue();
|
|
7761
7761
|
}
|
|
7762
7762
|
}
|
|
7763
7763
|
|
|
@@ -27407,7 +27407,7 @@
|
|
|
27407
27407
|
});
|
|
27408
27408
|
}
|
|
27409
27409
|
|
|
27410
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-
|
|
27410
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.21.0-sage.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./dist/tsembed.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/index.js",require:"./cjs/src/react.index.js",types:"./lib/src/react/index.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/index.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run bundle-dts-react-full; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^40.1.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
27411
27411
|
|
|
27412
27412
|
/**
|
|
27413
27413
|
* Copyright (c) 2022
|
|
@@ -28658,9 +28658,115 @@
|
|
|
28658
28658
|
}
|
|
28659
28659
|
}
|
|
28660
28660
|
|
|
28661
|
+
/**
|
|
28662
|
+
* Copyright (c) 2022
|
|
28663
|
+
*
|
|
28664
|
+
* Embed ThoughtSpot Sage
|
|
28665
|
+
*
|
|
28666
|
+
* @summary TS Sage embed
|
|
28667
|
+
* @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
|
|
28668
|
+
*/
|
|
28669
|
+
const HiddenActionItemByDefaultForSageEmbed = [
|
|
28670
|
+
exports.Action.Save,
|
|
28671
|
+
exports.Action.Pin,
|
|
28672
|
+
];
|
|
28673
|
+
/**
|
|
28674
|
+
* Embed ThoughtSpot search
|
|
28675
|
+
*
|
|
28676
|
+
* @group Embed components
|
|
28677
|
+
*/
|
|
28678
|
+
class SageEmbed extends V1Embed {
|
|
28679
|
+
// eslint-disable-next-line no-useless-constructor
|
|
28680
|
+
constructor(domSelector, viewConfig) {
|
|
28681
|
+
super(domSelector, viewConfig);
|
|
28682
|
+
this.defaultHeight = 500;
|
|
28683
|
+
/**
|
|
28684
|
+
* Set the iframe height as per the computed height received
|
|
28685
|
+
* from the ThoughtSpot app.
|
|
28686
|
+
*
|
|
28687
|
+
* @param {MessagePayload} data The event payload
|
|
28688
|
+
*/
|
|
28689
|
+
this.updateIFrameHeight = (data) => {
|
|
28690
|
+
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
28691
|
+
};
|
|
28692
|
+
this.embedIframeCenter = (data, responder) => {
|
|
28693
|
+
const obj = this.getIframeCenter();
|
|
28694
|
+
responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
|
|
28695
|
+
};
|
|
28696
|
+
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
28697
|
+
if (!data.data.currentPath.startsWith('/embed/viz/')) {
|
|
28698
|
+
this.setIFrameHeight(this.defaultHeight);
|
|
28699
|
+
}
|
|
28700
|
+
};
|
|
28701
|
+
if (this.viewConfig.fullHeight === true) {
|
|
28702
|
+
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
28703
|
+
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
28704
|
+
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
28705
|
+
}
|
|
28706
|
+
}
|
|
28707
|
+
/**
|
|
28708
|
+
* Constructs a map of parameters to be passed on to the
|
|
28709
|
+
* embedded Eureka or Sage search page.
|
|
28710
|
+
*
|
|
28711
|
+
* @returns {string} query string
|
|
28712
|
+
*/
|
|
28713
|
+
getEmbedParams() {
|
|
28714
|
+
var _a, _b;
|
|
28715
|
+
const { hideEurekaResults, isSageEmbed, disableWorksheetChange, hideWorksheetSelector, } = this.viewConfig;
|
|
28716
|
+
const params = {};
|
|
28717
|
+
params[Param.EmbedApp] = true;
|
|
28718
|
+
params[Param.HideActions] = [...((_a = params[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
28719
|
+
params[Param.HideActions] = [
|
|
28720
|
+
...((_b = params[Param.HideActions]) !== null && _b !== void 0 ? _b : []),
|
|
28721
|
+
...HiddenActionItemByDefaultForSageEmbed,
|
|
28722
|
+
];
|
|
28723
|
+
if (hideEurekaResults) {
|
|
28724
|
+
params[Param.HideEurekaResults] = true;
|
|
28725
|
+
}
|
|
28726
|
+
if (isSageEmbed) {
|
|
28727
|
+
params[Param.IsSageEmbed] = true;
|
|
28728
|
+
}
|
|
28729
|
+
if (disableWorksheetChange) {
|
|
28730
|
+
params[Param.DisableWorksheetChange] = true;
|
|
28731
|
+
}
|
|
28732
|
+
if (hideWorksheetSelector) {
|
|
28733
|
+
params[Param.HideWorksheetSelector] = true;
|
|
28734
|
+
}
|
|
28735
|
+
const queryParamsString = getQueryParamString(params, true);
|
|
28736
|
+
let query = '';
|
|
28737
|
+
if (queryParamsString) {
|
|
28738
|
+
query = `?${queryParamsString}`;
|
|
28739
|
+
}
|
|
28740
|
+
return query;
|
|
28741
|
+
}
|
|
28742
|
+
/**
|
|
28743
|
+
* Construct the URL of the embedded ThoughtSpot sage to be
|
|
28744
|
+
* loaded in the iframe
|
|
28745
|
+
*
|
|
28746
|
+
* @returns {string} iframe url
|
|
28747
|
+
*/
|
|
28748
|
+
getIFrameSrc() {
|
|
28749
|
+
const path = 'eureka';
|
|
28750
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
28751
|
+
return `${this.getRootIframeSrc()}/embed/${path}${tsPostHashParams}`;
|
|
28752
|
+
}
|
|
28753
|
+
/**
|
|
28754
|
+
* Render the embedded ThoughtSpot Sage
|
|
28755
|
+
*
|
|
28756
|
+
* @returns {SageEmbed} Eureka/Sage embed
|
|
28757
|
+
*/
|
|
28758
|
+
render() {
|
|
28759
|
+
super.render();
|
|
28760
|
+
const src = this.getIFrameSrc();
|
|
28761
|
+
this.renderV1Embed(src);
|
|
28762
|
+
return this;
|
|
28763
|
+
}
|
|
28764
|
+
}
|
|
28765
|
+
|
|
28661
28766
|
exports.AppEmbed = AppEmbed;
|
|
28662
28767
|
exports.LiveboardEmbed = LiveboardEmbed;
|
|
28663
28768
|
exports.PinboardEmbed = PinboardEmbed;
|
|
28769
|
+
exports.SageEmbed = SageEmbed;
|
|
28664
28770
|
exports.SearchBarEmbed = SearchBarEmbed;
|
|
28665
28771
|
exports.SearchEmbed = SearchEmbed;
|
|
28666
28772
|
exports.executeTML = executeTML;
|
|
@@ -74,6 +74,9 @@ interface SearchBarEmbedProps extends EmbedProps, SearchBarViewConfig {
|
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
76
|
export const SearchBarEmbed: React.ForwardRefExoticComponent<SearchBarEmbedProps & React.RefAttributes<TsEmbed>>;
|
|
77
|
+
interface SageEmbedProps extends EmbedProps, SageViewConfig {
|
|
78
|
+
}
|
|
79
|
+
export const SageEmbed: React.ForwardRefExoticComponent<SageEmbedProps & React.RefAttributes<TsEmbed>>;
|
|
77
80
|
/**
|
|
78
81
|
* Get a reference to the embed component to trigger events on the component.
|
|
79
82
|
*
|
|
@@ -91,7 +94,7 @@ export const SearchBarEmbed: React.ForwardRefExoticComponent<SearchBarEmbedProps
|
|
|
91
94
|
* ```
|
|
92
95
|
* @returns {React.MutableRefObject<TsEmbed>} ref
|
|
93
96
|
*/
|
|
94
|
-
export const useEmbedRef: () => React.MutableRefObject<
|
|
97
|
+
export const useEmbedRef: () => React.MutableRefObject<TsEmbed>;
|
|
95
98
|
|
|
96
99
|
/**
|
|
97
100
|
* Copyright (c) 2023
|
|
@@ -102,7 +105,7 @@ export const useEmbedRef: () => React.MutableRefObject<_AppEmbed | _LiveboardEmb
|
|
|
102
105
|
* @summary ThoughtSpot Visual Embed SDK
|
|
103
106
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
104
107
|
*/
|
|
105
|
-
export { init, logout, prefetch, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, };
|
|
108
|
+
export { init, logout, prefetch, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, };
|
|
106
109
|
|
|
107
110
|
/**
|
|
108
111
|
* @group Embed components
|
|
@@ -144,6 +147,66 @@ export declare class SearchBarEmbed extends TsEmbed {
|
|
|
144
147
|
render(): SearchBarEmbed;
|
|
145
148
|
}
|
|
146
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Copyright (c) 2022
|
|
152
|
+
*
|
|
153
|
+
* Embed ThoughtSpot Sage
|
|
154
|
+
*
|
|
155
|
+
* @summary TS Sage embed
|
|
156
|
+
* @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
|
|
157
|
+
*/
|
|
158
|
+
/**
|
|
159
|
+
* The configuration attributes for the embedded search view.
|
|
160
|
+
*
|
|
161
|
+
* @group Embed components
|
|
162
|
+
*/
|
|
163
|
+
export interface SageViewConfig extends ViewConfig {
|
|
164
|
+
/**
|
|
165
|
+
* If set to false, eureka results are hidden
|
|
166
|
+
*/
|
|
167
|
+
hideEurekaResults?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* primary flag to enable eureka(/sage) page embedding.
|
|
170
|
+
*/
|
|
171
|
+
isSageEmbed?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* flag to disable changing worksheet. default false.
|
|
174
|
+
*/
|
|
175
|
+
disableWorksheetChange?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* flag to hide worksheet selector. default false.
|
|
178
|
+
*/
|
|
179
|
+
hideWorksheetSelector?: boolean;
|
|
180
|
+
fullHeight?: boolean;
|
|
181
|
+
}
|
|
182
|
+
export declare const HiddenActionItemByDefaultForSageEmbed: Action[];
|
|
183
|
+
/**
|
|
184
|
+
* Embed ThoughtSpot search
|
|
185
|
+
*
|
|
186
|
+
* @group Embed components
|
|
187
|
+
*/
|
|
188
|
+
export declare class SageEmbed extends V1Embed {
|
|
189
|
+
/**
|
|
190
|
+
* The view configuration for the embedded ThoughtSpot sage.
|
|
191
|
+
*
|
|
192
|
+
*/
|
|
193
|
+
protected viewConfig: SageViewConfig;
|
|
194
|
+
constructor(domSelector: DOMSelector, viewConfig: SageViewConfig);
|
|
195
|
+
/**
|
|
196
|
+
* Constructs a map of parameters to be passed on to the
|
|
197
|
+
* embedded Eureka or Sage search page.
|
|
198
|
+
*
|
|
199
|
+
* @returns {string} query string
|
|
200
|
+
*/
|
|
201
|
+
protected getEmbedParams(): string;
|
|
202
|
+
/**
|
|
203
|
+
* Render the embedded ThoughtSpot Sage
|
|
204
|
+
*
|
|
205
|
+
* @returns {SageEmbed} Eureka/Sage embed
|
|
206
|
+
*/
|
|
207
|
+
render(): SageEmbed;
|
|
208
|
+
}
|
|
209
|
+
|
|
147
210
|
/**
|
|
148
211
|
* Copyright (c) 2022
|
|
149
212
|
*
|
|
@@ -1442,6 +1505,10 @@ export interface EmbedConfig {
|
|
|
1442
1505
|
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw*
|
|
1443
1506
|
*/
|
|
1444
1507
|
suppressSearchEmbedBetaWarning?: boolean;
|
|
1508
|
+
/**
|
|
1509
|
+
* Hide beta alert warning message for SearchEmbed.
|
|
1510
|
+
*/
|
|
1511
|
+
suppressSageEmbedBetaWarning?: boolean;
|
|
1445
1512
|
/**
|
|
1446
1513
|
* Custom style params for embed Config.
|
|
1447
1514
|
*
|
|
@@ -2851,7 +2918,11 @@ export declare enum Param {
|
|
|
2851
2918
|
PrimaryNavHidden = "primaryNavHidden",
|
|
2852
2919
|
HideProfleAndHelp = "profileAndHelpInNavBarHidden",
|
|
2853
2920
|
HideApplicationSwitcher = "applicationSwitcherHidden",
|
|
2854
|
-
HideOrgSwitcher = "orgSwitcherHidden"
|
|
2921
|
+
HideOrgSwitcher = "orgSwitcherHidden",
|
|
2922
|
+
IsSageEmbed = "isSageEmbed",
|
|
2923
|
+
HideWorksheetSelector = "hideWorksheetSelector",
|
|
2924
|
+
DisableWorksheetChange = "disableWorksheetChange",
|
|
2925
|
+
HideEurekaResults = "hideEurekaResults"
|
|
2855
2926
|
}
|
|
2856
2927
|
/**
|
|
2857
2928
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -13,7 +13,7 @@ import EventEmitter from 'eventemitter3';
|
|
|
13
13
|
* @summary ThoughtSpot Visual Embed SDK
|
|
14
14
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
15
15
|
*/
|
|
16
|
-
export { init, logout, prefetch, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, };
|
|
16
|
+
export { init, logout, prefetch, executeTML, exportTML, getEmbedConfig as getInitConfig, getSessionInfo, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, };
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Copyright (c) 2022
|
|
@@ -1108,6 +1108,10 @@ export interface EmbedConfig {
|
|
|
1108
1108
|
* @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw*
|
|
1109
1109
|
*/
|
|
1110
1110
|
suppressSearchEmbedBetaWarning?: boolean;
|
|
1111
|
+
/**
|
|
1112
|
+
* Hide beta alert warning message for SearchEmbed.
|
|
1113
|
+
*/
|
|
1114
|
+
suppressSageEmbedBetaWarning?: boolean;
|
|
1111
1115
|
/**
|
|
1112
1116
|
* Custom style params for embed Config.
|
|
1113
1117
|
*
|
|
@@ -2517,7 +2521,11 @@ export enum Param {
|
|
|
2517
2521
|
PrimaryNavHidden = "primaryNavHidden",
|
|
2518
2522
|
HideProfleAndHelp = "profileAndHelpInNavBarHidden",
|
|
2519
2523
|
HideApplicationSwitcher = "applicationSwitcherHidden",
|
|
2520
|
-
HideOrgSwitcher = "orgSwitcherHidden"
|
|
2524
|
+
HideOrgSwitcher = "orgSwitcherHidden",
|
|
2525
|
+
IsSageEmbed = "isSageEmbed",
|
|
2526
|
+
HideWorksheetSelector = "hideWorksheetSelector",
|
|
2527
|
+
DisableWorksheetChange = "disableWorksheetChange",
|
|
2528
|
+
HideEurekaResults = "hideEurekaResults"
|
|
2521
2529
|
}
|
|
2522
2530
|
/**
|
|
2523
2531
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -2776,6 +2784,66 @@ export enum ContextMenuTriggerOptions {
|
|
|
2776
2784
|
RIGHT_CLICK = "right-click"
|
|
2777
2785
|
}
|
|
2778
2786
|
|
|
2787
|
+
/**
|
|
2788
|
+
* Copyright (c) 2022
|
|
2789
|
+
*
|
|
2790
|
+
* Embed ThoughtSpot Sage
|
|
2791
|
+
*
|
|
2792
|
+
* @summary TS Sage embed
|
|
2793
|
+
* @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
|
|
2794
|
+
*/
|
|
2795
|
+
/**
|
|
2796
|
+
* The configuration attributes for the embedded search view.
|
|
2797
|
+
*
|
|
2798
|
+
* @group Embed components
|
|
2799
|
+
*/
|
|
2800
|
+
export interface SageViewConfig extends ViewConfig {
|
|
2801
|
+
/**
|
|
2802
|
+
* If set to false, eureka results are hidden
|
|
2803
|
+
*/
|
|
2804
|
+
hideEurekaResults?: boolean;
|
|
2805
|
+
/**
|
|
2806
|
+
* primary flag to enable eureka(/sage) page embedding.
|
|
2807
|
+
*/
|
|
2808
|
+
isSageEmbed?: boolean;
|
|
2809
|
+
/**
|
|
2810
|
+
* flag to disable changing worksheet. default false.
|
|
2811
|
+
*/
|
|
2812
|
+
disableWorksheetChange?: boolean;
|
|
2813
|
+
/**
|
|
2814
|
+
* flag to hide worksheet selector. default false.
|
|
2815
|
+
*/
|
|
2816
|
+
hideWorksheetSelector?: boolean;
|
|
2817
|
+
fullHeight?: boolean;
|
|
2818
|
+
}
|
|
2819
|
+
export const HiddenActionItemByDefaultForSageEmbed: Action[];
|
|
2820
|
+
/**
|
|
2821
|
+
* Embed ThoughtSpot search
|
|
2822
|
+
*
|
|
2823
|
+
* @group Embed components
|
|
2824
|
+
*/
|
|
2825
|
+
export class SageEmbed extends V1Embed {
|
|
2826
|
+
/**
|
|
2827
|
+
* The view configuration for the embedded ThoughtSpot sage.
|
|
2828
|
+
*
|
|
2829
|
+
*/
|
|
2830
|
+
protected viewConfig: SageViewConfig;
|
|
2831
|
+
constructor(domSelector: DOMSelector, viewConfig: SageViewConfig);
|
|
2832
|
+
/**
|
|
2833
|
+
* Constructs a map of parameters to be passed on to the
|
|
2834
|
+
* embedded Eureka or Sage search page.
|
|
2835
|
+
*
|
|
2836
|
+
* @returns {string} query string
|
|
2837
|
+
*/
|
|
2838
|
+
protected getEmbedParams(): string;
|
|
2839
|
+
/**
|
|
2840
|
+
* Render the embedded ThoughtSpot Sage
|
|
2841
|
+
*
|
|
2842
|
+
* @returns {SageEmbed} Eureka/Sage embed
|
|
2843
|
+
*/
|
|
2844
|
+
render(): SageEmbed;
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2779
2847
|
/**
|
|
2780
2848
|
* Copyright (c) 2022
|
|
2781
2849
|
*
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.21.0-
|
|
3
|
+
"version": "1.21.0-sage.0",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"types": "./lib/src/index.d.ts"
|
|
19
19
|
},
|
|
20
20
|
"./react": {
|
|
21
|
-
"import": "./lib/src/react/
|
|
22
|
-
"require": "./cjs/src/react
|
|
23
|
-
"types": "./lib/src/react/
|
|
21
|
+
"import": "./lib/src/react/index.js",
|
|
22
|
+
"require": "./cjs/src/react.index.js",
|
|
23
|
+
"types": "./lib/src/react/index.d.ts"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"typesVersions": {
|
|
27
27
|
"*": {
|
|
28
28
|
"react": [
|
|
29
|
-
"./lib/src/react/
|
|
29
|
+
"./lib/src/react/index.d.ts"
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=nls.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nls.spec.d.ts","sourceRoot":"","sources":["../../../src/embed/nls.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=nls.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nls.spec.js","sourceRoot":"","sources":["../../../src/embed/nls.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022
|
|
3
|
+
*
|
|
4
|
+
* Embed ThoughtSpot Sage fullscreen view
|
|
5
|
+
*
|
|
6
|
+
* @summary TS Sage embed
|
|
7
|
+
* @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
|
|
8
|
+
*/
|
|
9
|
+
import { DOMSelector, Action, ViewConfig } from '../types';
|
|
10
|
+
import { TsEmbed } from './ts-embed';
|
|
11
|
+
/**
|
|
12
|
+
* The configuration attributes for the embedded Sage fullscreen view.
|
|
13
|
+
*
|
|
14
|
+
* @group Embed components
|
|
15
|
+
*/
|
|
16
|
+
export interface SageFullscreenViewConfig extends ViewConfig {
|
|
17
|
+
/**
|
|
18
|
+
* If set to true, the data sources panel is collapsed on load,
|
|
19
|
+
* but can be expanded manually.
|
|
20
|
+
*/
|
|
21
|
+
collapseDataSources?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* If set to true, hides the data sources panel.
|
|
24
|
+
*/
|
|
25
|
+
hideDataSources?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* If set to true, hides the charts and tables in search answers.
|
|
28
|
+
* This attribute can be used to create a custom visualization
|
|
29
|
+
* using raw answer data.
|
|
30
|
+
*/
|
|
31
|
+
hideResults?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* If set to true, the Search Assist feature is enabled.
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
enableSearchAssist?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* If set to true, the tabular view is set as the default
|
|
39
|
+
* format for presenting search data.
|
|
40
|
+
*/
|
|
41
|
+
forceTable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The array of data source GUIDs to set on load.
|
|
44
|
+
*/
|
|
45
|
+
dataSource?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The answer session id of the answer to load.
|
|
48
|
+
*/
|
|
49
|
+
answerSessionId?: string;
|
|
50
|
+
/**
|
|
51
|
+
* If set to true, Sage fullscreen view will render without the Search Bar
|
|
52
|
+
* The chart/table should still be visible.
|
|
53
|
+
*/
|
|
54
|
+
hideSearchBar?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export declare const HiddenActionItemByDefaultForSageFullscreenEmbed: Action[];
|
|
57
|
+
/**
|
|
58
|
+
* Embed ThoughtSpot Sage
|
|
59
|
+
*
|
|
60
|
+
* @group Embed components
|
|
61
|
+
*/
|
|
62
|
+
export declare class SageFullscreenEmbed extends TsEmbed {
|
|
63
|
+
/**
|
|
64
|
+
* The view configuration for the embedded ThoughtSpot sage fullscreen.
|
|
65
|
+
*/
|
|
66
|
+
protected viewConfig: SageFullscreenViewConfig;
|
|
67
|
+
constructor(domSelector: DOMSelector, viewConfig: SageFullscreenViewConfig);
|
|
68
|
+
/**
|
|
69
|
+
* Get the state of the data sources panel that the embedded
|
|
70
|
+
* ThoughtSpot sage fullscreen will be initialized with.
|
|
71
|
+
*/
|
|
72
|
+
private getDataSourceMode;
|
|
73
|
+
protected getEmbedParams(): string;
|
|
74
|
+
/**
|
|
75
|
+
* Construct the URL of the embedded ThoughtSpot sage fullscreen to be
|
|
76
|
+
* loaded in the iframe
|
|
77
|
+
*
|
|
78
|
+
* @param answerSessionId The answer session id of the ad hoc answer
|
|
79
|
+
* @returns iframe url
|
|
80
|
+
*/
|
|
81
|
+
private getIFrameSrc;
|
|
82
|
+
/**
|
|
83
|
+
* Render the embedded ThoughtSpot sage fullscreen
|
|
84
|
+
*/
|
|
85
|
+
render(): SageFullscreenEmbed;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=sage-fullscreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sage-fullscreen.d.ts","sourceRoot":"","sources":["../../../src/embed/sage-fullscreen.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEH,WAAW,EAEX,MAAM,EACN,UAAU,EACb,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAQrC;;;;GAIG;AACH,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IACxD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,+CAA+C,UAM3D,CAAC;AAEF;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,OAAO;IAC5C;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,wBAAwB,CAAC;gBAEnC,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,wBAAwB;IAK1E;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAYzB,SAAS,CAAC,cAAc,IAAI,MAAM;IA6ClC;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;IACI,MAAM,IAAI,mBAAmB;CAkBvC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022
|
|
3
|
+
*
|
|
4
|
+
* Embed ThoughtSpot Sage fullscreen view
|
|
5
|
+
*
|
|
6
|
+
* @summary TS Sage embed
|
|
7
|
+
* @author Mourya Balabhadra <mourya.balabhadra@thoughtspot.com>
|
|
8
|
+
*/
|
|
9
|
+
import { DataSourceVisualMode, Param, Action, } from '../types';
|
|
10
|
+
import { getQueryParamString, checkReleaseVersionInBeta, getFilterQuery } from '../utils';
|
|
11
|
+
import { TsEmbed } from './ts-embed';
|
|
12
|
+
import { ERROR_MESSAGE } from '../errors';
|
|
13
|
+
import { getAuthPromise, getEmbedConfig } from './base';
|
|
14
|
+
import { getReleaseVersion } from '../auth';
|
|
15
|
+
export const HiddenActionItemByDefaultForSageFullscreenEmbed = [
|
|
16
|
+
Action.EditACopy,
|
|
17
|
+
Action.SaveAsView,
|
|
18
|
+
Action.UpdateTML,
|
|
19
|
+
Action.EditTML,
|
|
20
|
+
Action.AnswerDelete,
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
* Embed ThoughtSpot Sage
|
|
24
|
+
*
|
|
25
|
+
* @group Embed components
|
|
26
|
+
*/
|
|
27
|
+
export class SageFullscreenEmbed extends TsEmbed {
|
|
28
|
+
constructor(domSelector, viewConfig) {
|
|
29
|
+
super(domSelector);
|
|
30
|
+
this.viewConfig = viewConfig;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the state of the data sources panel that the embedded
|
|
34
|
+
* ThoughtSpot sage fullscreen will be initialized with.
|
|
35
|
+
*/
|
|
36
|
+
getDataSourceMode() {
|
|
37
|
+
let dataSourceMode = DataSourceVisualMode.Expanded;
|
|
38
|
+
if (this.viewConfig.collapseDataSources === true) {
|
|
39
|
+
dataSourceMode = DataSourceVisualMode.Collapsed;
|
|
40
|
+
}
|
|
41
|
+
if (this.viewConfig.hideDataSources === true) {
|
|
42
|
+
dataSourceMode = DataSourceVisualMode.Hidden;
|
|
43
|
+
}
|
|
44
|
+
return dataSourceMode;
|
|
45
|
+
}
|
|
46
|
+
getEmbedParams() {
|
|
47
|
+
var _a;
|
|
48
|
+
const { hideResults, enableSearchAssist, forceTable, runtimeFilters, dataSource, } = this.viewConfig;
|
|
49
|
+
const queryParams = this.getBaseQueryParams();
|
|
50
|
+
queryParams[Param.HideActions] = [
|
|
51
|
+
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
52
|
+
...HiddenActionItemByDefaultForSageFullscreenEmbed,
|
|
53
|
+
];
|
|
54
|
+
/* the below parameters are not needed but
|
|
55
|
+
reusing the parameters we have for saved answer page */
|
|
56
|
+
if (dataSource) {
|
|
57
|
+
queryParams[Param.DataSources] = `["${dataSource}"]`;
|
|
58
|
+
}
|
|
59
|
+
if (enableSearchAssist) {
|
|
60
|
+
queryParams[Param.EnableSearchAssist] = true;
|
|
61
|
+
}
|
|
62
|
+
if (hideResults) {
|
|
63
|
+
queryParams[Param.HideResult] = true;
|
|
64
|
+
}
|
|
65
|
+
if (forceTable) {
|
|
66
|
+
queryParams[Param.ForceTable] = true;
|
|
67
|
+
}
|
|
68
|
+
queryParams[Param.DataSourceMode] = this.getDataSourceMode();
|
|
69
|
+
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
70
|
+
queryParams[Param.searchEmbed] = true;
|
|
71
|
+
let query = '';
|
|
72
|
+
const queryParamsString = getQueryParamString(queryParams, true);
|
|
73
|
+
if (queryParamsString) {
|
|
74
|
+
query = `?${queryParamsString}`;
|
|
75
|
+
}
|
|
76
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
77
|
+
if (filterQuery) {
|
|
78
|
+
query += `&${filterQuery}`;
|
|
79
|
+
}
|
|
80
|
+
return query;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Construct the URL of the embedded ThoughtSpot sage fullscreen to be
|
|
84
|
+
* loaded in the iframe
|
|
85
|
+
*
|
|
86
|
+
* @param answerSessionId The answer session id of the ad hoc answer
|
|
87
|
+
* @returns iframe url
|
|
88
|
+
*/
|
|
89
|
+
getIFrameSrc(answerSessionId) {
|
|
90
|
+
const answerPath = answerSessionId ? `ai-answer/${answerSessionId}` : 'answer';
|
|
91
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
92
|
+
return `${this.getRootIframeSrc()}/embed/${answerPath}${tsPostHashParams}`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Render the embedded ThoughtSpot sage fullscreen
|
|
96
|
+
*/
|
|
97
|
+
render() {
|
|
98
|
+
super.render();
|
|
99
|
+
const { answerSessionId } = this.viewConfig;
|
|
100
|
+
const src = this.getIFrameSrc(answerSessionId);
|
|
101
|
+
this.renderIFrame(src);
|
|
102
|
+
getAuthPromise().then(() => {
|
|
103
|
+
if (checkReleaseVersionInBeta(getReleaseVersion(), getEmbedConfig().suppressSageEmbedBetaWarning)) {
|
|
104
|
+
alert(ERROR_MESSAGE.SAGE_EMBED_BETA_WARNING_MESSAGE);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=sage-fullscreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sage-fullscreen.js","sourceRoot":"","sources":["../../../src/embed/sage-fullscreen.ts"],"names":[],"mappings":"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"}
|