@thoughtspot/visual-embed-sdk 1.9.3 → 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.
Files changed (54) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/src/embed/app.d.ts +8 -0
  3. package/dist/src/embed/liveboard.d.ts +8 -0
  4. package/dist/src/embed/search.d.ts +0 -4
  5. package/dist/src/embed/ts-embed.d.ts +16 -1
  6. package/dist/src/types.d.ts +61 -7
  7. package/dist/src/utils.d.ts +3 -0
  8. package/dist/tsembed.es.js +111 -15
  9. package/dist/tsembed.js +111 -15
  10. package/lib/package.json +1 -1
  11. package/lib/src/embed/app.d.ts +8 -0
  12. package/lib/src/embed/app.js +5 -2
  13. package/lib/src/embed/app.js.map +1 -1
  14. package/lib/src/embed/app.spec.js +11 -10
  15. package/lib/src/embed/app.spec.js.map +1 -1
  16. package/lib/src/embed/liveboard.d.ts +8 -0
  17. package/lib/src/embed/liveboard.js +4 -1
  18. package/lib/src/embed/liveboard.js.map +1 -1
  19. package/lib/src/embed/liveboard.spec.js +1 -1
  20. package/lib/src/embed/liveboard.spec.js.map +1 -1
  21. package/lib/src/embed/pinboard.spec.js +1 -1
  22. package/lib/src/embed/pinboard.spec.js.map +1 -1
  23. package/lib/src/embed/search.d.ts +0 -4
  24. package/lib/src/embed/search.js +3 -2
  25. package/lib/src/embed/search.js.map +1 -1
  26. package/lib/src/embed/ts-embed.d.ts +16 -1
  27. package/lib/src/embed/ts-embed.js +34 -4
  28. package/lib/src/embed/ts-embed.js.map +1 -1
  29. package/lib/src/embed/ts-embed.spec.js +52 -7
  30. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  31. package/lib/src/react/index.js +1 -1
  32. package/lib/src/react/index.js.map +1 -1
  33. package/lib/src/react/index.spec.js +2 -1
  34. package/lib/src/react/index.spec.js.map +1 -1
  35. package/lib/src/types.d.ts +61 -7
  36. package/lib/src/types.js +60 -6
  37. package/lib/src/types.js.map +1 -1
  38. package/lib/src/utils.d.ts +3 -0
  39. package/lib/src/utils.js +5 -0
  40. package/lib/src/utils.js.map +1 -1
  41. package/lib/src/visual-embed-sdk.d.ts +93 -12
  42. package/package.json +1 -1
  43. package/src/embed/app.spec.ts +11 -10
  44. package/src/embed/app.ts +14 -2
  45. package/src/embed/liveboard.spec.ts +1 -1
  46. package/src/embed/liveboard.ts +13 -0
  47. package/src/embed/pinboard.spec.ts +1 -1
  48. package/src/embed/search.ts +4 -6
  49. package/src/embed/ts-embed.spec.ts +75 -7
  50. package/src/embed/ts-embed.ts +49 -3
  51. package/src/react/index.spec.tsx +6 -1
  52. package/src/react/index.tsx +7 -1
  53. package/src/types.ts +61 -7
  54. package/src/utils.ts +9 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,42 @@
1
1
  # Changelog
2
2
 
3
3
  Please find the comprehensive list of changes for ThoughtSpot releases and SDK [here](https://developers.thoughtspot.com/docs/?pageid=whats-new)
4
+ This project follows Semantic Versioning.
5
+
6
+ ## Unreleased
7
+
8
+ ### New Features
9
+ - Events for all actions on Search Embed
10
+
11
+ ## 1.9.3 (03-22-2022)
12
+
13
+ ### New Features
14
+ - `disableLoginRedirect` option in `EmbedConfig`
15
+
16
+ ## 1.9.2 (03-17-2022)
17
+
18
+ ### New Features
19
+ - Ability to trigger events on React components
20
+ - Added new `useEmbedRef` hook, check README for usage.
21
+
22
+ ### Fixed
23
+
24
+ - Typings for `on*` event handlers for React components
25
+
26
+
27
+ ## 1.9.1 (03-15-2022)
28
+
29
+ ### New Features
30
+
31
+ - `visibleVizs` option in the `LiveboardEmbed`
32
+ - `LiveboardRendered` new `EmbedEvent` emitted when a liveboard completes rendering.
33
+
34
+
35
+ ## 1.9.0
36
+
37
+ - Release to support TS version 8.1.0.cl
38
+ - Please check the full list of changes [here](https://developers.thoughtspot.com/docs/?pageid=whats-new)
39
+
4
40
 
5
41
  ## 1.8.1
6
42
 
@@ -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
@@ -44,10 +44,6 @@ export interface SearchViewConfig extends ViewConfig {
44
44
  * using raw answer data.
45
45
  */
46
46
  hideResults?: boolean;
47
- /**
48
- * If set to true, expands all the data sources panel.
49
- */
50
- expandAllDataSource?: boolean;
51
47
  /**
52
48
  * If set to true, the Search Assist feature is enabled.
53
49
  */
@@ -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: FrameParams): void;
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
@@ -431,7 +431,6 @@ export declare enum DataSourceVisualMode {
431
431
  export declare enum Param {
432
432
  DataSources = "dataSources",
433
433
  DataSourceMode = "dataSourceMode",
434
- ExpandAllDataSource = "expandAllDataSource",
435
434
  DisableActions = "disableAction",
436
435
  DisableActionReason = "disableHint",
437
436
  ForceTable = "forceTable",
@@ -455,8 +454,9 @@ export declare enum Param {
455
454
  ViewPortWidth = "viewPortWidth",
456
455
  VisibleActions = "visibleAction",
457
456
  CustomCSSUrl = "customCssUrl",
457
+ DisableLoginRedirect = "disableLoginRedirect",
458
458
  visibleVizs = "pinboardVisibleVizs",
459
- DisableLoginRedirect = "disableLoginRedirect"
459
+ LiveboardV2Enabled = "isPinboardV2Enabled"
460
460
  }
461
461
  /**
462
462
  * The list of actions that can be performed on visual ThoughtSpot
@@ -464,30 +464,57 @@ export declare enum Param {
464
464
  */
465
465
  export declare enum Action {
466
466
  Save = "save",
467
+ /**
468
+ * @hidden
469
+ */
467
470
  Update = "update",
471
+ /**
472
+ * @hidden
473
+ */
468
474
  SaveUntitled = "saveUntitled",
469
475
  SaveAsView = "saveAsView",
470
476
  MakeACopy = "makeACopy",
471
477
  EditACopy = "editACopy",
472
478
  CopyLink = "embedDocument",
479
+ /**
480
+ * @hidden
481
+ */
473
482
  ResetLayout = "resetLayout",
474
483
  Schedule = "subscription",
475
484
  SchedulesList = "schedule-list",
476
485
  Share = "share",
477
486
  AddFilter = "addFilter",
478
487
  ConfigureFilter = "configureFilter",
488
+ /**
489
+ * @hidden
490
+ */
479
491
  AddFormula = "addFormula",
492
+ /**
493
+ * @hidden
494
+ */
480
495
  SearchOnTop = "searchOnTop",
481
496
  SpotIQAnalyze = "spotIQAnalyze",
497
+ /**
498
+ * @hidden
499
+ */
482
500
  ExplainInsight = "explainInsight",
501
+ /**
502
+ * @hidden
503
+ */
483
504
  SpotIQFollow = "spotIQFollow",
484
505
  ShareViz = "shareViz",
506
+ /**
507
+ * @hidden
508
+ */
485
509
  ReplaySearch = "replaySearch",
486
510
  ShowUnderlyingData = "showUnderlyingData",
487
511
  Download = "download",
488
512
  DownloadAsPdf = "downloadAsPdf",
489
513
  DownloadAsCsv = "downloadAsCSV",
490
514
  DownloadAsXlsx = "downloadAsXLSX",
515
+ /**
516
+ * @hidden
517
+ */
491
518
  DownloadTrace = "downloadTrace",
492
519
  ExportTML = "exportTSL",
493
520
  ImportTML = "importTSL",
@@ -498,18 +525,39 @@ export declare enum Action {
498
525
  Edit = "edit",
499
526
  EditTitle = "editTitle",
500
527
  Remove = "delete",
528
+ /**
529
+ * @hidden
530
+ */
501
531
  Ungroup = "ungroup",
532
+ /**
533
+ * @hidden
534
+ */
502
535
  Describe = "describe",
536
+ /**
537
+ * @hidden
538
+ */
503
539
  Relate = "relate",
540
+ /**
541
+ * @hidden
542
+ */
504
543
  CustomizeHeadlines = "customizeHeadlines",
505
544
  /**
506
545
  * @hidden
507
546
  */
508
547
  PinboardInfo = "pinboardInfo",
509
548
  LiveboardInfo = "pinboardInfo",
549
+ /**
550
+ * @hidden
551
+ */
510
552
  SendAnswerFeedback = "sendFeedback",
553
+ /**
554
+ * @hidden
555
+ */
511
556
  DownloadEmbraceQueries = "downloadEmbraceQueries",
512
557
  Pin = "pin",
558
+ /**
559
+ * @hidden
560
+ */
513
561
  AnalysisInfo = "analysisInfo",
514
562
  Subscription = "subscription",
515
563
  Explore = "explore",
@@ -517,16 +565,18 @@ export declare enum Action {
517
565
  DrillExclude = "context-menu-item-exclude",
518
566
  CopyToClipboard = "context-menu-item-copy-to-clipboard",
519
567
  CopyAndEdit = "context-menu-item-copy-and-edit",
568
+ /**
569
+ * @hidden
570
+ */
520
571
  DrillEdit = "context-menu-item-edit",
521
572
  EditMeasure = "context-menu-item-edit-measure",
522
573
  Separator = "context-menu-item-separator",
574
+ /**
575
+ * @hidden
576
+ */
523
577
  DrillDown = "DRILL",
524
578
  RequestAccess = "requestAccess",
525
579
  QueryDetailsButtons = "queryDetailsButtons",
526
- /**
527
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
528
- */
529
- Monitor = "createMonitor",
530
580
  /**
531
581
  * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
532
582
  */
@@ -542,7 +592,11 @@ export declare enum Action {
542
592
  /**
543
593
  * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
544
594
  */
545
- EditDetails = "editDetails"
595
+ EditDetails = "editDetails",
596
+ /**
597
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
598
+ */
599
+ CreateMonitor = "createMonitor"
546
600
  }
547
601
  export interface SessionInterface {
548
602
  sessionId: string;
@@ -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;
@@ -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
  /**
@@ -422,7 +427,6 @@ var Param;
422
427
  (function (Param) {
423
428
  Param["DataSources"] = "dataSources";
424
429
  Param["DataSourceMode"] = "dataSourceMode";
425
- Param["ExpandAllDataSource"] = "expandAllDataSource";
426
430
  Param["DisableActions"] = "disableAction";
427
431
  Param["DisableActionReason"] = "disableHint";
428
432
  Param["ForceTable"] = "forceTable";
@@ -446,8 +450,9 @@ var Param;
446
450
  Param["ViewPortWidth"] = "viewPortWidth";
447
451
  Param["VisibleActions"] = "visibleAction";
448
452
  Param["CustomCSSUrl"] = "customCssUrl";
449
- Param["visibleVizs"] = "pinboardVisibleVizs";
450
453
  Param["DisableLoginRedirect"] = "disableLoginRedirect";
454
+ Param["visibleVizs"] = "pinboardVisibleVizs";
455
+ Param["LiveboardV2Enabled"] = "isPinboardV2Enabled";
451
456
  })(Param || (Param = {}));
452
457
  /**
453
458
  * The list of actions that can be performed on visual ThoughtSpot
@@ -457,30 +462,57 @@ var Param;
457
462
  var Action;
458
463
  (function (Action) {
459
464
  Action["Save"] = "save";
465
+ /**
466
+ * @hidden
467
+ */
460
468
  Action["Update"] = "update";
469
+ /**
470
+ * @hidden
471
+ */
461
472
  Action["SaveUntitled"] = "saveUntitled";
462
473
  Action["SaveAsView"] = "saveAsView";
463
474
  Action["MakeACopy"] = "makeACopy";
464
475
  Action["EditACopy"] = "editACopy";
465
476
  Action["CopyLink"] = "embedDocument";
477
+ /**
478
+ * @hidden
479
+ */
466
480
  Action["ResetLayout"] = "resetLayout";
467
481
  Action["Schedule"] = "subscription";
468
482
  Action["SchedulesList"] = "schedule-list";
469
483
  Action["Share"] = "share";
470
484
  Action["AddFilter"] = "addFilter";
471
485
  Action["ConfigureFilter"] = "configureFilter";
486
+ /**
487
+ * @hidden
488
+ */
472
489
  Action["AddFormula"] = "addFormula";
490
+ /**
491
+ * @hidden
492
+ */
473
493
  Action["SearchOnTop"] = "searchOnTop";
474
494
  Action["SpotIQAnalyze"] = "spotIQAnalyze";
495
+ /**
496
+ * @hidden
497
+ */
475
498
  Action["ExplainInsight"] = "explainInsight";
499
+ /**
500
+ * @hidden
501
+ */
476
502
  Action["SpotIQFollow"] = "spotIQFollow";
477
503
  Action["ShareViz"] = "shareViz";
504
+ /**
505
+ * @hidden
506
+ */
478
507
  Action["ReplaySearch"] = "replaySearch";
479
508
  Action["ShowUnderlyingData"] = "showUnderlyingData";
480
509
  Action["Download"] = "download";
481
510
  Action["DownloadAsPdf"] = "downloadAsPdf";
482
511
  Action["DownloadAsCsv"] = "downloadAsCSV";
483
512
  Action["DownloadAsXlsx"] = "downloadAsXLSX";
513
+ /**
514
+ * @hidden
515
+ */
484
516
  Action["DownloadTrace"] = "downloadTrace";
485
517
  Action["ExportTML"] = "exportTSL";
486
518
  Action["ImportTML"] = "importTSL";
@@ -491,18 +523,39 @@ var Action;
491
523
  Action["Edit"] = "edit";
492
524
  Action["EditTitle"] = "editTitle";
493
525
  Action["Remove"] = "delete";
526
+ /**
527
+ * @hidden
528
+ */
494
529
  Action["Ungroup"] = "ungroup";
530
+ /**
531
+ * @hidden
532
+ */
495
533
  Action["Describe"] = "describe";
534
+ /**
535
+ * @hidden
536
+ */
496
537
  Action["Relate"] = "relate";
538
+ /**
539
+ * @hidden
540
+ */
497
541
  Action["CustomizeHeadlines"] = "customizeHeadlines";
498
542
  /**
499
543
  * @hidden
500
544
  */
501
545
  Action["PinboardInfo"] = "pinboardInfo";
502
546
  Action["LiveboardInfo"] = "pinboardInfo";
547
+ /**
548
+ * @hidden
549
+ */
503
550
  Action["SendAnswerFeedback"] = "sendFeedback";
551
+ /**
552
+ * @hidden
553
+ */
504
554
  Action["DownloadEmbraceQueries"] = "downloadEmbraceQueries";
505
555
  Action["Pin"] = "pin";
556
+ /**
557
+ * @hidden
558
+ */
506
559
  Action["AnalysisInfo"] = "analysisInfo";
507
560
  Action["Subscription"] = "subscription";
508
561
  Action["Explore"] = "explore";
@@ -510,16 +563,18 @@ var Action;
510
563
  Action["DrillExclude"] = "context-menu-item-exclude";
511
564
  Action["CopyToClipboard"] = "context-menu-item-copy-to-clipboard";
512
565
  Action["CopyAndEdit"] = "context-menu-item-copy-and-edit";
566
+ /**
567
+ * @hidden
568
+ */
513
569
  Action["DrillEdit"] = "context-menu-item-edit";
514
570
  Action["EditMeasure"] = "context-menu-item-edit-measure";
515
571
  Action["Separator"] = "context-menu-item-separator";
572
+ /**
573
+ * @hidden
574
+ */
516
575
  Action["DrillDown"] = "DRILL";
517
576
  Action["RequestAccess"] = "requestAccess";
518
577
  Action["QueryDetailsButtons"] = "queryDetailsButtons";
519
- /**
520
- * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
521
- */
522
- Action["Monitor"] = "createMonitor";
523
578
  /**
524
579
  * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
525
580
  */
@@ -536,6 +591,10 @@ var Action;
536
591
  * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl
537
592
  */
538
593
  Action["EditDetails"] = "editDetails";
594
+ /**
595
+ * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
596
+ */
597
+ Action["CreateMonitor"] = "createMonitor";
539
598
  })(Action || (Action = {}));
540
599
  // eslint-disable-next-line no-shadow
541
600
  var OperationType;
@@ -8909,7 +8968,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
8909
8968
  }
8910
8969
  }
8911
8970
 
8912
- var name="@thoughtspot/visual-embed-sdk";var version="1.9.3";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};
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};
8913
8972
 
8914
8973
  /**
8915
8974
  * Copyright (c) 2022
@@ -8920,6 +8979,10 @@ var name="@thoughtspot/visual-embed-sdk";var version="1.9.3";var description="Th
8920
8979
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
8921
8980
  */
8922
8981
  const { version: version$1 } = pkgInfo;
8982
+ /**
8983
+ * Global prefix for all Thoughtspot postHash Params.
8984
+ */
8985
+ const THOUGHTSPOT_PARAM_PREFIX = 'ts-';
8923
8986
  /**
8924
8987
  * The event id map from v2 event names to v1 event id
8925
8988
  * v1 events are the classic embed events implemented in Blink v1
@@ -9127,7 +9190,7 @@ class TsEmbed {
9127
9190
  * @param url
9128
9191
  * @param frameOptions
9129
9192
  */
9130
- renderIFrame(url, frameOptions) {
9193
+ renderIFrame(url, frameOptions = {}) {
9131
9194
  if (this.isError) {
9132
9195
  return;
9133
9196
  }
@@ -9158,8 +9221,10 @@ class TsEmbed {
9158
9221
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9159
9222
  // @ts-ignore
9160
9223
  this.iFrame.mozallowfullscreen = true;
9161
- const width = getCssDimension((frameOptions === null || frameOptions === void 0 ? void 0 : frameOptions.width) || DEFAULT_EMBED_WIDTH);
9162
- const height = getCssDimension((frameOptions === null || frameOptions === void 0 ? void 0 : frameOptions.height) || DEFAULT_EMBED_HEIGHT);
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);
9163
9228
  this.iFrame.style.width = `${width}`;
9164
9229
  this.iFrame.style.height = `${height}`;
9165
9230
  this.iFrame.style.border = '0';
@@ -9323,6 +9388,30 @@ class TsEmbed {
9323
9388
  this.isRendered = true;
9324
9389
  return this;
9325
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
+ }
9326
9415
  }
9327
9416
  /**
9328
9417
  * Base class for embedding v1 experience
@@ -9404,13 +9493,14 @@ class AppEmbed extends V1Embed {
9404
9493
  */
9405
9494
  getEmbedParams() {
9406
9495
  const params = this.getBaseQueryParams();
9407
- const { tag, hideObjects } = this.viewConfig;
9496
+ const { tag, hideObjects, liveboardV2 = false } = this.viewConfig;
9408
9497
  if (tag) {
9409
9498
  params[Param.Tag] = tag;
9410
9499
  }
9411
9500
  if (hideObjects && hideObjects.length) {
9412
9501
  params[Param.HideObjects] = JSON.stringify(hideObjects);
9413
9502
  }
9503
+ params[Param.LiveboardV2Enabled] = liveboardV2;
9414
9504
  const queryParams = getQueryParamString(params, true);
9415
9505
  return queryParams;
9416
9506
  }
@@ -9424,7 +9514,9 @@ class AppEmbed extends V1Embed {
9424
9514
  const queryString = [filterQuery, queryParams]
9425
9515
  .filter(Boolean)
9426
9516
  .join('&');
9427
- const url = `${this.getV1EmbedBasePath(queryString, this.viewConfig.showPrimaryNavbar, this.viewConfig.disableProfileAndHelp, true)}/${pageId}`;
9517
+ let url = `${this.getV1EmbedBasePath(queryString, this.viewConfig.showPrimaryNavbar, this.viewConfig.disableProfileAndHelp, true)}/${pageId}`;
9518
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams();
9519
+ url = `${url}${tsPostHashParams}`;
9428
9520
  return url;
9429
9521
  }
9430
9522
  /**
@@ -9538,7 +9630,7 @@ class LiveboardEmbed extends V1Embed {
9538
9630
  */
9539
9631
  getEmbedParams() {
9540
9632
  const params = this.getBaseQueryParams();
9541
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, } = this.viewConfig;
9633
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2 = false, } = this.viewConfig;
9542
9634
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval ||
9543
9635
  this.viewConfig.preventPinboardFilterRemoval;
9544
9636
  if (fullHeight === true) {
@@ -9557,6 +9649,7 @@ class LiveboardEmbed extends V1Embed {
9557
9649
  params[Param.visibleVizs] = visibleVizs;
9558
9650
  }
9559
9651
  params[Param.livedBoardEmbed] = true;
9652
+ params[Param.LiveboardV2Enabled] = liveboardV2;
9560
9653
  const queryParams = getQueryParamString(params, true);
9561
9654
  return queryParams;
9562
9655
  }
@@ -9578,6 +9671,8 @@ class LiveboardEmbed extends V1Embed {
9578
9671
  if (vizId) {
9579
9672
  url = `${url}/${vizId}`;
9580
9673
  }
9674
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams();
9675
+ url = `${url}${tsPostHashParams}`;
9581
9676
  return url;
9582
9677
  }
9583
9678
  /**
@@ -9656,7 +9751,7 @@ class SearchEmbed extends TsEmbed {
9656
9751
  */
9657
9752
  getIFrameSrc(answerId, dataSources) {
9658
9753
  var _a;
9659
- const { hideResults, expandAllDataSource, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
9754
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, } = this.viewConfig;
9660
9755
  const answerPath = answerId ? `saved-answer/${answerId}` : 'answer';
9661
9756
  const queryParams = this.getBaseQueryParams();
9662
9757
  queryParams[Param.HideActions] = [
@@ -9689,7 +9784,8 @@ class SearchEmbed extends TsEmbed {
9689
9784
  if (queryParamsString) {
9690
9785
  query = `?${queryParamsString}`;
9691
9786
  }
9692
- return `${this.getEmbedBasePath(query)}/${answerPath}`;
9787
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams();
9788
+ return `${this.getEmbedBasePath(query)}/${answerPath}${tsPostHashParams}`;
9693
9789
  }
9694
9790
  /**
9695
9791
  * Render the embedded ThoughtSpot search