@myrmidon/cadmus-core 2.0.2 → 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.
Files changed (32) hide show
  1. package/{esm2020 → esm2022}/lib/cadmus-core.module.mjs +20 -20
  2. package/{esm2020 → esm2022}/lib/guards/pending-changes.guard.mjs +26 -26
  3. package/esm2022/lib/models.mjs +24 -0
  4. package/{esm2020 → esm2022}/lib/pipes/sort.pipe.mjs +42 -42
  5. package/{esm2020 → esm2022}/lib/services/library-route.service.mjs +211 -211
  6. package/{esm2020 → esm2022}/lib/services/text-layer.service.mjs +731 -731
  7. package/esm2022/lib/text-range.mjs +58 -0
  8. package/esm2022/lib/token-location.mjs +74 -0
  9. package/esm2022/lib/token-point.mjs +65 -0
  10. package/{esm2020 → esm2022}/myrmidon-cadmus-core.mjs +4 -4
  11. package/{esm2020 → esm2022}/public-api.mjs +12 -12
  12. package/{fesm2020 → fesm2022}/myrmidon-cadmus-core.mjs +1221 -1222
  13. package/fesm2022/myrmidon-cadmus-core.mjs.map +1 -0
  14. package/index.d.ts +5 -5
  15. package/lib/cadmus-core.module.d.ts +10 -10
  16. package/lib/guards/pending-changes.guard.d.ts +18 -19
  17. package/lib/models.d.ts +284 -283
  18. package/lib/pipes/sort.pipe.d.ts +10 -10
  19. package/lib/services/library-route.service.d.ts +123 -123
  20. package/lib/services/text-layer.service.d.ts +162 -162
  21. package/lib/text-range.d.ts +36 -36
  22. package/lib/token-location.d.ts +18 -18
  23. package/lib/token-point.d.ts +19 -19
  24. package/package.json +8 -14
  25. package/public-api.d.ts +9 -9
  26. package/esm2020/lib/models.mjs +0 -24
  27. package/esm2020/lib/text-range.mjs +0 -58
  28. package/esm2020/lib/token-location.mjs +0 -74
  29. package/esm2020/lib/token-point.mjs +0 -65
  30. package/fesm2015/myrmidon-cadmus-core.mjs +0 -1256
  31. package/fesm2015/myrmidon-cadmus-core.mjs.map +0 -1
  32. package/fesm2020/myrmidon-cadmus-core.mjs.map +0 -1
@@ -1,1256 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Pipe, Inject, NgModule } from '@angular/core';
3
- import { take, map } from 'rxjs';
4
- import * as i1 from '@myrmidon/ng-mat-tools';
5
- import * as rangy from 'rangy';
6
- import { CommonModule } from '@angular/common';
7
- import { HttpClientModule } from '@angular/common/http';
8
- import { NgToolsModule } from '@myrmidon/ng-tools';
9
-
10
- /**
11
- * Flags matching mode.
12
- */
13
- var FlagMatching;
14
- (function (FlagMatching) {
15
- // the none value is frontend-side only, as in the backend
16
- // the flags property in ItemFilter is nullable
17
- FlagMatching[FlagMatching["none"] = -1] = "none";
18
- FlagMatching[FlagMatching["bitsAllSet"] = 0] = "bitsAllSet";
19
- FlagMatching[FlagMatching["bitsAnySet"] = 1] = "bitsAnySet";
20
- FlagMatching[FlagMatching["bitsAllClear"] = 2] = "bitsAllClear";
21
- FlagMatching[FlagMatching["bitsAnyClear"] = 3] = "bitsAnyClear";
22
- })(FlagMatching || (FlagMatching = {}));
23
- /**
24
- * Data pin value type in a DataPinDefinition.
25
- */
26
- var DataPinValueType;
27
- (function (DataPinValueType) {
28
- DataPinValueType[DataPinValueType["string"] = 0] = "string";
29
- DataPinValueType[DataPinValueType["boolean"] = 1] = "boolean";
30
- DataPinValueType[DataPinValueType["integer"] = 2] = "integer";
31
- DataPinValueType[DataPinValueType["decimal"] = 3] = "decimal";
32
- })(DataPinValueType || (DataPinValueType = {}));
33
-
34
- /**
35
- * A simple text range, expressed as start character index and characters
36
- * length. This is used for misspellings operations.
37
- */
38
- class TextRange {
39
- constructor(start, length) {
40
- if (start < 0)
41
- throw new RangeError('TextRange start less than 0');
42
- if (length < 0)
43
- throw new RangeError('TextRange length less than 0');
44
- this.start = start;
45
- this.length = length;
46
- }
47
- /**
48
- * Parse the specified text representing a range, in the form "startxlength"
49
- * or just "start" when length is 1.
50
- *
51
- * @param text The text.
52
- */
53
- static parse(text) {
54
- if (!text) {
55
- return null;
56
- }
57
- // [1]=start, ([2]=length)
58
- const m = new RegExp('(\\d+)(?:[×x](\\d+))?', 'gm').exec(text);
59
- if (!m) {
60
- return null;
61
- }
62
- return new TextRange(parseInt(m[1], 10), m[2] ? parseInt(m[2], 10) : 1);
63
- }
64
- /**
65
- * Get the inclusive end of the range.
66
- */
67
- end() {
68
- const n = this.start + this.length;
69
- return n > 0 ? n - 1 : 0;
70
- }
71
- /**
72
- * True if this range value is equal to the other range value.
73
- * @param other The other range.
74
- */
75
- isEqual(other) {
76
- if (!other) {
77
- return false;
78
- }
79
- return this.start === other.start && this.length === other.length;
80
- }
81
- /**
82
- * Get a parsable textual representation of this range.
83
- * @returns Text.
84
- */
85
- toString() {
86
- return this.length === 1
87
- ? this.start.toString()
88
- : `${this.start}×${this.length}`;
89
- }
90
- }
91
-
92
- /**
93
- * A single point in a token-based textual location.
94
- */
95
- class TokenPoint {
96
- constructor(y, x, at = 0, run = 0) {
97
- this.y = y;
98
- this.x = x;
99
- this.at = at;
100
- this.run = run;
101
- }
102
- /**
103
- * Parse the specified text representing a token-based point location.
104
- * @param text The text to parse, in the forms Y.X or Y.X@AxR or
105
- * Y.X@A, where R=1.
106
- */
107
- static parse(text) {
108
- const r = new RegExp('^(\\d+)\\.(\\d+)(?:@(\\d+)(?:x(\\d+))?)?$', 'g');
109
- const m = r.exec(text);
110
- if (!m) {
111
- return null;
112
- }
113
- const pt = new TokenPoint(parseInt(m[1], 10), parseInt(m[2], 10), m[3] ? parseInt(m[3], 10) : 0);
114
- if (m[3]) {
115
- if (m[4]) {
116
- pt.run = m[4] ? parseInt(m[4], 10) : 1;
117
- }
118
- else {
119
- pt.run = 1;
120
- }
121
- }
122
- return pt;
123
- }
124
- toString() {
125
- let s = `${this.y}.${this.x}`;
126
- if (this.at && this.run) {
127
- s += `@${this.at}`;
128
- if (this.run !== 1) {
129
- s += `x${this.run}`;
130
- }
131
- }
132
- return s;
133
- }
134
- compareTo(other) {
135
- if (this.y !== other.y) {
136
- return this.y - other.y;
137
- }
138
- if (this.x !== other.x) {
139
- return this.x - other.x;
140
- }
141
- if (this.at !== other.at) {
142
- return this.at - other.at;
143
- }
144
- return this.run - other.run;
145
- }
146
- integralCompareTo(other) {
147
- if (this.y !== other.y) {
148
- return this.y - other.y;
149
- }
150
- if (this.x !== other.x) {
151
- return this.x - other.x;
152
- }
153
- return 0;
154
- }
155
- }
156
-
157
- class TokenLocation {
158
- constructor(primary, secondary) {
159
- this.primary = primary;
160
- this.secondary = secondary;
161
- }
162
- /**
163
- * Parse the text representing a token-based location,
164
- * which has the form "primary-secondary", or just "primary",
165
- * where each of these points has the format required by
166
- * TokenPoint.parse (e.g. Y.X or Y.X@AxR or Y.X@A, where R=1).
167
- * @param text The text to parse.
168
- */
169
- static parse(text) {
170
- if (!text) {
171
- return null;
172
- }
173
- const pair = text.split('-', 2);
174
- if (pair.length === 0) {
175
- return null;
176
- }
177
- return new TokenLocation(TokenPoint.parse(pair[0]), pair.length > 1 ? TokenPoint.parse(pair[1]) || undefined : undefined);
178
- }
179
- isRange() {
180
- // note that != checks for both null and undefined, whereas !== does not
181
- return this.secondary != null;
182
- }
183
- toString() {
184
- return this.secondary
185
- ? `${this.primary.toString()}-${this.secondary.toString()}`
186
- : this.primary.toString();
187
- }
188
- compareTo(other) {
189
- const n1 = this.primary.compareTo(other.primary);
190
- if (n1 !== 0) {
191
- return n1;
192
- }
193
- if (this.secondary && other.secondary) {
194
- return this.secondary.compareTo(other.secondary);
195
- }
196
- if (!this.secondary && !other.secondary) {
197
- return 0;
198
- }
199
- return this.secondary ? 1 : -1;
200
- }
201
- overlaps(other) {
202
- // empty coords never overlaps
203
- if (!other.primary) {
204
- return false;
205
- }
206
- // (in the following comments A=this and B=other)
207
- // 1) if B is a point, cases are:
208
- // 1.1. A is a point: A overlaps with B (both points) if they're equal.
209
- // 1.2. A is a range: A (range) overlaps with B (point)
210
- // when A-left is <= B-left and A-right is >= B-right.
211
- if (other.secondary == null) {
212
- return !this.secondary
213
- ? this.primary.integralCompareTo(other.primary) === 0
214
- : this.primary.compareTo(other.primary) <= 0 &&
215
- this.secondary.compareTo(other.primary) >= 0;
216
- }
217
- // 2) if B is a range, cases are:
218
- // 2.1. A is a point: A (point) overlaps with B (range) when B-left <= A and
219
- // B-right >= A
220
- // 2.2. A is a range: A (range) overlaps with B (range)
221
- // when B-right >= A-left and B-left <= A-right
222
- return !this.secondary
223
- ? other.primary.compareTo(this.primary) <= 0 &&
224
- other.secondary.compareTo(this.primary) >= 0
225
- : other.secondary.compareTo(this.primary) >= 0 &&
226
- other.primary.compareTo(this.secondary) <= 0;
227
- }
228
- }
229
-
230
- class PendingChangesGuard {
231
- constructor(_dialogService) {
232
- this._dialogService = _dialogService;
233
- }
234
- canDeactivate(component) {
235
- // if there are no pending changes, just allow deactivation; else confirm first
236
- return !component || component.canDeactivate()
237
- ? true
238
- : this._dialogService
239
- .confirm('Warning', 'There are unsaved changes. Do you want to leave?')
240
- .pipe(take(1), map((yes) => (yes ? true : false)));
241
- }
242
- }
243
- PendingChangesGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: PendingChangesGuard, deps: [{ token: i1.DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
244
- PendingChangesGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: PendingChangesGuard, providedIn: 'root' });
245
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: PendingChangesGuard, decorators: [{
246
- type: Injectable,
247
- args: [{
248
- providedIn: 'root',
249
- }]
250
- }], ctorParameters: function () { return [{ type: i1.DialogService }]; } });
251
-
252
- /**
253
- * Sort pipe. Use like *ngFor="let i of items | sort:'propname'".
254
- */
255
- class SortPipe {
256
- transform(value, propName) {
257
- if (!value || !Array.isArray(value)) {
258
- return value;
259
- }
260
- return [...value].sort((a, b) => {
261
- if (!a && !b) {
262
- return 0;
263
- }
264
- if (!a && b) {
265
- return -1;
266
- }
267
- if (a && !b) {
268
- return 1;
269
- }
270
- if (a[propName] < b[propName]) {
271
- return -1;
272
- }
273
- else if (a[propName] === b[propName]) {
274
- return 0;
275
- }
276
- else if (a[propName] > b[propName]) {
277
- return 1;
278
- }
279
- return 0;
280
- });
281
- }
282
- }
283
- SortPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: SortPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
284
- SortPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: SortPipe, name: "sort" });
285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: SortPipe, decorators: [{
286
- type: Pipe,
287
- args: [{
288
- name: 'sort',
289
- }]
290
- }] });
291
-
292
- /**
293
- * Library route service.
294
- * This service is used to build routes to part and fragment editors,
295
- * which are hosted in an open list of library modules in the Cadmus
296
- * application.
297
- * This architecture allows lazy-loading part- and fragment-editors
298
- * only when they are required.
299
- * Each part type with its dumb UI editor component is located in a
300
- * library, named after the name of the group the part belongs to. For
301
- * instance, the model and dumb UI editor component for a part belonging
302
- * to the "general" group are located in the "parts/general/general-ui"
303
- * library.
304
- * In turn, the feature UI editor component for the same part is located
305
- * in the "parts/general/general-feature" library. This library has
306
- * a route for each part editor. For instance, the NotePart editor
307
- * component route is "items/:iid/general/it.vedph.note/:pid", where
308
- * ":iid" is the item ID and ":pid" the part ID.
309
- */
310
- class LibraryRouteService {
311
- constructor(_partEditorKeys) {
312
- this._partEditorKeys = _partEditorKeys;
313
- }
314
- /**
315
- * Strip the eventual fragment-role ID from the specified part's role ID.
316
- * For instance, a part's role ID like "fr.it.vedph.comment:scholarly"
317
- * becomes "fr.it.vedph.comment".
318
- *
319
- * @param roleId The part's role ID.
320
- */
321
- stripFragmentRoleId(roleId) {
322
- // remove the optional :fr-role from roleId
323
- const i = roleId.lastIndexOf(':');
324
- if (i > -1) {
325
- roleId = roleId.substring(0, i);
326
- }
327
- return roleId;
328
- }
329
- /**
330
- * Get the fragment type and role from the part's role ID. This starts
331
- * with "fr.", and might be followed by the role proper, introduced
332
- * by the first dot if any. For instance, "fr.it.vedph.comment" would just
333
- * return "fr.it.vedph.comment", while "fr.it.vedph.comment:scholarly"
334
- * would return "fr.it.vedph.comment". This is required to navigate to
335
- * the correct fragment editor, which is the same for each fragment type,
336
- * independently from its role.
337
- * @param roleId The part role ID.
338
- * @returns An object where frTypeId=fragment type ID and frRoleId=fragment role
339
- * ID, or null.
340
- */
341
- getFragmentTypeAndRole(roleId) {
342
- if (!roleId || !roleId.startsWith('fr.')) {
343
- return null;
344
- }
345
- const i = roleId.indexOf(':');
346
- if (i > -1) {
347
- return {
348
- frTypeId: roleId.substring(0, i),
349
- frRoleId: roleId.substring(i + 1),
350
- };
351
- }
352
- else {
353
- return {
354
- frTypeId: roleId,
355
- frRoleId: undefined,
356
- };
357
- }
358
- }
359
- /**
360
- * Find among the specified parts definitions the one matching the specified
361
- * type ID, and eventually role ID when specified.
362
- *
363
- * @param partDefs The parts definitions.
364
- * @param typeId The type ID.
365
- * @param roleId The role ID or null.
366
- * @returns Part definition or undefined if not found.
367
- */
368
- findPartDefinition(partDefs, typeId, roleId = null) {
369
- if (!partDefs) {
370
- return undefined;
371
- }
372
- // if role ID is specified, find both type and role
373
- if (roleId) {
374
- const reqRoleId = this.stripFragmentRoleId(roleId);
375
- return partDefs.find((d) => {
376
- return (d.typeId === typeId &&
377
- d.roleId &&
378
- this.stripFragmentRoleId(d.roleId) === reqRoleId);
379
- });
380
- }
381
- // else just find type ID
382
- return partDefs.find((d) => {
383
- return d.typeId === typeId;
384
- });
385
- }
386
- /**
387
- * Get the library editor key from the specified part type, looking up
388
- * the specified parts definitions.
389
- *
390
- * @param typeId The part's type ID.
391
- * @param roleId The part's role ID.
392
- */
393
- getEditorKeyFromPartType(typeId, roleId) {
394
- // find the part type ID
395
- const partGroupKey = this._partEditorKeys[typeId];
396
- if (!partGroupKey) {
397
- return {
398
- partKey: 'default',
399
- };
400
- }
401
- // additionally find the role ID if specified
402
- if (roleId) {
403
- const reqRoleId = this.stripFragmentRoleId(roleId);
404
- return {
405
- partKey: partGroupKey.part,
406
- frKey: partGroupKey.fragments[reqRoleId],
407
- };
408
- }
409
- return {
410
- partKey: partGroupKey.part,
411
- };
412
- }
413
- /**
414
- * Decompose the specified editor key into part and fragment.
415
- * A simple editor key will just provide the same value for both.
416
- *
417
- * @param key The editor key to decompose.
418
- */
419
- decomposeEditorKey(key) {
420
- const i = key.indexOf(' ');
421
- if (i > -1) {
422
- return {
423
- partKey: key.substring(0, i),
424
- frKey: key.substring(i + 1),
425
- };
426
- }
427
- else {
428
- return {
429
- partKey: key,
430
- frKey: key,
431
- };
432
- }
433
- }
434
- /**
435
- * Build the route to the part editor corresponding to the specified
436
- * part.
437
- *
438
- * A part editing route is like
439
- * "/items/<id>/<part-group>/<part-typeid>/<part-id>?rid=<role-id>",
440
- * where the role ID is optional, and may include the fragment role ID
441
- * as a suffix preceded by a colon.
442
- *
443
- * A fragment editing route is like
444
- * "/items/<id>/<part-group>/fragment/<part-id>/<fr-typeid>/<loc>?frrid=<role-id>",
445
- * where the role ID is as above, and the fragment's type ID is derived
446
- * from the part's role ID, stripping the eventual fragment's role ID out.
447
- *
448
- * @param itemId The ID of the item the parts belongs to.
449
- * @param partId The part's ID.
450
- * @param typeId The part's type ID.
451
- * @param roleId The optional part's role ID.
452
- * @returns Object with a route property and an optional rid property
453
- * representing the role ID, which will be rendered as a query parameter.
454
- */
455
- buildPartEditorRoute(itemId, partId, typeId, roleId) {
456
- let route;
457
- const editorKey = this.getEditorKeyFromPartType(typeId);
458
- // /items/<id>/<part-group>/<part-typeid>/<part-id>?rid=<role-id>
459
- route = `/items/${itemId}/${editorKey.partKey}/${typeId}/${partId}`;
460
- return {
461
- route: route,
462
- rid: roleId,
463
- };
464
- }
465
- /**
466
- * Build the route to the fragment editor corresponding to the specified
467
- * layers part and location.
468
- *
469
- * @param partDefs The parts definitions.
470
- * @param itemId The ID of the item the parts belongs to.
471
- * @param partId The part's ID.
472
- * @param typeId The part's type ID.
473
- * @param roleId The part's role ID.
474
- * @param loc The fragment's location.
475
- * @returns Object with a route property and an optional rid property
476
- * representing the role ID, which will be rendered as a query parameter.
477
- */
478
- buildFragmentEditorRoute(partDefs, itemId, partId, typeId, roleId, loc) {
479
- let route;
480
- const editorKey = this.getEditorKeyFromPartType(typeId, roleId);
481
- const { frTypeId, frRoleId } = this.getFragmentTypeAndRole(roleId);
482
- route = `/items/${itemId}/${editorKey.frKey}/fragment/${partId}/${frTypeId}/${loc}`;
483
- return {
484
- route: route,
485
- rid: frRoleId,
486
- };
487
- }
488
- }
489
- LibraryRouteService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: LibraryRouteService, deps: [{ token: 'partEditorKeys' }], target: i0.ɵɵFactoryTarget.Injectable });
490
- LibraryRouteService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: LibraryRouteService, providedIn: 'root' });
491
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: LibraryRouteService, decorators: [{
492
- type: Injectable,
493
- args: [{
494
- providedIn: 'root',
495
- }]
496
- }], ctorParameters: function () {
497
- return [{ type: undefined, decorators: [{
498
- type: Inject,
499
- args: ['partEditorKeys']
500
- }] }];
501
- } });
502
-
503
- class TextLayerService {
504
- constructor() {
505
- this._wsRegex = new RegExp('^\\s$', 'g');
506
- }
507
- isWhitespace(c) {
508
- if (!c) {
509
- return false;
510
- }
511
- if (c.length !== 1) {
512
- c = c.charAt(0);
513
- }
514
- return this._wsRegex.test(c);
515
- }
516
- /**
517
- * Extract the lines with their tokens from the specified text.
518
- * @param text the source text.
519
- * @returns lines.
520
- */
521
- getLines(text) {
522
- const results = [];
523
- if (!text) {
524
- return results;
525
- }
526
- const lines = text.split('\n');
527
- for (let y = 0; y < lines.length; y++) {
528
- const line = lines[y].trim();
529
- const l = {
530
- y: y + 1,
531
- tokens: [],
532
- };
533
- let x = 0;
534
- let xBeg = 0;
535
- while (x < line.length) {
536
- if (this.isWhitespace(line.charAt(x))) {
537
- // l.tokens.push(line.substr(xBeg, x - xBeg));
538
- l.tokens.push(line.substring(xBeg, x));
539
- x++;
540
- while (x < line.length && this.isWhitespace(line.charAt(x))) {
541
- x++;
542
- }
543
- xBeg = x;
544
- }
545
- else {
546
- x++;
547
- }
548
- }
549
- if (xBeg < x) {
550
- l.tokens.push(line.substring(xBeg));
551
- }
552
- results.push(l);
553
- }
554
- return results;
555
- }
556
- /**
557
- * Get the fragment of text defined by the specified location.
558
- *
559
- * @param text The full base text.
560
- * @param location The location to get text for.
561
- * @returns A fragment of text corresponding to location.
562
- */
563
- getTextFragment(text, location) {
564
- const lines = this.getLines(text);
565
- if (location.isRange()) {
566
- const sb = [];
567
- // for each line
568
- let yn = 0;
569
- for (let y = location.primary.y; y <= location.secondary.y; y++) {
570
- const headLine = location.primary.y === y;
571
- const tailLine = location.secondary.y === y;
572
- if (++yn > 1) {
573
- sb.push(' ');
574
- }
575
- // for each token in line
576
- let xn = 0;
577
- for (let x = headLine ? location.primary.x : 1; x <= (tailLine ? location.secondary.x : lines[y - 1].tokens.length); x++) {
578
- if (++xn > 1) {
579
- sb.push(' ');
580
- }
581
- // get token bounds
582
- let start = location.primary.at && headLine && x === location.primary.x
583
- ? location.primary.at
584
- : 1;
585
- let len = location.secondary.at && tailLine && x === location.secondary.x
586
- ? location.secondary.run || 1
587
- : -1;
588
- const token = lines[y - 1].tokens[x - 1];
589
- if (start === 1 && len === -1) {
590
- sb.push(token);
591
- }
592
- else {
593
- sb.push(token.substring(start - 1, len === -1 ? undefined : start - 1 + len));
594
- }
595
- }
596
- }
597
- return sb.join('');
598
- }
599
- else {
600
- const token = lines[location.primary.y - 1].tokens[location.primary.x - 1];
601
- return location.primary.at
602
- ? token.substring(location.primary.at - 1, location.primary.at - 1 + (location.primary.run || 1))
603
- : token;
604
- }
605
- }
606
- /*
607
- * Rendition: HTML rendering from a base text and a set of fragments locations.
608
- * Each line in the base text is rendered with p; each token in a line is
609
- * rendered with its text value, and tokens are separated by space. Layer
610
- * fragments are rendered inside a span, with an id equal to the fragment location
611
- * plus a suffix beginning with _, added only for the purpose of ensuring unique
612
- * IDs in the rendered HTML code. Example:
613
- * <div>
614
- * <p id="y1">this is line 1.</p>
615
- * <p id="y2">here's a <span id="f2.3_0">fragment</span>.</p>
616
- * </div>
617
- */
618
- /**
619
- * Render the opening span for a layer fragment.
620
- * @param loc location.
621
- * @param locPortion the index of the token's portion (0-N). This is used
622
- * to build a unique ID for each HTML span rendering a layer fragment.
623
- * @param sb the target strings array.
624
- * @param isSelected true if selected.
625
- */
626
- renderOpeningSpan(loc, locPortion, sb, isSelected) {
627
- sb.push(`<span id="f${loc.toString()}_${locPortion}" class="fr${isSelected ? 'fr-sel' : ''}">`);
628
- }
629
- /**
630
- * Render the specified token intersecting the specified end-fragment location.
631
- * @param pt The point.
632
- * @param token The token.
633
- * @param sb The target array.
634
- */
635
- renderTokenAtEnd(pt, token, sb) {
636
- if (pt.at) {
637
- // ...to]
638
- // sb.push(token.substr(pt.at - 1, pt.run));
639
- sb.push(token.substring(pt.at - 1, (pt.run || 0) + pt.at - 1));
640
- sb.push('</span>');
641
- // ...ken
642
- if (pt.at - 1 + (pt.run || 0) < token.length) {
643
- // sb.push(token.substr(pt.at - 1 + (pt.run || 0)));
644
- sb.push(token.substring(pt.at - 1 + (pt.run || 0)));
645
- }
646
- }
647
- else {
648
- // ...token]
649
- sb.push(token);
650
- sb.push('</span>');
651
- }
652
- }
653
- /**
654
- * Render the specified token intersecting the specified single-point location.
655
- * The received token starts and ends a single-token range.
656
- * @param loc location.
657
- * @param token token.
658
- * @param sb target strings array.
659
- * @param isSelected True if the token is selected.
660
- */
661
- renderTokenAtPointStart(loc, token, sb, isSelected) {
662
- // 1.token's left-part
663
- if (loc.primary.at) {
664
- // to...
665
- sb.push(token.substring(0, loc.primary.at - 1));
666
- }
667
- // 2.span: [
668
- this.renderOpeningSpan(loc, 0, sb, isSelected);
669
- // 3.token's right-part (...ken]/...ke]n or ...token])
670
- this.renderTokenAtEnd(loc.primary, token, sb);
671
- }
672
- /**
673
- * Render the specified token intersecting the specified range start location.
674
- * The received token starts a multi-tokens range.
675
- * @param loc location.
676
- * @param token token.
677
- * @param sb target strings array.
678
- * @param isSelected True if the token is selected.
679
- */
680
- renderTokenAtRangeStart(loc, token, sb, isSelected) {
681
- // 1.token's left-part (=before at)
682
- if (loc.primary.at) {
683
- // to...
684
- sb.push(token.substring(0, loc.primary.at - 1));
685
- }
686
- // 2.span: [
687
- this.renderOpeningSpan(loc, 0, sb, isSelected);
688
- // 3.token's right-part (...ken or ...token)
689
- if (loc.primary.at) {
690
- // ...ken
691
- sb.push(token.substring(loc.primary.at - 1));
692
- }
693
- else {
694
- // ...token
695
- sb.push(token);
696
- }
697
- }
698
- renderTokenAtStart(loc, token, sb, isSelected) {
699
- if (!loc.secondary) {
700
- // single
701
- this.renderTokenAtPointStart(loc, token, sb, isSelected);
702
- return false;
703
- }
704
- else {
705
- // range
706
- this.renderTokenAtRangeStart(loc, token, sb, isSelected);
707
- return true;
708
- }
709
- }
710
- /**
711
- * Render to HTML the base text decorated with its layer fragments.
712
- * @param text The base text.
713
- * @param locations The locations of all the fragments
714
- * of the same type to be rendered on top of the base text.
715
- * @param selectedLoc The optional location of the selected
716
- * fragment if any. The selected fragment gets decorated with an additional
717
- * class value.
718
- */
719
- render(text, locations, selectedLoc) {
720
- if (!text) {
721
- return '<div></div>';
722
- }
723
- // get lines from text
724
- const sb = [];
725
- const lines = this.getLines(text);
726
- let loc = undefined;
727
- let tokenSelected = false;
728
- if (!locations) {
729
- locations = [];
730
- }
731
- // for each line in text
732
- sb.push('<div>');
733
- for (let y = 0; y < lines.length; y++) {
734
- sb.push(`<p id="y${y + 1}">`);
735
- // reopen a span if continuing a fragment from prev line
736
- if (loc) {
737
- this.renderOpeningSpan(loc, y + 1 - loc.primary.y, sb, tokenSelected);
738
- }
739
- // for each token in line
740
- const line = lines[y];
741
- for (let x = 0; x < line.tokens.length; x++) {
742
- // add separator if required
743
- if (x > 0) {
744
- sb.push(' ');
745
- }
746
- const token = line.tokens[x];
747
- // if inside a fragment, check if this token is the last
748
- if (loc && loc.secondary) {
749
- if (loc.secondary.y === y + 1 && loc.secondary.x === x + 1) {
750
- this.renderTokenAtEnd(loc.secondary, token, sb);
751
- loc = undefined;
752
- }
753
- else {
754
- sb.push(token);
755
- }
756
- }
757
- else {
758
- // else, check if this token starts a fragment
759
- loc = locations.find((l) => {
760
- return l.primary.y === y + 1 && l.primary.x === x + 1;
761
- });
762
- if (loc) {
763
- tokenSelected = selectedLoc ? loc.overlaps(selectedLoc) : false;
764
- if (!this.renderTokenAtStart(loc, token, sb, tokenSelected)) {
765
- loc = undefined;
766
- }
767
- }
768
- else {
769
- sb.push(token);
770
- }
771
- }
772
- }
773
- // close a span if pending at p end
774
- if (loc) {
775
- sb.push('</span>');
776
- }
777
- sb.push('</p>');
778
- }
779
- sb.push('</div>');
780
- return sb.join('');
781
- }
782
- /*
783
- Location: starting from user selection on a rendered text, get the corresponding
784
- layer fragment location. This differs according to the purpose of the location
785
- to be got: if getting a location for an existing fragment, at least 1 decorated
786
- text (span) should be included in the selection, which does not require to be
787
- exact; if getting a location for a new fragment, no decorated text (span) can be
788
- included in the selection (two fragments in the same layer can never overlap),
789
- which must be exact.
790
- */
791
- /**
792
- * Get the Y bounds from the specified selection.
793
- * @param range The selection range.
794
- * @param forNew True if getting bounds for a new fragment.
795
- * @returns Range, inclusive, or undefined.
796
- */
797
- getYBoundsFromRange(range, forNew) {
798
- let p = null;
799
- switch (range.commonAncestorContainer.nodeType) {
800
- case Node.TEXT_NODE:
801
- // single-p selection, parent=p
802
- p = range.commonAncestorContainer.parentElement;
803
- if (forNew && ((p === null || p === void 0 ? void 0 : p.nodeName) !== 'P' || !p.hasAttribute('id'))) {
804
- return null;
805
- }
806
- if ((p === null || p === void 0 ? void 0 : p.nodeName) === 'SPAN') {
807
- p = p.parentElement;
808
- }
809
- const y = parseInt(p.getAttribute('id').substring(1), 10);
810
- // return [y, y];
811
- return { start: y, end: y };
812
- case Node.ELEMENT_NODE:
813
- // div only is allowed; in this case, it's a multi-p range
814
- if (range.commonAncestorContainer.nodeName !== 'DIV') {
815
- return null;
816
- }
817
- // for each div's child p element:
818
- let yMin = 0;
819
- let yMax = 0;
820
- let inside = false;
821
- for (let i = 0; i < range.commonAncestorContainer.childNodes.length; i++) {
822
- const child = range.commonAncestorContainer.childNodes[i];
823
- if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'P') {
824
- continue;
825
- }
826
- // check if we're entering the start-p
827
- if (!inside && child.contains(range.startContainer)) {
828
- inside = true;
829
- }
830
- // collect y if inside
831
- if (inside) {
832
- const iy = parseInt(child.getAttribute('id').substring(1), 10);
833
- if (!yMin || iy < yMin) {
834
- yMin = iy;
835
- }
836
- if (!yMax || iy > yMax) {
837
- yMax = iy;
838
- }
839
- // check if we have exited the last p
840
- if (child.contains(range.endContainer)) {
841
- break;
842
- }
843
- }
844
- }
845
- return {
846
- start: yMin,
847
- end: yMax,
848
- };
849
- }
850
- return null;
851
- }
852
- locatePrevSpace(line, index) {
853
- while (index > -1 && line.charAt(index) !== ' ') {
854
- index--;
855
- }
856
- return index;
857
- }
858
- locateNextSpace(line, index) {
859
- while (index < line.length && line.charAt(index) !== ' ') {
860
- index++;
861
- }
862
- return index === line.length ? -1 : index;
863
- }
864
- /**
865
- * Get the bounds of the token any character of which is indexed
866
- * by index.
867
- * @param line The text line.
868
- * @param index The index to the text line to start from.
869
- * @returns Bounds where start=index of the first character of the token,
870
- * and end=index of the character past the token's last character;
871
- * or null if index was not valid.
872
- */
873
- getTokenBounds(line, index) {
874
- if (line.charAt(index) === ' ') {
875
- return null;
876
- }
877
- let start = this.locatePrevSpace(line, index);
878
- if (start === -1) {
879
- start = 0;
880
- }
881
- else {
882
- start++;
883
- }
884
- let end = this.locateNextSpace(line, index);
885
- if (end === -1) {
886
- end = line.length;
887
- }
888
- // return [start, end];
889
- return {
890
- start,
891
- end,
892
- };
893
- }
894
- /**
895
- * Return the received selection bounds, adjusted to exclude spaces.
896
- */
897
- getAdjustedSelectionBounds(selStart, selEnd, line) {
898
- // corner case: if on space, move to right
899
- if (line.charAt(selStart) === ' ') {
900
- selStart++;
901
- }
902
- // corner case: if included trailing space, move to left
903
- if (selEnd > 0 && line.charAt(selEnd - 1) === ' ') {
904
- selEnd--;
905
- }
906
- // return [selStart, selEnd];
907
- return {
908
- start: selStart,
909
- end: selEnd,
910
- };
911
- }
912
- /**
913
- * Get the start coordinates for the selected range and line.
914
- * @param range The selected range.
915
- * @param line The reference text line.
916
- */
917
- getStartCoordsFromRange(selStart, selEnd, line) {
918
- // get adjusted selection bounds
919
- const selBounds = this.getAdjustedSelectionBounds(selStart, selEnd, line);
920
- // get the bounds of the first selected token
921
- const tokBounds = this.getTokenBounds(line, selBounds.start);
922
- // calculate x by counting the tokens before the target token
923
- let x = 1;
924
- let j = tokBounds.start - 1;
925
- while (j > -1) {
926
- if (line.charAt(j) === ' ') {
927
- x++;
928
- }
929
- j--;
930
- }
931
- // calculate at,run only when either of these is true:
932
- // (a) selection starts past the 1st char of the token (al[pha);
933
- // (b) selection ends before the last char of the token (al]pha);
934
- // run is calculated only if (b) is true.
935
- let at = 0;
936
- let run = 0;
937
- if (selBounds.start > tokBounds.start || selBounds.end < tokBounds.end) {
938
- at = 1 + selBounds.start - tokBounds.start;
939
- run =
940
- (selBounds.end < tokBounds.end
941
- ? selBounds.end // al]pha
942
- : tokBounds.end) - // alpha]
943
- Math.max(tokBounds.start, selBounds.start);
944
- }
945
- return {
946
- y: 0,
947
- x,
948
- at,
949
- run,
950
- };
951
- }
952
- getEndCoordsFromRange(selStart, selEnd, line) {
953
- // get adjusted selection bounds
954
- const selBounds = this.getAdjustedSelectionBounds(selStart, selEnd, line);
955
- // get the bounds of the last selected token
956
- const tokBounds = this.getTokenBounds(line, selBounds.end - 1);
957
- // calculate x by counting the tokens before the target token
958
- let x = 1;
959
- let j = selBounds.end - 1;
960
- while (j > -1) {
961
- if (line.charAt(j) === ' ') {
962
- x++;
963
- }
964
- j--;
965
- }
966
- // calculate at,run only when selection ends before the 1st char of the token
967
- // (al]pha); run is calculated only if at is calculated.
968
- let at = 0;
969
- let run = 0;
970
- if (selBounds.end < tokBounds.end) {
971
- at =
972
- selBounds.start > tokBounds.start
973
- ? 1 + selBounds.start - tokBounds.start
974
- : 1;
975
- run = selBounds.end - tokBounds.start;
976
- }
977
- return {
978
- y: 0,
979
- x,
980
- at,
981
- run,
982
- };
983
- }
984
- getSpanLocFromId(id) {
985
- if (!id) {
986
- return null;
987
- }
988
- const r = new RegExp('^f([-\\d+.@x]+)', 'g');
989
- const m = r.exec(id);
990
- if (!m) {
991
- return null;
992
- }
993
- return TokenLocation.parse(m[1]);
994
- }
995
- visitNodes(node, visitor) {
996
- if (!visitor(node)) {
997
- return;
998
- }
999
- if (node.nodeType === Node.ELEMENT_NODE) {
1000
- for (let i = 0; i < node.childNodes.length; i++) {
1001
- const child = node.childNodes[i];
1002
- this.visitNodes(child, visitor);
1003
- }
1004
- }
1005
- }
1006
- findFirstDescendantSpan(range) {
1007
- let inside = false;
1008
- let span = null;
1009
- this.visitNodes(range.commonAncestorContainer, (current) => {
1010
- if (current === range.startContainer) {
1011
- inside = true;
1012
- }
1013
- if (current.nodeType === Node.ELEMENT_NODE &&
1014
- current.nodeName === 'SPAN') {
1015
- span = current;
1016
- return false;
1017
- }
1018
- if (current === range.endContainer) {
1019
- inside = false;
1020
- }
1021
- return true;
1022
- });
1023
- return span;
1024
- }
1025
- /**
1026
- * Get the base offset for the specified node. This is used
1027
- * when the start container of the selected range has any
1028
- * preceding sibling node, which happens only when you have
1029
- * any spans in the p element (=the line). In this case,
1030
- * the selection offset starts from the start container node,
1031
- * which is preceded by other nodes including other text.
1032
- * As we must get the line-based offset, we have to start
1033
- * from a base offset equal to the sum of the lengths of
1034
- * all the preceding siblings.
1035
- */
1036
- getNodeBaseOffset(node) {
1037
- var _a, _b;
1038
- let offset = 0;
1039
- let n = node;
1040
- n = node.previousSibling;
1041
- while (n) {
1042
- offset +=
1043
- n.nodeType === Node.ELEMENT_NODE
1044
- ? ((_a = n.innerText) === null || _a === void 0 ? void 0 : _a.length) || 0
1045
- : ((_b = n.textContent) === null || _b === void 0 ? void 0 : _b.length) || 0;
1046
- n = n.previousSibling;
1047
- }
1048
- return offset;
1049
- }
1050
- /**
1051
- * Get the location corresponding to the user selection,
1052
- * for editing the first fragment included in it.
1053
- * @param range The selected range. You can get it from the
1054
- * current selection using getSelectedRange().
1055
- * @returns The token location or null.
1056
- */
1057
- getSelectedLocationForEdit(range) {
1058
- if (!range) {
1059
- return null;
1060
- }
1061
- // just find the first descendant span in selection
1062
- let span = null;
1063
- switch (range.commonAncestorContainer.nodeType) {
1064
- case Node.ELEMENT_NODE:
1065
- span = range.commonAncestorContainer;
1066
- if (span.nodeName !== 'SPAN') {
1067
- span = this.findFirstDescendantSpan(range);
1068
- }
1069
- break;
1070
- case Node.TEXT_NODE:
1071
- span = range.commonAncestorContainer.parentElement;
1072
- if (span &&
1073
- (span.nodeType !== Node.ELEMENT_NODE || span.nodeName !== 'SPAN')) {
1074
- span = null;
1075
- }
1076
- break;
1077
- }
1078
- return span ? this.getSpanLocFromId(span.getAttribute('id')) : null;
1079
- }
1080
- textLineToString(line) {
1081
- if (!line || !line.tokens) {
1082
- return '';
1083
- }
1084
- return line.tokens.join(' ');
1085
- }
1086
- buildCoords(start, end, singleToken) {
1087
- const sb = [];
1088
- // start: y.x
1089
- sb.push(`${start.y}.${start.x}`);
1090
- if (singleToken) {
1091
- // single token: check for at,run
1092
- if (start.at) {
1093
- sb.push(`@${start.at}`);
1094
- if (start.run && start.run > 1) {
1095
- sb.push(`x${start.run}`);
1096
- }
1097
- }
1098
- }
1099
- else {
1100
- // not a single token
1101
- // first token
1102
- if (start.at) {
1103
- sb.push(`@${start.at}x${start.run}`);
1104
- }
1105
- // last token
1106
- sb.push(`-${end.y}.${end.x}`);
1107
- if (end.at) {
1108
- sb.push(`@1x${end.run}`);
1109
- }
1110
- }
1111
- return sb.join('');
1112
- }
1113
- /**
1114
- * Recursively find the node matching the specified matcher
1115
- * function, starting from the specified node (included).
1116
- *
1117
- * @param node The node to start from.
1118
- * @param matcher The matcher function, which receives a node
1119
- * to match, and returns 1=match, 0=no match, -1=stop the
1120
- * find operation with a no match.
1121
- * @return 1=match, 0=no match, -1=stop the find operation with a no match.
1122
- */
1123
- matchNode(node, matcher) {
1124
- // self
1125
- const n = matcher(node);
1126
- if (n) {
1127
- return n;
1128
- }
1129
- // children
1130
- if (node.hasChildNodes()) {
1131
- for (let i = 0; i < node.childNodes.length; i++) {
1132
- const child = node.childNodes[i];
1133
- const m = this.matchNode(child, matcher);
1134
- if (m) {
1135
- return m;
1136
- }
1137
- }
1138
- }
1139
- return 0;
1140
- }
1141
- selHasAnySpan(range) {
1142
- var _a, _b;
1143
- let inside = false;
1144
- if (
1145
- // the selected text node must not be child of a span
1146
- ((_a = range.startContainer.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) === 'SPAN' ||
1147
- ((_b = range.endContainer.parentElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'SPAN' ||
1148
- // the nodes tree from the common ancestor, from the start node
1149
- // up to the end node, must not include any span
1150
- this.matchNode(range.commonAncestorContainer, (node) => {
1151
- // start checking only when start node reached
1152
- if (node === range.startContainer) {
1153
- inside = true;
1154
- }
1155
- if (!inside) {
1156
- return 0;
1157
- }
1158
- // stop checking when end node reached
1159
- if (node === range.endContainer) {
1160
- return -1;
1161
- }
1162
- // node cannot be a span
1163
- if (node.nodeType === Node.ELEMENT_NODE &&
1164
- node.tagName === 'SPAN') {
1165
- return 1;
1166
- }
1167
- return 0;
1168
- }) === 1) {
1169
- return true;
1170
- }
1171
- return false;
1172
- }
1173
- /**
1174
- * Get the location corresponding to the user selection,
1175
- * for adding a new fragment with the same extension.
1176
- * @param range The selected range. You can get it from the
1177
- * current selection using getSelectedRange().
1178
- * @param text The full base text.
1179
- * @returns TokenLocation The token location or undefined.
1180
- */
1181
- getSelectedLocationForNew(range, text) {
1182
- if (!range || this.selHasAnySpan(range)) {
1183
- return null;
1184
- }
1185
- // get y bounds (min, max; equal if single-line)
1186
- const yBounds = this.getYBoundsFromRange(range, true);
1187
- if (!yBounds) {
1188
- return null;
1189
- }
1190
- // get lines and calculate start/end coords
1191
- const lines = this.getLines(text);
1192
- const startLine = this.textLineToString(lines[yBounds.start - 1]);
1193
- const endLine = this.textLineToString(lines[yBounds.end - 1]);
1194
- // get the base offsets
1195
- const startBaseOffset = this.getNodeBaseOffset(range.startContainer);
1196
- const endBaseOffset = this.getNodeBaseOffset(range.endContainer);
1197
- // get the start (including the base offset)
1198
- const startLineEndOffset = yBounds.start !== yBounds.end
1199
- ? startLine.length
1200
- : range.endOffset + startBaseOffset;
1201
- const start = this.getStartCoordsFromRange(range.startOffset + startBaseOffset, startLineEndOffset, startLine);
1202
- start.y = yBounds.start;
1203
- // get the end (including the base offset)
1204
- const end = yBounds.start !== yBounds.end
1205
- ? this.getEndCoordsFromRange(0, range.endOffset + endBaseOffset, endLine)
1206
- : this.getEndCoordsFromRange(range.startOffset + endBaseOffset, range.endOffset + endBaseOffset, endLine);
1207
- end.y = yBounds.end;
1208
- const singleLine = start.y === end.y;
1209
- const singleToken = singleLine && start.x === end.x;
1210
- const coords = this.buildCoords(start, end, singleToken);
1211
- return TokenLocation.parse(coords);
1212
- }
1213
- /**
1214
- * Get the currently selected range in the browser's document.
1215
- * This uses the rangy library.
1216
- */
1217
- getSelectedRange() {
1218
- const sel = rangy.getSelection();
1219
- if (sel.isCollapsed) {
1220
- return null;
1221
- }
1222
- return sel.getRangeAt(0);
1223
- }
1224
- }
1225
- TextLayerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: TextLayerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1226
- TextLayerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: TextLayerService, providedIn: 'root' });
1227
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: TextLayerService, decorators: [{
1228
- type: Injectable,
1229
- args: [{ providedIn: 'root' }]
1230
- }], ctorParameters: function () { return []; } });
1231
-
1232
- class CadmusCoreModule {
1233
- }
1234
- CadmusCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CadmusCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1235
- CadmusCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.0", ngImport: i0, type: CadmusCoreModule, declarations: [SortPipe], imports: [CommonModule, HttpClientModule, NgToolsModule], exports: [SortPipe] });
1236
- CadmusCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CadmusCoreModule, imports: [CommonModule, HttpClientModule, NgToolsModule] });
1237
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CadmusCoreModule, decorators: [{
1238
- type: NgModule,
1239
- args: [{
1240
- imports: [CommonModule, HttpClientModule, NgToolsModule],
1241
- declarations: [SortPipe],
1242
- exports: [SortPipe],
1243
- }]
1244
- }] });
1245
-
1246
- /*
1247
- * Public API Surface of cadmus-core
1248
- */
1249
-
1250
- /**
1251
- * Generated bundle index. Do not edit.
1252
- */
1253
-
1254
- export { CadmusCoreModule, DataPinValueType, FlagMatching, LibraryRouteService, PendingChangesGuard, SortPipe, TextLayerService, TextRange, TokenLocation, TokenPoint };
1255
- //# sourceMappingURL=myrmidon-cadmus-core.mjs.map
1256
- //# sourceMappingURL=myrmidon-cadmus-core.mjs.map