frame.identify 0.4.4 → 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,7 +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;
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;
11
12
  testMode?: boolean;
12
13
  }): import("react").JSX.Element;
13
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,EAAE;IACtC,KAAK,EAAE,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,CACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,KAAK,EAAE,EAChB,KAAK,CAAC,EAAE,OAAO,KACZ,MAAM,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BAoTA"}
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,EAAE;IACtC,KAAK,EAAE,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,CACjB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,KAAK,EAAE,EACtB,MAAM,EAAE,KAAK,EAAE,KACZ,MAAM,IAAI,CAAC;IAChB,gBAAgB,CAAC,EAAE,CACjB,MAAM,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,11 +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
- s.width = t * 2, s.height = r * 2, s.getContext("2d")?.drawImage(n.current, i, a, t, r, 0, 0, t * 2, r * 2), p(s.toDataURL()), y((e) => e + 1), u(!0), e.actor.send({ type: o });
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
+ let c = n.current.src;
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 });
4652
4654
  }
4653
4655
  return /* @__PURE__ */ s(jo, {
4654
4656
  keepMounted: !0,
@@ -4659,7 +4661,7 @@ function rs(e) {
4659
4661
  alignItems: "center"
4660
4662
  },
4661
4663
  open: e.modalIsOpen,
4662
- 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, [], []),
4663
4665
  children: /* @__PURE__ */ c(v, {
4664
4666
  elevation: 1,
4665
4667
  sx: {
@@ -4675,9 +4677,9 @@ function rs(e) {
4675
4677
  actor: e.actor,
4676
4678
  dataUrl: f,
4677
4679
  modalIsOpen: l,
4678
- closeModal: (t, n) => () => {
4679
- let r = w.context.SL ?? 0, i = w.context.SH ?? 0, a = w.context.AZG ?? 0;
4680
- 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);
4681
4683
  },
4682
4684
  testMode: e.testMode
4683
4685
  }, _),
@@ -6448,7 +6450,7 @@ function Ic(e) {
6448
6450
  n = a;
6449
6451
  }
6450
6452
  return e.testMode && console.log(`splitIndex: ${r}`), ie(t, r - 1);
6451
- }, []), oe = n((e, t, n) => e.map((e) => ({
6453
+ }, [e.testMode]), oe = n((e, t, n) => e.map((e) => ({
6452
6454
  x: e.x * t,
6453
6455
  y: e.y * (n ?? t)
6454
6456
  })), []), z = (e) => {
@@ -6576,7 +6578,7 @@ function Ic(e) {
6576
6578
  if (e.actor.send({ type: Zo }), !Ee) throw Error("SL is undefined");
6577
6579
  if (!De) throw Error("SH is undefined");
6578
6580
  let t = ce(Ee, De, !0);
6579
- e.closeModal(t, !1)();
6581
+ e.onCloseModal(b, f, t)();
6580
6582
  }
6581
6583
  function B() {
6582
6584
  M(!1);
@@ -6650,7 +6652,7 @@ function Ic(e) {
6650
6652
  alignItems: "center"
6651
6653
  },
6652
6654
  open: e.modalIsOpen,
6653
- onClose: e.closeModal([], !1),
6655
+ onClose: e.onCloseModal(0, [], []),
6654
6656
  children: /* @__PURE__ */ c(v, {
6655
6657
  elevation: 1,
6656
6658
  sx: {