cloud-ide-layout 1.0.61 → 1.0.62

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.
Files changed (13) hide show
  1. package/fesm2022/{cloud-ide-layout-cloud-ide-layout-grBP43Ly.mjs → cloud-ide-layout-cloud-ide-layout-CKLj-6xH.mjs} +121 -25
  2. package/fesm2022/cloud-ide-layout-cloud-ide-layout-CKLj-6xH.mjs.map +1 -0
  3. package/fesm2022/{cloud-ide-layout-drawer-theme.component-BJ6T7meW.mjs → cloud-ide-layout-drawer-theme.component-DMn2Cznf.mjs} +2 -2
  4. package/fesm2022/{cloud-ide-layout-drawer-theme.component-BJ6T7meW.mjs.map → cloud-ide-layout-drawer-theme.component-DMn2Cznf.mjs.map} +1 -1
  5. package/fesm2022/{cloud-ide-layout-floating-entity-selection.component-BdzYa5wO.mjs → cloud-ide-layout-floating-entity-selection.component-L3hZ4LJm.mjs} +2 -2
  6. package/fesm2022/{cloud-ide-layout-floating-entity-selection.component-BdzYa5wO.mjs.map → cloud-ide-layout-floating-entity-selection.component-L3hZ4LJm.mjs.map} +1 -1
  7. package/fesm2022/{cloud-ide-layout-home-wrapper.component-CdzzQ1bR.mjs → cloud-ide-layout-home-wrapper.component-ZWphfyNz.mjs} +2 -2
  8. package/fesm2022/{cloud-ide-layout-home-wrapper.component-CdzzQ1bR.mjs.map → cloud-ide-layout-home-wrapper.component-ZWphfyNz.mjs.map} +1 -1
  9. package/fesm2022/{cloud-ide-layout-sidedrawer-notes.component-buxglvep.mjs → cloud-ide-layout-sidedrawer-notes.component-sYWI-yH9.mjs} +2 -2
  10. package/fesm2022/{cloud-ide-layout-sidedrawer-notes.component-buxglvep.mjs.map → cloud-ide-layout-sidedrawer-notes.component-sYWI-yH9.mjs.map} +1 -1
  11. package/fesm2022/cloud-ide-layout.mjs +1 -1
  12. package/package.json +1 -1
  13. package/fesm2022/cloud-ide-layout-cloud-ide-layout-grBP43Ly.mjs.map +0 -1
@@ -1266,7 +1266,7 @@ class CideLytFloatingEntitySelectionService {
1266
1266
  }
1267
1267
  try {
1268
1268
  // Use relative import to avoid circular dependency
1269
- const module = await import('./cloud-ide-layout-floating-entity-selection.component-BdzYa5wO.mjs');
1269
+ const module = await import('./cloud-ide-layout-floating-entity-selection.component-L3hZ4LJm.mjs');
1270
1270
  if (module.CideLytFloatingEntitySelectionComponent) {
1271
1271
  this.containerService.registerComponent('entity-selection-header', module.CideLytFloatingEntitySelectionComponent);
1272
1272
  console.log('✅ Entity selection component registered successfully');
@@ -1558,7 +1558,7 @@ class CideLytHeaderWrapperComponent {
1558
1558
  // Get notifications from WebSocket service (real-time)
1559
1559
  const wsNotifications = this.wsNotificationService?.allNotifications() || [];
1560
1560
  console.log('[Notifications] WebSocket notifications:', wsNotifications.length);
1561
- // Load from API to get all notifications
1561
+ // Load from API to get all notifications (including read status)
1562
1562
  this.notificationApiService.getNotifications({
1563
1563
  pageSize: 20
1564
1564
  }).subscribe({
@@ -1577,19 +1577,32 @@ class CideLytHeaderWrapperComponent {
1577
1577
  action_label: notif.not_action_label,
1578
1578
  priority: notif.not_priority || 'normal',
1579
1579
  created_at: new Date(notif.not_created_at),
1580
- timestamp: new Date(notif.not_created_at)
1580
+ timestamp: new Date(notif.not_created_at),
1581
+ // Store read status for filtering
1582
+ isRead: notif.not_status === 'read' || notif.not_read_at !== undefined
1581
1583
  }));
1582
1584
  console.log('[Notifications] Converted API payloads:', apiPayloads.length);
1583
- // Merge WebSocket and API notifications (WebSocket takes priority for duplicates)
1584
- const mergedNotifications = [...wsNotifications];
1585
+ // Merge WebSocket and API notifications (API takes priority for read status)
1586
+ const mergedNotifications = [];
1587
+ // Add API notifications first (they have read status)
1585
1588
  apiPayloads.forEach(apiNotif => {
1586
- if (!mergedNotifications.find(n => n.id === apiNotif.id)) {
1587
- mergedNotifications.push(apiNotif);
1589
+ mergedNotifications.push(apiNotif);
1590
+ });
1591
+ // Add WebSocket notifications that aren't in API (new real-time notifications)
1592
+ wsNotifications.forEach(wsNotif => {
1593
+ if (!mergedNotifications.find(n => n.id === wsNotif.id)) {
1594
+ mergedNotifications.push({ ...wsNotif, isRead: false });
1588
1595
  }
1589
1596
  });
1590
1597
  // Sort by timestamp (newest first)
1591
1598
  mergedNotifications.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
1592
1599
  console.log('[Notifications] Total merged notifications:', mergedNotifications.length);
1600
+ // Update WebSocket service with read status
1601
+ if (this.wsNotificationService) {
1602
+ // Update unread count based on read status
1603
+ const unread = mergedNotifications.filter(n => !n.isRead);
1604
+ // Note: WebSocket service manages its own unread count, but we sync here
1605
+ }
1593
1606
  this.notifications.set(mergedNotifications);
1594
1607
  this.updateNotificationDropdown();
1595
1608
  }
@@ -1617,22 +1630,49 @@ class CideLytHeaderWrapperComponent {
1617
1630
  */
1618
1631
  updateNotificationDropdown() {
1619
1632
  const notifs = this.notifications();
1633
+ const unreadCount = this.unreadCount();
1634
+ // Map notifications to dropdown items (show first 10)
1620
1635
  this.notificationItems = notifs.slice(0, 10).map(notif => ({
1621
1636
  id: notif.id,
1622
1637
  label: notif.title,
1623
- description: notif.message,
1624
1638
  icon: this.getNotificationIcon(notif.type),
1625
1639
  iconColor: this.getNotificationIconColor(notif.type),
1626
- badge: notif.priority === 'urgent' ? 'Urgent' : undefined,
1627
- badgeColor: notif.priority === 'urgent' ? 'tw-bg-red-500' : undefined
1640
+ // Note: description is not supported by DropdownItem interface, but keeping for future use
1641
+ // description: notif.message,
1628
1642
  }));
1629
- // Add "View All" option if there are notifications
1643
+ // Add action buttons if there are notifications
1630
1644
  if (notifs.length > 0) {
1645
+ // Add divider before actions
1631
1646
  this.notificationItems.push({
1632
- id: 'divider',
1647
+ id: 'divider-1',
1633
1648
  label: '',
1634
1649
  divider: true
1635
1650
  });
1651
+ // Add "Mark All as Read" if there are unread notifications
1652
+ if (unreadCount > 0) {
1653
+ this.notificationItems.push({
1654
+ id: 'mark-all-read',
1655
+ label: 'Mark All as Read',
1656
+ icon: 'done_all',
1657
+ iconColor: 'tw-text-blue-500'
1658
+ });
1659
+ }
1660
+ // Add "Clear All" option
1661
+ this.notificationItems.push({
1662
+ id: 'clear-all',
1663
+ label: 'Clear All',
1664
+ icon: 'clear_all',
1665
+ iconColor: 'tw-text-red-500',
1666
+ textColor: 'tw-text-red-600',
1667
+ hoverBgColor: 'hover:tw-bg-red-50'
1668
+ });
1669
+ // Add divider before "View All"
1670
+ this.notificationItems.push({
1671
+ id: 'divider-2',
1672
+ label: '',
1673
+ divider: true
1674
+ });
1675
+ // Add "View All" option
1636
1676
  this.notificationItems.push({
1637
1677
  id: 'view-all',
1638
1678
  label: 'View All Notifications',
@@ -1680,30 +1720,86 @@ class CideLytHeaderWrapperComponent {
1680
1720
  * Handle notification dropdown item click
1681
1721
  */
1682
1722
  onNotificationClick(item) {
1723
+ // Handle action buttons
1724
+ if (item.id === 'mark-all-read') {
1725
+ this.markAllAsRead();
1726
+ return;
1727
+ }
1728
+ if (item.id === 'clear-all') {
1729
+ this.clearAllNotifications();
1730
+ return;
1731
+ }
1683
1732
  if (item.id === 'view-all') {
1684
1733
  // Navigate to notifications page or open full panel
1685
1734
  console.log('View all notifications');
1735
+ // TODO: Navigate to full notifications page
1686
1736
  return;
1687
1737
  }
1688
- if (item.id === 'no-notifications' || item.id === 'divider') {
1738
+ if (item.id === 'no-notifications' || item.id === 'divider' || item.id === 'divider-1' || item.id === 'divider-2') {
1689
1739
  return;
1690
1740
  }
1691
- // Mark notification as read
1741
+ // Mark notification as read when clicked
1742
+ this.markNotificationAsRead(String(item.id));
1743
+ // Navigate to action URL if available
1744
+ const notification = this.notifications().find(n => n.id === item.id);
1745
+ if (notification?.action_url) {
1746
+ this.router.navigate([notification.action_url]);
1747
+ }
1748
+ }
1749
+ /**
1750
+ * Mark a single notification as read
1751
+ */
1752
+ markNotificationAsRead(notificationId) {
1753
+ // Mark in WebSocket service
1692
1754
  if (this.wsNotificationService) {
1693
- this.wsNotificationService.markAsRead(String(item.id));
1755
+ this.wsNotificationService.markAsRead(notificationId);
1694
1756
  }
1695
- this.notificationApiService.markAsRead(String(item.id)).subscribe({
1757
+ // Mark in API
1758
+ this.notificationApiService.markAsRead(notificationId).subscribe({
1696
1759
  next: () => {
1760
+ console.log('[Notifications] Marked as read:', notificationId);
1761
+ // Reload notifications to update unread count
1697
1762
  this.loadNotifications();
1698
1763
  },
1699
1764
  error: (error) => {
1700
- console.error('Error marking notification as read:', error);
1765
+ console.error('[Notifications] Error marking notification as read:', error);
1701
1766
  }
1702
1767
  });
1703
- // Navigate to action URL if available
1704
- const notification = this.notifications().find(n => n.id === item.id);
1705
- if (notification?.action_url) {
1706
- this.router.navigate([notification.action_url]);
1768
+ }
1769
+ /**
1770
+ * Mark all notifications as read
1771
+ */
1772
+ markAllAsRead() {
1773
+ this.notificationApiService.markAllAsRead().subscribe({
1774
+ next: () => {
1775
+ console.log('[Notifications] All notifications marked as read');
1776
+ // Reload notifications to update unread count
1777
+ this.loadNotifications();
1778
+ },
1779
+ error: (error) => {
1780
+ console.error('[Notifications] Error marking all as read:', error);
1781
+ }
1782
+ });
1783
+ }
1784
+ /**
1785
+ * Clear all notifications (mark all as read and remove from view)
1786
+ */
1787
+ clearAllNotifications() {
1788
+ if (confirm('Are you sure you want to clear all notifications? This will mark them all as read.')) {
1789
+ // First mark all as read
1790
+ this.notificationApiService.markAllAsRead().subscribe({
1791
+ next: () => {
1792
+ console.log('[Notifications] All notifications cleared');
1793
+ // Clear local notifications array
1794
+ this.notifications.set([]);
1795
+ this.updateNotificationDropdown();
1796
+ // Reload to get updated state
1797
+ this.loadNotifications();
1798
+ },
1799
+ error: (error) => {
1800
+ console.error('[Notifications] Error clearing all notifications:', error);
1801
+ }
1802
+ });
1707
1803
  }
1708
1804
  }
1709
1805
  ngAfterViewInit() {
@@ -3310,8 +3406,8 @@ class CideLytSidedrawerWrapperComponent {
3310
3406
  }
3311
3407
  ngOnInit() {
3312
3408
  // Initialize the component map (You'd likely populate this from a config or service)
3313
- this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-buxglvep.mjs').then(m => m.CideLytSidedrawerNotesComponent);
3314
- this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-BJ6T7meW.mjs').then(m => m.CideLytDrawerThemeComponent);
3409
+ this.componentMap['drowar_notes'] = () => import('./cloud-ide-layout-sidedrawer-notes.component-sYWI-yH9.mjs').then(m => m.CideLytSidedrawerNotesComponent);
3410
+ this.componentMap['drawer_theme'] = () => import('./cloud-ide-layout-drawer-theme.component-DMn2Cznf.mjs').then(m => m.CideLytDrawerThemeComponent);
3315
3411
  }
3316
3412
  async loadComponent(configFor) {
3317
3413
  console.log('🔍 SIDEDRAWER - Loading component:', configFor, 'Current tab:', this.currentTabId);
@@ -3834,7 +3930,7 @@ const layoutControlPannelChildRoutes = [{
3834
3930
  },
3835
3931
  {
3836
3932
  path: "home",
3837
- loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-CdzzQ1bR.mjs').then(c => c.CideLytHomeWrapperComponent),
3933
+ loadComponent: () => import('./cloud-ide-layout-home-wrapper.component-ZWphfyNz.mjs').then(c => c.CideLytHomeWrapperComponent),
3838
3934
  canActivate: [authGuard],
3839
3935
  data: {
3840
3936
  reuseTab: true, // For CustomRouteReuseStrategy
@@ -5402,4 +5498,4 @@ var floatingEntityRightsSharing_component = /*#__PURE__*/Object.freeze({
5402
5498
  */
5403
5499
 
5404
5500
  export { AppStateHelperService as A, CideLytSharedWrapperComponent as C, ENVIRONMENT_CONFIG as E, CideLytSidebarService as a, CideLytRequestService as b, CideLytSidedrawerService as c, CideLytThemeService as d, AppStateService as e, CloudIdeLayoutService as f, CloudIdeLayoutComponent as g, CideLytSharedService as h, layoutControlPannelChildRoutes as i, CustomRouteReuseStrategy as j, CideLytUserStatusService as k, layoutRoutes as l, CacheManagerService as m, CideLytFileManagerService as n, CideLytFloatingEntityRightsSharingComponent as o, processThemeVariable as p, CideLytFloatingEntityRightsSharingService as q, setCSSVariable as s, themeFactory as t };
5405
- //# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-grBP43Ly.mjs.map
5501
+ //# sourceMappingURL=cloud-ide-layout-cloud-ide-layout-CKLj-6xH.mjs.map