frame.identify 0.4.5 → 0.5.0

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.
@@ -27,7 +27,7 @@ export declare function ModalImageCropped(props: {
27
27
  actor: ActorRefFrom<typeof identifyMachine>;
28
28
  dataUrl: string;
29
29
  modalIsOpen: boolean;
30
- closeModal: (points: Point[], reset: boolean) => () => void;
30
+ onCloseModal: (rotationAngle: number, contourPoints: Point[], points: Point[]) => () => void;
31
31
  testMode?: boolean;
32
32
  }): import("react").JSX.Element;
33
33
  //# sourceMappingURL=ModalImageCropped.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModalImageCropped.d.ts","sourceRoot":"","sources":["../src/ModalImageCropped.tsx"],"names":[],"mappings":"AAUA,OAAO,EAUL,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG3C,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAG1B;;;;;;;;;GASG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,KAAK,EAAE,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,IAAI,CAAC;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BAi4BA"}
1
+ {"version":3,"file":"ModalImageCropped.d.ts","sourceRoot":"","sources":["../src/ModalImageCropped.tsx"],"names":[],"mappings":"AAUA,OAAO,EAUL,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG3C,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAG1B;;;;;;;;;GASG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,KAAK,EAAE,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,CACZ,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,KAAK,EAAE,EACtB,MAAM,EAAE,KAAK,EAAE,KACZ,MAAM,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BA01BA"}
@@ -7,8 +7,8 @@ export type ModalImageLoadedHandle = {
7
7
  export declare function ModalImageLoaded(props: {
8
8
  actor: ActorRefFrom<typeof identifyMachine>;
9
9
  modalIsOpen: boolean;
10
- closeModal: (sl: number, sh: number, dbl: number, points?: Point[], reset?: boolean) => () => void;
11
- onAfterCropImage?: (x0: number, y0: number, width: number, height: number, sl: number, sh: number, dbl: number, base64: string) => void;
10
+ onAfterCloseModal: (sl: number, sh: number, dbl: number, rotationAngle: number, contourPoints: Point[], points: Point[]) => () => void;
11
+ onAfterCropImage?: (base64: string, sl: number, sh: number, dbl: number, x0: number, y0: number, width: number, height: number) => void;
12
12
  testMode?: boolean;
13
13
  }): import("react").JSX.Element;
14
14
  //# sourceMappingURL=ModalImageLoaded.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModalImageLoaded.d.ts","sourceRoot":"","sources":["../src/ModalImageLoaded.tsx"],"names":[],"mappings":"AAIA,OAAO,EAKL,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAI3C,OAAO,EAAqB,KAAK,EAAE,MAAM,GAAG,CAAC;AAG7C,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAIF,wBAAgB,gBAAgB,CAAC,KAAK,EA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,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,KACX,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BAmUA"}
@@ -4644,13 +4644,13 @@ function rs(e) {
4644
4644
  function P() {
4645
4645
  e.actor.send({ type: zo });
4646
4646
  let t = w.context.SL ?? 0, n = w.context.SH ?? 0, r = w.context.AZG ?? 0;
4647
- e.closeModal(t, n, r, [], !1)();
4647
+ e.onAfterCloseModal(t, n, r, 0, [], [])();
4648
4648
  }
4649
4649
  function ee(t, r, i, a, o) {
4650
4650
  let s = document.createElement("canvas");
4651
4651
  s.width = t * 2, s.height = r * 2, s.getContext("2d")?.drawImage(n.current, i, a, t, r, 0, 0, t * 2, r * 2);
4652
4652
  let c = n.current.src;
4653
- p(s.toDataURL()), y((e) => e + 1), u(!0), e.onAfterCropImage?.(i, a, t, r, w.context.SL ?? 0, w.context.SH ?? 0, w.context.AZG ?? 0, c), e.actor.send({ type: o });
4653
+ p(s.toDataURL()), y((e) => e + 1), u(!0), e.onAfterCropImage?.(c, w.context.SL ?? 0, w.context.SH ?? 0, w.context.AZG ?? 0, i, a, t, r), e.actor.send({ type: o });
4654
4654
  }
4655
4655
  return /* @__PURE__ */ s(jo, {
4656
4656
  keepMounted: !0,
@@ -4661,7 +4661,7 @@ function rs(e) {
4661
4661
  alignItems: "center"
4662
4662
  },
4663
4663
  open: e.modalIsOpen,
4664
- onClose: e.closeModal(w.context.SL ?? 0, w.context.SH ?? 0, w.context.AZG ?? 0, [], !1),
4664
+ onClose: e.onAfterCloseModal(w.context.SL ?? 0, w.context.SH ?? 0, w.context.AZG ?? 0, 0, [], []),
4665
4665
  children: /* @__PURE__ */ c(v, {
4666
4666
  elevation: 1,
4667
4667
  sx: {
@@ -4677,9 +4677,9 @@ function rs(e) {
4677
4677
  actor: e.actor,
4678
4678
  dataUrl: f,
4679
4679
  modalIsOpen: l,
4680
- closeModal: (t, n) => () => {
4681
- let r = w.context.SL ?? 0, i = w.context.SH ?? 0, a = w.context.AZG ?? 0;
4682
- e.closeModal(r, i, a, t, n)(), u(!1);
4680
+ onCloseModal: (t, n, r) => () => {
4681
+ let i = w.context.SL ?? 0, a = w.context.SH ?? 0, o = w.context.AZG ?? 0;
4682
+ e.onAfterCloseModal(i, a, o, t, n, r)(), u(!1);
4683
4683
  },
4684
4684
  testMode: e.testMode
4685
4685
  }, _),
@@ -6450,7 +6450,7 @@ function Ic(e) {
6450
6450
  n = a;
6451
6451
  }
6452
6452
  return e.testMode && console.log(`splitIndex: ${r}`), ie(t, r - 1);
6453
- }, []), oe = n((e, t, n) => e.map((e) => ({
6453
+ }, [e.testMode]), oe = n((e, t, n) => e.map((e) => ({
6454
6454
  x: e.x * t,
6455
6455
  y: e.y * (n ?? t)
6456
6456
  })), []), z = (e) => {
@@ -6578,7 +6578,7 @@ function Ic(e) {
6578
6578
  if (e.actor.send({ type: Zo }), !Ee) throw Error("SL is undefined");
6579
6579
  if (!De) throw Error("SH is undefined");
6580
6580
  let t = ce(Ee, De, !0);
6581
- e.closeModal(t, !1)();
6581
+ e.onCloseModal(b, f, t)();
6582
6582
  }
6583
6583
  function B() {
6584
6584
  M(!1);
@@ -6652,7 +6652,7 @@ function Ic(e) {
6652
6652
  alignItems: "center"
6653
6653
  },
6654
6654
  open: e.modalIsOpen,
6655
- onClose: e.closeModal([], !1),
6655
+ onClose: e.onCloseModal(0, [], []),
6656
6656
  children: /* @__PURE__ */ c(v, {
6657
6657
  elevation: 1,
6658
6658
  sx: {