@nar-bus/ui-shared 2.2.0 → 2.3.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/adapters/mock-adapter.d.ts.map +1 -1
- package/dist/api/normalizers/notifications.d.ts +23 -2
- package/dist/api/normalizers/notifications.d.ts.map +1 -1
- package/dist/components/CronBuilder.d.ts +46 -2
- package/dist/components/CronBuilder.d.ts.map +1 -1
- package/dist/components/DashboardWidgetGrid.d.ts.map +1 -1
- package/dist/components/NotificationBell.d.ts +29 -1
- package/dist/components/NotificationBell.d.ts.map +1 -1
- package/dist/components/detail-layout/ReadingHeatmap.d.ts +28 -2
- package/dist/components/detail-layout/ReadingHeatmap.d.ts.map +1 -1
- package/dist/components/detail-layout/TriColumnSymmetric.d.ts +14 -8
- package/dist/components/detail-layout/TriColumnSymmetric.d.ts.map +1 -1
- package/dist/components/detail-layout/adapters.d.ts.map +1 -1
- package/dist/components/detail-layout/types.d.ts +9 -0
- package/dist/components/detail-layout/types.d.ts.map +1 -1
- package/dist/components/form-sheet/FormSheet.d.ts +9 -1
- package/dist/components/form-sheet/FormSheet.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/sseHub.d.ts +72 -0
- package/dist/hooks/sseHub.d.ts.map +1 -0
- package/dist/hooks/useNotifications.d.ts +58 -2
- package/dist/hooks/useNotifications.d.ts.map +1 -1
- package/dist/hooks/useSSE.d.ts +51 -0
- package/dist/hooks/useSSE.d.ts.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16141 -15476
- package/dist/mocks/dlq.json.d.ts +88 -17
- package/dist/mocks/system-monitoring.json.d.ts +1 -0
- package/dist/types/common.types.d.ts +8 -0
- package/dist/types/common.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/location.types.d.ts +21 -0
- package/dist/types/location.types.d.ts.map +1 -1
- package/dist/types/management.types.d.ts +179 -2
- package/dist/types/management.types.d.ts.map +1 -1
- package/dist/types/modem.types.d.ts +16 -0
- package/dist/types/modem.types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/mocks/notifications.json.d.ts +0 -58
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/mock-adapter.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"mock-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/mock-adapter.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAyX1D,qBAAa,WAAY,YAAW,UAAU;IAC5C,OAAO,CAAC,OAAO;IAQT,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAwU5C,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAohB5D,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAyF3D,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAgC/C,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;CAgBhF"}
|
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import { ApiResponse, PageMeta } from '../../adapters/types';
|
|
2
|
-
import { NotificationItem, NotificationListEnvelope } from '../../types/management.types';
|
|
2
|
+
import { NotificationItem, NotificationListEnvelope, NotificationRecord, NotificationWireItem, NotificationWireListEnvelope } from '../../types/management.types';
|
|
3
3
|
export interface NotificationListResult {
|
|
4
|
+
/**
|
|
5
|
+
* Normalized items (`isRead` set from the wire's `read`). Typed as before; the
|
|
6
|
+
* `type` at runtime is the backend's code — read it as `NotificationTypeCode`.
|
|
7
|
+
*/
|
|
4
8
|
data: NotificationItem[];
|
|
5
9
|
meta: PageMeta;
|
|
10
|
+
/**
|
|
11
|
+
* NB-NOTIF-READ-01: unread notifications of the user across ALL pages — the
|
|
12
|
+
* backend's own count. When the envelope carries none, it falls back to the
|
|
13
|
+
* unread items of this page, which undercounts once there is a second page.
|
|
14
|
+
* Always set by the normalizer; optional so results built elsewhere still compile.
|
|
15
|
+
*/
|
|
16
|
+
unreadCount?: number;
|
|
6
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Normalize one notification from the wire (NB-NOTIF-READ-01).
|
|
20
|
+
*
|
|
21
|
+
* lena-management's `NotificationResponse` declares `boolean isRead`; Lombok
|
|
22
|
+
* names the getter `isRead()`, so Jackson writes the property as `read`. Every
|
|
23
|
+
* package reader goes through here so `isRead` is the one name a consumer sees.
|
|
24
|
+
* An item that already carries `isRead` (mocks, a consumer-normalized source)
|
|
25
|
+
* keeps it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function normalizeNotificationItem(raw: NotificationWireItem): NotificationRecord;
|
|
7
28
|
/**
|
|
8
29
|
* Normalize backend NotificationListResponse envelope to the FE-internal
|
|
9
30
|
* shape consumed by useNotificationList / NotificationPage.
|
|
@@ -11,7 +32,7 @@ export interface NotificationListResult {
|
|
|
11
32
|
* Backend `page` is 0-indexed; FE `meta.page` is 1-indexed (matches
|
|
12
33
|
* Pagination component contract used elsewhere).
|
|
13
34
|
*/
|
|
14
|
-
export declare function normalizeNotificationListResponse(response: ApiResponse<NotificationListEnvelope>, request: {
|
|
35
|
+
export declare function normalizeNotificationListResponse(response: ApiResponse<NotificationListEnvelope | NotificationWireListEnvelope>, request: {
|
|
15
36
|
page: number;
|
|
16
37
|
size: number;
|
|
17
38
|
}): NotificationListResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/api/normalizers/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/api/normalizers/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EACV,gBAAgB,EAChB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC7B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,oBAAoB,GAAG,kBAAkB,CASvF;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,WAAW,CAAC,wBAAwB,GAAG,4BAA4B,CAAC,EAC9E,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtC,sBAAsB,CAsBxB"}
|
|
@@ -13,13 +13,41 @@
|
|
|
13
13
|
* a specific value in one field resets the other to "every day"; an
|
|
14
14
|
* expression that still restricts both (typed into the expression box, or
|
|
15
15
|
* arriving as `value`) is flagged invalid instead of being silently rewritten.
|
|
16
|
+
*
|
|
17
|
+
* With `fields={6}` (Quartz) the builder is always exclusive and this prop is
|
|
18
|
+
* ignored.
|
|
16
19
|
*/
|
|
17
20
|
export type CronDayFieldSemantics = "or" | "exclusive";
|
|
21
|
+
/**
|
|
22
|
+
* Which cron dialect the builder edits (NB-CRONBUILDER-QUARTZ-01):
|
|
23
|
+
*
|
|
24
|
+
* - `5` — Unix cron `minute hour day-of-month month day-of-week`; day of week
|
|
25
|
+
* 0 (or 7) = Sunday … 6 = Saturday.
|
|
26
|
+
* - `6` — Quartz `second minute hour day-of-month month day-of-week`, the
|
|
27
|
+
* format management periodic jobs store. Day of week is 1 = Sunday …
|
|
28
|
+
* 7 = Saturday, so the builder writes it by name (`MON`, `MON-FRI`,
|
|
29
|
+
* `SAT,SUN` — a Unix digit would land one day early, FIX-763), and exactly
|
|
30
|
+
* one of the two day fields must be `?`. Quartz's optional seventh (year)
|
|
31
|
+
* field is not supported.
|
|
32
|
+
*/
|
|
33
|
+
export type CronFieldCount = 5 | 6;
|
|
18
34
|
export interface CronBuilderProps {
|
|
19
35
|
value: string;
|
|
20
36
|
onChange: (cron: string) => void;
|
|
21
|
-
/** @default "or" — see {@link CronDayFieldSemantics}. */
|
|
37
|
+
/** @default "or" — see {@link CronDayFieldSemantics}. Ignored when `fields` is 6. */
|
|
22
38
|
dayFieldSemantics?: CronDayFieldSemantics;
|
|
39
|
+
/**
|
|
40
|
+
* @default 5 — see {@link CronFieldCount}. `6` adds a Seconds picker, keeps
|
|
41
|
+
* exactly one day field `?` on every pick, and describes the seconds in the
|
|
42
|
+
* summary.
|
|
43
|
+
*/
|
|
44
|
+
fields?: CronFieldCount;
|
|
45
|
+
/**
|
|
46
|
+
* Called with the expression's validity on mount and whenever it changes
|
|
47
|
+
* (NB-CRONBUILDER-QUARTZ-01) — the same verdict {@link isValidCronExpression}
|
|
48
|
+
* gives, so a form can hold its submit while the builder shows the error.
|
|
49
|
+
*/
|
|
50
|
+
onValidityChange?: (valid: boolean) => void;
|
|
23
51
|
className?: string;
|
|
24
52
|
}
|
|
25
53
|
/**
|
|
@@ -30,5 +58,21 @@ export interface CronBuilderProps {
|
|
|
30
58
|
* shows. Anything that is not five fields returns `false`.
|
|
31
59
|
*/
|
|
32
60
|
export declare function hasCronDayOrSemantics(cron: string): boolean;
|
|
33
|
-
export
|
|
61
|
+
export interface CronValidityOptions {
|
|
62
|
+
/** @default 5 */
|
|
63
|
+
fields?: CronFieldCount;
|
|
64
|
+
/** @default "or" — ignored when `fields` is 6. */
|
|
65
|
+
dayFieldSemantics?: CronDayFieldSemantics;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* True when `cron` is an expression the builder accepts for the given dialect
|
|
69
|
+
* (NB-CRONBUILDER-QUARTZ-01) — exactly what it reports through
|
|
70
|
+
* `onValidityChange`. Exported so a submit guard or a list cell can agree with
|
|
71
|
+
* the builder without rendering it. The check is syntactic (field count,
|
|
72
|
+
* ranges, steps, names, Quartz's `?`/`L`/`W`/`#` forms and its one-`?` rule;
|
|
73
|
+
* letters in any case, as Quartz upper-cases the expression); it is not a
|
|
74
|
+
* scheduler — the server stays the authority.
|
|
75
|
+
*/
|
|
76
|
+
export declare function isValidCronExpression(cron: string, options?: CronValidityOptions): boolean;
|
|
77
|
+
export declare function CronBuilder({ value, onChange, dayFieldSemantics, fields, onValidityChange, className, }: CronBuilderProps): import("react").JSX.Element;
|
|
34
78
|
//# sourceMappingURL=CronBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CronBuilder.d.ts","sourceRoot":"","sources":["../../src/components/CronBuilder.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"CronBuilder.d.ts","sourceRoot":"","sources":["../../src/components/CronBuilder.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,GAAG,WAAW,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwCD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAI3D;AAgID,MAAM,WAAW,mBAAmB;IAClC,iBAAiB;IACjB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;CAC3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAG9F;AAoUD,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,iBAAwB,EACxB,MAAU,EACV,gBAAgB,EAChB,SAAS,GACV,EAAE,gBAAgB,+BA4PlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardWidgetGrid.d.ts","sourceRoot":"","sources":["../../src/components/DashboardWidgetGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DashboardWidgetGrid.d.ts","sourceRoot":"","sources":["../../src/components/DashboardWidgetGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgB9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0BD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,oBAAoB,+BAmInF;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,OAAW,EACX,SAAS,GACV,EAAE,wBAAwB,+BAS1B"}
|
|
@@ -1,5 +1,33 @@
|
|
|
1
|
+
import { NotificationSource } from '../hooks/useNotifications';
|
|
2
|
+
import { NotificationRecord } from '../types';
|
|
3
|
+
/** What a row shows for one notification (NB-NOTIF-BELL-01). */
|
|
4
|
+
export interface NotificationDisplay {
|
|
5
|
+
title: string;
|
|
6
|
+
body?: string;
|
|
7
|
+
/** Opened in-app (`navigateTo`) when the row is clicked; the row is marked read either way. */
|
|
8
|
+
href?: string;
|
|
9
|
+
}
|
|
1
10
|
export interface NotificationBellProps {
|
|
2
11
|
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* NB-NOTIF-BELL-01: builds the row text — e.g. a translated title from `type`
|
|
14
|
+
* and `data` — instead of the backend's free text. `sourceId` is
|
|
15
|
+
* `DEFAULT_NOTIFICATION_SOURCE_ID` for GET /api/notifications, else the id of
|
|
16
|
+
* one of `sources`. Without it a row shows `title` and `body` as sent.
|
|
17
|
+
*/
|
|
18
|
+
formatNotification?: (notification: NotificationRecord, sourceId: string) => NotificationDisplay;
|
|
19
|
+
/**
|
|
20
|
+
* NB-NOTIF-BELL-01: more notification sources (e.g. MDM's), merged with the
|
|
21
|
+
* built-in one: newest first, one unread count. A failing source keeps its
|
|
22
|
+
* last list and does not empty the others.
|
|
23
|
+
*/
|
|
24
|
+
sources?: NotificationSource[];
|
|
25
|
+
/**
|
|
26
|
+
* NB-NOTIF-BELL-01: target of "Tüm bildirimleri gör". Given, the link shows
|
|
27
|
+
* whenever there is a notification and opens the page in-app. Without it the
|
|
28
|
+
* button shows only past five notifications and goes nowhere, as before.
|
|
29
|
+
*/
|
|
30
|
+
viewAllHref?: string;
|
|
3
31
|
}
|
|
4
|
-
export declare function NotificationBell({ className }: NotificationBellProps): import("react").JSX.Element;
|
|
32
|
+
export declare function NotificationBell({ className, formatNotification, sources, viewAllHref }: NotificationBellProps): import("react").JSX.Element;
|
|
5
33
|
//# sourceMappingURL=NotificationBell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationBell.d.ts","sourceRoot":"","sources":["../../src/components/NotificationBell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NotificationBell.d.ts","sourceRoot":"","sources":["../../src/components/NotificationBell.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,gEAAgE;AAChE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+FAA+F;IAC/F,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,KAAK,mBAAmB,CAAC;IACjG;;;;OAIG;IACH,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAcD,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,qBAAqB,+BA8J9G"}
|
|
@@ -15,7 +15,33 @@ export interface ReadingHeatmapLabels {
|
|
|
15
15
|
/** Legend under the grid (default `detail_hero.calendar.legend.*`). */
|
|
16
16
|
legend?: Partial<Record<DayStatus, string>>;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* NB-HEATMAP-MONTH-01 — a calendar month. `month` is 1-12 (January = 1), the
|
|
20
|
+
* numbering of the backend's monthly endpoints (MDM `useReadingHeatmap(id, year, month)`).
|
|
21
|
+
*/
|
|
22
|
+
export interface ReadingHeatmapMonth {
|
|
23
|
+
year: number;
|
|
24
|
+
month: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* NB-HEATMAP-MONTH-01 — month navigation. Without `month` the calendar keeps its
|
|
28
|
+
* own month: it opens on the latest reading's month (and follows new `readings`
|
|
29
|
+
* until the user moves), and once an arrow is pressed it stays on the month the
|
|
30
|
+
* user chose — `readings` loaded for that month through `onMonthChange` do not
|
|
31
|
+
* move it again. With `month` it is controlled: it shows that month, and an
|
|
32
|
+
* arrow only reports the month asked for through `onMonthChange` — the consumer
|
|
33
|
+
* loads that month's `readings` and passes the new `month` back.
|
|
34
|
+
* `onMonthChange` fires in both modes. `minMonth` / `maxMonth` disable the
|
|
35
|
+
* arrow that would leave the range (`maxMonth` = this month → no future
|
|
36
|
+
* months). Invalid months are ignored.
|
|
37
|
+
*/
|
|
38
|
+
export interface ReadingHeatmapNavigation {
|
|
39
|
+
month?: ReadingHeatmapMonth;
|
|
40
|
+
onMonthChange?: (year: number, month: number) => void;
|
|
41
|
+
minMonth?: ReadingHeatmapMonth;
|
|
42
|
+
maxMonth?: ReadingHeatmapMonth;
|
|
43
|
+
}
|
|
44
|
+
interface ReadingHeatmapProps extends ReadingHeatmapNavigation {
|
|
19
45
|
readings: ReadingDay[];
|
|
20
46
|
/** Visual size — "comfortable" (~32px cells), "compact" (~22px). */
|
|
21
47
|
size?: "compact" | "comfortable" | "hero";
|
|
@@ -26,6 +52,6 @@ interface ReadingHeatmapProps {
|
|
|
26
52
|
/** LUG-HEATMAP-LABELS — overrides for this instance only (see `ReadingHeatmapLabels`). */
|
|
27
53
|
labels?: ReadingHeatmapLabels;
|
|
28
54
|
}
|
|
29
|
-
export declare function ReadingHeatmap({ readings, size, showDayNumbers, showHeader, labels, }: ReadingHeatmapProps): import("react").JSX.Element;
|
|
55
|
+
export declare function ReadingHeatmap({ readings, size, showDayNumbers, showHeader, labels, month, onMonthChange, minMonth, maxMonth, }: ReadingHeatmapProps): import("react").JSX.Element;
|
|
30
56
|
export {};
|
|
31
57
|
//# sourceMappingURL=ReadingHeatmap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadingHeatmap.d.ts","sourceRoot":"","sources":["../../../src/components/detail-layout/ReadingHeatmap.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5C,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7C;AAED,
|
|
1
|
+
{"version":3,"file":"ReadingHeatmap.d.ts","sourceRoot":"","sources":["../../../src/components/detail-layout/ReadingHeatmap.tsx"],"names":[],"mappings":"AAyBA,OAAO,K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1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ReadingHeatmapLabels } from './ReadingHeatmap';
|
|
2
|
+
import { ReadingHeatmapLabels, ReadingHeatmapNavigation } from './ReadingHeatmap';
|
|
3
3
|
import { DetailEntity, DetailPalette } from './types';
|
|
4
4
|
interface TriColumnSymmetricProps {
|
|
5
5
|
data: DetailEntity;
|
|
@@ -23,16 +23,22 @@ interface TriColumnSymmetricProps {
|
|
|
23
23
|
* `detail_hero.calendar.*` keys.
|
|
24
24
|
*/
|
|
25
25
|
calendarLabels?: ReadingHeatmapLabels;
|
|
26
|
+
/**
|
|
27
|
+
* NB-HEATMAP-MONTH-01 — month navigation of the calendar (controlled `month`, `onMonthChange`,
|
|
28
|
+
* `minMonth` / `maxMonth`), forwarded to `ReadingHeatmap`. Omitted → the calendar keeps its own month.
|
|
29
|
+
*/
|
|
30
|
+
calendarNavigation?: ReadingHeatmapNavigation;
|
|
26
31
|
}
|
|
27
|
-
export declare function TriColumnSymmetric({ data, palette, actionsSlot, activeOrdersTooltip, calendarLabels, }: TriColumnSymmetricProps): import("react").JSX.Element;
|
|
32
|
+
export declare function TriColumnSymmetric({ data, palette, actionsSlot, activeOrdersTooltip, calendarLabels, calendarNavigation, }: TriColumnSymmetricProps): import("react").JSX.Element;
|
|
28
33
|
/**
|
|
29
34
|
* FIX-407 — Hero pills collapsed from three (lifecycle + network + power)
|
|
30
|
-
* to two
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
35
|
+
* to two: fleet lifecycle (inventory state) and energy (consumer-driven
|
|
36
|
+
* power signal). Previous implementation hardcoded `tone="ok"` for
|
|
37
|
+
* lifecycle so FAULTY rendered as green; the Record maps make tone+label
|
|
38
|
+
* exhaustive over the union types.
|
|
39
|
+
* NB-DETAIL-NETWORK-01 (LDP-318, spec C487) brings the network pill back
|
|
40
|
+
* for MODEMS: the unit detail must show Online / Offline / Unknown, and the
|
|
41
|
+
* adapter already computed it. Meter headers stay lifecycle + disconnection.
|
|
36
42
|
*/
|
|
37
43
|
/** STORY-242 — expanded tone union (3 new: muted, info, amber). */
|
|
38
44
|
type PillTone = "ok" | "warn" | "crit" | "muted" | "info" | "amber";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriColumnSymmetric.d.ts","sourceRoot":"","sources":["../../../src/components/detail-layout/TriColumnSymmetric.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAY9C,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"TriColumnSymmetric.d.ts","sourceRoot":"","sources":["../../../src/components/detail-layout/TriColumnSymmetric.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAY9C,OAAO,EAAkB,KAAK,oBAAoB,EAAE,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAG5G,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAEhF,UAAU,uBAAuB;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;CAC/C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,WAAW,EACX,mBAAmB,EACnB,cAAc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E,kBAAkB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,UAAU,EAAE,CAAC;KAC5B,CAAC;IACF,6FAA6F;IAC7F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAoJD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,EAClB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,YAAY,
|
|
1
|
+
{"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../../src/components/detail-layout/adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EAGZ,UAAU,EAEX,MAAM,SAAS,CAAC;AAMjB;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAwBtE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAM9D;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAMnE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CASvF;AAMD,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,UAAU,EAAE,CAAC;KAC5B,CAAC;IACF,6FAA6F;IAC7F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAoJD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,EAClB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,YAAY,CAqDd;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,EAClB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,YAAY,CAmCd"}
|
|
@@ -48,6 +48,10 @@ interface DetailEntityBase {
|
|
|
48
48
|
lifecycleTone?: DetailLifecycleTone;
|
|
49
49
|
status: {
|
|
50
50
|
lifecycle: DetailLifecycle;
|
|
51
|
+
/**
|
|
52
|
+
* NB-DETAIL-NETWORK-01 — drawn as a header pill on MODEM entities only (`detail_status.network.*`:
|
|
53
|
+
* CONNECTED ok · DISCONNECTED crit · anything else UNKNOWN, muted). Meter headers do not show it.
|
|
54
|
+
*/
|
|
51
55
|
network: "CONNECTED" | "DISCONNECTED" | "UNKNOWN";
|
|
52
56
|
power?: "ON" | "OFF" | "UNKNOWN";
|
|
53
57
|
/**
|
|
@@ -105,6 +109,11 @@ export interface ModemDetailEntity extends DetailEntityBase {
|
|
|
105
109
|
orderSuitability?: ModemOrderSuitability | null;
|
|
106
110
|
/** NB-DETAIL-ORDERS-01 — per-priority split, listed in the same tooltip. */
|
|
107
111
|
activeOrdersByPriority?: ActiveOrdersByPriority | null;
|
|
112
|
+
/**
|
|
113
|
+
* NB-DETAIL-NETWORK-01 — the unit's last communication (ISO datetime), a "Last communication" row in the
|
|
114
|
+
* identity card. `undefined` → no row; `null` → "—". `modemRowToDetailEntity` always sets it.
|
|
115
|
+
*/
|
|
116
|
+
lastCommunicationAt?: string | null;
|
|
108
117
|
}
|
|
109
118
|
export interface MeterDetailEntity extends DetailEntityBase {
|
|
110
119
|
kind: "meter";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/detail-layout/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAMjF,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,CAAC;IAClB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC;CACvB;AAMD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ;AAMD;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,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
children: ReactNode;
|
|
31
31
|
onSubmit: () => void;
|
|
32
32
|
onCancel?: () => void;
|
|
33
|
+
/** Submit in flight: Submit shows its spinner and Cancel is disabled. */
|
|
33
34
|
isSubmitting?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Disables ONLY the Submit button (NB-FORMSHEET-SUBMIT-DISABLED-01) — for a
|
|
37
|
+
* form that must not be saved yet (a refused or still-validating field) while
|
|
38
|
+
* the user keeps editing. Unlike `isSubmitting` it shows no spinner and leaves
|
|
39
|
+
* Cancel alone; `onSubmit` is not called while it is `true`. Default `false`.
|
|
40
|
+
*/
|
|
41
|
+
submitDisabled?: boolean;
|
|
34
42
|
submitLabel?: string;
|
|
35
43
|
cancelLabel?: string;
|
|
36
44
|
/** Dock side. Default `"right"` — the only side MDM's call sites use. */
|
|
@@ -78,5 +86,5 @@ export interface FormSheetProps {
|
|
|
78
86
|
*/
|
|
79
87
|
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
80
88
|
}
|
|
81
|
-
export declare function FormSheet({ open, onOpenChange, title, description, children, onSubmit, onCancel, isSubmitting, submitLabel, cancelLabel, side, className, variant, headerGradient, surface, closeButtonProminent, closeOnBackdropClick, closeOnEscape, onInteractOutside, onEscapeKeyDown, }: FormSheetProps): import("react").JSX.Element;
|
|
89
|
+
export declare function FormSheet({ open, onOpenChange, title, description, children, onSubmit, onCancel, isSubmitting, submitDisabled, submitLabel, cancelLabel, side, className, variant, headerGradient, surface, closeButtonProminent, closeOnBackdropClick, closeOnEscape, onInteractOutside, onEscapeKeyDown, }: FormSheetProps): import("react").JSX.Element;
|
|
82
90
|
//# sourceMappingURL=FormSheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormSheet.d.ts","sourceRoot":"","sources":["../../../src/components/form-sheet/FormSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,IAAI,eAAe,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEt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AO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACjC,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACrE;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,cAAsB,EACtB,WAAW,EACX,WAAW,EACX,IAAc,EACd,SAAS,EACT,OAAmB,EACnB,cAAc,EACd,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,EAAE,cAAc,+BA4ChB"}
|
|
@@ -24,10 +24,10 @@ export { OrderDetailSheet } from './OrderDetailSheet';
|
|
|
24
24
|
export type { OrderDetailSheetProps } from './OrderDetailSheet';
|
|
25
25
|
export { MapView } from './MapView';
|
|
26
26
|
export type { MapViewProps } from './MapView';
|
|
27
|
-
export { CronBuilder, hasCronDayOrSemantics } from './CronBuilder';
|
|
28
|
-
export type { CronBuilderProps, CronDayFieldSemantics } from './CronBuilder';
|
|
27
|
+
export { CronBuilder, hasCronDayOrSemantics, isValidCronExpression } from './CronBuilder';
|
|
28
|
+
export type { CronBuilderProps, CronDayFieldSemantics, CronFieldCount, CronValidityOptions, } from './CronBuilder';
|
|
29
29
|
export { NotificationBell } from './NotificationBell';
|
|
30
|
-
export type { NotificationBellProps } from './NotificationBell';
|
|
30
|
+
export type { NotificationBellProps, NotificationDisplay } from './NotificationBell';
|
|
31
31
|
export { RealTimeStatusBar } from './RealTimeStatusBar';
|
|
32
32
|
export type { RealTimeStatusBarProps } from './RealTimeStatusBar';
|
|
33
33
|
export { DashboardWidgetGrid, DashboardWidget, useWidgetFullscreen } from './DashboardWidgetGrid';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;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B,CAAC;AACjE,YAAY,EACV,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,GACf,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,cAAc,GACf,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACnF,YAAY,EACV,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,cAAc,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { useSlug, parseSlug, buildSlug, getSlugFlag } from './useSlug';
|
|
|
5
5
|
export type { ParsedSlug } from './useSlug';
|
|
6
6
|
export { useSSE, setSSEDefaultMode } from './useSSE';
|
|
7
7
|
export type { SSEConnectionState, SSEOptions, SSEMode, SSEModeOption } from './useSSE';
|
|
8
|
-
export { useNotifications } from './useNotifications';
|
|
9
|
-
export type { UseNotificationsReturn } from './useNotifications';
|
|
8
|
+
export { useNotifications, DEFAULT_NOTIFICATION_SOURCE_ID } from './useNotifications';
|
|
9
|
+
export type { UseNotificationsReturn, UseNotificationsResult, UseNotificationsOptions, NotificationSource, NotificationEntry, } from './useNotifications';
|
|
10
10
|
export { useEnumValues, fetchEnumValues, enumValuesQueryOptions } from './useEnumValues';
|
|
11
11
|
export type { EnumOption, UseEnumValuesReturn } from './useEnumValues';
|
|
12
12
|
export { useOrderDetail } from './useOrderDetail';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACvE,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACtF,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzF,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { SSEConnectionState } from './useSSE';
|
|
2
|
+
/**
|
|
3
|
+
* NB-SSE-SHARED-01: one `EventSource` per logical stream, shared by every
|
|
4
|
+
* `useSSE` instance that subscribes to it.
|
|
5
|
+
*
|
|
6
|
+
* Browsers cap HTTP/1.1 connections at 6 per host for the WHOLE profile — not
|
|
7
|
+
* per tab. Every `useSSE` instance used to open its own `EventSource`, so two
|
|
8
|
+
* components on the same stream held two connections, and a few Lena tabs
|
|
9
|
+
* filled the cap until even static `remoteEntry.js` requests queued.
|
|
10
|
+
*
|
|
11
|
+
* - **In-tab (always):** subscribers with the same URL, the same
|
|
12
|
+
* authentication mode and the same identity scope share one connection,
|
|
13
|
+
* reference-counted — the last subscriber leaving closes it. Events are routed per subscriber by event
|
|
14
|
+
* name; the connection state (and the retry budget) is the stream's, so every
|
|
15
|
+
* subscriber sees the same state.
|
|
16
|
+
* - **Across tabs (`shareAcrossTabs`):** one tab holds a Web Lock and owns the
|
|
17
|
+
* connection (the leader); it relays events and state to the other tabs over
|
|
18
|
+
* a `BroadcastChannel`. When the leader's last subscriber leaves — or the tab
|
|
19
|
+
* closes — the lock is released and the next waiting tab takes over. Without
|
|
20
|
+
* Web Locks or `BroadcastChannel` the stream silently stays in-tab.
|
|
21
|
+
* - **Identity scope (KAUDIT X-F01):** the leader's connection carries ITS
|
|
22
|
+
* token or ticket, and the server filters what it sends by that identity. Two
|
|
23
|
+
* tabs of one origin can hold different sessions (the auth store does not
|
|
24
|
+
* re-hydrate from another tab's login), so tabs only share a stream when
|
|
25
|
+
* their scope (`shareScope`, else the signed-in user) is the same: the scope
|
|
26
|
+
* is part of the stream key and of the lock / channel names. Without a scope
|
|
27
|
+
* a stream is never shared across tabs.
|
|
28
|
+
*
|
|
29
|
+
* The connection is opened with the logical URL plus either the access token
|
|
30
|
+
* (`?token=`, URL-encoded) or whatever `resolveUrl` returns (NB-SSE-AUTH-01).
|
|
31
|
+
* `resolveUrl` runs before EVERY attempt, so a single-use ticket is fetched
|
|
32
|
+
* again after each drop.
|
|
33
|
+
*/
|
|
34
|
+
/** Delivery to one subscriber: the unparsed `data` string of each matching event, and every state change. */
|
|
35
|
+
export interface SSEStreamListener {
|
|
36
|
+
onEvent: (data: string) => void;
|
|
37
|
+
onState: (state: SSEConnectionState, error: Error | null) => void;
|
|
38
|
+
}
|
|
39
|
+
export interface SSEStreamRequest {
|
|
40
|
+
url: string;
|
|
41
|
+
/**
|
|
42
|
+
* Event names to receive; empty → unnamed events (the `onmessage` channel,
|
|
43
|
+
* which the EventSource spec names `"message"`).
|
|
44
|
+
*/
|
|
45
|
+
channels: readonly string[];
|
|
46
|
+
resolveUrl?: (url: string) => Promise<string>;
|
|
47
|
+
shareAcrossTabs?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Identity the connection is opened for (KAUDIT X-F01). Subscribers with
|
|
50
|
+
* different scopes never share a connection — in the tab or across tabs —
|
|
51
|
+
* and `null` (no identity known) never shares across tabs.
|
|
52
|
+
*/
|
|
53
|
+
scope?: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface SSEHubEnvironment {
|
|
56
|
+
/** Defaults to `globalThis.EventSource`, read at connect time. */
|
|
57
|
+
getEventSource?: () => typeof EventSource | undefined;
|
|
58
|
+
/** Defaults to `navigator.locks`; `undefined` → no cross-tab sharing. */
|
|
59
|
+
getLocks?: () => LockManager | undefined;
|
|
60
|
+
/** Defaults to `globalThis.BroadcastChannel`; `undefined` → no cross-tab sharing. */
|
|
61
|
+
getBroadcastChannel?: () => typeof BroadcastChannel | undefined;
|
|
62
|
+
/** Access token for token-mode streams. */
|
|
63
|
+
getToken: () => string | null;
|
|
64
|
+
tabId?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface SSEHub {
|
|
67
|
+
subscribe: (request: SSEStreamRequest, listener: SSEStreamListener) => () => void;
|
|
68
|
+
/** Test isolation: closes every stream without notifying subscribers. */
|
|
69
|
+
reset: () => void;
|
|
70
|
+
}
|
|
71
|
+
export declare function createSSEHub(env: SSEHubEnvironment): SSEHub;
|
|
72
|
+
//# sourceMappingURL=sseHub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sseHub.d.ts","sourceRoot":"","sources":["../../src/hooks/sseHub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,6GAA6G;AAC7G,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;CACnE;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAeD,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,OAAO,WAAW,GAAG,SAAS,CAAC;IACtD,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,WAAW,GAAG,SAAS,CAAC;IACzC,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,OAAO,gBAAgB,GAAG,SAAS,CAAC;IAChE,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqGD,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,iBAAiB,KAAK,MAAM,IAAI,CAAC;IAClF,yEAAyE;IACzE,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAgW3D"}
|
|
@@ -1,5 +1,46 @@
|
|
|
1
|
-
import { Notification } from '../types';
|
|
1
|
+
import { Notification, NotificationRecord } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Id of the built-in source — GET /api/notifications (lena-management). It is
|
|
4
|
+
* always part of the list; a consumer source must use another id.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_NOTIFICATION_SOURCE_ID = "default";
|
|
7
|
+
/**
|
|
8
|
+
* NB-NOTIF-BELL-01: one more place notifications come from (e.g. MDM's own
|
|
9
|
+
* notification API). Items must already be normalized — `isRead`, not `read`
|
|
10
|
+
* (`normalizeNotificationItem` does it for a lena-shaped item).
|
|
11
|
+
*/
|
|
12
|
+
export interface NotificationSource {
|
|
13
|
+
/** Unique among the sources; keys the rows and routes `markRead`. Not `"default"`. */
|
|
14
|
+
id: string;
|
|
15
|
+
list: () => Promise<NotificationRecord[]>;
|
|
16
|
+
markRead: (id: number) => Promise<void>;
|
|
17
|
+
/** This source's unread count — over everything it holds, not only what `list` returned. */
|
|
18
|
+
unreadCount: () => Promise<number>;
|
|
19
|
+
/**
|
|
20
|
+
* Marks everything of this source read. Without it, "mark all read" calls
|
|
21
|
+
* `markRead` for each unread item `list` returned, and the next poll brings
|
|
22
|
+
* back the count of any unread item beyond it.
|
|
23
|
+
*/
|
|
24
|
+
markAllRead?: () => Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
/** A notification together with the source it came from. */
|
|
27
|
+
export interface NotificationEntry {
|
|
28
|
+
/** `<sourceId>:<id>` — ids repeat across sources, keys do not. */
|
|
29
|
+
key: string;
|
|
30
|
+
sourceId: string;
|
|
31
|
+
notification: NotificationRecord;
|
|
32
|
+
}
|
|
33
|
+
export interface UseNotificationsOptions {
|
|
34
|
+
/** Extra sources, merged after the built-in one (newest first). */
|
|
35
|
+
sources?: NotificationSource[];
|
|
36
|
+
}
|
|
2
37
|
export interface UseNotificationsReturn {
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated The pre-backend shape this hook returned before 2.3.0, kept so
|
|
40
|
+
* existing readers compile: `message` is the backend's `body`, `read` its read
|
|
41
|
+
* state (the old fields were never filled). Read {@link UseNotificationsResult.items}.
|
|
42
|
+
* Removed in the next major.
|
|
43
|
+
*/
|
|
3
44
|
notifications: Notification[];
|
|
4
45
|
unreadCount: number;
|
|
5
46
|
isLoading: boolean;
|
|
@@ -7,5 +48,20 @@ export interface UseNotificationsReturn {
|
|
|
7
48
|
markAllRead: () => void;
|
|
8
49
|
refetch: () => void;
|
|
9
50
|
}
|
|
10
|
-
|
|
51
|
+
/**
|
|
52
|
+
* What `useNotifications` returns since 2.3.0: {@link UseNotificationsReturn} — kept
|
|
53
|
+
* as it was, so a consumer that builds one (a test double) still compiles — plus
|
|
54
|
+
* the normalized lists and the source-aware `markAsRead`.
|
|
55
|
+
*/
|
|
56
|
+
export interface UseNotificationsResult extends UseNotificationsReturn {
|
|
57
|
+
/** Every source's notifications, normalized; with extra sources, newest first. */
|
|
58
|
+
items: NotificationRecord[];
|
|
59
|
+
/** The same list with each item's source — use it once there is more than one source. */
|
|
60
|
+
entries: NotificationEntry[];
|
|
61
|
+
/** Unread count summed over the sources. */
|
|
62
|
+
unreadCount: number;
|
|
63
|
+
/** `sourceId` defaults to the built-in source. */
|
|
64
|
+
markAsRead: (id: number, sourceId?: string) => void;
|
|
65
|
+
}
|
|
66
|
+
export declare function useNotifications(options?: UseNotificationsOptions): UseNotificationsResult;
|
|
11
67
|
//# sourceMappingURL=useNotifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotifications.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotifications.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAsD,MAAM,UAAU,CAAC;AAIrH;;;GAGG;AACH,eAAO,MAAM,8BAA8B,YAAY,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,sFAAsF;IACtF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAC1C,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,4FAA4F;IAC5F,WAAW,EAAE,MAAM,OAAO,C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