@product7/product7-js 0.5.0 → 0.5.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.
@@ -6200,6 +6200,9 @@
6200
6200
  border-radius: 50%;
6201
6201
  border: 1.5px solid #D1D5DB;
6202
6202
  flex-shrink: 0;
6203
+ display: flex;
6204
+ align-items: center;
6205
+ justify-content: center;
6203
6206
  background: transparent;
6204
6207
  transition: all var(--transition-fast);
6205
6208
  }
@@ -6221,6 +6224,10 @@
6221
6224
  }
6222
6225
 
6223
6226
  .feedback-survey-page-choice-btn.selected::after {
6227
+ content: '✓';
6228
+ color: #ffffff;
6229
+ font-size: 11px;
6230
+ font-weight: 700;
6224
6231
  border-color: var(--color-primary);
6225
6232
  background-color: var(--color-primary);
6226
6233
  }
@@ -13622,10 +13629,25 @@
13622
13629
  _showThankYouScreen(onAfterClose) {
13623
13630
  if (!this.surveyElement) return;
13624
13631
 
13625
- const config = this.surveyOptions.thankYouConfig || {};
13632
+ const pages = this.surveyOptions.pages || [];
13633
+ const currentPage =
13634
+ pages[this.surveyState.currentPageIndex] ||
13635
+ pages[pages.length - 1] ||
13636
+ null;
13637
+ const pageConfig = currentPage?.thankYouConfig || null;
13638
+ const surveyConfig = this.surveyOptions.thankYouConfig || null;
13639
+ const config =
13640
+ (pageConfig?.title ? pageConfig : null) ||
13641
+ (surveyConfig?.title ? surveyConfig : null) ||
13642
+ {};
13626
13643
  const title = config.title || 'Thanks for your feedback!';
13627
13644
  const buttonText = config.button_text || null;
13628
- const buttonUrl = config.button_url || '#';
13645
+ const rawUrl = config.button_url || '';
13646
+ const buttonUrl = rawUrl
13647
+ ? /^https?:\/\//i.test(rawUrl)
13648
+ ? rawUrl
13649
+ : `https://${rawUrl}`
13650
+ : '#';
13629
13651
 
13630
13652
  if (this._escapeHandler) {
13631
13653
  document.removeEventListener('keydown', this._escapeHandler);
@@ -14305,6 +14327,7 @@
14305
14327
  page.multipleChoiceConfig || page.multiple_choice_config || null,
14306
14328
  linkConfig: page.linkConfig || page.link_config || null,
14307
14329
  afterThisPage: page.afterThisPage || page.after_this_page || null,
14330
+ thankYouConfig: page.thankYouConfig || page.thank_you_config || null,
14308
14331
  }))
14309
14332
  .sort((a, b) => a.position - b.position);
14310
14333
  }