frame.identify 0.3.12 → 0.4.1
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/dist/EnterValues.d.ts +1 -0
- package/dist/EnterValues.d.ts.map +1 -1
- package/dist/MachineState.d.ts +1 -0
- package/dist/MachineState.d.ts.map +1 -1
- package/dist/ModalImageCropped.d.ts.map +1 -1
- package/dist/ModalImageLoaded.d.ts.map +1 -1
- package/dist/NumberInput.d.ts +1 -0
- package/dist/NumberInput.d.ts.map +1 -1
- package/dist/frame.identify.js +55 -39
- package/dist/frame.identify.js.map +1 -1
- package/package.json +1 -1
- package/dist/ModalEnterValues.d.ts +0 -8
- package/dist/ModalEnterValues.d.ts.map +0 -1
package/dist/EnterValues.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { identifyMachine } from './state/machine';
|
|
|
2
2
|
import { ActorRefFrom } from 'xstate';
|
|
3
3
|
export declare function EnterValues(props: {
|
|
4
4
|
actor: ActorRefFrom<typeof identifyMachine>;
|
|
5
|
+
testMode?: boolean;
|
|
5
6
|
}): import("react").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=EnterValues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnterValues.d.ts","sourceRoot":"","sources":["../src/EnterValues.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"EnterValues.d.ts","sourceRoot":"","sources":["../src/EnterValues.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,eAAe,EAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAK3C,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BA4HA"}
|
package/dist/MachineState.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { identifyMachine } from './state/machine';
|
|
|
2
2
|
import { ActorRefFrom } from 'xstate';
|
|
3
3
|
export declare function MachineState(props: {
|
|
4
4
|
actor: ActorRefFrom<typeof identifyMachine>;
|
|
5
|
+
testMode?: boolean;
|
|
5
6
|
}): import("react").JSX.Element;
|
|
6
7
|
//# sourceMappingURL=MachineState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MachineState.d.ts","sourceRoot":"","sources":["../src/MachineState.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAQhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,KAAK,EAAE,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"MachineState.d.ts","sourceRoot":"","sources":["../src/MachineState.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAQhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,KAAK,EAAE,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BAmEA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalImageCropped.d.ts","sourceRoot":"","sources":["../src/ModalImageCropped.tsx"],"names":[],"mappings":"AASA,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,+
|
|
1
|
+
{"version":3,"file":"ModalImageCropped.d.ts","sourceRoot":"","sources":["../src/ModalImageCropped.tsx"],"names":[],"mappings":"AASA,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,+BAqtBA"}
|
|
@@ -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,+
|
|
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"}
|
package/dist/NumberInput.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../src/NumberInput.tsx"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../src/NumberInput.tsx"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,+BAqEA"}
|
package/dist/frame.identify.js
CHANGED
|
@@ -4402,16 +4402,16 @@ function $o(e) {
|
|
|
4402
4402
|
n = t("main.identify.defineValues", { defaultValue: "Please define SL, SH, AZG values and click \"Submit\"" });
|
|
4403
4403
|
break;
|
|
4404
4404
|
case No:
|
|
4405
|
-
n = t("main.identify.
|
|
4405
|
+
n = t("main.identify.cropImage", { defaultValue: "Please crop the image by clicking and dragging the mouse" });
|
|
4406
4406
|
break;
|
|
4407
4407
|
case Po:
|
|
4408
|
-
n = t("main.identify.defineHorizontalLine", { defaultValue: "Please define a horizontal line" });
|
|
4408
|
+
n = t("main.identify.defineHorizontalLine", { defaultValue: "Please define a horizontal line (point 1)" });
|
|
4409
4409
|
break;
|
|
4410
4410
|
case Fo:
|
|
4411
|
-
n = t("main.identify.finishHorizontalLine", { defaultValue: "Please
|
|
4411
|
+
n = t("main.identify.finishHorizontalLine", { defaultValue: "Please define a horizontal line (point 2))" });
|
|
4412
4412
|
break;
|
|
4413
4413
|
case Io:
|
|
4414
|
-
n = t("main.identify.addPoints", { defaultValue: "Please
|
|
4414
|
+
n = t("main.identify.addPoints", { defaultValue: "Please mark some points to define the frame contour" });
|
|
4415
4415
|
break;
|
|
4416
4416
|
case Lo:
|
|
4417
4417
|
n = t("main.identify.clickDone", { defaultValue: "Please click \"Done\" to finish the process" });
|
|
@@ -4421,7 +4421,7 @@ function $o(e) {
|
|
|
4421
4421
|
value: r.value
|
|
4422
4422
|
});
|
|
4423
4423
|
}
|
|
4424
|
-
return /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c(x, {
|
|
4424
|
+
return /* @__PURE__ */ c("div", { children: [e.testMode && /* @__PURE__ */ c(x, {
|
|
4425
4425
|
sx: {
|
|
4426
4426
|
textAlign: "left",
|
|
4427
4427
|
paddingLeft: 1,
|
|
@@ -4466,7 +4466,7 @@ function es(e) {
|
|
|
4466
4466
|
e
|
|
4467
4467
|
]), /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(b, {
|
|
4468
4468
|
"data-testid": `NumberInput.Textfield.${e.dataTestid}`,
|
|
4469
|
-
|
|
4469
|
+
autoFocus: e.autofocus ?? !1,
|
|
4470
4470
|
color: "secondary",
|
|
4471
4471
|
label: e.label,
|
|
4472
4472
|
variant: "filled",
|
|
@@ -4494,28 +4494,34 @@ function es(e) {
|
|
|
4494
4494
|
//#endregion
|
|
4495
4495
|
//#region src/EnterValues.tsx
|
|
4496
4496
|
function ts(e) {
|
|
4497
|
-
let [t, n] = a("50"), [
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4497
|
+
let [t, n] = a(e.testMode ? "50" : ""), [r, i] = a(e.testMode ? "44" : ""), [l, u] = a(e.testMode ? "15" : ""), d = T(e.actor, (e) => e), f = (e, t, n, r) => {
|
|
4498
|
+
let i = parseFloat(t);
|
|
4499
|
+
n(i <= 0 ? v("main.identify.error.positive", { field: e }) : i > r ? v("main.identify.error.notGreaterThan", {
|
|
4500
|
+
field: e,
|
|
4501
|
+
max: r,
|
|
4502
|
+
defaultValue: v("main.identify.error.notGreaterThan", {
|
|
4503
|
+
field: e,
|
|
4504
|
+
max: r
|
|
4505
|
+
})
|
|
4506
|
+
}) : "");
|
|
4507
|
+
}, p = {
|
|
4508
|
+
textTransform: "none",
|
|
4503
4509
|
width: "calc(100% - 100px)",
|
|
4504
4510
|
marginLeft: "50px",
|
|
4505
4511
|
marginRight: "50px"
|
|
4506
4512
|
};
|
|
4507
|
-
function
|
|
4508
|
-
|
|
4509
|
-
type:
|
|
4513
|
+
function h(t, n, r) {
|
|
4514
|
+
e.actor.send({
|
|
4515
|
+
type: Bo,
|
|
4510
4516
|
SL: Number(t),
|
|
4511
4517
|
SH: Number(n),
|
|
4512
4518
|
AZG: Number(r)
|
|
4513
4519
|
});
|
|
4514
4520
|
}
|
|
4515
|
-
let
|
|
4521
|
+
let _ = d.value === "Image loaded" && Number(t) > 0 && Number(t) < 100 && Number(r) > 0 && Number(r) < 100 && Number(l) > 0 && Number(l) < 100, { t: v } = m();
|
|
4516
4522
|
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s("form", {
|
|
4517
4523
|
onSubmit: (e) => {
|
|
4518
|
-
e.preventDefault(),
|
|
4524
|
+
e.preventDefault(), h(t, r, l);
|
|
4519
4525
|
},
|
|
4520
4526
|
children: /* @__PURE__ */ c("div", {
|
|
4521
4527
|
style: {
|
|
@@ -4532,23 +4538,24 @@ function ts(e) {
|
|
|
4532
4538
|
children: [
|
|
4533
4539
|
/* @__PURE__ */ s(es, {
|
|
4534
4540
|
value: t,
|
|
4535
|
-
checkValue:
|
|
4541
|
+
checkValue: (e, t) => f("SL", e, t, 80),
|
|
4536
4542
|
onChange: n,
|
|
4537
|
-
label:
|
|
4538
|
-
dataTestid: "scheibenlaenge-input"
|
|
4543
|
+
label: v("main.identify.label.scheibenlaenge", { defaultValue: "box length" }),
|
|
4544
|
+
dataTestid: "scheibenlaenge-input",
|
|
4545
|
+
autofocus: !0
|
|
4539
4546
|
}),
|
|
4540
4547
|
/* @__PURE__ */ s(es, {
|
|
4541
|
-
value:
|
|
4542
|
-
checkValue:
|
|
4543
|
-
onChange:
|
|
4544
|
-
label:
|
|
4548
|
+
value: r,
|
|
4549
|
+
checkValue: (e, t) => f("SH", e, t, 60),
|
|
4550
|
+
onChange: i,
|
|
4551
|
+
label: v("main.identify.label.scheibenhoehe", { defaultValue: "box height" }),
|
|
4545
4552
|
dataTestid: "scheibenhoehe-input"
|
|
4546
4553
|
}),
|
|
4547
4554
|
/* @__PURE__ */ s(es, {
|
|
4548
|
-
value:
|
|
4549
|
-
checkValue:
|
|
4550
|
-
onChange:
|
|
4551
|
-
label:
|
|
4555
|
+
value: l,
|
|
4556
|
+
checkValue: (e, t) => f("AzG", e, t, 20),
|
|
4557
|
+
onChange: u,
|
|
4558
|
+
label: v("main.identify.label.azg", { defaultValue: "distance between lenses" }),
|
|
4552
4559
|
dataTestid: "azg-input"
|
|
4553
4560
|
})
|
|
4554
4561
|
]
|
|
@@ -4556,10 +4563,10 @@ function ts(e) {
|
|
|
4556
4563
|
color: "secondary",
|
|
4557
4564
|
variant: "contained",
|
|
4558
4565
|
size: "small",
|
|
4559
|
-
disabled:
|
|
4560
|
-
sx:
|
|
4566
|
+
disabled: !_,
|
|
4567
|
+
sx: p,
|
|
4561
4568
|
type: "submit",
|
|
4562
|
-
children:
|
|
4569
|
+
children: v("main.identify.button.confirmValues")
|
|
4563
4570
|
})]
|
|
4564
4571
|
})
|
|
4565
4572
|
}) });
|
|
@@ -4664,8 +4671,14 @@ function ns(e) {
|
|
|
4664
4671
|
},
|
|
4665
4672
|
testMode: e.testMode
|
|
4666
4673
|
}, _),
|
|
4667
|
-
/* @__PURE__ */ s($o, {
|
|
4668
|
-
|
|
4674
|
+
/* @__PURE__ */ s($o, {
|
|
4675
|
+
actor: e.actor,
|
|
4676
|
+
testMode: e.testMode
|
|
4677
|
+
}),
|
|
4678
|
+
w.value === "Image loaded" && /* @__PURE__ */ s(ts, {
|
|
4679
|
+
actor: e.actor,
|
|
4680
|
+
testMode: e.testMode
|
|
4681
|
+
}),
|
|
4669
4682
|
w.value !== "idle" && /* @__PURE__ */ s("div", {
|
|
4670
4683
|
style: {
|
|
4671
4684
|
background: "#fff",
|
|
@@ -6387,8 +6400,8 @@ function Fc(e) {
|
|
|
6387
6400
|
x: e.x * t,
|
|
6388
6401
|
y: e.y * (n ?? t)
|
|
6389
6402
|
})), []), ee = (e) => {
|
|
6390
|
-
let t = e[0], n = e[1]
|
|
6391
|
-
return
|
|
6403
|
+
let t = e[0], n = e[1];
|
|
6404
|
+
return -Math.atan2(t.y, t.x) > -Math.atan2(n.y, n.x);
|
|
6392
6405
|
}, te = n((e, t, n, r = !1) => {
|
|
6393
6406
|
let i = Mc(n, w ? "akima" : "catmull"), a = -Infinity, o = Infinity, s = -Infinity, c = Infinity, l = Array.from({ length: 128 }, (e, t) => {
|
|
6394
6407
|
let n = i(t * 2 * Math.PI / 128);
|
|
@@ -6401,8 +6414,8 @@ function Fc(e) {
|
|
|
6401
6414
|
})).map((e) => ({
|
|
6402
6415
|
x: e.x,
|
|
6403
6416
|
y: -e.y
|
|
6404
|
-
})), u = I(i, r)
|
|
6405
|
-
return
|
|
6417
|
+
})), u = I(i, r);
|
|
6418
|
+
return ee(u) || u.reverse(), u;
|
|
6406
6419
|
}
|
|
6407
6420
|
return l;
|
|
6408
6421
|
}, [w, I]);
|
|
@@ -6536,7 +6549,7 @@ function Fc(e) {
|
|
|
6536
6549
|
return e.splice(n, 1), e;
|
|
6537
6550
|
}
|
|
6538
6551
|
return t;
|
|
6539
|
-
}) : (
|
|
6552
|
+
}) : (p((t) => [...t, e]), oe(Yo));
|
|
6540
6553
|
}
|
|
6541
6554
|
}
|
|
6542
6555
|
function fe(e) {
|
|
@@ -6574,7 +6587,10 @@ function Fc(e) {
|
|
|
6574
6587
|
backgroundColor: A.palette.primary.main
|
|
6575
6588
|
},
|
|
6576
6589
|
children: [
|
|
6577
|
-
/* @__PURE__ */ s($o, {
|
|
6590
|
+
/* @__PURE__ */ s($o, {
|
|
6591
|
+
actor: e.actor,
|
|
6592
|
+
testMode: e.testMode
|
|
6593
|
+
}, h),
|
|
6578
6594
|
/* @__PURE__ */ s("canvas", {
|
|
6579
6595
|
ref: o,
|
|
6580
6596
|
style: {
|