@myrmidon/cadmus-state 2.0.5 → 6.0.0
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/esm2022/lib/app.repository.mjs +89 -0
- package/esm2022/lib/cadmus-state.module.mjs +33 -0
- package/esm2022/lib/edit-fragment-feature-base.mjs +132 -0
- package/esm2022/lib/edit-part-feature-base.mjs +149 -0
- package/esm2022/lib/edited-layer.repository.mjs +289 -0
- package/esm2022/lib/edited-thesaurus.repository.mjs +78 -0
- package/esm2022/lib/fragment-editor.service.mjs +168 -0
- package/esm2022/lib/part-editor.service.mjs +158 -0
- package/{esm2020 → esm2022}/myrmidon-cadmus-state.mjs +4 -4
- package/{esm2020 → esm2022}/public-api.mjs +11 -11
- package/{fesm2020 → fesm2022}/myrmidon-cadmus-state.mjs +1036 -1014
- package/fesm2022/myrmidon-cadmus-state.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/app.repository.d.ts +34 -63
- package/lib/cadmus-state.module.d.ts +10 -10
- package/lib/edit-fragment-feature-base.d.ts +76 -76
- package/lib/edit-part-feature-base.d.ts +91 -91
- package/lib/edited-layer.repository.d.ts +64 -91
- package/lib/edited-thesaurus.repository.d.ts +30 -34
- package/lib/fragment-editor.service.d.ts +40 -40
- package/lib/part-editor.service.d.ts +39 -39
- package/package.json +8 -14
- package/public-api.d.ts +8 -8
- package/esm2020/lib/app.repository.mjs +0 -75
- package/esm2020/lib/cadmus-state.module.mjs +0 -32
- package/esm2020/lib/edit-fragment-feature-base.mjs +0 -131
- package/esm2020/lib/edit-part-feature-base.mjs +0 -148
- package/esm2020/lib/edited-layer.repository.mjs +0 -280
- package/esm2020/lib/edited-thesaurus.repository.mjs +0 -80
- package/esm2020/lib/fragment-editor.service.mjs +0 -167
- package/esm2020/lib/part-editor.service.mjs +0 -157
- package/fesm2015/myrmidon-cadmus-state.mjs +0 -1018
- package/fesm2015/myrmidon-cadmus-state.mjs.map +0 -1
- package/fesm2020/myrmidon-cadmus-state.mjs.map +0 -1
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { Router, ActivatedRoute } from '@angular/router';
|
|
3
|
-
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
-
import { ComponentCanDeactivate, Part } from '@myrmidon/cadmus-core';
|
|
5
|
-
import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
6
|
-
import { EditedObject, PartIdentity } from '@myrmidon/cadmus-ui';
|
|
7
|
-
import { PartEditorService } from './part-editor.service';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
/**
|
|
10
|
-
* Base class for part feature editors.
|
|
11
|
-
* A part feature editor is a wrapper component around a model editor component,
|
|
12
|
-
* used to separate the editor's logic from its host infrastructure.
|
|
13
|
-
*/
|
|
14
|
-
export declare abstract class EditPartFeatureBase implements OnInit, OnDestroy, ComponentCanDeactivate {
|
|
15
|
-
protected router: Router;
|
|
16
|
-
protected snackbar: MatSnackBar;
|
|
17
|
-
protected itemService: ItemService;
|
|
18
|
-
protected thesaurusService: ThesaurusService;
|
|
19
|
-
protected editorService: PartEditorService;
|
|
20
|
-
private _loadingSub?;
|
|
21
|
-
private _savingSub?;
|
|
22
|
-
/**
|
|
23
|
-
* The part being edited.
|
|
24
|
-
*/
|
|
25
|
-
data?: EditedObject<Part>;
|
|
26
|
-
/**
|
|
27
|
-
* The identity of the part being edited. This gets built from the current
|
|
28
|
-
* route.
|
|
29
|
-
*/
|
|
30
|
-
identity: PartIdentity;
|
|
31
|
-
/**
|
|
32
|
-
* True when the wrapped editor component data is dirty.
|
|
33
|
-
*/
|
|
34
|
-
dirty?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* True when loading data.
|
|
37
|
-
*/
|
|
38
|
-
loading?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* True when saving data.
|
|
41
|
-
*/
|
|
42
|
-
saving?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Set to true when you want the role ID (defined by identity) to affect
|
|
45
|
-
* the ID of the thesauri to load. You should set this in your editor
|
|
46
|
-
* constructor, or in your getReqThesauriIds override. When true, the role ID
|
|
47
|
-
* will be suffixed (preceded by an underscore) to the thesaurus ID,
|
|
48
|
-
* before its language identifier, i.e. for instance "categories@en"
|
|
49
|
-
* with role "sample" becomes "categories_sample@en". When this option is
|
|
50
|
-
* enabled, and some of your thesauri do not need to be suffixed, just
|
|
51
|
-
* provide an alias for the suffixed thesaurus in the backend.
|
|
52
|
-
*/
|
|
53
|
-
protected roleIdInThesauri?: boolean;
|
|
54
|
-
constructor(router: Router, route: ActivatedRoute, snackbar: MatSnackBar, itemService: ItemService, thesaurusService: ThesaurusService, editorService: PartEditorService);
|
|
55
|
-
/**
|
|
56
|
-
* Override in derived classes to return the IDs of the thesauri requested
|
|
57
|
-
* for this editor.
|
|
58
|
-
*
|
|
59
|
-
* @return Array with thesauri IDs, eventually empty.
|
|
60
|
-
*/
|
|
61
|
-
protected getReqThesauriIds(): string[];
|
|
62
|
-
/**
|
|
63
|
-
* Called once data has been loaded.
|
|
64
|
-
*/
|
|
65
|
-
protected onDataLoaded(): void;
|
|
66
|
-
private suffixThesaurusId;
|
|
67
|
-
private suffixThesauriIds;
|
|
68
|
-
ngOnInit(): void;
|
|
69
|
-
ngOnDestroy(): void;
|
|
70
|
-
canDeactivate(): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Called when the wrapped editor dirty state changes.
|
|
73
|
-
* In the HTML template, you MUST bind this handler to the dirtyChange event
|
|
74
|
-
* emitted by your wrapped editor (i.e. (dirtyChange)="onDirtyChange($event)").
|
|
75
|
-
*
|
|
76
|
-
* @param value The value of the dirty state.
|
|
77
|
-
*/
|
|
78
|
-
onDirtyChange(value: boolean): void;
|
|
79
|
-
/**
|
|
80
|
-
* Save the part.
|
|
81
|
-
*
|
|
82
|
-
* @param part The part to be saved.
|
|
83
|
-
*/
|
|
84
|
-
save(part: Part): void;
|
|
85
|
-
/**
|
|
86
|
-
* Close the editor by navigating back to the part's item.
|
|
87
|
-
*/
|
|
88
|
-
close(): void;
|
|
89
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EditPartFeatureBase, never>;
|
|
90
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<EditPartFeatureBase, "ng-component", never, {}, {}, never, never, false, never>;
|
|
91
|
-
}
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
3
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
+
import { ComponentCanDeactivate, Part } from '@myrmidon/cadmus-core';
|
|
5
|
+
import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
6
|
+
import { EditedObject, PartIdentity } from '@myrmidon/cadmus-ui';
|
|
7
|
+
import { PartEditorService } from './part-editor.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* Base class for part feature editors.
|
|
11
|
+
* A part feature editor is a wrapper component around a model editor component,
|
|
12
|
+
* used to separate the editor's logic from its host infrastructure.
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class EditPartFeatureBase implements OnInit, OnDestroy, ComponentCanDeactivate {
|
|
15
|
+
protected router: Router;
|
|
16
|
+
protected snackbar: MatSnackBar;
|
|
17
|
+
protected itemService: ItemService;
|
|
18
|
+
protected thesaurusService: ThesaurusService;
|
|
19
|
+
protected editorService: PartEditorService;
|
|
20
|
+
private _loadingSub?;
|
|
21
|
+
private _savingSub?;
|
|
22
|
+
/**
|
|
23
|
+
* The part being edited.
|
|
24
|
+
*/
|
|
25
|
+
data?: EditedObject<Part>;
|
|
26
|
+
/**
|
|
27
|
+
* The identity of the part being edited. This gets built from the current
|
|
28
|
+
* route.
|
|
29
|
+
*/
|
|
30
|
+
identity: PartIdentity;
|
|
31
|
+
/**
|
|
32
|
+
* True when the wrapped editor component data is dirty.
|
|
33
|
+
*/
|
|
34
|
+
dirty?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* True when loading data.
|
|
37
|
+
*/
|
|
38
|
+
loading?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* True when saving data.
|
|
41
|
+
*/
|
|
42
|
+
saving?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Set to true when you want the role ID (defined by identity) to affect
|
|
45
|
+
* the ID of the thesauri to load. You should set this in your editor
|
|
46
|
+
* constructor, or in your getReqThesauriIds override. When true, the role ID
|
|
47
|
+
* will be suffixed (preceded by an underscore) to the thesaurus ID,
|
|
48
|
+
* before its language identifier, i.e. for instance "categories@en"
|
|
49
|
+
* with role "sample" becomes "categories_sample@en". When this option is
|
|
50
|
+
* enabled, and some of your thesauri do not need to be suffixed, just
|
|
51
|
+
* provide an alias for the suffixed thesaurus in the backend.
|
|
52
|
+
*/
|
|
53
|
+
protected roleIdInThesauri?: boolean;
|
|
54
|
+
constructor(router: Router, route: ActivatedRoute, snackbar: MatSnackBar, itemService: ItemService, thesaurusService: ThesaurusService, editorService: PartEditorService);
|
|
55
|
+
/**
|
|
56
|
+
* Override in derived classes to return the IDs of the thesauri requested
|
|
57
|
+
* for this editor.
|
|
58
|
+
*
|
|
59
|
+
* @return Array with thesauri IDs, eventually empty.
|
|
60
|
+
*/
|
|
61
|
+
protected getReqThesauriIds(): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Called once data has been loaded.
|
|
64
|
+
*/
|
|
65
|
+
protected onDataLoaded(): void;
|
|
66
|
+
private suffixThesaurusId;
|
|
67
|
+
private suffixThesauriIds;
|
|
68
|
+
ngOnInit(): void;
|
|
69
|
+
ngOnDestroy(): void;
|
|
70
|
+
canDeactivate(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Called when the wrapped editor dirty state changes.
|
|
73
|
+
* In the HTML template, you MUST bind this handler to the dirtyChange event
|
|
74
|
+
* emitted by your wrapped editor (i.e. (dirtyChange)="onDirtyChange($event)").
|
|
75
|
+
*
|
|
76
|
+
* @param value The value of the dirty state.
|
|
77
|
+
*/
|
|
78
|
+
onDirtyChange(value: boolean): void;
|
|
79
|
+
/**
|
|
80
|
+
* Save the part.
|
|
81
|
+
*
|
|
82
|
+
* @param part The part to be saved.
|
|
83
|
+
*/
|
|
84
|
+
save(part: Part): void;
|
|
85
|
+
/**
|
|
86
|
+
* Close the editor by navigating back to the part's item.
|
|
87
|
+
*/
|
|
88
|
+
close(): void;
|
|
89
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditPartFeatureBase, never>;
|
|
90
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditPartFeatureBase, "ng-component", never, {}, {}, never, never, false, never>;
|
|
91
|
+
}
|
|
@@ -1,91 +1,64 @@
|
|
|
1
|
-
import { Fragment, LayerHint, Part, TextLayerPart, TokenLocation } from '@myrmidon/cadmus-core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { FacetService, ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
* Load the state for editing layer part(s).
|
|
66
|
-
*
|
|
67
|
-
* @param itemId The item ID the layer part belongs to.
|
|
68
|
-
* @param partId The layer part ID.
|
|
69
|
-
* @param thesauriIds The optional thesauri IDs to load.
|
|
70
|
-
*/
|
|
71
|
-
load(itemId: string, partId: string, thesauriIds?: string[]): void;
|
|
72
|
-
/**
|
|
73
|
-
* Refresh the layer part break chance.
|
|
74
|
-
*/
|
|
75
|
-
refreshBreakChance(): void;
|
|
76
|
-
applyLayerPatches(partId: string, patches: string[]): void;
|
|
77
|
-
/**
|
|
78
|
-
* Delete the fragment at the specified location.
|
|
79
|
-
*
|
|
80
|
-
* @param loc The fragment's location.
|
|
81
|
-
*/
|
|
82
|
-
deleteFragment(loc: TokenLocation): void;
|
|
83
|
-
/**
|
|
84
|
-
* Save the specified fragment.
|
|
85
|
-
*
|
|
86
|
-
* @param fragment The fragment.
|
|
87
|
-
*/
|
|
88
|
-
saveFragment(fragment: Fragment): void;
|
|
89
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EditedLayerRepository, never>;
|
|
90
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<EditedLayerRepository>;
|
|
91
|
-
}
|
|
1
|
+
import { Fragment, LayerHint, Part, TextLayerPart, TokenLocation } from '@myrmidon/cadmus-core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { FacetService, ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Edited layer part repository.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EditedLayerRepository {
|
|
9
|
+
private _itemService;
|
|
10
|
+
private _facetService;
|
|
11
|
+
private _thesaurusService;
|
|
12
|
+
private _part$;
|
|
13
|
+
private _baseText$;
|
|
14
|
+
private _baseTextPart$;
|
|
15
|
+
private _locations$;
|
|
16
|
+
private _breakChance$;
|
|
17
|
+
private _layerHints$;
|
|
18
|
+
private _thesauriSet;
|
|
19
|
+
private _loading$;
|
|
20
|
+
private _saving$;
|
|
21
|
+
get loading$(): Observable<boolean>;
|
|
22
|
+
get saving$(): Observable<boolean>;
|
|
23
|
+
get part$(): Observable<TextLayerPart | undefined>;
|
|
24
|
+
get baseText$(): Observable<string | undefined>;
|
|
25
|
+
get baseTextPart$(): Observable<Part | undefined>;
|
|
26
|
+
get locations$(): Observable<TokenLocation[]>;
|
|
27
|
+
get breakChance$(): Observable<number>;
|
|
28
|
+
get layerHints$(): Observable<LayerHint[]>;
|
|
29
|
+
constructor(_itemService: ItemService, _facetService: FacetService, _thesaurusService: ThesaurusService);
|
|
30
|
+
reset(): void;
|
|
31
|
+
getPart(): TextLayerPart | undefined;
|
|
32
|
+
getBaseText(): string | undefined;
|
|
33
|
+
getLocations(): TokenLocation[];
|
|
34
|
+
private getPartLocations;
|
|
35
|
+
private loadWithThesauri;
|
|
36
|
+
private loadWithoutThesauri;
|
|
37
|
+
/**
|
|
38
|
+
* Load the state for editing layer part(s).
|
|
39
|
+
*
|
|
40
|
+
* @param itemId The item ID the layer part belongs to.
|
|
41
|
+
* @param partId The layer part ID.
|
|
42
|
+
* @param thesauriIds The optional thesauri IDs to load.
|
|
43
|
+
*/
|
|
44
|
+
load(itemId: string, partId: string, thesauriIds?: string[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Refresh the layer part break chance.
|
|
47
|
+
*/
|
|
48
|
+
refreshBreakChance(): void;
|
|
49
|
+
applyLayerPatches(partId: string, patches: string[]): void;
|
|
50
|
+
/**
|
|
51
|
+
* Delete the fragment at the specified location.
|
|
52
|
+
*
|
|
53
|
+
* @param loc The fragment's location.
|
|
54
|
+
*/
|
|
55
|
+
deleteFragment(loc: TokenLocation): void;
|
|
56
|
+
/**
|
|
57
|
+
* Save the specified fragment.
|
|
58
|
+
*
|
|
59
|
+
* @param fragment The fragment.
|
|
60
|
+
*/
|
|
61
|
+
saveFragment(fragment: Fragment): void;
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditedLayerRepository, never>;
|
|
63
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EditedLayerRepository>;
|
|
64
|
+
}
|
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { Thesaurus } from '@myrmidon/cadmus-core';
|
|
3
|
-
import { ThesaurusService } from '@myrmidon/cadmus-api';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
save(thesaurus: Thesaurus): Promise<Thesaurus>;
|
|
32
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EditedThesaurusRepository, never>;
|
|
33
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<EditedThesaurusRepository>;
|
|
34
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { Thesaurus } from '@myrmidon/cadmus-core';
|
|
3
|
+
import { ThesaurusService } from '@myrmidon/cadmus-api';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class EditedThesaurusRepository {
|
|
6
|
+
private _thesaurusService;
|
|
7
|
+
private _thesaurus$;
|
|
8
|
+
private _loading$;
|
|
9
|
+
private _saving$;
|
|
10
|
+
loading$: Observable<boolean>;
|
|
11
|
+
saving$: Observable<boolean>;
|
|
12
|
+
get thesaurus$(): Observable<Thesaurus | undefined>;
|
|
13
|
+
constructor(_thesaurusService: ThesaurusService);
|
|
14
|
+
getThesaurus(): Thesaurus | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Load the specified thesaurus.
|
|
17
|
+
*
|
|
18
|
+
* @param id The thesaurus ID or undefined to load a new thesaurus.
|
|
19
|
+
*/
|
|
20
|
+
load(id?: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Save the specified thesaurus.
|
|
23
|
+
*
|
|
24
|
+
* @param thesaurus The thesaurus to save.
|
|
25
|
+
* @returns Promise with saved thesaurus.
|
|
26
|
+
*/
|
|
27
|
+
save(thesaurus: Thesaurus): Promise<Thesaurus>;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditedThesaurusRepository, never>;
|
|
29
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EditedThesaurusRepository>;
|
|
30
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
3
|
-
import { Fragment, Part } from '@myrmidon/cadmus-core';
|
|
4
|
-
import { EditedObject, FragmentIdentity } from '@myrmidon/cadmus-ui';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* Service used by layer part editor wrappers to load part and thesauri
|
|
8
|
-
* or save parts.
|
|
9
|
-
*/
|
|
10
|
-
export declare class FragmentEditorService {
|
|
11
|
-
private _itemService;
|
|
12
|
-
private _thesaurusService;
|
|
13
|
-
private _loading$;
|
|
14
|
-
private _saving$;
|
|
15
|
-
loading$: Observable<boolean>;
|
|
16
|
-
saving$: Observable<boolean>;
|
|
17
|
-
constructor(_itemService: ItemService, _thesaurusService: ThesaurusService);
|
|
18
|
-
private getFragmentFromPart;
|
|
19
|
-
private loadWithThesauri;
|
|
20
|
-
private loadWithoutThesauri;
|
|
21
|
-
/**
|
|
22
|
-
* Load into the state the part with the specified ID
|
|
23
|
-
* and its thesauri.
|
|
24
|
-
* If the ID is not specified, it's a new part; in this case,
|
|
25
|
-
* it will get a null ID, but use the specified itemId and roleId.
|
|
26
|
-
*
|
|
27
|
-
* @param identity The part identity.
|
|
28
|
-
* @param thesauriIds The thesauri IDs array.
|
|
29
|
-
*/
|
|
30
|
-
load(identity: FragmentIdentity, thesauriIds?: string[]): Promise<EditedObject<Fragment> | null>;
|
|
31
|
-
/**
|
|
32
|
-
* Save the fragments in their layer part.
|
|
33
|
-
*
|
|
34
|
-
* @param part The part.
|
|
35
|
-
* @returns Promise which when successful returns the saved part.
|
|
36
|
-
*/
|
|
37
|
-
save(part: Part): Promise<Part>;
|
|
38
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FragmentEditorService, never>;
|
|
39
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<FragmentEditorService>;
|
|
40
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
3
|
+
import { Fragment, Part } from '@myrmidon/cadmus-core';
|
|
4
|
+
import { EditedObject, FragmentIdentity } from '@myrmidon/cadmus-ui';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Service used by layer part editor wrappers to load part and thesauri
|
|
8
|
+
* or save parts.
|
|
9
|
+
*/
|
|
10
|
+
export declare class FragmentEditorService {
|
|
11
|
+
private _itemService;
|
|
12
|
+
private _thesaurusService;
|
|
13
|
+
private _loading$;
|
|
14
|
+
private _saving$;
|
|
15
|
+
loading$: Observable<boolean>;
|
|
16
|
+
saving$: Observable<boolean>;
|
|
17
|
+
constructor(_itemService: ItemService, _thesaurusService: ThesaurusService);
|
|
18
|
+
private getFragmentFromPart;
|
|
19
|
+
private loadWithThesauri;
|
|
20
|
+
private loadWithoutThesauri;
|
|
21
|
+
/**
|
|
22
|
+
* Load into the state the part with the specified ID
|
|
23
|
+
* and its thesauri.
|
|
24
|
+
* If the ID is not specified, it's a new part; in this case,
|
|
25
|
+
* it will get a null ID, but use the specified itemId and roleId.
|
|
26
|
+
*
|
|
27
|
+
* @param identity The part identity.
|
|
28
|
+
* @param thesauriIds The thesauri IDs array.
|
|
29
|
+
*/
|
|
30
|
+
load(identity: FragmentIdentity, thesauriIds?: string[]): Promise<EditedObject<Fragment> | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Save the fragments in their layer part.
|
|
33
|
+
*
|
|
34
|
+
* @param part The part.
|
|
35
|
+
* @returns Promise which when successful returns the saved part.
|
|
36
|
+
*/
|
|
37
|
+
save(part: Part): Promise<Part>;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FragmentEditorService, never>;
|
|
39
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FragmentEditorService>;
|
|
40
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
3
|
-
import { Part } from '@myrmidon/cadmus-core';
|
|
4
|
-
import { EditedObject, PartIdentity } from '@myrmidon/cadmus-ui';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
/**
|
|
7
|
-
* Service used by part editor wrappers to load part and thesauri
|
|
8
|
-
* or save parts.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PartEditorService {
|
|
11
|
-
private _itemService;
|
|
12
|
-
private _thesaurusService;
|
|
13
|
-
private _loading$;
|
|
14
|
-
private _saving$;
|
|
15
|
-
loading$: Observable<boolean>;
|
|
16
|
-
saving$: Observable<boolean>;
|
|
17
|
-
constructor(_itemService: ItemService, _thesaurusService: ThesaurusService);
|
|
18
|
-
private loadWithThesauri;
|
|
19
|
-
private loadWithoutThesauri;
|
|
20
|
-
/**
|
|
21
|
-
* Load into the state the part with the specified ID
|
|
22
|
-
* and its thesauri.
|
|
23
|
-
* If the ID is not specified, it's a new part; in this case,
|
|
24
|
-
* it will get a null ID, but use the specified itemId and roleId.
|
|
25
|
-
*
|
|
26
|
-
* @param identity The part identity.
|
|
27
|
-
* @param thesauriIds The thesauri IDs array.
|
|
28
|
-
*/
|
|
29
|
-
load(identity: PartIdentity, thesauriIds?: string[]): Promise<EditedObject<Part> | null>;
|
|
30
|
-
/**
|
|
31
|
-
* Save the part.
|
|
32
|
-
*
|
|
33
|
-
* @param part The part.
|
|
34
|
-
* @returns Promise which when successful returns the saved part.
|
|
35
|
-
*/
|
|
36
|
-
save(part: Part): Promise<Part>;
|
|
37
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PartEditorService, never>;
|
|
38
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<PartEditorService>;
|
|
39
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ItemService, ThesaurusService } from '@myrmidon/cadmus-api';
|
|
3
|
+
import { Part } from '@myrmidon/cadmus-core';
|
|
4
|
+
import { EditedObject, PartIdentity } from '@myrmidon/cadmus-ui';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Service used by part editor wrappers to load part and thesauri
|
|
8
|
+
* or save parts.
|
|
9
|
+
*/
|
|
10
|
+
export declare class PartEditorService {
|
|
11
|
+
private _itemService;
|
|
12
|
+
private _thesaurusService;
|
|
13
|
+
private _loading$;
|
|
14
|
+
private _saving$;
|
|
15
|
+
loading$: Observable<boolean>;
|
|
16
|
+
saving$: Observable<boolean>;
|
|
17
|
+
constructor(_itemService: ItemService, _thesaurusService: ThesaurusService);
|
|
18
|
+
private loadWithThesauri;
|
|
19
|
+
private loadWithoutThesauri;
|
|
20
|
+
/**
|
|
21
|
+
* Load into the state the part with the specified ID
|
|
22
|
+
* and its thesauri.
|
|
23
|
+
* If the ID is not specified, it's a new part; in this case,
|
|
24
|
+
* it will get a null ID, but use the specified itemId and roleId.
|
|
25
|
+
*
|
|
26
|
+
* @param identity The part identity.
|
|
27
|
+
* @param thesauriIds The thesauri IDs array.
|
|
28
|
+
*/
|
|
29
|
+
load(identity: PartIdentity, thesauriIds?: string[]): Promise<EditedObject<Part> | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Save the part.
|
|
32
|
+
*
|
|
33
|
+
* @param part The part.
|
|
34
|
+
* @returns Promise which when successful returns the saved part.
|
|
35
|
+
*/
|
|
36
|
+
save(part: Part): Promise<Part>;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PartEditorService, never>;
|
|
38
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PartEditorService>;
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrmidon/cadmus-state",
|
|
3
3
|
"description": "Cadmus - state management.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "6.0.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Cadmus"
|
|
7
7
|
],
|
|
@@ -14,17 +14,13 @@
|
|
|
14
14
|
"name": "Daniele Fusi"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@angular/common": "^
|
|
18
|
-
"@angular/core": "^
|
|
17
|
+
"@angular/common": "^16.0.0",
|
|
18
|
+
"@angular/core": "^16.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"tslib": "^2.
|
|
21
|
+
"tslib": "^2.5.0"
|
|
22
22
|
},
|
|
23
|
-
"module": "
|
|
24
|
-
"es2020": "fesm2020/myrmidon-cadmus-state.mjs",
|
|
25
|
-
"esm2020": "esm2020/myrmidon-cadmus-state.mjs",
|
|
26
|
-
"fesm2020": "fesm2020/myrmidon-cadmus-state.mjs",
|
|
27
|
-
"fesm2015": "fesm2015/myrmidon-cadmus-state.mjs",
|
|
23
|
+
"module": "fesm2022/myrmidon-cadmus-state.mjs",
|
|
28
24
|
"typings": "index.d.ts",
|
|
29
25
|
"exports": {
|
|
30
26
|
"./package.json": {
|
|
@@ -32,11 +28,9 @@
|
|
|
32
28
|
},
|
|
33
29
|
".": {
|
|
34
30
|
"types": "./index.d.ts",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"node": "./fesm2015/myrmidon-cadmus-state.mjs",
|
|
39
|
-
"default": "./fesm2020/myrmidon-cadmus-state.mjs"
|
|
31
|
+
"esm2022": "./esm2022/myrmidon-cadmus-state.mjs",
|
|
32
|
+
"esm": "./esm2022/myrmidon-cadmus-state.mjs",
|
|
33
|
+
"default": "./fesm2022/myrmidon-cadmus-state.mjs"
|
|
40
34
|
}
|
|
41
35
|
},
|
|
42
36
|
"sideEffects": false
|
package/public-api.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './lib/app.repository';
|
|
2
|
-
export * from './lib/edit-fragment-feature-base';
|
|
3
|
-
export * from './lib/edit-part-feature-base';
|
|
4
|
-
export * from './lib/edited-thesaurus.repository';
|
|
5
|
-
export * from './lib/edited-layer.repository';
|
|
6
|
-
export * from './lib/fragment-editor.service';
|
|
7
|
-
export * from './lib/part-editor.service';
|
|
8
|
-
export * from './lib/cadmus-state.module';
|
|
1
|
+
export * from './lib/app.repository';
|
|
2
|
+
export * from './lib/edit-fragment-feature-base';
|
|
3
|
+
export * from './lib/edit-part-feature-base';
|
|
4
|
+
export * from './lib/edited-thesaurus.repository';
|
|
5
|
+
export * from './lib/edited-layer.repository';
|
|
6
|
+
export * from './lib/fragment-editor.service';
|
|
7
|
+
export * from './lib/part-editor.service';
|
|
8
|
+
export * from './lib/cadmus-state.module';
|