@yorab/react-paint 0.7.3 → 0.7.4
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/README.md +11 -11
- package/dist/components/toolbox/MenuGroup.js +1 -1
- package/dist/constants/picture.js +8 -0
- package/dist/hooks/useKeyboard.js +6 -4
- package/dist/hooks/useShapes.js +4 -2
- package/dist/styles.css +32 -32
- package/dist/utils/file.js +31 -2
- package/dist/utils/shapes/picture.js +50 -35
- package/dist/utils/transform.js +3 -0
- package/package.json +78 -78
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# React Paint
|
|
2
|
-
|
|
3
|
-
## known issues :
|
|
4
|
-
|
|
5
|
-
- dnd layout on mobile not working (fix : use dnd lib, or add touch listener to fake dnd, or provide alt UI)
|
|
6
|
-
- TextEdit cursor overflow MINOR (quick fix : edit on modale ?)
|
|
7
|
-
- circle resizing only goes one direction
|
|
8
|
-
- adding padding to selection result in wrong intersection calculs
|
|
9
|
-
- Clear with custom callback breaks history stack
|
|
10
|
-
- selection padding needs work
|
|
11
|
-
- with shrunk or grown container, anchors selection is miscalculated
|
|
1
|
+
# React Paint
|
|
2
|
+
|
|
3
|
+
## known issues :
|
|
4
|
+
|
|
5
|
+
- dnd layout on mobile not working (fix : use dnd lib, or add touch listener to fake dnd, or provide alt UI)
|
|
6
|
+
- TextEdit cursor overflow MINOR (quick fix : edit on modale ?)
|
|
7
|
+
- circle resizing only goes one direction
|
|
8
|
+
- adding padding to selection result in wrong intersection calculs
|
|
9
|
+
- Clear with custom callback breaks history stack
|
|
10
|
+
- selection padding needs work
|
|
11
|
+
- with shrunk or grown container, anchors selection is miscalculated
|
|
@@ -137,7 +137,7 @@ const MenuGroup = _ref => {
|
|
|
137
137
|
disabled: disabled,
|
|
138
138
|
loadFile: addPicture,
|
|
139
139
|
img: _tools.UPLOAD_PICTURE_TOOL.icon,
|
|
140
|
-
accept: "image/png, image/gif, image/jpeg"
|
|
140
|
+
accept: "image/png, image/gif, image/jpeg, image/svg+xml"
|
|
141
141
|
}), withUrlPicture && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
142
142
|
disabled: disabled,
|
|
143
143
|
selected: false,
|
|
@@ -20,8 +20,10 @@ const KeyboardCode = {
|
|
|
20
20
|
Backspace: 'Backspace',
|
|
21
21
|
Escape: 'Escape',
|
|
22
22
|
Shift: 'Shift',
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
z: 'z',
|
|
24
|
+
Z: 'Z',
|
|
25
|
+
y: 'y',
|
|
26
|
+
Y: 'Y'
|
|
25
27
|
};
|
|
26
28
|
const KeyboardCommand = {
|
|
27
29
|
Copy: 'copy',
|
|
@@ -69,12 +71,12 @@ const useKeyboard = _ref => {
|
|
|
69
71
|
|
|
70
72
|
const handleKeyDown = e => {
|
|
71
73
|
if (e.metaKey || e.ctrlKey) {
|
|
72
|
-
if (e.key === KeyboardCode.Z) {
|
|
74
|
+
if (e.key === KeyboardCode.Z || e.key === KeyboardCode.z) {
|
|
73
75
|
e.preventDefault();
|
|
74
76
|
e.stopPropagation();
|
|
75
77
|
backwardShape();
|
|
76
78
|
return;
|
|
77
|
-
} else if (e.key === KeyboardCode.Y) {
|
|
79
|
+
} else if (e.key === KeyboardCode.Y || e.key === KeyboardCode.y) {
|
|
78
80
|
e.preventDefault();
|
|
79
81
|
e.stopPropagation();
|
|
80
82
|
forwardShape();
|
package/dist/hooks/useShapes.js
CHANGED
|
@@ -13,6 +13,8 @@ var _fp = _interopRequireDefault(require("lodash/fp"));
|
|
|
13
13
|
|
|
14
14
|
var _picture = require("../utils/shapes/picture");
|
|
15
15
|
|
|
16
|
+
var _picture2 = require("../constants/picture");
|
|
17
|
+
|
|
16
18
|
const useShapes = function () {
|
|
17
19
|
let onDataChanged = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _fp.default.noop;
|
|
18
20
|
const shapesRef = (0, _react.useRef)([]);
|
|
@@ -44,8 +46,8 @@ const useShapes = function () {
|
|
|
44
46
|
shapesRef.current = [newShape, ...shapesRef.current];
|
|
45
47
|
}, []);
|
|
46
48
|
const addPictureShape = (0, _react.useCallback)(async function (fileOrUrl) {
|
|
47
|
-
let maxWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
48
|
-
let maxHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] :
|
|
49
|
+
let maxWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _picture2.PICTURE_DEFAULT_SIZE;
|
|
50
|
+
let maxHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _picture2.PICTURE_DEFAULT_SIZE;
|
|
49
51
|
const pictureShape = await (0, _picture.createPicture)(fileOrUrl, maxWidth, maxHeight);
|
|
50
52
|
addShape(pictureShape);
|
|
51
53
|
saveShapes();
|
package/dist/styles.css
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
#react-paint-root {
|
|
2
|
-
margin: 0;
|
|
3
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
4
|
-
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
5
|
-
background: #F3F3F3;
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
#react-paint-root .examples {
|
|
10
|
-
display: flex;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
#react-paint-root .menu {
|
|
14
|
-
width: 250px;
|
|
15
|
-
min-width: 0;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
#react-paint-root .menu a {
|
|
21
|
-
margin: 8px;
|
|
22
|
-
padding: 4px;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
#react-paint-root .menu a.selected {
|
|
26
|
-
color: green;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
#react-paint-root .currentApp {
|
|
30
|
-
flex: 1;
|
|
31
|
-
min-width: 0;
|
|
32
|
-
}
|
|
1
|
+
#react-paint-root {
|
|
2
|
+
margin: 0;
|
|
3
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
4
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
5
|
+
background: #F3F3F3;
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
#react-paint-root .examples {
|
|
10
|
+
display: flex;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#react-paint-root .menu {
|
|
14
|
+
width: 250px;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#react-paint-root .menu a {
|
|
21
|
+
margin: 8px;
|
|
22
|
+
padding: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#react-paint-root .menu a.selected {
|
|
26
|
+
color: green;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#react-paint-root .currentApp {
|
|
30
|
+
flex: 1;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
}
|
|
33
33
|
|
|
34
34
|
.s1unz6yq{position:absolute;display:inline-block;outline:none;left:0px;top:0px;-webkit-transform-origin:left top;-ms-transform-origin:left top;transform-origin:left top;box-sizing:border-box;-webkit-transform:var(--s1unz6yq-0);-ms-transform:var(--s1unz6yq-0);transform:var(--s1unz6yq-0);color:var(--s1unz6yq-1);padding:var(--s1unz6yq-2);font-size:var(--s1unz6yq-3);line-height:var(--s1unz6yq-3);font-family:var(--s1unz6yq-5);opacity:var(--s1unz6yq-6);width:-webkit-max-content;width:-moz-max-content;width:max-content;background:none;}.s1unz6yq[data-fontbold='true']{font-weight:bold;}.s1unz6yq[data-fontitalic='true']{font-style:italic;}
|
|
35
35
|
.s9czb9p{-webkit-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}
|
package/dist/utils/file.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.getCanvasImage = exports.getBase64Image = exports.fetchAndStringify = exports.encodeShapesInString = exports.downloadFile = exports.decodeJson = exports.decodeImportedData = void 0;
|
|
8
|
+
exports.isSvg = exports.getCanvasImage = exports.getBase64Image = exports.fetchAndStringify = exports.encodeShapesInString = exports.downloadFile = exports.decodeJson = exports.decodeImportedData = exports.addSizeAndConvertSvgToBase64 = void 0;
|
|
9
9
|
|
|
10
10
|
var _shapes = require("../constants/shapes");
|
|
11
11
|
|
|
@@ -19,8 +19,37 @@ var _migration = require("./migration");
|
|
|
19
19
|
|
|
20
20
|
var _shapes2 = require("./shapes");
|
|
21
21
|
|
|
22
|
+
var _picture = require("../constants/picture");
|
|
23
|
+
|
|
24
|
+
const addSizeAndConvertSvgToBase64 = svgFileContent => {
|
|
25
|
+
var _inlineSVG$getAttribu;
|
|
26
|
+
|
|
27
|
+
const parser = new DOMParser();
|
|
28
|
+
const result = parser.parseFromString(svgFileContent, 'text/xml');
|
|
29
|
+
const inlineSVG = result.getElementsByTagName('svg')[0];
|
|
30
|
+
const svgWidth = inlineSVG.getAttribute('width');
|
|
31
|
+
const svgHeight = inlineSVG.getAttribute('height');
|
|
32
|
+
|
|
33
|
+
if (svgWidth || svgHeight) {
|
|
34
|
+
return 'data:image/svg+xml;base64,' + btoa(svgFileContent);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const viewBox = (_inlineSVG$getAttribu = inlineSVG.getAttribute('viewBox')) !== null && _inlineSVG$getAttribu !== void 0 ? _inlineSVG$getAttribu : "0 0 ".concat(_picture.PICTURE_DEFAULT_SIZE, " ").concat(_picture.PICTURE_DEFAULT_SIZE);
|
|
38
|
+
const [,, width, height] = viewBox.split(' ');
|
|
39
|
+
inlineSVG.setAttribute('width', width !== null && width !== void 0 ? width : _picture.PICTURE_DEFAULT_SIZE);
|
|
40
|
+
inlineSVG.setAttribute('height', height !== null && height !== void 0 ? height : _picture.PICTURE_DEFAULT_SIZE);
|
|
41
|
+
const svg64 = btoa(new XMLSerializer().serializeToString(inlineSVG));
|
|
42
|
+
return 'data:image/svg+xml;base64,' + svg64;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.addSizeAndConvertSvgToBase64 = addSizeAndConvertSvgToBase64;
|
|
46
|
+
|
|
47
|
+
const isSvg = fileOrUrl => (fileOrUrl instanceof File ? fileOrUrl.name : fileOrUrl).includes('.svg');
|
|
48
|
+
|
|
49
|
+
exports.isSvg = isSvg;
|
|
50
|
+
|
|
22
51
|
const fetchAndStringify = url => {
|
|
23
|
-
return fetch(url).then(response => response.blob()).then(myBlob => URL.createObjectURL(myBlob));
|
|
52
|
+
return isSvg(url) ? fetch(url).then(response => response.text()).then(svgFileContent => addSizeAndConvertSvgToBase64(svgFileContent)) : fetch(url).then(response => response.blob()).then(myBlob => URL.createObjectURL(myBlob));
|
|
24
53
|
};
|
|
25
54
|
|
|
26
55
|
exports.fetchAndStringify = fetchAndStringify;
|
|
@@ -19,48 +19,65 @@ var _canvas = require("../canvas");
|
|
|
19
19
|
|
|
20
20
|
var _rectangle = require("./rectangle");
|
|
21
21
|
|
|
22
|
+
const createPictureShape = (img, maxPictureWidth, maxPictureHeight) => {
|
|
23
|
+
const [width, height] = (0, _transform.fitContentInsideContainer)(img.width, img.height, maxPictureWidth, maxPictureHeight, true);
|
|
24
|
+
return {
|
|
25
|
+
toolId: _tools.DEFAULT_SHAPE_PICTURE.id,
|
|
26
|
+
type: 'picture',
|
|
27
|
+
id: _fp.default.uniqueId('picture'.concat("_")),
|
|
28
|
+
x: (maxPictureWidth - width) / 2,
|
|
29
|
+
y: (maxPictureHeight - height) / 2,
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
src: img.src,
|
|
33
|
+
img,
|
|
34
|
+
rotation: 0
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const createFilePicture = (img, resolve, file, maxPictureWidth, maxPictureHeight) => {
|
|
39
|
+
img.onload = async () => {
|
|
40
|
+
if ((0, _file.isSvg)(file) && !img.width && !img.height) {
|
|
41
|
+
const svgFileContent = await file.text();
|
|
42
|
+
const svgFile = (0, _file.addSizeAndConvertSvgToBase64)(svgFileContent);
|
|
43
|
+
if (svgFile === img.src) return; // prevent infinite loop
|
|
44
|
+
|
|
45
|
+
img.src = svgFile;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const pictureShape = createPictureShape(img, maxPictureWidth, maxPictureHeight);
|
|
50
|
+
resolve(pictureShape);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
img.src = URL.createObjectURL(file);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const createUrlPicture = (img, resolve, url, maxPictureWidth, maxPictureHeight) => {
|
|
57
|
+
img.onload = () => {
|
|
58
|
+
const pictureShape = createPictureShape(img, maxPictureWidth, maxPictureHeight);
|
|
59
|
+
resolve(pictureShape);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
(0, _file.fetchAndStringify)(url).then(picData => {
|
|
63
|
+
img.src = picData;
|
|
64
|
+
}).catch(() => {
|
|
65
|
+
img.src = ''; // trigger onerror
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
|
|
22
69
|
const createPicture = (fileOrUrl, maxPictureWidth, maxPictureHeight) => {
|
|
23
70
|
return new Promise((resolve, reject) => {
|
|
24
71
|
const img = new Image();
|
|
25
72
|
|
|
26
|
-
img.onload = () => {
|
|
27
|
-
const [width, height] = (0, _transform.fitContentInsideContainer)(img.width, img.height, maxPictureWidth, maxPictureHeight, true);
|
|
28
|
-
const pictureShape = {
|
|
29
|
-
toolId: _tools.DEFAULT_SHAPE_PICTURE.id,
|
|
30
|
-
type: 'picture',
|
|
31
|
-
id: _fp.default.uniqueId('picture'.concat("_")),
|
|
32
|
-
x: (maxPictureWidth - width) / 2,
|
|
33
|
-
y: (maxPictureHeight - height) / 2,
|
|
34
|
-
width,
|
|
35
|
-
height,
|
|
36
|
-
src: fileOrUrl instanceof File ? img.src : fileOrUrl,
|
|
37
|
-
img,
|
|
38
|
-
rotation: 0
|
|
39
|
-
};
|
|
40
|
-
resolve(pictureShape);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
73
|
img.onerror = () => {
|
|
44
74
|
reject(new Error('Some images could not be loaded'));
|
|
45
75
|
};
|
|
46
76
|
|
|
47
|
-
if (fileOrUrl instanceof File) {
|
|
48
|
-
img.src = URL.createObjectURL(fileOrUrl);
|
|
49
|
-
} else {
|
|
50
|
-
(0, _file.fetchAndStringify)(fileOrUrl).then(picData => {
|
|
51
|
-
img.src = picData;
|
|
52
|
-
}).catch(() => {
|
|
53
|
-
img.src = ''; // to trigger onerror
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
img.onerror = () => {
|
|
58
|
-
reject(new Error('Error while loading the src'));
|
|
59
|
-
};
|
|
60
|
-
|
|
61
77
|
setTimeout(() => {
|
|
62
|
-
reject(new Error('Timeout while loading
|
|
78
|
+
reject(new Error('Timeout while loading images'));
|
|
63
79
|
}, 4000);
|
|
80
|
+
fileOrUrl instanceof File ? createFilePicture(img, resolve, fileOrUrl, maxPictureWidth, maxPictureHeight) : createUrlPicture(img, resolve, fileOrUrl, maxPictureWidth, maxPictureHeight);
|
|
64
81
|
});
|
|
65
82
|
};
|
|
66
83
|
|
|
@@ -75,9 +92,7 @@ const drawPicture = (ctx, picture) => {
|
|
|
75
92
|
|
|
76
93
|
exports.drawPicture = drawPicture;
|
|
77
94
|
|
|
78
|
-
const getPictureBorder = (picture, selectionPadding) =>
|
|
79
|
-
return (0, _rectangle.getRectBorder)(picture, selectionPadding);
|
|
80
|
-
};
|
|
95
|
+
const getPictureBorder = (picture, selectionPadding) => (0, _rectangle.getRectBorder)(picture, selectionPadding);
|
|
81
96
|
|
|
82
97
|
exports.getPictureBorder = getPictureBorder;
|
|
83
98
|
|
package/dist/utils/transform.js
CHANGED
|
@@ -15,6 +15,8 @@ var _shapes = require("./shapes");
|
|
|
15
15
|
|
|
16
16
|
var _brush = require("./shapes/brush");
|
|
17
17
|
|
|
18
|
+
var _picture = require("../constants/picture");
|
|
19
|
+
|
|
18
20
|
const getNormalizedSize = (originalWidth, originalHeight, width, height) => {
|
|
19
21
|
const originalRatio = originalWidth / originalHeight;
|
|
20
22
|
const newRatio = width / height;
|
|
@@ -91,6 +93,7 @@ exports.transformShape = transformShape;
|
|
|
91
93
|
|
|
92
94
|
const fitContentInsideContainer = function (contentWidth, contentHeight, containerWidth, containerHeight) {
|
|
93
95
|
let shouldFillContainer = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
96
|
+
if (!contentWidth || !contentHeight || !containerHeight || !containerWidth) return [_picture.PICTURE_DEFAULT_SIZE, _picture.PICTURE_DEFAULT_SIZE];
|
|
94
97
|
const contentRatio = contentWidth / contentHeight;
|
|
95
98
|
const containerRatio = containerWidth / containerHeight;
|
|
96
99
|
|
package/package.json
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@yorab/react-paint",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"keywords": [],
|
|
5
|
-
"author": "Yohann Rabatel",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "./dist/components/App.js",
|
|
8
|
-
"types": "./dist/components/App.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"README.md",
|
|
11
|
-
"package.json",
|
|
12
|
-
"dist/"
|
|
13
|
-
],
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@linaria/react": "3.0.0-beta.22",
|
|
16
|
-
"lodash": "^4.17.20"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@babel/cli": "7.12.8",
|
|
20
|
-
"@babel/core": "^7.16.7",
|
|
21
|
-
"@babel/plugin-transform-runtime": "^7.16.8",
|
|
22
|
-
"@babel/preset-env": "^7.16.8",
|
|
23
|
-
"@babel/preset-react": "^7.16.7",
|
|
24
|
-
"@babel/preset-typescript": "^7.16.7",
|
|
25
|
-
"@babel/runtime": "^7.16.7",
|
|
26
|
-
"@linaria/babel-preset": "3.0.0-beta.22",
|
|
27
|
-
"@linaria/core": "3.0.0-beta.22",
|
|
28
|
-
"@linaria/webpack-loader": "3.0.0-beta.22",
|
|
29
|
-
"@linaria/shaker": "^3.0.0-beta.22",
|
|
30
|
-
"@testing-library/jest-dom": "^5.11.4",
|
|
31
|
-
"@testing-library/react": "^11.1.0",
|
|
32
|
-
"@testing-library/user-event": "^12.1.10",
|
|
33
|
-
"@types/jest": "^26.0.15",
|
|
34
|
-
"@types/lodash": "4.14.170",
|
|
35
|
-
"@types/node": "^12.0.0",
|
|
36
|
-
"@types/react": "^18.0.10",
|
|
37
|
-
"@types/react-dom": "^18.0.5",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "4.28.0",
|
|
39
|
-
"@typescript-eslint/parser": "4.28.0",
|
|
40
|
-
"babel-jest": "^27.4.6",
|
|
41
|
-
"babel-loader": "^8.2.3",
|
|
42
|
-
"babel-plugin-module-resolver": "^4.1.0",
|
|
43
|
-
"css-loader": "^6.7.0",
|
|
44
|
-
"eslint": "7.29.0",
|
|
45
|
-
"eslint-config-prettier": "^8.3.0",
|
|
46
|
-
"eslint-import-resolver-typescript": "2.4.0",
|
|
47
|
-
"eslint-plugin-import": "2.23.4",
|
|
48
|
-
"eslint-plugin-prettier": "^3.4.0",
|
|
49
|
-
"eslint-plugin-react-hooks": "^4.2.0",
|
|
50
|
-
"html-webpack-plugin": "^5.5.0",
|
|
51
|
-
"mini-css-extract-plugin": "^2.6.0",
|
|
52
|
-
"prettier": "^2.3.2",
|
|
53
|
-
"react": "18.1.0",
|
|
54
|
-
"react-dom": "18.1.0",
|
|
55
|
-
"typescript": "^4.7.2",
|
|
56
|
-
"webpack": "^5.66.0",
|
|
57
|
-
"webpack-cli": "^4.9.1",
|
|
58
|
-
"webpack-dev-server": "^4.7.3"
|
|
59
|
-
},
|
|
60
|
-
"peerDependencies": {
|
|
61
|
-
"react": "*",
|
|
62
|
-
"react-dom": "*"
|
|
63
|
-
},
|
|
64
|
-
"scripts": {
|
|
65
|
-
"declarationfiles": "tsc --project tsconfig.prod.json",
|
|
66
|
-
"start": "webpack serve --config webpack.config.js --open",
|
|
67
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
68
|
-
"buildexamples": "webpack --config webpack.prod.config.js",
|
|
69
|
-
"build": "npx babel src/ --extensions '.js,.ts,.tsx,.jsx' --copy-files --delete-dir-on-start -d dist",
|
|
70
|
-
"buildwithcss": "npm run build && npm run buildexamples && mv build/styles.css dist/styles.css",
|
|
71
|
-
"publish": "npm run buildwithcss && npm publish --access public"
|
|
72
|
-
},
|
|
73
|
-
"jest": {
|
|
74
|
-
"transform": {
|
|
75
|
-
"^.+\\.[t|j]sx?$": "babel-jest"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@yorab/react-paint",
|
|
3
|
+
"version": "0.7.4",
|
|
4
|
+
"keywords": [],
|
|
5
|
+
"author": "Yohann Rabatel",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/components/App.js",
|
|
8
|
+
"types": "./dist/components/App.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"README.md",
|
|
11
|
+
"package.json",
|
|
12
|
+
"dist/"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@linaria/react": "3.0.0-beta.22",
|
|
16
|
+
"lodash": "^4.17.20"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@babel/cli": "7.12.8",
|
|
20
|
+
"@babel/core": "^7.16.7",
|
|
21
|
+
"@babel/plugin-transform-runtime": "^7.16.8",
|
|
22
|
+
"@babel/preset-env": "^7.16.8",
|
|
23
|
+
"@babel/preset-react": "^7.16.7",
|
|
24
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
25
|
+
"@babel/runtime": "^7.16.7",
|
|
26
|
+
"@linaria/babel-preset": "3.0.0-beta.22",
|
|
27
|
+
"@linaria/core": "3.0.0-beta.22",
|
|
28
|
+
"@linaria/webpack-loader": "3.0.0-beta.22",
|
|
29
|
+
"@linaria/shaker": "^3.0.0-beta.22",
|
|
30
|
+
"@testing-library/jest-dom": "^5.11.4",
|
|
31
|
+
"@testing-library/react": "^11.1.0",
|
|
32
|
+
"@testing-library/user-event": "^12.1.10",
|
|
33
|
+
"@types/jest": "^26.0.15",
|
|
34
|
+
"@types/lodash": "4.14.170",
|
|
35
|
+
"@types/node": "^12.0.0",
|
|
36
|
+
"@types/react": "^18.0.10",
|
|
37
|
+
"@types/react-dom": "^18.0.5",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "4.28.0",
|
|
39
|
+
"@typescript-eslint/parser": "4.28.0",
|
|
40
|
+
"babel-jest": "^27.4.6",
|
|
41
|
+
"babel-loader": "^8.2.3",
|
|
42
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
43
|
+
"css-loader": "^6.7.0",
|
|
44
|
+
"eslint": "7.29.0",
|
|
45
|
+
"eslint-config-prettier": "^8.3.0",
|
|
46
|
+
"eslint-import-resolver-typescript": "2.4.0",
|
|
47
|
+
"eslint-plugin-import": "2.23.4",
|
|
48
|
+
"eslint-plugin-prettier": "^3.4.0",
|
|
49
|
+
"eslint-plugin-react-hooks": "^4.2.0",
|
|
50
|
+
"html-webpack-plugin": "^5.5.0",
|
|
51
|
+
"mini-css-extract-plugin": "^2.6.0",
|
|
52
|
+
"prettier": "^2.3.2",
|
|
53
|
+
"react": "18.1.0",
|
|
54
|
+
"react-dom": "18.1.0",
|
|
55
|
+
"typescript": "^4.7.2",
|
|
56
|
+
"webpack": "^5.66.0",
|
|
57
|
+
"webpack-cli": "^4.9.1",
|
|
58
|
+
"webpack-dev-server": "^4.7.3"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"react": "*",
|
|
62
|
+
"react-dom": "*"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"declarationfiles": "tsc --project tsconfig.prod.json",
|
|
66
|
+
"start": "webpack serve --config webpack.config.js --open",
|
|
67
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
68
|
+
"buildexamples": "webpack --config webpack.prod.config.js",
|
|
69
|
+
"build": "npx babel src/ --extensions '.js,.ts,.tsx,.jsx' --copy-files --delete-dir-on-start -d dist",
|
|
70
|
+
"buildwithcss": "npm run build && npm run buildexamples && mv build/styles.css dist/styles.css",
|
|
71
|
+
"publish": "npm run buildwithcss && npm publish --access public"
|
|
72
|
+
},
|
|
73
|
+
"jest": {
|
|
74
|
+
"transform": {
|
|
75
|
+
"^.+\\.[t|j]sx?$": "babel-jest"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|