@myrmidon/cadmus-core 2.0.1 → 5.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/cadmus-core.module.mjs +21 -0
- package/esm2022/lib/guards/pending-changes.guard.mjs +27 -0
- package/esm2022/lib/models.mjs +24 -0
- package/esm2022/lib/pipes/sort.pipe.mjs +43 -0
- package/esm2022/lib/services/library-route.service.mjs +212 -0
- package/esm2022/lib/services/text-layer.service.mjs +732 -0
- package/esm2022/lib/text-range.mjs +58 -0
- package/esm2022/lib/token-location.mjs +74 -0
- package/esm2022/lib/token-point.mjs +65 -0
- package/{esm2020 → esm2022}/myrmidon-cadmus-core.mjs +4 -4
- package/{esm2020 → esm2022}/public-api.mjs +12 -12
- package/{fesm2020 → fesm2022}/myrmidon-cadmus-core.mjs +1218 -1168
- package/fesm2022/myrmidon-cadmus-core.mjs.map +1 -0
- package/index.d.ts +5 -5
- package/lib/cadmus-core.module.d.ts +10 -10
- package/lib/guards/pending-changes.guard.d.ts +18 -19
- package/lib/models.d.ts +284 -283
- package/lib/pipes/sort.pipe.d.ts +10 -10
- package/lib/services/library-route.service.d.ts +123 -123
- package/lib/services/text-layer.service.d.ts +162 -154
- package/lib/text-range.d.ts +36 -36
- package/lib/token-location.d.ts +18 -18
- package/lib/token-point.d.ts +19 -19
- package/package.json +8 -14
- package/public-api.d.ts +9 -9
- package/esm2020/lib/cadmus-core.module.mjs +0 -20
- package/esm2020/lib/guards/pending-changes.guard.mjs +0 -26
- package/esm2020/lib/models.mjs +0 -24
- package/esm2020/lib/pipes/sort.pipe.mjs +0 -42
- package/esm2020/lib/services/library-route.service.mjs +0 -211
- package/esm2020/lib/services/text-layer.service.mjs +0 -681
- package/esm2020/lib/text-range.mjs +0 -58
- package/esm2020/lib/token-location.mjs +0 -74
- package/esm2020/lib/token-point.mjs +0 -65
- package/fesm2015/myrmidon-cadmus-core.mjs +0 -1205
- package/fesm2015/myrmidon-cadmus-core.mjs.map +0 -1
- package/fesm2020/myrmidon-cadmus-core.mjs.map +0 -1
package/lib/models.d.ts
CHANGED
|
@@ -1,283 +1,284 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface implemented by versioned storage objects.
|
|
3
|
-
*/
|
|
4
|
-
export interface HasVersion {
|
|
5
|
-
timeCreated: Date;
|
|
6
|
-
creatorId: string;
|
|
7
|
-
timeModified: Date;
|
|
8
|
-
userId: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Item's properties, excluding its parts.
|
|
12
|
-
*/
|
|
13
|
-
export interface Item extends HasVersion {
|
|
14
|
-
id: string;
|
|
15
|
-
title: string;
|
|
16
|
-
description: string;
|
|
17
|
-
facetId: string;
|
|
18
|
-
groupId: string;
|
|
19
|
-
sortKey: string;
|
|
20
|
-
flags: number;
|
|
21
|
-
parts?: Part[];
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Flags matching mode.
|
|
25
|
-
*/
|
|
26
|
-
export declare enum FlagMatching {
|
|
27
|
-
none = -1,
|
|
28
|
-
bitsAllSet = 0,
|
|
29
|
-
bitsAnySet = 1,
|
|
30
|
-
bitsAllClear = 2,
|
|
31
|
-
bitsAnyClear = 3
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Filter for items.
|
|
35
|
-
*/
|
|
36
|
-
export interface ItemFilter {
|
|
37
|
-
title?: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
facetId?: string;
|
|
40
|
-
groupId?: string;
|
|
41
|
-
flags?: number;
|
|
42
|
-
flagMatching?: FlagMatching;
|
|
43
|
-
minModified?: Date;
|
|
44
|
-
maxModified?: Date;
|
|
45
|
-
userId?: string;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Essential information about an item.
|
|
49
|
-
*/
|
|
50
|
-
export interface ItemInfo extends HasVersion {
|
|
51
|
-
id: string;
|
|
52
|
-
title: string;
|
|
53
|
-
description: string;
|
|
54
|
-
facetId: string;
|
|
55
|
-
groupId: string;
|
|
56
|
-
sortKey: string;
|
|
57
|
-
flags: number;
|
|
58
|
-
payload?: any;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Information about a data pin; returned by pins search.
|
|
62
|
-
*/
|
|
63
|
-
export interface DataPinInfo {
|
|
64
|
-
itemId: string;
|
|
65
|
-
partId: string;
|
|
66
|
-
roleId: string | null;
|
|
67
|
-
partTypeId: string;
|
|
68
|
-
name: string;
|
|
69
|
-
value: string;
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* used
|
|
229
|
-
*
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
* type IDs
|
|
240
|
-
*
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
*
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Interface implemented by versioned storage objects.
|
|
3
|
+
*/
|
|
4
|
+
export interface HasVersion {
|
|
5
|
+
timeCreated: Date;
|
|
6
|
+
creatorId: string;
|
|
7
|
+
timeModified: Date;
|
|
8
|
+
userId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Item's properties, excluding its parts.
|
|
12
|
+
*/
|
|
13
|
+
export interface Item extends HasVersion {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
facetId: string;
|
|
18
|
+
groupId: string;
|
|
19
|
+
sortKey: string;
|
|
20
|
+
flags: number;
|
|
21
|
+
parts?: Part[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Flags matching mode.
|
|
25
|
+
*/
|
|
26
|
+
export declare enum FlagMatching {
|
|
27
|
+
none = -1,
|
|
28
|
+
bitsAllSet = 0,
|
|
29
|
+
bitsAnySet = 1,
|
|
30
|
+
bitsAllClear = 2,
|
|
31
|
+
bitsAnyClear = 3
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Filter for items.
|
|
35
|
+
*/
|
|
36
|
+
export interface ItemFilter {
|
|
37
|
+
title?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
facetId?: string;
|
|
40
|
+
groupId?: string;
|
|
41
|
+
flags?: number;
|
|
42
|
+
flagMatching?: FlagMatching;
|
|
43
|
+
minModified?: Date;
|
|
44
|
+
maxModified?: Date;
|
|
45
|
+
userId?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Essential information about an item.
|
|
49
|
+
*/
|
|
50
|
+
export interface ItemInfo extends HasVersion {
|
|
51
|
+
id: string;
|
|
52
|
+
title: string;
|
|
53
|
+
description: string;
|
|
54
|
+
facetId: string;
|
|
55
|
+
groupId: string;
|
|
56
|
+
sortKey: string;
|
|
57
|
+
flags: number;
|
|
58
|
+
payload?: any;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Information about a data pin; returned by pins search.
|
|
62
|
+
*/
|
|
63
|
+
export interface DataPinInfo {
|
|
64
|
+
itemId: string;
|
|
65
|
+
partId: string;
|
|
66
|
+
roleId: string | null;
|
|
67
|
+
partTypeId: string;
|
|
68
|
+
name: string;
|
|
69
|
+
value: string;
|
|
70
|
+
tag?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Data pin value type in a DataPinDefinition.
|
|
74
|
+
*/
|
|
75
|
+
export declare enum DataPinValueType {
|
|
76
|
+
string = 0,
|
|
77
|
+
boolean = 1,
|
|
78
|
+
integer = 2,
|
|
79
|
+
decimal = 3
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Definition of a data pin.
|
|
83
|
+
*/
|
|
84
|
+
export interface DataPinDefinition {
|
|
85
|
+
name: string;
|
|
86
|
+
type: DataPinValueType;
|
|
87
|
+
tip?: string;
|
|
88
|
+
attributes?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Part type and role IDs.
|
|
92
|
+
*/
|
|
93
|
+
export interface PartTypeIds {
|
|
94
|
+
typeId: string;
|
|
95
|
+
roleId?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Part. This is the minimal set of properties present in all the
|
|
99
|
+
* parts. Each part then adds its own properties, extending this interface.
|
|
100
|
+
*/
|
|
101
|
+
export interface Part extends HasVersion, PartTypeIds {
|
|
102
|
+
id: string;
|
|
103
|
+
itemId: string;
|
|
104
|
+
thesaurusScope?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Essential information about a layer part.
|
|
108
|
+
*/
|
|
109
|
+
export interface LayerPartInfo extends HasVersion, PartTypeIds {
|
|
110
|
+
id: string;
|
|
111
|
+
itemId: string;
|
|
112
|
+
fragmentCount: number;
|
|
113
|
+
isAbsent: boolean;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Text layer fragment. This is the minimal set of properties present in all the
|
|
117
|
+
* fragments. Each fragment then adds its own properties, extending this
|
|
118
|
+
* interface.
|
|
119
|
+
* Every fragment has a location, and can be enriched with the corresponding
|
|
120
|
+
* base text when used in views.
|
|
121
|
+
*/
|
|
122
|
+
export interface Fragment {
|
|
123
|
+
location: string;
|
|
124
|
+
baseText?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Text layer part. This represents a special type of part,
|
|
128
|
+
* whose only content is a collection of fragments.
|
|
129
|
+
*/
|
|
130
|
+
export interface TextLayerPart extends Part {
|
|
131
|
+
fragments: Fragment[];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A text line in a base text part.
|
|
135
|
+
*/
|
|
136
|
+
export interface TokenTextLayerLine {
|
|
137
|
+
y: number;
|
|
138
|
+
tokens: string[];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Token-based text coordinates.
|
|
142
|
+
*/
|
|
143
|
+
export interface TextCoords {
|
|
144
|
+
y: number;
|
|
145
|
+
x: number;
|
|
146
|
+
at?: number;
|
|
147
|
+
run?: number;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Layer reconciliation hint for a single fragment.
|
|
151
|
+
*/
|
|
152
|
+
export interface LayerHint {
|
|
153
|
+
location: string;
|
|
154
|
+
editOperation: string;
|
|
155
|
+
patchOperation?: string;
|
|
156
|
+
impactLevel: number;
|
|
157
|
+
description?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A single entry in a thesaurus.
|
|
161
|
+
*/
|
|
162
|
+
export interface ThesaurusEntry {
|
|
163
|
+
id: string;
|
|
164
|
+
value: string;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* A set of thesaurus entries.
|
|
168
|
+
*/
|
|
169
|
+
export interface Thesaurus {
|
|
170
|
+
id: string;
|
|
171
|
+
language?: string;
|
|
172
|
+
targetId?: string;
|
|
173
|
+
entries?: ThesaurusEntry[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* A set of thesauri which get passed to an editor component.
|
|
177
|
+
* In the set, each thesaurus is identified by an arbitrarily
|
|
178
|
+
* defined key, which is unique only within the context of the editor
|
|
179
|
+
* consuming the set, and refers to frontend only.
|
|
180
|
+
*/
|
|
181
|
+
export interface ThesauriSet {
|
|
182
|
+
[key: string]: Thesaurus;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Filter for thesauri.
|
|
186
|
+
*/
|
|
187
|
+
export interface ThesaurusFilter {
|
|
188
|
+
id?: string;
|
|
189
|
+
isAlias?: boolean;
|
|
190
|
+
language?: string;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Part definition in a facet.
|
|
194
|
+
*/
|
|
195
|
+
export interface PartDefinition extends PartTypeIds {
|
|
196
|
+
name: string;
|
|
197
|
+
description: string;
|
|
198
|
+
isRequired: boolean;
|
|
199
|
+
colorKey: string;
|
|
200
|
+
groupKey: string;
|
|
201
|
+
sortKey: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Fragment definition in a facet.
|
|
205
|
+
*/
|
|
206
|
+
/**
|
|
207
|
+
* Facet definition.
|
|
208
|
+
*/
|
|
209
|
+
export interface FacetDefinition {
|
|
210
|
+
id: string;
|
|
211
|
+
label: string;
|
|
212
|
+
colorKey: string;
|
|
213
|
+
description: string;
|
|
214
|
+
partDefinitions: PartDefinition[];
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Flag definition.
|
|
218
|
+
*/
|
|
219
|
+
export interface FlagDefinition {
|
|
220
|
+
id: number;
|
|
221
|
+
label: string;
|
|
222
|
+
description: string;
|
|
223
|
+
colorKey: string;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The group key for a part type. This is used in EditorKeys objects
|
|
227
|
+
* to map a specific part ID with all its fragment IDs into group key(s).
|
|
228
|
+
* The part ID is used alone with normal parts; for layer parts, it is
|
|
229
|
+
* used in conjunction with 1 or more fragment type IDs, each mapped to
|
|
230
|
+
* a corresponding editor key.
|
|
231
|
+
*/
|
|
232
|
+
export interface PartGroupKey {
|
|
233
|
+
part: string;
|
|
234
|
+
fragments?: {
|
|
235
|
+
[key: string]: string;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Part type IDs to editor keys mappings. This contains a set of component
|
|
240
|
+
* type IDs (parts and parts + fragments) mapped to editor keys, which are
|
|
241
|
+
* used to build their routes in the UI.
|
|
242
|
+
*/
|
|
243
|
+
export interface PartEditorKeys {
|
|
244
|
+
[key: string]: PartGroupKey;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* An index lookup definition, used in dynamic lookup to provide the set
|
|
248
|
+
* of parameters required for a data pins based search.
|
|
249
|
+
*/
|
|
250
|
+
export interface IndexLookupDefinition {
|
|
251
|
+
typeId?: string;
|
|
252
|
+
roleId?: string;
|
|
253
|
+
name: string;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* A dictionary of index lookup definitions.
|
|
257
|
+
*/
|
|
258
|
+
export interface IndexLookupDefinitions {
|
|
259
|
+
[key: string]: IndexLookupDefinition;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* A group of parts. Usually the item's parts are grouped according
|
|
263
|
+
* to their metadata, and presented in this way.
|
|
264
|
+
*/
|
|
265
|
+
export interface PartGroup {
|
|
266
|
+
key: string;
|
|
267
|
+
label: string;
|
|
268
|
+
parts: Part[];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Essential information about a user.
|
|
272
|
+
*/
|
|
273
|
+
export interface UserInfo {
|
|
274
|
+
userName: string;
|
|
275
|
+
firstName: string;
|
|
276
|
+
lastName: string;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Login credentials.
|
|
280
|
+
*/
|
|
281
|
+
export interface LoginCredentials {
|
|
282
|
+
name: string;
|
|
283
|
+
password: string;
|
|
284
|
+
}
|
package/lib/pipes/sort.pipe.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
/**
|
|
4
|
-
* Sort pipe. Use like *ngFor="let i of items | sort:'propname'".
|
|
5
|
-
*/
|
|
6
|
-
export declare class SortPipe implements PipeTransform {
|
|
7
|
-
transform(value: any[], propName: string): unknown;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SortPipe, never>;
|
|
9
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<SortPipe, "sort", false>;
|
|
10
|
-
}
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Sort pipe. Use like *ngFor="let i of items | sort:'propname'".
|
|
5
|
+
*/
|
|
6
|
+
export declare class SortPipe implements PipeTransform {
|
|
7
|
+
transform(value: any[], propName: string): unknown;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SortPipe, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SortPipe, "sort", false>;
|
|
10
|
+
}
|