@thoughtspot/visual-embed-sdk 1.39.1 → 1.39.2-alpha.2
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 +1 -1
- package/cjs/src/config.spec.js +9 -0
- package/cjs/src/config.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +75 -15
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +69 -9
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +374 -12
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +24 -4
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +28 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts +9 -7
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js +9 -7
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +56 -17
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +48 -4
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +215 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +5 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +16 -1
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +164 -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 +3 -2
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +71 -20
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +79 -42
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +436 -100
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +80 -6
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +45 -1
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
- package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/cjs/src/utils/processTrigger.js +2 -1
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/cjs/src/utils.d.ts +6 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +23 -3
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +237 -1
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-JaFaxrvQ.js → index-CmEQfuE3.js} +1 -1
- package/dist/index-DeFzsyFF.js +7371 -0
- package/dist/index-Dpf0rd6w.js +7371 -0
- package/dist/index-UuEbsISo.js +7447 -0
- package/dist/index-e3Uw3YFO.js +7371 -0
- package/dist/src/embed/app.d.ts +75 -15
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +19 -7
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts +9 -7
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +56 -17
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +5 -0
- 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/index.d.ts +71 -20
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +80 -6
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/dist/src/utils.d.ts +6 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +320 -78
- package/dist/tsembed-react.js +320 -76
- package/dist/tsembed.es.js +238 -31
- package/dist/tsembed.js +236 -29
- package/dist/visual-embed-sdk-react-full.d.ts +288 -72
- package/dist/visual-embed-sdk-react.d.ts +288 -72
- package/dist/visual-embed-sdk.d.ts +218 -53
- package/lib/package.json +1 -1
- package/lib/src/config.spec.js +9 -0
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +75 -15
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +69 -9
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +376 -14
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +19 -7
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +23 -4
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +9 -191
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +30 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts +9 -7
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js +9 -7
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +56 -17
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +49 -5
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +215 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +5 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +16 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +164 -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/index.d.ts +71 -20
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +79 -43
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +439 -103
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +80 -6
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +45 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
- package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/lib/src/utils/processTrigger.js +2 -1
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/lib/src/utils.d.ts +6 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +21 -2
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +238 -2
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +219 -54
- package/package.json +1 -1
- package/src/config.spec.ts +11 -0
- package/src/embed/app.spec.ts +479 -26
- package/src/embed/app.ts +133 -27
- package/src/embed/bodyless-conversation.spec.ts +9 -203
- package/src/embed/bodyless-conversation.ts +24 -10
- package/src/embed/conversation.spec.ts +40 -2
- package/src/embed/embedConfig.ts +10 -8
- package/src/embed/liveboard.spec.ts +256 -5
- package/src/embed/liveboard.ts +99 -27
- package/src/embed/ts-embed.spec.ts +225 -0
- package/src/embed/ts-embed.ts +19 -0
- package/src/errors.ts +1 -0
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +2 -1
- package/src/react/index.spec.tsx +556 -157
- package/src/react/index.tsx +117 -51
- package/src/types.ts +117 -43
- package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
- package/src/utils/processTrigger.ts +1 -1
- package/src/utils.spec.ts +279 -2
- package/src/utils.ts +28 -2
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.39.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.39.2-alpha.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -284,7 +284,6 @@
|
|
|
284
284
|
function removeTypename(obj) {
|
|
285
285
|
if (!obj || typeof obj !== 'object')
|
|
286
286
|
return obj;
|
|
287
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
288
287
|
for (const key in obj) {
|
|
289
288
|
if (key === '__typename') {
|
|
290
289
|
delete obj[key];
|
|
@@ -313,7 +312,11 @@
|
|
|
313
312
|
if (!(element === null || element === void 0 ? void 0 : element.style))
|
|
314
313
|
return;
|
|
315
314
|
Object.keys(styleProperties).forEach((styleProperty) => {
|
|
316
|
-
|
|
315
|
+
const styleKey = styleProperty;
|
|
316
|
+
const value = styleProperties[styleKey];
|
|
317
|
+
if (value !== undefined) {
|
|
318
|
+
element.style[styleKey] = value.toString();
|
|
319
|
+
}
|
|
317
320
|
});
|
|
318
321
|
};
|
|
319
322
|
/**
|
|
@@ -441,6 +444,22 @@
|
|
|
441
444
|
}
|
|
442
445
|
}
|
|
443
446
|
logger$3.warn('Exit fullscreen API is not supported by this browser.');
|
|
447
|
+
};
|
|
448
|
+
const calculateVisibleElementData = (element) => {
|
|
449
|
+
const rect = element.getBoundingClientRect();
|
|
450
|
+
const windowHeight = window.innerHeight;
|
|
451
|
+
const windowWidth = window.innerWidth;
|
|
452
|
+
const frameRelativeTop = Math.max(rect.top, 0);
|
|
453
|
+
const frameRelativeLeft = Math.max(rect.left, 0);
|
|
454
|
+
const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
|
|
455
|
+
const frameRelativeRight = Math.min(windowWidth, rect.right);
|
|
456
|
+
const data = {
|
|
457
|
+
top: Math.max(0, rect.top * -1),
|
|
458
|
+
height: Math.max(0, frameRelativeBottom - frameRelativeTop),
|
|
459
|
+
left: Math.max(0, rect.left * -1),
|
|
460
|
+
width: Math.max(0, frameRelativeRight - frameRelativeLeft),
|
|
461
|
+
};
|
|
462
|
+
return data;
|
|
444
463
|
};
|
|
445
464
|
|
|
446
465
|
/**
|
|
@@ -659,6 +678,12 @@
|
|
|
659
678
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
660
679
|
*/
|
|
661
680
|
HomeLeftNavItem["Spotter"] = "spotter";
|
|
681
|
+
/**
|
|
682
|
+
* Favorites option in the insights left navigation,
|
|
683
|
+
* available when new navigation V3 is enabled.
|
|
684
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
685
|
+
*/
|
|
686
|
+
HomeLeftNavItem["Favorites"] = "favorites";
|
|
662
687
|
})(exports.HomeLeftNavItem || (exports.HomeLeftNavItem = {}));
|
|
663
688
|
/**
|
|
664
689
|
* A map of the supported runtime filter operations
|
|
@@ -1845,6 +1870,12 @@
|
|
|
1845
1870
|
* @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
1846
1871
|
*/
|
|
1847
1872
|
EmbedEvent["ExitPresentMode"] = "exitPresentMode";
|
|
1873
|
+
/**
|
|
1874
|
+
* Emitted when a user requests the full height lazy load data.
|
|
1875
|
+
* @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
|
|
1876
|
+
* @hidden
|
|
1877
|
+
*/
|
|
1878
|
+
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1848
1879
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1849
1880
|
/**
|
|
1850
1881
|
* Event types that can be triggered by the host application
|
|
@@ -2929,6 +2960,19 @@
|
|
|
2929
2960
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2930
2961
|
*/
|
|
2931
2962
|
HostEvent["ExitPresentMode"] = "exitPresentMode";
|
|
2963
|
+
/**
|
|
2964
|
+
* Triggers the full height lazy load data.
|
|
2965
|
+
* @example
|
|
2966
|
+
* ```js
|
|
2967
|
+
* liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
|
|
2968
|
+
* console.log(payload);
|
|
2969
|
+
* });
|
|
2970
|
+
* ```
|
|
2971
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
2972
|
+
*
|
|
2973
|
+
* @hidden
|
|
2974
|
+
*/
|
|
2975
|
+
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2932
2976
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2933
2977
|
/**
|
|
2934
2978
|
* The different visual modes that the data sources panel within
|
|
@@ -3034,6 +3078,7 @@
|
|
|
3034
3078
|
Param["Query"] = "query";
|
|
3035
3079
|
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
3036
3080
|
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
3081
|
+
Param["ListPageVersion"] = "listpageVersion";
|
|
3037
3082
|
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
3038
3083
|
Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
|
|
3039
3084
|
Param["IsProductTour"] = "isProductTour";
|
|
@@ -3068,10 +3113,12 @@
|
|
|
3068
3113
|
Param["DataSourceId"] = "dataSourceId";
|
|
3069
3114
|
Param["preAuthCache"] = "preAuthCache";
|
|
3070
3115
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
3071
|
-
Param["CoverAndFilterOptionInPDF"] = "
|
|
3116
|
+
Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
|
|
3072
3117
|
Param["PrimaryAction"] = "primaryAction";
|
|
3073
3118
|
Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
|
|
3074
3119
|
Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
|
|
3120
|
+
Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
|
|
3121
|
+
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3075
3122
|
})(Param || (Param = {}));
|
|
3076
3123
|
/**
|
|
3077
3124
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -4294,6 +4341,22 @@
|
|
|
4294
4341
|
* @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4295
4342
|
*/
|
|
4296
4343
|
Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
4344
|
+
/**
|
|
4345
|
+
* Action ID for hide or disable the
|
|
4346
|
+
* Spotter in conversation training widget.
|
|
4347
|
+
* The Add to Coaching feature is currently in beta
|
|
4348
|
+
* and is disabled by default on embed deployments.
|
|
4349
|
+
* To enable this feature on your instance,
|
|
4350
|
+
* contact ThoughtSpot Support.
|
|
4351
|
+
* @example
|
|
4352
|
+
* ```js
|
|
4353
|
+
* hiddenAction: [Action.InConversationTraining]
|
|
4354
|
+
* disabledActions: [Action.InConversationTraining]
|
|
4355
|
+
*
|
|
4356
|
+
* ```
|
|
4357
|
+
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4358
|
+
*/
|
|
4359
|
+
Action["InConversationTraining"] = "InConversationTraining";
|
|
4297
4360
|
})(exports.Action || (exports.Action = {}));
|
|
4298
4361
|
exports.PrefetchFeatures = void 0;
|
|
4299
4362
|
(function (PrefetchFeatures) {
|
|
@@ -6760,6 +6823,7 @@
|
|
|
6760
6823
|
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
6761
6824
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
6762
6825
|
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',
|
|
6826
|
+
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
6763
6827
|
};
|
|
6764
6828
|
|
|
6765
6829
|
const EndPoints = {
|
|
@@ -6967,13 +7031,14 @@
|
|
|
6967
7031
|
*
|
|
6968
7032
|
* @example
|
|
6969
7033
|
* ```js
|
|
7034
|
+
* import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
|
|
7035
|
+
* // Call the getInitConfig method to retrieve the embed configuration
|
|
6970
7036
|
* const config = getInitConfig();
|
|
7037
|
+
* // Log the configuration settings
|
|
6971
7038
|
* console.log(config);
|
|
6972
7039
|
* ```
|
|
6973
|
-
*
|
|
6974
|
-
*
|
|
6975
|
-
* Returns the `EmbedConfig` object, which
|
|
6976
|
-
* contains the configuration settings used to
|
|
7040
|
+
* Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
|
|
7041
|
+
* object, which contains the configuration settings used to
|
|
6977
7042
|
* initialize the SDK, including the following:
|
|
6978
7043
|
*
|
|
6979
7044
|
* - `thoughtSpotHost` - ThoughtSpot host URL
|
|
@@ -6982,9 +7047,10 @@
|
|
|
6982
7047
|
* - `customizations` - Style, text, and icon customization settings
|
|
6983
7048
|
* that were applied during the SDK initialization.
|
|
6984
7049
|
*
|
|
6985
|
-
*
|
|
6986
|
-
*
|
|
7050
|
+
* The following JSON output shows the embed configuration
|
|
7051
|
+
* settings returned from the code in the previous example:
|
|
6987
7052
|
*
|
|
7053
|
+
* @example
|
|
6988
7054
|
* ```json
|
|
6989
7055
|
* {
|
|
6990
7056
|
* "thoughtSpotHost": "https://{ThoughtSpot-Host}",
|
|
@@ -7006,7 +7072,7 @@
|
|
|
7006
7072
|
* "authTriggerContainer": "#your-own-div"
|
|
7007
7073
|
* }
|
|
7008
7074
|
* ```
|
|
7009
|
-
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.
|
|
7075
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
|
|
7010
7076
|
* @group Global methods
|
|
7011
7077
|
*/
|
|
7012
7078
|
const getEmbedConfig = () => getValueFromWindow(configKey) || {};
|
|
@@ -15548,7 +15614,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15548
15614
|
return e;
|
|
15549
15615
|
}
|
|
15550
15616
|
|
|
15551
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.
|
|
15617
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-alpha.2";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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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 | coveralls","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":"^8.2.6","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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":"^1.1.1",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:"31 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};
|
|
15552
15618
|
|
|
15553
15619
|
/**
|
|
15554
15620
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15571,7 +15637,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15571
15637
|
* @param channel
|
|
15572
15638
|
*/
|
|
15573
15639
|
function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
|
|
15574
|
-
|
|
15640
|
+
var _a;
|
|
15641
|
+
return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
|
|
15575
15642
|
}
|
|
15576
15643
|
const TRIGGER_TIMEOUT = 30000;
|
|
15577
15644
|
/**
|
|
@@ -15946,10 +16013,25 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15946
16013
|
// - cached auth info would be for wrong org
|
|
15947
16014
|
// - info call response changes for each different overrideOrgId
|
|
15948
16015
|
// 2. disablePreauthCache is explicitly set to true
|
|
16016
|
+
// 3. FullAppEmbed has primary navbar visible since:
|
|
16017
|
+
// - primary navbar requires fresh auth state for navigation
|
|
16018
|
+
// - cached auth may not reflect current user permissions
|
|
15949
16019
|
const isDisabled = (this.viewConfig.overrideOrgId !== undefined
|
|
15950
|
-
|| this.embedConfig.disablePreauthCache === true
|
|
16020
|
+
|| this.embedConfig.disablePreauthCache === true
|
|
16021
|
+
|| this.isFullAppEmbedWithVisiblePrimaryNavbar());
|
|
15951
16022
|
return !isDisabled;
|
|
15952
16023
|
}
|
|
16024
|
+
/**
|
|
16025
|
+
* Checks if current embed is FullAppEmbed with visible primary navbar
|
|
16026
|
+
* @returns boolean
|
|
16027
|
+
*/
|
|
16028
|
+
isFullAppEmbedWithVisiblePrimaryNavbar() {
|
|
16029
|
+
const appViewConfig = this.viewConfig;
|
|
16030
|
+
// Check if this is a FullAppEmbed (AppEmbed)
|
|
16031
|
+
// showPrimaryNavbar defaults to true if not explicitly set to false
|
|
16032
|
+
return (appViewConfig.embedComponentType === 'AppEmbed'
|
|
16033
|
+
&& appViewConfig.showPrimaryNavbar === true);
|
|
16034
|
+
}
|
|
15953
16035
|
/**
|
|
15954
16036
|
* fix for ts7.sep.cl
|
|
15955
16037
|
* will be removed for ts7.oct.cl
|
|
@@ -16941,7 +17023,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16941
17023
|
/**
|
|
16942
17024
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
16943
17025
|
*/
|
|
16944
|
-
// eslint-disable-next-line no-shadow
|
|
16945
17026
|
exports.Page = void 0;
|
|
16946
17027
|
(function (Page) {
|
|
16947
17028
|
/**
|
|
@@ -17027,16 +17108,46 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17027
17108
|
*/
|
|
17028
17109
|
HomePage["Modular"] = "v2";
|
|
17029
17110
|
})(exports.HomePage || (exports.HomePage = {}));
|
|
17111
|
+
/**
|
|
17112
|
+
* Define the version of the list page
|
|
17113
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
17114
|
+
*/
|
|
17115
|
+
exports.ListPage = void 0;
|
|
17116
|
+
(function (ListPage) {
|
|
17117
|
+
/**
|
|
17118
|
+
* List (v2) is the traditional List Experience.
|
|
17119
|
+
* It serves as the foundational version of the list page.
|
|
17120
|
+
*/
|
|
17121
|
+
ListPage["List"] = "v2";
|
|
17122
|
+
/**
|
|
17123
|
+
* ListWithUXChanges (v3) introduces the new updated list page with UX changes.
|
|
17124
|
+
*/
|
|
17125
|
+
ListPage["ListWithUXChanges"] = "v3";
|
|
17126
|
+
})(exports.ListPage || (exports.ListPage = {}));
|
|
17030
17127
|
/**
|
|
17031
17128
|
* Embeds full ThoughtSpot experience in a host application.
|
|
17032
17129
|
* @group Embed components
|
|
17033
17130
|
*/
|
|
17034
17131
|
class AppEmbed extends V1Embed {
|
|
17035
|
-
// eslint-disable-next-line no-useless-constructor
|
|
17036
17132
|
constructor(domSelector, viewConfig) {
|
|
17037
17133
|
viewConfig.embedComponentType = 'AppEmbed';
|
|
17038
17134
|
super(domSelector, viewConfig);
|
|
17039
17135
|
this.defaultHeight = '100%';
|
|
17136
|
+
this.sendFullHeightLazyLoadData = () => {
|
|
17137
|
+
const data = calculateVisibleElementData(this.iFrame);
|
|
17138
|
+
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
17139
|
+
};
|
|
17140
|
+
/**
|
|
17141
|
+
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
17142
|
+
* It is used to send the visible coordinates data to the host application.
|
|
17143
|
+
* @param data The event payload
|
|
17144
|
+
* @param responder The responder function
|
|
17145
|
+
*/
|
|
17146
|
+
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
17147
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
17148
|
+
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
17149
|
+
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
17150
|
+
};
|
|
17040
17151
|
/**
|
|
17041
17152
|
* Set the iframe height as per the computed height received
|
|
17042
17153
|
* from the ThoughtSpot app.
|
|
@@ -17045,6 +17156,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17045
17156
|
this.updateIFrameHeight = (data) => {
|
|
17046
17157
|
var _a;
|
|
17047
17158
|
this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
|
|
17159
|
+
this.sendFullHeightLazyLoadData();
|
|
17048
17160
|
};
|
|
17049
17161
|
this.embedIframeCenter = (data, responder) => {
|
|
17050
17162
|
const obj = this.getIframeCenter();
|
|
@@ -17074,6 +17186,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17074
17186
|
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
17075
17187
|
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
17076
17188
|
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
17189
|
+
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
17077
17190
|
}
|
|
17078
17191
|
}
|
|
17079
17192
|
/**
|
|
@@ -17081,9 +17194,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17081
17194
|
* embedded Liveboard or visualization.
|
|
17082
17195
|
*/
|
|
17083
17196
|
getEmbedParams() {
|
|
17084
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17085
|
-
/* eslint-disable-next-line max-len */
|
|
17086
|
-
dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17197
|
+
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17087
17198
|
let params = {};
|
|
17088
17199
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17089
17200
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17099,6 +17210,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17099
17210
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
17100
17211
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17101
17212
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17213
|
+
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
17102
17214
|
params = this.getBaseQueryParams(params);
|
|
17103
17215
|
if (hideObjectSearch) {
|
|
17104
17216
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -17111,6 +17223,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17111
17223
|
}
|
|
17112
17224
|
if (fullHeight === true) {
|
|
17113
17225
|
params[Param.fullHeight] = true;
|
|
17226
|
+
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
17227
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
17228
|
+
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
17229
|
+
}
|
|
17114
17230
|
}
|
|
17115
17231
|
if (tag) {
|
|
17116
17232
|
params[Param.Tag] = tag;
|
|
@@ -17131,7 +17247,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17131
17247
|
params[Param.enableAskSage] = enableAskSage;
|
|
17132
17248
|
}
|
|
17133
17249
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
17134
|
-
/* eslint-disable-next-line max-len */
|
|
17135
17250
|
params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17136
17251
|
}
|
|
17137
17252
|
if (homePageSearchBarMode) {
|
|
@@ -17152,11 +17267,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17152
17267
|
=== exports.DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
17153
17268
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17154
17269
|
=== exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
17155
|
-
/* eslint-disable-next-line max-len */
|
|
17156
17270
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17157
17271
|
}
|
|
17158
17272
|
else {
|
|
17159
|
-
/* eslint-disable-next-line max-len */
|
|
17160
17273
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17161
17274
|
}
|
|
17162
17275
|
if (discoveryExperience) {
|
|
@@ -17169,6 +17282,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17169
17282
|
if (discoveryExperience.homePage === exports.HomePage.Modular) {
|
|
17170
17283
|
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17171
17284
|
}
|
|
17285
|
+
// listPageVersion v3 will enable the new list page
|
|
17286
|
+
if (discoveryExperience.listPageVersion === exports.ListPage.ListWithUXChanges) {
|
|
17287
|
+
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
17288
|
+
}
|
|
17172
17289
|
}
|
|
17173
17290
|
const queryParams = getQueryParamString(params, true);
|
|
17174
17291
|
return queryParams;
|
|
@@ -17256,6 +17373,30 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17256
17373
|
this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
|
|
17257
17374
|
}
|
|
17258
17375
|
}
|
|
17376
|
+
/**
|
|
17377
|
+
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
17378
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
17379
|
+
*/
|
|
17380
|
+
destroy() {
|
|
17381
|
+
super.destroy();
|
|
17382
|
+
this.unregisterLazyLoadEvents();
|
|
17383
|
+
}
|
|
17384
|
+
postRender() {
|
|
17385
|
+
this.registerLazyLoadEvents();
|
|
17386
|
+
}
|
|
17387
|
+
registerLazyLoadEvents() {
|
|
17388
|
+
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
17389
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
17390
|
+
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
17391
|
+
window.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
17392
|
+
}
|
|
17393
|
+
}
|
|
17394
|
+
unregisterLazyLoadEvents() {
|
|
17395
|
+
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
17396
|
+
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
17397
|
+
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
17398
|
+
}
|
|
17399
|
+
}
|
|
17259
17400
|
/**
|
|
17260
17401
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
17261
17402
|
* @param renderOptions An object containing the page ID
|
|
@@ -17265,6 +17406,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17265
17406
|
await super.render();
|
|
17266
17407
|
const src = this.getIFrameSrc();
|
|
17267
17408
|
await this.renderV1Embed(src);
|
|
17409
|
+
this.postRender();
|
|
17268
17410
|
return this;
|
|
17269
17411
|
}
|
|
17270
17412
|
}
|
|
@@ -17369,6 +17511,21 @@ query GetEurekaVizSnapshots(
|
|
|
17369
17511
|
viewConfig.embedComponentType = 'LiveboardEmbed';
|
|
17370
17512
|
super(domSelector, viewConfig);
|
|
17371
17513
|
this.defaultHeight = 500;
|
|
17514
|
+
this.sendFullHeightLazyLoadData = () => {
|
|
17515
|
+
const data = calculateVisibleElementData(this.iFrame);
|
|
17516
|
+
this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
|
|
17517
|
+
};
|
|
17518
|
+
/**
|
|
17519
|
+
* This is a handler for the RequestVisibleEmbedCoordinates event.
|
|
17520
|
+
* It is used to send the visible coordinates data to the host application.
|
|
17521
|
+
* @param data The event payload
|
|
17522
|
+
* @param responder The responder function
|
|
17523
|
+
*/
|
|
17524
|
+
this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
|
|
17525
|
+
logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
|
|
17526
|
+
const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
|
|
17527
|
+
responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
|
|
17528
|
+
};
|
|
17372
17529
|
/**
|
|
17373
17530
|
* Set the iframe height as per the computed height received
|
|
17374
17531
|
* from the ThoughtSpot app.
|
|
@@ -17376,6 +17533,7 @@ query GetEurekaVizSnapshots(
|
|
|
17376
17533
|
*/
|
|
17377
17534
|
this.updateIFrameHeight = (data) => {
|
|
17378
17535
|
this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
|
|
17536
|
+
this.sendFullHeightLazyLoadData();
|
|
17379
17537
|
};
|
|
17380
17538
|
this.embedIframeCenter = (data, responder) => {
|
|
17381
17539
|
const obj = this.getIframeCenter();
|
|
@@ -17409,6 +17567,7 @@ query GetEurekaVizSnapshots(
|
|
|
17409
17567
|
this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
17410
17568
|
this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
17411
17569
|
this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
17570
|
+
this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
|
|
17412
17571
|
}
|
|
17413
17572
|
}
|
|
17414
17573
|
/**
|
|
@@ -17418,11 +17577,15 @@ query GetEurekaVizSnapshots(
|
|
|
17418
17577
|
getEmbedParams() {
|
|
17419
17578
|
let params = {};
|
|
17420
17579
|
params = this.getBaseQueryParams(params);
|
|
17421
|
-
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 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17580
|
+
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 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17422
17581
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
17423
17582
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
17424
17583
|
if (fullHeight === true) {
|
|
17425
17584
|
params[Param.fullHeight] = true;
|
|
17585
|
+
if (this.viewConfig.lazyLoadingForFullHeight) {
|
|
17586
|
+
params[Param.IsLazyLoadingForEmbedEnabled] = true;
|
|
17587
|
+
params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
|
|
17588
|
+
}
|
|
17426
17589
|
}
|
|
17427
17590
|
if (defaultHeight) {
|
|
17428
17591
|
this.defaultHeight = defaultHeight;
|
|
@@ -17470,9 +17633,6 @@ query GetEurekaVizSnapshots(
|
|
|
17470
17633
|
if (dataSourceId !== undefined) {
|
|
17471
17634
|
params[Param.DataSourceId] = dataSourceId;
|
|
17472
17635
|
}
|
|
17473
|
-
if (coverAndFilterOptionInPDF !== undefined) {
|
|
17474
|
-
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17475
|
-
}
|
|
17476
17636
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
17477
17637
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
17478
17638
|
}
|
|
@@ -17483,6 +17643,7 @@ query GetEurekaVizSnapshots(
|
|
|
17483
17643
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17484
17644
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17485
17645
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17646
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17486
17647
|
const queryParams = getQueryParamString(params, true);
|
|
17487
17648
|
return queryParams;
|
|
17488
17649
|
}
|
|
@@ -17580,6 +17741,30 @@ query GetEurekaVizSnapshots(
|
|
|
17580
17741
|
}
|
|
17581
17742
|
return super.trigger(messageType, dataWithVizId);
|
|
17582
17743
|
}
|
|
17744
|
+
/**
|
|
17745
|
+
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|
|
17746
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
17747
|
+
*/
|
|
17748
|
+
destroy() {
|
|
17749
|
+
super.destroy();
|
|
17750
|
+
this.unregisterLazyLoadEvents();
|
|
17751
|
+
}
|
|
17752
|
+
postRender() {
|
|
17753
|
+
this.registerLazyLoadEvents();
|
|
17754
|
+
}
|
|
17755
|
+
registerLazyLoadEvents() {
|
|
17756
|
+
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
17757
|
+
// TODO: Use passive: true, install modernizr to check for passive
|
|
17758
|
+
window.addEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
17759
|
+
window.addEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
17760
|
+
}
|
|
17761
|
+
}
|
|
17762
|
+
unregisterLazyLoadEvents() {
|
|
17763
|
+
if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
|
|
17764
|
+
window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
|
|
17765
|
+
window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
|
|
17766
|
+
}
|
|
17767
|
+
}
|
|
17583
17768
|
/**
|
|
17584
17769
|
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
17585
17770
|
* @param renderOptions An object specifying the Liveboard ID,
|
|
@@ -17590,6 +17775,7 @@ query GetEurekaVizSnapshots(
|
|
|
17590
17775
|
const src = this.getIFrameSrc();
|
|
17591
17776
|
await this.renderV1Embed(src);
|
|
17592
17777
|
this.showPreviewLoader();
|
|
17778
|
+
this.postRender();
|
|
17593
17779
|
return this;
|
|
17594
17780
|
}
|
|
17595
17781
|
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
@@ -18241,6 +18427,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18241
18427
|
});
|
|
18242
18428
|
const data = responses[0].data;
|
|
18243
18429
|
return {
|
|
18430
|
+
convId: this.conversationId,
|
|
18431
|
+
messageId: responses[0].msgId,
|
|
18244
18432
|
data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18245
18433
|
error: null,
|
|
18246
18434
|
};
|
|
@@ -18323,9 +18511,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18323
18511
|
return { error };
|
|
18324
18512
|
}
|
|
18325
18513
|
const container = document.createElement('div');
|
|
18326
|
-
if (this.viewConfig.containerClassName) {
|
|
18327
|
-
container.className = this.viewConfig.containerClassName;
|
|
18328
|
-
}
|
|
18329
18514
|
const embed = new ConversationMessage(container, {
|
|
18330
18515
|
...this.viewConfig,
|
|
18331
18516
|
sessionId: data.sessionId,
|
|
@@ -18336,6 +18521,28 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18336
18521
|
await embed.render();
|
|
18337
18522
|
return { container, viz: embed };
|
|
18338
18523
|
}
|
|
18524
|
+
/**
|
|
18525
|
+
* Send a message to the conversation service and return only the data.
|
|
18526
|
+
* @param userMessage - The message to send to the conversation service.
|
|
18527
|
+
* @returns The data from the conversation service.
|
|
18528
|
+
*/
|
|
18529
|
+
async sendMessageData(userMessage) {
|
|
18530
|
+
try {
|
|
18531
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18532
|
+
if (error) {
|
|
18533
|
+
return { error };
|
|
18534
|
+
}
|
|
18535
|
+
return { data: {
|
|
18536
|
+
sessionId: data.sessionId,
|
|
18537
|
+
genNo: data.genNo,
|
|
18538
|
+
acSessionId: data.stateKey.transactionId,
|
|
18539
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18540
|
+
} };
|
|
18541
|
+
}
|
|
18542
|
+
catch (error) {
|
|
18543
|
+
return { error: error };
|
|
18544
|
+
}
|
|
18545
|
+
}
|
|
18339
18546
|
}
|
|
18340
18547
|
/**
|
|
18341
18548
|
* Create a conversation embed, which can be integrated inside
|