@thoughtspot/visual-embed-sdk 1.41.1 → 1.42.1-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/cjs/package.json +9 -9
- package/cjs/src/api-intercept.d.ts +25 -0
- package/cjs/src/api-intercept.d.ts.map +1 -0
- package/cjs/src/api-intercept.js +115 -0
- package/cjs/src/api-intercept.js.map +1 -0
- package/cjs/src/css-variables.d.ts +52 -14
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +7 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +20 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +7 -3
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +1 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +7 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +1 -0
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +1 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +10 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +35 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +1 -0
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +10 -6
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +11 -7
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +1 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +10 -9
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +21 -4
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +115 -34
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +83 -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/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- 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/all-types-export.spec.js +1 -1
- package/cjs/src/react/all-types-export.spec.js.map +1 -1
- package/cjs/src/react/util.js.map +1 -1
- package/cjs/src/react/util.spec.d.ts +2 -0
- package/cjs/src/react/util.spec.d.ts.map +1 -0
- package/cjs/src/react/util.spec.js +78 -0
- package/cjs/src/react/util.spec.js.map +1 -0
- package/cjs/src/types.d.ts +135 -8
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +73 -4
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processData.d.ts +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +8 -8
- package/cjs/src/utils/processData.js.map +1 -1
- package/dist/index-BEzW4MDA.js +7371 -0
- package/dist/{index-DQueHwfQ.js → index-DvNA626T.js} +1 -1
- package/dist/src/api-intercept.d.ts +25 -0
- package/dist/src/api-intercept.d.ts.map +1 -0
- package/dist/src/css-variables.d.ts +52 -14
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +1 -0
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +1 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +1 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +1 -0
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +1 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +21 -4
- 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/index.d.ts +2 -2
- 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/util.spec.d.ts +2 -0
- package/dist/src/react/util.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +135 -8
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +370 -90
- package/dist/tsembed-react.js +369 -89
- package/dist/tsembed.es.js +371 -91
- package/dist/tsembed.js +369 -89
- package/dist/visual-embed-sdk-react-full.d.ts +9431 -9915
- package/dist/visual-embed-sdk-react.d.ts +9301 -9922
- package/dist/visual-embed-sdk.d.ts +9470 -9532
- package/lib/package.json +9 -9
- package/lib/src/api-intercept.d.ts +25 -0
- package/lib/src/api-intercept.d.ts.map +1 -0
- package/lib/src/api-intercept.js +108 -0
- package/lib/src/api-intercept.js.map +1 -0
- package/lib/src/css-variables.d.ts +52 -14
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +7 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +20 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +1 -0
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +7 -3
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +1 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +7 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +11 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +1 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +1 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +10 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +35 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +1 -0
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +10 -6
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +11 -7
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +1 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +10 -9
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +21 -4
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +115 -34
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +83 -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/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- 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/all-types-export.spec.js +1 -1
- package/lib/src/react/all-types-export.spec.js.map +1 -1
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/react/util.spec.d.ts +2 -0
- package/lib/src/react/util.spec.d.ts.map +1 -0
- package/lib/src/react/util.spec.js +76 -0
- package/lib/src/react/util.spec.js.map +1 -0
- package/lib/src/types.d.ts +135 -8
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +72 -3
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processData.d.ts +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +8 -8
- package/lib/src/utils/processData.js.map +1 -1
- package/package.json +9 -9
- package/src/api-intercept.ts +134 -0
- package/src/css-variables.ts +53 -16
- package/src/embed/app.spec.ts +28 -0
- package/src/embed/app.ts +9 -1
- package/src/embed/bodyless-conversation.ts +8 -3
- package/src/embed/conversation.ts +17 -2
- package/src/embed/hostEventClient/contracts.ts +10 -0
- package/src/embed/liveboard.spec.ts +44 -0
- package/src/embed/liveboard.ts +12 -1
- package/src/embed/sage.ts +14 -9
- package/src/embed/search-bar.tsx +14 -7
- package/src/embed/search.ts +21 -8
- package/src/embed/ts-embed.spec.ts +116 -5
- package/src/embed/ts-embed.ts +152 -50
- package/src/errors.ts +1 -0
- package/src/index.ts +2 -0
- package/src/react/all-types-export.spec.ts +1 -1
- package/src/react/all-types-export.ts +1 -0
- package/src/react/util.spec.tsx +88 -0
- package/src/react/util.ts +3 -3
- package/src/types.ts +195 -64
- package/src/utils/processData.ts +11 -11
- package/lib/src/visual-embed-sdk.d.ts +0 -9779
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-alpha.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -1697,6 +1697,21 @@ var EmbedEvent;
|
|
|
1697
1697
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1698
1698
|
*/
|
|
1699
1699
|
EmbedEvent["OrgSwitched"] = "orgSwitched";
|
|
1700
|
+
/**
|
|
1701
|
+
* Emitted when the user intercepts a URL.
|
|
1702
|
+
*
|
|
1703
|
+
* Supported on all embed types.
|
|
1704
|
+
*
|
|
1705
|
+
* @example
|
|
1706
|
+
* ```js
|
|
1707
|
+
* embed.on(EmbedEvent.ApiIntercept, (payload) => {
|
|
1708
|
+
* console.log('payload', payload);
|
|
1709
|
+
* })
|
|
1710
|
+
* ```
|
|
1711
|
+
*
|
|
1712
|
+
* @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
|
|
1713
|
+
*/
|
|
1714
|
+
EmbedEvent["ApiIntercept"] = "ApiIntercept";
|
|
1700
1715
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1701
1716
|
/**
|
|
1702
1717
|
* Event types that can be triggered by the host application
|
|
@@ -2462,21 +2477,42 @@ var HostEvent;
|
|
|
2462
2477
|
*/
|
|
2463
2478
|
HostEvent["Share"] = "share";
|
|
2464
2479
|
/**
|
|
2465
|
-
* Trigger the **Save**
|
|
2480
|
+
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
2466
2481
|
* Saves the changes.
|
|
2467
|
-
*
|
|
2482
|
+
*
|
|
2483
|
+
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
2484
|
+
* It is required and can be retrieved from the data embed event.
|
|
2485
|
+
*
|
|
2468
2486
|
* @example
|
|
2469
2487
|
* ```js
|
|
2488
|
+
* // Save changes in a Liveboard
|
|
2470
2489
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
2471
2490
|
* ```
|
|
2491
|
+
*
|
|
2472
2492
|
* ```js
|
|
2493
|
+
* // Save the current Answer in Search embed
|
|
2473
2494
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2474
2495
|
* ```
|
|
2496
|
+
*
|
|
2475
2497
|
* ```js
|
|
2498
|
+
* // Save an Answer in Spotter (requires vizId)
|
|
2476
2499
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2477
|
-
*
|
|
2500
|
+
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2478
2501
|
* })
|
|
2479
2502
|
* ```
|
|
2503
|
+
*
|
|
2504
|
+
* ```js
|
|
2505
|
+
* // How to get the vizId in Spotter?
|
|
2506
|
+
*
|
|
2507
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId.
|
|
2508
|
+
* let latestSpotterVizId = '';
|
|
2509
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2510
|
+
* latestSpotterVizId = payload.data.id;
|
|
2511
|
+
* });
|
|
2512
|
+
*
|
|
2513
|
+
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2514
|
+
* ```
|
|
2515
|
+
*
|
|
2480
2516
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2481
2517
|
*/
|
|
2482
2518
|
HostEvent["Save"] = "save";
|
|
@@ -2960,6 +2996,16 @@ var HostEvent;
|
|
|
2960
2996
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2961
2997
|
*/
|
|
2962
2998
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
2999
|
+
/**
|
|
3000
|
+
* @hidden
|
|
3001
|
+
* Triggers the update of the embed params.
|
|
3002
|
+
*
|
|
3003
|
+
* @example
|
|
3004
|
+
* ```js
|
|
3005
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3006
|
+
* ```
|
|
3007
|
+
*/
|
|
3008
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2963
3009
|
})(HostEvent || (HostEvent = {}));
|
|
2964
3010
|
/**
|
|
2965
3011
|
* The different visual modes that the data sources panel within
|
|
@@ -3107,6 +3153,7 @@ var Param;
|
|
|
3107
3153
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3108
3154
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3109
3155
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3156
|
+
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3110
3157
|
})(Param || (Param = {}));
|
|
3111
3158
|
/**
|
|
3112
3159
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4532,7 +4579,29 @@ var LogLevel;
|
|
|
4532
4579
|
* @version SDK: 1.26.7 | ThoughtSpot Cloud: 9.10.0.cl
|
|
4533
4580
|
*/
|
|
4534
4581
|
LogLevel["TRACE"] = "TRACE";
|
|
4535
|
-
})(LogLevel || (LogLevel = {}));
|
|
4582
|
+
})(LogLevel || (LogLevel = {}));
|
|
4583
|
+
/**
|
|
4584
|
+
* Enum for the type of API intercepted
|
|
4585
|
+
*/
|
|
4586
|
+
var InterceptedApiType;
|
|
4587
|
+
(function (InterceptedApiType) {
|
|
4588
|
+
/**
|
|
4589
|
+
* The apis that are use to get the metadata for the embed
|
|
4590
|
+
*/
|
|
4591
|
+
InterceptedApiType["METADATA"] = "METADATA";
|
|
4592
|
+
/**
|
|
4593
|
+
* The apis that are use to get the data for the embed
|
|
4594
|
+
*/
|
|
4595
|
+
InterceptedApiType["ANSWER_DATA"] = "ANSWER_DATA";
|
|
4596
|
+
/**
|
|
4597
|
+
* This will intercept all the apis
|
|
4598
|
+
*/
|
|
4599
|
+
InterceptedApiType["ALL"] = "ALL";
|
|
4600
|
+
/**
|
|
4601
|
+
* The apis that are use to get the data for the liveboard
|
|
4602
|
+
*/
|
|
4603
|
+
InterceptedApiType["LIVEBOARD_DATA"] = "LIVEBOARD_DATA";
|
|
4604
|
+
})(InterceptedApiType || (InterceptedApiType = {}));
|
|
4536
4605
|
|
|
4537
4606
|
const logFunctions = {
|
|
4538
4607
|
[LogLevel.SILENT]: () => undefined,
|
|
@@ -7295,6 +7364,17 @@ function isEmpty(value) {
|
|
|
7295
7364
|
|
|
7296
7365
|
var isEmpty_1 = isEmpty;
|
|
7297
7366
|
|
|
7367
|
+
var UIPassthroughEvent;
|
|
7368
|
+
(function (UIPassthroughEvent) {
|
|
7369
|
+
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
7370
|
+
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
7371
|
+
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
7372
|
+
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
7373
|
+
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
7374
|
+
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
7375
|
+
UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
|
|
7376
|
+
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
7377
|
+
|
|
7298
7378
|
const ERROR_MESSAGE = {
|
|
7299
7379
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
7300
7380
|
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
|
|
@@ -7316,6 +7396,7 @@ const ERROR_MESSAGE = {
|
|
|
7316
7396
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7317
7397
|
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',
|
|
7318
7398
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7399
|
+
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7319
7400
|
};
|
|
7320
7401
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7321
7402
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -8225,7 +8306,7 @@ class AnswerService {
|
|
|
8225
8306
|
async getTML() {
|
|
8226
8307
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8227
8308
|
const edoc = object[0].edoc;
|
|
8228
|
-
const YAML = await import('./index-
|
|
8309
|
+
const YAML = await import('./index-BEzW4MDA.js');
|
|
8229
8310
|
const parsedDoc = YAML.parse(edoc);
|
|
8230
8311
|
return {
|
|
8231
8312
|
answer: {
|
|
@@ -17378,27 +17459,27 @@ function processAuthLogout(e, containerEl) {
|
|
|
17378
17459
|
* @param thoughtSpotHost
|
|
17379
17460
|
* @param containerEl
|
|
17380
17461
|
*/
|
|
17381
|
-
function processEventData(type,
|
|
17462
|
+
function processEventData(type, eventData, thoughtSpotHost, containerEl) {
|
|
17382
17463
|
switch (type) {
|
|
17383
17464
|
case EmbedEvent.CustomAction:
|
|
17384
|
-
return processCustomAction(
|
|
17465
|
+
return processCustomAction(eventData, thoughtSpotHost);
|
|
17385
17466
|
case EmbedEvent.AuthInit:
|
|
17386
|
-
return processAuthInit(
|
|
17467
|
+
return processAuthInit(eventData);
|
|
17387
17468
|
case EmbedEvent.NoCookieAccess:
|
|
17388
|
-
return processNoCookieAccess(
|
|
17469
|
+
return processNoCookieAccess(eventData, containerEl);
|
|
17389
17470
|
case EmbedEvent.AuthFailure:
|
|
17390
|
-
return processAuthFailure(
|
|
17471
|
+
return processAuthFailure(eventData, containerEl);
|
|
17391
17472
|
case EmbedEvent.AuthLogout:
|
|
17392
|
-
return processAuthLogout(
|
|
17473
|
+
return processAuthLogout(eventData, containerEl);
|
|
17393
17474
|
case EmbedEvent.ExitPresentMode:
|
|
17394
17475
|
return processExitPresentMode();
|
|
17395
17476
|
case EmbedEvent.CLEAR_INFO_CACHE:
|
|
17396
17477
|
return processClearInfoCache();
|
|
17397
17478
|
}
|
|
17398
|
-
return
|
|
17479
|
+
return eventData;
|
|
17399
17480
|
}
|
|
17400
17481
|
|
|
17401
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17482
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-alpha.1";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 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":"^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":"^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",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","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:"^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:"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};
|
|
17402
17483
|
|
|
17403
17484
|
/**
|
|
17404
17485
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17470,16 +17551,6 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
17470
17551
|
});
|
|
17471
17552
|
}
|
|
17472
17553
|
|
|
17473
|
-
var UIPassthroughEvent;
|
|
17474
|
-
(function (UIPassthroughEvent) {
|
|
17475
|
-
UIPassthroughEvent["PinAnswerToLiveboard"] = "addVizToPinboard";
|
|
17476
|
-
UIPassthroughEvent["SaveAnswer"] = "saveAnswer";
|
|
17477
|
-
UIPassthroughEvent["GetDiscoverabilityStatus"] = "getDiscoverabilityStatus";
|
|
17478
|
-
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17479
|
-
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17480
|
-
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17481
|
-
})(UIPassthroughEvent || (UIPassthroughEvent = {}));
|
|
17482
|
-
|
|
17483
17554
|
class HostEventClient {
|
|
17484
17555
|
constructor(iFrame) {
|
|
17485
17556
|
this.iFrame = iFrame;
|
|
@@ -17571,6 +17642,107 @@ class HostEventClient {
|
|
|
17571
17642
|
}
|
|
17572
17643
|
}
|
|
17573
17644
|
|
|
17645
|
+
const defaultUrls = {
|
|
17646
|
+
[InterceptedApiType.METADATA]: [
|
|
17647
|
+
'/prism/?op=CreateAnswerSession',
|
|
17648
|
+
'/prism/?op=GetV2SourceDetail',
|
|
17649
|
+
],
|
|
17650
|
+
[InterceptedApiType.ANSWER_DATA]: [
|
|
17651
|
+
'/prism/?op=GetChartWithData',
|
|
17652
|
+
'/prism/?op=GetTableWithHeadlineData',
|
|
17653
|
+
],
|
|
17654
|
+
[InterceptedApiType.LIVEBOARD_DATA]: [
|
|
17655
|
+
'/prism/?op=LoadContextBook'
|
|
17656
|
+
],
|
|
17657
|
+
};
|
|
17658
|
+
const formatInterceptUrl = (url) => {
|
|
17659
|
+
const host = getThoughtSpotHost(getEmbedConfig());
|
|
17660
|
+
if (url.startsWith('/'))
|
|
17661
|
+
return `${host}${url}`;
|
|
17662
|
+
return url;
|
|
17663
|
+
};
|
|
17664
|
+
const processInterceptUrls = (interceptUrls) => {
|
|
17665
|
+
let processedUrls = [...interceptUrls];
|
|
17666
|
+
Object.entries(defaultUrls).forEach(([apiType, apiTypeUrls]) => {
|
|
17667
|
+
if (!processedUrls.includes(apiType))
|
|
17668
|
+
return;
|
|
17669
|
+
processedUrls = processedUrls.filter(url => url !== apiType);
|
|
17670
|
+
processedUrls = [...processedUrls, ...apiTypeUrls];
|
|
17671
|
+
});
|
|
17672
|
+
return processedUrls.map(url => formatInterceptUrl(url));
|
|
17673
|
+
};
|
|
17674
|
+
const getInterceptInitData = (embedConfig, viewConfig) => {
|
|
17675
|
+
const enableApiIntercept = (embedConfig.enableApiIntercept || viewConfig.enableApiIntercept) && (viewConfig.enableApiIntercept !== false);
|
|
17676
|
+
if (!enableApiIntercept)
|
|
17677
|
+
return {
|
|
17678
|
+
enableApiIntercept: false,
|
|
17679
|
+
};
|
|
17680
|
+
const combinedUrls = [...(embedConfig.interceptUrls || []), ...(viewConfig.interceptUrls || [])];
|
|
17681
|
+
if (viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17682
|
+
combinedUrls.push(InterceptedApiType.ANSWER_DATA);
|
|
17683
|
+
}
|
|
17684
|
+
const shouldInterceptAll = combinedUrls.includes(InterceptedApiType.ALL);
|
|
17685
|
+
const interceptUrls = shouldInterceptAll ? [InterceptedApiType.ALL] : processInterceptUrls(combinedUrls);
|
|
17686
|
+
const interceptTimeout = embedConfig.interceptTimeout || viewConfig.interceptTimeout;
|
|
17687
|
+
return {
|
|
17688
|
+
interceptUrls,
|
|
17689
|
+
interceptTimeout,
|
|
17690
|
+
enableApiIntercept,
|
|
17691
|
+
};
|
|
17692
|
+
};
|
|
17693
|
+
/**
|
|
17694
|
+
*
|
|
17695
|
+
* @param fetchInit
|
|
17696
|
+
*/
|
|
17697
|
+
const parseInterceptData = (eventDataString) => {
|
|
17698
|
+
try {
|
|
17699
|
+
const { input, init } = JSON.parse(eventDataString);
|
|
17700
|
+
init.body = JSON.parse(init.body);
|
|
17701
|
+
const parsedInit = { input, init };
|
|
17702
|
+
return [parsedInit, null];
|
|
17703
|
+
}
|
|
17704
|
+
catch (error) {
|
|
17705
|
+
return [null, error];
|
|
17706
|
+
}
|
|
17707
|
+
};
|
|
17708
|
+
const handleInterceptEvent = async (params) => {
|
|
17709
|
+
var _a, _b, _c, _d, _e;
|
|
17710
|
+
const { eventData, executeEvent, viewConfig, getUnsavedAnswerTml } = params;
|
|
17711
|
+
const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
|
|
17712
|
+
if (bodyParseError) {
|
|
17713
|
+
executeEvent(EmbedEvent.Error, {
|
|
17714
|
+
error: 'Error parsing api intercept body',
|
|
17715
|
+
});
|
|
17716
|
+
logger$3.error('Error parsing request body', bodyParseError);
|
|
17717
|
+
return;
|
|
17718
|
+
}
|
|
17719
|
+
const { input: requestUrl, init } = interceptData;
|
|
17720
|
+
const sessionId = (_c = (_b = (_a = init === null || init === void 0 ? void 0 : init.body) === null || _a === void 0 ? void 0 : _a.variables) === null || _b === void 0 ? void 0 : _b.session) === null || _c === void 0 ? void 0 : _c.sessionId;
|
|
17721
|
+
const vizId = (_e = (_d = init === null || init === void 0 ? void 0 : init.body) === null || _d === void 0 ? void 0 : _d.variables) === null || _e === void 0 ? void 0 : _e.contextBookId;
|
|
17722
|
+
if (defaultUrls.ANSWER_DATA.includes(requestUrl) && viewConfig.isOnBeforeGetVizDataInterceptEnabled) {
|
|
17723
|
+
const answerTml = await getUnsavedAnswerTml({ sessionId, vizId });
|
|
17724
|
+
executeEvent(EmbedEvent.OnBeforeGetVizDataIntercept, { data: { data: answerTml } });
|
|
17725
|
+
}
|
|
17726
|
+
executeEvent(EmbedEvent.ApiIntercept, interceptData);
|
|
17727
|
+
};
|
|
17728
|
+
const processLegacyInterceptResponse = (payload) => {
|
|
17729
|
+
var _a, _b;
|
|
17730
|
+
const title = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.errorText;
|
|
17731
|
+
const desc = (_b = payload === null || payload === void 0 ? void 0 : payload.data) === null || _b === void 0 ? void 0 : _b.errorDescription;
|
|
17732
|
+
const payloadToSend = [{
|
|
17733
|
+
data: {},
|
|
17734
|
+
errors: [
|
|
17735
|
+
{
|
|
17736
|
+
errorObj: {
|
|
17737
|
+
title,
|
|
17738
|
+
desc
|
|
17739
|
+
}
|
|
17740
|
+
}
|
|
17741
|
+
],
|
|
17742
|
+
}];
|
|
17743
|
+
return payloadToSend;
|
|
17744
|
+
};
|
|
17745
|
+
|
|
17574
17746
|
/**
|
|
17575
17747
|
* Copyright (c) 2022
|
|
17576
17748
|
*
|
|
@@ -17624,6 +17796,27 @@ class TsEmbed {
|
|
|
17624
17796
|
*/
|
|
17625
17797
|
this.fullscreenChangeHandler = null;
|
|
17626
17798
|
this.subscribedListeners = {};
|
|
17799
|
+
this.messageEventListener = async (event) => {
|
|
17800
|
+
const eventType = this.getEventType(event);
|
|
17801
|
+
const eventPort = this.getEventPort(event);
|
|
17802
|
+
const eventData = this.formatEventData(event, eventType);
|
|
17803
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
17804
|
+
const processedEventData = await processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el);
|
|
17805
|
+
const executeEvent = (_eventType, data) => {
|
|
17806
|
+
this.executeCallbacks(_eventType, data, eventPort);
|
|
17807
|
+
};
|
|
17808
|
+
if (eventType === EmbedEvent.ApiIntercept && this.viewConfig.enableApiIntercept) {
|
|
17809
|
+
const getUnsavedAnswerTml = async (props) => {
|
|
17810
|
+
var _a;
|
|
17811
|
+
const response = await this.triggerUIPassThrough(UIPassthroughEvent.GetUnsavedAnswerTML, props);
|
|
17812
|
+
return (_a = response[0]) === null || _a === void 0 ? void 0 : _a.value;
|
|
17813
|
+
};
|
|
17814
|
+
handleInterceptEvent({ eventData: processedEventData, executeEvent, embedConfig: this.embedConfig, viewConfig: this.viewConfig, getUnsavedAnswerTml });
|
|
17815
|
+
return;
|
|
17816
|
+
}
|
|
17817
|
+
this.executeCallbacks(eventType, processedEventData, eventPort);
|
|
17818
|
+
}
|
|
17819
|
+
};
|
|
17627
17820
|
/**
|
|
17628
17821
|
* Send Custom style as part of payload of APP_INIT
|
|
17629
17822
|
* @param _
|
|
@@ -17708,11 +17901,23 @@ class TsEmbed {
|
|
|
17708
17901
|
this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
17709
17902
|
};
|
|
17710
17903
|
this.showPreRenderByDefault = false;
|
|
17904
|
+
this.createEmbedEventResponder = (eventPort, eventType) => {
|
|
17905
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
17906
|
+
if (eventType === EmbedEvent.OnBeforeGetVizDataIntercept && enableApiIntercept) {
|
|
17907
|
+
return (payload) => {
|
|
17908
|
+
const payloadToSend = processLegacyInterceptResponse(payload);
|
|
17909
|
+
this.triggerEventOnPort(eventPort, payloadToSend);
|
|
17910
|
+
};
|
|
17911
|
+
}
|
|
17912
|
+
return (payload) => {
|
|
17913
|
+
this.triggerEventOnPort(eventPort, payload);
|
|
17914
|
+
};
|
|
17915
|
+
};
|
|
17711
17916
|
/**
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17917
|
+
* @hidden
|
|
17918
|
+
* Internal state to track if the embed container is loaded.
|
|
17919
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17920
|
+
*/
|
|
17716
17921
|
this.isEmbedContainerLoaded = false;
|
|
17717
17922
|
/**
|
|
17718
17923
|
* @hidden
|
|
@@ -17771,10 +17976,10 @@ class TsEmbed {
|
|
|
17771
17976
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
17772
17977
|
...viewConfig,
|
|
17773
17978
|
});
|
|
17979
|
+
const embedConfig = getEmbedConfig();
|
|
17980
|
+
this.embedConfig = embedConfig;
|
|
17774
17981
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
17775
17982
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17776
|
-
const embedConfig = getEmbedConfig();
|
|
17777
|
-
this.embedConfig = embedConfig;
|
|
17778
17983
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
17779
17984
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
17780
17985
|
}
|
|
@@ -17868,39 +18073,61 @@ class TsEmbed {
|
|
|
17868
18073
|
return eventData;
|
|
17869
18074
|
}
|
|
17870
18075
|
/**
|
|
17871
|
-
*
|
|
17872
|
-
*
|
|
17873
|
-
* embed instance through an identifier contained in the payload,
|
|
17874
|
-
* and executes the registered callbacks accordingly.
|
|
18076
|
+
* Subscribe to network events (online/offline) that should
|
|
18077
|
+
* work regardless of auth status
|
|
17875
18078
|
*/
|
|
17876
|
-
|
|
17877
|
-
this.
|
|
17878
|
-
const messageEventListener = (event) => {
|
|
17879
|
-
const eventType = this.getEventType(event);
|
|
17880
|
-
const eventPort = this.getEventPort(event);
|
|
17881
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17882
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17883
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17884
|
-
}
|
|
17885
|
-
};
|
|
17886
|
-
window.addEventListener('message', messageEventListener);
|
|
18079
|
+
subscribeToNetworkEvents() {
|
|
18080
|
+
this.unsubscribeToNetworkEvents();
|
|
17887
18081
|
const onlineEventListener = (e) => {
|
|
17888
18082
|
this.trigger(HostEvent.Reload);
|
|
17889
18083
|
};
|
|
17890
18084
|
window.addEventListener('online', onlineEventListener);
|
|
17891
18085
|
const offlineEventListener = (e) => {
|
|
17892
|
-
const offlineWarning =
|
|
18086
|
+
const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
|
|
17893
18087
|
this.executeCallbacks(EmbedEvent.Error, {
|
|
17894
18088
|
offlineWarning,
|
|
17895
18089
|
});
|
|
17896
18090
|
logger$3.warn(offlineWarning);
|
|
17897
18091
|
};
|
|
17898
18092
|
window.addEventListener('offline', offlineEventListener);
|
|
17899
|
-
this.subscribedListeners =
|
|
17900
|
-
|
|
17901
|
-
|
|
17902
|
-
|
|
17903
|
-
|
|
18093
|
+
this.subscribedListeners.online = onlineEventListener;
|
|
18094
|
+
this.subscribedListeners.offline = offlineEventListener;
|
|
18095
|
+
}
|
|
18096
|
+
/**
|
|
18097
|
+
* Subscribe to message events that depend on successful iframe setup
|
|
18098
|
+
*/
|
|
18099
|
+
subscribeToMessageEvents() {
|
|
18100
|
+
this.unsubscribeToMessageEvents();
|
|
18101
|
+
window.addEventListener('message', this.messageEventListener);
|
|
18102
|
+
this.subscribedListeners.message = this.messageEventListener;
|
|
18103
|
+
}
|
|
18104
|
+
/**
|
|
18105
|
+
* Adds event listeners for both network and message events.
|
|
18106
|
+
* This maintains backward compatibility with the existing method.
|
|
18107
|
+
* Adds a global event listener to window for "message" events.
|
|
18108
|
+
* ThoughtSpot detects if a particular event is targeted to this
|
|
18109
|
+
* embed instance through an identifier contained in the payload,
|
|
18110
|
+
* and executes the registered callbacks accordingly.
|
|
18111
|
+
*/
|
|
18112
|
+
subscribeToEvents() {
|
|
18113
|
+
this.subscribeToNetworkEvents();
|
|
18114
|
+
this.subscribeToMessageEvents();
|
|
18115
|
+
}
|
|
18116
|
+
unsubscribeToNetworkEvents() {
|
|
18117
|
+
if (this.subscribedListeners.online) {
|
|
18118
|
+
window.removeEventListener('online', this.subscribedListeners.online);
|
|
18119
|
+
delete this.subscribedListeners.online;
|
|
18120
|
+
}
|
|
18121
|
+
if (this.subscribedListeners.offline) {
|
|
18122
|
+
window.removeEventListener('offline', this.subscribedListeners.offline);
|
|
18123
|
+
delete this.subscribedListeners.offline;
|
|
18124
|
+
}
|
|
18125
|
+
}
|
|
18126
|
+
unsubscribeToMessageEvents() {
|
|
18127
|
+
if (this.subscribedListeners.message) {
|
|
18128
|
+
window.removeEventListener('message', this.subscribedListeners.message);
|
|
18129
|
+
delete this.subscribedListeners.message;
|
|
18130
|
+
}
|
|
17904
18131
|
}
|
|
17905
18132
|
unsubscribeToEvents() {
|
|
17906
18133
|
Object.keys(this.subscribedListeners).forEach((key) => {
|
|
@@ -17933,7 +18160,7 @@ class TsEmbed {
|
|
|
17933
18160
|
message: customActionsResult.errors,
|
|
17934
18161
|
});
|
|
17935
18162
|
}
|
|
17936
|
-
|
|
18163
|
+
const baseInitData = {
|
|
17937
18164
|
customisations: getCustomisations(this.embedConfig, this.viewConfig),
|
|
17938
18165
|
authToken,
|
|
17939
18166
|
runtimeFilterParams: this.viewConfig.excludeRuntimeFiltersfromURL
|
|
@@ -17951,7 +18178,9 @@ class TsEmbed {
|
|
|
17951
18178
|
customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
|
|
17952
18179
|
hiddenListColumns: this.viewConfig.hiddenListColumns || [],
|
|
17953
18180
|
customActions: customActionsResult.actions,
|
|
18181
|
+
...getInterceptInitData(this.embedConfig, this.viewConfig),
|
|
17954
18182
|
};
|
|
18183
|
+
return baseInitData;
|
|
17955
18184
|
}
|
|
17956
18185
|
async getAppInitData() {
|
|
17957
18186
|
return this.getDefaultAppInitData();
|
|
@@ -17970,6 +18199,11 @@ class TsEmbed {
|
|
|
17970
18199
|
.join('/');
|
|
17971
18200
|
return `${basePath}#`;
|
|
17972
18201
|
}
|
|
18202
|
+
getUpdateEmbedParamsObject() {
|
|
18203
|
+
let queryParams = this.getEmbedParamsObject();
|
|
18204
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18205
|
+
return queryParams;
|
|
18206
|
+
}
|
|
17973
18207
|
/**
|
|
17974
18208
|
* Common query params set for all the embed modes.
|
|
17975
18209
|
* @param queryParams
|
|
@@ -18119,9 +18353,13 @@ class TsEmbed {
|
|
|
18119
18353
|
return path;
|
|
18120
18354
|
}
|
|
18121
18355
|
getEmbedParams() {
|
|
18122
|
-
const queryParams = this.
|
|
18356
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18123
18357
|
return getQueryParamString(queryParams);
|
|
18124
18358
|
}
|
|
18359
|
+
getEmbedParamsObject() {
|
|
18360
|
+
const params = this.getBaseQueryParams();
|
|
18361
|
+
return params;
|
|
18362
|
+
}
|
|
18125
18363
|
getRootIframeSrc() {
|
|
18126
18364
|
const query = this.getEmbedParams();
|
|
18127
18365
|
return this.getEmbedBasePath(query);
|
|
@@ -18192,6 +18430,8 @@ class TsEmbed {
|
|
|
18192
18430
|
type: EmbedEvent.Init,
|
|
18193
18431
|
});
|
|
18194
18432
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
18433
|
+
// Always subscribe to network events, regardless of auth status
|
|
18434
|
+
this.subscribeToNetworkEvents();
|
|
18195
18435
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
18196
18436
|
if (!isLoggedIn) {
|
|
18197
18437
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
@@ -18234,7 +18474,9 @@ class TsEmbed {
|
|
|
18234
18474
|
el.remove();
|
|
18235
18475
|
});
|
|
18236
18476
|
}
|
|
18237
|
-
|
|
18477
|
+
// Subscribe to message events only after successful
|
|
18478
|
+
// auth and iframe setup
|
|
18479
|
+
this.subscribeToMessageEvents();
|
|
18238
18480
|
}).catch((error) => {
|
|
18239
18481
|
nextInQueue();
|
|
18240
18482
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
@@ -18367,9 +18609,8 @@ class TsEmbed {
|
|
|
18367
18609
|
// When start status is false it trigger only end releated
|
|
18368
18610
|
// payload
|
|
18369
18611
|
|| (!callbackObj.options.start && dataStatus === embedEventStatus.END)) {
|
|
18370
|
-
|
|
18371
|
-
|
|
18372
|
-
});
|
|
18612
|
+
const responder = this.createEmbedEventResponder(eventPort, eventType);
|
|
18613
|
+
callbackObj.callback(data, responder);
|
|
18373
18614
|
}
|
|
18374
18615
|
});
|
|
18375
18616
|
}
|
|
@@ -18554,6 +18795,12 @@ class TsEmbed {
|
|
|
18554
18795
|
this.handleError('Host event type is undefined');
|
|
18555
18796
|
return null;
|
|
18556
18797
|
}
|
|
18798
|
+
// Check if iframe exists before triggering -
|
|
18799
|
+
// this prevents the error when auth fails
|
|
18800
|
+
if (!this.iFrame) {
|
|
18801
|
+
logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
|
|
18802
|
+
return null;
|
|
18803
|
+
}
|
|
18557
18804
|
// send an empty object, this is needed for liveboard default handlers
|
|
18558
18805
|
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
18559
18806
|
}
|
|
@@ -18686,7 +18933,12 @@ class TsEmbed {
|
|
|
18686
18933
|
return this.preRender(true);
|
|
18687
18934
|
}
|
|
18688
18935
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
18936
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
18937
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18938
|
+
this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
18939
|
+
});
|
|
18689
18940
|
}
|
|
18941
|
+
this.beforePrerenderVisible();
|
|
18690
18942
|
if (this.el) {
|
|
18691
18943
|
this.syncPreRenderStyle();
|
|
18692
18944
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -18703,7 +18955,6 @@ class TsEmbed {
|
|
|
18703
18955
|
this.resizeObserver.observe(this.el);
|
|
18704
18956
|
}
|
|
18705
18957
|
}
|
|
18706
|
-
this.beforePrerenderVisible();
|
|
18707
18958
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
18708
18959
|
this.subscribeToEvents();
|
|
18709
18960
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -18892,15 +19143,9 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
|
|
|
18892
19143
|
this.embedComponentType = 'SearchBarEmbed';
|
|
18893
19144
|
this.viewConfig = viewConfig;
|
|
18894
19145
|
}
|
|
18895
|
-
|
|
18896
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18897
|
-
* loaded in the iframe
|
|
18898
|
-
* @param dataSources A list of data source GUIDs
|
|
18899
|
-
*/
|
|
18900
|
-
getIFrameSrc() {
|
|
19146
|
+
getEmbedParamsObject() {
|
|
18901
19147
|
var _a;
|
|
18902
19148
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
18903
|
-
const path = 'search-bar-embed';
|
|
18904
19149
|
const queryParams = this.getBaseQueryParams();
|
|
18905
19150
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18906
19151
|
if (dataSources && dataSources.length) {
|
|
@@ -18922,6 +19167,16 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
|
|
|
18922
19167
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
18923
19168
|
}
|
|
18924
19169
|
queryParams[Param.searchEmbed] = true;
|
|
19170
|
+
return queryParams;
|
|
19171
|
+
}
|
|
19172
|
+
/**
|
|
19173
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
19174
|
+
* loaded in the iframe
|
|
19175
|
+
* @param dataSources A list of data source GUIDs
|
|
19176
|
+
*/
|
|
19177
|
+
getIFrameSrc() {
|
|
19178
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19179
|
+
const path = 'search-bar-embed';
|
|
18925
19180
|
let query = '';
|
|
18926
19181
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18927
19182
|
if (queryParamsString) {
|
|
@@ -18972,12 +19227,7 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
|
|
|
18972
19227
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
18973
19228
|
super(domSelector, viewConfig);
|
|
18974
19229
|
}
|
|
18975
|
-
|
|
18976
|
-
* Constructs a map of parameters to be passed on to the
|
|
18977
|
-
* embedded Eureka or Sage search page.
|
|
18978
|
-
* @returns {string} query string
|
|
18979
|
-
*/
|
|
18980
|
-
getEmbedParams() {
|
|
19230
|
+
getEmbedParamsObject() {
|
|
18981
19231
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
18982
19232
|
const params = this.getBaseQueryParams();
|
|
18983
19233
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -18992,6 +19242,15 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
|
|
|
18992
19242
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18993
19243
|
params[Param.IsProductTour] = !!isProductTour;
|
|
18994
19244
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
19245
|
+
return params;
|
|
19246
|
+
}
|
|
19247
|
+
/**
|
|
19248
|
+
* Constructs a map of parameters to be passed on to the
|
|
19249
|
+
* embedded Eureka or Sage search page.
|
|
19250
|
+
* @returns {string} query string
|
|
19251
|
+
*/
|
|
19252
|
+
getEmbedParams() {
|
|
19253
|
+
const params = this.getEmbedParamsObject();
|
|
18995
19254
|
return getQueryParamString(params, true);
|
|
18996
19255
|
}
|
|
18997
19256
|
/**
|
|
@@ -19101,11 +19360,9 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
19101
19360
|
const defaultAppInitData = await super.getAppInitData();
|
|
19102
19361
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19103
19362
|
}
|
|
19104
|
-
|
|
19363
|
+
getEmbedParamsObject() {
|
|
19105
19364
|
var _a;
|
|
19106
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
19107
|
-
/* eslint-disable-next-line max-len */
|
|
19108
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19365
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19109
19366
|
const queryParams = this.getBaseQueryParams();
|
|
19110
19367
|
queryParams[Param.HideActions] = [
|
|
19111
19368
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19137,8 +19394,8 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
19137
19394
|
if (hideSearchBar) {
|
|
19138
19395
|
queryParams[Param.HideSearchBar] = true;
|
|
19139
19396
|
}
|
|
19140
|
-
|
|
19141
|
-
|
|
19397
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
19398
|
+
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19142
19399
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19143
19400
|
}
|
|
19144
19401
|
if (!focusSearchBarOnRender) {
|
|
@@ -19151,20 +19408,22 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
19151
19408
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19152
19409
|
}
|
|
19153
19410
|
queryParams[Param.searchEmbed] = true;
|
|
19154
|
-
/* eslint-disable-next-line max-len */
|
|
19155
19411
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
19156
19412
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19157
19413
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
19158
19414
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
19159
19415
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
19160
19416
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
19161
|
-
/* eslint-disable-next-line max-len */
|
|
19162
19417
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
19163
19418
|
}
|
|
19164
19419
|
else {
|
|
19165
|
-
/* eslint-disable-next-line max-len */
|
|
19166
19420
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
19167
19421
|
}
|
|
19422
|
+
return queryParams;
|
|
19423
|
+
}
|
|
19424
|
+
getEmbedParams() {
|
|
19425
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
19426
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19168
19427
|
let query = '';
|
|
19169
19428
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19170
19429
|
if (queryParamsString) {
|
|
@@ -19397,7 +19656,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19397
19656
|
* embedded Liveboard or visualization.
|
|
19398
19657
|
*/
|
|
19399
19658
|
getEmbedParams() {
|
|
19400
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
|
|
19659
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19401
19660
|
let params = {};
|
|
19402
19661
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19403
19662
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19450,7 +19709,8 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19450
19709
|
if (enableAskSage) {
|
|
19451
19710
|
params[Param.enableAskSage] = enableAskSage;
|
|
19452
19711
|
}
|
|
19453
|
-
|
|
19712
|
+
const { enableApiIntercept } = getInterceptInitData(this.embedConfig, this.viewConfig);
|
|
19713
|
+
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
19454
19714
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19455
19715
|
}
|
|
19456
19716
|
if (homePageSearchBarMode) {
|
|
@@ -19465,6 +19725,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
19465
19725
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19466
19726
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19467
19727
|
}
|
|
19728
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19729
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19730
|
+
}
|
|
19468
19731
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19469
19732
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19470
19733
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19812,9 +20075,14 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
19812
20075
|
* embedded Liveboard or visualization.
|
|
19813
20076
|
*/
|
|
19814
20077
|
getEmbedParams() {
|
|
20078
|
+
const params = this.getEmbedParamsObject();
|
|
20079
|
+
const queryParams = getQueryParamString(params, true);
|
|
20080
|
+
return queryParams;
|
|
20081
|
+
}
|
|
20082
|
+
getEmbedParamsObject() {
|
|
19815
20083
|
let params = {};
|
|
19816
20084
|
params = this.getBaseQueryParams(params);
|
|
19817
|
-
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 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
|
|
20085
|
+
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 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
|
|
19818
20086
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19819
20087
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19820
20088
|
if (fullHeight === true) {
|
|
@@ -19879,6 +20147,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
19879
20147
|
if (showSpotterLimitations !== undefined) {
|
|
19880
20148
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19881
20149
|
}
|
|
20150
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
20151
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
20152
|
+
}
|
|
19882
20153
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19883
20154
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19884
20155
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -19888,8 +20159,8 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
19888
20159
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19889
20160
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
19890
20161
|
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19891
|
-
|
|
19892
|
-
return
|
|
20162
|
+
getQueryParamString(params, true);
|
|
20163
|
+
return params;
|
|
19893
20164
|
}
|
|
19894
20165
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
19895
20166
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -20447,13 +20718,17 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
|
|
|
20447
20718
|
super(container, viewConfig);
|
|
20448
20719
|
this.viewConfig = viewConfig;
|
|
20449
20720
|
}
|
|
20450
|
-
|
|
20721
|
+
getEmbedParamsObject() {
|
|
20451
20722
|
var _a;
|
|
20452
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20453
|
-
const path = 'conv-assist-answer';
|
|
20454
20723
|
const queryParams = this.getBaseQueryParams();
|
|
20455
20724
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
20456
20725
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
20726
|
+
return queryParams;
|
|
20727
|
+
}
|
|
20728
|
+
getIframeSrc() {
|
|
20729
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20730
|
+
const path = 'conv-assist-answer';
|
|
20731
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20457
20732
|
let query = '';
|
|
20458
20733
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20459
20734
|
if (queryParamsString) {
|
|
@@ -20609,9 +20884,8 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
20609
20884
|
super(container, viewConfig);
|
|
20610
20885
|
this.viewConfig = viewConfig;
|
|
20611
20886
|
}
|
|
20612
|
-
|
|
20887
|
+
getEmbedParamsObject() {
|
|
20613
20888
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20614
|
-
const path = 'insights/conv-assist';
|
|
20615
20889
|
if (!worksheetId) {
|
|
20616
20890
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20617
20891
|
}
|
|
@@ -20632,6 +20906,12 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
20632
20906
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
20633
20907
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20634
20908
|
}
|
|
20909
|
+
return queryParams;
|
|
20910
|
+
}
|
|
20911
|
+
getIframeSrc() {
|
|
20912
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20913
|
+
const path = 'insights/conv-assist';
|
|
20914
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20635
20915
|
let query = '';
|
|
20636
20916
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20637
20917
|
if (queryParamsString) {
|