@thoughtspot/visual-embed-sdk 1.24.0-alpha.1 → 1.24.0-alpha.3
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 +9 -1
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +3 -0
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/embed/app.d.ts +20 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +2 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +10 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +2 -2
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +3 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +14 -6
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +4 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/mixpanel-service.d.ts +1 -0
- package/cjs/src/mixpanel-service.d.ts.map +1 -1
- package/cjs/src/mixpanel-service.js +10 -3
- package/cjs/src/mixpanel-service.js.map +1 -1
- package/cjs/src/mixpanel-service.spec.js +12 -3
- package/cjs/src/mixpanel-service.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +14 -14
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +4 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +2 -1
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +1 -0
- package/cjs/src/types.js.map +1 -1
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +20 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +3 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/mixpanel-service.d.ts +1 -0
- package/dist/src/mixpanel-service.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +14 -14
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +2 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +35 -13
- package/dist/tsembed-react.js +35 -13
- package/dist/tsembed.es.js +33 -13
- package/dist/tsembed.js +33 -13
- package/dist/visual-embed-sdk-react-full.d.ts +260 -237
- package/dist/visual-embed-sdk-react.d.ts +260 -237
- package/dist/visual-embed-sdk.d.ts +25 -3
- package/lib/package.json +9 -1
- package/lib/src/.index.d.ts.swp +0 -0
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +3 -0
- package/lib/src/auth.js.map +1 -1
- package/lib/src/embed/app.d.ts +20 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +2 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +2 -2
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +3 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +14 -6
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +4 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/mixpanel-service.d.ts +1 -0
- package/lib/src/mixpanel-service.d.ts.map +1 -1
- package/lib/src/mixpanel-service.js +10 -3
- package/lib/src/mixpanel-service.js.map +1 -1
- package/lib/src/mixpanel-service.spec.js +12 -3
- package/lib/src/mixpanel-service.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +14 -14
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +4 -2
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +1 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +2 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +1 -0
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +25 -3
- package/package.json +9 -1
- package/src/auth.ts +6 -3
- package/src/embed/app.spec.ts +15 -0
- package/src/embed/app.ts +29 -8
- package/src/embed/base.ts +5 -5
- package/src/embed/ts-embed.spec.ts +11 -5
- package/src/embed/ts-embed.ts +18 -5
- package/src/mixpanel-service.spec.ts +12 -3
- package/src/mixpanel-service.ts +10 -3
- package/src/react/index.spec.tsx +4 -2
- package/src/react/index.tsx +35 -26
- package/src/types.ts +2 -1
package/dist/tsembed-react.js
CHANGED
|
@@ -1786,6 +1786,7 @@
|
|
|
1786
1786
|
Param["HideSampleQuestions"] = "hideSampleQuestions";
|
|
1787
1787
|
Param["WorksheetId"] = "worksheet";
|
|
1788
1788
|
Param["Query"] = "query";
|
|
1789
|
+
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
1789
1790
|
})(Param || (Param = {}));
|
|
1790
1791
|
(function (Action) {
|
|
1791
1792
|
/**
|
|
@@ -8645,6 +8646,7 @@
|
|
|
8645
8646
|
|
|
8646
8647
|
// Needed to avoid error in CJS builds on some bundlers.
|
|
8647
8648
|
const mixpanelLib = mixpanel_cjs || mixpanel$1;
|
|
8649
|
+
let mixpanelInstance;
|
|
8648
8650
|
const MIXPANEL_EVENT = {
|
|
8649
8651
|
VISUAL_SDK_RENDER_START: 'visual-sdk-render-start',
|
|
8650
8652
|
VISUAL_SDK_CALLED_INIT: 'visual-sdk-called-init',
|
|
@@ -8653,6 +8655,7 @@
|
|
|
8653
8655
|
VISUAL_SDK_TRIGGER: 'visual-sdk-trigger',
|
|
8654
8656
|
VISUAL_SDK_ON: 'visual-sdk-on',
|
|
8655
8657
|
VISUAL_SDK_IFRAME_LOAD_PERFORMANCE: 'visual-sdk-iframe-load-performance',
|
|
8658
|
+
VISUAL_SDK_EMBED_CREATE: 'visual-sdk-embed-create',
|
|
8656
8659
|
};
|
|
8657
8660
|
let isMixpanelInitialized = false;
|
|
8658
8661
|
let eventQueue = [];
|
|
@@ -8667,7 +8670,7 @@
|
|
|
8667
8670
|
eventQueue.push({ eventId, eventProps });
|
|
8668
8671
|
return;
|
|
8669
8672
|
}
|
|
8670
|
-
|
|
8673
|
+
mixpanelInstance.track(eventId, eventProps);
|
|
8671
8674
|
}
|
|
8672
8675
|
/**
|
|
8673
8676
|
*
|
|
@@ -8695,10 +8698,15 @@
|
|
|
8695
8698
|
const token = sessionInfo.mixpanelToken;
|
|
8696
8699
|
try {
|
|
8697
8700
|
if (token) {
|
|
8698
|
-
mixpanelLib.init(token);
|
|
8701
|
+
mixpanelInstance = mixpanelLib.init(token, undefined, 'tsEmbed');
|
|
8699
8702
|
if (!isPublicCluster) {
|
|
8700
|
-
|
|
8703
|
+
mixpanelInstance.identify(sessionInfo.userGUID);
|
|
8701
8704
|
}
|
|
8705
|
+
mixpanelInstance.register_once({
|
|
8706
|
+
clusterId: sessionInfo.clusterId,
|
|
8707
|
+
clusterName: sessionInfo.clusterName,
|
|
8708
|
+
releaseVersion: sessionInfo.releaseVersion,
|
|
8709
|
+
});
|
|
8702
8710
|
isMixpanelInitialized = true;
|
|
8703
8711
|
emptyQueue();
|
|
8704
8712
|
}
|
|
@@ -9635,6 +9643,9 @@
|
|
|
9635
9643
|
userGUID: sessionInfoResp.userGUID,
|
|
9636
9644
|
mixpanelToken,
|
|
9637
9645
|
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
9646
|
+
releaseVersion: sessionInfoResp.releaseVersion,
|
|
9647
|
+
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
9648
|
+
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
9638
9649
|
...sessionInfoResp,
|
|
9639
9650
|
};
|
|
9640
9651
|
};
|
|
@@ -10170,7 +10181,7 @@
|
|
|
10170
10181
|
});
|
|
10171
10182
|
}
|
|
10172
10183
|
|
|
10173
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.
|
|
10184
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^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",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-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,"size-limit":[{path:"dist/tsembed.js",limit:"40 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};
|
|
10174
10185
|
|
|
10175
10186
|
/**
|
|
10176
10187
|
* Copyright (c) 2022
|
|
@@ -10257,8 +10268,8 @@
|
|
|
10257
10268
|
* Register APP_INIT event and sendback init payload
|
|
10258
10269
|
*/
|
|
10259
10270
|
this.registerAppInit = () => {
|
|
10260
|
-
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb);
|
|
10261
|
-
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken);
|
|
10271
|
+
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
10272
|
+
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
10262
10273
|
};
|
|
10263
10274
|
this.el = getDOMNode(domSelector);
|
|
10264
10275
|
// TODO: handle error
|
|
@@ -10273,6 +10284,9 @@
|
|
|
10273
10284
|
this.viewConfig = viewConfig;
|
|
10274
10285
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
10275
10286
|
this.registerAppInit();
|
|
10287
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
10288
|
+
...viewConfig,
|
|
10289
|
+
});
|
|
10276
10290
|
}
|
|
10277
10291
|
/**
|
|
10278
10292
|
* Throws error encountered during initialization.
|
|
@@ -10555,7 +10569,6 @@
|
|
|
10555
10569
|
this.insertIntoDOM(this.embedConfig.loginFailedMessage);
|
|
10556
10570
|
return;
|
|
10557
10571
|
}
|
|
10558
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
10559
10572
|
this.iFrame = this.iFrame || this.createIframeEl(url);
|
|
10560
10573
|
this.iFrame.addEventListener('load', () => {
|
|
10561
10574
|
nextInQueue();
|
|
@@ -10566,7 +10579,9 @@
|
|
|
10566
10579
|
},
|
|
10567
10580
|
type: exports.EmbedEvent.Load,
|
|
10568
10581
|
});
|
|
10569
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.
|
|
10582
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE, {
|
|
10583
|
+
elWidth: this.iFrame.clientWidth,
|
|
10584
|
+
elHeight: this.iFrame.clientHeight,
|
|
10570
10585
|
timeTookToLoad: loadTimestamp - initTimestamp,
|
|
10571
10586
|
});
|
|
10572
10587
|
});
|
|
@@ -10709,6 +10724,8 @@
|
|
|
10709
10724
|
* @param messageType The message type
|
|
10710
10725
|
* @param callback A callback as a function
|
|
10711
10726
|
* @param options The message options
|
|
10727
|
+
* @param isSelf
|
|
10728
|
+
* @param isRegisteredBySDK
|
|
10712
10729
|
* @example
|
|
10713
10730
|
* ```js
|
|
10714
10731
|
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
@@ -10724,7 +10741,10 @@
|
|
|
10724
10741
|
* });
|
|
10725
10742
|
* ```
|
|
10726
10743
|
*/
|
|
10727
|
-
on(messageType, callback, options = { start: false }) {
|
|
10744
|
+
on(messageType, callback, options = { start: false }, isRegisteredBySDK = false) {
|
|
10745
|
+
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`, {
|
|
10746
|
+
isRegisteredBySDK,
|
|
10747
|
+
});
|
|
10728
10748
|
if (this.isRendered) {
|
|
10729
10749
|
this.handleError('Please register event handlers before calling render');
|
|
10730
10750
|
}
|
|
@@ -10905,7 +10925,6 @@
|
|
|
10905
10925
|
*/
|
|
10906
10926
|
on(messageType, callback, options = { start: false }) {
|
|
10907
10927
|
const eventType = this.getCompatibleEventType(messageType);
|
|
10908
|
-
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
|
|
10909
10928
|
return super.on(eventType, callback, options);
|
|
10910
10929
|
}
|
|
10911
10930
|
}
|
|
@@ -11248,7 +11267,7 @@
|
|
|
11248
11267
|
* embedded Liveboard or visualization.
|
|
11249
11268
|
*/
|
|
11250
11269
|
getEmbedParams() {
|
|
11251
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, } = this.viewConfig;
|
|
11270
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, modularHomeExperience = false, } = this.viewConfig;
|
|
11252
11271
|
let params = {};
|
|
11253
11272
|
params[Param.EmbedApp] = true;
|
|
11254
11273
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
@@ -11272,6 +11291,7 @@
|
|
|
11272
11291
|
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
11273
11292
|
}
|
|
11274
11293
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
11294
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
11275
11295
|
const queryParams = getQueryParamString(params, true);
|
|
11276
11296
|
return queryParams;
|
|
11277
11297
|
}
|
|
@@ -11679,9 +11699,11 @@
|
|
|
11679
11699
|
* return <LiveboardEmbed ref={ref} liveboardId={<id>} />
|
|
11680
11700
|
* }
|
|
11681
11701
|
* ```
|
|
11682
|
-
* @returns {React.MutableRefObject<TsEmbed>} ref
|
|
11702
|
+
* @returns {React.MutableRefObject<T extends TsEmbed>} ref
|
|
11683
11703
|
*/
|
|
11684
|
-
|
|
11704
|
+
function useEmbedRef() {
|
|
11705
|
+
return React__default['default'].useRef(null);
|
|
11706
|
+
}
|
|
11685
11707
|
|
|
11686
11708
|
exports.AppEmbed = AppEmbed$1;
|
|
11687
11709
|
exports.LiveboardEmbed = LiveboardEmbed$1;
|
package/dist/tsembed.es.js
CHANGED
|
@@ -1670,6 +1670,7 @@ var Param;
|
|
|
1670
1670
|
Param["HideSampleQuestions"] = "hideSampleQuestions";
|
|
1671
1671
|
Param["WorksheetId"] = "worksheet";
|
|
1672
1672
|
Param["Query"] = "query";
|
|
1673
|
+
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
1673
1674
|
})(Param || (Param = {}));
|
|
1674
1675
|
/**
|
|
1675
1676
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -8558,6 +8559,7 @@ var mixpanel$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE
|
|
|
8558
8559
|
|
|
8559
8560
|
// Needed to avoid error in CJS builds on some bundlers.
|
|
8560
8561
|
const mixpanelLib = mixpanel_cjs || mixpanel$1;
|
|
8562
|
+
let mixpanelInstance;
|
|
8561
8563
|
const MIXPANEL_EVENT = {
|
|
8562
8564
|
VISUAL_SDK_RENDER_START: 'visual-sdk-render-start',
|
|
8563
8565
|
VISUAL_SDK_CALLED_INIT: 'visual-sdk-called-init',
|
|
@@ -8566,6 +8568,7 @@ const MIXPANEL_EVENT = {
|
|
|
8566
8568
|
VISUAL_SDK_TRIGGER: 'visual-sdk-trigger',
|
|
8567
8569
|
VISUAL_SDK_ON: 'visual-sdk-on',
|
|
8568
8570
|
VISUAL_SDK_IFRAME_LOAD_PERFORMANCE: 'visual-sdk-iframe-load-performance',
|
|
8571
|
+
VISUAL_SDK_EMBED_CREATE: 'visual-sdk-embed-create',
|
|
8569
8572
|
};
|
|
8570
8573
|
let isMixpanelInitialized = false;
|
|
8571
8574
|
let eventQueue = [];
|
|
@@ -8580,7 +8583,7 @@ function uploadMixpanelEvent(eventId, eventProps = {}) {
|
|
|
8580
8583
|
eventQueue.push({ eventId, eventProps });
|
|
8581
8584
|
return;
|
|
8582
8585
|
}
|
|
8583
|
-
|
|
8586
|
+
mixpanelInstance.track(eventId, eventProps);
|
|
8584
8587
|
}
|
|
8585
8588
|
/**
|
|
8586
8589
|
*
|
|
@@ -8608,10 +8611,15 @@ function initMixpanel(sessionInfo) {
|
|
|
8608
8611
|
const token = sessionInfo.mixpanelToken;
|
|
8609
8612
|
try {
|
|
8610
8613
|
if (token) {
|
|
8611
|
-
mixpanelLib.init(token);
|
|
8614
|
+
mixpanelInstance = mixpanelLib.init(token, undefined, 'tsEmbed');
|
|
8612
8615
|
if (!isPublicCluster) {
|
|
8613
|
-
|
|
8616
|
+
mixpanelInstance.identify(sessionInfo.userGUID);
|
|
8614
8617
|
}
|
|
8618
|
+
mixpanelInstance.register_once({
|
|
8619
|
+
clusterId: sessionInfo.clusterId,
|
|
8620
|
+
clusterName: sessionInfo.clusterName,
|
|
8621
|
+
releaseVersion: sessionInfo.releaseVersion,
|
|
8622
|
+
});
|
|
8615
8623
|
isMixpanelInitialized = true;
|
|
8616
8624
|
emptyQueue();
|
|
8617
8625
|
}
|
|
@@ -10329,6 +10337,9 @@ const getSessionDetails = (sessionInfoResp) => {
|
|
|
10329
10337
|
userGUID: sessionInfoResp.userGUID,
|
|
10330
10338
|
mixpanelToken,
|
|
10331
10339
|
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
10340
|
+
releaseVersion: sessionInfoResp.releaseVersion,
|
|
10341
|
+
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
10342
|
+
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
10332
10343
|
...sessionInfoResp,
|
|
10333
10344
|
};
|
|
10334
10345
|
};
|
|
@@ -10734,9 +10745,9 @@ const init = (embedConfig) => {
|
|
|
10734
10745
|
const authEE = new eventemitter3();
|
|
10735
10746
|
setAuthEE(authEE);
|
|
10736
10747
|
handleAuth();
|
|
10748
|
+
const { password, ...configToTrack } = config;
|
|
10737
10749
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
|
|
10738
|
-
|
|
10739
|
-
host: config.thoughtSpotHost,
|
|
10750
|
+
...configToTrack,
|
|
10740
10751
|
usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
|
|
10741
10752
|
usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
|
|
10742
10753
|
usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) != null,
|
|
@@ -11099,7 +11110,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
11099
11110
|
});
|
|
11100
11111
|
}
|
|
11101
11112
|
|
|
11102
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.
|
|
11113
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^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",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^8.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"40 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};
|
|
11103
11114
|
|
|
11104
11115
|
/**
|
|
11105
11116
|
* Copyright (c) 2022
|
|
@@ -11186,8 +11197,8 @@ class TsEmbed {
|
|
|
11186
11197
|
* Register APP_INIT event and sendback init payload
|
|
11187
11198
|
*/
|
|
11188
11199
|
this.registerAppInit = () => {
|
|
11189
|
-
this.on(EmbedEvent.APP_INIT, this.appInitCb);
|
|
11190
|
-
this.on(EmbedEvent.AuthExpire, this.updateAuthToken);
|
|
11200
|
+
this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
11201
|
+
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
11191
11202
|
};
|
|
11192
11203
|
this.el = getDOMNode(domSelector);
|
|
11193
11204
|
// TODO: handle error
|
|
@@ -11202,6 +11213,9 @@ class TsEmbed {
|
|
|
11202
11213
|
this.viewConfig = viewConfig;
|
|
11203
11214
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
11204
11215
|
this.registerAppInit();
|
|
11216
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
11217
|
+
...viewConfig,
|
|
11218
|
+
});
|
|
11205
11219
|
}
|
|
11206
11220
|
/**
|
|
11207
11221
|
* Throws error encountered during initialization.
|
|
@@ -11484,7 +11498,6 @@ class TsEmbed {
|
|
|
11484
11498
|
this.insertIntoDOM(this.embedConfig.loginFailedMessage);
|
|
11485
11499
|
return;
|
|
11486
11500
|
}
|
|
11487
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
11488
11501
|
this.iFrame = this.iFrame || this.createIframeEl(url);
|
|
11489
11502
|
this.iFrame.addEventListener('load', () => {
|
|
11490
11503
|
nextInQueue();
|
|
@@ -11495,7 +11508,9 @@ class TsEmbed {
|
|
|
11495
11508
|
},
|
|
11496
11509
|
type: EmbedEvent.Load,
|
|
11497
11510
|
});
|
|
11498
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.
|
|
11511
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE, {
|
|
11512
|
+
elWidth: this.iFrame.clientWidth,
|
|
11513
|
+
elHeight: this.iFrame.clientHeight,
|
|
11499
11514
|
timeTookToLoad: loadTimestamp - initTimestamp,
|
|
11500
11515
|
});
|
|
11501
11516
|
});
|
|
@@ -11638,6 +11653,8 @@ class TsEmbed {
|
|
|
11638
11653
|
* @param messageType The message type
|
|
11639
11654
|
* @param callback A callback as a function
|
|
11640
11655
|
* @param options The message options
|
|
11656
|
+
* @param isSelf
|
|
11657
|
+
* @param isRegisteredBySDK
|
|
11641
11658
|
* @example
|
|
11642
11659
|
* ```js
|
|
11643
11660
|
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
@@ -11653,7 +11670,10 @@ class TsEmbed {
|
|
|
11653
11670
|
* });
|
|
11654
11671
|
* ```
|
|
11655
11672
|
*/
|
|
11656
|
-
on(messageType, callback, options = { start: false }) {
|
|
11673
|
+
on(messageType, callback, options = { start: false }, isRegisteredBySDK = false) {
|
|
11674
|
+
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`, {
|
|
11675
|
+
isRegisteredBySDK,
|
|
11676
|
+
});
|
|
11657
11677
|
if (this.isRendered) {
|
|
11658
11678
|
this.handleError('Please register event handlers before calling render');
|
|
11659
11679
|
}
|
|
@@ -11834,7 +11854,6 @@ class V1Embed extends TsEmbed {
|
|
|
11834
11854
|
*/
|
|
11835
11855
|
on(messageType, callback, options = { start: false }) {
|
|
11836
11856
|
const eventType = this.getCompatibleEventType(messageType);
|
|
11837
|
-
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
|
|
11838
11857
|
return super.on(eventType, callback, options);
|
|
11839
11858
|
}
|
|
11840
11859
|
}
|
|
@@ -11925,7 +11944,7 @@ class AppEmbed extends V1Embed {
|
|
|
11925
11944
|
* embedded Liveboard or visualization.
|
|
11926
11945
|
*/
|
|
11927
11946
|
getEmbedParams() {
|
|
11928
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, } = this.viewConfig;
|
|
11947
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, modularHomeExperience = false, } = this.viewConfig;
|
|
11929
11948
|
let params = {};
|
|
11930
11949
|
params[Param.EmbedApp] = true;
|
|
11931
11950
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
@@ -11949,6 +11968,7 @@ class AppEmbed extends V1Embed {
|
|
|
11949
11968
|
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
11950
11969
|
}
|
|
11951
11970
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
11971
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
11952
11972
|
const queryParams = getQueryParamString(params, true);
|
|
11953
11973
|
return queryParams;
|
|
11954
11974
|
}
|
package/dist/tsembed.js
CHANGED
|
@@ -1611,6 +1611,7 @@
|
|
|
1611
1611
|
Param["HideSampleQuestions"] = "hideSampleQuestions";
|
|
1612
1612
|
Param["WorksheetId"] = "worksheet";
|
|
1613
1613
|
Param["Query"] = "query";
|
|
1614
|
+
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
1614
1615
|
})(Param || (Param = {}));
|
|
1615
1616
|
(function (Action) {
|
|
1616
1617
|
/**
|
|
@@ -8465,6 +8466,7 @@
|
|
|
8465
8466
|
|
|
8466
8467
|
// Needed to avoid error in CJS builds on some bundlers.
|
|
8467
8468
|
const mixpanelLib = mixpanel_cjs || mixpanel$1;
|
|
8469
|
+
let mixpanelInstance;
|
|
8468
8470
|
const MIXPANEL_EVENT = {
|
|
8469
8471
|
VISUAL_SDK_RENDER_START: 'visual-sdk-render-start',
|
|
8470
8472
|
VISUAL_SDK_CALLED_INIT: 'visual-sdk-called-init',
|
|
@@ -8473,6 +8475,7 @@
|
|
|
8473
8475
|
VISUAL_SDK_TRIGGER: 'visual-sdk-trigger',
|
|
8474
8476
|
VISUAL_SDK_ON: 'visual-sdk-on',
|
|
8475
8477
|
VISUAL_SDK_IFRAME_LOAD_PERFORMANCE: 'visual-sdk-iframe-load-performance',
|
|
8478
|
+
VISUAL_SDK_EMBED_CREATE: 'visual-sdk-embed-create',
|
|
8476
8479
|
};
|
|
8477
8480
|
let isMixpanelInitialized = false;
|
|
8478
8481
|
let eventQueue = [];
|
|
@@ -8487,7 +8490,7 @@
|
|
|
8487
8490
|
eventQueue.push({ eventId, eventProps });
|
|
8488
8491
|
return;
|
|
8489
8492
|
}
|
|
8490
|
-
|
|
8493
|
+
mixpanelInstance.track(eventId, eventProps);
|
|
8491
8494
|
}
|
|
8492
8495
|
/**
|
|
8493
8496
|
*
|
|
@@ -8515,10 +8518,15 @@
|
|
|
8515
8518
|
const token = sessionInfo.mixpanelToken;
|
|
8516
8519
|
try {
|
|
8517
8520
|
if (token) {
|
|
8518
|
-
mixpanelLib.init(token);
|
|
8521
|
+
mixpanelInstance = mixpanelLib.init(token, undefined, 'tsEmbed');
|
|
8519
8522
|
if (!isPublicCluster) {
|
|
8520
|
-
|
|
8523
|
+
mixpanelInstance.identify(sessionInfo.userGUID);
|
|
8521
8524
|
}
|
|
8525
|
+
mixpanelInstance.register_once({
|
|
8526
|
+
clusterId: sessionInfo.clusterId,
|
|
8527
|
+
clusterName: sessionInfo.clusterName,
|
|
8528
|
+
releaseVersion: sessionInfo.releaseVersion,
|
|
8529
|
+
});
|
|
8522
8530
|
isMixpanelInitialized = true;
|
|
8523
8531
|
emptyQueue();
|
|
8524
8532
|
}
|
|
@@ -10217,6 +10225,9 @@
|
|
|
10217
10225
|
userGUID: sessionInfoResp.userGUID,
|
|
10218
10226
|
mixpanelToken,
|
|
10219
10227
|
isPublicUser: sessionInfoResp.configInfo.isPublicUser,
|
|
10228
|
+
releaseVersion: sessionInfoResp.releaseVersion,
|
|
10229
|
+
clusterId: sessionInfoResp.configInfo.selfClusterId,
|
|
10230
|
+
clusterName: sessionInfoResp.configInfo.selfClusterName,
|
|
10220
10231
|
...sessionInfoResp,
|
|
10221
10232
|
};
|
|
10222
10233
|
};
|
|
@@ -10622,9 +10633,9 @@
|
|
|
10622
10633
|
const authEE = new eventemitter3();
|
|
10623
10634
|
setAuthEE(authEE);
|
|
10624
10635
|
handleAuth();
|
|
10636
|
+
const { password, ...configToTrack } = config;
|
|
10625
10637
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_CALLED_INIT, {
|
|
10626
|
-
|
|
10627
|
-
host: config.thoughtSpotHost,
|
|
10638
|
+
...configToTrack,
|
|
10628
10639
|
usedCustomizationSheet: ((_b = (_a = embedConfig.customizations) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.customCSSUrl) != null,
|
|
10629
10640
|
usedCustomizationVariables: ((_e = (_d = (_c = embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.customCSS) === null || _e === void 0 ? void 0 : _e.variables) != null,
|
|
10630
10641
|
usedCustomizationRules: ((_h = (_g = (_f = embedConfig.customizations) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.customCSS) === null || _h === void 0 ? void 0 : _h.rules_UNSTABLE) != null,
|
|
@@ -10987,7 +10998,7 @@
|
|
|
10987
10998
|
});
|
|
10988
10999
|
}
|
|
10989
11000
|
|
|
10990
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.
|
|
11001
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.24.0-alpha.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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^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",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-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,"size-limit":[{path:"dist/tsembed.js",limit:"40 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};
|
|
10991
11002
|
|
|
10992
11003
|
/**
|
|
10993
11004
|
* Copyright (c) 2022
|
|
@@ -11074,8 +11085,8 @@
|
|
|
11074
11085
|
* Register APP_INIT event and sendback init payload
|
|
11075
11086
|
*/
|
|
11076
11087
|
this.registerAppInit = () => {
|
|
11077
|
-
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb);
|
|
11078
|
-
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken);
|
|
11088
|
+
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
11089
|
+
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
11079
11090
|
};
|
|
11080
11091
|
this.el = getDOMNode(domSelector);
|
|
11081
11092
|
// TODO: handle error
|
|
@@ -11090,6 +11101,9 @@
|
|
|
11090
11101
|
this.viewConfig = viewConfig;
|
|
11091
11102
|
this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
|
|
11092
11103
|
this.registerAppInit();
|
|
11104
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
11105
|
+
...viewConfig,
|
|
11106
|
+
});
|
|
11093
11107
|
}
|
|
11094
11108
|
/**
|
|
11095
11109
|
* Throws error encountered during initialization.
|
|
@@ -11372,7 +11386,6 @@
|
|
|
11372
11386
|
this.insertIntoDOM(this.embedConfig.loginFailedMessage);
|
|
11373
11387
|
return;
|
|
11374
11388
|
}
|
|
11375
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE);
|
|
11376
11389
|
this.iFrame = this.iFrame || this.createIframeEl(url);
|
|
11377
11390
|
this.iFrame.addEventListener('load', () => {
|
|
11378
11391
|
nextInQueue();
|
|
@@ -11383,7 +11396,9 @@
|
|
|
11383
11396
|
},
|
|
11384
11397
|
type: exports.EmbedEvent.Load,
|
|
11385
11398
|
});
|
|
11386
|
-
uploadMixpanelEvent(MIXPANEL_EVENT.
|
|
11399
|
+
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_COMPLETE, {
|
|
11400
|
+
elWidth: this.iFrame.clientWidth,
|
|
11401
|
+
elHeight: this.iFrame.clientHeight,
|
|
11387
11402
|
timeTookToLoad: loadTimestamp - initTimestamp,
|
|
11388
11403
|
});
|
|
11389
11404
|
});
|
|
@@ -11526,6 +11541,8 @@
|
|
|
11526
11541
|
* @param messageType The message type
|
|
11527
11542
|
* @param callback A callback as a function
|
|
11528
11543
|
* @param options The message options
|
|
11544
|
+
* @param isSelf
|
|
11545
|
+
* @param isRegisteredBySDK
|
|
11529
11546
|
* @example
|
|
11530
11547
|
* ```js
|
|
11531
11548
|
* tsEmbed.on(EmbedEvent.Error, (data) => {
|
|
@@ -11541,7 +11558,10 @@
|
|
|
11541
11558
|
* });
|
|
11542
11559
|
* ```
|
|
11543
11560
|
*/
|
|
11544
|
-
on(messageType, callback, options = { start: false }) {
|
|
11561
|
+
on(messageType, callback, options = { start: false }, isRegisteredBySDK = false) {
|
|
11562
|
+
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`, {
|
|
11563
|
+
isRegisteredBySDK,
|
|
11564
|
+
});
|
|
11545
11565
|
if (this.isRendered) {
|
|
11546
11566
|
this.handleError('Please register event handlers before calling render');
|
|
11547
11567
|
}
|
|
@@ -11722,7 +11742,6 @@
|
|
|
11722
11742
|
*/
|
|
11723
11743
|
on(messageType, callback, options = { start: false }) {
|
|
11724
11744
|
const eventType = this.getCompatibleEventType(messageType);
|
|
11725
|
-
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_ON}-${messageType}`);
|
|
11726
11745
|
return super.on(eventType, callback, options);
|
|
11727
11746
|
}
|
|
11728
11747
|
}
|
|
@@ -11808,7 +11827,7 @@
|
|
|
11808
11827
|
* embedded Liveboard or visualization.
|
|
11809
11828
|
*/
|
|
11810
11829
|
getEmbedParams() {
|
|
11811
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, } = this.viewConfig;
|
|
11830
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, modularHomeExperience = false, } = this.viewConfig;
|
|
11812
11831
|
let params = {};
|
|
11813
11832
|
params[Param.EmbedApp] = true;
|
|
11814
11833
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
@@ -11832,6 +11851,7 @@
|
|
|
11832
11851
|
params[Param.EnableSearchAssist] = enableSearchAssist;
|
|
11833
11852
|
}
|
|
11834
11853
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
11854
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
11835
11855
|
const queryParams = getQueryParamString(params, true);
|
|
11836
11856
|
return queryParams;
|
|
11837
11857
|
}
|