@arsedizioni/ars-utils 22.5.11 → 22.5.12

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.5.11",
3
+ "version": "22.5.12",
4
4
  "author": {
5
5
  "email": "software@arsedizioni.it",
6
6
  "name": "Fabio Buscaroli, Alberto Doria"
@@ -1,12 +1,12 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { DestroyRef, ChangeDetectorRef, Injector } from '@angular/core';
2
+ import { DestroyRef, ChangeDetectorRef } from '@angular/core';
3
3
  import { ScrollDispatcher } from '@angular/cdk/scrolling';
4
4
  import { MatExpansionPanel } from '@angular/material/expansion';
5
5
  import { MatInput } from '@angular/material/input';
6
6
  import { MatPaginator, PageEvent } from '@angular/material/paginator';
7
7
  import { MatDrawer } from '@angular/material/sidenav';
8
8
  import { ClipperSearchFacetsSnapshot, ClipperSearchFacet, ClipperSearchFacetGroup, ClipperService, ClipperDocumentInfo, ClipperSearchParams, ClipperQueryReferencesMode, ClipperModule, ClipperModel, ClipperSearchCalendarSnapshotMonth, ClipperSearchCalendarSnapshotResult, ClipperSelectionMode, ClipperSearchResult, ClipperSort, ClipperUserSearch, SectorInfo, ClipperUserInfo, ClipperDocumentRelevants, ClipperDocumentAnchorInfo } from '@arsedizioni/ars-utils/clipper.common';
9
- import { BroadcastService, DateInterval, ThemeService, ScreenService, SelectableModel, NameValueItem, INode, ThemeType } from '@arsedizioni/ars-utils/core';
9
+ import { BroadcastService, DateInterval, ThemeType, ThemeService, ScreenService, SelectableModel, NameValueItem, INode } from '@arsedizioni/ars-utils/core';
10
10
  import { CalendarEmptyHeader, ButtonSelectorComponent, ChipsSelectorComponent } from '@arsedizioni/ars-utils/ui.controls';
11
11
  import { BreakpointObserver } from '@angular/cdk/layout';
12
12
  import { Clipboard } from '@angular/cdk/clipboard';
@@ -257,6 +257,49 @@ declare class ClipperSearchCalendarComponent {
257
257
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClipperSearchCalendarComponent, "clipper-search-calendar", never, { "canFilter": { "alias": "canFilter"; "required": false; "isSignal": true; }; }, { "changed": "changed"; }, never, never, true, never>;
258
258
  }
259
259
 
260
+ /**
261
+ * Opens the Clipper document viewer.
262
+ *
263
+ * It used to be a static method taking an `Injector` and resolving its dependencies through
264
+ * `runInInjectionContext`. That is the escape hatch for code that cannot do DI, and both callers
265
+ * here are components — they were injecting an `Injector` for the sole purpose of handing it over.
266
+ * As a service the dependencies are resolved at field level, which also removes a trap: the
267
+ * asynchronous continuation after the dynamic `import()` is outside the injection context, so an
268
+ * `inject()` added in there would have failed at runtime.
269
+ */
270
+ declare class ClipperDocumentUtilsService {
271
+ private readonly dialogService;
272
+ private readonly clipperService;
273
+ /**
274
+ * Opens the Clipper document viewer dialog for the given document.
275
+ * @param documentId - The ID of the document to open.
276
+ * @param query - The search query string used for term highlighting.
277
+ * @param queryChunks - Pipe-separated highlight chunks (e.g. "|1|2|3...").
278
+ * @param selectionMode - The Clipper selection mode to activate inside the viewer.
279
+ * @param selectableModules - The list of Clipper modules available for selection.
280
+ * @param theme - The UI theme to apply. Defaults to the system theme.
281
+ * @param canHandleTooManyResults - When `true`, the component handles oversized result sets.
282
+ * @param replaceUrl - When provided, after the dialog closes the method calls `window.close()`
283
+ * if the page was opened by another window, or navigates to this URL otherwise.
284
+ * @returns void
285
+ */
286
+ openDocument(documentId: string, query?: string, queryChunks?: string, selectionMode?: ClipperSelectionMode, selectableModules?: ClipperModule[], theme?: ThemeType, canHandleTooManyResults?: boolean, replaceUrl?: string): void;
287
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ClipperDocumentUtilsService, never>;
288
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ClipperDocumentUtilsService>;
289
+ }
290
+ /**
291
+ * Pure helpers on document data. Deliberately NOT a service: there is nothing to inject, and a
292
+ * string function that needs an injector to be called is a function nobody can call from a test.
293
+ */
294
+ declare class ClipperDocumentsUtils {
295
+ /**
296
+ * Extracts the display title from a full document title by stripping any trailing `[...]` suffix.
297
+ * @param title - The full document title, which may contain a bracketed qualifier.
298
+ * @returns The portion of the title before the first `[`, or the original title when no `[` is present.
299
+ */
300
+ static parseDocumentTitle(title: string): string;
301
+ }
302
+
260
303
  declare class ClipperSearchResultManager extends ClipperDocumentManager {
261
304
  readonly paginator: _angular_core.Signal<MatPaginator>;
262
305
  readonly facets: _angular_core.Signal<ClipperSearchFacetsComponent>;
@@ -264,7 +307,7 @@ declare class ClipperSearchResultManager extends ClipperDocumentManager {
264
307
  protected readonly destroyRef: DestroyRef;
265
308
  protected readonly changeDetector: ChangeDetectorRef;
266
309
  protected readonly breakpointObserver: BreakpointObserver;
267
- protected readonly injector: Injector;
310
+ protected readonly documentUtils: ClipperDocumentUtilsService;
268
311
  protected readonly themeService: ThemeService;
269
312
  readonly screenService: ScreenService;
270
313
  selection: SelectableModel<ClipperDocumentInfo, string> | undefined;
@@ -748,7 +791,7 @@ declare class ClipperDocumentComponent extends ClipperDocumentManager {
748
791
  readonly closing: _angular_core.OutputEmitterRef<void>;
749
792
  readonly opening: _angular_core.OutputEmitterRef<string>;
750
793
  private readonly destroyRef;
751
- private readonly injector;
794
+ private readonly documentUtils;
752
795
  private readonly breakpointObserver;
753
796
  private readonly renderer;
754
797
  private rendererListener1;
@@ -902,7 +945,7 @@ declare class ClipperDocumentComponent extends ClipperDocumentManager {
902
945
  */
903
946
  open(documentId: string, query?: string, queryChunks?: string, newWindow?: boolean): void;
904
947
  /**
905
- * Opens a document inline via the {@link ClipperDocumentsUtils} helper.
948
+ * Opens a document inline via the {@link ClipperDocumentUtilsService}.
906
949
  * @param documentId - The id of the document to open.
907
950
  * @param query - Optional free-text query for highlight.
908
951
  * @param queryChunks - Optional chunk offsets for semantic highlight.
@@ -1254,28 +1297,5 @@ declare class ClipperSearchResultItemComponent {
1254
1297
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ClipperSearchResultItemComponent, "clipper-search-result-item", never, { "parent": { "alias": "parent"; "required": true; "isSignal": true; }; "item": { "alias": "item"; "required": true; "isSignal": true; }; "actions": { "alias": "actions"; "required": true; "isSignal": true; }; "tileNoPictureUrl": { "alias": "tileNoPictureUrl"; "required": false; "isSignal": true; }; "tilePictureUrl": { "alias": "tilePictureUrl"; "required": false; "isSignal": true; }; "isSelectable": { "alias": "isSelectable"; "required": false; "isSignal": true; }; "isReadable": { "alias": "isReadable"; "required": false; "isSignal": true; }; "isReadableModel": { "alias": "isReadableModel"; "required": false; "isSignal": true; }; "displayModifiedTitle": { "alias": "displayModifiedTitle"; "required": false; "isSignal": true; }; "displayModelName": { "alias": "displayModelName"; "required": false; "isSignal": true; }; "displayDate": { "alias": "displayDate"; "required": false; "isSignal": true; }; "displayMode": { "alias": "displayMode"; "required": false; "isSignal": true; }; }, { "item": "itemChange"; }, never, never, true, never>;
1255
1298
  }
1256
1299
 
1257
- declare class ClipperDocumentsUtils {
1258
- /**
1259
- * Opens the Clipper document viewer dialog for the given document.
1260
- * @param injector - The Angular injector used to resolve `DialogService` and `ClipperService`.
1261
- * @param documentId - The ID of the document to open.
1262
- * @param query - The search query string used for term highlighting.
1263
- * @param queryChunks - Pipe-separated highlight chunks (e.g. "|1|2|3...").
1264
- * @param selectionMode - The Clipper selection mode to activate inside the viewer.
1265
- * @param selectableModules - The list of Clipper modules available for selection.
1266
- * @param theme - The UI theme to apply. Defaults to the system theme.
1267
- * @param canHandleTooManyResults - When `true`, the component handles oversized result sets.
1268
- * @param replaceUrl - When provided, after the dialog closes the method calls `window.close()`
1269
- * if the page was opened by another window, or navigates to this URL otherwise.
1270
- */
1271
- static openDocument(injector: Injector, documentId: string, query?: string, queryChunks?: string, selectionMode?: ClipperSelectionMode, selectableModules?: ClipperModule[], theme?: ThemeType, canHandleTooManyResults?: boolean, replaceUrl?: string): void;
1272
- /**
1273
- * Extracts the display title from a full document title by stripping any trailing `[...]` suffix.
1274
- * @param title - The full document title, which may contain a bracketed qualifier.
1275
- * @returns The portion of the title before the first `[`, or the original title when no `[` is present.
1276
- */
1277
- static parseDocumentTitle(title: string): string;
1278
- }
1279
-
1280
- export { ClipperBrowserComponent, ClipperBrowserDialogComponent, ClipperDocumentComponent, ClipperDocumentIndexComponent, ClipperDocumentManager, ClipperDocumentMenuComponent, ClipperDocumentsUtils, ClipperReferencesComponent, ClipperSearchCalendarComponent, ClipperSearchFacetsComponent, ClipperSearchFreeTextHelpComponent, ClipperSearchFreeTextQueryBuilderComponent, ClipperSearchResultItemComponent, ClipperSearchResultItemDisplayMode, ClipperSearchResultManager };
1300
+ export { ClipperBrowserComponent, ClipperBrowserDialogComponent, ClipperDocumentComponent, ClipperDocumentIndexComponent, ClipperDocumentManager, ClipperDocumentMenuComponent, ClipperDocumentUtilsService, ClipperDocumentsUtils, ClipperReferencesComponent, ClipperSearchCalendarComponent, ClipperSearchFacetsComponent, ClipperSearchFreeTextHelpComponent, ClipperSearchFreeTextQueryBuilderComponent, ClipperSearchResultItemComponent, ClipperSearchResultItemDisplayMode, ClipperSearchResultManager };
1281
1301
  export type { ClipperBrowserDialogData, ClipperDocumentDialogData, ClipperDocumentIndexDialogData, ClipperDocumentIndexDialogResult, ClipperReferenceDialogResult, ClipperReferencesDialogData, SearchFreeTextQueryParams };