@thoughtspot/visual-embed-sdk 1.37.1-spotter-embed → 1.38.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cjs/package.json +2 -2
- package/cjs/src/embed/app.d.ts +43 -3
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +40 -7
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +23 -6
- 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 +7 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +8 -3
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +5 -2
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +286 -1
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +5 -3
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +3 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +21 -10
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +6 -4
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +105 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/index.d.ts +4 -4
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +5 -3
- package/cjs/src/index.js.map +1 -1
- 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 +2 -1
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +32 -3
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +54 -2
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +94 -0
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +25 -51
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +24 -50
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-Cj4BVGHL.js → index-DeFzsyFF.js} +1 -1
- package/dist/{index-DnIvX1FR.js → index-NZYq1Tu3.js} +1 -2
- package/dist/src/embed/app.d.ts +43 -3
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +8 -3
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +5 -3
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.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 +32 -3
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +25 -51
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +614 -77
- package/dist/tsembed-react.js +758 -296
- package/dist/tsembed.es.js +153 -75
- package/dist/tsembed.js +297 -295
- package/dist/visual-embed-sdk-react-full.d.ts +194 -145
- package/dist/visual-embed-sdk-react.d.ts +194 -145
- package/dist/visual-embed-sdk.d.ts +82 -61
- package/lib/package.json +2 -2
- package/lib/src/embed/app.d.ts +43 -3
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +39 -6
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +24 -7
- 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 +7 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +8 -3
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +5 -2
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +287 -2
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +5 -3
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +3 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +21 -10
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +6 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +105 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/index.d.ts +4 -4
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +4 -4
- package/lib/src/index.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 +32 -3
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +53 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +96 -2
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +25 -51
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +24 -50
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +85 -64
- package/package.json +2 -2
- package/src/embed/app.spec.ts +30 -6
- package/src/embed/app.ts +62 -9
- package/src/embed/base.ts +9 -0
- package/src/embed/bodyless-conversation.spec.ts +308 -1
- package/src/embed/bodyless-conversation.ts +13 -3
- package/src/embed/conversation.ts +5 -3
- package/src/embed/liveboard.ts +25 -10
- package/src/embed/ts-embed.spec.ts +130 -0
- package/src/embed/ts-embed.ts +6 -4
- package/src/index.ts +10 -3
- package/src/react/all-types-export.ts +1 -0
- package/src/react/index.spec.tsx +157 -1
- package/src/react/index.tsx +64 -3
- package/src/types.ts +24 -56
- package/cjs/src/pages/embed-test.page.d.ts +0 -8
- package/cjs/src/pages/embed-test.page.d.ts.map +0 -1
- package/cjs/src/pages/embed-test.page.js +0 -20
- package/cjs/src/pages/embed-test.page.js.map +0 -1
- package/cjs/src/pages/home.page.d.ts +0 -6
- package/cjs/src/pages/home.page.d.ts.map +0 -1
- package/cjs/src/pages/home.page.js +0 -12
- package/cjs/src/pages/home.page.js.map +0 -1
- package/cjs/src/pages/login.page.d.ts +0 -15
- package/cjs/src/pages/login.page.d.ts.map +0 -1
- package/cjs/src/pages/login.page.js +0 -22
- package/cjs/src/pages/login.page.js.map +0 -1
- package/cjs/src/tests/auth.test.d.ts +0 -1
- package/cjs/src/tests/auth.test.d.ts.map +0 -1
- package/cjs/src/tests/auth.test.js +0 -1
- package/cjs/src/tests/auth.test.js.map +0 -1
- package/cjs/src/tests/e2e/auth.spec.d.ts +0 -2
- package/cjs/src/tests/e2e/auth.spec.d.ts.map +0 -1
- package/cjs/src/tests/e2e/auth.spec.js +0 -54
- package/cjs/src/tests/e2e/auth.spec.js.map +0 -1
- package/dist/index-DUaG1OG2.js +0 -7447
- package/dist/index-Fhk1V_Gw.js +0 -7371
- package/dist/index-OuiZF3zE.js +0 -7371
|
@@ -11,13 +11,13 @@ declare module '@thoughtspot/visual-embed-sdk' {
|
|
|
11
11
|
* @summary ThoughtSpot Visual Embed SDK
|
|
12
12
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
13
13
|
*/
|
|
14
|
-
import { AppEmbed, Page, AppViewConfig, HomePageSearchBarMode } from '@thoughtspot/visual-embed-sdk/embed/app';
|
|
14
|
+
import { AppEmbed, Page, AppViewConfig, HomePageSearchBarMode, PrimaryNavbarVersion, HomePage } from '@thoughtspot/visual-embed-sdk/embed/app';
|
|
15
15
|
import { init, prefetch, logout, executeTML, exportTML, executeTMLInput, exportTMLInput } from '@thoughtspot/visual-embed-sdk/embed/base';
|
|
16
16
|
import { PinboardEmbed, LiveboardViewConfig, LiveboardEmbed } from '@thoughtspot/visual-embed-sdk/embed/liveboard';
|
|
17
17
|
import { SearchEmbed, SearchViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search';
|
|
18
18
|
import { SearchBarEmbed, SearchBarViewConfig } from '@thoughtspot/visual-embed-sdk/embed/search-bar';
|
|
19
|
-
import { SpotterAgentEmbed, SpotterAgentEmbedViewConfig,
|
|
20
|
-
import { SpotterEmbed, SpotterEmbedViewConfig,
|
|
19
|
+
import { SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversation, BodylessConversationViewConfig } from '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation';
|
|
20
|
+
import { SpotterEmbed, SpotterEmbedViewConfig, ConversationEmbed, ConversationViewConfig } from '@thoughtspot/visual-embed-sdk/embed/conversation';
|
|
21
21
|
import { AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter } from '@thoughtspot/visual-embed-sdk/auth';
|
|
22
22
|
import { getSessionInfo } from '@thoughtspot/visual-embed-sdk/utils/sessionInfoService';
|
|
23
23
|
import { AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, EmbedConfig, PrefetchFeatures, FrameParams, DOMSelector, HomeLeftNavItem, HomepageModule, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, ContextMenuTriggerOptions, RuntimeParameter, LogLevel, VizPoint, CustomActionPayload, ListPageColumns } from '@thoughtspot/visual-embed-sdk/types';
|
|
@@ -30,7 +30,7 @@ declare module '@thoughtspot/visual-embed-sdk' {
|
|
|
30
30
|
import { getAnswerFromQuery } from '@thoughtspot/visual-embed-sdk/utils/graphql/nlsService/nls-answer-service';
|
|
31
31
|
import { createLiveboardWithAnswers } from '@thoughtspot/visual-embed-sdk/utils/liveboardService/liveboardService';
|
|
32
32
|
import { UIPassthroughEvent } from '@thoughtspot/visual-embed-sdk/embed/hostEventClient/contracts';
|
|
33
|
-
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversationViewConfig, BodylessConversation, SpotterEmbed, SpotterEmbedViewConfig, ConversationViewConfig, ConversationEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, };
|
|
33
|
+
export { init, logout, prefetch, executeTML, exportTML, executeTMLInput, exportTMLInput, getEmbedConfig as getInitConfig, getSessionInfo, tokenizedFetch, getAnswerFromQuery, createLiveboardWithAnswers, SearchEmbed, SearchBarEmbed, PinboardEmbed, LiveboardEmbed, SageEmbed, AppEmbed, SpotterAgentEmbed, SpotterAgentEmbedViewConfig, BodylessConversationViewConfig, BodylessConversation, SpotterEmbed, SpotterEmbedViewConfig, ConversationViewConfig, ConversationEmbed, AuthFailureType, AuthStatus, AuthEvent, AuthEventEmitter, AnswerService, SessionInterface, UnderlyingDataPoint, Page, AuthType, RuntimeFilter, RuntimeFilterOp, EmbedEvent, HostEvent, DataSourceVisualMode, Action, ContextMenuTriggerOptions, EmbedConfig, SearchViewConfig, SearchBarViewConfig, LiveboardViewConfig, SageViewConfig, AppViewConfig, PrefetchFeatures, FrameParams, HomeLeftNavItem, HomepageModule, DOMSelector, MessageOptions, MessageCallback, MessagePayload, CustomisationsInterface, CustomStyles, customCssInterface, CustomCssVariables, RuntimeParameter, LogLevel, uploadMixpanelEvent, MIXPANEL_EVENT, HomePageSearchBarMode, PrimaryNavbarVersion, HomePage, VizPoint, CustomActionPayload, UIPassthroughEvent, ListPageColumns, };
|
|
34
34
|
export { resetCachedAuthToken } from '@thoughtspot/visual-embed-sdk/authToken';
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -106,6 +106,43 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
106
106
|
AI_ANSWER = "aiAnswer",
|
|
107
107
|
NONE = "none"
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Define the version of the primary navbar
|
|
111
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
112
|
+
*/
|
|
113
|
+
export enum PrimaryNavbarVersion {
|
|
114
|
+
/**
|
|
115
|
+
* Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
|
|
116
|
+
* along with updates to the top navigation bar.
|
|
117
|
+
* It serves as the foundational version of the PrimaryNavBar.
|
|
118
|
+
*/
|
|
119
|
+
Sliding = "v3"
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Define the version of the home page
|
|
123
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
124
|
+
*/
|
|
125
|
+
export enum HomePage {
|
|
126
|
+
/**
|
|
127
|
+
* Modular (v2) introduces the updated Modular Home Experience.
|
|
128
|
+
* It serves as the foundational version of the home page.
|
|
129
|
+
*/
|
|
130
|
+
Modular = "v2"
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Define the discovery experience
|
|
134
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
135
|
+
*/
|
|
136
|
+
export interface DiscoveryExperience {
|
|
137
|
+
/**
|
|
138
|
+
* primaryNavbarVersion determines the version of the navigation version.
|
|
139
|
+
*/
|
|
140
|
+
primaryNavbarVersion?: PrimaryNavbarVersion;
|
|
141
|
+
/**
|
|
142
|
+
* homePage determines the version of the home page.
|
|
143
|
+
*/
|
|
144
|
+
homePage?: HomePage;
|
|
145
|
+
}
|
|
109
146
|
/**
|
|
110
147
|
* The view configuration for full app embedding.
|
|
111
148
|
* @group Embed components
|
|
@@ -413,7 +450,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
413
450
|
*/
|
|
414
451
|
modularHomeExperience?: boolean;
|
|
415
452
|
/**
|
|
416
|
-
*
|
|
453
|
+
* To configure the top-left navigation and home page experience
|
|
417
454
|
*
|
|
418
455
|
* @default false
|
|
419
456
|
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
@@ -421,11 +458,14 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
421
458
|
* ```js
|
|
422
459
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
423
460
|
* ... // other options
|
|
424
|
-
*
|
|
461
|
+
* discoveryExperience : {
|
|
462
|
+
* primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
463
|
+
* homePage: HompePage.Modular,
|
|
464
|
+
* },
|
|
425
465
|
* })
|
|
426
466
|
* ```
|
|
427
467
|
*/
|
|
428
|
-
|
|
468
|
+
discoveryExperience?: DiscoveryExperience;
|
|
429
469
|
/**
|
|
430
470
|
* Boolean to control if Liveboard header is sticky or not.
|
|
431
471
|
* @example
|
|
@@ -1616,10 +1656,15 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
|
|
|
1616
1656
|
* The ID of the worksheet to use for the conversation.
|
|
1617
1657
|
*/
|
|
1618
1658
|
worksheetId: string;
|
|
1659
|
+
/**
|
|
1660
|
+
* Optional CSS class name to add to the container div.
|
|
1661
|
+
*/
|
|
1662
|
+
containerClassName?: string;
|
|
1619
1663
|
}
|
|
1620
1664
|
/**
|
|
1621
1665
|
* Configuration for conversation options.
|
|
1622
|
-
* @deprecated
|
|
1666
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
1667
|
+
* Use {@link SpotterAgentEmbedViewConfig} instead
|
|
1623
1668
|
* @group Embed components
|
|
1624
1669
|
*/
|
|
1625
1670
|
export interface BodylessConversationViewConfig extends SpotterAgentEmbedViewConfig {
|
|
@@ -1670,7 +1715,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
|
|
|
1670
1715
|
/**
|
|
1671
1716
|
* Create a conversation embed, which can be integrated inside
|
|
1672
1717
|
* chatbots or other conversational interfaces.
|
|
1673
|
-
* @deprecated
|
|
1718
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
1719
|
+
* Use {@link SpotterAgentEmbed} instead
|
|
1674
1720
|
* @example
|
|
1675
1721
|
* ```js
|
|
1676
1722
|
* import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
|
|
@@ -1685,7 +1731,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/bodyless-conversation' {
|
|
|
1685
1731
|
* document.body.appendChild(container); // or to any other element
|
|
1686
1732
|
* ```
|
|
1687
1733
|
* @group Embed components
|
|
1688
|
-
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
1689
1734
|
*/
|
|
1690
1735
|
export class BodylessConversation extends SpotterAgentEmbed {
|
|
1691
1736
|
constructor(viewConfig: BodylessConversationViewConfig);
|
|
@@ -1786,7 +1831,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
|
|
|
1786
1831
|
}
|
|
1787
1832
|
/**
|
|
1788
1833
|
* The configuration for the embedded spotterEmbed options.
|
|
1789
|
-
* @deprecated
|
|
1834
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
1835
|
+
* Use {@link SpotterEmbedViewConfig} instead
|
|
1790
1836
|
* @group Embed components
|
|
1791
1837
|
*/
|
|
1792
1838
|
export interface ConversationViewConfig extends SpotterEmbedViewConfig {
|
|
@@ -1804,7 +1850,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
|
|
|
1804
1850
|
* });
|
|
1805
1851
|
* conversation.render();
|
|
1806
1852
|
* ```
|
|
1807
|
-
* @version SDK: 1.
|
|
1853
|
+
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
1808
1854
|
*/
|
|
1809
1855
|
export class SpotterEmbed extends TsEmbed {
|
|
1810
1856
|
protected viewConfig: SpotterEmbedViewConfig;
|
|
@@ -1814,7 +1860,8 @@ declare module '@thoughtspot/visual-embed-sdk/embed/conversation' {
|
|
|
1814
1860
|
}
|
|
1815
1861
|
/**
|
|
1816
1862
|
* Embed ThoughtSpot AI Conversation.
|
|
1817
|
-
* @deprecated
|
|
1863
|
+
* @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
|
|
1864
|
+
* Use {@link SpotterEmbed} instead
|
|
1818
1865
|
* @group Embed components
|
|
1819
1866
|
* @example
|
|
1820
1867
|
* ```js
|
|
@@ -4752,9 +4799,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4752
4799
|
* @example
|
|
4753
4800
|
* ```js
|
|
4754
4801
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
4755
|
-
* { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
|
|
4802
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
|
|
4803
|
+
* ```
|
|
4804
|
+
* @example
|
|
4805
|
+
* ```js
|
|
4756
4806
|
* LiveboardEmbed.trigger(HostEvent.OpenFilter,
|
|
4757
|
-
*
|
|
4807
|
+
* { column: {columnId: '<column-GUID>'}})
|
|
4758
4808
|
* ```
|
|
4759
4809
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
|
|
4760
4810
|
*/
|
|
@@ -5363,6 +5413,25 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
5363
5413
|
* }]
|
|
5364
5414
|
* });
|
|
5365
5415
|
* ```
|
|
5416
|
+
* If there are multiple columns with the same name, consider
|
|
5417
|
+
* using `WORKSHEET_NAME::COLUMN_NAME` format.
|
|
5418
|
+
*
|
|
5419
|
+
* @example
|
|
5420
|
+
*
|
|
5421
|
+
* ```js
|
|
5422
|
+
* liveboardEmbed.trigger(HostEvent.UpdateFilters, {
|
|
5423
|
+
* filters: [{
|
|
5424
|
+
* column: "(Sample) Retail - Apparel::city",
|
|
5425
|
+
* oper: 'IN',
|
|
5426
|
+
* values: ["atlanta"]
|
|
5427
|
+
* },
|
|
5428
|
+
* {
|
|
5429
|
+
* column: "(Sample) Retail - Apparel::Region",
|
|
5430
|
+
* oper: 'IN',
|
|
5431
|
+
* values: ["West","Midwest"]
|
|
5432
|
+
* }]
|
|
5433
|
+
* });
|
|
5434
|
+
* ```
|
|
5366
5435
|
* @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
|
|
5367
5436
|
*/
|
|
5368
5437
|
UpdateFilters = "updateFilters",
|
|
@@ -5571,55 +5640,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
5571
5640
|
* ```
|
|
5572
5641
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
5573
5642
|
*/
|
|
5574
|
-
TransformTableVizData = "TransformTableVizData"
|
|
5575
|
-
/**
|
|
5576
|
-
* Triggers the table visualization re-render with the updated data.
|
|
5577
|
-
* Includes the following properties:
|
|
5578
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
5579
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
5580
|
-
* payload.For example, { columnDataLite: []}`.
|
|
5581
|
-
*/
|
|
5582
|
-
SpotterSearch = "SpotterSearch",
|
|
5583
|
-
/**
|
|
5584
|
-
* Triggers the table visualization re-render with the updated data.
|
|
5585
|
-
* Includes the following properties:
|
|
5586
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
5587
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
5588
|
-
* payload.For example, { columnDataLite: []}`.
|
|
5589
|
-
*/
|
|
5590
|
-
EditLastPrompt = "EditLastPrompt",
|
|
5591
|
-
/**
|
|
5592
|
-
* Triggers the table visualization re-render with the updated data.
|
|
5593
|
-
* Includes the following properties:
|
|
5594
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
5595
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
5596
|
-
* payload.For example, { columnDataLite: []}`.
|
|
5597
|
-
*/
|
|
5598
|
-
PreviewSpotterData = "PreviewSpotterData",
|
|
5599
|
-
/**
|
|
5600
|
-
* Triggers the table visualization re-render with the updated data.
|
|
5601
|
-
* Includes the following properties:
|
|
5602
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
5603
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
5604
|
-
* payload.For example, { columnDataLite: []}`.
|
|
5605
|
-
*/
|
|
5606
|
-
ResetSpotterConversation = "ResetSpotterConversation",
|
|
5607
|
-
/**
|
|
5608
|
-
* Triggers the table visualization re-render with the updated data.
|
|
5609
|
-
* Includes the following properties:
|
|
5610
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
5611
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
5612
|
-
* payload.For example, { columnDataLite: []}`.
|
|
5613
|
-
*/
|
|
5614
|
-
DeleteLastPrompt = "DeleteLastPrompt",
|
|
5615
|
-
/**
|
|
5616
|
-
* Triggers the table visualization re-render with the updated data.
|
|
5617
|
-
* Includes the following properties:
|
|
5618
|
-
* @param - `columnDataLite` - an array of object containing the
|
|
5619
|
-
* data value modifications retrieved from the `EmbedEvent.TableVizRendered`
|
|
5620
|
-
* payload.For example, { columnDataLite: []}`.
|
|
5621
|
-
*/
|
|
5622
|
-
AnswerChartSwitcher = "answerChartSwitcher"
|
|
5643
|
+
TransformTableVizData = "TransformTableVizData"
|
|
5623
5644
|
}
|
|
5624
5645
|
/**
|
|
5625
5646
|
* The different visual modes that the data sources panel within
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thoughtspot/visual-embed-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0-alpha.1",
|
|
4
4
|
"description": "ThoughtSpot Embed SDK",
|
|
5
5
|
"module": "lib/src/index.js",
|
|
6
6
|
"main": "dist/tsembed.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"test": "npm run test-sdk",
|
|
58
58
|
"posttest": "cat ./coverage/sdk/lcov.info | coveralls",
|
|
59
59
|
"is-publish-allowed": "node scripts/is-publish-allowed.js",
|
|
60
|
-
"prepublishOnly": "npm run is-publish-allowed && 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",
|
|
60
|
+
"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",
|
|
61
61
|
"check-size": "npm run build && size-limit",
|
|
62
62
|
"publish-dev": "npm publish --tag dev",
|
|
63
63
|
"publish-prod": "npm publish --tag latest",
|
package/src/embed/app.spec.ts
CHANGED
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
DataPanelCustomColumnGroupsAccordionState,
|
|
5
5
|
Page,
|
|
6
6
|
HomePageSearchBarMode,
|
|
7
|
+
PrimaryNavbarVersion,
|
|
8
|
+
HomePage,
|
|
7
9
|
} from './app';
|
|
8
10
|
import { init } from '../index';
|
|
9
11
|
import {
|
|
@@ -528,32 +530,54 @@ describe('App embed tests', () => {
|
|
|
528
530
|
});
|
|
529
531
|
});
|
|
530
532
|
|
|
531
|
-
test('Should add navigationVersion=v3 when
|
|
533
|
+
test('Should add navigationVersion=v3 when primaryNavbarVersion is Sliding to the iframe src', async () => {
|
|
532
534
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
533
535
|
...defaultViewConfig,
|
|
534
|
-
|
|
536
|
+
discoveryExperience: {
|
|
537
|
+
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
538
|
+
homePage: HomePage.Modular,
|
|
539
|
+
},
|
|
535
540
|
} as AppViewConfig);
|
|
536
541
|
|
|
537
542
|
appEmbed.render();
|
|
538
543
|
await executeAfterWait(() => {
|
|
539
544
|
expectUrlMatchesWithParams(
|
|
540
545
|
getIFrameSrc(),
|
|
541
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=
|
|
546
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
542
547
|
);
|
|
543
548
|
});
|
|
544
549
|
});
|
|
545
550
|
|
|
546
|
-
test('Should not add navigationVersion when
|
|
551
|
+
test('Should not add navigationVersion=v3 when primaryNavbarVersion is not added to the iframe src', async () => {
|
|
547
552
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
548
553
|
...defaultViewConfig,
|
|
549
|
-
|
|
554
|
+
discoveryExperience: {
|
|
555
|
+
homePage: HomePage.Modular,
|
|
556
|
+
},
|
|
550
557
|
} as AppViewConfig);
|
|
551
558
|
|
|
552
559
|
appEmbed.render();
|
|
553
560
|
await executeAfterWait(() => {
|
|
554
561
|
expectUrlMatchesWithParams(
|
|
555
562
|
getIFrameSrc(),
|
|
556
|
-
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=
|
|
563
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=true${defaultParams}${defaultParamsPost}#/home`,
|
|
564
|
+
);
|
|
565
|
+
});
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
test('Should add navigationVersion=v3 & modularHomeExperience=false when primaryNavbarVersion is Sliding to the iframe src', async () => {
|
|
569
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
570
|
+
...defaultViewConfig,
|
|
571
|
+
discoveryExperience: {
|
|
572
|
+
primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
573
|
+
},
|
|
574
|
+
} as AppViewConfig);
|
|
575
|
+
|
|
576
|
+
appEmbed.render();
|
|
577
|
+
await executeAfterWait(() => {
|
|
578
|
+
expectUrlMatchesWithParams(
|
|
579
|
+
getIFrameSrc(),
|
|
580
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v3${defaultParams}${defaultParamsPost}#/home`,
|
|
557
581
|
);
|
|
558
582
|
});
|
|
559
583
|
});
|
package/src/embed/app.ts
CHANGED
|
@@ -83,6 +83,47 @@ export enum HomePageSearchBarMode {
|
|
|
83
83
|
AI_ANSWER = 'aiAnswer',
|
|
84
84
|
NONE = 'none'
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Define the version of the primary navbar
|
|
89
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
90
|
+
*/
|
|
91
|
+
export enum PrimaryNavbarVersion {
|
|
92
|
+
/**
|
|
93
|
+
* Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
|
|
94
|
+
* along with updates to the top navigation bar.
|
|
95
|
+
* It serves as the foundational version of the PrimaryNavBar.
|
|
96
|
+
*/
|
|
97
|
+
Sliding = 'v3',
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Define the version of the home page
|
|
102
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
103
|
+
*/
|
|
104
|
+
export enum HomePage {
|
|
105
|
+
/**
|
|
106
|
+
* Modular (v2) introduces the updated Modular Home Experience.
|
|
107
|
+
* It serves as the foundational version of the home page.
|
|
108
|
+
*/
|
|
109
|
+
Modular = 'v2',
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Define the discovery experience
|
|
114
|
+
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
115
|
+
*/
|
|
116
|
+
export interface DiscoveryExperience {
|
|
117
|
+
/**
|
|
118
|
+
* primaryNavbarVersion determines the version of the navigation version.
|
|
119
|
+
*/
|
|
120
|
+
primaryNavbarVersion?: PrimaryNavbarVersion;
|
|
121
|
+
/**
|
|
122
|
+
* homePage determines the version of the home page.
|
|
123
|
+
*/
|
|
124
|
+
homePage?: HomePage;
|
|
125
|
+
}
|
|
126
|
+
|
|
86
127
|
/**
|
|
87
128
|
* The view configuration for full app embedding.
|
|
88
129
|
* @group Embed components
|
|
@@ -390,7 +431,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
390
431
|
*/
|
|
391
432
|
modularHomeExperience?: boolean;
|
|
392
433
|
/**
|
|
393
|
-
*
|
|
434
|
+
* To configure the top-left navigation and home page experience
|
|
394
435
|
*
|
|
395
436
|
* @default false
|
|
396
437
|
* @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
|
|
@@ -398,11 +439,14 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
398
439
|
* ```js
|
|
399
440
|
* const embed = new AppEmbed('#tsEmbed', {
|
|
400
441
|
* ... // other options
|
|
401
|
-
*
|
|
442
|
+
* discoveryExperience : {
|
|
443
|
+
* primaryNavbarVersion: PrimaryNavbarVersion.Sliding,
|
|
444
|
+
* homePage: HompePage.Modular,
|
|
445
|
+
* },
|
|
402
446
|
* })
|
|
403
447
|
* ```
|
|
404
448
|
*/
|
|
405
|
-
|
|
449
|
+
discoveryExperience?: DiscoveryExperience;
|
|
406
450
|
/**
|
|
407
451
|
* Boolean to control if Liveboard header is sticky or not.
|
|
408
452
|
* @example
|
|
@@ -587,7 +631,6 @@ export class AppEmbed extends V1Embed {
|
|
|
587
631
|
showLiveboardDescription = true,
|
|
588
632
|
hideHomepageLeftNav = false,
|
|
589
633
|
modularHomeExperience = false,
|
|
590
|
-
modularHomeExperienceV3 = false,
|
|
591
634
|
isLiveboardHeaderSticky = true,
|
|
592
635
|
enableAskSage,
|
|
593
636
|
collapseSearchBarInitially = false,
|
|
@@ -604,6 +647,7 @@ export class AppEmbed extends V1Embed {
|
|
|
604
647
|
homePageSearchBarMode,
|
|
605
648
|
isUnifiedSearchExperienceEnabled = true,
|
|
606
649
|
enablePendoHelp = true,
|
|
650
|
+
discoveryExperience,
|
|
607
651
|
} = this.viewConfig;
|
|
608
652
|
|
|
609
653
|
let params = {};
|
|
@@ -624,10 +668,6 @@ export class AppEmbed extends V1Embed {
|
|
|
624
668
|
|
|
625
669
|
params = this.getBaseQueryParams(params);
|
|
626
670
|
|
|
627
|
-
if (modularHomeExperienceV3) {
|
|
628
|
-
params[Param.NavigationVersion] = 'v3';
|
|
629
|
-
}
|
|
630
|
-
|
|
631
671
|
if (hideObjectSearch) {
|
|
632
672
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
633
673
|
}
|
|
@@ -700,6 +740,19 @@ export class AppEmbed extends V1Embed {
|
|
|
700
740
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
701
741
|
}
|
|
702
742
|
|
|
743
|
+
if (discoveryExperience) {
|
|
744
|
+
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
745
|
+
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
746
|
+
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
// homePage v2 will enable the modular home page
|
|
750
|
+
// and it will override the modularHomeExperience value
|
|
751
|
+
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
752
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
703
756
|
const queryParams = getQueryParamString(params, true);
|
|
704
757
|
|
|
705
758
|
return queryParams;
|
|
@@ -735,7 +788,7 @@ export class AppEmbed extends V1Embed {
|
|
|
735
788
|
};
|
|
736
789
|
|
|
737
790
|
private setIframeHeightForNonEmbedLiveboard = (data: MessagePayload) => {
|
|
738
|
-
const { height: frameHeight
|
|
791
|
+
const { height: frameHeight } = this.viewConfig.frameParams || {};
|
|
739
792
|
|
|
740
793
|
const liveboardRelatedRoutes = [
|
|
741
794
|
'/pinboard/',
|
package/src/embed/base.ts
CHANGED
|
@@ -137,6 +137,15 @@ export const prefetch = (
|
|
|
137
137
|
iFrame.style.width = '0';
|
|
138
138
|
iFrame.style.height = '0';
|
|
139
139
|
iFrame.style.border = '0';
|
|
140
|
+
|
|
141
|
+
// Make it 'fixed' to keep it in a different stacking context.
|
|
142
|
+
// This should solve the focus behaviours inside the iframe from
|
|
143
|
+
// interfering with main body.
|
|
144
|
+
iFrame.style.position = 'fixed';
|
|
145
|
+
// Push it out of viewport.
|
|
146
|
+
iFrame.style.top = '100vh';
|
|
147
|
+
iFrame.style.left = '100vw';
|
|
148
|
+
|
|
140
149
|
iFrame.classList.add('prefetchIframe');
|
|
141
150
|
iFrame.classList.add(`prefetchIframeNum-${index}`);
|
|
142
151
|
document.body.appendChild(iFrame);
|