@thoughtspot/visual-embed-sdk 1.13.0-alpha.3 → 1.13.0-alpha.4

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.
@@ -183,6 +183,14 @@ export declare class TsEmbed {
183
183
  * and executes the registered callbacks accordingly.
184
184
  */
185
185
  private subscribeToEvents;
186
+ /**
187
+ * Send Custom style as part of payload of APP_INIT
188
+ */
189
+ private appInitCb;
190
+ /**
191
+ * Register APP_INIT event and sendback init payload
192
+ */
193
+ private registerAppInit;
186
194
  /**
187
195
  * Constructs the base URL string to load the ThoughtSpot app.
188
196
  */
@@ -41,6 +41,26 @@ export declare enum AuthType {
41
41
  Basic = "Basic"
42
42
  }
43
43
  export declare type DOMSelector = string | HTMLElement;
44
+ interface customCssInterface {
45
+ variables?: {
46
+ [variableName: string]: string;
47
+ };
48
+ rules_UNSTABLE?: {
49
+ [selector: string]: {
50
+ [declaration: string]: string;
51
+ };
52
+ };
53
+ }
54
+ interface CustomStyles {
55
+ customCSSUrl?: string;
56
+ customCss?: customCssInterface;
57
+ }
58
+ export interface CustomisationsInterface {
59
+ style: CustomStyles;
60
+ content: {
61
+ [key: string]: string;
62
+ };
63
+ }
44
64
  /**
45
65
  * The configuration object for embedding ThoughtSpot content.
46
66
  * It includes the ThoughtSpot hostname or IP address,
@@ -172,6 +192,10 @@ export interface EmbedConfig {
172
192
  * @version SDK: 1.12.0 | ThoughtSpot: *
173
193
  */
174
194
  suppressSearchEmbedBetaWarning?: boolean;
195
+ /**
196
+ * Custom style params for embed Config
197
+ */
198
+ customisations?: CustomisationsInterface;
175
199
  }
176
200
  /**
177
201
  * MessagePayload: Embed event payload: message type, data and status (start/end)
@@ -526,7 +550,66 @@ export declare enum EmbedEvent {
526
550
  * Emitted when an answer is switched to a chart or table view
527
551
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
528
552
  */
529
- AnswerChartSwitcher = "answerChartSwitcher"
553
+ AnswerChartSwitcher = "answerChartSwitcher",
554
+ /**
555
+ *
556
+ */
557
+ APP_INIT = "appInit",
558
+ /**
559
+ * Emitted when a user clicks Show Liveboard details on a Liveboard
560
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
561
+ */
562
+ LiveboardInfo = "pinboardInfo",
563
+ /**
564
+ * Emitted when a user clicks on the Favorite icon on a Liveboard
565
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
566
+ */
567
+ AddToFavorites = "addToFavorites",
568
+ /**
569
+ * Emitted when a user clicks Schedule on a Liveboard
570
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
571
+ */
572
+ Schedule = "subscription",
573
+ /**
574
+ * Emitted when a user clicks Edit on a Liveboard or visualization
575
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
576
+ */
577
+ Edit = "edit",
578
+ /**
579
+ * Emitted when a user clicks Make a copy on a Liveboard
580
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
581
+ */
582
+ MakeACopy = "makeACopy",
583
+ /**
584
+ * Emitted when a user clicks Present on a Liveboard or visualization
585
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
586
+ */
587
+ Present = "present",
588
+ /**
589
+ * Emitted when a user clicks Delete on a Liveboard
590
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
591
+ */
592
+ Delete = "delete",
593
+ /**
594
+ * Emitted when a user clicks Manage schedules on a Liveboard
595
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
596
+ */
597
+ SchedulesList = "schedule-list",
598
+ /**
599
+ * Emitted when a user clicks Cancel in edit mode on a Liveboard
600
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
601
+ */
602
+ Cancel = "cancel",
603
+ /**
604
+ * Emitted when a user clicks Explore on a visualization
605
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
606
+ */
607
+ Explore = "explore",
608
+ /**
609
+ * Emitted when a user clicks Copy link action on a visualization
610
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
611
+ */
612
+ CopyLink = "copyLink"
530
613
  }
531
614
  /**
532
615
  * Event types that can be triggered by the host application
@@ -588,12 +671,106 @@ export declare enum HostEvent {
588
671
  */
589
672
  getExportRequestForCurrentPinboard = "getExportRequestForCurrentPinboard",
590
673
  /**
591
- * Fires the pin action on an embedded object
592
- * @param - incase of liveboard embed, takes in an object with vizId as a key
593
- * can be left empty for search and viz embeds
674
+ * Triggers the Pin action on an embedded object
675
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
676
+ * can be left empty for search and visualization embeds
677
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
678
+ */
679
+ Pin = "pin",
680
+ /**
681
+ * Triggers the Show Liveboard details action on a Liveboard
682
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
683
+ */
684
+ LiveboardInfo = "pinboardInfo",
685
+ /**
686
+ * Triggers the Schedule action on a Liveboard
687
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
688
+ */
689
+ Schedule = "subscription",
690
+ /**
691
+ * Triggers the Manage schedule action on a Liveboard
692
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
693
+ */
694
+ SchedulesList = "schedule-list",
695
+ /**
696
+ * Triggers the Export TML action on a Liveboard
697
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
698
+ */
699
+ ExportTML = "exportTSL",
700
+ /**
701
+ * Triggers the Edit TML action on a Liveboard
702
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
703
+ */
704
+ EditTML = "editTSL",
705
+ /**
706
+ * Triggers the Update TML action on a Liveboard
707
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
708
+ */
709
+ UpdateTML = "updateTSL",
710
+ /**
711
+ * Triggers the Download PDF action on a Liveboard
712
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
713
+ */
714
+ DownloadAsPdf = "downloadAsPdf",
715
+ /**
716
+ * Triggers the Make a copy action on a Liveboard
717
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
718
+ */
719
+ MakeACopy = "makeACopy",
720
+ /**
721
+ * Triggers the Delete action on a Liveboard
722
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
723
+ */
724
+ Remove = "delete",
725
+ /**
726
+ * Triggers the Explore action on a visualization
727
+ * @param - an object with vizId as a key
728
+ * eg: {vizId: '730496d6-6903-4601-937e-2c691821af3c'}
729
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
730
+ */
731
+ Explore = "explore",
732
+ /**
733
+ * Triggers the Create alert action on a visualization
734
+ * @param - an object with vizId as a key
735
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
736
+ */
737
+ CreateMonitor = "createMonitor",
738
+ /**
739
+ * Triggers the Manage alert action on a visualization
740
+ * @param - an object with vizId as a key
741
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
742
+ */
743
+ ManageMonitor = "manageMonitor",
744
+ /**
745
+ * Triggers the Edit action on a Liveboard or visualization
746
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
747
+ * @example
748
+ * liveboardEmbed.trigger(HostEvent.Edit)
749
+ * liveboardEmbed.trigger(HostEvent.Edit, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
750
+ * vizEmbed.trigger((HostEvent.Edit)
751
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
752
+ */
753
+ Edit = "edit",
754
+ /**
755
+ * Triggers the Copy link action on a Liveboard or visualization
756
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
757
+ * @example
758
+ * liveboardEmbed.trigger(HostEvent.CopyLink)
759
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
760
+ * vizEmbed.trigger((HostEvent.CopyLink)
761
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
762
+ */
763
+ CopyLink = "embedDocument",
764
+ /**
765
+ * Triggers the Present action on a Liveboard or visualization
766
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
767
+ * @example
768
+ * liveboardEmbed.trigger(HostEvent.Present)
769
+ * liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
770
+ * vizEmbed.trigger((HostEvent.Present)
594
771
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
595
772
  */
596
- Pin = "pin"
773
+ Present = "present"
597
774
  }
598
775
  /**
599
776
  * The different visual modes that the data sources panel within
@@ -648,7 +825,8 @@ export declare enum Param {
648
825
  visibleVizs = "pinboardVisibleVizs",
649
826
  LiveboardV2Enabled = "isPinboardV2Enabled",
650
827
  ShowAlerts = "showAlerts",
651
- Locale = "locale"
828
+ Locale = "locale",
829
+ CustomStyle = "customStyle"
652
830
  }
653
831
  /**
654
832
  * The list of actions that can be performed on visual ThoughtSpot
@@ -809,3 +987,4 @@ export declare enum OperationType {
809
987
  export interface AnswerServiceType {
810
988
  getAnswer?: (offset: number, batchSize: number) => any;
811
989
  }
990
+ export {};
@@ -6,7 +6,7 @@
6
6
  * @summary Utils
7
7
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
8
8
  */
9
- import { QueryParams, RuntimeFilter } from './types';
9
+ import { EmbedConfig, QueryParams, RuntimeFilter, CustomisationsInterface } from './types';
10
10
  /**
11
11
  * Construct a runtime filters query string from the given filters.
12
12
  * Refer to the following docs for more details on runtime filter syntax:
@@ -43,3 +43,4 @@ export declare const setAttributes: (element: HTMLElement, attributes: {
43
43
  [key: string]: string | number | boolean;
44
44
  }) => void;
45
45
  export declare const checkReleaseVersionInBeta: (releaseVersion: string, suppressBetaWarning: boolean) => boolean;
46
+ export declare const getCustomisations: (embedConfig: EmbedConfig) => CustomisationsInterface;
@@ -132,6 +132,15 @@ const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
132
132
  return !suppressBetaWarning && isBetaVersion;
133
133
  }
134
134
  return false;
135
+ };
136
+ const getCustomisations = (embedConfig) => {
137
+ const { customCssUrl } = embedConfig;
138
+ let { customisations } = embedConfig;
139
+ customisations = customisations || {};
140
+ customisations.style = customisations.style || {};
141
+ customisations.style.customCSSUrl =
142
+ customisations.style.customCSSUrl || customCssUrl;
143
+ return customisations;
135
144
  };
136
145
 
137
146
  /**
@@ -488,6 +497,65 @@ var EmbedEvent;
488
497
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl
489
498
  */
490
499
  EmbedEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
500
+ /**
501
+ *
502
+ */
503
+ EmbedEvent["APP_INIT"] = "appInit";
504
+ /**
505
+ * Emitted when a user clicks Show Liveboard details on a Liveboard
506
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
507
+ */
508
+ EmbedEvent["LiveboardInfo"] = "pinboardInfo";
509
+ /**
510
+ * Emitted when a user clicks on the Favorite icon on a Liveboard
511
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
512
+ */
513
+ EmbedEvent["AddToFavorites"] = "addToFavorites";
514
+ /**
515
+ * Emitted when a user clicks Schedule on a Liveboard
516
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
517
+ */
518
+ EmbedEvent["Schedule"] = "subscription";
519
+ /**
520
+ * Emitted when a user clicks Edit on a Liveboard or visualization
521
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
522
+ */
523
+ EmbedEvent["Edit"] = "edit";
524
+ /**
525
+ * Emitted when a user clicks Make a copy on a Liveboard
526
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
527
+ */
528
+ EmbedEvent["MakeACopy"] = "makeACopy";
529
+ /**
530
+ * Emitted when a user clicks Present on a Liveboard or visualization
531
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
532
+ */
533
+ EmbedEvent["Present"] = "present";
534
+ /**
535
+ * Emitted when a user clicks Delete on a Liveboard
536
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
537
+ */
538
+ EmbedEvent["Delete"] = "delete";
539
+ /**
540
+ * Emitted when a user clicks Manage schedules on a Liveboard
541
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
542
+ */
543
+ EmbedEvent["SchedulesList"] = "schedule-list";
544
+ /**
545
+ * Emitted when a user clicks Cancel in edit mode on a Liveboard
546
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
547
+ */
548
+ EmbedEvent["Cancel"] = "cancel";
549
+ /**
550
+ * Emitted when a user clicks Explore on a visualization
551
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
552
+ */
553
+ EmbedEvent["Explore"] = "explore";
554
+ /**
555
+ * Emitted when a user clicks Copy link action on a visualization
556
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
557
+ */
558
+ EmbedEvent["CopyLink"] = "copyLink";
491
559
  })(EmbedEvent || (EmbedEvent = {}));
492
560
  /**
493
561
  * Event types that can be triggered by the host application
@@ -551,12 +619,106 @@ var HostEvent;
551
619
  */
552
620
  HostEvent["getExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
553
621
  /**
554
- * Fires the pin action on an embedded object
555
- * @param - incase of liveboard embed, takes in an object with vizId as a key
556
- * can be left empty for search and viz embeds
622
+ * Triggers the Pin action on an embedded object
623
+ * @param - incase of Liveboard embed, takes in an object with vizId as a key
624
+ * can be left empty for search and visualization embeds
557
625
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
558
626
  */
559
627
  HostEvent["Pin"] = "pin";
628
+ /**
629
+ * Triggers the Show Liveboard details action on a Liveboard
630
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
631
+ */
632
+ HostEvent["LiveboardInfo"] = "pinboardInfo";
633
+ /**
634
+ * Triggers the Schedule action on a Liveboard
635
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
636
+ */
637
+ HostEvent["Schedule"] = "subscription";
638
+ /**
639
+ * Triggers the Manage schedule action on a Liveboard
640
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
641
+ */
642
+ HostEvent["SchedulesList"] = "schedule-list";
643
+ /**
644
+ * Triggers the Export TML action on a Liveboard
645
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
646
+ */
647
+ HostEvent["ExportTML"] = "exportTSL";
648
+ /**
649
+ * Triggers the Edit TML action on a Liveboard
650
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
651
+ */
652
+ HostEvent["EditTML"] = "editTSL";
653
+ /**
654
+ * Triggers the Update TML action on a Liveboard
655
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
656
+ */
657
+ HostEvent["UpdateTML"] = "updateTSL";
658
+ /**
659
+ * Triggers the Download PDF action on a Liveboard
660
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
661
+ */
662
+ HostEvent["DownloadAsPdf"] = "downloadAsPdf";
663
+ /**
664
+ * Triggers the Make a copy action on a Liveboard
665
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
666
+ */
667
+ HostEvent["MakeACopy"] = "makeACopy";
668
+ /**
669
+ * Triggers the Delete action on a Liveboard
670
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
671
+ */
672
+ HostEvent["Remove"] = "delete";
673
+ /**
674
+ * Triggers the Explore action on a visualization
675
+ * @param - an object with vizId as a key
676
+ * eg: {vizId: '730496d6-6903-4601-937e-2c691821af3c'}
677
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
678
+ */
679
+ HostEvent["Explore"] = "explore";
680
+ /**
681
+ * Triggers the Create alert action on a visualization
682
+ * @param - an object with vizId as a key
683
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
684
+ */
685
+ HostEvent["CreateMonitor"] = "createMonitor";
686
+ /**
687
+ * Triggers the Manage alert action on a visualization
688
+ * @param - an object with vizId as a key
689
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
690
+ */
691
+ HostEvent["ManageMonitor"] = "manageMonitor";
692
+ /**
693
+ * Triggers the Edit action on a Liveboard or visualization
694
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
695
+ * @example
696
+ * liveboardEmbed.trigger(HostEvent.Edit)
697
+ * liveboardEmbed.trigger(HostEvent.Edit, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
698
+ * vizEmbed.trigger((HostEvent.Edit)
699
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
700
+ */
701
+ HostEvent["Edit"] = "edit";
702
+ /**
703
+ * Triggers the Copy link action on a Liveboard or visualization
704
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
705
+ * @example
706
+ * liveboardEmbed.trigger(HostEvent.CopyLink)
707
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
708
+ * vizEmbed.trigger((HostEvent.CopyLink)
709
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
710
+ */
711
+ HostEvent["CopyLink"] = "embedDocument";
712
+ /**
713
+ * Triggers the Present action on a Liveboard or visualization
714
+ * @param - object - to trigger the action for a specfic visualization in Liveboard embed, pass in vizId as a key
715
+ * @example
716
+ * liveboardEmbed.trigger(HostEvent.Present)
717
+ * liveboardEmbed.trigger(HostEvent.Present, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
718
+ * vizEmbed.trigger((HostEvent.Present)
719
+ * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl
720
+ */
721
+ HostEvent["Present"] = "present";
560
722
  })(HostEvent || (HostEvent = {}));
561
723
  /**
562
724
  * The different visual modes that the data sources panel within
@@ -616,6 +778,7 @@ var Param;
616
778
  Param["LiveboardV2Enabled"] = "isPinboardV2Enabled";
617
779
  Param["ShowAlerts"] = "showAlerts";
618
780
  Param["Locale"] = "locale";
781
+ Param["CustomStyle"] = "customStyle";
619
782
  })(Param || (Param = {}));
620
783
  /**
621
784
  * The list of actions that can be performed on visual ThoughtSpot
@@ -7824,7 +7987,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
7824
7987
  });
7825
7988
  }
7826
7989
 
7827
- var name="@thoughtspot/visual-embed-sdk";var version="1.13.0-alpha.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/sdk/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",eventemitter3:"^4.0.7","html-react-parser":"^1.4.12","mixpanel-browser":"^2.45.0","use-deep-compare-effect":"^1.8.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","@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};
7990
+ var name="@thoughtspot/visual-embed-sdk";var version="1.13.0-alpha.4";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/sdk/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",eventemitter3:"^4.0.7","html-react-parser":"^1.4.12","mixpanel-browser":"^2.45.0","use-deep-compare-effect":"^1.8.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","@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};
7828
7991
 
7829
7992
  /**
7830
7993
  * Copyright (c) 2022
@@ -7863,6 +8026,21 @@ class TsEmbed {
7863
8026
  */
7864
8027
  this.shouldEncodeUrlQueryParams = false;
7865
8028
  this.defaultHiddenActions = [Action.ReportError];
8029
+ /**
8030
+ * Send Custom style as part of payload of APP_INIT
8031
+ */
8032
+ this.appInitCb = (_, responder) => {
8033
+ responder({
8034
+ type: EmbedEvent.APP_INIT,
8035
+ data: { customisations: getCustomisations(this.embedConfig) },
8036
+ });
8037
+ };
8038
+ /**
8039
+ * Register APP_INIT event and sendback init payload
8040
+ */
8041
+ this.registerAppInit = () => {
8042
+ this.on(EmbedEvent.APP_INIT, this.appInitCb);
8043
+ };
7866
8044
  this.el = this.getDOMNode(domSelector);
7867
8045
  // TODO: handle error
7868
8046
  this.embedConfig = getEmbedConfig();
@@ -7872,6 +8050,7 @@ class TsEmbed {
7872
8050
  this.isError = false;
7873
8051
  this.viewConfig = viewConfig;
7874
8052
  this.shouldEncodeUrlQueryParams = this.embedConfig.shouldEncodeUrlQueryParams;
8053
+ this.registerAppInit();
7875
8054
  }
7876
8055
  /**
7877
8056
  * Gets a reference to the root DOM node where
@@ -7991,6 +8170,7 @@ class TsEmbed {
7991
8170
  this.embedConfig.autoLogin === true) {
7992
8171
  queryParams[Param.DisableLoginRedirect] = true;
7993
8172
  }
8173
+ // TODO remove this
7994
8174
  if (this.embedConfig.customCssUrl) {
7995
8175
  queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
7996
8176
  }