@thoughtspot/visual-embed-sdk 1.45.3-mcp.2 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +2 -2
- package/cjs/src/auth.d.ts +35 -2
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +35 -2
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +5 -5
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +87 -119
- 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.map +1 -1
- package/cjs/src/index.d.ts +2 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +1 -3
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/types.d.ts +55 -54
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +55 -52
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-0serzuii.js → index-BQvLEoxp.js} +1 -1
- package/dist/src/auth.d.ts +35 -2
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +55 -54
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +98 -62
- package/dist/tsembed-react.js +97 -61
- package/dist/tsembed.es.js +99 -126
- package/dist/tsembed.js +97 -125
- package/dist/visual-embed-sdk-react-full.d.ts +90 -53
- package/dist/visual-embed-sdk-react.d.ts +88 -51
- package/dist/visual-embed-sdk.d.ts +90 -56
- package/lib/package.json +2 -2
- package/lib/src/auth.d.ts +35 -2
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +35 -2
- package/lib/src/auth.js.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +5 -5
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +87 -119
- 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.map +1 -1
- package/lib/src/index.d.ts +2 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +0 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/types.d.ts +55 -54
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +55 -52
- package/lib/src/types.js.map +1 -1
- package/package.json +3 -3
- package/src/auth.ts +35 -2
- package/src/embed/app.spec.ts +171 -211
- package/src/embed/app.ts +15 -10
- package/src/embed/base.ts +0 -1
- package/src/index.ts +0 -3
- package/src/types.ts +55 -54
- package/cjs/src/embed/auto-frame-renderer.d.ts +0 -3
- package/cjs/src/embed/auto-frame-renderer.d.ts.map +0 -1
- package/cjs/src/embed/auto-frame-renderer.js +0 -70
- package/cjs/src/embed/auto-frame-renderer.js.map +0 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
- package/cjs/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js +0 -104
- package/cjs/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
- package/cjs/src/utils/answerService/answerService.d.ts +0 -34
- package/cjs/src/utils/answerService/answerService.d.ts.map +0 -1
- package/cjs/src/utils/answerService/answerService.js +0 -142
- package/cjs/src/utils/answerService/answerService.js.map +0 -1
- package/cjs/src/utils/answerService/answerService.spec.d.ts +0 -1
- package/cjs/src/utils/answerService/answerService.spec.d.ts.map +0 -1
- package/cjs/src/utils/answerService/answerService.spec.js +0 -1
- package/cjs/src/utils/answerService/answerService.spec.js.map +0 -1
- package/cjs/src/utils/answerService/graphql-queries.d.ts +0 -6
- package/cjs/src/utils/answerService/graphql-queries.d.ts.map +0 -1
- package/cjs/src/utils/answerService/graphql-queries.js +0 -123
- package/cjs/src/utils/answerService/graphql-queries.js.map +0 -1
- package/cjs/src/utils/answerService.d.ts +0 -10
- package/cjs/src/utils/answerService.d.ts.map +0 -1
- package/cjs/src/utils/answerService.js +0 -61
- package/cjs/src/utils/answerService.js.map +0 -1
- package/cjs/src/utils/answerService.spec.d.ts +0 -2
- package/cjs/src/utils/answerService.spec.d.ts.map +0 -1
- package/cjs/src/utils/answerService.spec.js +0 -31
- package/cjs/src/utils/answerService.spec.js.map +0 -1
- package/cjs/src/utils/authService.d.ts +0 -37
- package/cjs/src/utils/authService.d.ts.map +0 -1
- package/cjs/src/utils/authService.js +0 -106
- package/cjs/src/utils/authService.js.map +0 -1
- package/cjs/src/utils/authService.spec.d.ts +0 -2
- package/cjs/src/utils/authService.spec.d.ts.map +0 -1
- package/cjs/src/utils/authService.spec.js +0 -72
- package/cjs/src/utils/authService.spec.js.map +0 -1
- package/cjs/src/utils/graphql/answerService/graphql-queries.d.ts +0 -5
- package/cjs/src/utils/graphql/answerService/graphql-queries.d.ts.map +0 -1
- package/cjs/src/utils/graphql/answerService/graphql-queries.js +0 -80
- package/cjs/src/utils/graphql/answerService/graphql-queries.js.map +0 -1
- package/cjs/src/utils/graphql/conversationService/conversation-queries.d.ts +0 -3
- package/cjs/src/utils/graphql/conversationService/conversation-queries.d.ts.map +0 -1
- package/cjs/src/utils/graphql/conversationService/conversation-queries.js +0 -318
- package/cjs/src/utils/graphql/conversationService/conversation-queries.js.map +0 -1
- package/cjs/src/utils/graphql/conversationService/conversation-service.d.ts +0 -12
- package/cjs/src/utils/graphql/conversationService/conversation-service.d.ts.map +0 -1
- package/cjs/src/utils/graphql/conversationService/conversation-service.js +0 -89
- package/cjs/src/utils/graphql/conversationService/conversation-service.js.map +0 -1
- package/cjs/src/utils/graphql/spotterService/conversation-queries.d.ts +0 -3
- package/cjs/src/utils/graphql/spotterService/conversation-queries.d.ts.map +0 -1
- package/cjs/src/utils/graphql/spotterService/conversation-queries.js +0 -318
- package/cjs/src/utils/graphql/spotterService/conversation-queries.js.map +0 -1
- package/cjs/src/utils/graphql/spotterService/conversation-service.d.ts +0 -12
- package/cjs/src/utils/graphql/spotterService/conversation-service.d.ts.map +0 -1
- package/cjs/src/utils/graphql/spotterService/conversation-service.js +0 -89
- package/cjs/src/utils/graphql/spotterService/conversation-service.js.map +0 -1
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.d.ts +0 -2
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.d.ts.map +0 -1
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.js +0 -403
- package/cjs/src/utils/graphql/spotterService/nls-answer-queries.js.map +0 -1
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.d.ts +0 -12
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.d.ts.map +0 -1
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.js +0 -55
- package/cjs/src/utils/graphql/spotterService/nls-answer-service.js.map +0 -1
- package/dist/index-CqrIh3Vj.js +0 -7370
- package/dist/index-aFN9fe8V.js +0 -7371
- package/dist/src/embed/auto-frame-renderer.d.ts +0 -3
- package/dist/src/embed/auto-frame-renderer.d.ts.map +0 -1
- package/lib/src/embed/auto-frame-renderer.d.ts +0 -3
- package/lib/src/embed/auto-frame-renderer.d.ts.map +0 -1
- package/lib/src/embed/auto-frame-renderer.js +0 -66
- package/lib/src/embed/auto-frame-renderer.js.map +0 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts +0 -2
- package/lib/src/embed/searchEmbed-basic-auth.spec.d.ts.map +0 -1
- package/lib/src/embed/searchEmbed-basic-auth.spec.js +0 -101
- package/lib/src/embed/searchEmbed-basic-auth.spec.js.map +0 -1
- package/lib/src/utils/graphql/conversationService/conversation-queries.d.ts +0 -3
- package/lib/src/utils/graphql/conversationService/conversation-queries.d.ts.map +0 -1
- package/lib/src/utils/graphql/conversationService/conversation-queries.js +0 -315
- package/lib/src/utils/graphql/conversationService/conversation-queries.js.map +0 -1
- package/lib/src/utils/graphql/conversationService/conversation-service.d.ts +0 -12
- package/lib/src/utils/graphql/conversationService/conversation-service.d.ts.map +0 -1
- package/lib/src/utils/graphql/conversationService/conversation-service.js +0 -84
- package/lib/src/utils/graphql/conversationService/conversation-service.js.map +0 -1
- package/lib/src/utils/graphql/spotterService/conversation-queries.d.ts +0 -3
- package/lib/src/utils/graphql/spotterService/conversation-queries.d.ts.map +0 -1
- package/lib/src/utils/graphql/spotterService/conversation-queries.js +0 -315
- package/lib/src/utils/graphql/spotterService/conversation-queries.js.map +0 -1
- package/lib/src/utils/graphql/spotterService/conversation-service.d.ts +0 -12
- package/lib/src/utils/graphql/spotterService/conversation-service.d.ts.map +0 -1
- package/lib/src/utils/graphql/spotterService/conversation-service.js +0 -84
- package/lib/src/utils/graphql/spotterService/conversation-service.js.map +0 -1
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.d.ts +0 -2
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.d.ts.map +0 -1
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.js +0 -400
- package/lib/src/utils/graphql/spotterService/nls-answer-queries.js.map +0 -1
- package/lib/src/utils/graphql/spotterService/nls-answer-service.d.ts +0 -12
- package/lib/src/utils/graphql/spotterService/nls-answer-service.d.ts.map +0 -1
- package/lib/src/utils/graphql/spotterService/nls-answer-service.js +0 -50
- package/lib/src/utils/graphql/spotterService/nls-answer-service.js.map +0 -1
- package/lib/src/visual-embed-sdk.d.ts +0 -7186
- package/src/embed/auto-frame-renderer.ts +0 -78
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -1523,65 +1523,69 @@
|
|
|
1523
1523
|
EmbedEvent["Rename"] = "rename";
|
|
1524
1524
|
/**
|
|
1525
1525
|
*
|
|
1526
|
-
* This event
|
|
1527
|
-
*
|
|
1528
|
-
*
|
|
1529
|
-
*
|
|
1530
|
-
|
|
1531
|
-
*
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1526
|
+
* This event allows developers to intercept search execution
|
|
1527
|
+
* and implement logic that decides whether Search Data should return
|
|
1528
|
+
* data or block the search operation.
|
|
1529
|
+
*
|
|
1530
|
+
* **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
1531
|
+
* to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
|
|
1532
|
+
* when the embedding application user tries to run a search query.
|
|
1533
|
+
*
|
|
1534
|
+
* This framework applies only to `AppEmbed` and `SearchEmbed`.
|
|
1535
|
+
* @param - Includes the following parameters:
|
|
1534
1536
|
* - `payload`: The payload received from the embed related to the Data API call.
|
|
1535
1537
|
* - `responder`: Contains elements that let developers define whether ThoughtSpot
|
|
1536
|
-
*
|
|
1537
|
-
* should be shown to the user.
|
|
1538
|
-
*
|
|
1539
|
-
* `execute` - When `execute` returns `true`, the search will be run.
|
|
1540
|
-
* When `execute` returns `false`, the search will not be executed.
|
|
1538
|
+
* will run or block the search operation, and if blocked, which error message to provide.
|
|
1541
1539
|
*
|
|
1542
|
-
* `
|
|
1543
|
-
*
|
|
1540
|
+
* `execute` - When `execute` returns `true`, the search is run.
|
|
1541
|
+
* When `execute` returns `false`, the search is not executed.
|
|
1544
1542
|
*
|
|
1545
|
-
* `
|
|
1546
|
-
* `
|
|
1543
|
+
* `error` - Developers can customize the user-facing error message when `execute`
|
|
1544
|
+
* is `false` by using the `error` parameters in `responder`.
|
|
1545
|
+
* `errorText` - The error message text shown to the user.
|
|
1547
1546
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
1548
1547
|
* @example
|
|
1549
|
-
|
|
1550
|
-
*
|
|
1551
|
-
*
|
|
1552
|
-
*
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
1555
|
-
*
|
|
1556
|
-
*
|
|
1557
|
-
*
|
|
1558
|
-
*
|
|
1559
|
-
*
|
|
1560
|
-
*
|
|
1561
|
-
*
|
|
1562
|
-
* })
|
|
1548
|
+
*
|
|
1549
|
+
* This example blocks search operation and returns a custom error message:
|
|
1550
|
+
* ```js
|
|
1551
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
1552
|
+
* responder({
|
|
1553
|
+
* data: {
|
|
1554
|
+
* execute: false,
|
|
1555
|
+
* error: {
|
|
1556
|
+
* // Provide a custom error message to explain why the search did not run.
|
|
1557
|
+
* errorText: 'This search query cannot be run. Please contact your administrator for more details.',
|
|
1558
|
+
* },
|
|
1559
|
+
* },
|
|
1560
|
+
* });
|
|
1561
|
+
* });
|
|
1563
1562
|
* ```
|
|
1563
|
+
* @example
|
|
1564
1564
|
*
|
|
1565
|
-
|
|
1566
|
-
*
|
|
1567
|
-
*
|
|
1568
|
-
*
|
|
1569
|
-
* responder
|
|
1570
|
-
*
|
|
1571
|
-
*
|
|
1572
|
-
*
|
|
1573
|
-
*
|
|
1574
|
-
*
|
|
1575
|
-
*
|
|
1576
|
-
*
|
|
1577
|
-
*
|
|
1578
|
-
*
|
|
1579
|
-
*
|
|
1580
|
-
*
|
|
1581
|
-
*
|
|
1582
|
-
*
|
|
1583
|
-
*
|
|
1584
|
-
|
|
1565
|
+
* This example allows the search operation to run
|
|
1566
|
+
* unless the query contains both `sales` and `county`,
|
|
1567
|
+
* and returns a custom error message if the query is rejected:
|
|
1568
|
+
* ```js
|
|
1569
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
1570
|
+
* // Record the search query submitted by the end user.
|
|
1571
|
+
* const query = payload.data.data.answer.search_query;
|
|
1572
|
+
*
|
|
1573
|
+
* responder({
|
|
1574
|
+
* data: {
|
|
1575
|
+
* // Returns true as long as the query does not include both `sales` and `county`.
|
|
1576
|
+
* execute: !(query.includes('sales') && query.includes('county')),
|
|
1577
|
+
* error: {
|
|
1578
|
+
* // Provide a custom error message when the query is blocked by your logic.
|
|
1579
|
+
* errorText:
|
|
1580
|
+
* "You can't use this query: "
|
|
1581
|
+
* + query
|
|
1582
|
+
* + ". The 'sales' measure can never be used at the 'county' level. "
|
|
1583
|
+
* + "Please try another measure or remove 'county' from your search.",
|
|
1584
|
+
* },
|
|
1585
|
+
* },
|
|
1586
|
+
* });
|
|
1587
|
+
* });
|
|
1588
|
+
* ```
|
|
1585
1589
|
*/
|
|
1586
1590
|
EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
|
|
1587
1591
|
/**
|
|
@@ -3335,7 +3339,6 @@
|
|
|
3335
3339
|
*/
|
|
3336
3340
|
var Param;
|
|
3337
3341
|
(function (Param) {
|
|
3338
|
-
Param["Tsmcp"] = "tsmcp";
|
|
3339
3342
|
Param["EmbedApp"] = "embedApp";
|
|
3340
3343
|
Param["DataSources"] = "dataSources";
|
|
3341
3344
|
Param["DataSourceMode"] = "dataSourceMode";
|
|
@@ -17529,17 +17532,50 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17529
17532
|
let releaseVersion = '';
|
|
17530
17533
|
const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
|
|
17531
17534
|
/**
|
|
17532
|
-
* Enum for auth failure types.
|
|
17533
|
-
*
|
|
17535
|
+
* Enum for auth failure types.
|
|
17536
|
+
* This value is passed to the listener for {@link AuthStatus.FAILURE}.
|
|
17534
17537
|
* @group Authentication / Init
|
|
17535
17538
|
*/
|
|
17536
17539
|
var AuthFailureType;
|
|
17537
17540
|
(function (AuthFailureType) {
|
|
17541
|
+
/**
|
|
17542
|
+
* Authentication failed in the SDK authentication flow.
|
|
17543
|
+
*
|
|
17544
|
+
* Emitted when `init()` or auto-authentication cannot establish a logged-in session.
|
|
17545
|
+
* For example, this can happen because of an invalid token, an auth request failure,
|
|
17546
|
+
* or an auth promise rejection.
|
|
17547
|
+
*/
|
|
17538
17548
|
AuthFailureType["SDK"] = "SDK";
|
|
17549
|
+
/**
|
|
17550
|
+
* Browser cookie access is blocked for the embedded app.
|
|
17551
|
+
*
|
|
17552
|
+
* Emitted when the iframe reports that required cookies
|
|
17553
|
+
* cannot be read or sent, commonly due to third-party cookie restrictions.
|
|
17554
|
+
*/
|
|
17539
17555
|
AuthFailureType["NO_COOKIE_ACCESS"] = "NO_COOKIE_ACCESS";
|
|
17556
|
+
/**
|
|
17557
|
+
* The current authentication token or session has expired.
|
|
17558
|
+
*
|
|
17559
|
+
* Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
|
|
17560
|
+
*/
|
|
17540
17561
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
17562
|
+
/**
|
|
17563
|
+
* A generic authentication failure that does not match a more specific type.
|
|
17564
|
+
*
|
|
17565
|
+
* Emitted as a fallback for app-reported auth failures in standard auth flows.
|
|
17566
|
+
*/
|
|
17541
17567
|
AuthFailureType["OTHER"] = "OTHER";
|
|
17568
|
+
/**
|
|
17569
|
+
* The user session timed out due to inactivity.
|
|
17570
|
+
*
|
|
17571
|
+
* Emitted when the app reports an idle-session timeout.
|
|
17572
|
+
*/
|
|
17542
17573
|
AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
|
|
17574
|
+
/**
|
|
17575
|
+
* The app reports that the user is unauthenticated.
|
|
17576
|
+
*
|
|
17577
|
+
* Used primarily to classify unauthenticated failures in Embedded SSO flows.
|
|
17578
|
+
*/
|
|
17543
17579
|
AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
|
|
17544
17580
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
17545
17581
|
/**
|
|
@@ -18350,7 +18386,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18350
18386
|
return eventData;
|
|
18351
18387
|
}
|
|
18352
18388
|
|
|
18353
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
18389
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run 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.23","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","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":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
18354
18390
|
|
|
18355
18391
|
class HostEventClient {
|
|
18356
18392
|
constructor(iFrame) {
|
|
@@ -20796,6 +20832,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20796
20832
|
else {
|
|
20797
20833
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
20798
20834
|
}
|
|
20835
|
+
if (modularHomeExperience !== undefined) {
|
|
20836
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
20837
|
+
}
|
|
20799
20838
|
// Set navigation to v2 by default to avoid problems like the app
|
|
20800
20839
|
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
20801
20840
|
// at the cluster level.
|
|
@@ -20805,9 +20844,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20805
20844
|
// Set homePageVersion to v2 by default to reset the LD flag value
|
|
20806
20845
|
// for the homepageVersion.
|
|
20807
20846
|
params[Param.HomepageVersion] = 'v2';
|
|
20808
|
-
// Set listpageVersion to v2 by default to reset the LD flag value
|
|
20809
|
-
// for the listpageVersion.
|
|
20810
|
-
params[Param.ListPageVersion] = ListPage.List;
|
|
20811
20847
|
if (discoveryExperience) {
|
|
20812
20848
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
20813
20849
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
@@ -20826,8 +20862,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
20826
20862
|
if (discoveryExperience.homePage === HomePage.ModularWithStylingChanges) {
|
|
20827
20863
|
params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
|
|
20828
20864
|
}
|
|
20829
|
-
// listPageVersion
|
|
20830
|
-
if (discoveryExperience.listPageVersion
|
|
20865
|
+
// listPageVersion can be changed to v2 or v3
|
|
20866
|
+
if (discoveryExperience.listPageVersion !== undefined) {
|
|
20831
20867
|
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
20832
20868
|
}
|
|
20833
20869
|
}
|
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.46.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -1333,65 +1333,69 @@ var EmbedEvent;
|
|
|
1333
1333
|
EmbedEvent["Rename"] = "rename";
|
|
1334
1334
|
/**
|
|
1335
1335
|
*
|
|
1336
|
-
* This event
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1339
|
-
*
|
|
1340
|
-
|
|
1341
|
-
*
|
|
1342
|
-
*
|
|
1343
|
-
*
|
|
1336
|
+
* This event allows developers to intercept search execution
|
|
1337
|
+
* and implement logic that decides whether Search Data should return
|
|
1338
|
+
* data or block the search operation.
|
|
1339
|
+
*
|
|
1340
|
+
* **Prerequisite**: Set`isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
1341
|
+
* to ensure that `EmbedEvent.OnBeforeGetVizDataIntercept` is emitted
|
|
1342
|
+
* when the embedding application user tries to run a search query.
|
|
1343
|
+
*
|
|
1344
|
+
* This framework applies only to `AppEmbed` and `SearchEmbed`.
|
|
1345
|
+
* @param - Includes the following parameters:
|
|
1344
1346
|
* - `payload`: The payload received from the embed related to the Data API call.
|
|
1345
1347
|
* - `responder`: Contains elements that let developers define whether ThoughtSpot
|
|
1346
|
-
*
|
|
1347
|
-
* should be shown to the user.
|
|
1348
|
+
* will run or block the search operation, and if blocked, which error message to provide.
|
|
1348
1349
|
*
|
|
1349
|
-
* `execute` - When `execute` returns `true`, the search
|
|
1350
|
-
* When `execute` returns `false`, the search
|
|
1350
|
+
* `execute` - When `execute` returns `true`, the search is run.
|
|
1351
|
+
* When `execute` returns `false`, the search is not executed.
|
|
1351
1352
|
*
|
|
1352
|
-
* `error` - Developers can customize the error message
|
|
1353
|
-
* is `false` using the `
|
|
1354
|
-
*
|
|
1355
|
-
* `errorText` - The error message text to be shown to the user.
|
|
1356
|
-
* `errorDescription (ThoughtSpot: 10.15.0.cl and above)` - The error description to be shown to the user.
|
|
1353
|
+
* `error` - Developers can customize the user-facing error message when `execute`
|
|
1354
|
+
* is `false` by using the `error` parameters in `responder`.
|
|
1355
|
+
* `errorText` - The error message text shown to the user.
|
|
1357
1356
|
* @version SDK : 1.29.0 | ThoughtSpot: 10.3.0.cl
|
|
1358
1357
|
* @example
|
|
1359
|
-
|
|
1360
|
-
*
|
|
1361
|
-
*
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1367
|
-
*
|
|
1368
|
-
*
|
|
1369
|
-
*
|
|
1370
|
-
*
|
|
1371
|
-
*
|
|
1372
|
-
* })
|
|
1358
|
+
*
|
|
1359
|
+
* This example blocks search operation and returns a custom error message:
|
|
1360
|
+
* ```js
|
|
1361
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
1362
|
+
* responder({
|
|
1363
|
+
* data: {
|
|
1364
|
+
* execute: false,
|
|
1365
|
+
* error: {
|
|
1366
|
+
* // Provide a custom error message to explain why the search did not run.
|
|
1367
|
+
* errorText: 'This search query cannot be run. Please contact your administrator for more details.',
|
|
1368
|
+
* },
|
|
1369
|
+
* },
|
|
1370
|
+
* });
|
|
1371
|
+
* });
|
|
1373
1372
|
* ```
|
|
1373
|
+
* @example
|
|
1374
1374
|
*
|
|
1375
|
-
|
|
1376
|
-
*
|
|
1377
|
-
*
|
|
1378
|
-
*
|
|
1379
|
-
* responder
|
|
1380
|
-
*
|
|
1381
|
-
*
|
|
1382
|
-
*
|
|
1383
|
-
*
|
|
1384
|
-
*
|
|
1385
|
-
*
|
|
1386
|
-
*
|
|
1387
|
-
*
|
|
1388
|
-
*
|
|
1389
|
-
*
|
|
1390
|
-
*
|
|
1391
|
-
*
|
|
1392
|
-
*
|
|
1393
|
-
*
|
|
1394
|
-
|
|
1375
|
+
* This example allows the search operation to run
|
|
1376
|
+
* unless the query contains both `sales` and `county`,
|
|
1377
|
+
* and returns a custom error message if the query is rejected:
|
|
1378
|
+
* ```js
|
|
1379
|
+
* embed.on(EmbedEvent.OnBeforeGetVizDataIntercept, (payload, responder) => {
|
|
1380
|
+
* // Record the search query submitted by the end user.
|
|
1381
|
+
* const query = payload.data.data.answer.search_query;
|
|
1382
|
+
*
|
|
1383
|
+
* responder({
|
|
1384
|
+
* data: {
|
|
1385
|
+
* // Returns true as long as the query does not include both `sales` and `county`.
|
|
1386
|
+
* execute: !(query.includes('sales') && query.includes('county')),
|
|
1387
|
+
* error: {
|
|
1388
|
+
* // Provide a custom error message when the query is blocked by your logic.
|
|
1389
|
+
* errorText:
|
|
1390
|
+
* "You can't use this query: "
|
|
1391
|
+
* + query
|
|
1392
|
+
* + ". The 'sales' measure can never be used at the 'county' level. "
|
|
1393
|
+
* + "Please try another measure or remove 'county' from your search.",
|
|
1394
|
+
* },
|
|
1395
|
+
* },
|
|
1396
|
+
* });
|
|
1397
|
+
* });
|
|
1398
|
+
* ```
|
|
1395
1399
|
*/
|
|
1396
1400
|
EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
|
|
1397
1401
|
/**
|
|
@@ -3145,7 +3149,6 @@ var DataSourceVisualMode;
|
|
|
3145
3149
|
*/
|
|
3146
3150
|
var Param;
|
|
3147
3151
|
(function (Param) {
|
|
3148
|
-
Param["Tsmcp"] = "tsmcp";
|
|
3149
3152
|
Param["EmbedApp"] = "embedApp";
|
|
3150
3153
|
Param["DataSources"] = "dataSources";
|
|
3151
3154
|
Param["DataSourceMode"] = "dataSourceMode";
|
|
@@ -8954,7 +8957,7 @@ class AnswerService {
|
|
|
8954
8957
|
async getTML() {
|
|
8955
8958
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8956
8959
|
const edoc = object[0].edoc;
|
|
8957
|
-
const YAML = await import('./index-
|
|
8960
|
+
const YAML = await import('./index-BQvLEoxp.js');
|
|
8958
8961
|
const parsedDoc = YAML.parse(edoc);
|
|
8959
8962
|
return {
|
|
8960
8963
|
answer: {
|
|
@@ -17405,17 +17408,50 @@ let samlCompletionPromise = null;
|
|
|
17405
17408
|
let releaseVersion = '';
|
|
17406
17409
|
const SSO_REDIRECTION_MARKER_GUID = '5e16222e-ef02-43e9-9fbd-24226bf3ce5b';
|
|
17407
17410
|
/**
|
|
17408
|
-
* Enum for auth failure types.
|
|
17409
|
-
*
|
|
17411
|
+
* Enum for auth failure types.
|
|
17412
|
+
* This value is passed to the listener for {@link AuthStatus.FAILURE}.
|
|
17410
17413
|
* @group Authentication / Init
|
|
17411
17414
|
*/
|
|
17412
17415
|
var AuthFailureType;
|
|
17413
17416
|
(function (AuthFailureType) {
|
|
17417
|
+
/**
|
|
17418
|
+
* Authentication failed in the SDK authentication flow.
|
|
17419
|
+
*
|
|
17420
|
+
* Emitted when `init()` or auto-authentication cannot establish a logged-in session.
|
|
17421
|
+
* For example, this can happen because of an invalid token, an auth request failure,
|
|
17422
|
+
* or an auth promise rejection.
|
|
17423
|
+
*/
|
|
17414
17424
|
AuthFailureType["SDK"] = "SDK";
|
|
17425
|
+
/**
|
|
17426
|
+
* Browser cookie access is blocked for the embedded app.
|
|
17427
|
+
*
|
|
17428
|
+
* Emitted when the iframe reports that required cookies
|
|
17429
|
+
* cannot be read or sent, commonly due to third-party cookie restrictions.
|
|
17430
|
+
*/
|
|
17415
17431
|
AuthFailureType["NO_COOKIE_ACCESS"] = "NO_COOKIE_ACCESS";
|
|
17432
|
+
/**
|
|
17433
|
+
* The current authentication token or session has expired.
|
|
17434
|
+
*
|
|
17435
|
+
* Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
|
|
17436
|
+
*/
|
|
17416
17437
|
AuthFailureType["EXPIRY"] = "EXPIRY";
|
|
17438
|
+
/**
|
|
17439
|
+
* A generic authentication failure that does not match a more specific type.
|
|
17440
|
+
*
|
|
17441
|
+
* Emitted as a fallback for app-reported auth failures in standard auth flows.
|
|
17442
|
+
*/
|
|
17417
17443
|
AuthFailureType["OTHER"] = "OTHER";
|
|
17444
|
+
/**
|
|
17445
|
+
* The user session timed out due to inactivity.
|
|
17446
|
+
*
|
|
17447
|
+
* Emitted when the app reports an idle-session timeout.
|
|
17448
|
+
*/
|
|
17418
17449
|
AuthFailureType["IDLE_SESSION_TIMEOUT"] = "IDLE_SESSION_TIMEOUT";
|
|
17450
|
+
/**
|
|
17451
|
+
* The app reports that the user is unauthenticated.
|
|
17452
|
+
*
|
|
17453
|
+
* Used primarily to classify unauthenticated failures in Embedded SSO flows.
|
|
17454
|
+
*/
|
|
17419
17455
|
AuthFailureType["UNAUTHENTICATED_FAILURE"] = "UNAUTHENTICATED_FAILURE";
|
|
17420
17456
|
})(AuthFailureType || (AuthFailureType = {}));
|
|
17421
17457
|
/**
|
|
@@ -18392,7 +18428,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
|
18392
18428
|
return eventData;
|
|
18393
18429
|
}
|
|
18394
18430
|
|
|
18395
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
18431
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run 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.23","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","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":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
18396
18432
|
|
|
18397
18433
|
class HostEventClient {
|
|
18398
18434
|
constructor(iFrame) {
|
|
@@ -20498,6 +20534,9 @@ class AppEmbed extends V1Embed {
|
|
|
20498
20534
|
else {
|
|
20499
20535
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
20500
20536
|
}
|
|
20537
|
+
if (modularHomeExperience !== undefined) {
|
|
20538
|
+
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
20539
|
+
}
|
|
20501
20540
|
// Set navigation to v2 by default to avoid problems like the app
|
|
20502
20541
|
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
20503
20542
|
// at the cluster level.
|
|
@@ -20507,9 +20546,6 @@ class AppEmbed extends V1Embed {
|
|
|
20507
20546
|
// Set homePageVersion to v2 by default to reset the LD flag value
|
|
20508
20547
|
// for the homepageVersion.
|
|
20509
20548
|
params[Param.HomepageVersion] = 'v2';
|
|
20510
|
-
// Set listpageVersion to v2 by default to reset the LD flag value
|
|
20511
|
-
// for the listpageVersion.
|
|
20512
|
-
params[Param.ListPageVersion] = ListPage.List;
|
|
20513
20549
|
if (discoveryExperience) {
|
|
20514
20550
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
20515
20551
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
@@ -20528,8 +20564,8 @@ class AppEmbed extends V1Embed {
|
|
|
20528
20564
|
if (discoveryExperience.homePage === HomePage.ModularWithStylingChanges) {
|
|
20529
20565
|
params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
|
|
20530
20566
|
}
|
|
20531
|
-
// listPageVersion
|
|
20532
|
-
if (discoveryExperience.listPageVersion
|
|
20567
|
+
// listPageVersion can be changed to v2 or v3
|
|
20568
|
+
if (discoveryExperience.listPageVersion !== undefined) {
|
|
20533
20569
|
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
20534
20570
|
}
|
|
20535
20571
|
}
|
|
@@ -22685,67 +22721,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
|
|
|
22685
22721
|
return result;
|
|
22686
22722
|
};
|
|
22687
22723
|
|
|
22688
|
-
|
|
22689
|
-
const replaceWithMCPIframe = (iframe) => {
|
|
22690
|
-
const autoMCPFrameRenderer = new AutoFrameRenderer(viewConfig);
|
|
22691
|
-
autoMCPFrameRenderer.replaceIframe(iframe);
|
|
22692
|
-
};
|
|
22693
|
-
const observer = new MutationObserver((mutations) => {
|
|
22694
|
-
for (const mutation of mutations) {
|
|
22695
|
-
for (const node of Array.from(mutation.addedNodes)) {
|
|
22696
|
-
if (node instanceof HTMLIFrameElement && isTSMCPIframe(node)) {
|
|
22697
|
-
replaceWithMCPIframe(node);
|
|
22698
|
-
}
|
|
22699
|
-
if (node instanceof HTMLElement) {
|
|
22700
|
-
node.querySelectorAll('iframe').forEach((iframe) => {
|
|
22701
|
-
if (isTSMCPIframe(iframe)) {
|
|
22702
|
-
replaceWithMCPIframe(iframe);
|
|
22703
|
-
}
|
|
22704
|
-
});
|
|
22705
|
-
}
|
|
22706
|
-
}
|
|
22707
|
-
}
|
|
22708
|
-
});
|
|
22709
|
-
observer.observe(document.body, { childList: true, subtree: true });
|
|
22710
|
-
return observer;
|
|
22711
|
-
}
|
|
22712
|
-
function isTSMCPIframe(iframe) {
|
|
22713
|
-
const src = iframe.src;
|
|
22714
|
-
return src.includes(`${Param.Tsmcp}=true`);
|
|
22715
|
-
}
|
|
22716
|
-
class AutoFrameRenderer extends TsEmbed {
|
|
22717
|
-
constructor(viewConfig) {
|
|
22718
|
-
viewConfig.embedComponentType = 'auto-frame-renderer';
|
|
22719
|
-
const container = document.createElement('div');
|
|
22720
|
-
super(container, viewConfig);
|
|
22721
|
-
this.viewConfig = viewConfig;
|
|
22722
|
-
}
|
|
22723
|
-
getMCPIframeSrc(sourceSrc) {
|
|
22724
|
-
const queryParams = this.getEmbedParamsObject();
|
|
22725
|
-
const sourceURL = new URL(sourceSrc);
|
|
22726
|
-
const existingQueryParams = sourceURL.searchParams;
|
|
22727
|
-
// convert existing query params to an object
|
|
22728
|
-
const existingQueryParamsObject = Object.fromEntries(existingQueryParams);
|
|
22729
|
-
delete existingQueryParamsObject[Param.Tsmcp];
|
|
22730
|
-
// merge the existing query params with the new query params
|
|
22731
|
-
const mergedQueryParams = { ...queryParams, ...existingQueryParamsObject };
|
|
22732
|
-
const mergedQueryParamsString = getQueryParamString(mergedQueryParams);
|
|
22733
|
-
const frameSrc = `${sourceURL.origin}${sourceURL.pathname}?${mergedQueryParamsString}/${sourceURL.hash}`;
|
|
22734
|
-
return frameSrc;
|
|
22735
|
-
}
|
|
22736
|
-
handleInsertionIntoDOM(child) {
|
|
22737
|
-
if (this.frameToReplace) {
|
|
22738
|
-
this.frameToReplace.replaceWith(child);
|
|
22739
|
-
}
|
|
22740
|
-
else {
|
|
22741
|
-
super.handleInsertionIntoDOM(child);
|
|
22742
|
-
}
|
|
22743
|
-
}
|
|
22744
|
-
async replaceIframe(iframe) {
|
|
22745
|
-
this.frameToReplace = iframe;
|
|
22746
|
-
const src = this.getMCPIframeSrc(iframe.src);
|
|
22747
|
-
await this.renderIFrame(src);
|
|
22748
|
-
}
|
|
22749
|
-
}
|
|
22750
|
-
|
|
22751
|
-
export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, startAutoMCPFrameRenderer, tokenizedFetch, uploadMixpanelEvent };
|
|
22724
|
+
export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
|