@myrmidon/cadmus-item-editor 1.1.2 → 2.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/esm2020/lib/cadmus-item-editor.module.mjs +4 -4
- package/esm2020/lib/has-preview.pipe.mjs +3 -3
- package/esm2020/lib/item-editor/item-editor.component.mjs +74 -58
- package/esm2020/lib/missing-parts/missing-parts.component.mjs +3 -3
- package/esm2020/lib/parts-scope-editor/parts-scope-editor.component.mjs +18 -17
- package/esm2020/lib/state/edited-item.repository.mjs +272 -0
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/myrmidon-cadmus-item-editor.mjs +354 -81
- package/fesm2015/myrmidon-cadmus-item-editor.mjs.map +1 -1
- package/fesm2020/myrmidon-cadmus-item-editor.mjs +364 -81
- package/fesm2020/myrmidon-cadmus-item-editor.mjs.map +1 -1
- package/lib/item-editor/item-editor.component.d.ts +8 -11
- package/lib/missing-parts/missing-parts.component.d.ts +1 -1
- package/lib/parts-scope-editor/parts-scope-editor.component.d.ts +6 -5
- package/lib/state/edited-item.repository.d.ts +94 -0
- package/package.json +3 -3
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { FacetDefinition, Item, LayerPartInfo, Part, PartGroup } from '@myrmidon/cadmus-core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ItemService } from '@myrmidon/cadmus-api';
|
|
4
|
+
import { AppRepository } from '@myrmidon/cadmus-state';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Edited item store properties.
|
|
8
|
+
*/
|
|
9
|
+
export interface EditedItemProps {
|
|
10
|
+
/**
|
|
11
|
+
* The item being edited.
|
|
12
|
+
*/
|
|
13
|
+
item?: Item;
|
|
14
|
+
/**
|
|
15
|
+
* The raw list of item's parts.
|
|
16
|
+
*/
|
|
17
|
+
parts: Part[];
|
|
18
|
+
/**
|
|
19
|
+
* The item's parts, grouped.
|
|
20
|
+
*/
|
|
21
|
+
partGroups: PartGroup[];
|
|
22
|
+
/**
|
|
23
|
+
* The set of all the possible layer parts for this item, either
|
|
24
|
+
* present or absent.
|
|
25
|
+
*/
|
|
26
|
+
layerPartInfos: LayerPartInfo[];
|
|
27
|
+
/**
|
|
28
|
+
* The facet definition assigned to the item.
|
|
29
|
+
*/
|
|
30
|
+
facet?: FacetDefinition;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Edited item ELF repository.
|
|
34
|
+
*/
|
|
35
|
+
export declare class EditedItemRepository {
|
|
36
|
+
private _appRepository;
|
|
37
|
+
private _itemService;
|
|
38
|
+
private _store;
|
|
39
|
+
item$: Observable<Item | undefined>;
|
|
40
|
+
parts$: Observable<Part[]>;
|
|
41
|
+
partGroups$: Observable<PartGroup[]>;
|
|
42
|
+
layers$: Observable<LayerPartInfo[]>;
|
|
43
|
+
facet$: Observable<FacetDefinition | undefined>;
|
|
44
|
+
constructor(_appRepository: AppRepository, _itemService: ItemService);
|
|
45
|
+
getValue(): EditedItemProps;
|
|
46
|
+
getItem(): Item | undefined;
|
|
47
|
+
getFacet(): FacetDefinition | undefined;
|
|
48
|
+
getPartGroups(): PartGroup[];
|
|
49
|
+
private pickDefaultFacet;
|
|
50
|
+
/**
|
|
51
|
+
* Load the specified item or a new item.
|
|
52
|
+
*
|
|
53
|
+
* @param itemId The item ID, or undefined for a new item.
|
|
54
|
+
*/
|
|
55
|
+
load(itemId?: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* Ensure that the item with the specified ID is loaded.
|
|
58
|
+
*
|
|
59
|
+
* @param id The item ID.
|
|
60
|
+
*/
|
|
61
|
+
ensureItemLoaded(id: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Save the specified item.
|
|
64
|
+
*
|
|
65
|
+
* @param item The item.
|
|
66
|
+
* @returns Promise with saved item.
|
|
67
|
+
*/
|
|
68
|
+
save(item: Item): Promise<Item>;
|
|
69
|
+
/**
|
|
70
|
+
* Delete the specified part from this edited item.
|
|
71
|
+
*
|
|
72
|
+
* @param id The part's ID.
|
|
73
|
+
* @returns Promise with part ID.
|
|
74
|
+
*/
|
|
75
|
+
deletePart(id: string): Promise<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Add a new layer part to this item.
|
|
78
|
+
*
|
|
79
|
+
* @param typeId The part type ID.
|
|
80
|
+
* @param roleId The part role ID.
|
|
81
|
+
* @returns Promise with new part.
|
|
82
|
+
*/
|
|
83
|
+
addNewLayerPart(typeId: string, roleId?: string): Promise<Part>;
|
|
84
|
+
/**
|
|
85
|
+
* Set the scope for the specified parts in this item.
|
|
86
|
+
*
|
|
87
|
+
* @param ids The part IDs.
|
|
88
|
+
* @param scope The scope to set.
|
|
89
|
+
* @returns Promise.
|
|
90
|
+
*/
|
|
91
|
+
setPartThesaurusScope(ids: string[], scope: string): Promise<boolean>;
|
|
92
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EditedItemRepository, never>;
|
|
93
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EditedItemRepository>;
|
|
94
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrmidon/cadmus-item-editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Cadmus - item editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Cadmus"
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"name": "Daniele Fusi"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@angular/common": "^
|
|
18
|
-
"@angular/core": "^
|
|
17
|
+
"@angular/common": "^15.0.0",
|
|
18
|
+
"@angular/core": "^15.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"tslib": "^2.3.0"
|
package/public-api.d.ts
CHANGED