@eeacms/volto-slate-footnote 6.1.1 → 6.1.2

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/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [6.1.2](https://github.com/eea/volto-slate-footnote/compare/6.1.1...6.1.2) - 24 July 2023
8
+
7
9
  ### [6.1.1](https://github.com/eea/volto-slate-footnote/compare/6.1.0...6.1.1) - 12 June 2023
8
10
 
9
11
  #### :house: Internal changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-slate-footnote",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
4
4
  "description": "volto-slate-footnote: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -68,9 +68,7 @@ const MultiSelectSearchWidget = injectLazyLibs('reactSelectAsyncCreateable')(
68
68
  const isMatch = (result) => re.test(result.value);
69
69
  const resultsFiltered = filter(props.choices, isMatch);
70
70
 
71
- return new Promise((resolve, reject) => {
72
- resolve(resultsFiltered);
73
- });
71
+ return Promise.resolve(resultsFiltered);
74
72
  };
75
73
 
76
74
  /**
@@ -110,7 +108,6 @@ const MultiSelectSearchWidget = injectLazyLibs('reactSelectAsyncCreateable')(
110
108
  ...item,
111
109
  footnote: item.value,
112
110
  };
113
-
114
111
  const { __isNew__: remove, extra, ...rest } = obj;
115
112
  return rest;
116
113
  });
@@ -41,21 +41,23 @@ export const FootnoteElement = (props) => {
41
41
 
42
42
  // will cosider zotero citations and footnote
43
43
  // notesObjResult contains all zotero/footnote as unique, and contain refs for other zotero/footnote
44
+ const indiceIfZoteroId = data.extra
45
+ ? [
46
+ `[${Object.keys(notesObjResult).indexOf(zoteroId) + 1}]`, // parent footnote
47
+ ...data.extra.map(
48
+ // citations from extra
49
+ (zoteroObj, _index) =>
50
+ // all zotero citation are indexed by zoteroId in notesObjResult
51
+ `[${
52
+ Object.keys(notesObjResult).indexOf(zoteroObj.zoteroId) + 1
53
+ }]`,
54
+ ),
55
+ ].join('')
56
+ : // no extra citations (no multiples)
57
+ `[${Object.keys(notesObjResult).indexOf(zoteroId) + 1}]`;
58
+
44
59
  const indice = zoteroId // ZOTERO
45
- ? data.extra
46
- ? [
47
- `[${Object.keys(notesObjResult).indexOf(zoteroId) + 1}]`, // parent footnote
48
- ...data.extra.map(
49
- // citations from extra
50
- (zoteroObj, _index) =>
51
- // all zotero citation are indexed by zoteroId in notesObjResult
52
- `[${
53
- Object.keys(notesObjResult).indexOf(zoteroObj.zoteroId) + 1
54
- }]`,
55
- ),
56
- ].join('')
57
- : // no extra citations (no multiples)
58
- `[${Object.keys(notesObjResult).indexOf(zoteroId) + 1}]`
60
+ ? indiceIfZoteroId
59
61
  : // FOOTNOTES
60
62
  // parent footnote
61
63
  [data, ...(data.extra || [])]