@zambon-dev/shared 1.0.2 → 1.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,95 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@zambon-dev/shared` are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ > **Upgrading?** Each release lists what changed and, under
9
+ > **⚠ Breaking Changes / Migration**, the concrete steps required to move to that version.
10
+ > When no migration is needed, that subsection is omitted.
11
+
12
+ ## [Unreleased]
13
+
14
+ ### Added
15
+
16
+ ### Changed
17
+
18
+ ### Deprecated
19
+
20
+ ### Removed
21
+
22
+ ### Fixed
23
+
24
+ ### ⚠ Breaking Changes / Migration
25
+
26
+ ## [1.1.0] - 2026-07-24
27
+
28
+ ### Added
29
+
30
+ - New application top bar (`shared-top-bar`), rendered by `MainLayoutComponent`, composing the
31
+ brand (app name, company name, optional logo), an environment badge, notifications, the language
32
+ selector, and the user profile — alongside the existing sidebar-collapse and logout controls.
33
+ - `NotificationsService` (root-provided) that streams notifications from a **SignalR hub**. It
34
+ exposes `getNotifications()`, `getUnreadCount()`, `markAsRead()`, `markAllAsRead()`, `start()`,
35
+ `stop()`, and an `isEnabled` flag. When enabled it connects (authenticated with the current JWT)
36
+ to `AppConfig.notificationsUrl` and listens for the server's `ReceiveNotifications` push. The top
37
+ bar drives it — apps do not call it directly.
38
+ - The notifications feature is toggleable and configurable via `AppConfig.notificationsEnabled` and
39
+ `AppConfig.notificationsUrl`; when disabled (or no URL is set) the bell is not rendered.
40
+ - Notifications show an icon, title, and description, and — when a `callToActionUrl` is present —
41
+ clicking navigates to it (internal routes via the Angular router, external URLs in a new tab).
42
+ - Individually reusable top-bar components: `BrandComponent`, `EnvironmentBadgeComponent`,
43
+ `NotificationsComponent`, `UserProfileComponent`, and the composing `TopBarComponent`.
44
+ - `top-bar` i18n bundle (`en`/`pt`) registered in `ZAMBON_SHARED_I18N_RESOURCES`.
45
+ - New peer dependency `@microsoft/signalr` (^10.0.0), used by `NotificationsService`.
46
+ - `LanguageSelectorComponent` gained a `showFlag` input; when `true` the toggle shows the current
47
+ language's flag on a light-gray button instead of the text label (used by the top bar; the login
48
+ page keeps the text label).
49
+ - `MainLayoutComponent` projects the application version (`AppConfig.version`) into the sidebar's
50
+ footer slot, shown at the bottom of the navigation when set.
51
+
52
+ ### Changed
53
+
54
+ - `ICurrentUserInfo` gained optional `pictureUrl` and `position` fields, displayed in the top-bar
55
+ user profile. The avatar falls back to the user's initials when `pictureUrl` is absent, and the
56
+ position line is hidden when `position` is empty.
57
+ - **`INotification` redefined** to `{ title, description, icon, callToActionUrl?, isRead }` (was
58
+ `{ id, title, message, read, createdAt }`) to match the SignalR hub contract.
59
+ - The top bar no longer renders a sidebar-collapse button — the sidebar owns its own collapse/expand
60
+ toggle. The user profile now uses a light, on-palette surface (neutral chip + brand-colored avatar)
61
+ instead of the previous dark chip.
62
+ - On small screens (< 768px) the top bar hides the brand text (app name + company; the logo remains)
63
+ and the entire user profile, for a compact layout.
64
+ - `LanguageSelectorComponent` now renders language flags as self-contained inline SVGs (US for `en`,
65
+ Brazil for `pt`) instead of `/flags/*.png` background images, in both the flag toggle and the
66
+ dropdown. The selector no longer depends on app-provided flag assets; apps that supplied custom
67
+ `/flags/*.png` images will no longer see them in the language selector.
68
+
69
+ ### ⚠ Breaking Changes / Migration
70
+
71
+ - **`INotification` shape changed** (see above). If you referenced the old fields (`id`, `message`,
72
+ `read`, `createdAt`), update to `title`, `description`, `icon`, `callToActionUrl`, `isRead`.
73
+ - **Notifications now require `@microsoft/signalr`.** Install it in the consuming app
74
+ (`npm i @microsoft/signalr`) — it is a peer dependency.
75
+
76
+ To populate the top bar, provide `appName`, `companyName`, `environment`, and optionally `logoUrl`
77
+ via `AppConfig` options (requires `@zambon-dev/framework` with the new `AppConfig` options). The
78
+ environment badge maps `DEV`/`QA`/`STG` to colors, renders any other non-empty value with a neutral
79
+ style, and is hidden for `PROD` or when no environment is set.
80
+
81
+ To enable notifications, set `notificationsEnabled: true` and `notificationsUrl` (the SignalR hub
82
+ URL) in `AppConfig`, and implement a hub that pushes the notification list to clients via a
83
+ `ReceiveNotifications` invocation (and optionally handles a `MarkAllAsRead` invoke). See
84
+ `docs/guides/top-bar-configuration.md` for the full consuming-app guide. The user's
85
+ `pictureUrl`/`position` are supplied by the auth response when available.
86
+
87
+ ## [1.0.2] - 2026-05-02
88
+
89
+ - Baseline release: the changelog starts being tracked from this version. Earlier history is
90
+ available via [GitHub Releases](https://github.com/RicardoZambon/ZLibraries/releases) and the
91
+ `shared-v*` tags.
92
+
93
+ [Unreleased]: https://github.com/RicardoZambon/ZLibraries/compare/shared-v1.1.0...HEAD
94
+ [1.1.0]: https://github.com/RicardoZambon/ZLibraries/releases/tag/shared-v1.1.0
95
+ [1.0.2]: https://github.com/RicardoZambon/ZLibraries/releases/tag/shared-v1.0.2