@annotorious/annotorious 3.0.17 → 3.0.19

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,11 +1,11 @@
1
- import { Annotation, ChangeSet, DrawingStyleExpression, FormatAdapter, UserSelectActionExpression } from '@annotorious/core';
1
+ import { Annotation, DrawingStyleExpression, FormatAdapter, History, UserSelectActionExpression } from '@annotorious/core';
2
2
  import { ImageAnnotation } from './model';
3
3
  export interface AnnotoriousOpts<I extends Annotation = ImageAnnotation, E extends unknown = ImageAnnotation> {
4
4
  adapter?: FormatAdapter<I, E>;
5
5
  autoSave?: boolean;
6
6
  drawingEnabled?: boolean;
7
7
  drawingMode?: DrawingMode;
8
- initialHistory?: ChangeSet<I>[];
8
+ initialHistory?: History<I>;
9
9
  modalSelect?: boolean;
10
10
  userSelectAction?: UserSelectActionExpression<E>;
11
11
  style?: DrawingStyleExpression<ImageAnnotation>;
@@ -966,8 +966,8 @@ let ro = () => ({
966
966
  }
967
967
  });
968
968
  const lo = 250, ao = (e, t) => {
969
- const n = ro(), o = t || [];
970
- let i = -1, s = !1, r = 0;
969
+ const n = ro(), o = (t == null ? void 0 : t.changes) || [];
970
+ let i = t ? t.pointer : -1, s = !1, r = 0;
971
971
  const l = (g) => {
972
972
  if (!s) {
973
973
  const { changes: _ } = g, A = performance.now();
@@ -987,7 +987,7 @@ const lo = 250, ao = (e, t) => {
987
987
  canRedo: () => o.length - 1 > i,
988
988
  canUndo: () => i > -1,
989
989
  destroy: () => e.unobserve(l),
990
- getHistory: () => [...o],
990
+ getHistory: () => ({ changes: [...o], pointer: i }),
991
991
  on: (g, _) => n.on(g, _),
992
992
  redo: () => {
993
993
  if (o.length - 1 > i) {