@annotorious/core 3.0.0-pre-alpha-50 → 3.0.0-pre-alpha-51

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/core",
3
- "version": "3.0.0-pre-alpha-50",
3
+ "version": "3.0.0-pre-alpha-51",
4
4
  "description": "Annotorious core types and functions",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -108,9 +108,13 @@ export const createStore = <T extends Annotation>() => {
108
108
 
109
109
  const all = () => [...annotationIndex.values()];
110
110
 
111
- const clear = () => {
111
+ const clear = (origin = Origin.LOCAL) => {
112
+ const all = [...annotationIndex.values()];
113
+
112
114
  annotationIndex.clear();
113
115
  bodyIndex.clear();
116
+
117
+ emit(origin, { deleted: all });
114
118
  }
115
119
 
116
120
  const bulkAddAnnotation = (annotations: T[], replace = true, origin = Origin.LOCAL) => {