@arsedizioni/ars-utils 22.6.90 → 22.6.92

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arsedizioni/ars-utils",
3
- "version": "22.6.90",
3
+ "version": "22.6.92",
4
4
  "author": {
5
5
  "email": "software@arsedizioni.it",
6
6
  "name": "Fabio Buscaroli, Alberto Doria"
@@ -585,6 +585,17 @@ export interface ClipperDocumentUpdateStateParams {
585
585
  documentIds: string[];
586
586
  isRead: boolean;
587
587
  }
588
+ /**
589
+ * What a read-state update did on the server, document by document.
590
+ */
591
+ export interface ClipperDocumentUpdateStateResult {
592
+ /** The documents that changed state and were written. */
593
+ updated: string[];
594
+ /** The documents older than the unread window, whose state is not kept. */
595
+ expired: string[];
596
+ /** How many documents changed state. */
597
+ count: number;
598
+ }
588
599
  export interface ClipperDashboardModelItem {
589
600
  id?: ClipperModel;
590
601
  newItems: number;
@@ -839,9 +850,10 @@ export declare class ClipperDocumentsService {
839
850
  /**
840
851
  * Updates the state of one or more documents.
841
852
  * @param params - The document state update parameters.
842
- * @returns An observable emitting the API result wrapping the number of updated documents.
853
+ * @returns An observable emitting the API result telling which documents changed state and which
854
+ * were too old to.
843
855
  */
844
- updateState(params: ClipperDocumentUpdateStateParams): import("rxjs").Observable<ApiResult<number>>;
856
+ updateState(params: ClipperDocumentUpdateStateParams): import("rxjs").Observable<ApiResult<ClipperDocumentUpdateStateResult>>;
845
857
  /**
846
858
  * Exports a single document in PDF format.
847
859
  * @param id - The ID of the document to export.
@@ -453,11 +453,23 @@ export declare class ClipperSearchResultManager extends ClipperDocumentManager {
453
453
  toggleSelection(item: ClipperDocumentInfo, e?: Event): void;
454
454
  /**
455
455
  * Sets the read state on the given item or on all currently selected items.
456
- * Broadcasts a read-state-changed event and updates the unread counter.
456
+ *
457
+ * Only the documents the server reports as written change on screen and in the counters: a
458
+ * document older than the unread window keeps no state, and one already in the state asked for
459
+ * has nothing to count. Touching either would leave the counters out of step with the server.
457
460
  * @param value - The new read flag value.
458
461
  * @param item - When provided, only this item is updated; otherwise the full selection is used.
462
+ * @param silent - When `true`, suppresses the "too old" notice.
463
+ */
464
+ setRead(value: boolean, item?: ClipperDocumentInfo, silent?: boolean): void;
465
+ /**
466
+ * Words the notice for the documents a read-state update left alone because they are older than
467
+ * the unread window: a single document, the whole selection, or a part of it.
468
+ * @param expired - How many documents were too old.
469
+ * @param total - How many documents the update was asked for.
470
+ * @returns The message to show.
459
471
  */
460
- setRead(value: boolean, item?: ClipperDocumentInfo): void;
472
+ private getExpiredReadStateMessage;
461
473
  /**
462
474
  * Opens a document by ID, either inline or in a new browser tab.
463
475
  * @param documentId - The ID of the document to open.
@@ -956,7 +968,7 @@ export declare class ClipperBrowserDialogComponent {
956
968
  static ɵfac: i0.ɵɵFactoryDeclaration<ClipperBrowserDialogComponent, never>;
957
969
  static ɵcmp: i0.ɵɵComponentDeclaration<ClipperBrowserDialogComponent, "ng-component", never, {}, {}, never, never, true, never>;
958
970
  }
959
- export interface ClipperDocumentDialogData {
971
+ interface ClipperDocumentDialogData {
960
972
  selectionMode?: ClipperSelectionMode;
961
973
  selectableModules?: ClipperModule[];
962
974
  id: string;
@@ -965,7 +977,7 @@ export interface ClipperDocumentDialogData {
965
977
  theme?: ThemeType;
966
978
  canHandleTooManyResults?: boolean;
967
979
  }
968
- export declare class ClipperDocumentComponent extends ClipperDocumentManager {
980
+ declare class ClipperDocumentComponent extends ClipperDocumentManager {
969
981
  readonly relevantsPane: import("@angular/core").Signal<MatDrawer>;
970
982
  /** Reference to the document iframe element, used to drive navigation imperatively. */
971
983
  private readonly iframeRef;
@@ -1373,7 +1385,7 @@ export declare class ClipperDocumentMenuComponent {
1373
1385
  };
1374
1386
  }, {}, never, never, true, never>;
1375
1387
  }
1376
- export interface ClipperReferencesDialogData {
1388
+ interface ClipperReferencesDialogData {
1377
1389
  mode?: ClipperQueryReferencesMode;
1378
1390
  anchor?: string;
1379
1391
  anchorTitle?: string;
@@ -1381,10 +1393,10 @@ export interface ClipperReferencesDialogData {
1381
1393
  model: number;
1382
1394
  canHandleTooManyResults?: boolean;
1383
1395
  }
1384
- export interface ClipperReferenceDialogResult {
1396
+ interface ClipperReferenceDialogResult {
1385
1397
  documentId: string;
1386
1398
  }
1387
- export declare class ClipperReferencesComponent extends ClipperSearchResultManager {
1399
+ declare class ClipperReferencesComponent extends ClipperSearchResultManager {
1388
1400
  readonly filterPane: import("@angular/core").Signal<MatDrawer>;
1389
1401
  private readonly dialogRef;
1390
1402
  protected readonly dialogData: ClipperReferencesDialogData;
@@ -1643,4 +1655,5 @@ export declare class ClipperSearchResultItemComponent {
1643
1655
  }, {
1644
1656
  "item": "itemChange";
1645
1657
  }, never, never, true, never>;
1646
- }
1658
+ }
1659
+ export type { ClipperDocumentDialogData, ClipperReferenceDialogResult, ClipperReferencesDialogData };