@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-react.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 (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -2484,21 +2484,42 @@
|
|
|
2484
2484
|
*/
|
|
2485
2485
|
HostEvent["Share"] = "share";
|
|
2486
2486
|
/**
|
|
2487
|
-
* Trigger the **Save**
|
|
2487
|
+
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
2488
2488
|
* Saves the changes.
|
|
2489
|
-
*
|
|
2489
|
+
*
|
|
2490
|
+
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
2491
|
+
* It is required and can be retrieved from the data embed event.
|
|
2492
|
+
*
|
|
2490
2493
|
* @example
|
|
2491
2494
|
* ```js
|
|
2495
|
+
* // Save changes in a Liveboard
|
|
2492
2496
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
2493
2497
|
* ```
|
|
2498
|
+
*
|
|
2494
2499
|
* ```js
|
|
2500
|
+
* // Save the current Answer in Search embed
|
|
2495
2501
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2496
2502
|
* ```
|
|
2503
|
+
*
|
|
2497
2504
|
* ```js
|
|
2505
|
+
* // Save an Answer in Spotter (requires vizId)
|
|
2498
2506
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2499
|
-
*
|
|
2507
|
+
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2500
2508
|
* })
|
|
2501
2509
|
* ```
|
|
2510
|
+
*
|
|
2511
|
+
* ```js
|
|
2512
|
+
* // How to get the vizId in Spotter?
|
|
2513
|
+
*
|
|
2514
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId.
|
|
2515
|
+
* let latestSpotterVizId = '';
|
|
2516
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2517
|
+
* latestSpotterVizId = payload.data.id;
|
|
2518
|
+
* });
|
|
2519
|
+
*
|
|
2520
|
+
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2521
|
+
* ```
|
|
2522
|
+
*
|
|
2502
2523
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2503
2524
|
*/
|
|
2504
2525
|
HostEvent["Save"] = "save";
|
|
@@ -2636,7 +2657,7 @@
|
|
|
2636
2657
|
* column: "Date",
|
|
2637
2658
|
* oper: 'EQ',
|
|
2638
2659
|
* values: ["2023-07-31"],
|
|
2639
|
-
*
|
|
2660
|
+
* type: "EXACT_DATE"
|
|
2640
2661
|
* }]
|
|
2641
2662
|
* });
|
|
2642
2663
|
* ```
|
|
@@ -2982,6 +3003,16 @@
|
|
|
2982
3003
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2983
3004
|
*/
|
|
2984
3005
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3006
|
+
/**
|
|
3007
|
+
* @hidden
|
|
3008
|
+
* Triggers the update of the embed params.
|
|
3009
|
+
*
|
|
3010
|
+
* @example
|
|
3011
|
+
* ```js
|
|
3012
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3013
|
+
* ```
|
|
3014
|
+
*/
|
|
3015
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2985
3016
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2986
3017
|
/**
|
|
2987
3018
|
* The different visual modes that the data sources panel within
|
|
@@ -3128,6 +3159,7 @@
|
|
|
3128
3159
|
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3129
3160
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3130
3161
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3162
|
+
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3131
3163
|
})(Param || (Param = {}));
|
|
3132
3164
|
/**
|
|
3133
3165
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4409,6 +4441,29 @@
|
|
|
4409
4441
|
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4410
4442
|
*/
|
|
4411
4443
|
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4444
|
+
/**
|
|
4445
|
+
* The **PNG screenshot in email** option in the schedule email dialog.
|
|
4446
|
+
* Includes a PNG screenshot in the notification email body.
|
|
4447
|
+
* @example
|
|
4448
|
+
* ```js
|
|
4449
|
+
* disabledActions: [Action.PngScreenshotInEmail]
|
|
4450
|
+
* ```
|
|
4451
|
+
* ```
|
|
4452
|
+
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4453
|
+
*/
|
|
4454
|
+
Action["PngScreenshotInEmail"] = "pngScreenshotInEmail";
|
|
4455
|
+
/**
|
|
4456
|
+
* The **Remove attachment** action in the schedule email dialog.
|
|
4457
|
+
* Removes an attachment from the email configuration.
|
|
4458
|
+
* @example
|
|
4459
|
+
* ```js
|
|
4460
|
+
* disabledActions: [Action.RemoveAttachment]
|
|
4461
|
+
* ```
|
|
4462
|
+
* ```
|
|
4463
|
+
* ```
|
|
4464
|
+
* @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
4465
|
+
*/
|
|
4466
|
+
Action["RemoveAttachment"] = "removeAttachment";
|
|
4412
4467
|
})(exports.Action || (exports.Action = {}));
|
|
4413
4468
|
var PrefetchFeatures;
|
|
4414
4469
|
(function (PrefetchFeatures) {
|
|
@@ -4997,6 +5052,26 @@
|
|
|
4997
5052
|
width: Math.max(0, frameRelativeRight - frameRelativeLeft),
|
|
4998
5053
|
};
|
|
4999
5054
|
return data;
|
|
5055
|
+
};
|
|
5056
|
+
/**
|
|
5057
|
+
* Replaces placeholders in a template string with provided values.
|
|
5058
|
+
* Placeholders should be in the format {key}.
|
|
5059
|
+
* @param template - The template string with placeholders
|
|
5060
|
+
* @param values - An object containing key-value pairs to replace placeholders
|
|
5061
|
+
* @returns The template string with placeholders replaced
|
|
5062
|
+
* @example
|
|
5063
|
+
* formatTemplate('Hello {name}, you are {age} years old', { name: 'John', age: 30 })
|
|
5064
|
+
* // Returns: 'Hello John, you are 30 years old'
|
|
5065
|
+
*
|
|
5066
|
+
* formatTemplate('Expected {type}, but received {actual}', { type: 'string', actual: 'number' })
|
|
5067
|
+
* // Returns: 'Expected string, but received number'
|
|
5068
|
+
*/
|
|
5069
|
+
const formatTemplate = (template, values) => {
|
|
5070
|
+
// This regex /\{(\w+)\}/g finds all placeholders in the format {word}
|
|
5071
|
+
// and captures the word inside the braces for replacement.
|
|
5072
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => {
|
|
5073
|
+
return values[key] !== undefined ? String(values[key]) : match;
|
|
5074
|
+
});
|
|
5000
5075
|
};
|
|
5001
5076
|
|
|
5002
5077
|
/**
|
|
@@ -7285,6 +7360,7 @@
|
|
|
7285
7360
|
SDK_NOT_INITIALIZED: 'SDK not initialized',
|
|
7286
7361
|
SESSION_INFO_FAILED: 'Failed to get session information',
|
|
7287
7362
|
INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
|
|
7363
|
+
INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
|
|
7288
7364
|
MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
|
|
7289
7365
|
PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
|
|
7290
7366
|
SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
|
|
@@ -7465,6 +7541,15 @@
|
|
|
7465
7541
|
return authToken;
|
|
7466
7542
|
}
|
|
7467
7543
|
const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
|
|
7544
|
+
// even if token verification is disabled, we will still validate
|
|
7545
|
+
// that the token is a string before proceeding.
|
|
7546
|
+
if (typeof authToken !== 'string') {
|
|
7547
|
+
const errorMessage = formatTemplate(ERROR_MESSAGE.INVALID_TOKEN_TYPE_ERROR, {
|
|
7548
|
+
invalidType: typeof authToken,
|
|
7549
|
+
});
|
|
7550
|
+
logger$3.error(errorMessage);
|
|
7551
|
+
throw new Error(errorMessage);
|
|
7552
|
+
}
|
|
7468
7553
|
const cachedAuthToken = getCacheAuthToken();
|
|
7469
7554
|
if (embedConfig.disableTokenVerification) {
|
|
7470
7555
|
logger$3.info('Token verification is disabled. Assuming token is valid.');
|
|
@@ -17366,7 +17451,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17366
17451
|
return e;
|
|
17367
17452
|
}
|
|
17368
17453
|
|
|
17369
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17454
|
+
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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.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$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
17370
17455
|
|
|
17371
17456
|
/**
|
|
17372
17457
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17677,10 +17762,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17677
17762
|
};
|
|
17678
17763
|
this.showPreRenderByDefault = false;
|
|
17679
17764
|
/**
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17765
|
+
* @hidden
|
|
17766
|
+
* Internal state to track if the embed container is loaded.
|
|
17767
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17768
|
+
*/
|
|
17684
17769
|
this.isEmbedContainerLoaded = false;
|
|
17685
17770
|
/**
|
|
17686
17771
|
* @hidden
|
|
@@ -17739,10 +17824,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17739
17824
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
17740
17825
|
...viewConfig,
|
|
17741
17826
|
});
|
|
17827
|
+
const embedConfig = getEmbedConfig();
|
|
17828
|
+
this.embedConfig = embedConfig;
|
|
17742
17829
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
17743
17830
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17744
|
-
const embedConfig = getEmbedConfig();
|
|
17745
|
-
this.embedConfig = embedConfig;
|
|
17746
17831
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
17747
17832
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
17748
17833
|
}
|
|
@@ -17938,6 +18023,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17938
18023
|
.join('/');
|
|
17939
18024
|
return `${basePath}#`;
|
|
17940
18025
|
}
|
|
18026
|
+
getUpdateEmbedParamsObject() {
|
|
18027
|
+
let queryParams = this.getEmbedParamsObject();
|
|
18028
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18029
|
+
return queryParams;
|
|
18030
|
+
}
|
|
17941
18031
|
/**
|
|
17942
18032
|
* Common query params set for all the embed modes.
|
|
17943
18033
|
* @param queryParams
|
|
@@ -18087,9 +18177,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18087
18177
|
return path;
|
|
18088
18178
|
}
|
|
18089
18179
|
getEmbedParams() {
|
|
18090
|
-
const queryParams = this.
|
|
18180
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18091
18181
|
return getQueryParamString(queryParams);
|
|
18092
18182
|
}
|
|
18183
|
+
getEmbedParamsObject() {
|
|
18184
|
+
const params = this.getBaseQueryParams();
|
|
18185
|
+
return params;
|
|
18186
|
+
}
|
|
18093
18187
|
getRootIframeSrc() {
|
|
18094
18188
|
const query = this.getEmbedParams();
|
|
18095
18189
|
return this.getEmbedBasePath(query);
|
|
@@ -18560,13 +18654,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18560
18654
|
* Creates the preRender shell
|
|
18561
18655
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
|
18562
18656
|
*/
|
|
18563
|
-
async preRender(showPreRenderByDefault = false) {
|
|
18657
|
+
async preRender(showPreRenderByDefault = false, replaceExistingPreRender = false) {
|
|
18564
18658
|
if (!this.viewConfig.preRenderId) {
|
|
18565
18659
|
logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
|
|
18566
18660
|
return this;
|
|
18567
18661
|
}
|
|
18568
18662
|
this.isPreRendered = true;
|
|
18569
18663
|
this.showPreRenderByDefault = showPreRenderByDefault;
|
|
18664
|
+
const isAlreadyRendered = this.connectPreRendered();
|
|
18665
|
+
if (isAlreadyRendered && !replaceExistingPreRender) {
|
|
18666
|
+
return this;
|
|
18667
|
+
}
|
|
18570
18668
|
return this.handleRenderForPrerender();
|
|
18571
18669
|
}
|
|
18572
18670
|
/**
|
|
@@ -18650,7 +18748,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18650
18748
|
return this.preRender(true);
|
|
18651
18749
|
}
|
|
18652
18750
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
18751
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
18752
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18753
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
18754
|
+
});
|
|
18653
18755
|
}
|
|
18756
|
+
this.beforePrerenderVisible();
|
|
18654
18757
|
if (this.el) {
|
|
18655
18758
|
this.syncPreRenderStyle();
|
|
18656
18759
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -18667,7 +18770,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18667
18770
|
this.resizeObserver.observe(this.el);
|
|
18668
18771
|
}
|
|
18669
18772
|
}
|
|
18670
|
-
this.beforePrerenderVisible();
|
|
18671
18773
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
18672
18774
|
this.subscribeToEvents();
|
|
18673
18775
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -18856,15 +18958,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18856
18958
|
this.embedComponentType = 'SearchBarEmbed';
|
|
18857
18959
|
this.viewConfig = viewConfig;
|
|
18858
18960
|
}
|
|
18859
|
-
|
|
18860
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18861
|
-
* loaded in the iframe
|
|
18862
|
-
* @param dataSources A list of data source GUIDs
|
|
18863
|
-
*/
|
|
18864
|
-
getIFrameSrc() {
|
|
18961
|
+
getEmbedParamsObject() {
|
|
18865
18962
|
var _a;
|
|
18866
18963
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
18867
|
-
const path = 'search-bar-embed';
|
|
18868
18964
|
const queryParams = this.getBaseQueryParams();
|
|
18869
18965
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18870
18966
|
if (dataSources && dataSources.length) {
|
|
@@ -18886,6 +18982,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18886
18982
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
18887
18983
|
}
|
|
18888
18984
|
queryParams[Param.searchEmbed] = true;
|
|
18985
|
+
return queryParams;
|
|
18986
|
+
}
|
|
18987
|
+
/**
|
|
18988
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18989
|
+
* loaded in the iframe
|
|
18990
|
+
* @param dataSources A list of data source GUIDs
|
|
18991
|
+
*/
|
|
18992
|
+
getIFrameSrc() {
|
|
18993
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18994
|
+
const path = 'search-bar-embed';
|
|
18889
18995
|
let query = '';
|
|
18890
18996
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18891
18997
|
if (queryParamsString) {
|
|
@@ -18936,12 +19042,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18936
19042
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
18937
19043
|
super(domSelector, viewConfig);
|
|
18938
19044
|
}
|
|
18939
|
-
|
|
18940
|
-
* Constructs a map of parameters to be passed on to the
|
|
18941
|
-
* embedded Eureka or Sage search page.
|
|
18942
|
-
* @returns {string} query string
|
|
18943
|
-
*/
|
|
18944
|
-
getEmbedParams() {
|
|
19045
|
+
getEmbedParamsObject() {
|
|
18945
19046
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
18946
19047
|
const params = this.getBaseQueryParams();
|
|
18947
19048
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -18956,6 +19057,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18956
19057
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18957
19058
|
params[Param.IsProductTour] = !!isProductTour;
|
|
18958
19059
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
19060
|
+
return params;
|
|
19061
|
+
}
|
|
19062
|
+
/**
|
|
19063
|
+
* Constructs a map of parameters to be passed on to the
|
|
19064
|
+
* embedded Eureka or Sage search page.
|
|
19065
|
+
* @returns {string} query string
|
|
19066
|
+
*/
|
|
19067
|
+
getEmbedParams() {
|
|
19068
|
+
const params = this.getEmbedParamsObject();
|
|
18959
19069
|
return getQueryParamString(params, true);
|
|
18960
19070
|
}
|
|
18961
19071
|
/**
|
|
@@ -19065,11 +19175,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19065
19175
|
const defaultAppInitData = await super.getAppInitData();
|
|
19066
19176
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19067
19177
|
}
|
|
19068
|
-
|
|
19178
|
+
getEmbedParamsObject() {
|
|
19069
19179
|
var _a;
|
|
19070
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 =
|
|
19071
|
-
/* eslint-disable-next-line max-len */
|
|
19072
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19180
|
+
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;
|
|
19073
19181
|
const queryParams = this.getBaseQueryParams();
|
|
19074
19182
|
queryParams[Param.HideActions] = [
|
|
19075
19183
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19102,7 +19210,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19102
19210
|
queryParams[Param.HideSearchBar] = true;
|
|
19103
19211
|
}
|
|
19104
19212
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19105
|
-
/* eslint-disable-next-line max-len */
|
|
19106
19213
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19107
19214
|
}
|
|
19108
19215
|
if (!focusSearchBarOnRender) {
|
|
@@ -19115,20 +19222,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19115
19222
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19116
19223
|
}
|
|
19117
19224
|
queryParams[Param.searchEmbed] = true;
|
|
19118
|
-
/* eslint-disable-next-line max-len */
|
|
19119
19225
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
19120
19226
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19121
19227
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
19122
19228
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
19123
19229
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
19124
19230
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
19125
|
-
/* eslint-disable-next-line max-len */
|
|
19126
19231
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
19127
19232
|
}
|
|
19128
19233
|
else {
|
|
19129
|
-
/* eslint-disable-next-line max-len */
|
|
19130
19234
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
19131
19235
|
}
|
|
19236
|
+
return queryParams;
|
|
19237
|
+
}
|
|
19238
|
+
getEmbedParams() {
|
|
19239
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
19240
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19132
19241
|
let query = '';
|
|
19133
19242
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19134
19243
|
if (queryParamsString) {
|
|
@@ -19361,7 +19470,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19361
19470
|
* embedded Liveboard or visualization.
|
|
19362
19471
|
*/
|
|
19363
19472
|
getEmbedParams() {
|
|
19364
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 =
|
|
19473
|
+
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;
|
|
19365
19474
|
let params = {};
|
|
19366
19475
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19367
19476
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19426,6 +19535,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19426
19535
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19427
19536
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19428
19537
|
}
|
|
19538
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19539
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19540
|
+
}
|
|
19429
19541
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19430
19542
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19431
19543
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19773,9 +19885,14 @@ query GetEurekaVizSnapshots(
|
|
|
19773
19885
|
* embedded Liveboard or visualization.
|
|
19774
19886
|
*/
|
|
19775
19887
|
getEmbedParams() {
|
|
19888
|
+
const params = this.getEmbedParamsObject();
|
|
19889
|
+
const queryParams = getQueryParamString(params, true);
|
|
19890
|
+
return queryParams;
|
|
19891
|
+
}
|
|
19892
|
+
getEmbedParamsObject() {
|
|
19776
19893
|
let params = {};
|
|
19777
19894
|
params = this.getBaseQueryParams(params);
|
|
19778
|
-
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 =
|
|
19895
|
+
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;
|
|
19779
19896
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19780
19897
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19781
19898
|
if (fullHeight === true) {
|
|
@@ -19834,6 +19951,12 @@ query GetEurekaVizSnapshots(
|
|
|
19834
19951
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
19835
19952
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
19836
19953
|
}
|
|
19954
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19955
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19956
|
+
}
|
|
19957
|
+
if (showSpotterLimitations !== undefined) {
|
|
19958
|
+
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19959
|
+
}
|
|
19837
19960
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19838
19961
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19839
19962
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -19843,8 +19966,8 @@ query GetEurekaVizSnapshots(
|
|
|
19843
19966
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19844
19967
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
19845
19968
|
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19846
|
-
|
|
19847
|
-
return
|
|
19969
|
+
getQueryParamString(params, true);
|
|
19970
|
+
return params;
|
|
19848
19971
|
}
|
|
19849
19972
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
19850
19973
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -20402,13 +20525,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20402
20525
|
super(container, viewConfig);
|
|
20403
20526
|
this.viewConfig = viewConfig;
|
|
20404
20527
|
}
|
|
20405
|
-
|
|
20528
|
+
getEmbedParamsObject() {
|
|
20406
20529
|
var _a;
|
|
20407
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20408
|
-
const path = 'conv-assist-answer';
|
|
20409
20530
|
const queryParams = this.getBaseQueryParams();
|
|
20410
20531
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
20411
20532
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
20533
|
+
return queryParams;
|
|
20534
|
+
}
|
|
20535
|
+
getIframeSrc() {
|
|
20536
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20537
|
+
const path = 'conv-assist-answer';
|
|
20538
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20412
20539
|
let query = '';
|
|
20413
20540
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20414
20541
|
if (queryParamsString) {
|
|
@@ -20564,9 +20691,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20564
20691
|
super(container, viewConfig);
|
|
20565
20692
|
this.viewConfig = viewConfig;
|
|
20566
20693
|
}
|
|
20567
|
-
|
|
20694
|
+
getEmbedParamsObject() {
|
|
20568
20695
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20569
|
-
const path = 'insights/conv-assist';
|
|
20570
20696
|
if (!worksheetId) {
|
|
20571
20697
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20572
20698
|
}
|
|
@@ -20587,6 +20713,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20587
20713
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
20588
20714
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20589
20715
|
}
|
|
20716
|
+
return queryParams;
|
|
20717
|
+
}
|
|
20718
|
+
getIframeSrc() {
|
|
20719
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20720
|
+
const path = 'insights/conv-assist';
|
|
20721
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20590
20722
|
let query = '';
|
|
20591
20723
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20592
20724
|
if (queryParamsString) {
|
|
@@ -20695,7 +20827,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20695
20827
|
handleDestroy(tsEmbed);
|
|
20696
20828
|
};
|
|
20697
20829
|
}, [viewConfig, listeners]);
|
|
20698
|
-
|
|
20830
|
+
const preRenderStyles = isPreRenderedComponent ? { display: 'none' } : {};
|
|
20831
|
+
return viewConfig.insertAsSibling ? (React.createElement("span", { "data-testid": "tsEmbed", ref: ref, style: { position: 'absolute', ...preRenderStyles } })) : (React.createElement("div", { "data-testid": "tsEmbed", ref: ref, style: { ...style, ...preRenderStyles }, className: `ts-embed-container ${className}` }));
|
|
20699
20832
|
});
|
|
20700
20833
|
/**
|
|
20701
20834
|
* React component for Search Embed.
|