@thoughtspot/visual-embed-sdk 1.39.1 → 1.39.2-spotter-agent
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 +1 -1
- package/cjs/src/config.spec.js +9 -0
- package/cjs/src/config.spec.js.map +1 -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 +18 -8
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +24 -4
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +28 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts +9 -7
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js +9 -7
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +0 -17
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +2 -4
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +12 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +5 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +16 -1
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +164 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- 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/pages/embed-test.page.d.ts +8 -0
- package/cjs/src/pages/embed-test.page.d.ts.map +1 -0
- package/cjs/src/pages/embed-test.page.js +20 -0
- package/cjs/src/pages/embed-test.page.js.map +1 -0
- package/cjs/src/pages/home.page.d.ts +6 -0
- package/cjs/src/pages/home.page.d.ts.map +1 -0
- package/cjs/src/pages/home.page.js +12 -0
- package/cjs/src/pages/home.page.js.map +1 -0
- package/cjs/src/pages/login.page.d.ts +15 -0
- package/cjs/src/pages/login.page.d.ts.map +1 -0
- package/cjs/src/pages/login.page.js +22 -0
- package/cjs/src/pages/login.page.js.map +1 -0
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +3 -2
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +71 -20
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +79 -42
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +436 -100
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/tests/auth.test.d.ts +1 -0
- package/cjs/src/tests/auth.test.d.ts.map +1 -0
- package/cjs/src/tests/auth.test.js +1 -0
- package/cjs/src/tests/auth.test.js.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts +2 -0
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +1 -0
- package/cjs/src/tests/e2e/auth.spec.js +54 -0
- package/cjs/src/tests/e2e/auth.spec.js.map +1 -0
- package/cjs/src/types.d.ts +34 -2
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +17 -1
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
- package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/cjs/src/utils.spec.js +25 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/index-2QHwuA-G.js +7371 -0
- package/dist/index-Cj4BVGHL.js +7371 -0
- package/dist/index-DUaG1OG2.js +7447 -0
- package/dist/{index-JaFaxrvQ.js → index-DnIvX1FR.js} +1 -1
- package/dist/index-Fhk1V_Gw.js +7371 -0
- package/dist/index-OuiZF3zE.js +7371 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +19 -7
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts +9 -7
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +0 -17
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +5 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +71 -20
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +34 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +157 -68
- package/dist/tsembed-react.js +157 -66
- package/dist/tsembed.es.js +74 -20
- package/dist/tsembed.js +73 -19
- package/dist/visual-embed-sdk-react-full.d.ts +132 -52
- package/dist/visual-embed-sdk-react.d.ts +132 -52
- package/dist/visual-embed-sdk.d.ts +62 -33
- package/lib/package.json +1 -1
- package/lib/src/config.spec.js +9 -0
- package/lib/src/config.spec.js.map +1 -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 +19 -9
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +19 -7
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +23 -4
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +9 -191
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +30 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts +9 -7
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js +9 -7
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +0 -17
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +2 -4
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +12 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +5 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +16 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +164 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- 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/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +71 -20
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +79 -43
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +439 -103
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +34 -2
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +17 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
- package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/lib/src/utils.spec.js +26 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +62 -33
- package/package.json +1 -1
- package/src/config.spec.ts +11 -0
- package/src/embed/app.spec.ts +36 -23
- package/src/embed/app.ts +2 -0
- package/src/embed/bodyless-conversation.spec.ts +9 -203
- package/src/embed/bodyless-conversation.ts +24 -10
- package/src/embed/conversation.spec.ts +40 -2
- package/src/embed/embedConfig.ts +10 -8
- package/src/embed/liveboard.spec.ts +5 -4
- package/src/embed/liveboard.ts +2 -22
- package/src/embed/ts-embed.spec.ts +225 -0
- package/src/embed/ts-embed.ts +19 -0
- package/src/errors.ts +1 -0
- package/src/react/all-types-export.ts +2 -1
- package/src/react/index.spec.tsx +556 -157
- package/src/react/index.tsx +117 -51
- package/src/types.ts +75 -43
- package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
- package/src/utils.spec.ts +29 -0
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.39.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.39.2-spotter-agent */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import React__default, { useRef } from 'react';
|
|
4
|
+
import React__default, { useRef, useCallback } from 'react';
|
|
5
5
|
|
|
6
6
|
function _mergeNamespaces(n, m) {
|
|
7
7
|
m.forEach(function (e) {
|
|
@@ -2808,7 +2808,7 @@ var Param;
|
|
|
2808
2808
|
Param["DataSourceId"] = "dataSourceId";
|
|
2809
2809
|
Param["preAuthCache"] = "preAuthCache";
|
|
2810
2810
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
2811
|
-
Param["CoverAndFilterOptionInPDF"] = "
|
|
2811
|
+
Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
|
|
2812
2812
|
Param["PrimaryAction"] = "primaryAction";
|
|
2813
2813
|
Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
|
|
2814
2814
|
Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
|
|
@@ -4034,6 +4034,22 @@ var Action;
|
|
|
4034
4034
|
* @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4035
4035
|
*/
|
|
4036
4036
|
Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
4037
|
+
/**
|
|
4038
|
+
* Action ID for hide or disable the
|
|
4039
|
+
* Spotter in conversation training widget.
|
|
4040
|
+
* The Add to Coaching feature is currently in beta
|
|
4041
|
+
* and is disabled by default on embed deployments.
|
|
4042
|
+
* To enable this feature on your instance,
|
|
4043
|
+
* contact ThoughtSpot Support.
|
|
4044
|
+
* @example
|
|
4045
|
+
* ```js
|
|
4046
|
+
* hiddenAction: [Action.InConversationTraining]
|
|
4047
|
+
* disabledActions: [Action.InConversationTraining]
|
|
4048
|
+
*
|
|
4049
|
+
* ```
|
|
4050
|
+
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4051
|
+
*/
|
|
4052
|
+
Action["InConversationTraining"] = "InConversationTraining";
|
|
4037
4053
|
})(Action || (Action = {}));
|
|
4038
4054
|
var PrefetchFeatures;
|
|
4039
4055
|
(function (PrefetchFeatures) {
|
|
@@ -6869,6 +6885,7 @@ const ERROR_MESSAGE = {
|
|
|
6869
6885
|
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
6870
6886
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
6871
6887
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
6888
|
+
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
6872
6889
|
};
|
|
6873
6890
|
|
|
6874
6891
|
const EndPoints = {
|
|
@@ -7076,13 +7093,14 @@ const configKey = 'embedConfig';
|
|
|
7076
7093
|
*
|
|
7077
7094
|
* @example
|
|
7078
7095
|
* ```js
|
|
7096
|
+
* import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
|
|
7097
|
+
* // Call the getInitConfig method to retrieve the embed configuration
|
|
7079
7098
|
* const config = getInitConfig();
|
|
7099
|
+
* // Log the configuration settings
|
|
7080
7100
|
* console.log(config);
|
|
7081
7101
|
* ```
|
|
7082
|
-
*
|
|
7083
|
-
*
|
|
7084
|
-
* Returns the `EmbedConfig` object, which
|
|
7085
|
-
* contains the configuration settings used to
|
|
7102
|
+
* Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
|
|
7103
|
+
* object, which contains the configuration settings used to
|
|
7086
7104
|
* initialize the SDK, including the following:
|
|
7087
7105
|
*
|
|
7088
7106
|
* - `thoughtSpotHost` - ThoughtSpot host URL
|
|
@@ -7091,9 +7109,10 @@ const configKey = 'embedConfig';
|
|
|
7091
7109
|
* - `customizations` - Style, text, and icon customization settings
|
|
7092
7110
|
* that were applied during the SDK initialization.
|
|
7093
7111
|
*
|
|
7094
|
-
*
|
|
7095
|
-
*
|
|
7112
|
+
* The following JSON output shows the embed configuration
|
|
7113
|
+
* settings returned from the code in the previous example:
|
|
7096
7114
|
*
|
|
7115
|
+
* @example
|
|
7097
7116
|
* ```json
|
|
7098
7117
|
* {
|
|
7099
7118
|
* "thoughtSpotHost": "https://{ThoughtSpot-Host}",
|
|
@@ -7115,7 +7134,7 @@ const configKey = 'embedConfig';
|
|
|
7115
7134
|
* "authTriggerContainer": "#your-own-div"
|
|
7116
7135
|
* }
|
|
7117
7136
|
* ```
|
|
7118
|
-
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.
|
|
7137
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
|
|
7119
7138
|
* @group Global methods
|
|
7120
7139
|
*/
|
|
7121
7140
|
const getEmbedConfig = () => getValueFromWindow(configKey) || {};
|
|
@@ -7757,7 +7776,7 @@ class AnswerService {
|
|
|
7757
7776
|
async getTML() {
|
|
7758
7777
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7759
7778
|
const edoc = object[0].edoc;
|
|
7760
|
-
const YAML = await import('./index-
|
|
7779
|
+
const YAML = await import('./index-2QHwuA-G.js');
|
|
7761
7780
|
const parsedDoc = YAML.parse(edoc);
|
|
7762
7781
|
return {
|
|
7763
7782
|
answer: {
|
|
@@ -15491,7 +15510,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15491
15510
|
return e;
|
|
15492
15511
|
}
|
|
15493
15512
|
|
|
15494
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.
|
|
15513
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-spotter-agent";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={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":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^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":"^1.1.1",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:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15495
15514
|
|
|
15496
15515
|
/**
|
|
15497
15516
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15889,10 +15908,25 @@ class TsEmbed {
|
|
|
15889
15908
|
// - cached auth info would be for wrong org
|
|
15890
15909
|
// - info call response changes for each different overrideOrgId
|
|
15891
15910
|
// 2. disablePreauthCache is explicitly set to true
|
|
15911
|
+
// 3. FullAppEmbed has primary navbar visible since:
|
|
15912
|
+
// - primary navbar requires fresh auth state for navigation
|
|
15913
|
+
// - cached auth may not reflect current user permissions
|
|
15892
15914
|
const isDisabled = (this.viewConfig.overrideOrgId !== undefined
|
|
15893
|
-
|| this.embedConfig.disablePreauthCache === true
|
|
15915
|
+
|| this.embedConfig.disablePreauthCache === true
|
|
15916
|
+
|| this.isFullAppEmbedWithVisiblePrimaryNavbar());
|
|
15894
15917
|
return !isDisabled;
|
|
15895
15918
|
}
|
|
15919
|
+
/**
|
|
15920
|
+
* Checks if current embed is FullAppEmbed with visible primary navbar
|
|
15921
|
+
* @returns boolean
|
|
15922
|
+
*/
|
|
15923
|
+
isFullAppEmbedWithVisiblePrimaryNavbar() {
|
|
15924
|
+
const appViewConfig = this.viewConfig;
|
|
15925
|
+
// Check if this is a FullAppEmbed (AppEmbed)
|
|
15926
|
+
// showPrimaryNavbar defaults to true if not explicitly set to false
|
|
15927
|
+
return (appViewConfig.embedComponentType === 'AppEmbed'
|
|
15928
|
+
&& appViewConfig.showPrimaryNavbar === true);
|
|
15929
|
+
}
|
|
15896
15930
|
/**
|
|
15897
15931
|
* fix for ts7.sep.cl
|
|
15898
15932
|
* will be removed for ts7.oct.cl
|
|
@@ -17354,7 +17388,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17354
17388
|
getEmbedParams() {
|
|
17355
17389
|
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17356
17390
|
/* eslint-disable-next-line max-len */
|
|
17357
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17391
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17358
17392
|
let params = {};
|
|
17359
17393
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17360
17394
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17370,6 +17404,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17370
17404
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
17371
17405
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17372
17406
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17407
|
+
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
17373
17408
|
params = this.getBaseQueryParams(params);
|
|
17374
17409
|
if (hideObjectSearch) {
|
|
17375
17410
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -17689,7 +17724,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17689
17724
|
getEmbedParams() {
|
|
17690
17725
|
let params = {};
|
|
17691
17726
|
params = this.getBaseQueryParams(params);
|
|
17692
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17727
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17693
17728
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
17694
17729
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
17695
17730
|
if (fullHeight === true) {
|
|
@@ -17741,9 +17776,6 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17741
17776
|
if (dataSourceId !== undefined) {
|
|
17742
17777
|
params[Param.DataSourceId] = dataSourceId;
|
|
17743
17778
|
}
|
|
17744
|
-
if (coverAndFilterOptionInPDF !== undefined) {
|
|
17745
|
-
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17746
|
-
}
|
|
17747
17779
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
17748
17780
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
17749
17781
|
}
|
|
@@ -17754,6 +17786,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17754
17786
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17755
17787
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17756
17788
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17789
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17757
17790
|
const queryParams = getQueryParamString(params, true);
|
|
17758
17791
|
return queryParams;
|
|
17759
17792
|
}
|
|
@@ -18257,6 +18290,8 @@ class Conversation {
|
|
|
18257
18290
|
});
|
|
18258
18291
|
const data = responses[0].data;
|
|
18259
18292
|
return {
|
|
18293
|
+
convId: this.conversationId,
|
|
18294
|
+
messageId: responses[0].msgId,
|
|
18260
18295
|
data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18261
18296
|
error: null,
|
|
18262
18297
|
};
|
|
@@ -18275,7 +18310,7 @@ class Conversation {
|
|
|
18275
18310
|
}
|
|
18276
18311
|
}
|
|
18277
18312
|
|
|
18278
|
-
class ConversationMessage extends TsEmbed {
|
|
18313
|
+
let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
|
|
18279
18314
|
constructor(container, viewConfig) {
|
|
18280
18315
|
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
18281
18316
|
super(container, viewConfig);
|
|
@@ -18307,7 +18342,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
18307
18342
|
await this.renderIFrame(src);
|
|
18308
18343
|
return this;
|
|
18309
18344
|
}
|
|
18310
|
-
}
|
|
18345
|
+
};
|
|
18311
18346
|
/**
|
|
18312
18347
|
* Create a conversation embed, which can be integrated inside
|
|
18313
18348
|
* chatbots or other conversational interfaces.
|
|
@@ -18327,7 +18362,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
18327
18362
|
* @group Embed components
|
|
18328
18363
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18329
18364
|
*/
|
|
18330
|
-
|
|
18365
|
+
class SpotterAgentEmbed {
|
|
18331
18366
|
constructor(viewConfig) {
|
|
18332
18367
|
this.viewConfig = viewConfig;
|
|
18333
18368
|
const embedConfig = getEmbedConfig();
|
|
@@ -18339,10 +18374,7 @@ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
|
18339
18374
|
return { error };
|
|
18340
18375
|
}
|
|
18341
18376
|
const container = document.createElement('div');
|
|
18342
|
-
|
|
18343
|
-
container.className = this.viewConfig.containerClassName;
|
|
18344
|
-
}
|
|
18345
|
-
const embed = new ConversationMessage(container, {
|
|
18377
|
+
const embed = new ConversationMessage$1(container, {
|
|
18346
18378
|
...this.viewConfig,
|
|
18347
18379
|
sessionId: data.sessionId,
|
|
18348
18380
|
genNo: data.genNo,
|
|
@@ -18352,7 +18384,29 @@ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
|
18352
18384
|
await embed.render();
|
|
18353
18385
|
return { container, viz: embed };
|
|
18354
18386
|
}
|
|
18355
|
-
|
|
18387
|
+
/**
|
|
18388
|
+
* Send a message to the conversation service and return only the data.
|
|
18389
|
+
* @param userMessage - The message to send to the conversation service.
|
|
18390
|
+
* @returns The data from the conversation service.
|
|
18391
|
+
*/
|
|
18392
|
+
async sendMessageData(userMessage) {
|
|
18393
|
+
try {
|
|
18394
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18395
|
+
if (error) {
|
|
18396
|
+
return { error };
|
|
18397
|
+
}
|
|
18398
|
+
return { data: {
|
|
18399
|
+
sessionId: data.sessionId,
|
|
18400
|
+
genNo: data.genNo,
|
|
18401
|
+
acSessionId: data.stateKey.transactionId,
|
|
18402
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18403
|
+
} };
|
|
18404
|
+
}
|
|
18405
|
+
catch (error) {
|
|
18406
|
+
return { error: error };
|
|
18407
|
+
}
|
|
18408
|
+
}
|
|
18409
|
+
}
|
|
18356
18410
|
|
|
18357
18411
|
/**
|
|
18358
18412
|
*
|
|
@@ -18727,55 +18781,34 @@ const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
|
18727
18781
|
* ```
|
|
18728
18782
|
*/
|
|
18729
18783
|
const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
18784
|
+
const ConversationMessage = componentFactory(ConversationMessage$1);
|
|
18730
18785
|
/**
|
|
18731
|
-
* React component for
|
|
18732
|
-
*
|
|
18786
|
+
* React component for displaying individual conversation messages from SpotterAgent.
|
|
18787
|
+
*
|
|
18788
|
+
* This component renders a single message response from your ThoughtSpot conversation,
|
|
18789
|
+
* showing charts, visualizations, or text responses based on the user's query.
|
|
18790
|
+
*
|
|
18733
18791
|
* @example
|
|
18734
18792
|
* ```tsx
|
|
18735
|
-
*
|
|
18736
|
-
*
|
|
18793
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
18794
|
+
* const result = await sendMessage('show me sales by region');
|
|
18737
18795
|
*
|
|
18738
|
-
*
|
|
18739
|
-
*
|
|
18740
|
-
*
|
|
18741
|
-
* document.body.appendChild(container);
|
|
18742
|
-
* }
|
|
18743
|
-
* };
|
|
18796
|
+
* if (!result.error) {
|
|
18797
|
+
* // Simple usage - just pass the message data
|
|
18798
|
+
* <SpotterMessage message={result.message} />
|
|
18744
18799
|
*
|
|
18745
|
-
*
|
|
18746
|
-
*
|
|
18747
|
-
*
|
|
18748
|
-
*
|
|
18749
|
-
*
|
|
18750
|
-
* );
|
|
18800
|
+
* // With optional query for context
|
|
18801
|
+
* <SpotterMessage
|
|
18802
|
+
* message={result.message}
|
|
18803
|
+
* query={result.query}
|
|
18804
|
+
* />
|
|
18751
18805
|
* }
|
|
18752
18806
|
* ```
|
|
18807
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
18753
18808
|
*/
|
|
18754
|
-
const
|
|
18755
|
-
const {
|
|
18756
|
-
|
|
18757
|
-
useDeepCompareEffect(() => {
|
|
18758
|
-
if (serviceRef.current) {
|
|
18759
|
-
serviceRef.current = null;
|
|
18760
|
-
}
|
|
18761
|
-
const configProps = {
|
|
18762
|
-
...restProps,
|
|
18763
|
-
...(className ? { containerClassName: className } : {})
|
|
18764
|
-
};
|
|
18765
|
-
serviceRef.current = new SpotterAgentEmbed$1(configProps);
|
|
18766
|
-
if (ref) {
|
|
18767
|
-
if (typeof ref === 'function') {
|
|
18768
|
-
ref(serviceRef.current);
|
|
18769
|
-
}
|
|
18770
|
-
else {
|
|
18771
|
-
ref.current = serviceRef.current;
|
|
18772
|
-
}
|
|
18773
|
-
}
|
|
18774
|
-
return () => {
|
|
18775
|
-
serviceRef.current = null;
|
|
18776
|
-
};
|
|
18777
|
-
}, [props]);
|
|
18778
|
-
return null;
|
|
18809
|
+
const SpotterMessage = React__default.forwardRef((props, ref) => {
|
|
18810
|
+
const { message, query: _, ...otherProps } = props;
|
|
18811
|
+
return (React__default.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
|
|
18779
18812
|
});
|
|
18780
18813
|
/**
|
|
18781
18814
|
* React component for PreRendered Conversation embed.
|
|
@@ -18835,6 +18868,62 @@ function useInit(config) {
|
|
|
18835
18868
|
ref.current = authEE;
|
|
18836
18869
|
}, [config]);
|
|
18837
18870
|
return ref;
|
|
18871
|
+
}
|
|
18872
|
+
/**
|
|
18873
|
+
* React hook for interacting with SpotterAgent AI conversations.
|
|
18874
|
+
*
|
|
18875
|
+
* This hook provides a sendMessage function that allows you to send natural language
|
|
18876
|
+
* queries to your data and get back AI-generated responses with visualizations.
|
|
18877
|
+
*
|
|
18878
|
+
* @param config - Configuration object containing worksheetId and other options
|
|
18879
|
+
* @returns Object with sendMessage function that returns conversation results
|
|
18880
|
+
* @example
|
|
18881
|
+
* ```tsx
|
|
18882
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
18883
|
+
*
|
|
18884
|
+
* const handleQuery = async () => {
|
|
18885
|
+
* const result = await sendMessage('show me sales by region');
|
|
18886
|
+
*
|
|
18887
|
+
* if (!result.error) {
|
|
18888
|
+
* // Display the message response
|
|
18889
|
+
* <SpotterMessage message={result.message} />
|
|
18890
|
+
* } else {
|
|
18891
|
+
* console.error('Error:', result.error);
|
|
18892
|
+
* }
|
|
18893
|
+
* };
|
|
18894
|
+
* ```
|
|
18895
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
18896
|
+
*/
|
|
18897
|
+
function useSpotterAgent(config) {
|
|
18898
|
+
const serviceRef = useRef(null);
|
|
18899
|
+
useDeepCompareEffect(() => {
|
|
18900
|
+
if (serviceRef.current) {
|
|
18901
|
+
serviceRef.current = null;
|
|
18902
|
+
}
|
|
18903
|
+
serviceRef.current = new SpotterAgentEmbed(config);
|
|
18904
|
+
return () => {
|
|
18905
|
+
serviceRef.current = null;
|
|
18906
|
+
};
|
|
18907
|
+
}, [config]);
|
|
18908
|
+
const sendMessage = useCallback(async (query) => {
|
|
18909
|
+
if (!serviceRef.current) {
|
|
18910
|
+
return { error: new Error(ERROR_MESSAGE.SPOTTER_AGENT_NOT_INITIALIZED) };
|
|
18911
|
+
}
|
|
18912
|
+
const result = await serviceRef.current.sendMessageData(query);
|
|
18913
|
+
if (result.error) {
|
|
18914
|
+
return { error: result.error };
|
|
18915
|
+
}
|
|
18916
|
+
return {
|
|
18917
|
+
query: query,
|
|
18918
|
+
message: {
|
|
18919
|
+
...result.data,
|
|
18920
|
+
worksheetId: config.worksheetId,
|
|
18921
|
+
},
|
|
18922
|
+
};
|
|
18923
|
+
}, [config.worksheetId]);
|
|
18924
|
+
return {
|
|
18925
|
+
sendMessage,
|
|
18926
|
+
};
|
|
18838
18927
|
}
|
|
18839
18928
|
|
|
18840
|
-
export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed,
|
|
18929
|
+
export { Action, AppEmbed, ConversationEmbed, ConversationMessage, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterEmbed, SpotterMessage, getSessionInfo, useEmbedRef, useInit, useSpotterAgent };
|