@fontoxml/fontoxml-development-tools 8.11.0 → 8.12.0-nightly.20250103232913

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@fontoxml/fontoxml-development-tools",
3
- "version": "8.11.0",
3
+ "version": "8.12.0-nightly.20250103232913",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@fontoxml/fontoxml-development-tools",
9
- "version": "8.11.0",
9
+ "version": "8.12.0-nightly.20250103232913",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@babel/core": "7.25.2",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fontoxml/fontoxml-development-tools",
3
3
  "description": "Development tools for Fonto.",
4
- "version": "8.11.0",
4
+ "version": "8.12.0-nightly.20250103232913",
5
5
  "author": "The Fonto Team",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -220,17 +220,27 @@ export default class AnnotationDatabase {
220
220
  */
221
221
  addAnnotations(cms, currentSession, annotationsToAdd) {
222
222
  return this._getDatabase(cms, currentSession).then((database) => {
223
- const annotations = annotationsToAdd.map((annotationToAdd) => ({
224
- ...annotationToAdd,
225
- author: {
226
- id: currentSession.user.id,
227
- displayName: currentSession.user.displayName,
228
- },
229
- id: uuid(),
230
- replies: [],
231
- revisionId: uuid(),
232
- timestamp: new Date().toISOString(),
233
- }));
223
+ const annotations = annotationsToAdd.map((annotationToAdd) => {
224
+ const annotation = {
225
+ ...annotationToAdd,
226
+ author: {
227
+ id: currentSession.user.id,
228
+ displayName: currentSession.user.displayName,
229
+ },
230
+ id: uuid(),
231
+ replies: [],
232
+ revisionId: uuid(),
233
+ timestamp: new Date().toISOString(),
234
+ };
235
+ if (annotation.status === 'ANNOTATION_STATUS_RESOLVED') {
236
+ annotation.resolvedAuthor = {
237
+ id: currentSession.user.id,
238
+ displayName: currentSession.user.displayName,
239
+ };
240
+ annotation.resolvedTimestamp = new Date().toISOString();
241
+ }
242
+ return annotation;
243
+ });
234
244
 
235
245
  database.annotations = database.annotations.concat(annotations);
236
246
  return this._updateDatabase(cms, currentSession, database).then(