@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.
@@ -1282,6 +1282,10 @@
1282
1282
  return this.help.searchHelpArticles(query, options);
1283
1283
  }
1284
1284
 
1285
+ async getChangelogs(options) {
1286
+ return this.changelog.getChangelogs(options);
1287
+ }
1288
+
1285
1289
  _loadStoredSession() {
1286
1290
  if (typeof localStorage === 'undefined') return false;
1287
1291
 
@@ -6070,26 +6074,25 @@
6070
6074
  }
6071
6075
  }
6072
6076
 
6073
- async _fetchHelpArticles() {
6074
- try {
6075
- const response = await this.apiService.getHelpCollections();
6076
- if (response.status && response.data) {
6077
- return response.data.map((collection) => ({
6078
- id: collection.id,
6079
- title: collection.title || collection.name,
6080
- description: collection.description || '',
6081
- articleCount:
6082
- collection.article_count || collection.articleCount || 0,
6083
- icon: collection.icon || 'ph-book-open',
6084
- url: collection.url || `#/help/${collection.slug || collection.id}`,
6085
- }));
6086
- }
6087
- return [];
6088
- } catch (error) {
6089
- console.error('[MessengerWidget] Failed to fetch help articles:', error);
6090
- return [];
6091
- }
6092
- }
6077
+ async _fetchHelpArticles() {
6078
+ try {
6079
+ const response = await this.apiService.getHelpCollections();
6080
+ if (response.success && response.data) {
6081
+ const collections = response.data.collections || response.data;
6082
+ return collections.map((collection) => ({
6083
+ id: collection.id,
6084
+ title: collection.title,
6085
+ description: collection.description || '',
6086
+ articleCount: collection.article_count || 0,
6087
+ url: collection.url_slug ? `/help/${collection.url_slug}` : null,
6088
+ }));
6089
+ }
6090
+ return [];
6091
+ } catch (error) {
6092
+ console.error('[MessengerWidget] Failed to fetch help articles:', error);
6093
+ return [];
6094
+ }
6095
+ }
6093
6096
 
6094
6097
  async fetchMessages(conversationId) {
6095
6098
  try {
@@ -6214,105 +6217,89 @@
6214
6217
  }
6215
6218
  }
6216
6219
 
6217
- async _fetchChangelog() {
6218
- if (this.apiService?.mock) {
6219
- return {
6220
- homeItems: [
6221
- {
6222
- id: 'changelog_5',
6223
- title: 'New integrations available',
6224
- description:
6225
- 'Connect with more tools you love and streamline your workflow.',
6226
- tags: ['Integration'],
6227
- coverImage:
6228
- 'https://images.unsplash.com/photo-1674027444485-cec3da58eef4?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8M3x8YWl8ZW58MHx8MHx8fDA%3D',
6229
- coverText: null,
6230
- publishedAt: new Date(
6231
- Date.now() - 14 * 24 * 60 * 60 * 1000
6232
- ).toISOString(),
6233
- url: '#',
6234
- },
6235
- {
6236
- id: 'changelog_2',
6237
- title: 'A new era of Insights has arrived',
6238
- description:
6239
- 'We announced Fin Insights, a groundbreaking, AI-powered product that gives you complete visibility into every customer conversation.',
6240
- tags: ['New feature', 'AI'],
6241
- coverImage:
6242
- 'https://images.unsplash.com/photo-1666875753105-c63a6f3bdc86?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTJ8fGluc2lnaHRzfGVufDB8fDB8fHww',
6243
- coverText: 'Watch our major product launch on-demand',
6244
- publishedAt: new Date(
6245
- Date.now() - 5 * 24 * 60 * 60 * 1000
6246
- ).toISOString(),
6247
- url: '#',
6248
- },
6249
- {
6250
- id: 'changelog_1',
6251
- title: 'The 2025 Customer Service Transformation Report',
6252
- description:
6253
- 'Learn how AI has transformed customer service from the ground up—rewriting its economics and reshaping expectations.',
6254
- tags: ['Report'],
6255
- coverImage:
6256
- 'https://images.unsplash.com/photo-1762330467475-a565d04e1808?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8N3x8YWklMjBjdXN0b21lciUyMHNlcnZpY2V8ZW58MHx8MHx8fDA%3D',
6257
- coverText: 'Customer service trends as we know them are dead.',
6258
- publishedAt: new Date(
6259
- Date.now() - 2 * 24 * 60 * 60 * 1000
6260
- ).toISOString(),
6261
- url: '#',
6262
- },
6263
- ],
6264
- changelogItems: [
6265
- {
6266
- id: 'changelog_4',
6267
- title: 'Enhanced conversation analytics',
6268
- description:
6269
- 'Get deeper insights into your customer conversations with our new analytics dashboard.',
6270
- tags: ['Analytics'],
6271
- coverImage:
6272
- 'https://images.unsplash.com/photo-1523961131990-5ea7c61b2107?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTJ8fGFuYWx5dGljc3xlbnwwfHwwfHx8MA%3D%3D',
6273
- coverText: null,
6274
- publishedAt: new Date(
6275
- Date.now() - 10 * 24 * 60 * 60 * 1000
6276
- ).toISOString(),
6277
- url: '#',
6278
- },
6279
- {
6280
- id: 'changelog_3',
6281
- title: 'Escalation guidance for complex issues',
6282
- description:
6283
- 'New AI-powered escalation guidance helps your team handle complex customer issues more effectively.',
6284
- tags: ['New feature', 'AI'],
6285
- coverImage:
6286
- 'https://images.unsplash.com/photo-1764773516703-b246ac2ad5ef?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8M3x8Y29tcGxleCUyMGlzc3Vlc3xlbnwwfHwwfHx8MA%3D%3D',
6287
- coverText: null,
6288
- publishedAt: new Date(
6289
- Date.now() - 7 * 24 * 60 * 60 * 1000
6290
- ).toISOString(),
6291
- url: '#',
6292
- },
6293
- ],
6294
- };
6295
- }
6296
-
6297
- const response = await this.apiService.getChangelogs({ limit: 20 });
6298
- const changelogs = response.data || [];
6299
-
6300
- const mappedItems = changelogs.map((item) => ({
6301
- id: item.id,
6302
- title: item.title,
6303
- description: item.excerpt || item.description || '',
6304
- tags: item.labels ? item.labels.map((label) => label.name) : [],
6305
- coverImage: item.cover_image || null,
6306
- coverText: null,
6307
- publishedAt: item.published_at,
6308
- url: item.slug ? `/changelog/${item.slug}` : '#',
6309
- }));
6310
-
6311
- return {
6312
- homeItems: mappedItems.slice(0, 3),
6313
- changelogItems: mappedItems,
6314
- };
6315
- }
6220
+ async _fetchChangelog() {
6221
+ if (this.apiService?.mock) {
6222
+ return {
6223
+ homeItems: [
6224
+ {
6225
+ id: 'changelog_5',
6226
+ title: 'New integrations available',
6227
+ description: 'Connect with more tools you love and streamline your workflow.',
6228
+ tags: ['Integration'],
6229
+ coverImage: 'https://images.unsplash.com/photo-1674027444485-cec3da58eef4?w=500&auto=format&fit=crop&q=60',
6230
+ publishedAt: new Date(Date.now() - 14 * 24 * 60 * 60 * 1000).toISOString(),
6231
+ url: '#',
6232
+ },
6233
+ {
6234
+ id: 'changelog_2',
6235
+ title: 'A new era of Insights has arrived',
6236
+ description: 'We announced Fin Insights, a groundbreaking, AI-powered product that gives you complete visibility into every customer conversation.',
6237
+ tags: ['New feature', 'AI'],
6238
+ coverImage: 'https://images.unsplash.com/photo-1666875753105-c63a6f3bdc86?w=500&auto=format&fit=crop&q=60',
6239
+ publishedAt: new Date(Date.now() - 5 * 24 * 60 * 60 * 1000).toISOString(),
6240
+ url: '#',
6241
+ },
6242
+ {
6243
+ id: 'changelog_1',
6244
+ title: 'The 2025 Customer Service Transformation Report',
6245
+ description: 'Learn how AI has transformed customer service from the ground up—rewriting its economics and reshaping expectations.',
6246
+ tags: ['Report'],
6247
+ coverImage: 'https://images.unsplash.com/photo-1762330467475-a565d04e1808?w=500&auto=format&fit=crop&q=60',
6248
+ publishedAt: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString(),
6249
+ url: '#',
6250
+ },
6251
+ ],
6252
+ changelogItems: [
6253
+ {
6254
+ id: 'changelog_4',
6255
+ title: 'Enhanced conversation analytics',
6256
+ description: 'Get deeper insights into your customer conversations with our new analytics dashboard.',
6257
+ tags: ['Analytics'],
6258
+ coverImage: 'https://images.unsplash.com/photo-1523961131990-5ea7c61b2107?w=500&auto=format&fit=crop&q=60',
6259
+ publishedAt: new Date(Date.now() - 10 * 24 * 60 * 60 * 1000).toISOString(),
6260
+ url: '#',
6261
+ },
6262
+ {
6263
+ id: 'changelog_3',
6264
+ title: 'Escalation guidance for complex issues',
6265
+ description: 'New AI-powered escalation guidance helps your team handle complex customer issues more effectively.',
6266
+ tags: ['New feature', 'AI'],
6267
+ coverImage: 'https://images.unsplash.com/photo-1764773516703-b246ac2ad5ef?w=500&auto=format&fit=crop&q=60',
6268
+ publishedAt: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),
6269
+ url: '#',
6270
+ },
6271
+ ],
6272
+ };
6273
+ }
6274
+
6275
+ try {
6276
+ const response = await this.apiService.getChangelogs({ limit: 20 });
6277
+
6278
+ if (response.success && response.data) {
6279
+ const changelogs = Array.isArray(response.data) ? response.data : [];
6280
+
6281
+ const mappedItems = changelogs.map((item) => ({
6282
+ id: item.id,
6283
+ title: item.title,
6284
+ description: item.excerpt || item.description || '',
6285
+ tags: item.labels ? item.labels.map((label) => label.name) : [],
6286
+ coverImage: item.cover_image || null,
6287
+ publishedAt: item.published_at,
6288
+ url: item.slug ? `/changelog/${item.slug}` : null,
6289
+ }));
6290
+
6291
+ return {
6292
+ homeItems: mappedItems.slice(0, 3),
6293
+ changelogItems: mappedItems,
6294
+ };
6295
+ }
6296
+
6297
+ return { homeItems: [], changelogItems: [] };
6298
+ } catch (error) {
6299
+ console.error('[MessengerWidget] Failed to fetch changelog:', error);
6300
+ return { homeItems: [], changelogItems: [] };
6301
+ }
6302
+ }
6316
6303
 
6317
6304
  async onMount() {
6318
6305
  this.loadInitialData();
@@ -8806,6 +8793,7 @@
8806
8793
  transform: translateX(calc(100% + 24px));
8807
8794
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
8808
8795
  font-family: inherit;
8796
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
8809
8797
  }
8810
8798
 
8811
8799
  .feedback-panel.open {
@@ -8818,7 +8806,6 @@
8818
8806
  display: flex;
8819
8807
  flex-direction: column;
8820
8808
  border-radius: var(--radius-2xl);
8821
- box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
8822
8809
  }
8823
8810
 
8824
8811
  .feedback-panel-header {
@@ -10460,7 +10447,7 @@
10460
10447
  z-index: var(--z-modal);
10461
10448
  background: var(--color-white);
10462
10449
  border-radius: var(--radius-2xl);
10463
- box-shadow: var(--shadow-2xl);
10450
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
10464
10451
  padding: var(--spacing-6);
10465
10452
  min-width: 320px;
10466
10453
  max-width: 400px;