@annotorious/annotorious 3.0.16 → 3.0.17

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,10 +1,11 @@
1
- import { Annotation, DrawingStyleExpression, FormatAdapter, UserSelectActionExpression } from '@annotorious/core';
1
+ import { Annotation, ChangeSet, DrawingStyleExpression, FormatAdapter, 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
9
  modalSelect?: boolean;
9
10
  userSelectAction?: UserSelectActionExpression<E>;
10
11
  style?: DrawingStyleExpression<ImageAnnotation>;
@@ -966,7 +966,7 @@ let ro = () => ({
966
966
  }
967
967
  });
968
968
  const lo = 250, ao = (e, t) => {
969
- const n = ro(), o = [];
969
+ const n = ro(), o = t || [];
970
970
  let i = -1, s = !1, r = 0;
971
971
  const l = (g) => {
972
972
  if (!s) {
@@ -4387,7 +4387,7 @@ const Ci = () => {
4387
4387
  drawingMode: "drag",
4388
4388
  userSelectAction: nn.EDIT,
4389
4389
  theme: "light"
4390
- }), i = Ui(o), { selection: s, store: r } = i, l = ao(r), a = fo(
4390
+ }), i = Ui(o), { selection: s, store: r } = i, l = ao(r, o.initialHistory), a = fo(
4391
4391
  i,
4392
4392
  l,
4393
4393
  o.adapter,