@thoughtspot/visual-embed-sdk 1.41.0 → 1.42.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/README.md +2 -4
- package/cjs/package.json +8 -8
- package/cjs/src/authToken.d.ts +1 -0
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +13 -3
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.js +29 -0
- package/cjs/src/authToken.spec.js.map +1 -1
- package/cjs/src/css-variables.d.ts +54 -15
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +16 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +10 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/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 +3 -2
- 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/liveboard.d.ts +33 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +13 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +98 -11
- 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/sage.spec.js +20 -10
- package/cjs/src/embed/sage.spec.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 +7 -8
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +10 -10
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +7 -5
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +26 -9
- package/cjs/src/embed/ts-embed.js.map +1 -1
- 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/react/all-types-export.spec.js +1 -1
- package/cjs/src/react/all-types-export.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +2 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +1 -1
- package/cjs/src/react/index.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 +64 -9
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +59 -4
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +14 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +22 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +10 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-B_mxAan8.js → index-BpSohedu.js} +1 -1
- package/dist/src/authToken.d.ts +1 -0
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +54 -15
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +16 -0
- 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 +3 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +33 -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 +7 -5
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/index.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 +64 -9
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +14 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +180 -47
- package/dist/tsembed-react.js +179 -46
- package/dist/tsembed.es.js +178 -46
- package/dist/tsembed.js +177 -45
- package/dist/visual-embed-sdk-react-full.d.ts +9312 -9842
- package/dist/visual-embed-sdk-react.d.ts +9184 -9848
- package/dist/visual-embed-sdk.d.ts +9351 -9459
- package/lib/package.json +8 -8
- package/lib/src/authToken.d.ts +1 -0
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +11 -2
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.js +30 -1
- package/lib/src/authToken.spec.js.map +1 -1
- package/lib/src/css-variables.d.ts +54 -15
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +16 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/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 +3 -2
- 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/liveboard.d.ts +33 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +13 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +98 -11
- 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/sage.spec.js +20 -10
- package/lib/src/embed/sage.spec.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 +7 -8
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +11 -11
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +7 -5
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +26 -9
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/react/all-types-export.spec.js +1 -1
- package/lib/src/react/all-types-export.spec.js.map +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +2 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +1 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/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 +64 -9
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +59 -4
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +14 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +20 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +11 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/package.json +8 -8
- package/src/authToken.spec.ts +48 -1
- package/src/authToken.ts +13 -2
- package/src/css-variables.ts +55 -17
- package/src/embed/app.spec.ts +14 -0
- package/src/embed/app.ts +23 -1
- package/src/embed/bodyless-conversation.ts +8 -3
- package/src/embed/conversation.ts +19 -4
- package/src/embed/liveboard.spec.ts +126 -14
- package/src/embed/liveboard.ts +72 -24
- package/src/embed/sage.spec.ts +24 -10
- package/src/embed/sage.ts +14 -9
- package/src/embed/search-bar.tsx +14 -7
- package/src/embed/search.spec.ts +13 -14
- package/src/embed/search.ts +19 -8
- package/src/embed/ts-embed.spec.ts +1 -1
- package/src/embed/ts-embed.ts +35 -13
- package/src/errors.ts +1 -0
- package/src/react/all-types-export.spec.ts +1 -1
- package/src/react/index.spec.tsx +1 -1
- package/src/react/index.tsx +4 -2
- package/src/react/util.spec.tsx +88 -0
- package/src/react/util.ts +3 -3
- package/src/types.ts +125 -69
- package/src/utils.spec.ts +18 -0
- package/src/utils.ts +21 -0
- package/lib/src/visual-embed-sdk.d.ts +0 -9705
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -463,6 +463,26 @@ const calculateVisibleElementData = (element) => {
|
|
|
463
463
|
width: Math.max(0, frameRelativeRight - frameRelativeLeft),
|
|
464
464
|
};
|
|
465
465
|
return data;
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* Replaces placeholders in a template string with provided values.
|
|
469
|
+
* Placeholders should be in the format {key}.
|
|
470
|
+
* @param template - The template string with placeholders
|
|
471
|
+
* @param values - An object containing key-value pairs to replace placeholders
|
|
472
|
+
* @returns The template string with placeholders replaced
|
|
473
|
+
* @example
|
|
474
|
+
* formatTemplate('Hello {name}, you are {age} years old', { name: 'John', age: 30 })
|
|
475
|
+
* // Returns: 'Hello John, you are 30 years old'
|
|
476
|
+
*
|
|
477
|
+
* formatTemplate('Expected {type}, but received {actual}', { type: 'string', actual: 'number' })
|
|
478
|
+
* // Returns: 'Expected string, but received number'
|
|
479
|
+
*/
|
|
480
|
+
const formatTemplate = (template, values) => {
|
|
481
|
+
// This regex /\{(\w+)\}/g finds all placeholders in the format {word}
|
|
482
|
+
// and captures the word inside the braces for replacement.
|
|
483
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => {
|
|
484
|
+
return values[key] !== undefined ? String(values[key]) : match;
|
|
485
|
+
});
|
|
466
486
|
};
|
|
467
487
|
|
|
468
488
|
/**
|
|
@@ -2744,21 +2764,42 @@ var HostEvent;
|
|
|
2744
2764
|
*/
|
|
2745
2765
|
HostEvent["Share"] = "share";
|
|
2746
2766
|
/**
|
|
2747
|
-
* Trigger the **Save**
|
|
2767
|
+
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
2748
2768
|
* Saves the changes.
|
|
2749
|
-
*
|
|
2769
|
+
*
|
|
2770
|
+
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
2771
|
+
* It is required and can be retrieved from the data embed event.
|
|
2772
|
+
*
|
|
2750
2773
|
* @example
|
|
2751
2774
|
* ```js
|
|
2775
|
+
* // Save changes in a Liveboard
|
|
2752
2776
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
2753
2777
|
* ```
|
|
2778
|
+
*
|
|
2754
2779
|
* ```js
|
|
2780
|
+
* // Save the current Answer in Search embed
|
|
2755
2781
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2756
2782
|
* ```
|
|
2783
|
+
*
|
|
2757
2784
|
* ```js
|
|
2785
|
+
* // Save an Answer in Spotter (requires vizId)
|
|
2758
2786
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2759
|
-
*
|
|
2787
|
+
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2760
2788
|
* })
|
|
2761
2789
|
* ```
|
|
2790
|
+
*
|
|
2791
|
+
* ```js
|
|
2792
|
+
* // How to get the vizId in Spotter?
|
|
2793
|
+
*
|
|
2794
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId.
|
|
2795
|
+
* let latestSpotterVizId = '';
|
|
2796
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2797
|
+
* latestSpotterVizId = payload.data.id;
|
|
2798
|
+
* });
|
|
2799
|
+
*
|
|
2800
|
+
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2801
|
+
* ```
|
|
2802
|
+
*
|
|
2762
2803
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2763
2804
|
*/
|
|
2764
2805
|
HostEvent["Save"] = "save";
|
|
@@ -2896,7 +2937,7 @@ var HostEvent;
|
|
|
2896
2937
|
* column: "Date",
|
|
2897
2938
|
* oper: 'EQ',
|
|
2898
2939
|
* values: ["2023-07-31"],
|
|
2899
|
-
*
|
|
2940
|
+
* type: "EXACT_DATE"
|
|
2900
2941
|
* }]
|
|
2901
2942
|
* });
|
|
2902
2943
|
* ```
|
|
@@ -3242,6 +3283,16 @@ var HostEvent;
|
|
|
3242
3283
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3243
3284
|
*/
|
|
3244
3285
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3286
|
+
/**
|
|
3287
|
+
* @hidden
|
|
3288
|
+
* Triggers the update of the embed params.
|
|
3289
|
+
*
|
|
3290
|
+
* @example
|
|
3291
|
+
* ```js
|
|
3292
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3293
|
+
* ```
|
|
3294
|
+
*/
|
|
3295
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3245
3296
|
})(HostEvent || (HostEvent = {}));
|
|
3246
3297
|
/**
|
|
3247
3298
|
* The different visual modes that the data sources panel within
|
|
@@ -3388,6 +3439,7 @@ var Param;
|
|
|
3388
3439
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3389
3440
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3390
3441
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3442
|
+
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3391
3443
|
})(Param || (Param = {}));
|
|
3392
3444
|
/**
|
|
3393
3445
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4669,6 +4721,29 @@ var Action;
|
|
|
4669
4721
|
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4670
4722
|
*/
|
|
4671
4723
|
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4724
|
+
/**
|
|
4725
|
+
* The **PNG screenshot in email** option in the schedule email dialog.
|
|
4726
|
+
* Includes a PNG screenshot in the notification email body.
|
|
4727
|
+
* @example
|
|
4728
|
+
* ```js
|
|
4729
|
+
* disabledActions: [Action.PngScreenshotInEmail]
|
|
4730
|
+
* ```
|
|
4731
|
+
* ```
|
|
4732
|
+
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4733
|
+
*/
|
|
4734
|
+
Action["PngScreenshotInEmail"] = "pngScreenshotInEmail";
|
|
4735
|
+
/**
|
|
4736
|
+
* The **Remove attachment** action in the schedule email dialog.
|
|
4737
|
+
* Removes an attachment from the email configuration.
|
|
4738
|
+
* @example
|
|
4739
|
+
* ```js
|
|
4740
|
+
* disabledActions: [Action.RemoveAttachment]
|
|
4741
|
+
* ```
|
|
4742
|
+
* ```
|
|
4743
|
+
* ```
|
|
4744
|
+
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4745
|
+
*/
|
|
4746
|
+
Action["RemoveAttachment"] = "removeAttachment";
|
|
4672
4747
|
})(Action || (Action = {}));
|
|
4673
4748
|
var PrefetchFeatures;
|
|
4674
4749
|
(function (PrefetchFeatures) {
|
|
@@ -7148,6 +7223,7 @@ const ERROR_MESSAGE = {
|
|
|
7148
7223
|
SDK_NOT_INITIALIZED: 'SDK not initialized',
|
|
7149
7224
|
SESSION_INFO_FAILED: 'Failed to get session information',
|
|
7150
7225
|
INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
|
|
7226
|
+
INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
|
|
7151
7227
|
MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
|
|
7152
7228
|
PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
|
|
7153
7229
|
SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
|
|
@@ -7328,6 +7404,15 @@ async function getAuthenticationToken(embedConfig) {
|
|
|
7328
7404
|
return authToken;
|
|
7329
7405
|
}
|
|
7330
7406
|
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
7407
|
+
// even if token verification is disabled, we will still validate
|
|
7408
|
+
// that the token is a string before proceeding.
|
|
7409
|
+
if (typeof authToken !== 'string') {
|
|
7410
|
+
const errorMessage = formatTemplate(ERROR_MESSAGE.INVALID_TOKEN_TYPE_ERROR, {
|
|
7411
|
+
invalidType: typeof authToken,
|
|
7412
|
+
});
|
|
7413
|
+
logger$3.error(errorMessage);
|
|
7414
|
+
throw new Error(errorMessage);
|
|
7415
|
+
}
|
|
7331
7416
|
const cachedAuthToken = getCacheAuthToken();
|
|
7332
7417
|
if (embedConfig.disableTokenVerification) {
|
|
7333
7418
|
logger$3.info('Token verification is disabled. Assuming token is valid.');
|
|
@@ -8056,7 +8141,7 @@ class AnswerService {
|
|
|
8056
8141
|
async getTML() {
|
|
8057
8142
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8058
8143
|
const edoc = object[0].edoc;
|
|
8059
|
-
const YAML = await import('./index-
|
|
8144
|
+
const YAML = await import('./index-BpSohedu.js');
|
|
8060
8145
|
const parsedDoc = YAML.parse(edoc);
|
|
8061
8146
|
return {
|
|
8062
8147
|
answer: {
|
|
@@ -17395,7 +17480,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
17395
17480
|
return e;
|
|
17396
17481
|
}
|
|
17397
17482
|
|
|
17398
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17483
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.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.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};
|
|
17399
17484
|
|
|
17400
17485
|
/**
|
|
17401
17486
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17706,10 +17791,10 @@ class TsEmbed {
|
|
|
17706
17791
|
};
|
|
17707
17792
|
this.showPreRenderByDefault = false;
|
|
17708
17793
|
/**
|
|
17709
|
-
|
|
17710
|
-
|
|
17711
|
-
|
|
17712
|
-
|
|
17794
|
+
* @hidden
|
|
17795
|
+
* Internal state to track if the embed container is loaded.
|
|
17796
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17797
|
+
*/
|
|
17713
17798
|
this.isEmbedContainerLoaded = false;
|
|
17714
17799
|
/**
|
|
17715
17800
|
* @hidden
|
|
@@ -17768,10 +17853,10 @@ class TsEmbed {
|
|
|
17768
17853
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
17769
17854
|
...viewConfig,
|
|
17770
17855
|
});
|
|
17856
|
+
const embedConfig = getEmbedConfig();
|
|
17857
|
+
this.embedConfig = embedConfig;
|
|
17771
17858
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
17772
17859
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17773
|
-
const embedConfig = getEmbedConfig();
|
|
17774
|
-
this.embedConfig = embedConfig;
|
|
17775
17860
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
17776
17861
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
17777
17862
|
}
|
|
@@ -17967,6 +18052,11 @@ class TsEmbed {
|
|
|
17967
18052
|
.join('/');
|
|
17968
18053
|
return `${basePath}#`;
|
|
17969
18054
|
}
|
|
18055
|
+
getUpdateEmbedParamsObject() {
|
|
18056
|
+
let queryParams = this.getEmbedParamsObject();
|
|
18057
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18058
|
+
return queryParams;
|
|
18059
|
+
}
|
|
17970
18060
|
/**
|
|
17971
18061
|
* Common query params set for all the embed modes.
|
|
17972
18062
|
* @param queryParams
|
|
@@ -18116,9 +18206,13 @@ class TsEmbed {
|
|
|
18116
18206
|
return path;
|
|
18117
18207
|
}
|
|
18118
18208
|
getEmbedParams() {
|
|
18119
|
-
const queryParams = this.
|
|
18209
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18120
18210
|
return getQueryParamString(queryParams);
|
|
18121
18211
|
}
|
|
18212
|
+
getEmbedParamsObject() {
|
|
18213
|
+
const params = this.getBaseQueryParams();
|
|
18214
|
+
return params;
|
|
18215
|
+
}
|
|
18122
18216
|
getRootIframeSrc() {
|
|
18123
18217
|
const query = this.getEmbedParams();
|
|
18124
18218
|
return this.getEmbedBasePath(query);
|
|
@@ -18589,13 +18683,17 @@ class TsEmbed {
|
|
|
18589
18683
|
* Creates the preRender shell
|
|
18590
18684
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
18591
18685
|
*/
|
|
18592
|
-
async preRender(showPreRenderByDefault = false) {
|
|
18686
|
+
async preRender(showPreRenderByDefault = false, replaceExistingPreRender = false) {
|
|
18593
18687
|
if (!this.viewConfig.preRenderId) {
|
|
18594
18688
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
18595
18689
|
return this;
|
|
18596
18690
|
}
|
|
18597
18691
|
this.isPreRendered = true;
|
|
18598
18692
|
this.showPreRenderByDefault = showPreRenderByDefault;
|
|
18693
|
+
const isAlreadyRendered = this.connectPreRendered();
|
|
18694
|
+
if (isAlreadyRendered && !replaceExistingPreRender) {
|
|
18695
|
+
return this;
|
|
18696
|
+
}
|
|
18599
18697
|
return this.handleRenderForPrerender();
|
|
18600
18698
|
}
|
|
18601
18699
|
/**
|
|
@@ -18679,7 +18777,12 @@ class TsEmbed {
|
|
|
18679
18777
|
return this.preRender(true);
|
|
18680
18778
|
}
|
|
18681
18779
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
18780
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
18781
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18782
|
+
this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
18783
|
+
});
|
|
18682
18784
|
}
|
|
18785
|
+
this.beforePrerenderVisible();
|
|
18683
18786
|
if (this.el) {
|
|
18684
18787
|
this.syncPreRenderStyle();
|
|
18685
18788
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -18696,7 +18799,6 @@ class TsEmbed {
|
|
|
18696
18799
|
this.resizeObserver.observe(this.el);
|
|
18697
18800
|
}
|
|
18698
18801
|
}
|
|
18699
|
-
this.beforePrerenderVisible();
|
|
18700
18802
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
18701
18803
|
this.subscribeToEvents();
|
|
18702
18804
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -19062,7 +19164,7 @@ class AppEmbed extends V1Embed {
|
|
|
19062
19164
|
* embedded Liveboard or visualization.
|
|
19063
19165
|
*/
|
|
19064
19166
|
getEmbedParams() {
|
|
19065
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 =
|
|
19167
|
+
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$1.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;
|
|
19066
19168
|
let params = {};
|
|
19067
19169
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19068
19170
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19127,6 +19229,9 @@ class AppEmbed extends V1Embed {
|
|
|
19127
19229
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19128
19230
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19129
19231
|
}
|
|
19232
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19233
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19234
|
+
}
|
|
19130
19235
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19131
19236
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19132
19237
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19474,9 +19579,14 @@ class LiveboardEmbed extends V1Embed {
|
|
|
19474
19579
|
* embedded Liveboard or visualization.
|
|
19475
19580
|
*/
|
|
19476
19581
|
getEmbedParams() {
|
|
19582
|
+
const params = this.getEmbedParamsObject();
|
|
19583
|
+
const queryParams = getQueryParamString(params, true);
|
|
19584
|
+
return queryParams;
|
|
19585
|
+
}
|
|
19586
|
+
getEmbedParamsObject() {
|
|
19477
19587
|
let params = {};
|
|
19478
19588
|
params = this.getBaseQueryParams(params);
|
|
19479
|
-
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 =
|
|
19589
|
+
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;
|
|
19480
19590
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19481
19591
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19482
19592
|
if (fullHeight === true) {
|
|
@@ -19535,6 +19645,12 @@ class LiveboardEmbed extends V1Embed {
|
|
|
19535
19645
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19536
19646
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19537
19647
|
}
|
|
19648
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19649
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19650
|
+
}
|
|
19651
|
+
if (showSpotterLimitations !== undefined) {
|
|
19652
|
+
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19653
|
+
}
|
|
19538
19654
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19539
19655
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19540
19656
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -19544,8 +19660,8 @@ class LiveboardEmbed extends V1Embed {
|
|
|
19544
19660
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19545
19661
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
19546
19662
|
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19547
|
-
|
|
19548
|
-
return
|
|
19663
|
+
getQueryParamString(params, true);
|
|
19664
|
+
return params;
|
|
19549
19665
|
}
|
|
19550
19666
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
19551
19667
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -19787,11 +19903,9 @@ class SearchEmbed extends TsEmbed {
|
|
|
19787
19903
|
const defaultAppInitData = await super.getAppInitData();
|
|
19788
19904
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19789
19905
|
}
|
|
19790
|
-
|
|
19906
|
+
getEmbedParamsObject() {
|
|
19791
19907
|
var _a;
|
|
19792
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 =
|
|
19793
|
-
/* eslint-disable-next-line max-len */
|
|
19794
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19908
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19795
19909
|
const queryParams = this.getBaseQueryParams();
|
|
19796
19910
|
queryParams[Param.HideActions] = [
|
|
19797
19911
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19824,7 +19938,6 @@ class SearchEmbed extends TsEmbed {
|
|
|
19824
19938
|
queryParams[Param.HideSearchBar] = true;
|
|
19825
19939
|
}
|
|
19826
19940
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19827
|
-
/* eslint-disable-next-line max-len */
|
|
19828
19941
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19829
19942
|
}
|
|
19830
19943
|
if (!focusSearchBarOnRender) {
|
|
@@ -19837,20 +19950,22 @@ class SearchEmbed extends TsEmbed {
|
|
|
19837
19950
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19838
19951
|
}
|
|
19839
19952
|
queryParams[Param.searchEmbed] = true;
|
|
19840
|
-
/* eslint-disable-next-line max-len */
|
|
19841
19953
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
19842
19954
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19843
19955
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
19844
19956
|
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
19845
19957
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
19846
19958
|
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
19847
|
-
/* eslint-disable-next-line max-len */
|
|
19848
19959
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
19849
19960
|
}
|
|
19850
19961
|
else {
|
|
19851
|
-
/* eslint-disable-next-line max-len */
|
|
19852
19962
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
19853
19963
|
}
|
|
19964
|
+
return queryParams;
|
|
19965
|
+
}
|
|
19966
|
+
getEmbedParams() {
|
|
19967
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
19968
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19854
19969
|
let query = '';
|
|
19855
19970
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19856
19971
|
if (queryParamsString) {
|
|
@@ -19906,15 +20021,9 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
19906
20021
|
this.embedComponentType = 'SearchBarEmbed';
|
|
19907
20022
|
this.viewConfig = viewConfig;
|
|
19908
20023
|
}
|
|
19909
|
-
|
|
19910
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
19911
|
-
* loaded in the iframe
|
|
19912
|
-
* @param dataSources A list of data source GUIDs
|
|
19913
|
-
*/
|
|
19914
|
-
getIFrameSrc() {
|
|
20024
|
+
getEmbedParamsObject() {
|
|
19915
20025
|
var _a;
|
|
19916
20026
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
19917
|
-
const path = 'search-bar-embed';
|
|
19918
20027
|
const queryParams = this.getBaseQueryParams();
|
|
19919
20028
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
19920
20029
|
if (dataSources && dataSources.length) {
|
|
@@ -19936,6 +20045,16 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
19936
20045
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19937
20046
|
}
|
|
19938
20047
|
queryParams[Param.searchEmbed] = true;
|
|
20048
|
+
return queryParams;
|
|
20049
|
+
}
|
|
20050
|
+
/**
|
|
20051
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
20052
|
+
* loaded in the iframe
|
|
20053
|
+
* @param dataSources A list of data source GUIDs
|
|
20054
|
+
*/
|
|
20055
|
+
getIFrameSrc() {
|
|
20056
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20057
|
+
const path = 'search-bar-embed';
|
|
19939
20058
|
let query = '';
|
|
19940
20059
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19941
20060
|
if (queryParamsString) {
|
|
@@ -20358,13 +20477,17 @@ class ConversationMessage extends TsEmbed {
|
|
|
20358
20477
|
super(container, viewConfig);
|
|
20359
20478
|
this.viewConfig = viewConfig;
|
|
20360
20479
|
}
|
|
20361
|
-
|
|
20480
|
+
getEmbedParamsObject() {
|
|
20362
20481
|
var _a;
|
|
20363
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20364
|
-
const path = 'conv-assist-answer';
|
|
20365
20482
|
const queryParams = this.getBaseQueryParams();
|
|
20366
20483
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
20367
20484
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
20485
|
+
return queryParams;
|
|
20486
|
+
}
|
|
20487
|
+
getIframeSrc() {
|
|
20488
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20489
|
+
const path = 'conv-assist-answer';
|
|
20490
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20368
20491
|
let query = '';
|
|
20369
20492
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20370
20493
|
if (queryParamsString) {
|
|
@@ -20525,9 +20648,8 @@ class SpotterEmbed extends TsEmbed {
|
|
|
20525
20648
|
super(container, viewConfig);
|
|
20526
20649
|
this.viewConfig = viewConfig;
|
|
20527
20650
|
}
|
|
20528
|
-
|
|
20651
|
+
getEmbedParamsObject() {
|
|
20529
20652
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20530
|
-
const path = 'insights/conv-assist';
|
|
20531
20653
|
if (!worksheetId) {
|
|
20532
20654
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20533
20655
|
}
|
|
@@ -20548,6 +20670,12 @@ class SpotterEmbed extends TsEmbed {
|
|
|
20548
20670
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
20549
20671
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20550
20672
|
}
|
|
20673
|
+
return queryParams;
|
|
20674
|
+
}
|
|
20675
|
+
getIframeSrc() {
|
|
20676
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20677
|
+
const path = 'insights/conv-assist';
|
|
20678
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20551
20679
|
let query = '';
|
|
20552
20680
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20553
20681
|
if (queryParamsString) {
|
|
@@ -20619,12 +20747,7 @@ class SageEmbed extends V1Embed {
|
|
|
20619
20747
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
20620
20748
|
super(domSelector, viewConfig);
|
|
20621
20749
|
}
|
|
20622
|
-
|
|
20623
|
-
* Constructs a map of parameters to be passed on to the
|
|
20624
|
-
* embedded Eureka or Sage search page.
|
|
20625
|
-
* @returns {string} query string
|
|
20626
|
-
*/
|
|
20627
|
-
getEmbedParams() {
|
|
20750
|
+
getEmbedParamsObject() {
|
|
20628
20751
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
20629
20752
|
const params = this.getBaseQueryParams();
|
|
20630
20753
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -20639,6 +20762,15 @@ class SageEmbed extends V1Embed {
|
|
|
20639
20762
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20640
20763
|
params[Param.IsProductTour] = !!isProductTour;
|
|
20641
20764
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
20765
|
+
return params;
|
|
20766
|
+
}
|
|
20767
|
+
/**
|
|
20768
|
+
* Constructs a map of parameters to be passed on to the
|
|
20769
|
+
* embedded Eureka or Sage search page.
|
|
20770
|
+
* @returns {string} query string
|
|
20771
|
+
*/
|
|
20772
|
+
getEmbedParams() {
|
|
20773
|
+
const params = this.getEmbedParamsObject();
|
|
20642
20774
|
return getQueryParamString(params, true);
|
|
20643
20775
|
}
|
|
20644
20776
|
/**
|