@myrmidon/cadmus-state 0.0.10 → 1.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 (78) hide show
  1. package/README.md +2 -2
  2. package/esm2020/lib/app.query.mjs +29 -0
  3. package/esm2020/lib/app.service.mjs +43 -0
  4. package/esm2020/lib/app.store.mjs +24 -0
  5. package/esm2020/lib/cadmus-state.module.mjs +34 -0
  6. package/esm2020/lib/edit-fragment-feature-base.mjs +118 -0
  7. package/esm2020/lib/edit-fragment-query-base.mjs +20 -0
  8. package/esm2020/lib/edit-fragment-service-base.mjs +140 -0
  9. package/esm2020/lib/edit-fragment.store.mjs +36 -0
  10. package/esm2020/lib/edit-item.query.mjs +52 -0
  11. package/esm2020/lib/edit-item.service.mjs +182 -0
  12. package/esm2020/lib/edit-item.store.mjs +40 -0
  13. package/esm2020/lib/edit-layer-part.query.mjs +35 -0
  14. package/esm2020/lib/edit-layer-part.service.mjs +230 -0
  15. package/esm2020/lib/edit-layer-part.store.mjs +49 -0
  16. package/esm2020/lib/edit-part-feature-base.mjs +116 -0
  17. package/esm2020/lib/edit-part-query-base.mjs +25 -0
  18. package/esm2020/lib/edit-part-service-base.mjs +120 -0
  19. package/esm2020/lib/edit-part.store.mjs +31 -0
  20. package/esm2020/lib/edit-thesaurus.query.mjs +26 -0
  21. package/esm2020/lib/edit-thesaurus.service.mjs +59 -0
  22. package/esm2020/lib/edit-thesaurus.store.mjs +30 -0
  23. package/{esm2015/myrmidon-cadmus-state.js → esm2020/myrmidon-cadmus-state.mjs} +1 -1
  24. package/{esm2015/public-api.js → esm2020/public-api.mjs} +1 -1
  25. package/fesm2015/myrmidon-cadmus-state.mjs +1392 -0
  26. package/fesm2015/myrmidon-cadmus-state.mjs.map +1 -0
  27. package/{fesm2015/myrmidon-cadmus-state.js → fesm2020/myrmidon-cadmus-state.mjs} +194 -228
  28. package/fesm2020/myrmidon-cadmus-state.mjs.map +1 -0
  29. package/lib/app.query.d.ts +7 -4
  30. package/lib/app.service.d.ts +4 -1
  31. package/lib/app.store.d.ts +5 -2
  32. package/lib/cadmus-state.module.d.ts +8 -0
  33. package/lib/edit-fragment-feature-base.d.ts +7 -7
  34. package/lib/edit-fragment-query-base.d.ts +5 -5
  35. package/lib/edit-fragment-service-base.d.ts +1 -1
  36. package/lib/edit-fragment.store.d.ts +5 -2
  37. package/lib/edit-item.query.d.ts +6 -3
  38. package/lib/edit-item.service.d.ts +5 -2
  39. package/lib/edit-item.store.d.ts +8 -5
  40. package/lib/edit-layer-part.query.d.ts +9 -6
  41. package/lib/edit-layer-part.service.d.ts +5 -2
  42. package/lib/edit-layer-part.store.d.ts +6 -3
  43. package/lib/edit-part-feature-base.d.ts +9 -9
  44. package/lib/edit-part-query-base.d.ts +4 -4
  45. package/lib/edit-part-service-base.d.ts +3 -3
  46. package/lib/edit-part.store.d.ts +5 -3
  47. package/lib/edit-thesaurus.query.d.ts +5 -3
  48. package/lib/edit-thesaurus.service.d.ts +5 -2
  49. package/lib/edit-thesaurus.store.d.ts +4 -1
  50. package/myrmidon-cadmus-state.d.ts +1 -0
  51. package/package.json +26 -17
  52. package/bundles/myrmidon-cadmus-state.umd.js +0 -1812
  53. package/bundles/myrmidon-cadmus-state.umd.js.map +0 -1
  54. package/bundles/myrmidon-cadmus-state.umd.min.js +0 -16
  55. package/bundles/myrmidon-cadmus-state.umd.min.js.map +0 -1
  56. package/esm2015/lib/app.query.js +0 -31
  57. package/esm2015/lib/app.service.js +0 -49
  58. package/esm2015/lib/app.store.js +0 -25
  59. package/esm2015/lib/cadmus-state.module.js +0 -19
  60. package/esm2015/lib/edit-fragment-feature-base.js +0 -116
  61. package/esm2015/lib/edit-fragment-query-base.js +0 -32
  62. package/esm2015/lib/edit-fragment-service-base.js +0 -137
  63. package/esm2015/lib/edit-fragment.store.js +0 -38
  64. package/esm2015/lib/edit-item.query.js +0 -56
  65. package/esm2015/lib/edit-item.service.js +0 -188
  66. package/esm2015/lib/edit-item.store.js +0 -46
  67. package/esm2015/lib/edit-layer-part.query.js +0 -37
  68. package/esm2015/lib/edit-layer-part.service.js +0 -235
  69. package/esm2015/lib/edit-layer-part.store.js +0 -52
  70. package/esm2015/lib/edit-part-feature-base.js +0 -116
  71. package/esm2015/lib/edit-part-query-base.js +0 -25
  72. package/esm2015/lib/edit-part-service-base.js +0 -121
  73. package/esm2015/lib/edit-part.store.js +0 -38
  74. package/esm2015/lib/edit-thesaurus.query.js +0 -28
  75. package/esm2015/lib/edit-thesaurus.service.js +0 -63
  76. package/esm2015/lib/edit-thesaurus.store.js +0 -36
  77. package/fesm2015/myrmidon-cadmus-state.js.map +0 -1
  78. package/myrmidon-cadmus-state.metadata.json +0 -1
@@ -1,31 +1,33 @@
1
- import { ɵɵdefineInjectable, Injectable, ɵɵinject, NgModule } from '@angular/core';
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, NgModule } from '@angular/core';
2
3
  import { Store, StoreConfig, Query } from '@datorama/akita';
3
4
  import { __decorate } from 'tslib';
4
- import { FacetService, FlagService, ThesaurusService, ItemService, CadmusApiModule } from '@myrmidon/cadmus-api';
5
5
  import { forkJoin } from 'rxjs';
6
- import { LibraryRouteService, TokenLocation, deepCopy, CadmusCoreModule } from '@myrmidon/cadmus-core';
6
+ import * as i2 from '@myrmidon/cadmus-api';
7
+ import { CadmusApiModule } from '@myrmidon/cadmus-api';
8
+ import * as i2$1 from '@myrmidon/cadmus-core';
9
+ import { TokenLocation, CadmusCoreModule } from '@myrmidon/cadmus-core';
10
+ import { deepCopy, NgToolsModule } from '@myrmidon/ng-tools';
7
11
  import { CommonModule } from '@angular/common';
8
- import { CadmusMaterialModule } from '@myrmidon/cadmus-material';
9
12
 
10
- const initialState = {
13
+ const initialState$2 = {
11
14
  facets: [],
12
15
  flags: [],
13
- typeThesaurus: null,
14
- itemBrowserThesaurus: null,
15
16
  };
16
17
  let AppStore = class AppStore extends Store {
17
18
  constructor() {
18
- super(initialState);
19
+ super(initialState$2);
19
20
  }
20
21
  };
21
- AppStore.ɵprov = ɵɵdefineInjectable({ factory: function AppStore_Factory() { return new AppStore(); }, token: AppStore, providedIn: "root" });
22
- AppStore.decorators = [
23
- { type: Injectable, args: [{ providedIn: 'root' },] }
24
- ];
25
- AppStore.ctorParameters = () => [];
22
+ AppStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
23
+ AppStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppStore, providedIn: 'root' });
26
24
  AppStore = __decorate([
27
25
  StoreConfig({ name: 'app', resettable: false })
28
- ], AppStore);
26
+ ], AppStore);
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppStore, decorators: [{
28
+ type: Injectable,
29
+ args: [{ providedIn: 'root' }]
30
+ }], ctorParameters: function () { return []; } });
29
31
 
30
32
  class AppQuery extends Query {
31
33
  constructor(store) {
@@ -45,13 +47,12 @@ class AppQuery extends Query {
45
47
  return this.select((state) => state.itemBrowserThesaurus);
46
48
  }
47
49
  }
48
- AppQuery.ɵprov = ɵɵdefineInjectable({ factory: function AppQuery_Factory() { return new AppQuery(ɵɵinject(AppStore)); }, token: AppQuery, providedIn: "root" });
49
- AppQuery.decorators = [
50
- { type: Injectable, args: [{ providedIn: 'root' },] }
51
- ];
52
- AppQuery.ctorParameters = () => [
53
- { type: AppStore }
54
- ];
50
+ AppQuery.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppQuery, deps: [{ token: AppStore }], target: i0.ɵɵFactoryTarget.Injectable });
51
+ AppQuery.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppQuery, providedIn: 'root' });
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppQuery, decorators: [{
53
+ type: Injectable,
54
+ args: [{ providedIn: 'root' }]
55
+ }], ctorParameters: function () { return [{ type: AppStore }]; } });
55
56
 
56
57
  class AppService {
57
58
  constructor(_store, _facetService, _flagService, _thesaurusService) {
@@ -84,28 +85,17 @@ class AppService {
84
85
  });
85
86
  }
86
87
  }
87
- AppService.ɵprov = ɵɵdefineInjectable({ factory: function AppService_Factory() { return new AppService(ɵɵinject(AppStore), ɵɵinject(FacetService), ɵɵinject(FlagService), ɵɵinject(ThesaurusService)); }, token: AppService, providedIn: "root" });
88
- AppService.decorators = [
89
- { type: Injectable, args: [{ providedIn: 'root' },] }
90
- ];
91
- AppService.ctorParameters = () => [
92
- { type: AppStore },
93
- { type: FacetService },
94
- { type: FlagService },
95
- { type: ThesaurusService }
96
- ];
88
+ AppService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppService, deps: [{ token: AppStore }, { token: i2.FacetService }, { token: i2.FlagService }, { token: i2.ThesaurusService }], target: i0.ɵɵFactoryTarget.Injectable });
89
+ AppService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppService, providedIn: 'root' });
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: AppService, decorators: [{
91
+ type: Injectable,
92
+ args: [{ providedIn: 'root' }]
93
+ }], ctorParameters: function () { return [{ type: AppStore }, { type: i2.FacetService }, { type: i2.FlagService }, { type: i2.ThesaurusService }]; } });
97
94
 
98
95
  const initialState$1 = {
99
- item: null,
100
96
  parts: [],
101
97
  partGroups: [],
102
98
  layerPartInfos: [],
103
- facet: null,
104
- dirty: false,
105
- saving: false,
106
- deletingPart: false,
107
- loading: false,
108
- error: null
109
99
  };
110
100
  let EditItemStore = class EditItemStore extends Store {
111
101
  constructor() {
@@ -113,28 +103,29 @@ let EditItemStore = class EditItemStore extends Store {
113
103
  }
114
104
  setDirty(value = true) {
115
105
  this.update({
116
- dirty: value
106
+ dirty: value,
117
107
  });
118
108
  }
119
109
  setSaving(value = true) {
120
110
  this.update({
121
- saving: value
111
+ saving: value,
122
112
  });
123
113
  }
124
114
  setDeletingPart(value = true) {
125
115
  this.update({
126
- deletingPart: value
116
+ deletingPart: value,
127
117
  });
128
118
  }
129
119
  };
130
- EditItemStore.ɵprov = ɵɵdefineInjectable({ factory: function EditItemStore_Factory() { return new EditItemStore(); }, token: EditItemStore, providedIn: "root" });
131
- EditItemStore.decorators = [
132
- { type: Injectable, args: [{ providedIn: 'root' },] }
133
- ];
134
- EditItemStore.ctorParameters = () => [];
120
+ EditItemStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
121
+ EditItemStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemStore, providedIn: 'root' });
135
122
  EditItemStore = __decorate([
136
123
  StoreConfig({ name: 'edit-item', resettable: true })
137
- ], EditItemStore);
124
+ ], EditItemStore);
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemStore, decorators: [{
126
+ type: Injectable,
127
+ args: [{ providedIn: 'root' }]
128
+ }], ctorParameters: function () { return []; } });
138
129
 
139
130
  /**
140
131
  * The query facade to the edit item store.
@@ -155,19 +146,19 @@ class EditItemQuery extends Query {
155
146
  return this.select((state) => state.facet);
156
147
  }
157
148
  selectSaving() {
158
- return this.select((state) => state.saving);
149
+ return this.select((state) => (state.saving ? true : false));
159
150
  }
160
151
  selectDeletingPart() {
161
- return this.select((state) => state.deletingPart);
152
+ return this.select((state) => (state.deletingPart ? true : false));
162
153
  }
163
- hasItem(id = null) {
154
+ hasItem(id) {
164
155
  const item = this.getValue().item;
165
156
  if (!item || (id && id !== item.id)) {
166
157
  return false;
167
158
  }
168
159
  return true;
169
160
  }
170
- getEditorKeyFromPartTypeId(typeId, roleId = null) {
161
+ getEditorKeyFromPartTypeId(typeId, roleId) {
171
162
  const facet = this.getValue().facet;
172
163
  if (!facet) {
173
164
  return 'default';
@@ -176,14 +167,12 @@ class EditItemQuery extends Query {
176
167
  .partKey;
177
168
  }
178
169
  }
179
- EditItemQuery.ɵprov = ɵɵdefineInjectable({ factory: function EditItemQuery_Factory() { return new EditItemQuery(ɵɵinject(EditItemStore), ɵɵinject(LibraryRouteService)); }, token: EditItemQuery, providedIn: "root" });
180
- EditItemQuery.decorators = [
181
- { type: Injectable, args: [{ providedIn: 'root' },] }
182
- ];
183
- EditItemQuery.ctorParameters = () => [
184
- { type: EditItemStore },
185
- { type: LibraryRouteService }
186
- ];
170
+ EditItemQuery.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemQuery, deps: [{ token: EditItemStore }, { token: i2$1.LibraryRouteService }], target: i0.ɵɵFactoryTarget.Injectable });
171
+ EditItemQuery.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemQuery, providedIn: 'root' });
172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemQuery, decorators: [{
173
+ type: Injectable,
174
+ args: [{ providedIn: 'root' }]
175
+ }], ctorParameters: function () { return [{ type: EditItemStore }, { type: i2$1.LibraryRouteService }]; } });
187
176
 
188
177
  /**
189
178
  * The service which handles the edit item store.
@@ -196,7 +185,7 @@ class EditItemService {
196
185
  }
197
186
  pickDefaultFacet(facets) {
198
187
  if (!facets.length) {
199
- return null;
188
+ return undefined;
200
189
  }
201
190
  // if there is a facet with id="default", pick it
202
191
  const defaultFacet = facets.find((f) => f.id === 'default');
@@ -212,9 +201,9 @@ class EditItemService {
212
201
  */
213
202
  load(itemId) {
214
203
  this._store.setLoading(true);
215
- const layers$ = this._itemService.getItemLayerInfo(itemId, true);
216
204
  const appState = this._appQuery.getValue();
217
205
  // if not a new item, include it in load
206
+ const layers$ = this._itemService.getItemLayerInfo(itemId || '', true);
218
207
  if (itemId) {
219
208
  forkJoin({
220
209
  item: this._itemService.getItem(itemId, true),
@@ -229,7 +218,7 @@ class EditItemService {
229
218
  this._store.update({
230
219
  item: result.item,
231
220
  parts: result.item.parts,
232
- partGroups: this._itemService.groupParts(result.item.parts, facetParts),
221
+ partGroups: this._itemService.groupParts(result.item.parts || [], facetParts),
233
222
  layerPartInfos: result.layers,
234
223
  facet: appState.facets.find((f) => f.id === result.item.facetId),
235
224
  });
@@ -248,17 +237,17 @@ class EditItemService {
248
237
  this._store.setError(null);
249
238
  this._store.update({
250
239
  item: {
251
- id: null,
252
- title: null,
253
- description: null,
254
- facetId: null,
255
- groupId: null,
256
- sortKey: null,
240
+ id: '',
241
+ title: '',
242
+ description: '',
243
+ facetId: '',
244
+ groupId: '',
245
+ sortKey: '',
257
246
  flags: 0,
258
247
  timeCreated: new Date(),
259
- creatorId: null,
248
+ creatorId: '',
260
249
  timeModified: new Date(),
261
- userId: null,
250
+ userId: '',
262
251
  },
263
252
  parts: [],
264
253
  partGroups: [],
@@ -309,7 +298,7 @@ class EditItemService {
309
298
  this._itemService.deletePart(id).subscribe((_) => {
310
299
  this._store.setDeletingPart(false);
311
300
  // reload the store
312
- this.load(this._store.getValue().item.id);
301
+ this.load(this._store.getValue().item?.id);
313
302
  resolve(id);
314
303
  }, (error) => {
315
304
  console.log(error);
@@ -324,9 +313,9 @@ class EditItemService {
324
313
  itemId,
325
314
  typeId,
326
315
  roleId,
327
- id: null,
328
- creatorId: null,
329
- userId: null,
316
+ id: '',
317
+ creatorId: '',
318
+ userId: '',
330
319
  timeCreated: new Date(),
331
320
  timeModified: new Date(),
332
321
  };
@@ -334,7 +323,7 @@ class EditItemService {
334
323
  this._itemService.addPart(part).subscribe((_) => {
335
324
  this._store.setSaving(false);
336
325
  // reload the store
337
- this.load(this._store.getValue().item.id);
326
+ this.load(this._store.getValue().item?.id);
338
327
  }, (error) => {
339
328
  console.log(error);
340
329
  this._store.setSaving(false);
@@ -346,7 +335,7 @@ class EditItemService {
346
335
  this._itemService.setPartThesaurusScope(ids, scope).subscribe((_) => {
347
336
  this._store.setSaving(false);
348
337
  // reload the store
349
- this.load(this._store.getValue().item.id);
338
+ this.load(this._store.getValue().item?.id);
350
339
  }, (error) => {
351
340
  console.log(error);
352
341
  this._store.setSaving(false);
@@ -354,15 +343,12 @@ class EditItemService {
354
343
  });
355
344
  }
356
345
  }
357
- EditItemService.ɵprov = ɵɵdefineInjectable({ factory: function EditItemService_Factory() { return new EditItemService(ɵɵinject(EditItemStore), ɵɵinject(AppQuery), ɵɵinject(ItemService)); }, token: EditItemService, providedIn: "root" });
358
- EditItemService.decorators = [
359
- { type: Injectable, args: [{ providedIn: 'root' },] }
360
- ];
361
- EditItemService.ctorParameters = () => [
362
- { type: EditItemStore },
363
- { type: AppQuery },
364
- { type: ItemService }
365
- ];
346
+ EditItemService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemService, deps: [{ token: EditItemStore }, { token: AppQuery }, { token: i2.ItemService }], target: i0.ɵɵFactoryTarget.Injectable });
347
+ EditItemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemService, providedIn: 'root' });
348
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditItemService, decorators: [{
349
+ type: Injectable,
350
+ args: [{ providedIn: 'root' }]
351
+ }], ctorParameters: function () { return [{ type: EditItemStore }, { type: AppQuery }, { type: i2.ItemService }]; } });
366
352
 
367
353
  /**
368
354
  * Base class for fragment feature editors.
@@ -370,7 +356,6 @@ EditItemService.ctorParameters = () => [
370
356
  */
371
357
  class EditFragmentFeatureBase {
372
358
  constructor(_router, route, snackbar, _editFrQuery, _editFrService, _editItemQuery, _editItemService, _editLayersQuery, _editLayersService, _libraryRouteService) {
373
- var _a;
374
359
  this._router = _router;
375
360
  this.snackbar = snackbar;
376
361
  this._editFrQuery = _editFrQuery;
@@ -380,15 +365,18 @@ class EditFragmentFeatureBase {
380
365
  this._editLayersQuery = _editLayersQuery;
381
366
  this._editLayersService = _editLayersService;
382
367
  this._libraryRouteService = _libraryRouteService;
383
- this.itemId = route.snapshot.params.iid;
384
- this.partId = route.snapshot.params.pid;
385
- this.frTypeId = (_a = route.snapshot.url[2]) === null || _a === void 0 ? void 0 : _a.path;
386
- this.loc = route.snapshot.params.loc;
387
- this.frRoleId = route.snapshot.queryParams.frrid;
368
+ this.fragment$ = this._editFrQuery.selectFragment();
369
+ this.thesauri$ = this._editFrQuery.selectThesauri();
370
+ this.baseText$ = this._editLayersQuery.select((state) => state.baseText);
371
+ this.itemId = route.snapshot.params['iid'];
372
+ this.partId = route.snapshot.params['pid'];
373
+ this.frTypeId = route.snapshot.url[2]?.path;
374
+ this.loc = route.snapshot.params['loc'];
375
+ this.frRoleId = route.snapshot.queryParams['frrid'];
388
376
  // connect _stateDirty to the value of the edit state
389
377
  this._editFrQuery.selectDirty().subscribe((d) => {
390
378
  console.log('fr dirty change (from state): ' + d);
391
- this._stateDirty = d;
379
+ this._stateDirty = d ? true : false;
392
380
  });
393
381
  }
394
382
  /**
@@ -421,7 +409,7 @@ class EditFragmentFeatureBase {
421
409
  this.fragment$ = this._editFrQuery.selectFragment();
422
410
  this.thesauri$ = this._editFrQuery.selectThesauri();
423
411
  this.baseText$ = this._editLayersQuery.select((state) => state.baseText);
424
- this.frLoc = TokenLocation.parse(this.loc);
412
+ this.frLoc = TokenLocation.parse(this.loc) ?? undefined;
425
413
  // load item if required
426
414
  this.ensureItemLoaded(this.itemId);
427
415
  // load layers if required
@@ -493,30 +481,15 @@ class EditFragmentQueryBase extends Query {
493
481
  selectFragment() {
494
482
  return this.select((state) => state.fragment);
495
483
  }
496
- // public selectJson(): Observable<string> {
497
- // return this.select((state) => state.fragment).pipe(
498
- // map((fr: Fragment) => {
499
- // // supply IDs
500
- // if (fr) {
501
- // return JSON.stringify(fr);
502
- // } else {
503
- // return '{}';
504
- // }
505
- // })
506
- // );
507
- // }
508
484
  selectThesauri() {
509
485
  return this.select((state) => state.thesauri);
510
486
  }
511
487
  }
512
488
 
513
489
  const editFragmentInitialState = {
514
- fragment: null,
515
- thesauri: null,
516
490
  dirty: false,
517
491
  saving: false,
518
492
  loading: false,
519
- error: null,
520
493
  };
521
494
  /**
522
495
  * General-purpose edit-fragment store. This can be used with any fragment,
@@ -534,14 +507,15 @@ let EditFragmentStore = class EditFragmentStore extends Store {
534
507
  this.update({ saving: value });
535
508
  }
536
509
  };
537
- EditFragmentStore.ɵprov = ɵɵdefineInjectable({ factory: function EditFragmentStore_Factory() { return new EditFragmentStore(); }, token: EditFragmentStore, providedIn: "root" });
538
- EditFragmentStore.decorators = [
539
- { type: Injectable, args: [{ providedIn: 'root' },] }
540
- ];
541
- EditFragmentStore.ctorParameters = () => [];
510
+ EditFragmentStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditFragmentStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
511
+ EditFragmentStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditFragmentStore, providedIn: 'root' });
542
512
  EditFragmentStore = __decorate([
543
513
  StoreConfig({ name: 'edit-fragment' })
544
- ], EditFragmentStore);
514
+ ], EditFragmentStore);
515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditFragmentStore, decorators: [{
516
+ type: Injectable,
517
+ args: [{ providedIn: 'root' }]
518
+ }], ctorParameters: function () { return []; } });
545
519
 
546
520
  /**
547
521
  * Base class for fragment editor services.
@@ -560,13 +534,16 @@ class EditFragmentServiceBase {
560
534
  * @param thesauriIds The thesauri IDs array, or null.
561
535
  */
562
536
  load(partId, loc, thesauriIds = null) {
537
+ if (!this.store) {
538
+ return;
539
+ }
563
540
  // signal that we're loading
564
541
  this.store.setLoading(true);
565
542
  // if thesauri are required:
566
543
  if (thesauriIds) {
567
544
  // remove trailing ! from IDs if any
568
545
  const unscopedIds = thesauriIds.map((id) => {
569
- return this._thesaurusService.getScopedId(id, null);
546
+ return this._thesaurusService.getScopedId(id);
570
547
  });
571
548
  // fetch fragment and thesauri
572
549
  forkJoin({
@@ -598,9 +575,9 @@ class EditFragmentServiceBase {
598
575
  });
599
576
  }
600
577
  // if the loaded layer part has a thesaurus scope, reload the thesauri
601
- if (result.part.thesaurusScope) {
578
+ if (result.part?.thesaurusScope) {
602
579
  const scopedIds = thesauriIds.map((id) => {
603
- return this._thesaurusService.getScopedId(id, result.part.thesaurusScope);
580
+ return this._thesaurusService.getScopedId(id, result.part?.thesaurusScope);
604
581
  });
605
582
  // loading again
606
583
  this.store.setLoading(true);
@@ -702,18 +679,18 @@ class EditPartFeatureBase {
702
679
  this._editItemQuery = _editItemQuery;
703
680
  this._editItemService = _editItemService;
704
681
  // item ID
705
- this.itemId = route.snapshot.params.iid;
682
+ this.itemId = route.snapshot.params['iid'];
706
683
  // type ID (from "TYPEID/:pid")
707
684
  this.typeId = route.snapshot.routeConfig.path.substr(0, route.snapshot.routeConfig.path.indexOf('/'));
708
685
  // part ID or null (if "new")
709
- this.partId = route.snapshot.params.pid;
686
+ this.partId = route.snapshot.params['pid'];
710
687
  if (this.partId === 'new') {
711
- this.partId = null;
688
+ this.partId = undefined;
712
689
  }
713
690
  // role ID or null (if "default")
714
- this.roleId = route.snapshot.queryParams.rid;
691
+ this.roleId = route.snapshot.queryParams['rid'];
715
692
  if (this.roleId === 'default') {
716
- this.roleId = null;
693
+ this.roleId = undefined;
717
694
  }
718
695
  // connect _stateDirty to the value observed in the part state
719
696
  this._editPartQuery.selectDirty().subscribe((d) => {
@@ -812,10 +789,10 @@ class EditPartQueryBase extends Query {
812
789
  return this.select((state) => state.saving);
813
790
  }
814
791
  selectPart() {
815
- return this.select((state) => state.part);
792
+ return this.select((state) => state.part || undefined);
816
793
  }
817
794
  selectThesauri() {
818
- return this.select((state) => state.thesauri);
795
+ return this.select((state) => state.thesauri || undefined);
819
796
  }
820
797
  }
821
798
 
@@ -834,26 +811,25 @@ class EditPartServiceBase {
834
811
  * it will get a null ID, but use the specified itemId and roleId.
835
812
  *
836
813
  * @param partId The part ID, unless it's a new part.
837
- * @param thesauriIds The thesauri IDs array, or null.
814
+ * @param thesauriIds The thesauri IDs array.
838
815
  * @param itemId The item ID for the new part.
839
816
  * @param typeId The part type ID for the new part.
840
817
  * @param roleId The role ID for the new part.
841
818
  */
842
- load(partId, thesauriIds = null, itemId, typeId, roleId) {
819
+ load(partId, thesauriIds, itemId, typeId, roleId) {
843
820
  // signal that we're loading
844
821
  this.store.setLoading(true);
845
822
  // if thesauri are required:
846
823
  if (thesauriIds) {
847
824
  // remove trailing ! from IDs if any
848
825
  const unscopedIds = thesauriIds.map((id) => {
849
- return this.thesaurusService.getScopedId(id, null);
826
+ return this.thesaurusService.getScopedId(id);
850
827
  });
851
828
  // fetch part and thesauri
852
829
  forkJoin({
853
- part: this.itemService.getPart(partId),
830
+ part: this.itemService.getPart(partId || ''),
854
831
  thesauri: this.thesaurusService.getThesauriSet(unscopedIds),
855
832
  }).subscribe((result) => {
856
- var _a;
857
833
  // loading has ended
858
834
  this.store.setLoading(false);
859
835
  // update the store with a new or existing part,
@@ -868,9 +844,9 @@ class EditPartServiceBase {
868
844
  thesauri: result.thesauri,
869
845
  });
870
846
  // if the loaded part has a thesaurus scope, reload the thesauri
871
- if ((_a = result.part) === null || _a === void 0 ? void 0 : _a.thesaurusScope) {
847
+ if (result.part?.thesaurusScope) {
872
848
  const scopedIds = thesauriIds.map((id) => {
873
- return this.thesaurusService.getScopedId(id, result.part.thesaurusScope);
849
+ return this.thesaurusService.getScopedId(id, result.part?.thesaurusScope);
874
850
  });
875
851
  // loading again
876
852
  this.store.setLoading(true);
@@ -890,7 +866,7 @@ class EditPartServiceBase {
890
866
  }
891
867
  else {
892
868
  // without thesauri to be fetched, just fetch the part
893
- this.itemService.getPart(partId).subscribe((part) => {
869
+ this.itemService.getPart(partId || '').subscribe((part) => {
894
870
  this.store.update({
895
871
  part: part || {
896
872
  id: null,
@@ -939,14 +915,6 @@ class EditPartServiceBase {
939
915
  }
940
916
  }
941
917
 
942
- const editPartInitialState = {
943
- part: null,
944
- thesauri: null,
945
- dirty: false,
946
- saving: false,
947
- loading: false,
948
- error: null
949
- };
950
918
  /**
951
919
  * General-purpose edit-part store. This can be used with any part, so that
952
920
  * you should only provide your part store, query, and service (usually
@@ -954,7 +922,7 @@ const editPartInitialState = {
954
922
  */
955
923
  let EditPartStore = class EditPartStore extends Store {
956
924
  constructor() {
957
- super(editPartInitialState);
925
+ super({});
958
926
  }
959
927
  setDirty(value) {
960
928
  this.update({ dirty: value });
@@ -963,25 +931,22 @@ let EditPartStore = class EditPartStore extends Store {
963
931
  this.update({ saving: value });
964
932
  }
965
933
  };
966
- EditPartStore.ɵprov = ɵɵdefineInjectable({ factory: function EditPartStore_Factory() { return new EditPartStore(); }, token: EditPartStore, providedIn: "root" });
967
- EditPartStore.decorators = [
968
- { type: Injectable, args: [{ providedIn: 'root' },] }
969
- ];
970
- EditPartStore.ctorParameters = () => [];
934
+ EditPartStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditPartStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
935
+ EditPartStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditPartStore, providedIn: 'root' });
971
936
  EditPartStore = __decorate([
972
937
  StoreConfig({ name: 'edit-part' })
973
- ], EditPartStore);
938
+ ], EditPartStore);
939
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditPartStore, decorators: [{
940
+ type: Injectable,
941
+ args: [{ providedIn: 'root' }]
942
+ }], ctorParameters: function () { return []; } });
974
943
 
975
- const initialState$2 = {
976
- part: null,
977
- baseText: null,
978
- baseTextPart: null,
944
+ const initialState = {
979
945
  locations: [],
980
946
  breakChance: -1,
981
947
  layerHints: [],
982
948
  thesauri: {},
983
949
  loading: false,
984
- error: null,
985
950
  deletingFragment: false,
986
951
  savingFragment: false,
987
952
  refreshingBreakChance: false,
@@ -989,7 +954,7 @@ const initialState$2 = {
989
954
  };
990
955
  let EditLayerPartStore = class EditLayerPartStore extends Store {
991
956
  constructor() {
992
- super(initialState$2);
957
+ super(initialState);
993
958
  }
994
959
  setDeletingFragment(value = true) {
995
960
  this.update({ deletingFragment: value });
@@ -1010,14 +975,15 @@ let EditLayerPartStore = class EditLayerPartStore extends Store {
1010
975
  this.update({ locations });
1011
976
  }
1012
977
  };
1013
- EditLayerPartStore.ɵprov = ɵɵdefineInjectable({ factory: function EditLayerPartStore_Factory() { return new EditLayerPartStore(); }, token: EditLayerPartStore, providedIn: "root" });
1014
- EditLayerPartStore.decorators = [
1015
- { type: Injectable, args: [{ providedIn: 'root' },] }
1016
- ];
1017
- EditLayerPartStore.ctorParameters = () => [];
978
+ EditLayerPartStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
979
+ EditLayerPartStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartStore, providedIn: 'root' });
1018
980
  EditLayerPartStore = __decorate([
1019
981
  StoreConfig({ name: 'edit-layer-part' })
1020
- ], EditLayerPartStore);
982
+ ], EditLayerPartStore);
983
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartStore, decorators: [{
984
+ type: Injectable,
985
+ args: [{ providedIn: 'root' }]
986
+ }], ctorParameters: function () { return []; } });
1021
987
 
1022
988
  class EditLayerPartQuery extends Query {
1023
989
  constructor(store) {
@@ -1043,13 +1009,12 @@ class EditLayerPartQuery extends Query {
1043
1009
  return this.select((state) => state.patchingLayer);
1044
1010
  }
1045
1011
  }
1046
- EditLayerPartQuery.ɵprov = ɵɵdefineInjectable({ factory: function EditLayerPartQuery_Factory() { return new EditLayerPartQuery(ɵɵinject(EditLayerPartStore)); }, token: EditLayerPartQuery, providedIn: "root" });
1047
- EditLayerPartQuery.decorators = [
1048
- { type: Injectable, args: [{ providedIn: 'root' },] }
1049
- ];
1050
- EditLayerPartQuery.ctorParameters = () => [
1051
- { type: EditLayerPartStore }
1052
- ];
1012
+ EditLayerPartQuery.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartQuery, deps: [{ token: EditLayerPartStore }], target: i0.ɵɵFactoryTarget.Injectable });
1013
+ EditLayerPartQuery.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartQuery, providedIn: 'root' });
1014
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartQuery, decorators: [{
1015
+ type: Injectable,
1016
+ args: [{ providedIn: 'root' }]
1017
+ }], ctorParameters: function () { return [{ type: EditLayerPartStore }]; } });
1053
1018
 
1054
1019
  class EditLayerPartService {
1055
1020
  constructor(_store, _itemService, _facetService, _thesaurusService) {
@@ -1074,7 +1039,7 @@ class EditLayerPartService {
1074
1039
  * @param partId The layer part ID.
1075
1040
  * @param thesauriIds The optional thesauri IDs to load.
1076
1041
  */
1077
- load(itemId, partId, thesauriIds = null) {
1042
+ load(itemId, partId, thesauriIds) {
1078
1043
  if (this._store.getValue().loading) {
1079
1044
  return;
1080
1045
  }
@@ -1082,7 +1047,7 @@ class EditLayerPartService {
1082
1047
  if (thesauriIds) {
1083
1048
  // remove trailing ! from IDs if any
1084
1049
  const unscopedIds = thesauriIds.map((id) => {
1085
- return this._thesaurusService.getScopedId(id, null);
1050
+ return this._thesaurusService.getScopedId(id);
1086
1051
  });
1087
1052
  forkJoin({
1088
1053
  // TODO: eventually optimize by adding method param to load only fragments locations
@@ -1102,10 +1067,10 @@ class EditLayerPartService {
1102
1067
  layerHints: result.layerHints,
1103
1068
  thesauri: result.thesauri,
1104
1069
  loading: false,
1105
- error: null,
1070
+ error: undefined,
1106
1071
  });
1107
1072
  // if the loaded part has a thesaurus scope, reload the thesauri
1108
- if (result.layerPart.thesaurusScope) {
1073
+ if (result.layerPart?.thesaurusScope) {
1109
1074
  const scopedIds = thesauriIds.map((id) => {
1110
1075
  return this._thesaurusService.getScopedId(id, result.layerPart.thesaurusScope);
1111
1076
  });
@@ -1143,7 +1108,7 @@ class EditLayerPartService {
1143
1108
  breakChance: result.breakChance.chance,
1144
1109
  layerHints: result.layerHints,
1145
1110
  loading: false,
1146
- error: null,
1111
+ error: undefined,
1147
1112
  });
1148
1113
  }, (error) => {
1149
1114
  console.error(error);
@@ -1196,7 +1161,7 @@ class EditLayerPartService {
1196
1161
  return;
1197
1162
  }
1198
1163
  const i = part.fragments.findIndex((p) => {
1199
- return TokenLocation.parse(p.location).overlaps(loc);
1164
+ return TokenLocation.parse(p.location)?.overlaps(loc);
1200
1165
  });
1201
1166
  if (i === -1) {
1202
1167
  return;
@@ -1267,27 +1232,16 @@ class EditLayerPartService {
1267
1232
  });
1268
1233
  }
1269
1234
  }
1270
- EditLayerPartService.ɵprov = ɵɵdefineInjectable({ factory: function EditLayerPartService_Factory() { return new EditLayerPartService(ɵɵinject(EditLayerPartStore), ɵɵinject(ItemService), ɵɵinject(FacetService), ɵɵinject(ThesaurusService)); }, token: EditLayerPartService, providedIn: "root" });
1271
- EditLayerPartService.decorators = [
1272
- { type: Injectable, args: [{ providedIn: 'root' },] }
1273
- ];
1274
- EditLayerPartService.ctorParameters = () => [
1275
- { type: EditLayerPartStore },
1276
- { type: ItemService },
1277
- { type: FacetService },
1278
- { type: ThesaurusService }
1279
- ];
1235
+ EditLayerPartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartService, deps: [{ token: EditLayerPartStore }, { token: i2.ItemService }, { token: i2.FacetService }, { token: i2.ThesaurusService }], target: i0.ɵɵFactoryTarget.Injectable });
1236
+ EditLayerPartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartService, providedIn: 'root' });
1237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditLayerPartService, decorators: [{
1238
+ type: Injectable,
1239
+ args: [{ providedIn: 'root' }]
1240
+ }], ctorParameters: function () { return [{ type: EditLayerPartStore }, { type: i2.ItemService }, { type: i2.FacetService }, { type: i2.ThesaurusService }]; } });
1280
1241
 
1281
- const initialState$3 = {
1282
- thesaurus: null,
1283
- dirty: false,
1284
- saving: false,
1285
- loading: false,
1286
- error: null,
1287
- };
1288
1242
  let EditThesaurusStore = class EditThesaurusStore extends Store {
1289
1243
  constructor() {
1290
- super(initialState$3);
1244
+ super({});
1291
1245
  }
1292
1246
  setDirty(value = true) {
1293
1247
  this.update({
@@ -1300,14 +1254,15 @@ let EditThesaurusStore = class EditThesaurusStore extends Store {
1300
1254
  });
1301
1255
  }
1302
1256
  };
1303
- EditThesaurusStore.ɵprov = ɵɵdefineInjectable({ factory: function EditThesaurusStore_Factory() { return new EditThesaurusStore(); }, token: EditThesaurusStore, providedIn: "root" });
1304
- EditThesaurusStore.decorators = [
1305
- { type: Injectable, args: [{ providedIn: 'root' },] }
1306
- ];
1307
- EditThesaurusStore.ctorParameters = () => [];
1257
+ EditThesaurusStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1258
+ EditThesaurusStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusStore, providedIn: 'root' });
1308
1259
  EditThesaurusStore = __decorate([
1309
1260
  StoreConfig({ name: 'edit-thesaurus', resettable: true })
1310
- ], EditThesaurusStore);
1261
+ ], EditThesaurusStore);
1262
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusStore, decorators: [{
1263
+ type: Injectable,
1264
+ args: [{ providedIn: 'root' }]
1265
+ }], ctorParameters: function () { return []; } });
1311
1266
 
1312
1267
  class EditThesaurusQuery extends Query {
1313
1268
  constructor(store) {
@@ -1317,20 +1272,19 @@ class EditThesaurusQuery extends Query {
1317
1272
  selectThesaurus() {
1318
1273
  return this.select(state => state.thesaurus);
1319
1274
  }
1320
- selectLoading() {
1321
- return this.select(state => state.loading);
1322
- }
1275
+ // public selectLoading(): Observable<boolean | undefined> {
1276
+ // return this.select(state => state.loading);
1277
+ // }
1323
1278
  selectSaving() {
1324
1279
  return this.select(state => state.saving);
1325
1280
  }
1326
1281
  }
1327
- EditThesaurusQuery.ɵprov = ɵɵdefineInjectable({ factory: function EditThesaurusQuery_Factory() { return new EditThesaurusQuery(ɵɵinject(EditThesaurusStore)); }, token: EditThesaurusQuery, providedIn: "root" });
1328
- EditThesaurusQuery.decorators = [
1329
- { type: Injectable, args: [{ providedIn: 'root' },] }
1330
- ];
1331
- EditThesaurusQuery.ctorParameters = () => [
1332
- { type: EditThesaurusStore }
1333
- ];
1282
+ EditThesaurusQuery.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusQuery, deps: [{ token: EditThesaurusStore }], target: i0.ɵɵFactoryTarget.Injectable });
1283
+ EditThesaurusQuery.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusQuery, providedIn: 'root' });
1284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusQuery, decorators: [{
1285
+ type: Injectable,
1286
+ args: [{ providedIn: 'root' }]
1287
+ }], ctorParameters: function () { return [{ type: EditThesaurusStore }]; } });
1334
1288
 
1335
1289
  class EditThesaurusService {
1336
1290
  constructor(_store, _thesaurusService) {
@@ -1354,7 +1308,7 @@ class EditThesaurusService {
1354
1308
  else {
1355
1309
  this._store.update({
1356
1310
  thesaurus: {
1357
- id: null,
1311
+ id: '',
1358
1312
  language: 'en',
1359
1313
  entries: [],
1360
1314
  },
@@ -1380,28 +1334,40 @@ class EditThesaurusService {
1380
1334
  });
1381
1335
  }
1382
1336
  }
1383
- EditThesaurusService.ɵprov = ɵɵdefineInjectable({ factory: function EditThesaurusService_Factory() { return new EditThesaurusService(ɵɵinject(EditThesaurusStore), ɵɵinject(ThesaurusService)); }, token: EditThesaurusService, providedIn: "root" });
1384
- EditThesaurusService.decorators = [
1385
- { type: Injectable, args: [{ providedIn: 'root' },] }
1386
- ];
1387
- EditThesaurusService.ctorParameters = () => [
1388
- { type: EditThesaurusStore },
1389
- { type: ThesaurusService }
1390
- ];
1337
+ EditThesaurusService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusService, deps: [{ token: EditThesaurusStore }, { token: i2.ThesaurusService }], target: i0.ɵɵFactoryTarget.Injectable });
1338
+ EditThesaurusService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusService, providedIn: 'root' });
1339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: EditThesaurusService, decorators: [{
1340
+ type: Injectable,
1341
+ args: [{ providedIn: 'root' }]
1342
+ }], ctorParameters: function () { return [{ type: EditThesaurusStore }, { type: i2.ThesaurusService }]; } });
1391
1343
 
1392
1344
  class CadmusStateModule {
1393
1345
  }
1394
- CadmusStateModule.decorators = [
1395
- { type: NgModule, args: [{
1396
- imports: [
1397
- CommonModule,
1398
- // Cadmus
1399
- CadmusCoreModule,
1400
- CadmusApiModule,
1401
- CadmusMaterialModule,
1402
- ],
1403
- },] }
1404
- ];
1346
+ CadmusStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CadmusStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1347
+ CadmusStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CadmusStateModule, imports: [CommonModule,
1348
+ // Cadmus
1349
+ CadmusCoreModule,
1350
+ CadmusApiModule,
1351
+ NgToolsModule] });
1352
+ CadmusStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CadmusStateModule, imports: [[
1353
+ CommonModule,
1354
+ // Cadmus
1355
+ CadmusCoreModule,
1356
+ CadmusApiModule,
1357
+ NgToolsModule,
1358
+ ]] });
1359
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: CadmusStateModule, decorators: [{
1360
+ type: NgModule,
1361
+ args: [{
1362
+ imports: [
1363
+ CommonModule,
1364
+ // Cadmus
1365
+ CadmusCoreModule,
1366
+ CadmusApiModule,
1367
+ NgToolsModule,
1368
+ ],
1369
+ }]
1370
+ }] });
1405
1371
 
1406
1372
  /*
1407
1373
  * Public API Surface of cadmus-state
@@ -1411,5 +1377,5 @@ CadmusStateModule.decorators = [
1411
1377
  * Generated bundle index. Do not edit.
1412
1378
  */
1413
1379
 
1414
- export { AppQuery, AppService, AppStore, CadmusStateModule, EditFragmentFeatureBase, EditFragmentQueryBase, EditFragmentServiceBase, EditFragmentStore, EditItemQuery, EditItemService, EditItemStore, EditLayerPartQuery, EditLayerPartService, EditLayerPartStore, EditPartFeatureBase, EditPartQueryBase, EditPartServiceBase, EditPartStore, EditThesaurusQuery, EditThesaurusService, EditThesaurusStore, editFragmentInitialState, editPartInitialState };
1415
- //# sourceMappingURL=myrmidon-cadmus-state.js.map
1380
+ export { AppQuery, AppService, AppStore, CadmusStateModule, EditFragmentFeatureBase, EditFragmentQueryBase, EditFragmentServiceBase, EditFragmentStore, EditItemQuery, EditItemService, EditItemStore, EditLayerPartQuery, EditLayerPartService, EditLayerPartStore, EditPartFeatureBase, EditPartQueryBase, EditPartServiceBase, EditPartStore, EditThesaurusQuery, EditThesaurusService, EditThesaurusStore, editFragmentInitialState };
1381
+ //# sourceMappingURL=myrmidon-cadmus-state.mjs.map