@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.
- package/README.md +4 -0
- package/fesm2022/myrmidon-cadmus-state.mjs +1155 -1373
- package/fesm2022/myrmidon-cadmus-state.mjs.map +1 -1
- package/package.json +17 -18
- package/types/myrmidon-cadmus-state.d.ts +387 -396
|
@@ -1,425 +1,416 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Observable } from
|
|
3
|
-
import { FacetService, FlagService,
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { MatSnackBar } from
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
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
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
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
|
+
}
|