frame.image 1.6.6 → 1.6.7
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/App.d.ts.map +1 -1
- package/dist/App.js +8 -1
- package/dist/Designer.d.ts +5 -0
- package/dist/Designer.d.ts.map +1 -1
- package/dist/Designer.js +12 -6
- package/dist/DrawCanvas.d.ts +1 -2
- package/dist/DrawCanvas.d.ts.map +1 -1
- package/dist/DrawCanvas.js +1 -17
- package/dist/Finish.d.ts +1 -1
- package/dist/Finish.d.ts.map +1 -1
- package/dist/Finish.js +2 -21
- package/dist/ModalDesigner.d.ts.map +1 -1
- package/dist/ModalDesigner.js +10 -1
- package/dist/Polygon.d.ts +1 -1
- package/dist/Polygon.d.ts.map +1 -1
- package/dist/Polygon.js +1 -1
- package/dist/ScaleForm.d.ts.map +1 -1
- package/dist/ScaleForm.js +2 -3
- package/dist/Scaling.d.ts.map +1 -1
- package/dist/ShowOptions.d.ts.map +1 -1
- package/dist/ShowOptions.js +2 -13
- package/dist/Start.d.ts.map +1 -1
- package/dist/Start.js +0 -9
- package/dist/Workflow.d.ts.map +1 -1
- package/dist/Workflow.js +0 -3
- package/dist/types.d.ts +0 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +22 -17
package/dist/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,CAAC;AAUnB,iBAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,CAAC;AAUnB,iBAAS,GAAG,4CAwIX;AAED,eAAe,GAAG,CAAC"}
|
package/dist/App.js
CHANGED
|
@@ -14,6 +14,7 @@ function App() {
|
|
|
14
14
|
const universeCenter = new Point(width / 2, height / 2);
|
|
15
15
|
const offset = 0;
|
|
16
16
|
const [modalDesigner, setModalDesigner] = useState(false);
|
|
17
|
+
const [rt1, setRt1] = useState('');
|
|
17
18
|
const [imageCoords, setImageCoords] = useState({
|
|
18
19
|
horizontal: 0,
|
|
19
20
|
vertical: 0,
|
|
@@ -85,7 +86,13 @@ function App() {
|
|
|
85
86
|
function onClose(rt1) {
|
|
86
87
|
console.log(`RT1 from App: ${rt1}`);
|
|
87
88
|
setModalDesigner(false);
|
|
89
|
+
setRt1(rt1);
|
|
88
90
|
}
|
|
89
|
-
return (_jsxs(_Fragment, { children: [_jsx("h3", { children: "frame.image" }), _jsx(Scaling, { SL: scaledSL, setSL: setScaledSL, SH: scaledSH, setSH: setScaledSH, onScale: onScale }), _jsx(ImageHandler, { imageCoords: { imageCoords, setImageCoords } }), _jsx(Center, { coords: coords }), _jsx("button", { onClick: onOpenModalDesigner, children: "Designer" }), _jsx(ModalDesigner, { isOpen: modalDesigner, onClose: onClose })
|
|
91
|
+
return (_jsxs(_Fragment, { children: [_jsx("h3", { children: "frame.image" }), _jsx(Scaling, { SL: scaledSL, setSL: setScaledSL, SH: scaledSH, setSH: setScaledSH, onScale: onScale }), _jsx(ImageHandler, { imageCoords: { imageCoords, setImageCoords } }), _jsx(Center, { coords: coords }), _jsx("button", { "data-testid": "button.designer", onClick: onOpenModalDesigner, children: "Designer" }), _jsx(ModalDesigner, { isOpen: modalDesigner, onClose: onClose }), _jsx("div", { style: { maxWidth: '400px', marginTop: '10px' }, children: _jsx("input", { "data-testid": "input.rt1-output", type: "text", style: {
|
|
92
|
+
width: '100%',
|
|
93
|
+
padding: '8px',
|
|
94
|
+
border: '1px solid #ccc',
|
|
95
|
+
borderRadius: '4px',
|
|
96
|
+
}, placeholder: "RT1 Output", value: rt1, readOnly: true }) })] }));
|
|
90
97
|
}
|
|
91
98
|
export default App;
|
package/dist/Designer.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { Polygon } from './Polygon';
|
|
2
|
+
import { Point } from './Point';
|
|
1
3
|
export declare function Designer(props: {
|
|
2
4
|
onClose: (rt1: string) => void;
|
|
3
5
|
nrPoints?: number;
|
|
4
6
|
trademarkImageUrl?: string;
|
|
7
|
+
callBackAfterTransform?: (coordinates: Polygon) => void;
|
|
8
|
+
callbackAfterScale?: (length: number, height: number) => void;
|
|
9
|
+
callbackAfterTrademark?: (tradeMark: Point) => void;
|
|
5
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
11
|
//# sourceMappingURL=Designer.d.ts.map
|
package/dist/Designer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Designer.d.ts","sourceRoot":"","sources":["../src/Designer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Designer.d.ts","sourceRoot":"","sources":["../src/Designer.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAMhC,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9D,sBAAsB,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,KAAK,IAAI,CAAC;CACrD,2CAmRA"}
|
package/dist/Designer.js
CHANGED
|
@@ -27,9 +27,7 @@ export function Designer(props) {
|
|
|
27
27
|
const [scaledSH, setScaledSH] = useState(undefined);
|
|
28
28
|
const [trademarkCenter, setTrademarkCenter] = useState(undefined);
|
|
29
29
|
const [show, setShow] = useState({
|
|
30
|
-
catmullRomPoints: true,
|
|
31
30
|
catmullRom: true,
|
|
32
|
-
catmullRomCenter: true,
|
|
33
31
|
points: true,
|
|
34
32
|
polygon: false,
|
|
35
33
|
center: false,
|
|
@@ -42,7 +40,6 @@ export function Designer(props) {
|
|
|
42
40
|
horizontal: 0,
|
|
43
41
|
vertical: 0,
|
|
44
42
|
});
|
|
45
|
-
const [catmullRomPoints, setCatmullRomPoints] = useState(undefined);
|
|
46
43
|
const onClickReset = () => {
|
|
47
44
|
setCoords(new Polygon([], universeCenter));
|
|
48
45
|
// setCatmullRomPoints(undefined);
|
|
@@ -74,6 +71,9 @@ export function Designer(props) {
|
|
|
74
71
|
function handleCloseScaleFormContinue(length, height) {
|
|
75
72
|
currentMachine.context.length = length;
|
|
76
73
|
currentMachine.context.height = height;
|
|
74
|
+
if (props.callbackAfterScale) {
|
|
75
|
+
props.callbackAfterScale(length, height);
|
|
76
|
+
}
|
|
77
77
|
onCloseScaleForm();
|
|
78
78
|
}
|
|
79
79
|
const onLoad = (nrPts) => {
|
|
@@ -82,9 +82,12 @@ export function Designer(props) {
|
|
|
82
82
|
sendCommand(ACTION.DEFINE_POINTS);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
const
|
|
85
|
+
const onAfterTransform = (coordinates) => {
|
|
86
86
|
setScalingEnabled(true);
|
|
87
87
|
sendCommand(ACTION.TRANSFORM);
|
|
88
|
+
if (props.callBackAfterTransform) {
|
|
89
|
+
props.callBackAfterTransform(coordinates);
|
|
90
|
+
}
|
|
88
91
|
};
|
|
89
92
|
const onReset = () => {
|
|
90
93
|
setScalingEnabled(false);
|
|
@@ -96,6 +99,9 @@ export function Designer(props) {
|
|
|
96
99
|
const rt1 = createRT1(points);
|
|
97
100
|
if (trademark) {
|
|
98
101
|
console.log(`trademark is now defined at [${trademark.X}, ${trademark.Y}]`);
|
|
102
|
+
if (props.callbackAfterTrademark) {
|
|
103
|
+
props.callbackAfterTrademark(trademark);
|
|
104
|
+
}
|
|
99
105
|
}
|
|
100
106
|
props.onClose(rt1);
|
|
101
107
|
};
|
|
@@ -146,7 +152,7 @@ export function Designer(props) {
|
|
|
146
152
|
height: '100%',
|
|
147
153
|
boxSizing: 'border-box',
|
|
148
154
|
backgroundColor: 'rgb(173, 216, 230)', // lightblue in rgb
|
|
149
|
-
}, children: _jsx(DrawCanvas, { machine: currentMachine, command: sendCommand, width: width, height: height, status: { status, setStatus }, show: show, axis: { axis, setAxis }, imageUrl: imageUrl, coords: { coords, setCoords }, trademarkCenter: { trademarkCenter, setTrademarkCenter }, imageCoords: { imageCoords, setImageCoords }, rotation: { rotationAngle, setRotationAngle }, scaledSL: scaledSL, scaledSH: scaledSH,
|
|
155
|
+
}, children: _jsx(DrawCanvas, { machine: currentMachine, command: sendCommand, width: width, height: height, status: { status, setStatus }, show: show, axis: { axis, setAxis }, imageUrl: imageUrl, coords: { coords, setCoords }, trademarkCenter: { trademarkCenter, setTrademarkCenter }, imageCoords: { imageCoords, setImageCoords }, rotation: { rotationAngle, setRotationAngle }, scaledSL: scaledSL, scaledSH: scaledSH, trademarkImageUrl: props.trademarkImageUrl }) }), _jsx(Box, { id: "id.box.ScaleForm", sx: {
|
|
150
156
|
display: 'flex',
|
|
151
157
|
flexDirection: 'column',
|
|
152
158
|
flex: wCol3,
|
|
@@ -160,5 +166,5 @@ export function Designer(props) {
|
|
|
160
166
|
height: '20%',
|
|
161
167
|
width: '100%',
|
|
162
168
|
overflow: 'auto',
|
|
163
|
-
}, children: _jsx(Finish, { universeCenter: universeCenter, nrPoints: nrPoints, coords: { coords, setCoords }, trademarkCenter: { trademarkCenter, setTrademarkCenter }, onLoad: onLoad, onAfterTransform:
|
|
169
|
+
}, children: _jsx(Finish, { universeCenter: universeCenter, nrPoints: nrPoints, coords: { coords, setCoords }, trademarkCenter: { trademarkCenter, setTrademarkCenter }, onLoad: onLoad, onAfterTransform: onAfterTransform, onAfterReset: onReset, onClose: onClose }) })] })] }));
|
|
164
170
|
}
|
package/dist/DrawCanvas.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { TAxisHook,
|
|
2
|
+
import { TAxisHook, TCoordsHook, TImageHook, TRotationHook, TShow, TStatusHook, TTrademarkHook } from './types';
|
|
3
3
|
export declare function DrawCanvas(props: {
|
|
4
4
|
machine: any;
|
|
5
5
|
command: any;
|
|
@@ -11,7 +11,6 @@ export declare function DrawCanvas(props: {
|
|
|
11
11
|
imageUrl?: string;
|
|
12
12
|
coords: TCoordsHook;
|
|
13
13
|
trademarkCenter: TTrademarkHook;
|
|
14
|
-
catmullRomPoints: TCatmullRomPointsHook;
|
|
15
14
|
imageCoords: TImageHook;
|
|
16
15
|
rotation: TRotationHook;
|
|
17
16
|
scaledSL?: number;
|
package/dist/DrawCanvas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawCanvas.d.ts","sourceRoot":"","sources":["../src/DrawCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqD,MAAM,OAAO,CAAC;AAG/E,OAAO,EACL,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"DrawCanvas.d.ts","sourceRoot":"","sources":["../src/DrawCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqD,MAAM,OAAO,CAAC;AAG/E,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,aAAa,EACb,KAAK,EACL,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAC;AAKjB,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,cAAc,CAAC;IAChC,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,GAAG,CAAC,OAAO,CAsrBd"}
|
package/dist/DrawCanvas.js
CHANGED
|
@@ -76,18 +76,6 @@ export function DrawCanvas(props) {
|
|
|
76
76
|
const polygon = new Polygon(props.coords.coords.Points, universeCenter);
|
|
77
77
|
polygon.drawPolygon(context, 'black', 0.2);
|
|
78
78
|
}
|
|
79
|
-
if (props.show.catmullRomCenter) {
|
|
80
|
-
if (props.catmullRomPoints.catmullRomPoints) {
|
|
81
|
-
new Point(0, 0, universeCenter).drawCross(context, 'blue', 100, 15);
|
|
82
|
-
// props.catmullRomPoints.catmullRomPoints.drawCenter(context, 'blue');
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (props.show.catmullRomPoints) {
|
|
86
|
-
if (props.catmullRomPoints.catmullRomPoints &&
|
|
87
|
-
props.catmullRomPoints.catmullRomPoints.Length > 0) {
|
|
88
|
-
props.catmullRomPoints.catmullRomPoints.drawPoints(context, true, 'blue');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
79
|
if (props.show.points) {
|
|
92
80
|
sortedPoints.drawPoints(context, 'green');
|
|
93
81
|
if (props.machine.name === STATUS.X_AXIS_STARTED) {
|
|
@@ -113,7 +101,6 @@ export function DrawCanvas(props) {
|
|
|
113
101
|
sortedPoints.drawCatmullRom(context);
|
|
114
102
|
}
|
|
115
103
|
if (props.machine.name === STATUS.FORM_SCALED) {
|
|
116
|
-
const origin = props.coords.coords.UniverseCenter;
|
|
117
104
|
// const trademarkPolygon = props.coords.coords.scale(0.9, 0.9);
|
|
118
105
|
// const trademarkPolygon = props.coords.coords.scaleByRadius(0.9);
|
|
119
106
|
// setTradeMarkLine(trademarkPolygon);
|
|
@@ -176,14 +163,11 @@ export function DrawCanvas(props) {
|
|
|
176
163
|
props.show.box,
|
|
177
164
|
props.show.scaledBox,
|
|
178
165
|
props.show.polygon,
|
|
179
|
-
props.show.catmullRomCenter,
|
|
180
|
-
props.show.catmullRomPoints,
|
|
181
166
|
props.show.points,
|
|
182
167
|
props.show.catmullRom,
|
|
183
168
|
props.machine.name,
|
|
184
169
|
props.scaledSL,
|
|
185
170
|
props.scaledSH,
|
|
186
|
-
props.catmullRomPoints.catmullRomPoints,
|
|
187
171
|
props.axis.axis.x1,
|
|
188
172
|
props.axis.axis.x2,
|
|
189
173
|
universeCenter,
|
|
@@ -572,5 +556,5 @@ export function DrawCanvas(props) {
|
|
|
572
556
|
useEffect(() => {
|
|
573
557
|
loadTrademarkImage(setTrademarkImage);
|
|
574
558
|
}, [loadTrademarkImage]);
|
|
575
|
-
return (_jsx("canvas", { ref: canvasRef, width: props.width, height: props.height, id: "idCanvas", style: { backgroundColor: 'lightgrey' }, children: "Your browser does not support the HTML canvas tag." }));
|
|
559
|
+
return (_jsx("canvas", { "data-testid": "canvas.draw", ref: canvasRef, width: props.width, height: props.height, id: "idCanvas", style: { backgroundColor: 'lightgrey' }, children: "Your browser does not support the HTML canvas tag." }));
|
|
576
560
|
}
|
package/dist/Finish.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare function Finish(props: {
|
|
|
7
7
|
coords: TCoordsHook;
|
|
8
8
|
trademarkCenter: TTrademarkHook;
|
|
9
9
|
onLoad: (nrPoints: number) => void;
|
|
10
|
-
onAfterTransform: () => void;
|
|
10
|
+
onAfterTransform: (coordinates: Polygon) => void;
|
|
11
11
|
onAfterReset: () => void;
|
|
12
12
|
onClose: (pol: Polygon, trademark?: Point) => () => void;
|
|
13
13
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/Finish.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Finish.d.ts","sourceRoot":"","sources":["../src/Finish.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGtD,wBAAgB,MAAM,CAAC,KAAK,EAAE;IAC5B,cAAc,EAAE,KAAK,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,cAAc,CAAC;IAChC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"Finish.d.ts","sourceRoot":"","sources":["../src/Finish.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGtD,wBAAgB,MAAM,CAAC,KAAK,EAAE;IAC5B,cAAc,EAAE,KAAK,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,cAAc,CAAC;IAChC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gBAAgB,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,KAAK,KAAK,MAAM,IAAI,CAAC;CAC1D,2CAoGA"}
|
package/dist/Finish.js
CHANGED
|
@@ -15,25 +15,6 @@ export function Finish(props) {
|
|
|
15
15
|
left: '50%',
|
|
16
16
|
transform: 'translate(-50%, -50%)',
|
|
17
17
|
};
|
|
18
|
-
const refine = (coordinates) => {
|
|
19
|
-
// 1) Transform to Center
|
|
20
|
-
const prevCenter = coordinates.Center;
|
|
21
|
-
let transformed = coordinates.transform(prevCenter.x, prevCenter.y, props.universeCenter);
|
|
22
|
-
// 2) Convert to Spline
|
|
23
|
-
const xCenter = (coordinates.XMax + coordinates.XMin) / 2;
|
|
24
|
-
const yCenter = (coordinates.YMax + coordinates.YMin) / 2;
|
|
25
|
-
const catmullRomPolygon = transformed.createCatmullRomPoints(props.nrPoints, new Point(xCenter, yCenter));
|
|
26
|
-
// setCatmullRomPoints(catmullRomPolygon);
|
|
27
|
-
// 3) Reset Spline and adjust Points to new origin
|
|
28
|
-
// if (catmullRomPolygon) {
|
|
29
|
-
// setCoords(catmullRomPolygon);
|
|
30
|
-
// }
|
|
31
|
-
// setCatmullRomPoints(undefined);
|
|
32
|
-
const dist = Math.hypot(catmullRomPolygon.Center.X, catmullRomPolygon.Center.Y);
|
|
33
|
-
// 4) Retransform back to Center
|
|
34
|
-
transformed = catmullRomPolygon.transform(-prevCenter.X, -prevCenter.Y, props.universeCenter);
|
|
35
|
-
return { coords: transformed, dist };
|
|
36
|
-
};
|
|
37
18
|
const onTransform = () => {
|
|
38
19
|
const coordinates = props.coords.coords.clone();
|
|
39
20
|
setOriginalCoords(props.coords.coords);
|
|
@@ -49,7 +30,7 @@ export function Finish(props) {
|
|
|
49
30
|
return new Point(p.X + center.X, p.Y + center.Y, props.universeCenter);
|
|
50
31
|
}), props.universeCenter);
|
|
51
32
|
props.coords.setCoords(newCoordinates);
|
|
52
|
-
props.onAfterTransform();
|
|
33
|
+
props.onAfterTransform(coordinates);
|
|
53
34
|
};
|
|
54
35
|
const onReset = () => {
|
|
55
36
|
if (originalCoords) {
|
|
@@ -58,7 +39,7 @@ export function Finish(props) {
|
|
|
58
39
|
props.onAfterReset();
|
|
59
40
|
}
|
|
60
41
|
};
|
|
61
|
-
return (_jsxs(Box, { id: "id.Finish", sx: styleButton, children: [_jsx(Button, { variant: "contained", disabled: props.coords.coords.Length < 3, onClick: originalCoords === undefined ? onTransform : onReset, sx: { width: '200px' }, children: originalCoords === undefined ? 'Start Transformation' : 'Undo' }), _jsx(Button, { "data-testid": "
|
|
42
|
+
return (_jsxs(Box, { id: "id.Finish", sx: styleButton, children: [_jsx(Button, { "data-testid": "button.start-transformation", variant: "contained", disabled: props.coords.coords.Length < 3, onClick: originalCoords === undefined ? onTransform : onReset, sx: { width: '200px' }, children: originalCoords === undefined ? 'Start Transformation' : 'Undo' }), _jsx(Button, { "data-testid": "button.create-rt1", variant: "contained", disabled: originalCoords === undefined, onClick: props.onClose(props.coords.coords, props.trademarkCenter.trademarkCenter), children: "Create RT1" }), _jsx(Button, { variant: "contained", onClick: () => {
|
|
62
43
|
props.coords.coords.save('frame.image.json');
|
|
63
44
|
}, children: "Save Points" }), _jsxs(Button, { variant: "contained", component: "label", children: ["Load Points", _jsx("input", { type: "file", accept: "application/json", hidden: true, onChange: async (e) => {
|
|
64
45
|
const file = e.target.files?.[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalDesigner.d.ts","sourceRoot":"","sources":["../src/ModalDesigner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModalDesigner.d.ts","sourceRoot":"","sources":["../src/ModalDesigner.tsx"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,2CAoDA"}
|
package/dist/ModalDesigner.js
CHANGED
|
@@ -2,6 +2,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Modal } from '@mui/material';
|
|
3
3
|
import { Designer } from './Designer';
|
|
4
4
|
export function ModalDesigner(props) {
|
|
5
|
+
function logPolygon(coordinates) {
|
|
6
|
+
console.log('Transformed Polygon:', JSON.stringify(coordinates.toJSON(), null));
|
|
7
|
+
}
|
|
8
|
+
function logScaling(length, height) {
|
|
9
|
+
console.log('Scaled Dimensions:', length, height);
|
|
10
|
+
}
|
|
11
|
+
function logTrademark(tradeMark) {
|
|
12
|
+
console.log('Trademark Position:', tradeMark.X, tradeMark.Y);
|
|
13
|
+
}
|
|
5
14
|
return (_jsx(Modal, { open: props.isOpen, onClose: props.onClose, "aria-labelledby": "modal-title", "aria-describedby": "modal-description", children: _jsx(Box, { id: "id.box.ModalDesigner", sx: {
|
|
6
15
|
width: 1400,
|
|
7
16
|
height: 900,
|
|
@@ -17,5 +26,5 @@ export function ModalDesigner(props) {
|
|
|
17
26
|
borderRadius: 2,
|
|
18
27
|
display: 'flex',
|
|
19
28
|
flexDirection: 'column',
|
|
20
|
-
}, children: _jsx(Designer, { onClose: props.onClose, nrPoints: 128 }) }) }));
|
|
29
|
+
}, children: _jsx(Designer, { onClose: props.onClose, nrPoints: 128, callBackAfterTransform: logPolygon, callbackAfterScale: logScaling, callbackAfterTrademark: logTrademark }) }) }));
|
|
21
30
|
}
|
package/dist/Polygon.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export declare class Polygon {
|
|
|
42
42
|
findMinDistancePoint(point: Point): number;
|
|
43
43
|
transform(x: number, y: number, universeCenter: Point): Polygon;
|
|
44
44
|
scale(width: number, height: number): Polygon;
|
|
45
|
-
createCatmullRomPoints(nrPoints: number
|
|
45
|
+
createCatmullRomPoints(nrPoints: number): Polygon;
|
|
46
46
|
findNearestPoint(point: Point): number;
|
|
47
47
|
createRT1(): string;
|
|
48
48
|
createTR1(): string;
|
package/dist/Polygon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polygon.d.ts","sourceRoot":"","sources":["../src/Polygon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAIhC,qBAAa,OAAO;IA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|
120
120
|
return new Polygon(scaledPoints, this.universeCenter);
|
|
121
121
|
}
|
|
122
|
-
createCatmullRomPoints(nrPoints
|
|
122
|
+
createCatmullRomPoints(nrPoints) {
|
|
123
123
|
const points = this.points.map((xPoint) => {
|
|
124
124
|
return new Point(xPoint.X, xPoint.Y);
|
|
125
125
|
});
|
package/dist/ScaleForm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScaleForm.d.ts","sourceRoot":"","sources":["../src/ScaleForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAInD,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,WAAW,CAAC;IACtB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,
|
|
1
|
+
{"version":3,"file":"ScaleForm.d.ts","sourceRoot":"","sources":["../src/ScaleForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAInD,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,WAAW,CAAC;IACtB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,2CAsNA"}
|
package/dist/ScaleForm.js
CHANGED
|
@@ -14,7 +14,6 @@ export function ScaleForm(props) {
|
|
|
14
14
|
const [inputLength, setInputLength] = useState(props.scaledSL.value ?? 0);
|
|
15
15
|
const [length, setLength] = useState(props.scaledSL.value);
|
|
16
16
|
const [height, setHeight] = useState(props.scaledSH.value);
|
|
17
|
-
const [ratio, setRatio] = useState(1);
|
|
18
17
|
function onChangeLength(e) {
|
|
19
18
|
const newLength = Math.round(parseFloat(e.target.value) * scalingParam) / scalingParam;
|
|
20
19
|
// ratio = length / height
|
|
@@ -49,7 +48,7 @@ export function ScaleForm(props) {
|
|
|
49
48
|
const { points } = createEquidistantPoints(scaledPolygon.Points, scaledPolygon.Points.length);
|
|
50
49
|
const equidistantPolygon = new Polygon(points.map((pt) => new Point(pt.X, pt.Y, props.coords.coords.UniverseCenter)), props.coords.coords.UniverseCenter);
|
|
51
50
|
props.coords.setCoords(equidistantPolygon);
|
|
52
|
-
props.onCloseContinue(
|
|
51
|
+
props.onCloseContinue(length ?? 0, height ?? 0);
|
|
53
52
|
};
|
|
54
53
|
let xMin = 0;
|
|
55
54
|
let xMax = 0;
|
|
@@ -81,7 +80,7 @@ export function ScaleForm(props) {
|
|
|
81
80
|
useEffect(() => {
|
|
82
81
|
if (inputLength !== 0 && drawnLength !== 0) {
|
|
83
82
|
setLength(inputLength);
|
|
84
|
-
setRatio(inputLength / drawnLength);
|
|
83
|
+
// setRatio(inputLength / drawnLength);
|
|
85
84
|
}
|
|
86
85
|
}, [drawnLength, inputLength]);
|
|
87
86
|
function renderExtension(extensionString, min, max) {
|
package/dist/Scaling.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scaling.d.ts","sourceRoot":"","sources":["../src/Scaling.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Scaling.d.ts","sourceRoot":"","sources":["../src/Scaling.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,GAAG,EAAE,MAAM,OAAO,CAAC;AAEzC,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAC7B,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAChE,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAChE,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,GAAG,GAAG,CAAC,OAAO,CA8Cd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShowOptions.d.ts","sourceRoot":"","sources":["../src/ShowOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,GAAG,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ShowOptions.d.ts","sourceRoot":"","sources":["../src/ShowOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,GAAG,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;CACtD,GAAG,GAAG,CAAC,OAAO,CAoGd"}
|
package/dist/ShowOptions.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormControlLabel, Switch } from '@mui/material';
|
|
2
3
|
export function ShowOptions(props) {
|
|
3
4
|
function handleCheckboxChange(key) {
|
|
4
5
|
return (e) => {
|
|
@@ -14,18 +15,6 @@ export function ShowOptions(props) {
|
|
|
14
15
|
const handleCheckboxScaledBoxChange = handleCheckboxChange('scaledBox');
|
|
15
16
|
const handleCheckboxPolygonChange = handleCheckboxChange('polygon');
|
|
16
17
|
const handleCheckboxPointsChange = handleCheckboxChange('points');
|
|
17
|
-
const handleCheckboxCatmullRomCenterChange = handleCheckboxChange('catmullRomCenter');
|
|
18
|
-
const handleCheckboxCatmullRomPointsChange = handleCheckboxChange('catmullRomPoints');
|
|
19
18
|
const handleCheckboxCatmullRomChange = handleCheckboxChange('catmullRom');
|
|
20
|
-
return (_jsxs("div", { id: "id.ShowOptions", children: [
|
|
21
|
-
background: 'lightgreen',
|
|
22
|
-
padding: '4px',
|
|
23
|
-
borderRadius: '4px',
|
|
24
|
-
display: 'inline-block',
|
|
25
|
-
}, children: [_jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: props.show.center, onChange: (e) => handleCheckboxCenterChange(e) }), "Center"] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: props.show.points, onChange: (e) => handleCheckboxPointsChange(e) }), "Points"] }), _jsxs("label", { style: { marginLeft: '8px' }, children: [_jsx("input", { type: "checkbox", checked: props.show.polygon, onChange: (e) => handleCheckboxPolygonChange(e) }), "Polygon"] })] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: props.show.box, onChange: (e) => handleCheckboxBoxChange(e) }), "Box"] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: props.show.scaledBox, onChange: (e) => handleCheckboxScaledBoxChange(e) }), "Scaled Box"] }), _jsxs("div", { style: {
|
|
26
|
-
background: 'lightblue',
|
|
27
|
-
padding: '4px',
|
|
28
|
-
borderRadius: '4px',
|
|
29
|
-
display: 'inline-block',
|
|
30
|
-
}, children: [_jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: props.show.catmullRomCenter, onChange: (e) => handleCheckboxCatmullRomCenterChange(e) }), "Center"] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: props.show.catmullRomPoints, onChange: (e) => handleCheckboxCatmullRomPointsChange(e) }), "Catmull-Rom Points"] }), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: props.show.catmullRom, onChange: handleCheckboxCatmullRomChange }), "Catmull-Rom"] })] })] }));
|
|
19
|
+
return (_jsxs("div", { id: "id.ShowOptions", children: [_jsx(FormControlLabel, { control: _jsx(Switch, { checked: props.show.background, onChange: handleCheckboxBackgroundChange }), label: "Background" }), _jsx(FormControlLabel, { control: _jsx(Switch, { checked: props.show.center, onChange: handleCheckboxCenterChange }), label: "Center" }), _jsx(FormControlLabel, { control: _jsx(Switch, { checked: props.show.points, onChange: handleCheckboxPointsChange }), label: "Points" }), _jsx(FormControlLabel, { control: _jsx(Switch, { checked: props.show.polygon, onChange: handleCheckboxPolygonChange }), label: "Polygon", style: { marginLeft: '8px' } }), _jsx(FormControlLabel, { control: _jsx(Switch, { checked: props.show.box, onChange: handleCheckboxBoxChange }), label: "Box" }), _jsx(FormControlLabel, { control: _jsx(Switch, { checked: props.show.scaledBox, onChange: handleCheckboxScaledBoxChange }), label: "Scaled Box" }), _jsx(FormControlLabel, { control: _jsx(Switch, { checked: props.show.catmullRom, onChange: handleCheckboxCatmullRomChange }), label: "Catmull-Rom" })] }));
|
|
31
20
|
}
|
package/dist/Start.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Start.d.ts","sourceRoot":"","sources":["../src/Start.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,wBAAgB,KAAK,CAAC,KAAK,EAAE;IAC3B,MAAM,EAAE,KAAK,CAAC;IACd,OAAO,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,cAAc,EAAE,KAAK,KAAK,IAAI,CAAC;IACpE,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACjC,
|
|
1
|
+
{"version":3,"file":"Start.d.ts","sourceRoot":"","sources":["../src/Start.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,wBAAgB,KAAK,CAAC,KAAK,EAAE;IAC3B,MAAM,EAAE,KAAK,CAAC;IACd,OAAO,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,cAAc,EAAE,KAAK,KAAK,IAAI,CAAC;IACpE,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACjC,2CA+GA"}
|
package/dist/Start.js
CHANGED
|
@@ -6,15 +6,6 @@ import PointsForm from './PointsForm';
|
|
|
6
6
|
export function Start(props) {
|
|
7
7
|
const fileInputRef = useRef(null);
|
|
8
8
|
const [showModalPointsForm, setShowModalPointsForm] = useState(false);
|
|
9
|
-
const styleButton = {
|
|
10
|
-
// display: 'flex',
|
|
11
|
-
// flexDirection: 'column',
|
|
12
|
-
// gap: 2,
|
|
13
|
-
// padding: 1,
|
|
14
|
-
// position: 'absolute' as const,
|
|
15
|
-
// top: '38%',
|
|
16
|
-
// left: '7%',
|
|
17
|
-
};
|
|
18
9
|
const actions = getValidActions(props.machine);
|
|
19
10
|
function isDisabled(action) {
|
|
20
11
|
return actions.findIndex((a) => a === action) === -1;
|
package/dist/Workflow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workflow.d.ts","sourceRoot":"","sources":["../src/Workflow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAU,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"Workflow.d.ts","sourceRoot":"","sources":["../src/Workflow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAU,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,GAAG,GAAG,CAAC,OAAO,CAkFd"}
|
package/dist/Workflow.js
CHANGED
|
@@ -3,9 +3,6 @@ import { useRef } from 'react';
|
|
|
3
3
|
import { STATUS } from './enum';
|
|
4
4
|
import { Button, Input } from '@mui/material';
|
|
5
5
|
export function Workflow(props) {
|
|
6
|
-
function onLoadImage() {
|
|
7
|
-
props.setStatus(STATUS.LOAD_IMAGE);
|
|
8
|
-
}
|
|
9
6
|
function onDefineXAxis() {
|
|
10
7
|
props.setStatus(STATUS.DEFINE_X_AXIS_1);
|
|
11
8
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -2,9 +2,7 @@ import { STATUS } from 'frame.statemachine';
|
|
|
2
2
|
import { Point } from './Point';
|
|
3
3
|
import { Polygon } from './Polygon';
|
|
4
4
|
export type TShow = {
|
|
5
|
-
catmullRomPoints: boolean;
|
|
6
5
|
catmullRom: boolean;
|
|
7
|
-
catmullRomCenter: boolean;
|
|
8
6
|
points: boolean;
|
|
9
7
|
polygon: boolean;
|
|
10
8
|
center: boolean;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,KAAK,GAAG;IAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,KAAK,GAAG;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC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OAAO,GAAG,SAAS,CAAC;IACtC,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CACjC,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC,CAC1C,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACpE,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;CAC7E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frame.image",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"description": "A React component for drawing a frame on a canvas element.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Christian.Todd@rodenstock.com",
|
|
@@ -26,15 +26,18 @@
|
|
|
26
26
|
"dev": "vite",
|
|
27
27
|
"build": "tsc -b",
|
|
28
28
|
"test": "vitest",
|
|
29
|
+
"test:e2e": "playwright test",
|
|
30
|
+
"test:e2e:ui": "playwright test --ui",
|
|
31
|
+
"test:e2e:debug": "playwright test --debug",
|
|
29
32
|
"doc": "typedoc --options typedoc.json --tsconfig ./tsconfig.json --logLevel Verbose",
|
|
30
33
|
"build-with-vite": "tsc -b && vite build",
|
|
31
34
|
"lint": "eslint .",
|
|
32
35
|
"preview": "vite preview"
|
|
33
36
|
},
|
|
34
37
|
"peerDependencies": {
|
|
38
|
+
"@mui/material": ">=7.0.0",
|
|
35
39
|
"react": ">=18.0.0",
|
|
36
|
-
"react-dom": ">=18.0.0"
|
|
37
|
-
"@mui/material": ">=7.0.0"
|
|
40
|
+
"react-dom": ">=18.0.0"
|
|
38
41
|
},
|
|
39
42
|
"dependencies": {
|
|
40
43
|
"@emotion/react": "^11.14.0",
|
|
@@ -42,25 +45,27 @@
|
|
|
42
45
|
"frame.akima": "^2.0.1",
|
|
43
46
|
"frame.nidek": "^1.1.4",
|
|
44
47
|
"frame.statemachine": "^1.1.4",
|
|
45
|
-
"
|
|
48
|
+
"playwright": "^1.57.0",
|
|
49
|
+
"react-error-boundary": "^6.0.3",
|
|
46
50
|
"react-robot": "^1.2.1"
|
|
47
51
|
},
|
|
48
52
|
"devDependencies": {
|
|
49
|
-
"@eslint/js": "^9.39.
|
|
50
|
-
"@mui/material": "^7.3.
|
|
51
|
-
"@
|
|
52
|
-
"@types/react
|
|
53
|
+
"@eslint/js": "^9.39.2",
|
|
54
|
+
"@mui/material": "^7.3.7",
|
|
55
|
+
"@playwright/test": "^1.57.0",
|
|
56
|
+
"@types/react": "^19.2.8",
|
|
57
|
+
"@types/react-dom": "^19.2.3",
|
|
53
58
|
"@vitejs/plugin-react": "^5.1.2",
|
|
54
|
-
"eslint": "^9.39.
|
|
59
|
+
"eslint": "^9.39.2",
|
|
55
60
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
56
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
57
|
-
"globals": "^
|
|
58
|
-
"react": "^
|
|
59
|
-
"react-dom": "^
|
|
60
|
-
"typedoc": "^0.28.
|
|
61
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
62
|
+
"globals": "^17.0.0",
|
|
63
|
+
"react": "^19.2.3",
|
|
64
|
+
"react-dom": "^19.2.3",
|
|
65
|
+
"typedoc": "^0.28.16",
|
|
61
66
|
"typescript": "~5.9.3",
|
|
62
|
-
"typescript-eslint": "^8.
|
|
63
|
-
"vite": "^7.
|
|
64
|
-
"vitest": "^4.0.
|
|
67
|
+
"typescript-eslint": "^8.53.0",
|
|
68
|
+
"vite": "^7.3.1",
|
|
69
|
+
"vitest": "^4.0.17"
|
|
65
70
|
}
|
|
66
71
|
}
|