@myrmidon/cadmus-state 16.0.1 → 20.0.2

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,425 +1,416 @@
1
- import { FacetDefinition, FlagDefinition, Thesaurus, FragmentIdentity, EditedObject, Fragment, Part, ComponentCanDeactivate, TokenLocation, LibraryRouteService, PartIdentity, TextLayerPart, LayerHint, ThesauriSet } from '@myrmidon/cadmus-core';
2
- import { Observable } from 'rxjs';
3
- import { FacetService, FlagService, ThesaurusService, PreviewService, EditorSettingsService, ItemService } from '@myrmidon/cadmus-api';
4
- import * as i0 from '@angular/core';
5
- import { OnInit, OnDestroy } from '@angular/core';
6
- import { Router, ActivatedRoute } from '@angular/router';
7
- import { MatSnackBar } from '@angular/material/snack-bar';
8
-
1
+ import { ComponentCanDeactivate, EditedObject, FacetDefinition, FlagDefinition, Fragment, FragmentIdentity, LayerHint, LibraryRouteService, Part, PartIdentity, TextLayerPart, ThesauriSet, Thesaurus, TokenLocation } from "@myrmidon/cadmus-core";
2
+ import { Observable } from "rxjs";
3
+ import { EditorSettingsService, FacetService, FlagService, ItemService, PreviewService, ThesaurusService } from "@myrmidon/cadmus-api";
4
+ import * as i0 from "@angular/core";
5
+ import { OnDestroy, OnInit } from "@angular/core";
6
+ import { ActivatedRoute, Router } from "@angular/router";
7
+ import { MatSnackBar } from "@angular/material/snack-bar";
9
8
  /**
10
9
  * App state repository.
11
10
  */
12
- declare class AppRepository {
13
- private _facetService;
14
- private _flagService;
15
- private _thesaurusService;
16
- private _previewService;
17
- private _settingService;
18
- private readonly _facets$;
19
- private readonly _flags$;
20
- private readonly _typeThesaurus$;
21
- private readonly _itemBrowserThesaurus$;
22
- private readonly _previewJKeys$;
23
- private readonly _previewFKeys$;
24
- private readonly _previewCKeys$;
25
- private readonly _settingsCache;
26
- get facets$(): Observable<FacetDefinition[]>;
27
- get flags$(): Observable<FlagDefinition[]>;
28
- get typeThesaurus$(): Observable<Thesaurus | undefined>;
29
- get itemBrowserThesaurus$(): Observable<Thesaurus | undefined>;
30
- get previewJKeys$(): Observable<string[]>;
31
- get previewFKeys$(): Observable<string[]>;
32
- get previewCKeys$(): Observable<string[]>;
33
- constructor(_facetService: FacetService, _flagService: FlagService, _thesaurusService: ThesaurusService, _previewService: PreviewService, _settingService: EditorSettingsService);
34
- /**
35
- * Get the loaded model types thesaurus.
36
- * @returns Thesaurus or undefined if not loaded.
37
- */
38
- getTypeThesaurus(): Thesaurus | undefined;
39
- /**
40
- * Get the loaded items facets.
41
- * @returns The facets.
42
- */
43
- getFacets(): FacetDefinition[];
44
- /**
45
- * Get the loaded items flags.
46
- * @returns The flags.
47
- */
48
- getFlags(): FlagDefinition[];
49
- /**
50
- * Load app data from the API. If the data is already loaded, this
51
- * does nothing unless refresh is true.
52
- *
53
- * @param refresh True to force a refresh.
54
- * @returns Promise.
55
- */
56
- load(refresh?: boolean): Promise<void>;
57
- /**
58
- * Clear the repository.
59
- */
60
- clear(): void;
61
- /**
62
- * Load the model types and item browsers thesauri.
63
- */
64
- loadThesauri(): Promise<void>;
65
- /**
66
- * Get the color defined for the specified part type ID, reading it
67
- * from the facets definitions.
68
- * @param typeId The part type ID.
69
- * @param roleId The optional role type ID.
70
- * @returns The color key, or undefined if not found.
71
- */
72
- getPartColor(typeId: string, roleId?: string): string | undefined;
73
- /**
74
- * Load the flags definitions.
75
- */
76
- loadFlags(): Promise<void>;
77
- /**
78
- * Get the editor setting with the specified ID.
79
- * @param id The setting ID.
80
- * @param reload True to force reloading from server.
81
- * @returns Promise with the settings object.
82
- */
83
- getSetting<T>(id: string, reload?: boolean): Promise<T | undefined>;
84
- /**
85
- * Set the editor setting with the specified ID.
86
- * @param id The setting ID.
87
- * @param setting The setting to store.
88
- */
89
- setSetting<T>(id: string, setting: T): void;
90
- /**
91
- * Get the editor setting for the specified part or fragment type ID,
92
- * optionally having the specified role ID.
93
- * @param typeId The part or fragment type ID.
94
- * @param roleId The optional role ID.
95
- * @param reload True to force reloading from server.
96
- * @returns Promise with settings object.
97
- */
98
- getSettingFor<T>(typeId: string, roleId?: string, reload?: boolean): Promise<T | undefined>;
99
- /**
100
- * Set the editor setting for the specified part or fragment type ID,
101
- * optionally having the specified role ID.
102
- * @param typeId The part or fragment type ID.
103
- * @param setting The setting to store.
104
- * @param roleId The optional role ID.
105
- */
106
- setSettingFor<T>(typeId: string, setting: T, roleId?: string): void;
107
- static ɵfac: i0.ɵɵFactoryDeclaration<AppRepository, never>;
108
- static ɵprov: i0.ɵɵInjectableDeclaration<AppRepository>;
11
+ export declare class AppRepository {
12
+ private _facetService;
13
+ private _flagService;
14
+ private _thesaurusService;
15
+ private _previewService;
16
+ private _settingService;
17
+ private readonly _facets$;
18
+ private readonly _flags$;
19
+ private readonly _typeThesaurus$;
20
+ private readonly _itemBrowserThesaurus$;
21
+ private readonly _previewJKeys$;
22
+ private readonly _previewFKeys$;
23
+ private readonly _previewCKeys$;
24
+ private readonly _settingsCache;
25
+ get facets$(): Observable<FacetDefinition[]>;
26
+ get flags$(): Observable<FlagDefinition[]>;
27
+ get typeThesaurus$(): Observable<Thesaurus | undefined>;
28
+ get itemBrowserThesaurus$(): Observable<Thesaurus | undefined>;
29
+ get previewJKeys$(): Observable<string[]>;
30
+ get previewFKeys$(): Observable<string[]>;
31
+ get previewCKeys$(): Observable<string[]>;
32
+ constructor(_facetService: FacetService, _flagService: FlagService, _thesaurusService: ThesaurusService, _previewService: PreviewService, _settingService: EditorSettingsService);
33
+ /**
34
+ * Get the loaded model types thesaurus.
35
+ * @returns Thesaurus or undefined if not loaded.
36
+ */
37
+ getTypeThesaurus(): Thesaurus | undefined;
38
+ /**
39
+ * Get the loaded items facets.
40
+ * @returns The facets.
41
+ */
42
+ getFacets(): FacetDefinition[];
43
+ /**
44
+ * Get the loaded items flags.
45
+ * @returns The flags.
46
+ */
47
+ getFlags(): FlagDefinition[];
48
+ /**
49
+ * Load app data from the API. If the data is already loaded, this
50
+ * does nothing unless refresh is true.
51
+ *
52
+ * @param refresh True to force a refresh.
53
+ * @returns Promise.
54
+ */
55
+ load(refresh?: boolean): Promise<void>;
56
+ /**
57
+ * Clear the repository.
58
+ */
59
+ clear(): void;
60
+ /**
61
+ * Load the model types and item browsers thesauri.
62
+ */
63
+ loadThesauri(): Promise<void>;
64
+ /**
65
+ * Get the color defined for the specified part type ID, reading it
66
+ * from the facets definitions.
67
+ * @param typeId The part type ID.
68
+ * @param roleId The optional role type ID.
69
+ * @returns The color key, or undefined if not found.
70
+ */
71
+ getPartColor(typeId: string, roleId?: string): string | undefined;
72
+ /**
73
+ * Load the flags definitions.
74
+ */
75
+ loadFlags(): Promise<void>;
76
+ /**
77
+ * Get the editor setting with the specified ID.
78
+ * @param id The setting ID.
79
+ * @param reload True to force reloading from server.
80
+ * @returns Promise with the settings object.
81
+ */
82
+ getSetting<T>(id: string, reload?: boolean): Promise<T | undefined>;
83
+ /**
84
+ * Set the editor setting with the specified ID.
85
+ * @param id The setting ID.
86
+ * @param setting The setting to store.
87
+ */
88
+ setSetting<T>(id: string, setting: T): void;
89
+ /**
90
+ * Get the editor setting for the specified part or fragment type ID,
91
+ * optionally having the specified role ID.
92
+ * @param typeId The part or fragment type ID.
93
+ * @param roleId The optional role ID.
94
+ * @param reload True to force reloading from server.
95
+ * @returns Promise with settings object.
96
+ */
97
+ getSettingFor<T>(typeId: string, roleId?: string, reload?: boolean): Promise<T | undefined>;
98
+ /**
99
+ * Set the editor setting for the specified part or fragment type ID,
100
+ * optionally having the specified role ID.
101
+ * @param typeId The part or fragment type ID.
102
+ * @param setting The setting to store.
103
+ * @param roleId The optional role ID.
104
+ */
105
+ setSettingFor<T>(typeId: string, setting: T, roleId?: string): void;
106
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppRepository, never>;
107
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
109
108
  }
110
-
111
109
  /**
112
110
  * Service used by layer part editor wrappers to load part and thesauri
113
111
  * or save parts.
114
112
  */
115
- declare class FragmentEditorService {
116
- private _itemService;
117
- private _thesaurusService;
118
- private _loading$;
119
- private _saving$;
120
- loading$: Observable<boolean>;
121
- saving$: Observable<boolean>;
122
- constructor(_itemService: ItemService, _thesaurusService: ThesaurusService);
123
- private getFragmentFromPart;
124
- private loadWithThesauri;
125
- private loadWithoutThesauri;
126
- /**
127
- * Load into the state the part with the specified ID
128
- * and its thesauri.
129
- * If the ID is not specified, it's a new part; in this case,
130
- * it will get a null ID, but use the specified itemId and roleId.
131
- *
132
- * @param identity The part identity.
133
- * @param thesauriIds The thesauri IDs array.
134
- */
135
- load(identity: FragmentIdentity, thesauriIds?: string[]): Promise<EditedObject<Fragment> | null>;
136
- /**
137
- * Save the fragments in their layer part.
138
- *
139
- * @param part The part.
140
- * @returns Promise which when successful returns the saved part.
141
- */
142
- save(part: Part): Promise<Part>;
143
- static ɵfac: i0.ɵɵFactoryDeclaration<FragmentEditorService, never>;
144
- static ɵprov: i0.ɵɵInjectableDeclaration<FragmentEditorService>;
113
+ export declare class FragmentEditorService {
114
+ private _itemService;
115
+ private _thesaurusService;
116
+ private _loading$;
117
+ private _saving$;
118
+ loading$: Observable<boolean>;
119
+ saving$: Observable<boolean>;
120
+ constructor(_itemService: ItemService, _thesaurusService: ThesaurusService);
121
+ private getFragmentFromPart;
122
+ private loadWithThesauri;
123
+ private loadWithoutThesauri;
124
+ /**
125
+ * Load into the state the part with the specified ID
126
+ * and its thesauri.
127
+ * If the ID is not specified, it's a new part; in this case,
128
+ * it will get a null ID, but use the specified itemId and roleId.
129
+ *
130
+ * @param identity The part identity.
131
+ * @param thesauriIds The thesauri IDs array.
132
+ */
133
+ load(identity: FragmentIdentity, thesauriIds?: string[]): Promise<EditedObject<Fragment> | null>;
134
+ /**
135
+ * Save the fragments in their layer part.
136
+ *
137
+ * @param part The part.
138
+ * @returns Promise which when successful returns the saved part.
139
+ */
140
+ save(part: Part): Promise<Part>;
141
+ static ɵfac: i0.ɵɵFactoryDeclaration<FragmentEditorService, never>;
142
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
145
143
  }
146
-
147
144
  /**
148
145
  * Base class for fragment feature editors.
149
146
  * This is similar to the EditPartFeatureBase class.
150
147
  */
151
- declare abstract class EditFragmentFeatureBase implements OnInit, OnDestroy, ComponentCanDeactivate {
152
- private _router;
153
- protected snackbar: MatSnackBar;
154
- protected editorService: FragmentEditorService;
155
- private _libraryRouteService;
156
- private _loadingSub?;
157
- private _savingSub?;
158
- /**
159
- * The fragment being edited.
160
- */
161
- readonly data: i0.WritableSignal<EditedObject<Fragment> | undefined>;
162
- /**
163
- * The identity of the fragment being edited. This gets built from the current
164
- * route.
165
- */
166
- readonly identity: i0.WritableSignal<FragmentIdentity>;
167
- /**
168
- * True when the wrapped editor component data is dirty.
169
- */
170
- readonly dirty: i0.WritableSignal<boolean>;
171
- /**
172
- * True when loading data.
173
- */
174
- readonly loading: i0.WritableSignal<boolean | undefined>;
175
- /**
176
- * True when saving data.
177
- */
178
- readonly saving: i0.WritableSignal<boolean | undefined>;
179
- /**
180
- * The location of the fragment being edited.
181
- */
182
- readonly frLoc: i0.WritableSignal<TokenLocation | undefined>;
183
- constructor(_router: Router, route: ActivatedRoute, snackbar: MatSnackBar, editorService: FragmentEditorService, _libraryRouteService: LibraryRouteService);
184
- /**
185
- * Override in derived classes to return the IDs of the thesauri requested
186
- * for this editor.
187
- *
188
- * @return Array with thesauri IDs, eventually empty.
189
- */
190
- protected getReqThesauriIds(): string[];
191
- /**
192
- * Called once data has been loaded.
193
- */
194
- protected onDataLoaded(): void;
195
- ngOnInit(): void;
196
- ngOnDestroy(): void;
197
- canDeactivate(): boolean;
198
- /**
199
- * Called when the wrapped editor dirty state changes.
200
- * In the HTML template, you MUST bind this handler to the dirtyChange event
201
- * emitted by your wrapped editor (i.e. (dirtyChange)="onDirtyChange($event)").
202
- *
203
- * @param value The value of the dirty state.
204
- */
205
- onDirtyChange(value: boolean): void;
206
- /**
207
- * Save the fragment.
208
- *
209
- * @param fragment The fragment to be saved.
210
- */
211
- save(fragment: Fragment): void;
212
- close(): void;
213
- static ɵfac: i0.ɵɵFactoryDeclaration<EditFragmentFeatureBase, never>;
214
- static ɵcmp: i0.ɵɵComponentDeclaration<EditFragmentFeatureBase, "ng-component", never, {}, {}, never, never, false, never>;
148
+ export declare abstract class EditFragmentFeatureBase implements OnInit, OnDestroy, ComponentCanDeactivate {
149
+ private _router;
150
+ protected snackbar: MatSnackBar;
151
+ protected editorService: FragmentEditorService;
152
+ private _libraryRouteService;
153
+ private _loadingSub?;
154
+ private _savingSub?;
155
+ /**
156
+ * The fragment being edited.
157
+ */
158
+ readonly data: import("@angular/core").WritableSignal<EditedObject<Fragment> | undefined>;
159
+ /**
160
+ * The identity of the fragment being edited. This gets built from the current
161
+ * route.
162
+ */
163
+ readonly identity: import("@angular/core").WritableSignal<FragmentIdentity>;
164
+ /**
165
+ * True when the wrapped editor component data is dirty.
166
+ */
167
+ readonly dirty: import("@angular/core").WritableSignal<boolean>;
168
+ /**
169
+ * True when loading data.
170
+ */
171
+ readonly loading: import("@angular/core").WritableSignal<boolean | undefined>;
172
+ /**
173
+ * True when saving data.
174
+ */
175
+ readonly saving: import("@angular/core").WritableSignal<boolean | undefined>;
176
+ /**
177
+ * The location of the fragment being edited.
178
+ */
179
+ readonly frLoc: import("@angular/core").WritableSignal<TokenLocation | undefined>;
180
+ constructor(_router: Router, route: ActivatedRoute, snackbar: MatSnackBar, editorService: FragmentEditorService, _libraryRouteService: LibraryRouteService);
181
+ /**
182
+ * Override in derived classes to return the IDs of the thesauri requested
183
+ * for this editor.
184
+ *
185
+ * @return Array with thesauri IDs, eventually empty.
186
+ */
187
+ protected getReqThesauriIds(): string[];
188
+ /**
189
+ * Called once data has been loaded.
190
+ */
191
+ protected onDataLoaded(): void;
192
+ ngOnInit(): void;
193
+ ngOnDestroy(): void;
194
+ canDeactivate(): boolean;
195
+ /**
196
+ * Called when the wrapped editor dirty state changes.
197
+ * In the HTML template, you MUST bind this handler to the dirtyChange event
198
+ * emitted by your wrapped editor (i.e. (dirtyChange)="onDirtyChange($event)").
199
+ *
200
+ * @param value The value of the dirty state.
201
+ */
202
+ onDirtyChange(value: boolean): void;
203
+ /**
204
+ * Save the fragment.
205
+ *
206
+ * @param fragment The fragment to be saved.
207
+ */
208
+ save(fragment: Fragment): void;
209
+ close(): void;
210
+ static ɵfac: i0.ɵɵFactoryDeclaration<EditFragmentFeatureBase, never>;
211
+ static ɵcmp: i0.ɵɵComponentDeclaration<EditFragmentFeatureBase, "ng-component", never, {}, {}, never, never, false, never>;
215
212
  }
216
-
217
213
  /**
218
214
  * Service used by part editor wrappers to load part and thesauri
219
215
  * or save parts.
220
216
  */
221
- declare class PartEditorService {
222
- private _itemService;
223
- private _thesaurusService;
224
- private _loading$;
225
- private _saving$;
226
- loading$: Observable<boolean>;
227
- saving$: Observable<boolean>;
228
- constructor(_itemService: ItemService, _thesaurusService: ThesaurusService);
229
- private loadWithThesauri;
230
- private loadWithoutThesauri;
231
- /**
232
- * Load into the state the part with the specified ID
233
- * and its thesauri.
234
- * If the ID is not specified, it's a new part; in this case,
235
- * it will get a null ID, but use the specified itemId and roleId.
236
- *
237
- * @param identity The part identity.
238
- * @param thesauriIds The thesauri IDs array.
239
- */
240
- load(identity: PartIdentity, thesauriIds?: string[]): Promise<EditedObject<Part> | null>;
241
- /**
242
- * Save the part.
243
- *
244
- * @param part The part.
245
- * @returns Promise which when successful returns the saved part.
246
- */
247
- save(part: Part): Promise<Part>;
248
- static ɵfac: i0.ɵɵFactoryDeclaration<PartEditorService, never>;
249
- static ɵprov: i0.ɵɵInjectableDeclaration<PartEditorService>;
217
+ export declare class PartEditorService {
218
+ private _itemService;
219
+ private _thesaurusService;
220
+ private _loading$;
221
+ private _saving$;
222
+ loading$: Observable<boolean>;
223
+ saving$: Observable<boolean>;
224
+ constructor(_itemService: ItemService, _thesaurusService: ThesaurusService);
225
+ private loadWithThesauri;
226
+ private loadWithoutThesauri;
227
+ /**
228
+ * Load into the state the part with the specified ID
229
+ * and its thesauri.
230
+ * If the ID is not specified, it's a new part; in this case,
231
+ * it will get a null ID, but use the specified itemId and roleId.
232
+ *
233
+ * @param identity The part identity.
234
+ * @param thesauriIds The thesauri IDs array.
235
+ */
236
+ load(identity: PartIdentity, thesauriIds?: string[]): Promise<EditedObject<Part> | null>;
237
+ /**
238
+ * Save the part.
239
+ *
240
+ * @param part The part.
241
+ * @returns Promise which when successful returns the saved part.
242
+ */
243
+ save(part: Part): Promise<Part>;
244
+ static ɵfac: i0.ɵɵFactoryDeclaration<PartEditorService, never>;
245
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
250
246
  }
251
-
252
247
  /**
253
248
  * Base class for part feature editors.
254
249
  * A part feature editor is a wrapper component around a model editor component,
255
250
  * used to separate the editor's logic from its host infrastructure.
256
251
  */
257
- declare abstract class EditPartFeatureBase implements OnInit, OnDestroy, ComponentCanDeactivate {
258
- protected router: Router;
259
- protected snackbar: MatSnackBar;
260
- protected itemService: ItemService;
261
- protected thesaurusService: ThesaurusService;
262
- protected editorService: PartEditorService;
263
- private _loadingSub?;
264
- private _savingSub?;
265
- /**
266
- * The part being edited.
267
- */
268
- readonly data: i0.WritableSignal<EditedObject<Part> | undefined>;
269
- /**
270
- * The identity of the part being edited. This gets built from the current
271
- * route.
272
- */
273
- readonly identity: i0.WritableSignal<PartIdentity>;
274
- /**
275
- * True when the wrapped editor component data is dirty.
276
- */
277
- readonly dirty: i0.WritableSignal<boolean>;
278
- /**
279
- * True when loading data.
280
- */
281
- readonly loading: i0.WritableSignal<boolean | undefined>;
282
- /**
283
- * True when saving data.
284
- */
285
- readonly saving: i0.WritableSignal<boolean | undefined>;
286
- /**
287
- * Set to true when you want the role ID (defined by identity) to affect
288
- * the ID of the thesauri to load. You should set this in your editor
289
- * constructor, or in your getReqThesauriIds override. When true, the role ID
290
- * will be suffixed (preceded by an underscore) to the thesaurus ID,
291
- * before its language identifier, i.e. for instance "categories@en"
292
- * with role "sample" becomes "categories_sample@en". When this option is
293
- * enabled, and some of your thesauri do not need to be suffixed, just
294
- * provide an alias for the suffixed thesaurus in the backend.
295
- */
296
- protected roleIdInThesauri?: boolean;
297
- constructor(router: Router, route: ActivatedRoute, snackbar: MatSnackBar, itemService: ItemService, thesaurusService: ThesaurusService, editorService: PartEditorService);
298
- /**
299
- * Override in derived classes to return the IDs of the thesauri requested
300
- * for this editor.
301
- *
302
- * @return Array with thesauri IDs, eventually empty.
303
- */
304
- protected getReqThesauriIds(): string[];
305
- /**
306
- * Called once data has been loaded.
307
- */
308
- protected onDataLoaded(): void;
309
- private suffixThesaurusId;
310
- private suffixThesauriIds;
311
- ngOnInit(): void;
312
- ngOnDestroy(): void;
313
- canDeactivate(): boolean;
314
- /**
315
- * Called when the wrapped editor dirty state changes.
316
- * In the HTML template, you MUST bind this handler to the dirtyChange event
317
- * emitted by your wrapped editor (i.e. (dirtyChange)="onDirtyChange($event)").
318
- *
319
- * @param value The value of the dirty state.
320
- */
321
- onDirtyChange(value: boolean): void;
322
- /**
323
- * Save the part.
324
- *
325
- * @param part The part to be saved.
326
- */
327
- save(part: Part): void;
328
- /**
329
- * Close the editor by navigating back to the part's item.
330
- */
331
- close(): void;
332
- static ɵfac: i0.ɵɵFactoryDeclaration<EditPartFeatureBase, never>;
333
- static ɵcmp: i0.ɵɵComponentDeclaration<EditPartFeatureBase, "ng-component", never, {}, {}, never, never, false, never>;
252
+ export declare abstract class EditPartFeatureBase implements OnInit, OnDestroy, ComponentCanDeactivate {
253
+ protected router: Router;
254
+ protected snackbar: MatSnackBar;
255
+ protected itemService: ItemService;
256
+ protected thesaurusService: ThesaurusService;
257
+ protected editorService: PartEditorService;
258
+ private _loadingSub?;
259
+ private _savingSub?;
260
+ /**
261
+ * The part being edited.
262
+ */
263
+ readonly data: import("@angular/core").WritableSignal<EditedObject<Part> | undefined>;
264
+ /**
265
+ * The identity of the part being edited. This gets built from the current
266
+ * route.
267
+ */
268
+ readonly identity: import("@angular/core").WritableSignal<PartIdentity>;
269
+ /**
270
+ * True when the wrapped editor component data is dirty.
271
+ */
272
+ readonly dirty: import("@angular/core").WritableSignal<boolean>;
273
+ /**
274
+ * True when loading data.
275
+ */
276
+ readonly loading: import("@angular/core").WritableSignal<boolean | undefined>;
277
+ /**
278
+ * True when saving data.
279
+ */
280
+ readonly saving: import("@angular/core").WritableSignal<boolean | undefined>;
281
+ /**
282
+ * Set to true when you want the role ID (defined by identity) to affect
283
+ * the ID of the thesauri to load. You should set this in your editor
284
+ * constructor, or in your getReqThesauriIds override. When true, the role ID
285
+ * will be suffixed (preceded by an underscore) to the thesaurus ID,
286
+ * before its language identifier, i.e. for instance "categories@en"
287
+ * with role "sample" becomes "categories_sample@en". When this option is
288
+ * enabled, and some of your thesauri do not need to be suffixed, just
289
+ * provide an alias for the suffixed thesaurus in the backend.
290
+ */
291
+ protected roleIdInThesauri?: boolean;
292
+ constructor(router: Router, route: ActivatedRoute, snackbar: MatSnackBar, itemService: ItemService, thesaurusService: ThesaurusService, editorService: PartEditorService);
293
+ /**
294
+ * Override in derived classes to return the IDs of the thesauri requested
295
+ * for this editor.
296
+ *
297
+ * @return Array with thesauri IDs, eventually empty.
298
+ */
299
+ protected getReqThesauriIds(): string[];
300
+ /**
301
+ * Called once data has been loaded.
302
+ */
303
+ protected onDataLoaded(): void;
304
+ private suffixThesaurusId;
305
+ private suffixThesauriIds;
306
+ ngOnInit(): void;
307
+ ngOnDestroy(): void;
308
+ canDeactivate(): boolean;
309
+ /**
310
+ * Called when the wrapped editor dirty state changes.
311
+ * In the HTML template, you MUST bind this handler to the dirtyChange event
312
+ * emitted by your wrapped editor (i.e. (dirtyChange)="onDirtyChange($event)").
313
+ *
314
+ * @param value The value of the dirty state.
315
+ */
316
+ onDirtyChange(value: boolean): void;
317
+ /**
318
+ * Save the part.
319
+ *
320
+ * @param part The part to be saved.
321
+ */
322
+ save(part: Part): void;
323
+ /**
324
+ * Close the editor by navigating back to the part's item.
325
+ */
326
+ close(): void;
327
+ static ɵfac: i0.ɵɵFactoryDeclaration<EditPartFeatureBase, never>;
328
+ static ɵcmp: i0.ɵɵComponentDeclaration<EditPartFeatureBase, "ng-component", never, {}, {}, never, never, false, never>;
334
329
  }
335
-
336
- declare class EditedThesaurusRepository {
337
- private _thesaurusService;
338
- private _thesaurus$;
339
- private _loading$;
340
- private _saving$;
341
- loading$: Observable<boolean>;
342
- saving$: Observable<boolean>;
343
- get thesaurus$(): Observable<Thesaurus | undefined>;
344
- constructor(_thesaurusService: ThesaurusService);
345
- getThesaurus(): Thesaurus | undefined;
346
- /**
347
- * Load the specified thesaurus.
348
- *
349
- * @param id The thesaurus ID or undefined to load a new thesaurus.
350
- */
351
- load(id?: string): void;
352
- /**
353
- * Save the specified thesaurus.
354
- *
355
- * @param thesaurus The thesaurus to save.
356
- * @returns Promise with saved thesaurus.
357
- */
358
- save(thesaurus: Thesaurus): Promise<Thesaurus>;
359
- static ɵfac: i0.ɵɵFactoryDeclaration<EditedThesaurusRepository, never>;
360
- static ɵprov: i0.ɵɵInjectableDeclaration<EditedThesaurusRepository>;
330
+ export declare class EditedThesaurusRepository {
331
+ private _thesaurusService;
332
+ private _thesaurus$;
333
+ private _loading$;
334
+ private _saving$;
335
+ loading$: Observable<boolean>;
336
+ saving$: Observable<boolean>;
337
+ get thesaurus$(): Observable<Thesaurus | undefined>;
338
+ constructor(_thesaurusService: ThesaurusService);
339
+ getThesaurus(): Thesaurus | undefined;
340
+ /**
341
+ * Load the specified thesaurus.
342
+ *
343
+ * @param id The thesaurus ID or undefined to load a new thesaurus.
344
+ */
345
+ load(id?: string): void;
346
+ /**
347
+ * Save the specified thesaurus.
348
+ *
349
+ * @param thesaurus The thesaurus to save.
350
+ * @returns Promise with saved thesaurus.
351
+ */
352
+ save(thesaurus: Thesaurus): Promise<Thesaurus>;
353
+ static ɵfac: i0.ɵɵFactoryDeclaration<EditedThesaurusRepository, never>;
354
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
361
355
  }
362
-
363
356
  /**
364
357
  * Edited layer part repository.
365
358
  */
366
- declare class EditedLayerRepository {
367
- private _itemService;
368
- private _facetService;
369
- private _thesaurusService;
370
- private _part$;
371
- private _baseText$;
372
- private _baseTextPart$;
373
- private _locations$;
374
- private _breakChance$;
375
- private _layerHints$;
376
- private _thesauriSet;
377
- private _loading$;
378
- private _saving$;
379
- get loading$(): Observable<boolean>;
380
- get saving$(): Observable<boolean>;
381
- get part$(): Observable<TextLayerPart | undefined>;
382
- get baseText$(): Observable<string | undefined>;
383
- get baseTextPart$(): Observable<Part | undefined>;
384
- get locations$(): Observable<TokenLocation[]>;
385
- get breakChance$(): Observable<number>;
386
- get layerHints$(): Observable<LayerHint[]>;
387
- get thesauriSet$(): Observable<ThesauriSet | undefined>;
388
- constructor(_itemService: ItemService, _facetService: FacetService, _thesaurusService: ThesaurusService);
389
- reset(): void;
390
- getPart(): TextLayerPart | undefined;
391
- getBaseText(): string | undefined;
392
- getLocations(): TokenLocation[];
393
- private getPartLocations;
394
- private loadWithThesauri;
395
- private loadWithoutThesauri;
396
- /**
397
- * Load the state for editing layer part(s).
398
- *
399
- * @param itemId The item ID the layer part belongs to.
400
- * @param partId The layer part ID.
401
- * @param thesauriIds The optional thesauri IDs to load.
402
- */
403
- load(itemId: string, partId: string, thesauriIds?: string[]): void;
404
- /**
405
- * Refresh the layer part break chance.
406
- */
407
- refreshBreakChance(): void;
408
- applyLayerPatches(partId: string, patches: string[]): void;
409
- /**
410
- * Delete the fragment at the specified location.
411
- *
412
- * @param loc The fragment's location.
413
- */
414
- deleteFragment(loc: TokenLocation): void;
415
- /**
416
- * Save the specified fragment.
417
- *
418
- * @param fragment The fragment.
419
- */
420
- saveFragment(fragment: Fragment): void;
421
- static ɵfac: i0.ɵɵFactoryDeclaration<EditedLayerRepository, never>;
422
- static ɵprov: i0.ɵɵInjectableDeclaration<EditedLayerRepository>;
423
- }
424
-
425
- export { AppRepository, EditFragmentFeatureBase, EditPartFeatureBase, EditedLayerRepository, EditedThesaurusRepository, FragmentEditorService, PartEditorService };
359
+ export declare class EditedLayerRepository {
360
+ private _itemService;
361
+ private _facetService;
362
+ private _thesaurusService;
363
+ private _part$;
364
+ private _baseText$;
365
+ private _baseTextPart$;
366
+ private _locations$;
367
+ private _breakChance$;
368
+ private _layerHints$;
369
+ private _thesauriSet;
370
+ private _loading$;
371
+ private _saving$;
372
+ get loading$(): Observable<boolean>;
373
+ get saving$(): Observable<boolean>;
374
+ get part$(): Observable<TextLayerPart | undefined>;
375
+ get baseText$(): Observable<string | undefined>;
376
+ get baseTextPart$(): Observable<Part | undefined>;
377
+ get locations$(): Observable<TokenLocation[]>;
378
+ get breakChance$(): Observable<number>;
379
+ get layerHints$(): Observable<LayerHint[]>;
380
+ get thesauriSet$(): Observable<ThesauriSet | undefined>;
381
+ constructor(_itemService: ItemService, _facetService: FacetService, _thesaurusService: ThesaurusService);
382
+ reset(): void;
383
+ getPart(): TextLayerPart | undefined;
384
+ getBaseText(): string | undefined;
385
+ getLocations(): TokenLocation[];
386
+ private getPartLocations;
387
+ private loadWithThesauri;
388
+ private loadWithoutThesauri;
389
+ /**
390
+ * Load the state for editing layer part(s).
391
+ *
392
+ * @param itemId The item ID the layer part belongs to.
393
+ * @param partId The layer part ID.
394
+ * @param thesauriIds The optional thesauri IDs to load.
395
+ */
396
+ load(itemId: string, partId: string, thesauriIds?: string[]): void;
397
+ /**
398
+ * Refresh the layer part break chance.
399
+ */
400
+ refreshBreakChance(): void;
401
+ applyLayerPatches(partId: string, patches: string[]): void;
402
+ /**
403
+ * Delete the fragment at the specified location.
404
+ *
405
+ * @param loc The fragment's location.
406
+ */
407
+ deleteFragment(loc: TokenLocation): void;
408
+ /**
409
+ * Save the specified fragment.
410
+ *
411
+ * @param fragment The fragment.
412
+ */
413
+ saveFragment(fragment: Fragment): void;
414
+ static ɵfac: i0.ɵɵFactoryDeclaration<EditedLayerRepository, never>;
415
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
416
+ }