@product7/feedback-sdk 1.3.9 → 1.4.0
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/dist/feedback-sdk.js +108 -121
- 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/core/APIService.js +4 -0
- package/src/styles/feedback.js +1 -1
- package/src/styles/survey.js +1 -1
- package/src/widgets/MessengerWidget.js +102 -119
package/package.json
CHANGED
package/src/core/APIService.js
CHANGED
|
@@ -236,6 +236,10 @@ export class APIService extends BaseAPIService {
|
|
|
236
236
|
return this.help.searchHelpArticles(query, options);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
async getChangelogs(options) {
|
|
240
|
+
return this.changelog.getChangelogs(options);
|
|
241
|
+
}
|
|
242
|
+
|
|
239
243
|
_loadStoredSession() {
|
|
240
244
|
if (typeof localStorage === 'undefined') return false;
|
|
241
245
|
|
package/src/styles/feedback.js
CHANGED
|
@@ -124,6 +124,7 @@ export const feedbackStyles = `
|
|
|
124
124
|
transform: translateX(calc(100% + 24px));
|
|
125
125
|
transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
|
|
126
126
|
font-family: inherit;
|
|
127
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
.feedback-panel.open {
|
|
@@ -136,7 +137,6 @@ export const feedbackStyles = `
|
|
|
136
137
|
display: flex;
|
|
137
138
|
flex-direction: column;
|
|
138
139
|
border-radius: var(--radius-2xl);
|
|
139
|
-
box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
.feedback-panel-header {
|
package/src/styles/survey.js
CHANGED
|
@@ -23,7 +23,7 @@ export const surveyStyles = `
|
|
|
23
23
|
z-index: var(--z-modal);
|
|
24
24
|
background: var(--color-white);
|
|
25
25
|
border-radius: var(--radius-2xl);
|
|
26
|
-
box-shadow:
|
|
26
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
|
|
27
27
|
padding: var(--spacing-6);
|
|
28
28
|
min-width: 320px;
|
|
29
29
|
max-width: 400px;
|
|
@@ -526,26 +526,25 @@ export class MessengerWidget extends BaseWidget {
|
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}
|
|
529
|
+
async _fetchHelpArticles() {
|
|
530
|
+
try {
|
|
531
|
+
const response = await this.apiService.getHelpCollections();
|
|
532
|
+
if (response.success && response.data) {
|
|
533
|
+
const collections = response.data.collections || response.data;
|
|
534
|
+
return collections.map((collection) => ({
|
|
535
|
+
id: collection.id,
|
|
536
|
+
title: collection.title,
|
|
537
|
+
description: collection.description || '',
|
|
538
|
+
articleCount: collection.article_count || 0,
|
|
539
|
+
url: collection.url_slug ? `/help/${collection.url_slug}` : null,
|
|
540
|
+
}));
|
|
541
|
+
}
|
|
542
|
+
return [];
|
|
543
|
+
} catch (error) {
|
|
544
|
+
console.error('[MessengerWidget] Failed to fetch help articles:', error);
|
|
545
|
+
return [];
|
|
546
|
+
}
|
|
547
|
+
}
|
|
549
548
|
|
|
550
549
|
async fetchMessages(conversationId) {
|
|
551
550
|
try {
|
|
@@ -670,105 +669,89 @@ export class MessengerWidget extends BaseWidget {
|
|
|
670
669
|
}
|
|
671
670
|
}
|
|
672
671
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
const mappedItems = changelogs.map((item) => ({
|
|
757
|
-
id: item.id,
|
|
758
|
-
title: item.title,
|
|
759
|
-
description: item.excerpt || item.description || '',
|
|
760
|
-
tags: item.labels ? item.labels.map((label) => label.name) : [],
|
|
761
|
-
coverImage: item.cover_image || null,
|
|
762
|
-
coverText: null,
|
|
763
|
-
publishedAt: item.published_at,
|
|
764
|
-
url: item.slug ? `/changelog/${item.slug}` : '#',
|
|
765
|
-
}));
|
|
766
|
-
|
|
767
|
-
return {
|
|
768
|
-
homeItems: mappedItems.slice(0, 3),
|
|
769
|
-
changelogItems: mappedItems,
|
|
770
|
-
};
|
|
771
|
-
}
|
|
672
|
+
async _fetchChangelog() {
|
|
673
|
+
if (this.apiService?.mock) {
|
|
674
|
+
return {
|
|
675
|
+
homeItems: [
|
|
676
|
+
{
|
|
677
|
+
id: 'changelog_5',
|
|
678
|
+
title: 'New integrations available',
|
|
679
|
+
description: 'Connect with more tools you love and streamline your workflow.',
|
|
680
|
+
tags: ['Integration'],
|
|
681
|
+
coverImage: 'https://images.unsplash.com/photo-1674027444485-cec3da58eef4?w=500&auto=format&fit=crop&q=60',
|
|
682
|
+
publishedAt: new Date(Date.now() - 14 * 24 * 60 * 60 * 1000).toISOString(),
|
|
683
|
+
url: '#',
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
id: 'changelog_2',
|
|
687
|
+
title: 'A new era of Insights has arrived',
|
|
688
|
+
description: 'We announced Fin Insights, a groundbreaking, AI-powered product that gives you complete visibility into every customer conversation.',
|
|
689
|
+
tags: ['New feature', 'AI'],
|
|
690
|
+
coverImage: 'https://images.unsplash.com/photo-1666875753105-c63a6f3bdc86?w=500&auto=format&fit=crop&q=60',
|
|
691
|
+
publishedAt: new Date(Date.now() - 5 * 24 * 60 * 60 * 1000).toISOString(),
|
|
692
|
+
url: '#',
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
id: 'changelog_1',
|
|
696
|
+
title: 'The 2025 Customer Service Transformation Report',
|
|
697
|
+
description: 'Learn how AI has transformed customer service from the ground up—rewriting its economics and reshaping expectations.',
|
|
698
|
+
tags: ['Report'],
|
|
699
|
+
coverImage: 'https://images.unsplash.com/photo-1762330467475-a565d04e1808?w=500&auto=format&fit=crop&q=60',
|
|
700
|
+
publishedAt: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString(),
|
|
701
|
+
url: '#',
|
|
702
|
+
},
|
|
703
|
+
],
|
|
704
|
+
changelogItems: [
|
|
705
|
+
{
|
|
706
|
+
id: 'changelog_4',
|
|
707
|
+
title: 'Enhanced conversation analytics',
|
|
708
|
+
description: 'Get deeper insights into your customer conversations with our new analytics dashboard.',
|
|
709
|
+
tags: ['Analytics'],
|
|
710
|
+
coverImage: 'https://images.unsplash.com/photo-1523961131990-5ea7c61b2107?w=500&auto=format&fit=crop&q=60',
|
|
711
|
+
publishedAt: new Date(Date.now() - 10 * 24 * 60 * 60 * 1000).toISOString(),
|
|
712
|
+
url: '#',
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
id: 'changelog_3',
|
|
716
|
+
title: 'Escalation guidance for complex issues',
|
|
717
|
+
description: 'New AI-powered escalation guidance helps your team handle complex customer issues more effectively.',
|
|
718
|
+
tags: ['New feature', 'AI'],
|
|
719
|
+
coverImage: 'https://images.unsplash.com/photo-1764773516703-b246ac2ad5ef?w=500&auto=format&fit=crop&q=60',
|
|
720
|
+
publishedAt: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),
|
|
721
|
+
url: '#',
|
|
722
|
+
},
|
|
723
|
+
],
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
try {
|
|
728
|
+
const response = await this.apiService.getChangelogs({ limit: 20 });
|
|
729
|
+
|
|
730
|
+
if (response.success && response.data) {
|
|
731
|
+
const changelogs = Array.isArray(response.data) ? response.data : [];
|
|
732
|
+
|
|
733
|
+
const mappedItems = changelogs.map((item) => ({
|
|
734
|
+
id: item.id,
|
|
735
|
+
title: item.title,
|
|
736
|
+
description: item.excerpt || item.description || '',
|
|
737
|
+
tags: item.labels ? item.labels.map((label) => label.name) : [],
|
|
738
|
+
coverImage: item.cover_image || null,
|
|
739
|
+
publishedAt: item.published_at,
|
|
740
|
+
url: item.slug ? `/changelog/${item.slug}` : null,
|
|
741
|
+
}));
|
|
742
|
+
|
|
743
|
+
return {
|
|
744
|
+
homeItems: mappedItems.slice(0, 3),
|
|
745
|
+
changelogItems: mappedItems,
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
return { homeItems: [], changelogItems: [] };
|
|
750
|
+
} catch (error) {
|
|
751
|
+
console.error('[MessengerWidget] Failed to fetch changelog:', error);
|
|
752
|
+
return { homeItems: [], changelogItems: [] };
|
|
753
|
+
}
|
|
754
|
+
}
|
|
772
755
|
|
|
773
756
|
async onMount() {
|
|
774
757
|
this.loadInitialData();
|