@product7/feedback-sdk 1.6.8 → 1.6.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@product7/feedback-sdk",
3
- "version": "1.6.8",
3
+ "version": "1.6.9",
4
4
  "description": "JavaScript SDK for integrating Product7 feedback widgets into any website",
5
5
  "main": "dist/feedback-sdk.js",
6
6
  "module": "src/index.js",
@@ -512,6 +512,7 @@ export class FeedbackSDK {
512
512
  triggerText: "What's New",
513
513
  showBadge: true,
514
514
  viewButtonText: 'View Update',
515
+ showBackdrop: true,
515
516
  };
516
517
 
517
518
  const configDefaults = this._getWidgetTypeConfig('changelog');
@@ -688,6 +688,7 @@ messenger.mount();
688
688
  const changelog = sdk.createWidget('changelog', {
689
689
  position: 'bottom-left',
690
690
  theme: 'light',
691
+ showBackdrop: true,
691
692
  triggerText: "What's New",
692
693
  showBadge: true,
693
694
  title: "What's New",
@@ -7,6 +7,7 @@ export class ChangelogWidget extends BaseWidget {
7
7
  this.isLoading = false;
8
8
  this.modalElement = null;
9
9
  this.sidebarElement = null;
10
+ this.listModalBackdropElement = null;
10
11
  this.currentIndex = 0;
11
12
  }
12
13
 
@@ -87,10 +88,12 @@ export class ChangelogWidget extends BaseWidget {
87
88
  }
88
89
 
89
90
  _createModal() {
90
- this.backdropElement = document.createElement('div');
91
- this.backdropElement.className = `changelog-modal-backdrop changelog-theme-${this.options.theme || 'light'}`;
92
- document.body.appendChild(this.backdropElement);
93
- this.backdropElement.addEventListener('click', () => this.closeModal());
91
+ if (this.options.showBackdrop !== false) {
92
+ this.backdropElement = document.createElement('div');
93
+ this.backdropElement.className = `changelog-modal-backdrop changelog-theme-${this.options.theme || 'light'}`;
94
+ document.body.appendChild(this.backdropElement);
95
+ this.backdropElement.addEventListener('click', () => this.closeModal());
96
+ }
94
97
 
95
98
  this.modalElement = document.createElement('div');
96
99
  this.modalElement.className = `changelog-modal changelog-theme-${this.options.theme || 'light'}`;
@@ -230,12 +233,14 @@ export class ChangelogWidget extends BaseWidget {
230
233
  }
231
234
 
232
235
  _createListModal() {
233
- this.listModalBackdropElement = document.createElement('div');
234
- this.listModalBackdropElement.className = `changelog-list-modal-backdrop changelog-theme-${this.options.theme || 'light'}`;
235
- document.body.appendChild(this.listModalBackdropElement);
236
- this.listModalBackdropElement.addEventListener('click', () =>
237
- this.closeSidebar()
238
- );
236
+ if (this.options.showBackdrop !== false) {
237
+ this.listModalBackdropElement = document.createElement('div');
238
+ this.listModalBackdropElement.className = `changelog-list-modal-backdrop changelog-theme-${this.options.theme || 'light'}`;
239
+ document.body.appendChild(this.listModalBackdropElement);
240
+ this.listModalBackdropElement.addEventListener('click', () =>
241
+ this.closeSidebar()
242
+ );
243
+ }
239
244
 
240
245
  this.listModalElement = document.createElement('div');
241
246
  this.listModalElement.className = `changelog-list-modal changelog-theme-${this.options.theme || 'light'}`;
package/types/index.d.ts CHANGED
@@ -233,6 +233,7 @@ declare module '@product7/feedback-sdk' {
233
233
  enabled?: boolean;
234
234
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
235
235
  theme?: 'light' | 'dark';
236
+ showBackdrop?: boolean;
236
237
  triggerText?: string;
237
238
  showBadge?: boolean;
238
239
  title?: string;