@arsedizioni/ars-utils 18.2.245 → 18.2.250

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.
@@ -1,6 +1,7 @@
1
1
  import { SendToDialogResult } from '@arsedizioni/ars-utils/ui.application';
2
2
  import { LoginResult, NameValueItem } from '@arsedizioni/ars-utils/core';
3
3
  import { LoginOAuthType } from '@arsedizioni/ars-utils/ui.oauth';
4
+ import { Signal } from '@angular/core';
4
5
  export declare enum ClipperSelectionMode {
5
6
  Single = 1,
6
7
  Multi = 2,
@@ -492,23 +493,24 @@ export interface ClipperDashboardResult {
492
493
  documentUpdates?: number | null;
493
494
  }
494
495
  export declare class ClipperDashboard {
495
- items: ClipperDashboardItem[];
496
+ items: import("@angular/core").WritableSignal<ClipperDashboardItem[]>;
496
497
  isTrial?: boolean | null;
497
498
  expiredDeadlines?: number | null;
498
499
  expiringDeadlines?: number | null;
499
500
  documentUpdates?: number | null;
501
+ unreadItems: Signal<[ClipperModule, number][]>;
500
502
  /**
501
503
  * Update unread items
502
504
  * @param module : the module
503
505
  * @param increment : the increment (can be negative)
504
506
  */
505
507
  updateUnreadItems(module: ClipperModule, increment: number): void;
506
- /**
507
- * Get the unread items of a module
508
- * @param module : the module
509
- * @returns : the number of unread items
508
+ /***
509
+ * Get the module unread items
510
+ * @param module: the module
511
+ * @returns the module unread items
510
512
  */
511
- getUnreadItems(module: ClipperModule): number | null | undefined;
513
+ getUnreadItems(module: ClipperModule): number;
512
514
  }
513
515
  export declare class ClipperUtils {
514
516
  /**
@@ -19,7 +19,7 @@ export declare const ClipperMessages: {
19
19
  COMMAND_SEARCH_RESTORED: string;
20
20
  COMMAND_SEARCH_EXECUTED: string;
21
21
  COMMAND_HISTORY_OPEN: string;
22
- COMMAND_DASHBOARD_LOADED: string;
22
+ COMMAND_DASHBOARD_UPDATED: string;
23
23
  INTEROP_RS_NEW_LAW: string;
24
24
  INTEROP_RS_NEW_ACTIVITY: string;
25
25
  INTEROP_RS_USAGE_REPORT: string;
@@ -22,7 +22,7 @@ export declare class ClipperService implements OnDestroy {
22
22
  readonly loggingIn: import("@angular/core").WritableSignal<boolean>;
23
23
  readonly snapshot: import("@angular/core").WritableSignal<ClipperSearchResult>;
24
24
  readonly referencesSnapshot: import("@angular/core").WritableSignal<ClipperSearchResult>;
25
- readonly dashboard: import("@angular/core").WritableSignal<ClipperDashboard>;
25
+ readonly dashboard: ClipperDashboard;
26
26
  readonly bag: import("@angular/core").WritableSignal<ClipperDocumentInfo[]>;
27
27
  readonly bagTotal: Signal<number>;
28
28
  readonly visible: import("@angular/core").WritableSignal<boolean>;
@@ -160,11 +160,11 @@ export declare class ClipperService implements OnDestroy {
160
160
  */
161
161
  loadDashboard(): void;
162
162
  /**
163
- * Update unread items
164
- * @param module : the module
165
- * @param increment : the increment (can be negative)
166
- */
167
- updateDashboardUnreadItems(module: ClipperModule, increment: number): void;
163
+ * Update unread items
164
+ * @param module : the module
165
+ * @param increment : the increment (can be negative)
166
+ */
167
+ updateUnreadItems(module: ClipperModule, increment: number): void;
168
168
  /**
169
169
  * Save a user link
170
170
  * @param item: the user link
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Standard Broadcast Messages Manager
3
+ * https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
4
+ */
5
+ /**
6
+ * The message bag sent as a message
7
+ */
8
+ export interface BroadcastChannelMessageBag<T> {
9
+ messageId: string;
10
+ sender: string;
11
+ data?: T;
12
+ }
13
+ /**
14
+ * Message subscription params
15
+ */
16
+ export interface BroadcastChannelSubscriberInfo<T> {
17
+ messageId: string;
18
+ action: (bag: BroadcastChannelMessageBag<T>) => void;
19
+ }
20
+ /**
21
+ * Web Standard Broadcast Messages Manager
22
+ * https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
23
+ */
24
+ export declare class BroadcastChannelManager {
25
+ private channel?;
26
+ private subscriptions;
27
+ /**
28
+ * Get the current channel registration
29
+ */
30
+ get currentBus(): string | null | undefined;
31
+ constructor(bus: string);
32
+ dispose(): void;
33
+ /**
34
+ * Send a message
35
+ * @param bag The message, see also {@link BroadcastChannelMessageBag}
36
+ *
37
+ * @example
38
+ * channel.sendMessage({ messageId: 'my-broadcast-message', sender: 'the-sender', data: value });
39
+ */
40
+ sendMessage<T>(bag: BroadcastChannelMessageBag<T>): void;
41
+ /**
42
+ * Send a message
43
+ * @param bag The message, see also {@link BroadcastChannelMessageBag}
44
+ * @param delay The number of milliseconds to wait before sending the message, see also {@link setTimeout}
45
+ *
46
+ * @example
47
+ * channel.sendMessage({ messageId: 'my-broadcast-message', sender: 'the-sender', data: value }, 250);
48
+ */
49
+ sendMessage<T>(bag: BroadcastChannelMessageBag<T>, delay: number | null): void;
50
+ /**
51
+ * Send a message
52
+ * @param messageId The message id
53
+ * @param data The data to send
54
+ *
55
+ * @example
56
+ * channel.sendMessage('my-broadcast-message', value);
57
+ */
58
+ sendMessage<T>(messageId: string, data: T | null): void;
59
+ /**
60
+ * Send a message
61
+ * @param messageId The message id
62
+ * @param data The data to send
63
+ * @param delay The number of milliseconds to wait before sending the message
64
+ *
65
+ * @example
66
+ * channel.sendMessage('my-broadcast-message', value, 250);
67
+ */
68
+ sendMessage<T>(messageId: string, data: T | null, delay: number | null): void;
69
+ /**
70
+ * Subscribe to a message
71
+ * @param args The subscription info, see also {@link BroadcastChannelSubscriberInfo}
72
+ */
73
+ subscribe<T>(args: BroadcastChannelSubscriberInfo<T>): void;
74
+ /**
75
+ * Remove a message subscription
76
+ * @param messageId The message id
77
+ */
78
+ unsubscribe(messageId: string): void;
79
+ /**
80
+ * Remove all the current subscriptions
81
+ */
82
+ unsubscribeAll(): void;
83
+ }
@@ -1,15 +1,40 @@
1
- import { Signal } from "@angular/core";
1
+ import { OnDestroy, Signal } from "@angular/core";
2
2
  import * as i0 from "@angular/core";
3
- export declare class ThemeService {
3
+ export declare class ThemeService implements OnDestroy {
4
+ private readonly broadcastChannel;
5
+ private readonly broadcastMessage;
6
+ private readonly prefersColorSchemeMediaQueryList;
4
7
  private renderFactory2;
5
8
  private renderer;
6
- readonly theme: import("@angular/core").WritableSignal<"dark" | "light">;
9
+ /**
10
+ * Current theme
11
+ */
12
+ private readonly theme;
13
+ /**
14
+ * The current theme is "System default"
15
+ */
16
+ private readonly auto;
17
+ /**
18
+ * Configuration schema about the icon, the text and the toggle() sequence
19
+ */
20
+ private readonly themeInfo;
21
+ /**
22
+ * Icon of the current theme (mat-icon code)
23
+ */
7
24
  readonly themeIcon: Signal<string>;
25
+ /**
26
+ * Current theme name
27
+ */
8
28
  readonly themeName: Signal<string>;
29
+ /**
30
+ * Tooltip text on toggle
31
+ */
32
+ readonly toggleTooltip: Signal<string>;
9
33
  constructor();
34
+ ngOnDestroy(): void;
10
35
  /**
11
36
  * Set the new theme
12
- * @param theme : the theme
37
+ * @param theme the new theme
13
38
  */
14
39
  private setTheme;
15
40
  /**