@product7/feedback-sdk 1.6.0 → 1.6.1
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/README.md +5 -5
- package/dist/README.md +5 -5
- package/dist/feedback-sdk.js +347 -134
- package/dist/feedback-sdk.js.map +1 -1
- package/dist/feedback-sdk.min.js +1 -1
- package/dist/feedback-sdk.min.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +12 -4
- package/src/styles/messenger-views.js +156 -15
- package/src/styles/survey.js +0 -10
- package/src/widgets/MessengerWidget.js +7 -1
- package/src/widgets/SurveyWidget.js +14 -10
- package/src/widgets/messenger/components/NavigationTabs.js +13 -36
- package/src/widgets/messenger/views/ChangelogView.js +21 -30
- package/src/widgets/messenger/views/HelpView.js +124 -28
package/dist/feedback-sdk.js
CHANGED
|
@@ -3911,24 +3911,24 @@
|
|
|
3911
3911
|
|
|
3912
3912
|
_getTabs() {
|
|
3913
3913
|
const tabs = [
|
|
3914
|
-
{ id: 'home', label: 'Home', icon:
|
|
3914
|
+
{ id: 'home', label: 'Home', icon: 'ph:house-simple-duotone' },
|
|
3915
3915
|
{
|
|
3916
3916
|
id: 'messages',
|
|
3917
3917
|
label: 'Messages',
|
|
3918
|
-
icon:
|
|
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:
|
|
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: '
|
|
3931
|
-
icon:
|
|
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
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
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
|
-
<
|
|
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
|
-
|
|
4210
|
-
|
|
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
|
-
<
|
|
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
|
|
4272
|
+
if (changelogItem?.url) {
|
|
4305
4273
|
window.open(changelogItem.url, '_blank');
|
|
4306
4274
|
} else if (this.options.onChangelogClick) {
|
|
4307
4275
|
this.options.onChangelogClick(changelogItem);
|
|
@@ -5160,6 +5128,9 @@
|
|
|
5160
5128
|
this.options = options;
|
|
5161
5129
|
this.element = null;
|
|
5162
5130
|
this._unsubscribe = null;
|
|
5131
|
+
|
|
5132
|
+
// Configurable header colour — defaults to Product7 blue
|
|
5133
|
+
this._headerBg = `linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%)`;
|
|
5163
5134
|
}
|
|
5164
5135
|
|
|
5165
5136
|
render() {
|
|
@@ -5184,18 +5155,23 @@
|
|
|
5184
5155
|
<div class="messenger-help-header">
|
|
5185
5156
|
<div class="messenger-help-header-top">
|
|
5186
5157
|
<h2>Help</h2>
|
|
5187
|
-
<button class="sdk-close-btn" aria-label="Close">
|
|
5158
|
+
<button class="sdk-close-btn messenger-help-close-btn" aria-label="Close">
|
|
5188
5159
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 256 256">
|
|
5189
5160
|
<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
5161
|
</svg>
|
|
5191
5162
|
</button>
|
|
5192
5163
|
</div>
|
|
5193
|
-
<
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5164
|
+
<div class="messenger-help-search-wrap">
|
|
5165
|
+
<span class="messenger-help-search-icon">
|
|
5166
|
+
<iconify-icon icon="ph:magnifying-glass-duotone" width="16" height="16"></iconify-icon>
|
|
5167
|
+
</span>
|
|
5168
|
+
<input
|
|
5169
|
+
type="text"
|
|
5170
|
+
class="messenger-help-search-input"
|
|
5171
|
+
placeholder="Search for help..."
|
|
5172
|
+
value="${searchQuery}"
|
|
5173
|
+
/>
|
|
5174
|
+
</div>
|
|
5199
5175
|
</div>
|
|
5200
5176
|
|
|
5201
5177
|
<div class="messenger-help-body">
|
|
@@ -5222,13 +5198,6 @@
|
|
|
5222
5198
|
)
|
|
5223
5199
|
: collections;
|
|
5224
5200
|
|
|
5225
|
-
const headerEl = this.element.querySelector(
|
|
5226
|
-
'.messenger-help-collections-header'
|
|
5227
|
-
);
|
|
5228
|
-
if (headerEl) {
|
|
5229
|
-
headerEl.textContent = `${filteredCollections.length} collections`;
|
|
5230
|
-
}
|
|
5231
|
-
|
|
5232
5201
|
if (filteredCollections.length === 0) {
|
|
5233
5202
|
collectionsContainer.innerHTML = this._renderEmptyState();
|
|
5234
5203
|
return;
|
|
@@ -5241,32 +5210,125 @@
|
|
|
5241
5210
|
this._attachCollectionEvents();
|
|
5242
5211
|
}
|
|
5243
5212
|
|
|
5213
|
+
// ─── Avatar helpers ──────────────────────────────────────────────────────────
|
|
5214
|
+
|
|
5215
|
+
_avatarColors = [
|
|
5216
|
+
{ bg: '#EF4444', text: '#FFFFFF' },
|
|
5217
|
+
{ bg: '#F97316', text: '#FFFFFF' },
|
|
5218
|
+
{ bg: '#F59E0B', text: '#FFFFFF' },
|
|
5219
|
+
{ bg: '#10B981', text: '#FFFFFF' },
|
|
5220
|
+
{ bg: '#06B6D4', text: '#FFFFFF' },
|
|
5221
|
+
{ bg: '#3B82F6', text: '#FFFFFF' },
|
|
5222
|
+
{ bg: '#8B5CF6', text: '#FFFFFF' },
|
|
5223
|
+
{ bg: '#EC4899', text: '#FFFFFF' },
|
|
5224
|
+
];
|
|
5225
|
+
|
|
5226
|
+
_getAvatarColor(id) {
|
|
5227
|
+
const hash = id
|
|
5228
|
+
.split('')
|
|
5229
|
+
.reduce((acc, char) => acc + char.charCodeAt(0), 0);
|
|
5230
|
+
return this._avatarColors[hash % this._avatarColors.length];
|
|
5231
|
+
}
|
|
5232
|
+
|
|
5233
|
+
_getInitials(name) {
|
|
5234
|
+
if (!name) return 'A';
|
|
5235
|
+
return name
|
|
5236
|
+
.split(' ')
|
|
5237
|
+
.map((n) => n[0])
|
|
5238
|
+
.join('')
|
|
5239
|
+
.toUpperCase()
|
|
5240
|
+
.slice(0, 2);
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5243
|
+
_renderAuthorAvatar(collection) {
|
|
5244
|
+
if (collection.author?.picture) {
|
|
5245
|
+
return `
|
|
5246
|
+
<img
|
|
5247
|
+
src="${collection.author.picture}"
|
|
5248
|
+
alt="${collection.author.name || ''}"
|
|
5249
|
+
class="messenger-help-collection-avatar"
|
|
5250
|
+
title="${collection.author.name || ''}"
|
|
5251
|
+
/>
|
|
5252
|
+
`;
|
|
5253
|
+
}
|
|
5254
|
+
|
|
5255
|
+
const { bg, text } = this._getAvatarColor(collection.id);
|
|
5256
|
+
const initials = collection.author?.name
|
|
5257
|
+
? this._getInitials(collection.author.name)
|
|
5258
|
+
: 'A';
|
|
5259
|
+
|
|
5260
|
+
return `
|
|
5261
|
+
<span
|
|
5262
|
+
class="messenger-help-collection-avatar messenger-help-collection-avatar--initials"
|
|
5263
|
+
style="background-color: ${bg}; color: ${text};"
|
|
5264
|
+
title="${collection.author?.name || 'Author'}"
|
|
5265
|
+
>${initials}</span>
|
|
5266
|
+
`;
|
|
5267
|
+
}
|
|
5268
|
+
|
|
5269
|
+
// ─── Icon resolution ─────────────────────────────────────────────────────────
|
|
5270
|
+
|
|
5271
|
+
_resolveCollectionIcon(icon) {
|
|
5272
|
+
if (!icon) return this._defaultCollectionIcon();
|
|
5273
|
+
|
|
5274
|
+
if (icon.trimStart().startsWith('<')) {
|
|
5275
|
+
return `<span class="messenger-help-collection-icon">${icon}</span>`;
|
|
5276
|
+
}
|
|
5277
|
+
|
|
5278
|
+
if (icon.startsWith('ph:')) {
|
|
5279
|
+
return `
|
|
5280
|
+
<span class="messenger-help-collection-icon">
|
|
5281
|
+
<iconify-icon icon="${icon}" width="20" height="20"></iconify-icon>
|
|
5282
|
+
</span>
|
|
5283
|
+
`;
|
|
5284
|
+
}
|
|
5285
|
+
|
|
5286
|
+
return this._defaultCollectionIcon();
|
|
5287
|
+
}
|
|
5288
|
+
|
|
5289
|
+
_defaultCollectionIcon() {
|
|
5290
|
+
return `
|
|
5291
|
+
<span class="messenger-help-collection-icon">
|
|
5292
|
+
<iconify-icon icon="ph:book-open-duotone" width="20" height="20"></iconify-icon>
|
|
5293
|
+
</span>
|
|
5294
|
+
`;
|
|
5295
|
+
}
|
|
5296
|
+
|
|
5297
|
+
// ─── Rendering ───────────────────────────────────────────────────────────────
|
|
5298
|
+
|
|
5244
5299
|
_renderCollectionItem(collection) {
|
|
5245
5300
|
const articleCount = collection.articleCount || 0;
|
|
5301
|
+
const iconHtml = this._resolveCollectionIcon(collection.icon);
|
|
5302
|
+
const avatarHtml = this._renderAuthorAvatar(collection);
|
|
5303
|
+
|
|
5246
5304
|
return `
|
|
5247
5305
|
<div class="messenger-help-collection" data-collection-id="${collection.id}">
|
|
5306
|
+
${iconHtml}
|
|
5248
5307
|
<div class="messenger-help-collection-content">
|
|
5249
5308
|
<h3 class="messenger-help-collection-title">${collection.title}</h3>
|
|
5250
|
-
|
|
5251
|
-
<
|
|
5309
|
+
${collection.description ? `<p class="messenger-help-collection-desc">${collection.description}</p>` : ''}
|
|
5310
|
+
<div class="messenger-help-collection-meta">
|
|
5311
|
+
${avatarHtml}
|
|
5312
|
+
<span class="messenger-help-collection-count">
|
|
5313
|
+
${articleCount} ${articleCount === 1 ? 'article' : 'articles'}
|
|
5314
|
+
</span>
|
|
5315
|
+
</div>
|
|
5252
5316
|
</div>
|
|
5253
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
5317
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 256 256" class="messenger-help-collection-arrow">
|
|
5254
5318
|
<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
5319
|
</svg>
|
|
5256
5320
|
</div>
|
|
5257
5321
|
`;
|
|
5258
5322
|
}
|
|
5259
5323
|
|
|
5260
|
-
|
|
5261
|
-
const isSearching = this.state.helpSearchQuery;
|
|
5324
|
+
// ─── Empty states ────────────────────────────────────────────────────────────
|
|
5262
5325
|
|
|
5263
|
-
|
|
5326
|
+
_renderEmptyState() {
|
|
5327
|
+
if (this.state.helpSearchQuery) {
|
|
5264
5328
|
return `
|
|
5265
5329
|
<div class="messenger-empty-state">
|
|
5266
5330
|
<div class="messenger-empty-state-icon">
|
|
5267
|
-
<
|
|
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>
|
|
5331
|
+
<iconify-icon icon="ph:magnifying-glass-duotone" width="48" height="48"></iconify-icon>
|
|
5270
5332
|
</div>
|
|
5271
5333
|
<h3>No results found</h3>
|
|
5272
5334
|
<p>Try a different search term</p>
|
|
@@ -5277,9 +5339,7 @@
|
|
|
5277
5339
|
return `
|
|
5278
5340
|
<div class="messenger-empty-state">
|
|
5279
5341
|
<div class="messenger-empty-state-icon">
|
|
5280
|
-
<
|
|
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>
|
|
5342
|
+
<iconify-icon icon="ph:books-duotone" width="48" height="48"></iconify-icon>
|
|
5283
5343
|
</div>
|
|
5284
5344
|
<h3>Help collections</h3>
|
|
5285
5345
|
<p>No collections available yet</p>
|
|
@@ -5287,9 +5347,11 @@
|
|
|
5287
5347
|
`;
|
|
5288
5348
|
}
|
|
5289
5349
|
|
|
5350
|
+
// ─── Events ──────────────────────────────────────────────────────────────────
|
|
5351
|
+
|
|
5290
5352
|
_attachEvents() {
|
|
5291
5353
|
this.element
|
|
5292
|
-
.querySelector('.
|
|
5354
|
+
.querySelector('.messenger-help-close-btn')
|
|
5293
5355
|
.addEventListener('click', () => {
|
|
5294
5356
|
this.state.setOpen(false);
|
|
5295
5357
|
});
|
|
@@ -5317,7 +5379,7 @@
|
|
|
5317
5379
|
const collection = this.state.helpArticles.find(
|
|
5318
5380
|
(c) => c.id === collectionId
|
|
5319
5381
|
);
|
|
5320
|
-
if (collection
|
|
5382
|
+
if (collection?.url) {
|
|
5321
5383
|
window.open(collection.url, '_blank');
|
|
5322
5384
|
} else if (this.options.onArticleClick) {
|
|
5323
5385
|
this.options.onArticleClick(collection);
|
|
@@ -5326,6 +5388,8 @@
|
|
|
5326
5388
|
});
|
|
5327
5389
|
}
|
|
5328
5390
|
|
|
5391
|
+
// ─── Lifecycle ───────────────────────────────────────────────────────────────
|
|
5392
|
+
|
|
5329
5393
|
destroy() {
|
|
5330
5394
|
if (this._unsubscribe) {
|
|
5331
5395
|
this._unsubscribe();
|
|
@@ -6430,11 +6494,17 @@
|
|
|
6430
6494
|
''
|
|
6431
6495
|
);
|
|
6432
6496
|
|
|
6433
|
-
|
|
6497
|
+
const sorted = [...collections].sort(
|
|
6498
|
+
(a, b) => (a.order ?? 0) - (b.order ?? 0)
|
|
6499
|
+
);
|
|
6500
|
+
|
|
6501
|
+
return sorted.map((collection) => ({
|
|
6434
6502
|
id: collection.id,
|
|
6435
6503
|
title: collection.title,
|
|
6436
6504
|
description: collection.description || '',
|
|
6437
6505
|
articleCount: collection.article_count || 0,
|
|
6506
|
+
icon: collection.icon || null,
|
|
6507
|
+
author: collection.author || null,
|
|
6438
6508
|
url:
|
|
6439
6509
|
collection.url_slug && helpBase
|
|
6440
6510
|
? `${helpBase}/collections/${collection.url_slug}`
|
|
@@ -6877,11 +6947,13 @@
|
|
|
6877
6947
|
}
|
|
6878
6948
|
|
|
6879
6949
|
const npsScale = this._getNPSScale();
|
|
6880
|
-
const
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6950
|
+
const npsUsesSegmentedScale = npsScale.values.length <= 7;
|
|
6951
|
+
const npsContainerClass = npsUsesSegmentedScale
|
|
6952
|
+
? 'feedback-survey-ces feedback-survey-rating-scale'
|
|
6953
|
+
: 'feedback-survey-nps';
|
|
6954
|
+
const npsButtonClass = npsUsesSegmentedScale
|
|
6955
|
+
? 'feedback-survey-nps-btn feedback-survey-ces-btn feedback-survey-rating-scale-btn'
|
|
6956
|
+
: 'feedback-survey-nps-btn';
|
|
6885
6957
|
const npsLowLabel =
|
|
6886
6958
|
this.surveyOptions.lowLabel ||
|
|
6887
6959
|
(npsScale.start === 0 ? 'Not likely' : 'Strongly Disagree');
|
|
@@ -7141,11 +7213,13 @@
|
|
|
7141
7213
|
{ length: npsScale },
|
|
7142
7214
|
(_, index) => start + index
|
|
7143
7215
|
);
|
|
7144
|
-
const
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
|
|
7148
|
-
|
|
7216
|
+
const usesSegmentedScale = values.length <= 7;
|
|
7217
|
+
const containerClass = usesSegmentedScale
|
|
7218
|
+
? 'feedback-survey-ces feedback-survey-rating-scale'
|
|
7219
|
+
: 'feedback-survey-nps';
|
|
7220
|
+
const buttonClass = usesSegmentedScale
|
|
7221
|
+
? 'feedback-survey-page-rating-btn feedback-survey-nps-btn feedback-survey-ces-btn feedback-survey-rating-scale-btn'
|
|
7222
|
+
: 'feedback-survey-page-rating-btn feedback-survey-nps-btn';
|
|
7149
7223
|
return `
|
|
7150
7224
|
<div class="${containerClass}" data-page-id="${pageId}">
|
|
7151
7225
|
${values
|
|
@@ -11026,7 +11100,6 @@
|
|
|
11026
11100
|
`;
|
|
11027
11101
|
|
|
11028
11102
|
const messengerViewsStyles = `
|
|
11029
|
-
|
|
11030
11103
|
/* ========================================
|
|
11031
11104
|
HOME VIEW
|
|
11032
11105
|
======================================== */
|
|
@@ -11480,9 +11553,36 @@
|
|
|
11480
11553
|
display: flex;
|
|
11481
11554
|
flex-direction: column;
|
|
11482
11555
|
gap: var(--spacing-3);
|
|
11483
|
-
padding: var(--spacing-
|
|
11556
|
+
padding: var(--spacing-3) var(--spacing-5) var(--spacing-4);
|
|
11484
11557
|
border-bottom: 1px solid var(--color-border);
|
|
11485
|
-
|
|
11558
|
+
flex-shrink: 0;
|
|
11559
|
+
background: linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%);
|
|
11560
|
+
position: relative;
|
|
11561
|
+
overflow: hidden;
|
|
11562
|
+
}
|
|
11563
|
+
|
|
11564
|
+
.messenger-help-header::before {
|
|
11565
|
+
content: '';
|
|
11566
|
+
position: absolute;
|
|
11567
|
+
top: -20px;
|
|
11568
|
+
left: -20px;
|
|
11569
|
+
width: 200px;
|
|
11570
|
+
height: 200px;
|
|
11571
|
+
background: radial-gradient(circle, rgba(21, 94, 239, 0.12) 0%, transparent 70%);
|
|
11572
|
+
filter: blur(30px);
|
|
11573
|
+
pointer-events: none;
|
|
11574
|
+
}
|
|
11575
|
+
|
|
11576
|
+
.messenger-help-header::after {
|
|
11577
|
+
content: '';
|
|
11578
|
+
position: absolute;
|
|
11579
|
+
top: -10px;
|
|
11580
|
+
right: -20px;
|
|
11581
|
+
width: 150px;
|
|
11582
|
+
height: 150px;
|
|
11583
|
+
background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
|
|
11584
|
+
filter: blur(25px);
|
|
11585
|
+
pointer-events: none;
|
|
11486
11586
|
}
|
|
11487
11587
|
|
|
11488
11588
|
.messenger-help-header-top {
|
|
@@ -11494,30 +11594,48 @@
|
|
|
11494
11594
|
|
|
11495
11595
|
.messenger-help-header-top h2 {
|
|
11496
11596
|
margin: 0;
|
|
11497
|
-
font-size: var(--font-size-
|
|
11597
|
+
font-size: var(--font-size-md);
|
|
11498
11598
|
font-weight: var(--font-weight-semibold);
|
|
11499
11599
|
color: var(--color-text-primary);
|
|
11500
11600
|
}
|
|
11501
11601
|
|
|
11502
|
-
.messenger-help-
|
|
11602
|
+
.messenger-help-close-btn {
|
|
11503
11603
|
position: absolute;
|
|
11504
11604
|
right: 0;
|
|
11505
11605
|
top: 50%;
|
|
11506
11606
|
transform: translateY(-50%);
|
|
11507
11607
|
}
|
|
11508
11608
|
|
|
11609
|
+
/* Search — back to normal style on light bg */
|
|
11610
|
+
.messenger-help-search-wrap {
|
|
11611
|
+
position: relative;
|
|
11612
|
+
width: 100%;
|
|
11613
|
+
}
|
|
11614
|
+
|
|
11615
|
+
.messenger-help-search-icon {
|
|
11616
|
+
position: absolute;
|
|
11617
|
+
left: var(--spacing-3);
|
|
11618
|
+
top: 50%;
|
|
11619
|
+
transform: translateY(-50%);
|
|
11620
|
+
color: var(--color-text-tertiary);
|
|
11621
|
+
display: flex;
|
|
11622
|
+
align-items: center;
|
|
11623
|
+
pointer-events: none;
|
|
11624
|
+
}
|
|
11625
|
+
|
|
11509
11626
|
.messenger-help-search-input {
|
|
11510
11627
|
width: 100%;
|
|
11511
|
-
background:
|
|
11628
|
+
background: rgba(255, 255, 255, 0.7);
|
|
11512
11629
|
border: 1px solid var(--color-border);
|
|
11513
11630
|
border-radius: var(--radius-md);
|
|
11514
|
-
padding: var(--spacing-2) var(--spacing-3);
|
|
11631
|
+
padding: var(--spacing-2) var(--spacing-3) var(--spacing-2) calc(var(--spacing-3) + 16px + var(--spacing-2));
|
|
11515
11632
|
font-size: var(--font-size-base);
|
|
11516
11633
|
font-weight: var(--font-weight-normal);
|
|
11517
11634
|
color: var(--color-text-primary);
|
|
11518
11635
|
font-family: inherit;
|
|
11519
11636
|
outline: none;
|
|
11520
|
-
transition: border-color var(--transition-base);
|
|
11637
|
+
transition: border-color var(--transition-base), background var(--transition-base);
|
|
11638
|
+
box-sizing: border-box;
|
|
11521
11639
|
}
|
|
11522
11640
|
|
|
11523
11641
|
.messenger-help-search-input:focus {
|
|
@@ -11529,6 +11647,7 @@
|
|
|
11529
11647
|
color: var(--color-text-tertiary);
|
|
11530
11648
|
}
|
|
11531
11649
|
|
|
11650
|
+
/* Body */
|
|
11532
11651
|
.messenger-help-body {
|
|
11533
11652
|
flex: 1;
|
|
11534
11653
|
overflow-y: auto;
|
|
@@ -11543,9 +11662,12 @@
|
|
|
11543
11662
|
padding: 0;
|
|
11544
11663
|
}
|
|
11545
11664
|
|
|
11665
|
+
/* ── Collection item ─────────────────────────────── */
|
|
11666
|
+
|
|
11546
11667
|
.messenger-help-collection {
|
|
11547
11668
|
display: flex;
|
|
11548
11669
|
align-items: center;
|
|
11670
|
+
gap: var(--spacing-3);
|
|
11549
11671
|
padding: var(--spacing-4) var(--spacing-5);
|
|
11550
11672
|
cursor: pointer;
|
|
11551
11673
|
transition: background var(--transition-base);
|
|
@@ -11556,13 +11678,34 @@
|
|
|
11556
11678
|
background: var(--color-neutral-50);
|
|
11557
11679
|
}
|
|
11558
11680
|
|
|
11681
|
+
/* Icon pill — tinted with primary colour */
|
|
11682
|
+
.messenger-help-collection-icon {
|
|
11683
|
+
flex-shrink: 0;
|
|
11684
|
+
width: 36px;
|
|
11685
|
+
height: 36px;
|
|
11686
|
+
border-radius: var(--radius-md);
|
|
11687
|
+
background: color-mix(in srgb, var(--color-primary) 10%, transparent);
|
|
11688
|
+
color: var(--color-primary);
|
|
11689
|
+
display: flex;
|
|
11690
|
+
align-items: center;
|
|
11691
|
+
justify-content: center;
|
|
11692
|
+
}
|
|
11693
|
+
|
|
11694
|
+
.messenger-help-collection-icon svg,
|
|
11695
|
+
.messenger-help-collection-icon iconify-icon {
|
|
11696
|
+
width: 20px;
|
|
11697
|
+
height: 20px;
|
|
11698
|
+
display: block;
|
|
11699
|
+
}
|
|
11700
|
+
|
|
11701
|
+
/* Content area */
|
|
11559
11702
|
.messenger-help-collection-content {
|
|
11560
11703
|
flex: 1;
|
|
11561
11704
|
min-width: 0;
|
|
11562
11705
|
}
|
|
11563
11706
|
|
|
11564
11707
|
.messenger-help-collection-title {
|
|
11565
|
-
margin: 0 0
|
|
11708
|
+
margin: 0 0 2px;
|
|
11566
11709
|
font-size: var(--font-size-md);
|
|
11567
11710
|
font-weight: var(--font-weight-bold);
|
|
11568
11711
|
color: var(--color-text-primary);
|
|
@@ -11570,10 +11713,40 @@
|
|
|
11570
11713
|
}
|
|
11571
11714
|
|
|
11572
11715
|
.messenger-help-collection-desc {
|
|
11573
|
-
margin: 0 0 var(--spacing-
|
|
11574
|
-
font-size: var(--font-size-
|
|
11716
|
+
margin: 0 0 var(--spacing-2);
|
|
11717
|
+
font-size: var(--font-size-sm);
|
|
11575
11718
|
color: var(--color-text-secondary);
|
|
11576
11719
|
line-height: var(--line-height-normal);
|
|
11720
|
+
display: -webkit-box;
|
|
11721
|
+
-webkit-line-clamp: 2;
|
|
11722
|
+
-webkit-box-orient: vertical;
|
|
11723
|
+
overflow: hidden;
|
|
11724
|
+
}
|
|
11725
|
+
|
|
11726
|
+
/* Meta row: author avatar + article count */
|
|
11727
|
+
.messenger-help-collection-meta {
|
|
11728
|
+
display: flex;
|
|
11729
|
+
align-items: center;
|
|
11730
|
+
gap: var(--spacing-2);
|
|
11731
|
+
}
|
|
11732
|
+
|
|
11733
|
+
/* Avatar — shared base */
|
|
11734
|
+
.messenger-help-collection-avatar {
|
|
11735
|
+
width: 18px;
|
|
11736
|
+
height: 18px;
|
|
11737
|
+
border-radius: var(--radius-full);
|
|
11738
|
+
flex-shrink: 0;
|
|
11739
|
+
object-fit: cover;
|
|
11740
|
+
}
|
|
11741
|
+
|
|
11742
|
+
/* Initials fallback */
|
|
11743
|
+
.messenger-help-collection-avatar--initials {
|
|
11744
|
+
display: inline-flex;
|
|
11745
|
+
align-items: center;
|
|
11746
|
+
justify-content: center;
|
|
11747
|
+
font-size: 9px;
|
|
11748
|
+
font-weight: 600;
|
|
11749
|
+
line-height: 1;
|
|
11577
11750
|
}
|
|
11578
11751
|
|
|
11579
11752
|
.messenger-help-collection-count {
|
|
@@ -11584,9 +11757,11 @@
|
|
|
11584
11757
|
.messenger-help-collection-arrow {
|
|
11585
11758
|
color: var(--color-text-tertiary);
|
|
11586
11759
|
flex-shrink: 0;
|
|
11587
|
-
margin-left:
|
|
11760
|
+
margin-left: auto;
|
|
11588
11761
|
}
|
|
11589
11762
|
|
|
11763
|
+
/* ── Footer (kept for optional use) ─────────────── */
|
|
11764
|
+
|
|
11590
11765
|
.messenger-help-footer {
|
|
11591
11766
|
padding: var(--spacing-4) var(--spacing-5);
|
|
11592
11767
|
border-top: 1px solid var(--color-border);
|
|
@@ -11614,19 +11789,59 @@
|
|
|
11614
11789
|
======================================== */
|
|
11615
11790
|
|
|
11616
11791
|
.messenger-changelog-header {
|
|
11792
|
+
padding: var(--spacing-3) var(--spacing-5);
|
|
11793
|
+
border-bottom: 1px solid var(--color-border);
|
|
11794
|
+
flex-shrink: 0;
|
|
11795
|
+
background: linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%);
|
|
11796
|
+
position: relative;
|
|
11797
|
+
overflow: hidden;
|
|
11798
|
+
}
|
|
11799
|
+
|
|
11800
|
+
.messenger-changelog-header::before {
|
|
11801
|
+
content: '';
|
|
11802
|
+
position: absolute;
|
|
11803
|
+
top: -20px;
|
|
11804
|
+
left: -20px;
|
|
11805
|
+
width: 200px;
|
|
11806
|
+
height: 200px;
|
|
11807
|
+
background: radial-gradient(circle, rgba(21, 94, 239, 0.12) 0%, transparent 70%);
|
|
11808
|
+
filter: blur(30px);
|
|
11809
|
+
pointer-events: none;
|
|
11810
|
+
}
|
|
11811
|
+
|
|
11812
|
+
.messenger-changelog-header::after {
|
|
11813
|
+
content: '';
|
|
11814
|
+
position: absolute;
|
|
11815
|
+
top: -10px;
|
|
11816
|
+
right: -20px;
|
|
11817
|
+
width: 150px;
|
|
11818
|
+
height: 150px;
|
|
11819
|
+
background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
|
|
11820
|
+
filter: blur(25px);
|
|
11821
|
+
pointer-events: none;
|
|
11822
|
+
}
|
|
11823
|
+
|
|
11824
|
+
.messenger-changelog-header-top {
|
|
11617
11825
|
display: flex;
|
|
11618
11826
|
align-items: center;
|
|
11619
11827
|
justify-content: center;
|
|
11620
|
-
|
|
11828
|
+
position: relative;
|
|
11621
11829
|
}
|
|
11622
11830
|
|
|
11623
|
-
.messenger-changelog-header h2 {
|
|
11831
|
+
.messenger-changelog-header-top h2 {
|
|
11624
11832
|
margin: 0;
|
|
11625
|
-
font-size: var(--font-size-
|
|
11833
|
+
font-size: var(--font-size-md);
|
|
11626
11834
|
font-weight: var(--font-weight-semibold);
|
|
11627
11835
|
color: var(--color-text-primary);
|
|
11628
11836
|
}
|
|
11629
11837
|
|
|
11838
|
+
.messenger-changelog-close-btn {
|
|
11839
|
+
position: absolute;
|
|
11840
|
+
right: 0;
|
|
11841
|
+
top: 50%;
|
|
11842
|
+
transform: translateY(-50%);
|
|
11843
|
+
}
|
|
11844
|
+
|
|
11630
11845
|
.messenger-changelog-body {
|
|
11631
11846
|
flex: 1;
|
|
11632
11847
|
overflow-y: auto;
|
|
@@ -11984,11 +12199,6 @@
|
|
|
11984
12199
|
box-shadow: inset 0 0 0 2px var(--color-primary);
|
|
11985
12200
|
}
|
|
11986
12201
|
|
|
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
12202
|
.feedback-survey-labels {
|
|
11993
12203
|
display: flex;
|
|
11994
12204
|
justify-content: space-between;
|
|
@@ -12263,11 +12473,6 @@
|
|
|
12263
12473
|
font-size: clamp(14px, 6vw, 18px);
|
|
12264
12474
|
}
|
|
12265
12475
|
|
|
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
12476
|
.feedback-survey-rating-scale + .feedback-survey-labels {
|
|
12272
12477
|
font-size: var(--font-size-xs);
|
|
12273
12478
|
}
|
|
@@ -12284,15 +12489,23 @@
|
|
|
12284
12489
|
messengerStyles;
|
|
12285
12490
|
|
|
12286
12491
|
function injectStyles() {
|
|
12287
|
-
if (
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
) {
|
|
12492
|
+
if (typeof document === 'undefined') return;
|
|
12493
|
+
|
|
12494
|
+
if (!document.querySelector('#feedback-sdk-styles')) {
|
|
12291
12495
|
const style = document.createElement('style');
|
|
12292
12496
|
style.id = 'feedback-sdk-styles';
|
|
12293
12497
|
style.textContent = CSS_STYLES;
|
|
12294
12498
|
document.head.appendChild(style);
|
|
12295
12499
|
}
|
|
12500
|
+
|
|
12501
|
+
if (!document.querySelector('#feedback-sdk-iconify')) {
|
|
12502
|
+
const script = document.createElement('script');
|
|
12503
|
+
script.id = 'feedback-sdk-iconify';
|
|
12504
|
+
script.src =
|
|
12505
|
+
'https://cdn.jsdelivr.net/npm/iconify-icon@2/dist/iconify-icon.min.js';
|
|
12506
|
+
script.async = true;
|
|
12507
|
+
document.head.appendChild(script);
|
|
12508
|
+
}
|
|
12296
12509
|
}
|
|
12297
12510
|
|
|
12298
12511
|
function autoInit() {
|