frame.identify 0.3.2 → 0.3.5
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalImageCropped.d.ts","sourceRoot":"","sources":["../src/ModalImageCropped.tsx"],"names":[],"mappings":"AAGA,OAAO,EAYL,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG3C,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAE1B;;;;;;;;;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;CAC7D,+
|
|
1
|
+
{"version":3,"file":"ModalImageCropped.d.ts","sourceRoot":"","sources":["../src/ModalImageCropped.tsx"],"names":[],"mappings":"AAGA,OAAO,EAYL,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG3C,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAE1B;;;;;;;;;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;CAC7D,+BA6qBA"}
|
|
@@ -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,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAE1B,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;CACjB,+
|
|
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,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAE1B,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;CACjB,+BAoSA"}
|
|
@@ -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;CACpB,+
|
|
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;CACpB,+BAqEA"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
-24,97; 0,33
|
|
2
|
+
-24,90; 1,71
|
|
3
|
+
-24,78; 3,07
|
|
4
|
+
-24,64; 4,21
|
|
5
|
+
-24,44; 5,49
|
|
6
|
+
-24,15; 6,89
|
|
7
|
+
-23,81; 8,2
|
|
8
|
+
-23,41; 9,39
|
|
9
|
+
-22,89; 10,58
|
|
10
|
+
-22,22; 11,68
|
|
11
|
+
-21,29; 12,66
|
|
12
|
+
-20,08; 13,42
|
|
13
|
+
-18,60; 14
|
|
14
|
+
-17,20; 14,35
|
|
15
|
+
-15,66; 14,61
|
|
16
|
+
-14,18; 14,75
|
|
17
|
+
-12,81; 14,82
|
|
18
|
+
-11,57; 14,83
|
|
19
|
+
-10,30; 14,81
|
|
20
|
+
-9,02; 14,75
|
|
21
|
+
-7,91; 14,67
|
|
22
|
+
-6,81; 14,58
|
|
23
|
+
-5,88; 14,48
|
|
24
|
+
-4,97; 14,37
|
|
25
|
+
-4,06; 14,24
|
|
26
|
+
-3,17; 14,11
|
|
27
|
+
-2,28; 13,96
|
|
28
|
+
-1,59; 13,84
|
|
29
|
+
-0,74; 13,68
|
|
30
|
+
-0,08; 13,54
|
|
31
|
+
0,72; 13,37
|
|
32
|
+
1,35; 13,23
|
|
33
|
+
2,10; 13,04
|
|
34
|
+
2,81; 12,86
|
|
35
|
+
3,36; 12,7
|
|
36
|
+
4,01; 12,51
|
|
37
|
+
4,74; 12,28
|
|
38
|
+
5,31; 12,07
|
|
39
|
+
5,97; 11,79
|
|
40
|
+
6,51; 11,52
|
|
41
|
+
7,13; 11,17
|
|
42
|
+
7,63; 10,85
|
|
43
|
+
8,21; 10,45
|
|
44
|
+
8,68; 10,09
|
|
45
|
+
9,23; 9,64
|
|
46
|
+
9,68; 9,25
|
|
47
|
+
10,19; 8,76
|
|
48
|
+
10,61; 8,34
|
|
49
|
+
11,09; 7,82
|
|
50
|
+
11,49; 7,37
|
|
51
|
+
11,87; 6,93
|
|
52
|
+
12,32; 6,38
|
|
53
|
+
12,68; 5,92
|
|
54
|
+
13,11; 5,37
|
|
55
|
+
13,52; 4,81
|
|
56
|
+
13,92; 4,26
|
|
57
|
+
14,32; 3,71
|
|
58
|
+
14,70; 3,17
|
|
59
|
+
15,15; 2,56
|
|
60
|
+
15,58; 1,95
|
|
61
|
+
16,06; 1,29
|
|
62
|
+
16,60; 0,59
|
|
63
|
+
17,18; -0,13
|
|
64
|
+
17,88; -0,89
|
|
65
|
+
18,86; -1,79
|
|
66
|
+
20,03; -2,73
|
|
67
|
+
21,68; -3,92
|
|
68
|
+
23,68; -5,35
|
|
69
|
+
25,00; -6,83
|
|
70
|
+
23,81; -7,72
|
|
71
|
+
20,62; -7,78
|
|
72
|
+
17,48; -7,57
|
|
73
|
+
15,10; -7,4
|
|
74
|
+
13,30; -7,29
|
|
75
|
+
11,88; -7,23
|
|
76
|
+
10,88; -7,2
|
|
77
|
+
9,87; -7,19
|
|
78
|
+
9,01; -7,2
|
|
79
|
+
8,29; -7,21
|
|
80
|
+
7,72; -7,23
|
|
81
|
+
7,15; -7,26
|
|
82
|
+
6,59; -7,3
|
|
83
|
+
6,17; -7,34
|
|
84
|
+
5,75; -7,38
|
|
85
|
+
5,34; -7,42
|
|
86
|
+
4,93; -7,48
|
|
87
|
+
4,52; -7,53
|
|
88
|
+
4,10; -7,61
|
|
89
|
+
3,82; -7,66
|
|
90
|
+
3,53; -7,72
|
|
91
|
+
3,08; -7,82
|
|
92
|
+
2,78; -7,9
|
|
93
|
+
2,48; -7,98
|
|
94
|
+
2,17; -8,06
|
|
95
|
+
1,69; -8,2
|
|
96
|
+
1,37; -8,29
|
|
97
|
+
1,05; -8,39
|
|
98
|
+
0,72; -8,49
|
|
99
|
+
0,23; -8,66
|
|
100
|
+
-0,11; -8,77
|
|
101
|
+
-0,62; -8,95
|
|
102
|
+
-1,13; -9,13
|
|
103
|
+
-1,65; -9,32
|
|
104
|
+
-2,17; -9,51
|
|
105
|
+
-2,70; -9,71
|
|
106
|
+
-3,41; -9,98
|
|
107
|
+
-4,31; -10,33
|
|
108
|
+
-5,03; -10,61
|
|
109
|
+
-6,12; -11,05
|
|
110
|
+
-7,39; -11,55
|
|
111
|
+
-8,66; -12,04
|
|
112
|
+
-10,45; -12,72
|
|
113
|
+
-12,37; -13,41
|
|
114
|
+
-14,70; -14,13
|
|
115
|
+
-17,14; -14,68
|
|
116
|
+
-19,38; -14,83
|
|
117
|
+
-21,17; -14,43
|
|
118
|
+
-22,27; -13,57
|
|
119
|
+
-22,99; -12,51
|
|
120
|
+
-23,55; -11,28
|
|
121
|
+
-23,97; -9,99
|
|
122
|
+
-24,29; -8,72
|
|
123
|
+
-24,55; -7,35
|
|
124
|
+
-24,73; -6,08
|
|
125
|
+
-24,86; -4,77
|
|
126
|
+
-24,95; -3,42
|
|
127
|
+
-24,99; -2,24
|
|
128
|
+
-25,00; -0,86
|
package/dist/frame.identify.js
CHANGED
|
@@ -5975,69 +5975,142 @@ function hc(e, t, n = "catmull") {
|
|
|
5975
5975
|
//#endregion
|
|
5976
5976
|
//#region src/ModalImageCropped.tsx
|
|
5977
5977
|
function gc(e) {
|
|
5978
|
-
let t = "ModalImageCropped", o = i(null), l = i(null), [u, d] = a([]), [f, p] = a([
|
|
5979
|
-
|
|
5978
|
+
let t = "ModalImageCropped", o = i(null), l = i(null), [u, d] = a([]), [f, p] = a([
|
|
5979
|
+
{
|
|
5980
|
+
x: 50,
|
|
5981
|
+
y: 100
|
|
5982
|
+
},
|
|
5983
|
+
{
|
|
5984
|
+
x: 50,
|
|
5985
|
+
y: 300
|
|
5986
|
+
},
|
|
5987
|
+
{
|
|
5988
|
+
x: 250,
|
|
5989
|
+
y: 100
|
|
5990
|
+
},
|
|
5991
|
+
{
|
|
5992
|
+
x: 250,
|
|
5993
|
+
y: 250
|
|
5994
|
+
},
|
|
5995
|
+
{
|
|
5996
|
+
x: 350,
|
|
5997
|
+
y: 200
|
|
5998
|
+
},
|
|
5999
|
+
{
|
|
6000
|
+
x: 400,
|
|
6001
|
+
y: 250
|
|
6002
|
+
}
|
|
6003
|
+
]), [m, v] = a(0), [b, x] = a(0), [S, C] = a(!1), [w, T] = a(0), [E, D] = a(0), O = e.actor.getSnapshot();
|
|
6004
|
+
function k(e, t, n = "blue") {
|
|
5980
6005
|
t.forEach((t) => {
|
|
5981
6006
|
e.fillStyle = n, e.beginPath(), e.arc(t.x, t.y, 5, 0, Math.PI * 2), e.fill();
|
|
5982
6007
|
});
|
|
5983
6008
|
}
|
|
5984
|
-
function
|
|
6009
|
+
function A(e, t, n = "magenta") {
|
|
5985
6010
|
if (t.length < 2) return;
|
|
5986
6011
|
e.strokeStyle = n;
|
|
5987
6012
|
let r = Math.min(...t.map((e) => e.x)), i = Math.max(...t.map((e) => e.x)), a = Math.min(...t.map((e) => e.y)), o = Math.max(...t.map((e) => e.y));
|
|
5988
6013
|
T(i - r), D(o - a), e.strokeRect(r, a, i - r, o - a);
|
|
5989
6014
|
}
|
|
5990
|
-
function
|
|
5991
|
-
let
|
|
5992
|
-
for (let
|
|
5993
|
-
let
|
|
5994
|
-
if (
|
|
5995
|
-
|
|
6015
|
+
function j(e, t = 2) {
|
|
6016
|
+
let n = "";
|
|
6017
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
6018
|
+
let i = e[r], a = Math.round(Math.hypot(i.x * t, i.y * t) * 100);
|
|
6019
|
+
if (a === 0) throw Error(`createRT1: radius is zero for point (${i.x}, ${i.y})`);
|
|
6020
|
+
n += a.toString().padStart(4, "0");
|
|
5996
6021
|
}
|
|
5997
|
-
return
|
|
6022
|
+
return n;
|
|
5998
6023
|
}
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6024
|
+
function M(e, t) {
|
|
6025
|
+
if (e.length === 0) return [];
|
|
6026
|
+
let n = Math.max(0, Math.min(t, e.length - 1));
|
|
6027
|
+
return e.slice(n + 1).concat(e.slice(0, n + 1));
|
|
6028
|
+
}
|
|
6029
|
+
function N(e) {
|
|
6030
|
+
let t = -Infinity, n = Infinity, r = -Infinity, i = Infinity;
|
|
6031
|
+
return e.map((e) => {
|
|
6032
|
+
e.x > t && (t = e.x), e.x < n && (n = e.x), e.y > r && (r = e.y), e.y < i && (i = e.y);
|
|
6033
|
+
}), {
|
|
6034
|
+
xMin: n,
|
|
6035
|
+
xMax: t,
|
|
6036
|
+
yMin: i,
|
|
6037
|
+
yMax: r
|
|
6038
|
+
};
|
|
6039
|
+
}
|
|
6040
|
+
let P = n((e) => {
|
|
6041
|
+
let { yMin: t, yMax: n } = N(e), r = n - t, i = 0, a = -1;
|
|
6042
|
+
for (let n = 0; n < e.length; n += 1) {
|
|
6043
|
+
let o = e[n].y - t - r / 2;
|
|
6044
|
+
if (n > 0 && o > 0 && i < 0) {
|
|
6045
|
+
console.log(`crossed from negative to positive at index ${n}`), a = n;
|
|
6046
|
+
break;
|
|
6047
|
+
}
|
|
6048
|
+
if (n > 0 && o < 0 && i > 0) {
|
|
6049
|
+
console.log(`crossed from positive to negative at index ${n}`), a = n;
|
|
6050
|
+
break;
|
|
6051
|
+
}
|
|
6052
|
+
i = o;
|
|
6053
|
+
}
|
|
6054
|
+
return console.log(`splitIndex: ${a}`), M(e, a - 1);
|
|
6055
|
+
}, []), F = n((e, t, n) => e.map((e) => ({
|
|
6056
|
+
x: e.x * t,
|
|
6057
|
+
y: e.y * (n ?? t)
|
|
6058
|
+
})), []), I = (e) => {
|
|
6059
|
+
let t = e[0], n = e[1], r = -Math.atan2(t.y, t.x), i = -Math.atan2(n.y, n.x);
|
|
6060
|
+
return console.log(`pt1: (${t.x}, ${t.y}), angle1: ${r}`), console.log(`pt2: (${n.x}, ${n.y}), angle2: ${i}`), r > i;
|
|
6061
|
+
}, L = n((e, t, n, r = !1) => {
|
|
6062
|
+
let i = pc(n, S ? "akima" : "catmull"), a = -Infinity, o = Infinity, s = -Infinity, c = Infinity, l = Array.from({ length: 128 }, (e, t) => {
|
|
6063
|
+
let n = i(t * 2 * Math.PI / 128);
|
|
6064
|
+
return n.x > a && (a = n.x), n.x < o && (o = n.x), n.y > s && (s = n.y), n.y < c && (c = n.y), n;
|
|
6003
6065
|
});
|
|
6004
|
-
if (
|
|
6005
|
-
let
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6066
|
+
if (r) {
|
|
6067
|
+
let n = a - o, r = s - c, i = e / n;
|
|
6068
|
+
t / r;
|
|
6069
|
+
let u = l.map((e) => ({
|
|
6070
|
+
x: e.x - o - n / 2,
|
|
6071
|
+
y: e.y - c - r / 2
|
|
6072
|
+
})).map((e) => ({
|
|
6073
|
+
x: e.x,
|
|
6074
|
+
y: -e.y
|
|
6075
|
+
})), d = F(u, i), f = I(d);
|
|
6076
|
+
return f || d.reverse(), f = I(d), console.log(`isCounterClockwise after reverse: ${f}`), P(d), d;
|
|
6013
6077
|
}
|
|
6014
|
-
return
|
|
6015
|
-
}, [
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6078
|
+
return l;
|
|
6079
|
+
}, [
|
|
6080
|
+
S,
|
|
6081
|
+
F,
|
|
6082
|
+
P
|
|
6083
|
+
]);
|
|
6084
|
+
function R(e, t, n = !1) {
|
|
6085
|
+
let r = L(e, t, f, n), i = j(r);
|
|
6086
|
+
return console.log(`rt1String: ${i}`), r;
|
|
6019
6087
|
}
|
|
6020
|
-
let
|
|
6088
|
+
let z = n((e) => {
|
|
6021
6089
|
if (f.length < 2) return;
|
|
6022
|
-
let t =
|
|
6090
|
+
let t = L(O.context.SL ?? 0, O.context.SH ?? 0, f);
|
|
6023
6091
|
e.beginPath(), e.fillStyle = "rgba(34, 197, 94, 0.3)", e.moveTo(t[0].x, t[0].y);
|
|
6024
6092
|
for (let n of t) e.lineTo(n.x, n.y);
|
|
6025
6093
|
e.closePath(), e.fill();
|
|
6026
|
-
}, [
|
|
6027
|
-
|
|
6094
|
+
}, [
|
|
6095
|
+
f,
|
|
6096
|
+
L,
|
|
6097
|
+
O.context.SH,
|
|
6098
|
+
O.context.SL
|
|
6099
|
+
]);
|
|
6100
|
+
function ee(e, t, n) {
|
|
6028
6101
|
e.strokeStyle = "blue", e.lineWidth = 2, n ? e.setLineDash([4, 3]) : e.setLineDash([]), e.beginPath(), e.moveTo(t[0].x, t[0].y), e.lineTo(n?.x ?? t[1].x, n?.y ?? t[1].y), e.stroke(), n && e.setLineDash([]);
|
|
6029
6102
|
}
|
|
6030
|
-
let
|
|
6103
|
+
let te = n((e, t) => {
|
|
6031
6104
|
let n = o.current, r = l.current;
|
|
6032
6105
|
if (!n || !r) return;
|
|
6033
6106
|
let i = n.getContext("2d");
|
|
6034
|
-
b === 0 ? i.drawImage(r, 0, 0) : (i.clearRect(0, 0, n.width, n.height), i.save(), i.translate(n.width / 2, n.height / 2), i.rotate(b), i.drawImage(r, -r.naturalWidth / 2, -r.naturalHeight / 2), i.restore()), i.setLineDash([]), b === 0 &&
|
|
6107
|
+
b === 0 ? i.drawImage(r, 0, 0) : (i.clearRect(0, 0, n.width, n.height), i.save(), i.translate(n.width / 2, n.height / 2), i.rotate(b), i.drawImage(r, -r.naturalWidth / 2, -r.naturalHeight / 2), i.restore()), i.setLineDash([]), b === 0 && k(i, e), k(i, f, "orange"), A(i, f, "magenta"), z(i), e.length === 2 && b === 0 && ee(i, e), e.length === 1 && t && ee(i, e, t);
|
|
6035
6108
|
}, [
|
|
6036
6109
|
f,
|
|
6037
|
-
|
|
6110
|
+
z,
|
|
6038
6111
|
b
|
|
6039
6112
|
]);
|
|
6040
|
-
function
|
|
6113
|
+
function ne(e) {
|
|
6041
6114
|
let t = o.current, n = l.current;
|
|
6042
6115
|
if (!t || !n) return;
|
|
6043
6116
|
let r = t.getContext("2d");
|
|
@@ -6050,37 +6123,40 @@ function gc(e) {
|
|
|
6050
6123
|
e && (e.width = t.naturalWidth, e.height = t.naturalHeight, e.getContext("2d")?.drawImage(t, 0, 0), l.current = t);
|
|
6051
6124
|
}, t.src = e.dataUrl;
|
|
6052
6125
|
}, [e.dataUrl]), r(() => {
|
|
6053
|
-
|
|
6054
|
-
}, [u,
|
|
6055
|
-
|
|
6126
|
+
te(u);
|
|
6127
|
+
}, [u, te]), r(() => {
|
|
6128
|
+
ne(b);
|
|
6056
6129
|
}, [b]);
|
|
6057
|
-
function
|
|
6058
|
-
e.actor.send({ type: t }),
|
|
6130
|
+
function re(t) {
|
|
6131
|
+
e.actor.send({ type: t }), v((e) => e + 1);
|
|
6059
6132
|
}
|
|
6060
|
-
function
|
|
6133
|
+
function ie(t, n) {
|
|
6061
6134
|
let r = n.x - t.x, i = n.y - t.y, a = -Math.atan2(i, r);
|
|
6062
6135
|
a > Math.PI / 2 && (a -= Math.PI), a < -Math.PI / 2 && (a += Math.PI), x(a), e.actor.send({
|
|
6063
6136
|
type: Js,
|
|
6064
6137
|
rotationAngle: a
|
|
6065
|
-
}),
|
|
6138
|
+
}), v((e) => e + 1);
|
|
6066
6139
|
}
|
|
6067
|
-
function
|
|
6140
|
+
function B(e, t) {
|
|
6068
6141
|
let n = e.getBoundingClientRect();
|
|
6069
6142
|
return {
|
|
6070
6143
|
x: (t.clientX - n.left) * (e.width / n.width),
|
|
6071
6144
|
y: (t.clientY - n.top) * (e.height / n.height)
|
|
6072
6145
|
};
|
|
6073
6146
|
}
|
|
6074
|
-
function
|
|
6147
|
+
function ae() {
|
|
6075
6148
|
e.actor.send({ type: zs }), e.closeModal([], !0)();
|
|
6076
6149
|
}
|
|
6077
|
-
function
|
|
6150
|
+
function oe() {
|
|
6078
6151
|
e.actor.send({ type: Ws }), e.closeModal([], !1)();
|
|
6079
6152
|
}
|
|
6080
|
-
function
|
|
6081
|
-
e.actor.send({ type: Zs }),
|
|
6153
|
+
function se() {
|
|
6154
|
+
if (e.actor.send({ type: Zs }), !me) throw Error("SL is undefined");
|
|
6155
|
+
if (!he) throw Error("SH is undefined");
|
|
6156
|
+
let t = R(me, he, !0);
|
|
6157
|
+
e.closeModal(t, !1)();
|
|
6082
6158
|
}
|
|
6083
|
-
function
|
|
6159
|
+
function ce(e, t) {
|
|
6084
6160
|
if (e.length === 0) return -1;
|
|
6085
6161
|
let n = 0, r = Infinity;
|
|
6086
6162
|
return e.forEach((e, i) => {
|
|
@@ -6088,49 +6164,49 @@ function gc(e) {
|
|
|
6088
6164
|
s < r && (r = s, n = i);
|
|
6089
6165
|
}), n;
|
|
6090
6166
|
}
|
|
6091
|
-
function
|
|
6167
|
+
function le(t) {
|
|
6092
6168
|
let n = e.actor.getSnapshot(), r = o.current;
|
|
6093
6169
|
if (!r || !l.current) return;
|
|
6094
6170
|
let i = t.button === 2;
|
|
6095
6171
|
if (n.value === "Image cropped" || n.value === "X-axis started") {
|
|
6096
6172
|
if (i) {
|
|
6097
|
-
console.log("right mouse button clicked"), d((e) => e.slice(0, -1)), x(0),
|
|
6173
|
+
console.log("right mouse button clicked"), d((e) => e.slice(0, -1)), x(0), re(Ys);
|
|
6098
6174
|
return;
|
|
6099
6175
|
}
|
|
6100
6176
|
{
|
|
6101
|
-
let e =
|
|
6102
|
-
d((t) => (t.length % 2 == 0 ?
|
|
6177
|
+
let e = B(r, t);
|
|
6178
|
+
d((t) => (t.length % 2 == 0 ? re(qs) : t.length % 2 == 1 && ie(t[0], e), t.length < 2 ? [...t, e] : [e]));
|
|
6103
6179
|
}
|
|
6104
6180
|
return;
|
|
6105
6181
|
}
|
|
6106
6182
|
if (n.value === "X-axis finished" || n.value === "Points defined") {
|
|
6107
|
-
let e =
|
|
6183
|
+
let e = B(r, t);
|
|
6108
6184
|
i ? p((t) => {
|
|
6109
|
-
let n =
|
|
6185
|
+
let n = ce(t, e);
|
|
6110
6186
|
if (n !== -1) {
|
|
6111
6187
|
let e = [...t];
|
|
6112
6188
|
return e.splice(n, 1), e;
|
|
6113
6189
|
}
|
|
6114
6190
|
return t;
|
|
6115
|
-
}) : (console.log(` adding point at (${e.x}, ${e.y})`), p((t) => [...t, e]),
|
|
6191
|
+
}) : (console.log(` adding point at (${e.x}, ${e.y})`), p((t) => [...t, e]), re(Xs));
|
|
6116
6192
|
}
|
|
6117
6193
|
}
|
|
6118
|
-
function
|
|
6194
|
+
function ue(e) {
|
|
6119
6195
|
let t = o.current;
|
|
6120
6196
|
if (!t || !l.current) return;
|
|
6121
|
-
let n =
|
|
6122
|
-
|
|
6197
|
+
let n = B(t, e);
|
|
6198
|
+
te(u, n);
|
|
6123
6199
|
}
|
|
6124
|
-
function
|
|
6125
|
-
|
|
6200
|
+
function de() {
|
|
6201
|
+
te(u);
|
|
6126
6202
|
}
|
|
6127
|
-
function
|
|
6128
|
-
function
|
|
6203
|
+
function fe(e) {}
|
|
6204
|
+
function pe(e) {
|
|
6129
6205
|
e.preventDefault();
|
|
6130
6206
|
}
|
|
6131
|
-
let
|
|
6207
|
+
let V = (e) => {
|
|
6132
6208
|
C(e.target.checked);
|
|
6133
|
-
},
|
|
6209
|
+
}, me = e.actor.getSnapshot().context.SL, he = e.actor.getSnapshot().context.SH, H = e.actor.getSnapshot().context.AZG;
|
|
6134
6210
|
return /* @__PURE__ */ s(vo, {
|
|
6135
6211
|
"data-testid": `${t}.Modal`,
|
|
6136
6212
|
sx: {
|
|
@@ -6160,11 +6236,11 @@ function gc(e) {
|
|
|
6160
6236
|
maxHeight: "70vh",
|
|
6161
6237
|
cursor: "crosshair"
|
|
6162
6238
|
},
|
|
6163
|
-
onMouseDown:
|
|
6164
|
-
onMouseMove:
|
|
6165
|
-
onMouseUp:
|
|
6166
|
-
onMouseLeave:
|
|
6167
|
-
onContextMenu:
|
|
6239
|
+
onMouseDown: le,
|
|
6240
|
+
onMouseMove: ue,
|
|
6241
|
+
onMouseUp: fe,
|
|
6242
|
+
onMouseLeave: de,
|
|
6243
|
+
onContextMenu: pe
|
|
6168
6244
|
}),
|
|
6169
6245
|
/* @__PURE__ */ c("div", {
|
|
6170
6246
|
className: "modal-content",
|
|
@@ -6176,13 +6252,13 @@ function gc(e) {
|
|
|
6176
6252
|
},
|
|
6177
6253
|
children: [
|
|
6178
6254
|
"SL: ",
|
|
6179
|
-
|
|
6255
|
+
me,
|
|
6180
6256
|
", SH: ",
|
|
6181
|
-
|
|
6257
|
+
he,
|
|
6182
6258
|
" -> [",
|
|
6183
|
-
|
|
6259
|
+
me && he && he !== 0 ? (me / he).toFixed(3) : 0,
|
|
6184
6260
|
"], AZG: ",
|
|
6185
|
-
|
|
6261
|
+
H
|
|
6186
6262
|
]
|
|
6187
6263
|
}),
|
|
6188
6264
|
/* @__PURE__ */ c(y, {
|
|
@@ -6207,7 +6283,7 @@ function gc(e) {
|
|
|
6207
6283
|
control: /* @__PURE__ */ s(_, {
|
|
6208
6284
|
"data-testid": `${t}.Switch`,
|
|
6209
6285
|
checked: S,
|
|
6210
|
-
onChange:
|
|
6286
|
+
onChange: V
|
|
6211
6287
|
}),
|
|
6212
6288
|
label: /* @__PURE__ */ s(y, {
|
|
6213
6289
|
sx: {
|
|
@@ -6220,19 +6296,20 @@ function gc(e) {
|
|
|
6220
6296
|
/* @__PURE__ */ s(js, {
|
|
6221
6297
|
color: "secondary",
|
|
6222
6298
|
variant: "outlined",
|
|
6223
|
-
onClick:
|
|
6299
|
+
onClick: ae,
|
|
6224
6300
|
children: "close"
|
|
6225
6301
|
}),
|
|
6226
6302
|
/* @__PURE__ */ s(js, {
|
|
6227
6303
|
color: "secondary",
|
|
6228
6304
|
variant: "outlined",
|
|
6229
|
-
onClick:
|
|
6305
|
+
onClick: oe,
|
|
6230
6306
|
children: "Undo crop"
|
|
6231
6307
|
}),
|
|
6232
6308
|
/* @__PURE__ */ s(js, {
|
|
6233
6309
|
color: "secondary",
|
|
6234
|
-
variant: "
|
|
6235
|
-
|
|
6310
|
+
variant: "contained",
|
|
6311
|
+
size: "small",
|
|
6312
|
+
onClick: se,
|
|
6236
6313
|
children: "Finish"
|
|
6237
6314
|
})
|
|
6238
6315
|
]
|
|
@@ -6265,7 +6342,7 @@ function _c(e) {
|
|
|
6265
6342
|
e.errorMessage,
|
|
6266
6343
|
e.sh,
|
|
6267
6344
|
e
|
|
6268
|
-
]),
|
|
6345
|
+
]), /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(v, {
|
|
6269
6346
|
"data-testid": `NumberInput.Textfield.${e.dataTestid}`,
|
|
6270
6347
|
focused: !0,
|
|
6271
6348
|
color: "secondary",
|
|
@@ -6295,7 +6372,7 @@ function _c(e) {
|
|
|
6295
6372
|
//#endregion
|
|
6296
6373
|
//#region src/EnterValues.tsx
|
|
6297
6374
|
function vc(e) {
|
|
6298
|
-
let [t, n] = a(""), [i, l] = a(""), [u, d] = a("");
|
|
6375
|
+
let [t, n] = a("50"), [i, l] = a("44"), [u, d] = a("15");
|
|
6299
6376
|
r(() => {}, [e.actor]);
|
|
6300
6377
|
let f = C(e.actor, (e) => e), p = (e, t) => {
|
|
6301
6378
|
let n = parseFloat(e);
|
|
@@ -6475,7 +6552,9 @@ function yc(e) {
|
|
|
6475
6552
|
style: { display: "none" },
|
|
6476
6553
|
onChange: w
|
|
6477
6554
|
}), /* @__PURE__ */ s(m, {
|
|
6478
|
-
|
|
6555
|
+
color: "secondary",
|
|
6556
|
+
variant: "contained",
|
|
6557
|
+
size: "small",
|
|
6479
6558
|
onClick: () => o.current?.click(),
|
|
6480
6559
|
children: "load image"
|
|
6481
6560
|
})] }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frame.identify",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Typescript React package to handle frame detection",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/frame.identify.js",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"@emotion/styled": "^11.14.1",
|
|
38
38
|
"@eslint/js": "^10.0.1",
|
|
39
39
|
"@mui/material": "^9.3.1",
|
|
40
|
-
"@types/node": "^26.
|
|
40
|
+
"@types/node": "^26.4.0",
|
|
41
41
|
"@types/react": "^19.2.17",
|
|
42
42
|
"@types/react-dom": "^19.2.5",
|
|
43
43
|
"@vitejs/plugin-react": "^6.0.4",
|
|
44
44
|
"@xstate/react": "^6.1.0",
|
|
45
45
|
"eslint": "^10.9.1",
|
|
46
46
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
47
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
47
|
+
"eslint-plugin-react-refresh": "^0.5.5",
|
|
48
48
|
"globals": "^17.7.0",
|
|
49
49
|
"react": "^19.2.8",
|
|
50
50
|
"react-dom": "^19.2.8",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"typescript-eslint": "^8.68.0",
|
|
53
53
|
"vite": "^8.2.2",
|
|
54
54
|
"vite-plugin-dts": "^5.0.3",
|
|
55
|
-
"xstate": "^5.32.
|
|
55
|
+
"xstate": "^5.32.6"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"ai.akima": "^1.0.2"
|