@product7/feedback-sdk 1.6.0 → 1.6.3

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.
@@ -3911,24 +3911,24 @@
3911
3911
 
3912
3912
  _getTabs() {
3913
3913
  const tabs = [
3914
- { id: 'home', label: 'Home', icon: this._getHomeIcon() },
3914
+ { id: 'home', label: 'Home', icon: 'ph:house-simple-duotone' },
3915
3915
  {
3916
3916
  id: 'messages',
3917
3917
  label: 'Messages',
3918
- icon: this._getMessagesIcon(),
3918
+ icon: 'ph:chats-duotone',
3919
3919
  badge: this.state.unreadCount,
3920
3920
  },
3921
3921
  ];
3922
3922
 
3923
3923
  if (this.state.enableHelp) {
3924
- tabs.push({ id: 'help', label: 'Help', icon: this._getHelpIcon() });
3924
+ tabs.push({ id: 'help', label: 'Help', icon: 'ph:books-duotone' });
3925
3925
  }
3926
3926
 
3927
3927
  if (this.state.enableChangelog) {
3928
3928
  tabs.push({
3929
3929
  id: 'changelog',
3930
- label: 'Changelog',
3931
- icon: this._getChangelogIcon(),
3930
+ label: 'Updates',
3931
+ icon: 'ph:megaphone-duotone',
3932
3932
  });
3933
3933
  }
3934
3934
 
@@ -3946,12 +3946,14 @@
3946
3946
  : '';
3947
3947
 
3948
3948
  return `
3949
- <button class="messenger-nav-tab ${isActive ? 'active' : ''}" data-tab="${tab.id}">
3950
- <span class="messenger-nav-icon">${tab.icon}</span>
3951
- <span class="messenger-nav-label">${tab.label}</span>
3952
- ${badgeHtml}
3953
- </button>
3954
- `;
3949
+ <button class="messenger-nav-tab ${isActive ? 'active' : ''}" data-tab="${tab.id}">
3950
+ <span class="messenger-nav-icon">
3951
+ <iconify-icon icon="${tab.icon}" width="22" height="22"></iconify-icon>
3952
+ </span>
3953
+ <span class="messenger-nav-label">${tab.label}</span>
3954
+ ${badgeHtml}
3955
+ </button>
3956
+ `;
3955
3957
  })
3956
3958
  .join('');
3957
3959
 
@@ -4004,31 +4006,6 @@
4004
4006
  });
4005
4007
  }
4006
4008
 
4007
- _getHomeIcon() {
4008
- return `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256">
4009
- <path d="M40,216H216V120a8,8,0,0,0-2.34-5.66l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,40,120Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
4010
- </svg>`;
4011
- }
4012
-
4013
- _getMessagesIcon() {
4014
- return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><path d="M71.58,144,32,176V48a8,8,0,0,1,8-8H168a8,8,0,0,1,8,8v88a8,8,0,0,1-8,8Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M80,144v40a8,8,0,0,0,8,8h96.42L224,224V96a8,8,0,0,0-8-8H176" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>`;
4015
- }
4016
-
4017
- _getHelpIcon() {
4018
- return `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256">
4019
- <circle cx="128" cy="128" r="96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
4020
- <circle cx="128" cy="180" r="12"/>
4021
- <path d="M128,144v-8a28,28,0,1,0-28-28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
4022
- </svg>`;
4023
- }
4024
-
4025
- _getChangelogIcon() {
4026
- return `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256">
4027
- <path d="M160,80V200.67a8,8,0,0,0,3.56,6.65l11,7.33a8,8,0,0,0,12.2-4.72L200,160" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
4028
- <path d="M40,200a8,8,0,0,0,13.15,6.12C105.55,162.16,160,160,160,160h40a40,40,0,0,0,0-80H160S105.55,77.84,53.15,33.89A8,8,0,0,0,40,40Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
4029
- </svg>`;
4030
- }
4031
-
4032
4009
  destroy() {
4033
4010
  if (this._unsubscribe) {
4034
4011
  this._unsubscribe();
@@ -4152,6 +4129,9 @@
4152
4129
  this.options = options;
4153
4130
  this.element = null;
4154
4131
  this._unsubscribe = null;
4132
+
4133
+ // Configurable header colour — defaults to Product7 blue
4134
+ this._headerBg = `linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%)`;
4155
4135
  }
4156
4136
 
4157
4137
  render() {
@@ -4172,7 +4152,14 @@
4172
4152
  _updateContent() {
4173
4153
  this.element.innerHTML = `
4174
4154
  <div class="messenger-changelog-header">
4175
- <h2>Latest Updates</h2>
4155
+ <div class="messenger-changelog-header-top">
4156
+ <h2>Latest Updates</h2>
4157
+ <button class="sdk-close-btn messenger-changelog-close-btn" aria-label="Close">
4158
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 256 256">
4159
+ <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
4160
+ </svg>
4161
+ </button>
4162
+ </div>
4176
4163
  </div>
4177
4164
 
4178
4165
  <div class="messenger-changelog-body">
@@ -4206,8 +4193,8 @@
4206
4193
  const tagsHtml =
4207
4194
  item.tags && item.tags.length > 0
4208
4195
  ? `<div class="messenger-changelog-tags">
4209
- ${item.tags.map((tag) => `<span class="sdk-badge sdk-badge-primary messenger-changelog-tag">${tag}</span>`).join('')}
4210
- </div>`
4196
+ ${item.tags.map((tag) => `<span class="sdk-badge sdk-badge-primary messenger-changelog-tag">${tag}</span>`).join('')}
4197
+ </div>`
4211
4198
  : '';
4212
4199
 
4213
4200
  const dateStr = this._formatDate(item.publishedAt || item.date);
@@ -4235,36 +4222,11 @@
4235
4222
  `;
4236
4223
  }
4237
4224
 
4238
- _renderTeamAvatars() {
4239
- const avatars = this.state.teamAvatars;
4240
- if (!avatars || avatars.length === 0) {
4241
- return `
4242
- <div class="messenger-avatar-stack messenger-avatar-stack-tiny">
4243
- <div class="sdk-avatar sdk-avatar-sm">S</div>
4244
- </div>
4245
- `;
4246
- }
4247
-
4248
- const avatarItems = avatars
4249
- .slice(0, 2)
4250
- .map((avatar) => {
4251
- if (typeof avatar === 'string' && avatar.startsWith('http')) {
4252
- return `<div class="sdk-avatar sdk-avatar-sm"><img src="${avatar}" alt="Team member" /></div>`;
4253
- }
4254
- return `<div class="sdk-avatar sdk-avatar-sm">${avatar.charAt(0).toUpperCase()}</div>`;
4255
- })
4256
- .join('');
4257
-
4258
- return `<div class="messenger-avatar-stack messenger-avatar-stack-tiny">${avatarItems}</div>`;
4259
- }
4260
-
4261
4225
  _renderEmptyState() {
4262
4226
  return `
4263
4227
  <div class="messenger-empty-state">
4264
4228
  <div class="messenger-empty-state-icon">
4265
- <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="currentColor" viewBox="0 0 256 256">
4266
- <path d="M228.54,86.66l-26.46,23.07A40,40,0,0,0,168,72.13L120.89,46.5a40,40,0,0,0-75.44-4l-22-19.2a8,8,0,0,0-10.5,12L35.44,54.77a40,40,0,0,0,50,61.07l47.1,25.64a40,40,0,0,0,75.41,4.07l26.46-23.07a8,8,0,0,0-10.5-12ZM56,96A24,24,0,1,1,77.25,82.75,24,24,0,0,1,56,96Zm144,64a24,24,0,1,1,24-24A24,24,0,0,1,200,160Z"></path>
4267
- </svg>
4229
+ <iconify-icon icon="ph:megaphone-duotone" width="48" height="48"></iconify-icon>
4268
4230
  </div>
4269
4231
  <h3>No changelog yet</h3>
4270
4232
  <p>Check back later for updates</p>
@@ -4289,6 +4251,12 @@
4289
4251
  }
4290
4252
 
4291
4253
  _attachEvents() {
4254
+ this.element
4255
+ .querySelector('.messenger-changelog-close-btn')
4256
+ .addEventListener('click', () => {
4257
+ this.state.setOpen(false);
4258
+ });
4259
+
4292
4260
  this._attachChangelogEvents();
4293
4261
  }
4294
4262
 
@@ -4301,7 +4269,7 @@
4301
4269
  const changelogItem = this.state.changelogItems.find(
4302
4270
  (n) => n.id === changelogId
4303
4271
  );
4304
- if (changelogItem && changelogItem.url) {
4272
+ if (changelogItem?.url) {
4305
4273
  window.open(changelogItem.url, '_blank');
4306
4274
  } else if (this.options.onChangelogClick) {
4307
4275
  this.options.onChangelogClick(changelogItem);
@@ -5184,20 +5152,24 @@
5184
5152
  <div class="messenger-help-header">
5185
5153
  <div class="messenger-help-header-top">
5186
5154
  <h2>Help</h2>
5187
- <button class="sdk-close-btn" aria-label="Close">
5155
+ <button class="sdk-close-btn messenger-help-close-btn" aria-label="Close">
5188
5156
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 256 256">
5189
5157
  <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
5190
5158
  </svg>
5191
5159
  </button>
5192
5160
  </div>
5193
- <input
5194
- type="text"
5195
- class="messenger-help-search-input"
5196
- placeholder="Search for help..."
5197
- value="${searchQuery}"
5198
- />
5161
+ <div class="messenger-help-search-wrap">
5162
+ <span class="messenger-help-search-icon">
5163
+ <iconify-icon icon="ph:magnifying-glass-duotone" width="16" height="16"></iconify-icon>
5164
+ </span>
5165
+ <input
5166
+ type="text"
5167
+ class="messenger-help-search-input"
5168
+ placeholder="Search for help..."
5169
+ value="${searchQuery}"
5170
+ />
5171
+ </div>
5199
5172
  </div>
5200
-
5201
5173
  <div class="messenger-help-body">
5202
5174
  <div class="messenger-help-collections"></div>
5203
5175
  </div>
@@ -5208,13 +5180,11 @@
5208
5180
  }
5209
5181
 
5210
5182
  _updateCollectionsList() {
5211
- const collectionsContainer = this.element.querySelector(
5212
- '.messenger-help-collections'
5213
- );
5183
+ const container = this.element.querySelector('.messenger-help-collections');
5214
5184
  const collections = this.state.helpArticles || [];
5215
5185
  const searchQuery = (this.state.helpSearchQuery || '').toLowerCase();
5216
5186
 
5217
- const filteredCollections = searchQuery
5187
+ const filtered = searchQuery
5218
5188
  ? collections.filter(
5219
5189
  (c) =>
5220
5190
  c.title.toLowerCase().includes(searchQuery) ||
@@ -5222,51 +5192,104 @@
5222
5192
  )
5223
5193
  : collections;
5224
5194
 
5225
- const headerEl = this.element.querySelector(
5226
- '.messenger-help-collections-header'
5227
- );
5228
- if (headerEl) {
5229
- headerEl.textContent = `${filteredCollections.length} collections`;
5195
+ if (filtered.length === 0) {
5196
+ container.innerHTML = this._renderEmptyState();
5197
+ return;
5230
5198
  }
5231
5199
 
5232
- if (filteredCollections.length === 0) {
5233
- collectionsContainer.innerHTML = this._renderEmptyState();
5234
- return;
5200
+ container.innerHTML = filtered.map((c) => this._renderCollectionItem(c)).join('');
5201
+ this._attachCollectionEvents();
5202
+ }
5203
+
5204
+ _avatarColors = [
5205
+ { bg: '#EF4444', text: '#FFFFFF' },
5206
+ { bg: '#F97316', text: '#FFFFFF' },
5207
+ { bg: '#F59E0B', text: '#FFFFFF' },
5208
+ { bg: '#10B981', text: '#FFFFFF' },
5209
+ { bg: '#06B6D4', text: '#FFFFFF' },
5210
+ { bg: '#3B82F6', text: '#FFFFFF' },
5211
+ { bg: '#8B5CF6', text: '#FFFFFF' },
5212
+ { bg: '#EC4899', text: '#FFFFFF' },
5213
+ ];
5214
+
5215
+ _getAvatarColor(id) {
5216
+ const hash = id.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);
5217
+ return this._avatarColors[hash % this._avatarColors.length];
5218
+ }
5219
+
5220
+ _getInitials(name) {
5221
+ if (!name) return 'A';
5222
+ return name.split(' ').map((n) => n[0]).join('').toUpperCase().slice(0, 2);
5223
+ }
5224
+
5225
+ _renderAuthorAvatar(collection) {
5226
+ if (collection.author?.picture) {
5227
+ return `<img
5228
+ src="${collection.author.picture}"
5229
+ alt="${collection.author.name || ''}"
5230
+ class="messenger-help-collection-avatar"
5231
+ title="${collection.author.name || ''}"
5232
+ />`;
5235
5233
  }
5236
5234
 
5237
- collectionsContainer.innerHTML = filteredCollections
5238
- .map((collection) => this._renderCollectionItem(collection))
5239
- .join('');
5235
+ const { bg, text } = this._getAvatarColor(collection.id);
5236
+ const initials = collection.author?.name ? this._getInitials(collection.author.name) : 'A';
5240
5237
 
5241
- this._attachCollectionEvents();
5238
+ return `<span
5239
+ class="messenger-help-collection-avatar messenger-help-collection-avatar--initials"
5240
+ style="background-color: ${bg}; color: ${text};"
5241
+ title="${collection.author?.name || 'Author'}"
5242
+ >${initials}</span>`;
5243
+ }
5244
+
5245
+ _resolveCollectionIcon(icon) {
5246
+ if (!icon) return this._defaultCollectionIcon();
5247
+
5248
+ if (icon.trimStart().startsWith('<')) {
5249
+ return `<span class="messenger-help-collection-icon">${icon}</span>`;
5250
+ }
5251
+
5252
+ if (icon.startsWith('ph:')) {
5253
+ return `<span class="messenger-help-collection-icon">
5254
+ <iconify-icon icon="${icon}" width="18" height="18"></iconify-icon>
5255
+ </span>`;
5256
+ }
5257
+
5258
+ return this._defaultCollectionIcon();
5259
+ }
5260
+
5261
+ _defaultCollectionIcon() {
5262
+ return `<span class="messenger-help-collection-icon">
5263
+ <iconify-icon icon="ph:book-open-duotone" width="18" height="18"></iconify-icon>
5264
+ </span>`;
5242
5265
  }
5243
5266
 
5244
5267
  _renderCollectionItem(collection) {
5245
5268
  const articleCount = collection.articleCount || 0;
5269
+
5246
5270
  return `
5247
5271
  <div class="messenger-help-collection" data-collection-id="${collection.id}">
5272
+ ${this._resolveCollectionIcon(collection.icon)}
5248
5273
  <div class="messenger-help-collection-content">
5249
- <h3 class="messenger-help-collection-title">${collection.title}</h3>
5250
- <p class="messenger-help-collection-desc">${collection.description || ''}</p>
5251
- <span class="messenger-help-collection-count">${articleCount} articles</span>
5274
+ <div class="messenger-help-collection-title">${collection.title}</div>
5275
+ ${collection.description ? `<p class="messenger-help-collection-desc">${collection.description}</p>` : ''}
5276
+ <div class="messenger-help-collection-meta">
5277
+ ${this._renderAuthorAvatar(collection)}
5278
+ <span class="messenger-help-collection-count">
5279
+ ${articleCount} ${articleCount === 1 ? 'article' : 'articles'}
5280
+ </span>
5281
+ </div>
5252
5282
  </div>
5253
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="#000000" viewBox="0 0 256 256" class="messenger-help-collection-arrow">
5254
- <path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"></path>
5255
- </svg>
5256
5283
  </div>
5257
5284
  `;
5258
5285
  }
5259
5286
 
5260
5287
  _renderEmptyState() {
5261
- const isSearching = this.state.helpSearchQuery;
5262
-
5263
- if (isSearching) {
5288
+ if (this.state.helpSearchQuery) {
5264
5289
  return `
5265
5290
  <div class="messenger-empty-state">
5266
5291
  <div class="messenger-empty-state-icon">
5267
- <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="currentColor" viewBox="0 0 256 256">
5268
- <path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"></path>
5269
- </svg>
5292
+ <iconify-icon icon="ph:magnifying-glass-duotone" width="48" height="48"></iconify-icon>
5270
5293
  </div>
5271
5294
  <h3>No results found</h3>
5272
5295
  <p>Try a different search term</p>
@@ -5277,9 +5300,7 @@
5277
5300
  return `
5278
5301
  <div class="messenger-empty-state">
5279
5302
  <div class="messenger-empty-state-icon">
5280
- <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="currentColor" viewBox="0 0 256 256">
5281
- <path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"></path>
5282
- </svg>
5303
+ <iconify-icon icon="ph:books-duotone" width="48" height="48"></iconify-icon>
5283
5304
  </div>
5284
5305
  <h3>Help collections</h3>
5285
5306
  <p>No collections available yet</p>
@@ -5288,15 +5309,11 @@
5288
5309
  }
5289
5310
 
5290
5311
  _attachEvents() {
5291
- this.element
5292
- .querySelector('.sdk-close-btn')
5293
- .addEventListener('click', () => {
5294
- this.state.setOpen(false);
5295
- });
5312
+ this.element.querySelector('.messenger-help-close-btn').addEventListener('click', () => {
5313
+ this.state.setOpen(false);
5314
+ });
5296
5315
 
5297
- const searchInput = this.element.querySelector(
5298
- '.messenger-help-search-input'
5299
- );
5316
+ const searchInput = this.element.querySelector('.messenger-help-search-input');
5300
5317
  let searchTimeout;
5301
5318
  searchInput.addEventListener('input', (e) => {
5302
5319
  clearTimeout(searchTimeout);
@@ -5309,30 +5326,23 @@
5309
5326
  }
5310
5327
 
5311
5328
  _attachCollectionEvents() {
5312
- this.element
5313
- .querySelectorAll('.messenger-help-collection')
5314
- .forEach((item) => {
5315
- item.addEventListener('click', () => {
5316
- const collectionId = item.dataset.collectionId;
5317
- const collection = this.state.helpArticles.find(
5318
- (c) => c.id === collectionId
5319
- );
5320
- if (collection && collection.url) {
5321
- window.open(collection.url, '_blank');
5322
- } else if (this.options.onArticleClick) {
5323
- this.options.onArticleClick(collection);
5324
- }
5325
- });
5329
+ this.element.querySelectorAll('.messenger-help-collection').forEach((item) => {
5330
+ item.addEventListener('click', () => {
5331
+ const collection = this.state.helpArticles.find(
5332
+ (c) => c.id === item.dataset.collectionId
5333
+ );
5334
+ if (collection?.url) {
5335
+ window.open(collection.url, '_blank');
5336
+ } else if (this.options.onArticleClick) {
5337
+ this.options.onArticleClick(collection);
5338
+ }
5326
5339
  });
5340
+ });
5327
5341
  }
5328
5342
 
5329
5343
  destroy() {
5330
- if (this._unsubscribe) {
5331
- this._unsubscribe();
5332
- }
5333
- if (this.element && this.element.parentNode) {
5334
- this.element.parentNode.removeChild(this.element);
5335
- }
5344
+ if (this._unsubscribe) this._unsubscribe();
5345
+ if (this.element?.parentNode) this.element.parentNode.removeChild(this.element);
5336
5346
  }
5337
5347
  }
5338
5348
 
@@ -6430,11 +6440,17 @@
6430
6440
  ''
6431
6441
  );
6432
6442
 
6433
- return collections.map((collection) => ({
6443
+ const sorted = [...collections].sort(
6444
+ (a, b) => (a.order ?? 0) - (b.order ?? 0)
6445
+ );
6446
+
6447
+ return sorted.map((collection) => ({
6434
6448
  id: collection.id,
6435
6449
  title: collection.title,
6436
6450
  description: collection.description || '',
6437
6451
  articleCount: collection.article_count || 0,
6452
+ icon: collection.icon || null,
6453
+ author: collection.author || null,
6438
6454
  url:
6439
6455
  collection.url_slug && helpBase
6440
6456
  ? `${helpBase}/collections/${collection.url_slug}`
@@ -6877,11 +6893,13 @@
6877
6893
  }
6878
6894
 
6879
6895
  const npsScale = this._getNPSScale();
6880
- const npsCompactClass =
6881
- npsScale.values.length > 7 ? ' feedback-survey-rating-scale-compact' : '';
6882
- const npsContainerClass = `feedback-survey-rating-scale${npsCompactClass}`;
6883
- const npsButtonClass =
6884
- 'feedback-survey-nps-btn feedback-survey-rating-scale-btn';
6896
+ const npsUsesSegmentedScale = npsScale.values.length <= 7;
6897
+ const npsContainerClass = npsUsesSegmentedScale
6898
+ ? 'feedback-survey-ces feedback-survey-rating-scale'
6899
+ : 'feedback-survey-nps';
6900
+ const npsButtonClass = npsUsesSegmentedScale
6901
+ ? 'feedback-survey-nps-btn feedback-survey-ces-btn feedback-survey-rating-scale-btn'
6902
+ : 'feedback-survey-nps-btn';
6885
6903
  const npsLowLabel =
6886
6904
  this.surveyOptions.lowLabel ||
6887
6905
  (npsScale.start === 0 ? 'Not likely' : 'Strongly Disagree');
@@ -7141,11 +7159,13 @@
7141
7159
  { length: npsScale },
7142
7160
  (_, index) => start + index
7143
7161
  );
7144
- const compactClass =
7145
- values.length > 7 ? ' feedback-survey-rating-scale-compact' : '';
7146
- const containerClass = `feedback-survey-rating-scale${compactClass}`;
7147
- const buttonClass =
7148
- 'feedback-survey-page-rating-btn feedback-survey-nps-btn feedback-survey-rating-scale-btn';
7162
+ const usesSegmentedScale = values.length <= 7;
7163
+ const containerClass = usesSegmentedScale
7164
+ ? 'feedback-survey-ces feedback-survey-rating-scale'
7165
+ : 'feedback-survey-nps';
7166
+ const buttonClass = usesSegmentedScale
7167
+ ? 'feedback-survey-page-rating-btn feedback-survey-nps-btn feedback-survey-ces-btn feedback-survey-rating-scale-btn'
7168
+ : 'feedback-survey-page-rating-btn feedback-survey-nps-btn';
7149
7169
  return `
7150
7170
  <div class="${containerClass}" data-page-id="${pageId}">
7151
7171
  ${values
@@ -11026,7 +11046,6 @@
11026
11046
  `;
11027
11047
 
11028
11048
  const messengerViewsStyles = `
11029
-
11030
11049
  /* ========================================
11031
11050
  HOME VIEW
11032
11051
  ======================================== */
@@ -11480,9 +11499,36 @@
11480
11499
  display: flex;
11481
11500
  flex-direction: column;
11482
11501
  gap: var(--spacing-3);
11483
- padding: var(--spacing-4) var(--spacing-5) var(--spacing-5);
11502
+ padding: var(--spacing-3) var(--spacing-5) var(--spacing-4);
11484
11503
  border-bottom: 1px solid var(--color-border);
11485
- background: var(--color-white);
11504
+ flex-shrink: 0;
11505
+ background: linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%);
11506
+ position: relative;
11507
+ overflow: hidden;
11508
+ }
11509
+
11510
+ .messenger-help-header::before {
11511
+ content: '';
11512
+ position: absolute;
11513
+ top: -20px;
11514
+ left: -20px;
11515
+ width: 200px;
11516
+ height: 200px;
11517
+ background: radial-gradient(circle, rgba(21, 94, 239, 0.12) 0%, transparent 70%);
11518
+ filter: blur(30px);
11519
+ pointer-events: none;
11520
+ }
11521
+
11522
+ .messenger-help-header::after {
11523
+ content: '';
11524
+ position: absolute;
11525
+ top: -10px;
11526
+ right: -20px;
11527
+ width: 150px;
11528
+ height: 150px;
11529
+ background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
11530
+ filter: blur(25px);
11531
+ pointer-events: none;
11486
11532
  }
11487
11533
 
11488
11534
  .messenger-help-header-top {
@@ -11494,30 +11540,47 @@
11494
11540
 
11495
11541
  .messenger-help-header-top h2 {
11496
11542
  margin: 0;
11497
- font-size: var(--font-size-xl);
11543
+ font-size: var(--font-size-md);
11498
11544
  font-weight: var(--font-weight-semibold);
11499
11545
  color: var(--color-text-primary);
11500
11546
  }
11501
11547
 
11502
- .messenger-help-header-top .sdk-close-btn {
11548
+ .messenger-help-close-btn {
11503
11549
  position: absolute;
11504
11550
  right: 0;
11505
11551
  top: 50%;
11506
11552
  transform: translateY(-50%);
11507
11553
  }
11508
11554
 
11555
+ .messenger-help-search-wrap {
11556
+ position: relative;
11557
+ width: 100%;
11558
+ }
11559
+
11560
+ .messenger-help-search-icon {
11561
+ position: absolute;
11562
+ left: var(--spacing-3);
11563
+ top: 50%;
11564
+ transform: translateY(-50%);
11565
+ color: var(--color-text-tertiary);
11566
+ display: flex;
11567
+ align-items: center;
11568
+ pointer-events: none;
11569
+ }
11570
+
11509
11571
  .messenger-help-search-input {
11510
11572
  width: 100%;
11511
- background: var(--color-neutral-50);
11573
+ background: rgba(255, 255, 255, 0.7);
11512
11574
  border: 1px solid var(--color-border);
11513
11575
  border-radius: var(--radius-md);
11514
- padding: var(--spacing-2) var(--spacing-3);
11576
+ padding: var(--spacing-2) var(--spacing-3) var(--spacing-2) calc(var(--spacing-3) + 16px + var(--spacing-2));
11515
11577
  font-size: var(--font-size-base);
11516
11578
  font-weight: var(--font-weight-normal);
11517
11579
  color: var(--color-text-primary);
11518
11580
  font-family: inherit;
11519
11581
  outline: none;
11520
- transition: border-color var(--transition-base);
11582
+ transition: border-color var(--transition-base), background var(--transition-base);
11583
+ box-sizing: border-box;
11521
11584
  }
11522
11585
 
11523
11586
  .messenger-help-search-input:focus {
@@ -11546,7 +11609,8 @@
11546
11609
  .messenger-help-collection {
11547
11610
  display: flex;
11548
11611
  align-items: center;
11549
- padding: var(--spacing-4) var(--spacing-5);
11612
+ gap: var(--spacing-3);
11613
+ padding: var(--spacing-3) var(--spacing-5);
11550
11614
  cursor: pointer;
11551
11615
  transition: background var(--transition-base);
11552
11616
  border-bottom: 1px solid var(--color-border);
@@ -11556,35 +11620,75 @@
11556
11620
  background: var(--color-neutral-50);
11557
11621
  }
11558
11622
 
11623
+ .messenger-help-collection-icon {
11624
+ flex-shrink: 0;
11625
+ width: 28px;
11626
+ height: 28px;
11627
+ display: flex;
11628
+ align-items: center;
11629
+ justify-content: center;
11630
+ color: var(--color-text-secondary);
11631
+ }
11632
+
11633
+ .messenger-help-collection-icon svg,
11634
+ .messenger-help-collection-icon iconify-icon {
11635
+ width: 18px;
11636
+ height: 18px;
11637
+ display: block;
11638
+ }
11639
+
11559
11640
  .messenger-help-collection-content {
11560
11641
  flex: 1;
11561
11642
  min-width: 0;
11562
11643
  }
11563
11644
 
11564
11645
  .messenger-help-collection-title {
11565
- margin: 0 0 var(--spacing-1);
11566
- font-size: var(--font-size-md);
11567
- font-weight: var(--font-weight-bold);
11646
+ font-size: var(--font-size-sm);
11647
+ font-weight: var(--font-weight-medium);
11568
11648
  color: var(--color-text-primary);
11569
11649
  line-height: var(--line-height-snug);
11650
+ white-space: nowrap;
11651
+ overflow: hidden;
11652
+ text-overflow: ellipsis;
11570
11653
  }
11571
11654
 
11572
11655
  .messenger-help-collection-desc {
11573
- margin: 0 0 var(--spacing-1);
11574
- font-size: var(--font-size-base);
11656
+ margin: 2px 0 var(--spacing-1);
11657
+ font-size: var(--font-size-xs);
11575
11658
  color: var(--color-text-secondary);
11576
11659
  line-height: var(--line-height-normal);
11660
+ white-space: nowrap;
11661
+ overflow: hidden;
11662
+ text-overflow: ellipsis;
11577
11663
  }
11578
11664
 
11579
- .messenger-help-collection-count {
11580
- font-size: var(--font-size-sm);
11581
- color: var(--color-text-tertiary);
11665
+ .messenger-help-collection-meta {
11666
+ display: flex;
11667
+ align-items: center;
11668
+ gap: var(--spacing-2);
11669
+ margin-top: 2px;
11582
11670
  }
11583
11671
 
11584
- .messenger-help-collection-arrow {
11585
- color: var(--color-text-tertiary);
11672
+ .messenger-help-collection-avatar {
11673
+ width: 16px;
11674
+ height: 16px;
11675
+ border-radius: var(--radius-full);
11586
11676
  flex-shrink: 0;
11587
- margin-left: var(--spacing-3);
11677
+ object-fit: cover;
11678
+ }
11679
+
11680
+ .messenger-help-collection-avatar--initials {
11681
+ display: inline-flex;
11682
+ align-items: center;
11683
+ justify-content: center;
11684
+ font-size: 9px;
11685
+ font-weight: 600;
11686
+ line-height: 1;
11687
+ }
11688
+
11689
+ .messenger-help-collection-count {
11690
+ font-size: var(--font-size-xs);
11691
+ color: var(--color-text-tertiary);
11588
11692
  }
11589
11693
 
11590
11694
  .messenger-help-footer {
@@ -11614,19 +11718,59 @@
11614
11718
  ======================================== */
11615
11719
 
11616
11720
  .messenger-changelog-header {
11721
+ padding: var(--spacing-3) var(--spacing-5);
11722
+ border-bottom: 1px solid var(--color-border);
11723
+ flex-shrink: 0;
11724
+ background: linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%);
11725
+ position: relative;
11726
+ overflow: hidden;
11727
+ }
11728
+
11729
+ .messenger-changelog-header::before {
11730
+ content: '';
11731
+ position: absolute;
11732
+ top: -20px;
11733
+ left: -20px;
11734
+ width: 200px;
11735
+ height: 200px;
11736
+ background: radial-gradient(circle, rgba(21, 94, 239, 0.12) 0%, transparent 70%);
11737
+ filter: blur(30px);
11738
+ pointer-events: none;
11739
+ }
11740
+
11741
+ .messenger-changelog-header::after {
11742
+ content: '';
11743
+ position: absolute;
11744
+ top: -10px;
11745
+ right: -20px;
11746
+ width: 150px;
11747
+ height: 150px;
11748
+ background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
11749
+ filter: blur(25px);
11750
+ pointer-events: none;
11751
+ }
11752
+
11753
+ .messenger-changelog-header-top {
11617
11754
  display: flex;
11618
11755
  align-items: center;
11619
11756
  justify-content: center;
11620
- padding: var(--spacing-3) var(--spacing-5);
11757
+ position: relative;
11621
11758
  }
11622
11759
 
11623
- .messenger-changelog-header h2 {
11760
+ .messenger-changelog-header-top h2 {
11624
11761
  margin: 0;
11625
- font-size: var(--font-size-lg);
11762
+ font-size: var(--font-size-md);
11626
11763
  font-weight: var(--font-weight-semibold);
11627
11764
  color: var(--color-text-primary);
11628
11765
  }
11629
11766
 
11767
+ .messenger-changelog-close-btn {
11768
+ position: absolute;
11769
+ right: 0;
11770
+ top: 50%;
11771
+ transform: translateY(-50%);
11772
+ }
11773
+
11630
11774
  .messenger-changelog-body {
11631
11775
  flex: 1;
11632
11776
  overflow-y: auto;
@@ -11984,11 +12128,6 @@
11984
12128
  box-shadow: inset 0 0 0 2px var(--color-primary);
11985
12129
  }
11986
12130
 
11987
- .feedback-survey-rating-scale-compact .feedback-survey-rating-scale-btn {
11988
- min-height: 50px;
11989
- font-size: clamp(12px, 2vw, 16px);
11990
- }
11991
-
11992
12131
  .feedback-survey-labels {
11993
12132
  display: flex;
11994
12133
  justify-content: space-between;
@@ -12263,11 +12402,6 @@
12263
12402
  font-size: clamp(14px, 6vw, 18px);
12264
12403
  }
12265
12404
 
12266
- .feedback-survey-rating-scale-compact .feedback-survey-rating-scale-btn {
12267
- min-height: 44px;
12268
- font-size: clamp(11px, 3.7vw, 14px);
12269
- }
12270
-
12271
12405
  .feedback-survey-rating-scale + .feedback-survey-labels {
12272
12406
  font-size: var(--font-size-xs);
12273
12407
  }
@@ -12284,15 +12418,23 @@
12284
12418
  messengerStyles;
12285
12419
 
12286
12420
  function injectStyles() {
12287
- if (
12288
- typeof document !== 'undefined' &&
12289
- !document.querySelector('#feedback-sdk-styles')
12290
- ) {
12421
+ if (typeof document === 'undefined') return;
12422
+
12423
+ if (!document.querySelector('#feedback-sdk-styles')) {
12291
12424
  const style = document.createElement('style');
12292
12425
  style.id = 'feedback-sdk-styles';
12293
12426
  style.textContent = CSS_STYLES;
12294
12427
  document.head.appendChild(style);
12295
12428
  }
12429
+
12430
+ if (!document.querySelector('#feedback-sdk-iconify')) {
12431
+ const script = document.createElement('script');
12432
+ script.id = 'feedback-sdk-iconify';
12433
+ script.src =
12434
+ 'https://cdn.jsdelivr.net/npm/iconify-icon@2/dist/iconify-icon.min.js';
12435
+ script.async = true;
12436
+ document.head.appendChild(script);
12437
+ }
12296
12438
  }
12297
12439
 
12298
12440
  function autoInit() {