@myrmidon/cadmus-core 0.1.0 → 1.0.1
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 +2 -2
- package/esm2020/lib/cadmus-core.module.mjs +8 -7
- package/esm2020/lib/guards/pending-changes.guard.mjs +5 -5
- package/esm2020/lib/models.mjs +1 -1
- package/esm2020/lib/pipes/sort.pipe.mjs +5 -4
- package/esm2020/lib/services/library-route.service.mjs +20 -19
- package/esm2020/lib/services/text-layer.service.mjs +30 -28
- package/esm2020/lib/text-range.mjs +1 -1
- package/esm2020/lib/token-location.mjs +3 -3
- package/esm2020/lib/token-point.mjs +2 -2
- package/esm2020/public-api.mjs +1 -12
- package/fesm2015/myrmidon-cadmus-core.mjs +68 -1371
- package/fesm2015/myrmidon-cadmus-core.mjs.map +1 -1
- package/fesm2020/myrmidon-cadmus-core.mjs +67 -1371
- package/fesm2020/myrmidon-cadmus-core.mjs.map +1 -1
- package/lib/cadmus-core.module.d.ts +2 -1
- package/lib/models.d.ts +1 -94
- package/lib/services/library-route.service.d.ts +7 -7
- package/lib/services/text-layer.service.d.ts +6 -6
- package/lib/text-range.d.ts +1 -1
- package/lib/token-location.d.ts +1 -1
- package/lib/token-point.d.ts +1 -1
- package/package.json +5 -5
- package/public-api.d.ts +0 -10
- package/esm2020/lib/datation.mjs +0 -520
- package/esm2020/lib/historical-date.mjs +0 -297
- package/esm2020/lib/roman-number.mjs +0 -155
- package/esm2020/lib/services/env.service.mjs +0 -77
- package/esm2020/lib/services/env.service.provider.mjs +0 -31
- package/esm2020/lib/services/error.service.mjs +0 -40
- package/esm2020/lib/services/gravatar.service.mjs +0 -30
- package/esm2020/lib/services/local-storage.service.mjs +0 -101
- package/esm2020/lib/utils.mjs +0 -36
- package/esm2020/lib/validators/password.validator.mjs +0 -34
- package/lib/datation.d.ts +0 -157
- package/lib/historical-date.d.ts +0 -84
- package/lib/roman-number.d.ts +0 -34
- package/lib/services/env.service.d.ts +0 -55
- package/lib/services/env.service.provider.d.ts +0 -15
- package/lib/services/error.service.d.ts +0 -16
- package/lib/services/gravatar.service.d.ts +0 -12
- package/lib/services/local-storage.service.d.ts +0 -35
- package/lib/utils.d.ts +0 -4
- package/lib/validators/password.validator.d.ts +0 -6
package/lib/models.d.ts
CHANGED
|
@@ -7,23 +7,6 @@ export interface HasVersion {
|
|
|
7
7
|
timeModified: Date;
|
|
8
8
|
userId: string;
|
|
9
9
|
}
|
|
10
|
-
/**
|
|
11
|
-
* A page of data.
|
|
12
|
-
*/
|
|
13
|
-
export interface DataPage<T> {
|
|
14
|
-
pageNumber: number;
|
|
15
|
-
pageSize: number;
|
|
16
|
-
pageCount: number;
|
|
17
|
-
total: number;
|
|
18
|
-
items: T[];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* A wrapper for a value or an optional error message.
|
|
22
|
-
*/
|
|
23
|
-
export interface ErrorWrapper<T> {
|
|
24
|
-
value?: T;
|
|
25
|
-
error?: string;
|
|
26
|
-
}
|
|
27
10
|
/**
|
|
28
11
|
* Item's properties, excluding its parts.
|
|
29
12
|
*/
|
|
@@ -99,7 +82,7 @@ export interface DataPinDefinition {
|
|
|
99
82
|
*/
|
|
100
83
|
export interface PartTypeIds {
|
|
101
84
|
typeId: string;
|
|
102
|
-
roleId
|
|
85
|
+
roleId?: string;
|
|
103
86
|
}
|
|
104
87
|
/**
|
|
105
88
|
* Part. This is the minimal set of properties present in all the
|
|
@@ -276,34 +259,6 @@ export interface PartGroup {
|
|
|
276
259
|
label: string;
|
|
277
260
|
parts: Part[];
|
|
278
261
|
}
|
|
279
|
-
/**
|
|
280
|
-
* A document reference, usually including an author and a work.
|
|
281
|
-
*/
|
|
282
|
-
export interface DocReference {
|
|
283
|
-
tag?: string;
|
|
284
|
-
author: string;
|
|
285
|
-
work: string;
|
|
286
|
-
location?: string;
|
|
287
|
-
note?: string;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* A physical dimension value.
|
|
291
|
-
*/
|
|
292
|
-
export interface PhysicalDimension {
|
|
293
|
-
tag?: string;
|
|
294
|
-
value: number;
|
|
295
|
-
unit: string;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* A physical 1D, 2D or 3D size.
|
|
299
|
-
*/
|
|
300
|
-
export interface PhysicalSize {
|
|
301
|
-
tag?: string;
|
|
302
|
-
w?: PhysicalDimension;
|
|
303
|
-
h?: PhysicalDimension;
|
|
304
|
-
d?: PhysicalDimension;
|
|
305
|
-
note?: string;
|
|
306
|
-
}
|
|
307
262
|
/**
|
|
308
263
|
* Essential information about a user.
|
|
309
264
|
*/
|
|
@@ -319,51 +274,3 @@ export interface LoginCredentials {
|
|
|
319
274
|
name: string;
|
|
320
275
|
password: string;
|
|
321
276
|
}
|
|
322
|
-
/**
|
|
323
|
-
* Login result.
|
|
324
|
-
*/
|
|
325
|
-
export interface LoginResult {
|
|
326
|
-
token: string;
|
|
327
|
-
expiration: Date;
|
|
328
|
-
}
|
|
329
|
-
export interface ExistResult {
|
|
330
|
-
entry: string;
|
|
331
|
-
isExisting: boolean;
|
|
332
|
-
}
|
|
333
|
-
export interface RegistrationModel {
|
|
334
|
-
email: string;
|
|
335
|
-
name: string;
|
|
336
|
-
firstName: string;
|
|
337
|
-
lastName: string;
|
|
338
|
-
password: string;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Authenticated user data.
|
|
342
|
-
*/
|
|
343
|
-
export interface User {
|
|
344
|
-
userName: string;
|
|
345
|
-
email: string;
|
|
346
|
-
roles: string[];
|
|
347
|
-
emailConfirmed?: boolean;
|
|
348
|
-
firstName: string;
|
|
349
|
-
lastName: string;
|
|
350
|
-
lockoutEnabled?: boolean;
|
|
351
|
-
lockoutEnd?: Date;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* User filter parameters.
|
|
355
|
-
*/
|
|
356
|
-
export interface UserFilter {
|
|
357
|
-
pageNumber: number;
|
|
358
|
-
pageSize: number;
|
|
359
|
-
name?: string;
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Password change data.
|
|
363
|
-
*/
|
|
364
|
-
export interface PasswordChange {
|
|
365
|
-
email: string;
|
|
366
|
-
oldPassword: string;
|
|
367
|
-
newPassword: string;
|
|
368
|
-
confirmPassword: string;
|
|
369
|
-
}
|
|
@@ -41,10 +41,10 @@ export declare class LibraryRouteService {
|
|
|
41
41
|
* @returns An object where frTypeId=fragment type ID and frRoleId=fragment role
|
|
42
42
|
* ID, or null.
|
|
43
43
|
*/
|
|
44
|
-
getFragmentTypeAndRole(roleId
|
|
44
|
+
getFragmentTypeAndRole(roleId?: string): {
|
|
45
45
|
frTypeId: string;
|
|
46
|
-
frRoleId
|
|
47
|
-
};
|
|
46
|
+
frRoleId?: string;
|
|
47
|
+
} | null;
|
|
48
48
|
/**
|
|
49
49
|
* Find among the specified parts definitions the one matching the specified
|
|
50
50
|
* type ID, and eventually role ID when specified.
|
|
@@ -52,7 +52,7 @@ export declare class LibraryRouteService {
|
|
|
52
52
|
* @param partDefs The parts definitions.
|
|
53
53
|
* @param typeId The type ID.
|
|
54
54
|
* @param roleId The role ID or null.
|
|
55
|
-
* @returns Part definition or
|
|
55
|
+
* @returns Part definition or undefined if not found.
|
|
56
56
|
*/
|
|
57
57
|
private findPartDefinition;
|
|
58
58
|
/**
|
|
@@ -99,7 +99,7 @@ export declare class LibraryRouteService {
|
|
|
99
99
|
*/
|
|
100
100
|
buildPartEditorRoute(itemId: string, partId: string, typeId: string, roleId?: string): {
|
|
101
101
|
route: string;
|
|
102
|
-
rid
|
|
102
|
+
rid?: string;
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
105
|
* Build the route to the fragment editor corresponding to the specified
|
|
@@ -114,9 +114,9 @@ export declare class LibraryRouteService {
|
|
|
114
114
|
* @returns Object with a route property and an optional rid property
|
|
115
115
|
* representing the role ID, which will be rendered as a query parameter.
|
|
116
116
|
*/
|
|
117
|
-
buildFragmentEditorRoute(partDefs: PartDefinition[], itemId: string, partId: string, typeId: string, roleId: string, loc: string): {
|
|
117
|
+
buildFragmentEditorRoute(partDefs: PartDefinition[], itemId: string, partId: string, typeId: string, roleId: string | undefined, loc: string): {
|
|
118
118
|
route: string;
|
|
119
|
-
rid
|
|
119
|
+
rid?: string;
|
|
120
120
|
};
|
|
121
121
|
static ɵfac: i0.ɵɵFactoryDeclaration<LibraryRouteService, never>;
|
|
122
122
|
static ɵprov: i0.ɵɵInjectableDeclaration<LibraryRouteService>;
|
|
@@ -69,12 +69,12 @@ export declare class TextLayerService {
|
|
|
69
69
|
* fragment if any. The selected fragment gets decorated with an additional
|
|
70
70
|
* class value.
|
|
71
71
|
*/
|
|
72
|
-
render(text: string, locations
|
|
72
|
+
render(text: string, locations?: TokenLocation[], selectedLoc?: TokenLocation): string;
|
|
73
73
|
/**
|
|
74
74
|
* Get the Y bounds from the specified selection.
|
|
75
75
|
* @param range The selection range.
|
|
76
76
|
* @param forNew True if getting bounds for a new fragment.
|
|
77
|
-
* @returns Range, inclusive.
|
|
77
|
+
* @returns Range, inclusive, or undefined.
|
|
78
78
|
*/
|
|
79
79
|
private getYBoundsFromRange;
|
|
80
80
|
private locatePrevSpace;
|
|
@@ -122,7 +122,7 @@ export declare class TextLayerService {
|
|
|
122
122
|
* current selection using getSelectedRange().
|
|
123
123
|
* @returns The token location or null.
|
|
124
124
|
*/
|
|
125
|
-
getSelectedLocationForEdit(range: SelectedRange): TokenLocation;
|
|
125
|
+
getSelectedLocationForEdit(range: SelectedRange): TokenLocation | null;
|
|
126
126
|
private textLineToString;
|
|
127
127
|
private buildCoords;
|
|
128
128
|
/**
|
|
@@ -142,14 +142,14 @@ export declare class TextLayerService {
|
|
|
142
142
|
* @param range The selected range. You can get it from the
|
|
143
143
|
* current selection using getSelectedRange().
|
|
144
144
|
* @param text The full base text.
|
|
145
|
-
* @returns TokenLocation The token location or
|
|
145
|
+
* @returns TokenLocation The token location or undefined.
|
|
146
146
|
*/
|
|
147
|
-
getSelectedLocationForNew(range: SelectedRange, text: string): TokenLocation;
|
|
147
|
+
getSelectedLocationForNew(range: SelectedRange, text: string): TokenLocation | null;
|
|
148
148
|
/**
|
|
149
149
|
* Get the currently selected range in the browser's document.
|
|
150
150
|
* This uses the rangy library.
|
|
151
151
|
*/
|
|
152
|
-
getSelectedRange(): Range;
|
|
152
|
+
getSelectedRange(): Range | null;
|
|
153
153
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextLayerService, never>;
|
|
154
154
|
static ɵprov: i0.ɵɵInjectableDeclaration<TextLayerService>;
|
|
155
155
|
}
|
package/lib/text-range.d.ts
CHANGED
package/lib/token-location.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class TokenLocation {
|
|
|
9
9
|
* TokenPoint.parse (e.g. Y.X or Y.X@AxR or Y.X@A, where R=1).
|
|
10
10
|
* @param text The text to parse.
|
|
11
11
|
*/
|
|
12
|
-
static parse(text: string): TokenLocation;
|
|
12
|
+
static parse(text: string): TokenLocation | null;
|
|
13
13
|
constructor(primary: TokenPoint, secondary?: TokenPoint);
|
|
14
14
|
isRange(): boolean;
|
|
15
15
|
toString(): string;
|
package/lib/token-point.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class TokenPoint {
|
|
|
11
11
|
* @param text The text to parse, in the forms Y.X or Y.X@AxR or
|
|
12
12
|
* Y.X@A, where R=1.
|
|
13
13
|
*/
|
|
14
|
-
static parse(text: string): TokenPoint;
|
|
14
|
+
static parse(text: string): TokenPoint | null;
|
|
15
15
|
constructor(y: number, x: number, at?: number, run?: number);
|
|
16
16
|
toString(): string;
|
|
17
17
|
compareTo(other: TokenPoint): number;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrmidon/cadmus-core",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "Cadmus - core
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Cadmus - core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Cadmus"
|
|
7
7
|
],
|
|
8
|
-
"homepage": "https://github.com/vedph/
|
|
8
|
+
"homepage": "https://github.com/vedph/cadmus-shell",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/vedph/
|
|
11
|
+
"url": "https://github.com/vedph/cadmus-shell"
|
|
12
12
|
},
|
|
13
13
|
"author": {
|
|
14
14
|
"name": "Daniele Fusi"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@angular/core": "^13.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"tslib": "^2.
|
|
21
|
+
"tslib": "^2.3.0"
|
|
22
22
|
},
|
|
23
23
|
"module": "fesm2015/myrmidon-cadmus-core.mjs",
|
|
24
24
|
"es2020": "fesm2020/myrmidon-cadmus-core.mjs",
|
package/public-api.d.ts
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
export * from './lib/datation';
|
|
2
|
-
export * from './lib/historical-date';
|
|
3
1
|
export * from './lib/models';
|
|
4
|
-
export * from './lib/roman-number';
|
|
5
2
|
export * from './lib/text-range';
|
|
6
3
|
export * from './lib/token-location';
|
|
7
4
|
export * from './lib/token-point';
|
|
8
|
-
export * from './lib/utils';
|
|
9
5
|
export * from './lib/guards/pending-changes.guard';
|
|
10
6
|
export * from './lib/pipes/sort.pipe';
|
|
11
|
-
export * from './lib/services/env.service';
|
|
12
|
-
export * from './lib/services/env.service.provider';
|
|
13
|
-
export * from './lib/services/error.service';
|
|
14
|
-
export * from './lib/services/gravatar.service';
|
|
15
7
|
export * from './lib/services/library-route.service';
|
|
16
|
-
export * from './lib/services/local-storage.service';
|
|
17
8
|
export * from './lib/services/text-layer.service';
|
|
18
9
|
export * from './lib/validators/cadmus-validators';
|
|
19
|
-
export * from './lib/validators/password.validator';
|
|
20
10
|
export * from './lib/cadmus-core.module';
|