@thoughtspot/visual-embed-sdk 1.10.0-alpha.1 → 1.10.0-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/CHANGELOG.md +4 -0
- package/dist/src/embed/app.d.ts +8 -0
- package/dist/src/embed/liveboard.d.ts +8 -0
- package/dist/src/embed/ts-embed.d.ts +16 -1
- package/dist/src/types.d.ts +56 -5
- package/dist/src/utils.d.ts +3 -0
- package/dist/tsembed.es.js +105 -12
- package/dist/tsembed.js +105 -12
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +8 -0
- package/lib/src/embed/app.js +5 -2
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +11 -10
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +8 -0
- package/lib/src/embed/liveboard.js +4 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +1 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/pinboard.spec.js +1 -1
- package/lib/src/embed/pinboard.spec.js.map +1 -1
- package/lib/src/embed/search.js +2 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +16 -1
- package/lib/src/embed/ts-embed.js +34 -4
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +52 -7
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +56 -5
- package/lib/src/types.js +55 -4
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +3 -0
- package/lib/src/utils.js +5 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +88 -6
- package/package.json +1 -1
- package/src/embed/app.spec.ts +11 -10
- package/src/embed/app.ts +14 -2
- package/src/embed/liveboard.spec.ts +1 -1
- package/src/embed/liveboard.ts +13 -0
- package/src/embed/pinboard.spec.ts +1 -1
- package/src/embed/search.ts +4 -1
- package/src/embed/ts-embed.spec.ts +75 -7
- package/src/embed/ts-embed.ts +49 -3
- package/src/types.ts +55 -4
- package/src/utils.ts +9 -0
package/CHANGELOG.md
CHANGED
package/dist/src/embed/app.d.ts
CHANGED
|
@@ -74,6 +74,14 @@ export interface AppViewConfig extends ViewConfig {
|
|
|
74
74
|
* The array of GUIDs to be hidden
|
|
75
75
|
*/
|
|
76
76
|
hideObjects?: string[];
|
|
77
|
+
/**
|
|
78
|
+
* Render liveboards using the new v2 rendering mode
|
|
79
|
+
* This is a transient flag which is primarily meant for internal use
|
|
80
|
+
* @default false
|
|
81
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
82
|
+
* @hidden
|
|
83
|
+
*/
|
|
84
|
+
liveboardV2?: boolean;
|
|
77
85
|
}
|
|
78
86
|
/**
|
|
79
87
|
* Embeds full ThoughtSpot experience in a host application.
|
|
@@ -63,6 +63,14 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
63
63
|
* @hidden
|
|
64
64
|
*/
|
|
65
65
|
preventPinboardFilterRemoval?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Render embedded liveboards and visualizations using the new v2 rendering mode
|
|
68
|
+
* This is a transient flag which is primarily meant for internal use
|
|
69
|
+
* @default false
|
|
70
|
+
* @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
liveboardV2?: boolean;
|
|
66
74
|
}
|
|
67
75
|
/**
|
|
68
76
|
* Embed a ThoughtSpot Liveboard or visualization
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8
8
|
*/
|
|
9
9
|
import { DOMSelector, HostEvent, EmbedEvent, MessageCallback, Action, RuntimeFilter, EmbedConfig } from '../types';
|
|
10
|
+
/**
|
|
11
|
+
* Global prefix for all Thoughtspot postHash Params.
|
|
12
|
+
*/
|
|
13
|
+
export declare const THOUGHTSPOT_PARAM_PREFIX = "ts-";
|
|
10
14
|
export interface LayoutConfig {
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
@@ -21,6 +25,11 @@ export interface FrameParams {
|
|
|
21
25
|
* The height of the iFrame (unit is pixels if numeric).
|
|
22
26
|
*/
|
|
23
27
|
height?: number | string;
|
|
28
|
+
/**
|
|
29
|
+
* This parameters will be passed on the iframe
|
|
30
|
+
* as is.
|
|
31
|
+
*/
|
|
32
|
+
[key: string]: string | number | boolean;
|
|
24
33
|
}
|
|
25
34
|
/**
|
|
26
35
|
* The configuration object for an embedded view.
|
|
@@ -183,7 +192,7 @@ export declare class TsEmbed {
|
|
|
183
192
|
* @param url
|
|
184
193
|
* @param frameOptions
|
|
185
194
|
*/
|
|
186
|
-
protected renderIFrame(url: string, frameOptions
|
|
195
|
+
protected renderIFrame(url: string, frameOptions?: FrameParams): void;
|
|
187
196
|
/**
|
|
188
197
|
* Sets the height of the iframe
|
|
189
198
|
* @param height The height in pixels
|
|
@@ -250,6 +259,12 @@ export declare class TsEmbed {
|
|
|
250
259
|
* @param args
|
|
251
260
|
*/
|
|
252
261
|
render(): TsEmbed;
|
|
262
|
+
/**
|
|
263
|
+
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
264
|
+
* host app URL.
|
|
265
|
+
* THOUGHTSPOT URL params starts with a prefix "ts-"
|
|
266
|
+
*/
|
|
267
|
+
getThoughtSpotPostUrlParams(): string;
|
|
253
268
|
}
|
|
254
269
|
/**
|
|
255
270
|
* Base class for embedding v1 experience
|
package/dist/src/types.d.ts
CHANGED
|
@@ -455,7 +455,8 @@ export declare enum Param {
|
|
|
455
455
|
VisibleActions = "visibleAction",
|
|
456
456
|
CustomCSSUrl = "customCssUrl",
|
|
457
457
|
DisableLoginRedirect = "disableLoginRedirect",
|
|
458
|
-
visibleVizs = "pinboardVisibleVizs"
|
|
458
|
+
visibleVizs = "pinboardVisibleVizs",
|
|
459
|
+
LiveboardV2Enabled = "isPinboardV2Enabled"
|
|
459
460
|
}
|
|
460
461
|
/**
|
|
461
462
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -463,30 +464,57 @@ export declare enum Param {
|
|
|
463
464
|
*/
|
|
464
465
|
export declare enum Action {
|
|
465
466
|
Save = "save",
|
|
467
|
+
/**
|
|
468
|
+
* @hidden
|
|
469
|
+
*/
|
|
466
470
|
Update = "update",
|
|
471
|
+
/**
|
|
472
|
+
* @hidden
|
|
473
|
+
*/
|
|
467
474
|
SaveUntitled = "saveUntitled",
|
|
468
475
|
SaveAsView = "saveAsView",
|
|
469
476
|
MakeACopy = "makeACopy",
|
|
470
477
|
EditACopy = "editACopy",
|
|
471
478
|
CopyLink = "embedDocument",
|
|
479
|
+
/**
|
|
480
|
+
* @hidden
|
|
481
|
+
*/
|
|
472
482
|
ResetLayout = "resetLayout",
|
|
473
483
|
Schedule = "subscription",
|
|
474
484
|
SchedulesList = "schedule-list",
|
|
475
485
|
Share = "share",
|
|
476
486
|
AddFilter = "addFilter",
|
|
477
487
|
ConfigureFilter = "configureFilter",
|
|
488
|
+
/**
|
|
489
|
+
* @hidden
|
|
490
|
+
*/
|
|
478
491
|
AddFormula = "addFormula",
|
|
492
|
+
/**
|
|
493
|
+
* @hidden
|
|
494
|
+
*/
|
|
479
495
|
SearchOnTop = "searchOnTop",
|
|
480
496
|
SpotIQAnalyze = "spotIQAnalyze",
|
|
497
|
+
/**
|
|
498
|
+
* @hidden
|
|
499
|
+
*/
|
|
481
500
|
ExplainInsight = "explainInsight",
|
|
501
|
+
/**
|
|
502
|
+
* @hidden
|
|
503
|
+
*/
|
|
482
504
|
SpotIQFollow = "spotIQFollow",
|
|
483
505
|
ShareViz = "shareViz",
|
|
506
|
+
/**
|
|
507
|
+
* @hidden
|
|
508
|
+
*/
|
|
484
509
|
ReplaySearch = "replaySearch",
|
|
485
510
|
ShowUnderlyingData = "showUnderlyingData",
|
|
486
511
|
Download = "download",
|
|
487
512
|
DownloadAsPdf = "downloadAsPdf",
|
|
488
513
|
DownloadAsCsv = "downloadAsCSV",
|
|
489
514
|
DownloadAsXlsx = "downloadAsXLSX",
|
|
515
|
+
/**
|
|
516
|
+
* @hidden
|
|
517
|
+
*/
|
|
490
518
|
DownloadTrace = "downloadTrace",
|
|
491
519
|
ExportTML = "exportTSL",
|
|
492
520
|
ImportTML = "importTSL",
|
|
@@ -497,18 +525,39 @@ export declare enum Action {
|
|
|
497
525
|
Edit = "edit",
|
|
498
526
|
EditTitle = "editTitle",
|
|
499
527
|
Remove = "delete",
|
|
528
|
+
/**
|
|
529
|
+
* @hidden
|
|
530
|
+
*/
|
|
500
531
|
Ungroup = "ungroup",
|
|
532
|
+
/**
|
|
533
|
+
* @hidden
|
|
534
|
+
*/
|
|
501
535
|
Describe = "describe",
|
|
536
|
+
/**
|
|
537
|
+
* @hidden
|
|
538
|
+
*/
|
|
502
539
|
Relate = "relate",
|
|
540
|
+
/**
|
|
541
|
+
* @hidden
|
|
542
|
+
*/
|
|
503
543
|
CustomizeHeadlines = "customizeHeadlines",
|
|
504
544
|
/**
|
|
505
545
|
* @hidden
|
|
506
546
|
*/
|
|
507
547
|
PinboardInfo = "pinboardInfo",
|
|
508
548
|
LiveboardInfo = "pinboardInfo",
|
|
549
|
+
/**
|
|
550
|
+
* @hidden
|
|
551
|
+
*/
|
|
509
552
|
SendAnswerFeedback = "sendFeedback",
|
|
553
|
+
/**
|
|
554
|
+
* @hidden
|
|
555
|
+
*/
|
|
510
556
|
DownloadEmbraceQueries = "downloadEmbraceQueries",
|
|
511
557
|
Pin = "pin",
|
|
558
|
+
/**
|
|
559
|
+
* @hidden
|
|
560
|
+
*/
|
|
512
561
|
AnalysisInfo = "analysisInfo",
|
|
513
562
|
Subscription = "subscription",
|
|
514
563
|
Explore = "explore",
|
|
@@ -516,16 +565,18 @@ export declare enum Action {
|
|
|
516
565
|
DrillExclude = "context-menu-item-exclude",
|
|
517
566
|
CopyToClipboard = "context-menu-item-copy-to-clipboard",
|
|
518
567
|
CopyAndEdit = "context-menu-item-copy-and-edit",
|
|
568
|
+
/**
|
|
569
|
+
* @hidden
|
|
570
|
+
*/
|
|
519
571
|
DrillEdit = "context-menu-item-edit",
|
|
520
572
|
EditMeasure = "context-menu-item-edit-measure",
|
|
521
573
|
Separator = "context-menu-item-separator",
|
|
574
|
+
/**
|
|
575
|
+
* @hidden
|
|
576
|
+
*/
|
|
522
577
|
DrillDown = "DRILL",
|
|
523
578
|
RequestAccess = "requestAccess",
|
|
524
579
|
QueryDetailsButtons = "queryDetailsButtons",
|
|
525
|
-
/**
|
|
526
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
527
|
-
*/
|
|
528
|
-
Monitor = "createMonitor",
|
|
529
580
|
/**
|
|
530
581
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
531
582
|
*/
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -34,3 +34,6 @@ export declare const getCssDimension: (value: number | string) => string;
|
|
|
34
34
|
export declare const appendToUrlHash: (url: string, stringToAppend: string) => string;
|
|
35
35
|
export declare const getEncodedQueryParamsString: (queryString: string) => string;
|
|
36
36
|
export declare const getOffsetTop: (element: any) => any;
|
|
37
|
+
export declare const setAttributes: (element: HTMLElement, attributes: {
|
|
38
|
+
[key: string]: string | number | boolean;
|
|
39
|
+
}) => void;
|
package/dist/tsembed.es.js
CHANGED
|
@@ -108,6 +108,11 @@ const getEncodedQueryParamsString = (queryString) => {
|
|
|
108
108
|
const getOffsetTop = (element) => {
|
|
109
109
|
const rect = element.getBoundingClientRect();
|
|
110
110
|
return rect.top + window.scrollY;
|
|
111
|
+
};
|
|
112
|
+
const setAttributes = (element, attributes) => {
|
|
113
|
+
Object.keys(attributes).forEach((key) => {
|
|
114
|
+
element.setAttribute(key, attributes[key].toString());
|
|
115
|
+
});
|
|
111
116
|
};
|
|
112
117
|
|
|
113
118
|
/**
|
|
@@ -447,6 +452,7 @@ var Param;
|
|
|
447
452
|
Param["CustomCSSUrl"] = "customCssUrl";
|
|
448
453
|
Param["DisableLoginRedirect"] = "disableLoginRedirect";
|
|
449
454
|
Param["visibleVizs"] = "pinboardVisibleVizs";
|
|
455
|
+
Param["LiveboardV2Enabled"] = "isPinboardV2Enabled";
|
|
450
456
|
})(Param || (Param = {}));
|
|
451
457
|
/**
|
|
452
458
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
@@ -456,30 +462,57 @@ var Param;
|
|
|
456
462
|
var Action;
|
|
457
463
|
(function (Action) {
|
|
458
464
|
Action["Save"] = "save";
|
|
465
|
+
/**
|
|
466
|
+
* @hidden
|
|
467
|
+
*/
|
|
459
468
|
Action["Update"] = "update";
|
|
469
|
+
/**
|
|
470
|
+
* @hidden
|
|
471
|
+
*/
|
|
460
472
|
Action["SaveUntitled"] = "saveUntitled";
|
|
461
473
|
Action["SaveAsView"] = "saveAsView";
|
|
462
474
|
Action["MakeACopy"] = "makeACopy";
|
|
463
475
|
Action["EditACopy"] = "editACopy";
|
|
464
476
|
Action["CopyLink"] = "embedDocument";
|
|
477
|
+
/**
|
|
478
|
+
* @hidden
|
|
479
|
+
*/
|
|
465
480
|
Action["ResetLayout"] = "resetLayout";
|
|
466
481
|
Action["Schedule"] = "subscription";
|
|
467
482
|
Action["SchedulesList"] = "schedule-list";
|
|
468
483
|
Action["Share"] = "share";
|
|
469
484
|
Action["AddFilter"] = "addFilter";
|
|
470
485
|
Action["ConfigureFilter"] = "configureFilter";
|
|
486
|
+
/**
|
|
487
|
+
* @hidden
|
|
488
|
+
*/
|
|
471
489
|
Action["AddFormula"] = "addFormula";
|
|
490
|
+
/**
|
|
491
|
+
* @hidden
|
|
492
|
+
*/
|
|
472
493
|
Action["SearchOnTop"] = "searchOnTop";
|
|
473
494
|
Action["SpotIQAnalyze"] = "spotIQAnalyze";
|
|
495
|
+
/**
|
|
496
|
+
* @hidden
|
|
497
|
+
*/
|
|
474
498
|
Action["ExplainInsight"] = "explainInsight";
|
|
499
|
+
/**
|
|
500
|
+
* @hidden
|
|
501
|
+
*/
|
|
475
502
|
Action["SpotIQFollow"] = "spotIQFollow";
|
|
476
503
|
Action["ShareViz"] = "shareViz";
|
|
504
|
+
/**
|
|
505
|
+
* @hidden
|
|
506
|
+
*/
|
|
477
507
|
Action["ReplaySearch"] = "replaySearch";
|
|
478
508
|
Action["ShowUnderlyingData"] = "showUnderlyingData";
|
|
479
509
|
Action["Download"] = "download";
|
|
480
510
|
Action["DownloadAsPdf"] = "downloadAsPdf";
|
|
481
511
|
Action["DownloadAsCsv"] = "downloadAsCSV";
|
|
482
512
|
Action["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
513
|
+
/**
|
|
514
|
+
* @hidden
|
|
515
|
+
*/
|
|
483
516
|
Action["DownloadTrace"] = "downloadTrace";
|
|
484
517
|
Action["ExportTML"] = "exportTSL";
|
|
485
518
|
Action["ImportTML"] = "importTSL";
|
|
@@ -490,18 +523,39 @@ var Action;
|
|
|
490
523
|
Action["Edit"] = "edit";
|
|
491
524
|
Action["EditTitle"] = "editTitle";
|
|
492
525
|
Action["Remove"] = "delete";
|
|
526
|
+
/**
|
|
527
|
+
* @hidden
|
|
528
|
+
*/
|
|
493
529
|
Action["Ungroup"] = "ungroup";
|
|
530
|
+
/**
|
|
531
|
+
* @hidden
|
|
532
|
+
*/
|
|
494
533
|
Action["Describe"] = "describe";
|
|
534
|
+
/**
|
|
535
|
+
* @hidden
|
|
536
|
+
*/
|
|
495
537
|
Action["Relate"] = "relate";
|
|
538
|
+
/**
|
|
539
|
+
* @hidden
|
|
540
|
+
*/
|
|
496
541
|
Action["CustomizeHeadlines"] = "customizeHeadlines";
|
|
497
542
|
/**
|
|
498
543
|
* @hidden
|
|
499
544
|
*/
|
|
500
545
|
Action["PinboardInfo"] = "pinboardInfo";
|
|
501
546
|
Action["LiveboardInfo"] = "pinboardInfo";
|
|
547
|
+
/**
|
|
548
|
+
* @hidden
|
|
549
|
+
*/
|
|
502
550
|
Action["SendAnswerFeedback"] = "sendFeedback";
|
|
551
|
+
/**
|
|
552
|
+
* @hidden
|
|
553
|
+
*/
|
|
503
554
|
Action["DownloadEmbraceQueries"] = "downloadEmbraceQueries";
|
|
504
555
|
Action["Pin"] = "pin";
|
|
556
|
+
/**
|
|
557
|
+
* @hidden
|
|
558
|
+
*/
|
|
505
559
|
Action["AnalysisInfo"] = "analysisInfo";
|
|
506
560
|
Action["Subscription"] = "subscription";
|
|
507
561
|
Action["Explore"] = "explore";
|
|
@@ -509,16 +563,18 @@ var Action;
|
|
|
509
563
|
Action["DrillExclude"] = "context-menu-item-exclude";
|
|
510
564
|
Action["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
|
|
511
565
|
Action["CopyAndEdit"] = "context-menu-item-copy-and-edit";
|
|
566
|
+
/**
|
|
567
|
+
* @hidden
|
|
568
|
+
*/
|
|
512
569
|
Action["DrillEdit"] = "context-menu-item-edit";
|
|
513
570
|
Action["EditMeasure"] = "context-menu-item-edit-measure";
|
|
514
571
|
Action["Separator"] = "context-menu-item-separator";
|
|
572
|
+
/**
|
|
573
|
+
* @hidden
|
|
574
|
+
*/
|
|
515
575
|
Action["DrillDown"] = "DRILL";
|
|
516
576
|
Action["RequestAccess"] = "requestAccess";
|
|
517
577
|
Action["QueryDetailsButtons"] = "queryDetailsButtons";
|
|
518
|
-
/**
|
|
519
|
-
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
520
|
-
*/
|
|
521
|
-
Action["Monitor"] = "createMonitor";
|
|
522
578
|
/**
|
|
523
579
|
* @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
|
|
524
580
|
*/
|
|
@@ -8912,7 +8968,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
8912
8968
|
}
|
|
8913
8969
|
}
|
|
8914
8970
|
|
|
8915
|
-
var name="@thoughtspot/visual-embed-sdk";var version="1.10.0-alpha.
|
|
8971
|
+
var name="@thoughtspot/visual-embed-sdk";var version="1.10.0-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/**"];var exports={".":"./lib/src/index.js","./react":"./lib/src/react/index.js"};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts",build:"rollup -c",watch:"rollup -cw","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs && npx istanbul-merge --out ./coverage/coverage.json ./coverage/docs/coverage-final.json ./coverage/sdk/coverage-final.json && npx istanbul report --include ./coverage/coverage.json --dir ./coverage lcov",posttest:"cat ./coverage/lcov.info | coveralls",prepublishOnly:"npm run test; npm run tsc; npm run bundle-dts; npm run build","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1","mixpanel-browser":"^2.41.0"};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","@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/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.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","dts-bundle":"0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.1.0","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"4.1.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.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-puppeteer":"^4.4.0",jsdom:"^17.0.0","node-sass":"^4.0.0",prettier:"2.1.2",puppeteer:"^7.0.1",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:"2.30.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-neo-theme":"^1.1.0","typedoc-plugin-toc-group":"0.0.5",typescript:"^4.1.0","url-search-params-polyfill":"^8.1.0",util:"^0.12.4"};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","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,description:description,module:module,main:main,types:types,files:files,exports:exports,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};
|
|
8916
8972
|
|
|
8917
8973
|
/**
|
|
8918
8974
|
* Copyright (c) 2022
|
|
@@ -8923,6 +8979,10 @@ var name="@thoughtspot/visual-embed-sdk";var version="1.10.0-alpha.1";var descri
|
|
|
8923
8979
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
8924
8980
|
*/
|
|
8925
8981
|
const { version: version$1 } = pkgInfo;
|
|
8982
|
+
/**
|
|
8983
|
+
* Global prefix for all Thoughtspot postHash Params.
|
|
8984
|
+
*/
|
|
8985
|
+
const THOUGHTSPOT_PARAM_PREFIX = 'ts-';
|
|
8926
8986
|
/**
|
|
8927
8987
|
* The event id map from v2 event names to v1 event id
|
|
8928
8988
|
* v1 events are the classic embed events implemented in Blink v1
|
|
@@ -9130,7 +9190,7 @@ class TsEmbed {
|
|
|
9130
9190
|
* @param url
|
|
9131
9191
|
* @param frameOptions
|
|
9132
9192
|
*/
|
|
9133
|
-
renderIFrame(url, frameOptions) {
|
|
9193
|
+
renderIFrame(url, frameOptions = {}) {
|
|
9134
9194
|
if (this.isError) {
|
|
9135
9195
|
return;
|
|
9136
9196
|
}
|
|
@@ -9161,8 +9221,10 @@ class TsEmbed {
|
|
|
9161
9221
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9162
9222
|
// @ts-ignore
|
|
9163
9223
|
this.iFrame.mozallowfullscreen = true;
|
|
9164
|
-
const
|
|
9165
|
-
const
|
|
9224
|
+
const { height: frameHeight, width: frameWidth, ...restParams } = frameOptions;
|
|
9225
|
+
const width = getCssDimension(frameWidth || DEFAULT_EMBED_WIDTH);
|
|
9226
|
+
const height = getCssDimension(frameWidth || DEFAULT_EMBED_HEIGHT);
|
|
9227
|
+
setAttributes(this.iFrame, restParams);
|
|
9166
9228
|
this.iFrame.style.width = `${width}`;
|
|
9167
9229
|
this.iFrame.style.height = `${height}`;
|
|
9168
9230
|
this.iFrame.style.border = '0';
|
|
@@ -9326,6 +9388,30 @@ class TsEmbed {
|
|
|
9326
9388
|
this.isRendered = true;
|
|
9327
9389
|
return this;
|
|
9328
9390
|
}
|
|
9391
|
+
/**
|
|
9392
|
+
* Get the Post Url Params for THOUGHTSPOT from the current
|
|
9393
|
+
* host app URL.
|
|
9394
|
+
* THOUGHTSPOT URL params starts with a prefix "ts-"
|
|
9395
|
+
*/
|
|
9396
|
+
getThoughtSpotPostUrlParams() {
|
|
9397
|
+
const urlHash = window.location.hash;
|
|
9398
|
+
const queryParams = window.location.search;
|
|
9399
|
+
const postHashParams = urlHash.split('?');
|
|
9400
|
+
const postURLParams = postHashParams[postHashParams.length - 1];
|
|
9401
|
+
const queryParamsObj = new URLSearchParams(queryParams);
|
|
9402
|
+
const postURLParamsObj = new URLSearchParams(postURLParams);
|
|
9403
|
+
const params = new URLSearchParams();
|
|
9404
|
+
const addKeyValuePairCb = (value, key) => {
|
|
9405
|
+
if (key.startsWith(THOUGHTSPOT_PARAM_PREFIX)) {
|
|
9406
|
+
params.append(key, value);
|
|
9407
|
+
}
|
|
9408
|
+
};
|
|
9409
|
+
queryParamsObj.forEach(addKeyValuePairCb);
|
|
9410
|
+
postURLParamsObj.forEach(addKeyValuePairCb);
|
|
9411
|
+
let tsParams = params.toString();
|
|
9412
|
+
tsParams = tsParams ? `?${tsParams}` : '';
|
|
9413
|
+
return tsParams;
|
|
9414
|
+
}
|
|
9329
9415
|
}
|
|
9330
9416
|
/**
|
|
9331
9417
|
* Base class for embedding v1 experience
|
|
@@ -9407,13 +9493,14 @@ class AppEmbed extends V1Embed {
|
|
|
9407
9493
|
*/
|
|
9408
9494
|
getEmbedParams() {
|
|
9409
9495
|
const params = this.getBaseQueryParams();
|
|
9410
|
-
const { tag, hideObjects } = this.viewConfig;
|
|
9496
|
+
const { tag, hideObjects, liveboardV2 = false } = this.viewConfig;
|
|
9411
9497
|
if (tag) {
|
|
9412
9498
|
params[Param.Tag] = tag;
|
|
9413
9499
|
}
|
|
9414
9500
|
if (hideObjects && hideObjects.length) {
|
|
9415
9501
|
params[Param.HideObjects] = JSON.stringify(hideObjects);
|
|
9416
9502
|
}
|
|
9503
|
+
params[Param.LiveboardV2Enabled] = liveboardV2;
|
|
9417
9504
|
const queryParams = getQueryParamString(params, true);
|
|
9418
9505
|
return queryParams;
|
|
9419
9506
|
}
|
|
@@ -9427,7 +9514,9 @@ class AppEmbed extends V1Embed {
|
|
|
9427
9514
|
const queryString = [filterQuery, queryParams]
|
|
9428
9515
|
.filter(Boolean)
|
|
9429
9516
|
.join('&');
|
|
9430
|
-
|
|
9517
|
+
let url = `${this.getV1EmbedBasePath(queryString, this.viewConfig.showPrimaryNavbar, this.viewConfig.disableProfileAndHelp, true)}/${pageId}`;
|
|
9518
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
9519
|
+
url = `${url}${tsPostHashParams}`;
|
|
9431
9520
|
return url;
|
|
9432
9521
|
}
|
|
9433
9522
|
/**
|
|
@@ -9541,7 +9630,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
9541
9630
|
*/
|
|
9542
9631
|
getEmbedParams() {
|
|
9543
9632
|
const params = this.getBaseQueryParams();
|
|
9544
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, } = this.viewConfig;
|
|
9633
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2 = false, } = this.viewConfig;
|
|
9545
9634
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval ||
|
|
9546
9635
|
this.viewConfig.preventPinboardFilterRemoval;
|
|
9547
9636
|
if (fullHeight === true) {
|
|
@@ -9560,6 +9649,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
9560
9649
|
params[Param.visibleVizs] = visibleVizs;
|
|
9561
9650
|
}
|
|
9562
9651
|
params[Param.livedBoardEmbed] = true;
|
|
9652
|
+
params[Param.LiveboardV2Enabled] = liveboardV2;
|
|
9563
9653
|
const queryParams = getQueryParamString(params, true);
|
|
9564
9654
|
return queryParams;
|
|
9565
9655
|
}
|
|
@@ -9581,6 +9671,8 @@ class LiveboardEmbed extends V1Embed {
|
|
|
9581
9671
|
if (vizId) {
|
|
9582
9672
|
url = `${url}/${vizId}`;
|
|
9583
9673
|
}
|
|
9674
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
9675
|
+
url = `${url}${tsPostHashParams}`;
|
|
9584
9676
|
return url;
|
|
9585
9677
|
}
|
|
9586
9678
|
/**
|
|
@@ -9692,7 +9784,8 @@ class SearchEmbed extends TsEmbed {
|
|
|
9692
9784
|
if (queryParamsString) {
|
|
9693
9785
|
query = `?${queryParamsString}`;
|
|
9694
9786
|
}
|
|
9695
|
-
|
|
9787
|
+
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
|
9788
|
+
return `${this.getEmbedBasePath(query)}/${answerPath}${tsPostHashParams}`;
|
|
9696
9789
|
}
|
|
9697
9790
|
/**
|
|
9698
9791
|
* Render the embedded ThoughtSpot search
|