nzk-react-components 0.4.0 → 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/assets/icons/games.svg.js +137 -0
- package/dist/assets/icons/games.svg.js.map +1 -0
- package/dist/components/Icon/icons.d.ts +1 -0
- package/dist/components/Icon/icons.js +2 -0
- package/dist/components/Icon/icons.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/DrawingTool/DrawingTool.d.ts +0 -29
- package/dist/components/DrawingTool/DrawingTool.js +0 -277
- package/dist/components/DrawingTool/DrawingTool.js.map +0 -1
- package/dist/components/DrawingTool/DrawingTool.stories.d.ts +0 -6
- package/dist/components/DrawingTool/DrawingTool.styles.d.ts +0 -41
- package/dist/components/DrawingTool/DrawingTool.styles.js +0 -54
- package/dist/components/DrawingTool/DrawingTool.styles.js.map +0 -1
- package/dist/components/DrawingTool/DrawingToolProvider.d.ts +0 -56
- package/dist/components/DrawingTool/DrawingToolProvider.js +0 -182
- package/dist/components/DrawingTool/DrawingToolProvider.js.map +0 -1
- package/dist/components/DrawingTool/components/ColourToolbar/ColourToolbar.d.ts +0 -21
- package/dist/components/DrawingTool/components/ColourToolbar/ColourToolbar.js +0 -89
- package/dist/components/DrawingTool/components/ColourToolbar/ColourToolbar.js.map +0 -1
- package/dist/components/DrawingTool/components/ColourToolbar/ColourToolbar.styles.d.ts +0 -9
- package/dist/components/DrawingTool/components/ColourToolbar/ColourToolbar.styles.js +0 -18
- package/dist/components/DrawingTool/components/ColourToolbar/ColourToolbar.styles.js.map +0 -1
- package/dist/components/DrawingTool/components/ColourToolbar/index.d.ts +0 -2
- package/dist/components/DrawingTool/components/ColourToolbar/index.js +0 -8
- package/dist/components/DrawingTool/components/ColourToolbar/index.js.map +0 -1
- package/dist/components/DrawingTool/components/FileInput/FileInput.d.ts +0 -9
- package/dist/components/DrawingTool/components/FileInput/FileInput.js +0 -88
- package/dist/components/DrawingTool/components/FileInput/FileInput.js.map +0 -1
- package/dist/components/DrawingTool/components/FileInput/FileInput.styles.d.ts +0 -4
- package/dist/components/DrawingTool/components/FileInput/FileInput.styles.js +0 -22
- package/dist/components/DrawingTool/components/FileInput/FileInput.styles.js.map +0 -1
- package/dist/components/DrawingTool/components/FileInput/index.d.ts +0 -2
- package/dist/components/DrawingTool/components/FileInput/index.js +0 -8
- package/dist/components/DrawingTool/components/FileInput/index.js.map +0 -1
- package/dist/components/DrawingTool/components/Header/Header.d.ts +0 -9
- package/dist/components/DrawingTool/components/Header/Header.js +0 -38
- package/dist/components/DrawingTool/components/Header/Header.js.map +0 -1
- package/dist/components/DrawingTool/components/Header/index.d.ts +0 -2
- package/dist/components/DrawingTool/components/Header/index.js +0 -8
- package/dist/components/DrawingTool/components/Header/index.js.map +0 -1
- package/dist/components/DrawingTool/components/OpacityToggle/OpacityToggle.d.ts +0 -8
- package/dist/components/DrawingTool/components/OpacityToggle/OpacityToggle.js +0 -31
- package/dist/components/DrawingTool/components/OpacityToggle/OpacityToggle.js.map +0 -1
- package/dist/components/DrawingTool/components/OpacityToggle/OpacityToggle.styles.d.ts +0 -9
- package/dist/components/DrawingTool/components/OpacityToggle/OpacityToggle.styles.js +0 -18
- package/dist/components/DrawingTool/components/OpacityToggle/OpacityToggle.styles.js.map +0 -1
- package/dist/components/DrawingTool/components/OpacityToggle/index.d.ts +0 -2
- package/dist/components/DrawingTool/components/OpacityToggle/index.js +0 -8
- package/dist/components/DrawingTool/components/OpacityToggle/index.js.map +0 -1
- package/dist/components/DrawingTool/components/Placeable/index.d.ts +0 -9
- package/dist/components/DrawingTool/components/Placeable/index.js +0 -22
- package/dist/components/DrawingTool/components/Placeable/index.js.map +0 -1
- package/dist/components/DrawingTool/index.d.ts +0 -2
- package/dist/components/DrawingTool/lib/Sketch.d.ts +0 -90
- package/dist/components/DrawingTool/lib/Sketch.js +0 -414
- package/dist/components/DrawingTool/lib/Sketch.js.map +0 -1
- package/dist/components/DrawingTool/lib/SketchCut.d.ts +0 -22
- package/dist/components/DrawingTool/lib/SketchCut.js +0 -98
- package/dist/components/DrawingTool/lib/SketchCut.js.map +0 -1
- package/dist/components/DrawingTool/lib/SketchCutModel.d.ts +0 -6
- package/dist/components/DrawingTool/lib/SketchCutModel.js +0 -20
- package/dist/components/DrawingTool/lib/SketchCutModel.js.map +0 -1
- package/dist/components/DrawingTool/lib/SketchLayer.d.ts +0 -27
- package/dist/components/DrawingTool/lib/SketchLayer.js +0 -59
- package/dist/components/DrawingTool/lib/SketchLayer.js.map +0 -1
- package/dist/components/DrawingTool/lib/SketchModel.d.ts +0 -65
- package/dist/components/DrawingTool/lib/SketchModel.js +0 -137
- package/dist/components/DrawingTool/lib/SketchModel.js.map +0 -1
- package/dist/components/DrawingTool/lib/SketchStrokeModel.d.ts +0 -33
- package/dist/components/DrawingTool/lib/SketchStrokeModel.js +0 -48
- package/dist/components/DrawingTool/lib/SketchStrokeModel.js.map +0 -1
- package/dist/components/DrawingTool/lib/createInteractionSurface.d.ts +0 -16
- package/dist/components/DrawingTool/lib/createInteractionSurface.js +0 -56
- package/dist/components/DrawingTool/lib/createInteractionSurface.js.map +0 -1
- package/dist/components/DrawingTool/lib/trace.d.ts +0 -3
- package/dist/components/DrawingTool/lib/trace.js +0 -24
- package/dist/components/DrawingTool/lib/trace.js.map +0 -1
- package/dist/components/DrawingTool/lib/trimCanvas.d.ts +0 -2
- package/dist/components/DrawingTool/lib/trimCanvas.js +0 -42
- package/dist/components/DrawingTool/lib/trimCanvas.js.map +0 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule) return e;
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return e[k];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n['default'] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
var _defs, _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11, _path12, _path13, _path14, _path15, _path16, _path17, _path18, _path19, _path20, _path21, _path22, _path23, _path24, _path25, _path26, _path27, _path28, _path29, _path30, _path31, _path32;
|
|
28
|
+
|
|
29
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
30
|
+
|
|
31
|
+
function SvgGames(props) {
|
|
32
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
33
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34
|
+
width: 120,
|
|
35
|
+
height: 120,
|
|
36
|
+
viewBox: "0 0 120 120"
|
|
37
|
+
}, props), _defs || (_defs = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("style", null, ".games_svg__c{fill:#222c3f}.games_svg__d{fill:#1d1e28}.games_svg__e{fill:#4c6284}.games_svg__f{fill:#364760}.games_svg__g{fill:#00c1bc}.games_svg__h{fill:#0ff}.games_svg__i{fill:#94333a}.games_svg__j{fill:#b24352}"))), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
|
|
38
|
+
d: "M40.343 9.126s-11.546 2.309-23.349 18.73S-2.634 64.932 5.063 70.449s21.168-3.592 25.273-11.033a9.87 9.87 0 007.954 6.414c6.158.77 12.572-2.95 12.572-2.95l5.389 2.18s-1.54 12.7 11.161 13.471l5.26.256s1.924-.256 1.539 3.977-.77 23.606 11.674 26.685 18.6-17.191 21.681-26.813 18.474-40.026-1.154-48.75c0 0-6.286-2.822-11.675-2.181s-7.569 3.079-10.648 2.053-17.19-6.8-17.19-6.8a4.408 4.408 0 01-2.823-3.592c-.385-2.822-1.026-5.131-4.618-7.44S46.629 8.1 40.343 9.126z",
|
|
39
|
+
opacity: 0.3
|
|
40
|
+
})), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
41
|
+
d: "M40.343 4.126s-11.546 2.309-23.349 18.73S-2.634 59.932 5.063 65.449s21.168-3.592 25.273-11.033a9.87 9.87 0 007.954 6.414c6.158.77 12.572-2.95 12.572-2.95l5.389 2.18s-1.54 12.7 11.161 13.471l5.26.256s1.924-.256 1.539 3.977-.77 23.606 11.674 26.685 18.6-17.191 21.681-26.813 18.474-40.026-1.154-48.75c0 0-6.286-2.822-11.675-2.181s-7.569 3.079-10.648 2.053-17.19-6.8-17.19-6.8a4.408 4.408 0 01-2.823-3.592c-.385-2.822-1.026-5.131-4.618-7.44S46.629 3.1 40.343 4.126z",
|
|
42
|
+
fill: "#333e59"
|
|
43
|
+
})), _path3 || (_path3 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
44
|
+
className: "games_svg__c",
|
|
45
|
+
d: "M78.701 65.004a12.687 12.687 0 01-4.109 2.112c-6.158 1.925-12.444 0-15.266-2.822s-3.849-8.595-3.849-8.595-4.1-1.925-5.773-2.566-2.053-.128-2.053-.128a20.849 20.849 0 01-9.75 1.026c-5.9-.642-6.286-2.694-8.724-4.875s-2.565-.642-3.848 2.694-6.8 9.622-10.52 12.572a15.573 15.573 0 01-5.123 2.672c7.614.643 17.279-6.576 20.646-12.678a9.87 9.87 0 007.954 6.414c6.158.77 12.572-2.95 12.572-2.95l5.389 2.18s-1.54 12.7 11.161 13.471l5.26.256s1.924-.256 1.539 3.977a47.232 47.232 0 00.559 11.556 1.708 1.708 0 00.467-1.421c-.256-2.052 1.155-8.082.9-8.98a23.113 23.113 0 01.129-7.826 48.835 48.835 0 012.954-5.835c.309-.548.047-.691-.515-.254zM66.501 21.787a4.4 4.4 0 01-2.423-3.421c-.385-2.822-1.026-5.131-4.618-7.44a9.952 9.952 0 011.668 4.361c.123 2.13-.227 4.138 5.373 6.5z"
|
|
46
|
+
})), _path4 || (_path4 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
47
|
+
className: "games_svg__d",
|
|
48
|
+
d: "M23.591 21.75s-.216 13.157 15.317 12.765c16.878-.425 15.034-13.9 15.034-13.9-.283-4.4-4.255-11.488-15.176-11.488-12.907.001-15.175 9.503-15.175 12.623z"
|
|
49
|
+
})), _path5 || (_path5 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
50
|
+
className: "games_svg__e",
|
|
51
|
+
d: "M22.801 20.175s-.215 13.157 15.318 12.765c16.878-.425 15.034-13.9 15.034-13.9-.284-4.4-4.255-11.489-15.176-11.489-12.905.001-15.176 9.504-15.176 12.624z"
|
|
52
|
+
})), _path6 || (_path6 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
53
|
+
className: "games_svg__d",
|
|
54
|
+
d: "M78.328 45.692s-.233 14.229 16.567 13.806c18.254-.461 16.26-15.034 16.26-15.034-.307-4.755-4.6-12.425-16.414-12.425-13.96 0-16.413 10.278-16.413 13.653z"
|
|
55
|
+
})), _path7 || (_path7 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
56
|
+
className: "games_svg__e",
|
|
57
|
+
d: "M77.54 44.117s-.233 14.229 16.567 13.8c18.255-.46 16.26-15.033 16.26-15.033-.306-4.755-4.6-12.425-16.413-12.425-13.96.008-16.414 10.283-16.414 13.658z"
|
|
58
|
+
})), _path8 || (_path8 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
59
|
+
className: "games_svg__d",
|
|
60
|
+
d: "M29.173 43.455s-.162 9.88 11.5 9.586c12.676-.32 11.291-10.438 11.291-10.438-.213-3.3-3.2-8.628-11.4-8.628-9.687 0-11.391 7.136-11.391 9.48z"
|
|
61
|
+
})), _path9 || (_path9 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
62
|
+
className: "games_svg__e",
|
|
63
|
+
d: "M28.385 42.667s-.161 9.88 11.5 9.586c12.675-.319 11.29-10.438 11.29-10.438-.213-3.3-3.2-8.628-11.4-8.628-9.686 0-11.39 7.137-11.39 9.48z"
|
|
64
|
+
})), _path10 || (_path10 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
65
|
+
className: "games_svg__f",
|
|
66
|
+
d: "M29.627 20.993s-.13 7.933 9.237 7.7c10.177-.256 9.066-8.381 9.066-8.381-.172-2.652-2.566-6.928-9.152-6.928-7.783-.003-9.151 5.727-9.151 7.609z"
|
|
67
|
+
})), _path11 || (_path11 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
68
|
+
className: "games_svg__g",
|
|
69
|
+
d: "M28.839 20.205s-.13 7.934 9.237 7.7c10.178-.257 9.066-8.382 9.066-8.382-.171-2.651-2.566-6.928-9.151-6.928-7.784-.002-9.152 5.729-9.152 7.61z"
|
|
70
|
+
})), _path12 || (_path12 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
71
|
+
className: "games_svg__h",
|
|
72
|
+
d: "M28.839 18.63s-.13 7.934 9.237 7.7c10.178-.256 9.066-8.381 9.066-8.381-.171-2.651-2.566-6.928-9.151-6.928-7.784-.003-9.152 5.727-9.152 7.609z"
|
|
73
|
+
})), _path13 || (_path13 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
74
|
+
className: "games_svg__f",
|
|
75
|
+
d: "M83.851 41.717s-.053 3.234 3.766 3.138c4.149-.1 3.7-3.417 3.7-3.417-.07-1.081-1.046-2.824-3.731-2.824-3.178 0-3.735 2.336-3.735 3.103zM95.401 39.237s-.053 3.234 3.766 3.138c4.149-.1 3.7-3.417 3.7-3.417-.07-1.081-1.046-2.825-3.731-2.825-3.182 0-3.735 2.334-3.735 3.104zM86.16 51.039s-.053 3.235 3.766 3.139c4.149-.1 3.7-3.418 3.7-3.418-.07-1.081-1.046-2.824-3.731-2.824-3.177 0-3.735 2.336-3.735 3.103zM97.701 48.559s-.053 3.235 3.766 3.138c4.149-.1 3.7-3.417 3.7-3.417-.07-1.081-1.046-2.824-3.731-2.824-3.172 0-3.735 2.336-3.735 3.103z"
|
|
76
|
+
})), _path14 || (_path14 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
77
|
+
className: "games_svg__g",
|
|
78
|
+
d: "M83.063 40.929s-.053 3.235 3.766 3.139c4.149-.1 3.7-3.418 3.7-3.418-.07-1.08-1.046-2.824-3.731-2.824-3.177 0-3.735 2.341-3.735 3.103z"
|
|
79
|
+
})), _path15 || (_path15 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
80
|
+
className: "games_svg__i",
|
|
81
|
+
d: "M94.609 38.449s-.053 3.235 3.766 3.138c4.149-.1 3.7-3.417 3.7-3.417-.07-1.081-1.046-2.824-3.731-2.824-3.177 0-3.735 2.336-3.735 3.103zM85.372 50.252s-.053 3.234 3.766 3.138c4.15-.1 3.7-3.417 3.7-3.417-.069-1.081-1.046-2.825-3.731-2.825-3.177 0-3.735 2.337-3.735 3.104z"
|
|
82
|
+
})), _path16 || (_path16 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
83
|
+
className: "games_svg__g",
|
|
84
|
+
d: "M96.918 47.772s-.053 3.234 3.766 3.138c4.15-.105 3.7-3.417 3.7-3.417-.069-1.081-1.046-2.825-3.731-2.825-3.177-.001-3.735 2.336-3.735 3.104z"
|
|
85
|
+
})), _path17 || (_path17 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
86
|
+
className: "games_svg__h",
|
|
87
|
+
d: "M83.063 39.354s-.053 3.235 3.766 3.138c4.149-.1 3.7-3.417 3.7-3.417-.07-1.081-1.046-2.824-3.731-2.824-3.177 0-3.735 2.336-3.735 3.103z"
|
|
88
|
+
})), _path18 || (_path18 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
89
|
+
className: "games_svg__j",
|
|
90
|
+
d: "M94.609 36.874s-.053 3.234 3.766 3.138c4.149-.1 3.7-3.417 3.7-3.417-.07-1.081-1.046-2.824-3.731-2.824-3.177-.004-3.735 2.336-3.735 3.103zM85.372 48.677s-.053 3.234 3.766 3.138c4.15-.105 3.7-3.417 3.7-3.417-.069-1.081-1.046-2.825-3.731-2.825-3.177 0-3.735 2.337-3.735 3.104z"
|
|
91
|
+
})), _path19 || (_path19 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
92
|
+
className: "games_svg__h",
|
|
93
|
+
d: "M96.918 46.196s-.053 3.235 3.766 3.139c4.15-.1 3.7-3.418 3.7-3.418-.069-1.08-1.046-2.824-3.731-2.824-3.177 0-3.735 2.336-3.735 3.103z"
|
|
94
|
+
})), _path20 || (_path20 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
95
|
+
className: "games_svg__f",
|
|
96
|
+
d: "M33.561 45.013s-.1 5.317 6.764 5.159c7.452-.172 6.638-5.617 6.638-5.617-.126-1.777-1.879-4.643-6.7-4.643-5.7 0-6.702 3.84-6.702 5.101z"
|
|
97
|
+
})), _path21 || (_path21 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
98
|
+
className: "games_svg__i",
|
|
99
|
+
d: "M32.774 43.438s-.1 5.317 6.763 5.158c7.452-.171 6.638-5.617 6.638-5.617-.125-1.776-1.879-4.642-6.7-4.642-5.7 0-6.701 3.84-6.701 5.101z"
|
|
100
|
+
})), _path22 || (_path22 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
101
|
+
className: "games_svg__i",
|
|
102
|
+
d: "M32.774 37.653h3.164v6.158h-3.164zM43.037 37.653h3.164v6.158h-3.164z"
|
|
103
|
+
})), _path23 || (_path23 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
104
|
+
className: "games_svg__j",
|
|
105
|
+
d: "M32.774 38.05s-.1 5.317 6.763 5.158c7.452-.172 6.638-5.617 6.638-5.617-.125-1.777-1.879-4.642-6.7-4.642-5.7 0-6.701 3.84-6.701 5.101z"
|
|
106
|
+
})), _path24 || (_path24 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
107
|
+
className: "games_svg__d",
|
|
108
|
+
d: "M58.321 56.441s-.162 10.23 11.507 9.925c12.68-.33 11.295-10.807 11.295-10.807-.213-3.419-3.2-8.933-11.4-8.933-9.698 0-11.402 7.389-11.402 9.815z"
|
|
109
|
+
})), _path25 || (_path25 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
110
|
+
className: "games_svg__e",
|
|
111
|
+
d: "M57.534 55.654s-.162 10.229 11.507 9.925c12.679-.331 11.294-10.812 11.294-10.812-.213-3.418-3.2-8.932-11.4-8.932-9.697.004-11.401 7.393-11.401 9.819z"
|
|
112
|
+
})), _path26 || (_path26 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
113
|
+
className: "games_svg__f",
|
|
114
|
+
d: "M62.711 57.999s-.1 5.5 6.765 5.341c7.455-.178 6.641-5.816 6.641-5.816-.126-1.839-1.88-4.806-6.7-4.806-5.704 0-6.706 3.976-6.706 5.281z"
|
|
115
|
+
})), _path27 || (_path27 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
116
|
+
className: "games_svg__i",
|
|
117
|
+
d: "M61.923 56.424s-.1 5.505 6.766 5.341c7.455-.178 6.64-5.816 6.64-5.816-.125-1.839-1.879-4.807-6.7-4.807-5.704 0-6.706 3.976-6.706 5.282z"
|
|
118
|
+
})), _path28 || (_path28 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
119
|
+
className: "games_svg__i",
|
|
120
|
+
d: "M61.923 50.434h3.166v6.376h-3.166zM72.19 50.434h3.166v6.376H72.19z"
|
|
121
|
+
})), _path29 || (_path29 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
122
|
+
className: "games_svg__j",
|
|
123
|
+
d: "M61.923 50.845s-.1 5.5 6.766 5.341c7.455-.178 6.64-5.815 6.64-5.815-.125-1.84-1.879-4.807-6.7-4.807-5.704.003-6.706 3.976-6.706 5.281z"
|
|
124
|
+
})), _path30 || (_path30 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
125
|
+
d: "M9.435 35.699a3.729 3.729 0 00-1.055 1.584q-1.251 2.565-2.357 5.2a61.534 61.534 0 00-2.4 6.644 19.817 19.817 0 00-1 6.1c.233 6.675 5.613 1.973 6.364-2.12a18.377 18.377 0 00.152-4.026c-.085-2.187-.276-4.374-.181-6.564a15.968 15.968 0 01.408-3.132 23.976 23.976 0 00.93-3.1c.032-.31-.04-.715-.346-.771a.584.584 0 00-.4.108c-.032.02-.074.045-.115.077z",
|
|
126
|
+
fill: "#3e4c66"
|
|
127
|
+
})), _path31 || (_path31 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
128
|
+
className: "games_svg__c",
|
|
129
|
+
d: "M107.566 77.636c1.41-4.4 5.4-13.161 7.427-22.2-.614 1.027-1.081 2.167-1.685 3.183a49.754 49.754 0 01-3.721 5.123 34.8 34.8 0 00-4.023 5.976c-2.031 4.124-2.432 8.832-2.8 13.415l-.748 9.337a112.545 112.545 0 005.55-14.834z"
|
|
130
|
+
})), _path32 || (_path32 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
131
|
+
fill: "none",
|
|
132
|
+
d: "M0 0h120v120H0z"
|
|
133
|
+
})));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
module.exports = SvgGames;
|
|
137
|
+
//# sourceMappingURL=games.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"games.svg.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -48,6 +48,7 @@ var facebook = require('../../assets/icons/facebook.svg.js');
|
|
|
48
48
|
var filter = require('../../assets/icons/filter.svg.js');
|
|
49
49
|
var flag = require('../../assets/icons/flag.svg.js');
|
|
50
50
|
var forYou = require('../../assets/icons/for-you.svg.js');
|
|
51
|
+
var games = require('../../assets/icons/games.svg.js');
|
|
51
52
|
var gift = require('../../assets/icons/gift.svg.js');
|
|
52
53
|
var goals = require('../../assets/icons/goals.svg.js');
|
|
53
54
|
var heart = require('../../assets/icons/heart.svg.js');
|
|
@@ -152,6 +153,7 @@ var ICONS = {
|
|
|
152
153
|
'eye': React__default['default'].createElement(eye, null),
|
|
153
154
|
'filter': React__default['default'].createElement(filter, null),
|
|
154
155
|
'for-you': React__default['default'].createElement(forYou, null),
|
|
156
|
+
'games': React__default['default'].createElement(games, null),
|
|
155
157
|
'goals': React__default['default'].createElement(goals, null),
|
|
156
158
|
'heart': React__default['default'].createElement(heart, null),
|
|
157
159
|
'help': React__default['default'].createElement(help, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icons.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface Props {
|
|
3
|
-
prompt: string;
|
|
4
|
-
showHeader: boolean;
|
|
5
|
-
onBack: () => void;
|
|
6
|
-
onSave: () => void;
|
|
7
|
-
showPaperBackground?: boolean;
|
|
8
|
-
disableCameraUpload?: boolean;
|
|
9
|
-
minImageUploadSize?: number;
|
|
10
|
-
disableAutoCache?: boolean;
|
|
11
|
-
openUploadPopupOnStart?: boolean;
|
|
12
|
-
cacheKey?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare type Orientation = 'LANDSCAPE' | 'PORTRAIT';
|
|
15
|
-
declare const Drawing: {
|
|
16
|
-
(props: Props): JSX.Element;
|
|
17
|
-
defaultProps: {
|
|
18
|
-
prompt: string;
|
|
19
|
-
showHeader: boolean;
|
|
20
|
-
onBack: () => void;
|
|
21
|
-
onSave: () => void;
|
|
22
|
-
showPaperBackground: boolean;
|
|
23
|
-
disableCameraUpload: boolean;
|
|
24
|
-
disableAutoCache: boolean;
|
|
25
|
-
cacheKey: string;
|
|
26
|
-
openUploadPopupOnStart: boolean;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export default Drawing;
|
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib = require('tslib');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var polished = require('polished');
|
|
6
|
-
var Moveable = require('react-moveable');
|
|
7
|
-
var MoveableHelper = require('moveable-helper');
|
|
8
|
-
var ReactTooltip = require('react-tooltip');
|
|
9
|
-
var DrawingTool_styles = require('./DrawingTool.styles.js');
|
|
10
|
-
var useDebounce = require('../../hooks/useDebounce.js');
|
|
11
|
-
var useElementSize = require('../../hooks/useElementSize.js');
|
|
12
|
-
var Button = require('../Button/Button.js');
|
|
13
|
-
var Icon = require('../Icon/Icon.js');
|
|
14
|
-
var IconButton = require('../IconButton/IconButton.js');
|
|
15
|
-
var ColourToolbar = require('./components/ColourToolbar/ColourToolbar.js');
|
|
16
|
-
var Modal = require('../Modal/Modal.js');
|
|
17
|
-
var DrawingToolProvider = require('./DrawingToolProvider.js');
|
|
18
|
-
var FileInput = require('./components/FileInput/FileInput.js');
|
|
19
|
-
var index = require('./components/Placeable/index.js');
|
|
20
|
-
var OpacityToggle = require('./components/OpacityToggle/OpacityToggle.js');
|
|
21
|
-
var Header = require('./components/Header/Header.js');
|
|
22
|
-
|
|
23
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
|
-
|
|
25
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
-
var Moveable__default = /*#__PURE__*/_interopDefaultLegacy(Moveable);
|
|
27
|
-
var MoveableHelper__default = /*#__PURE__*/_interopDefaultLegacy(MoveableHelper);
|
|
28
|
-
var ReactTooltip__default = /*#__PURE__*/_interopDefaultLegacy(ReactTooltip);
|
|
29
|
-
|
|
30
|
-
var Drawing = function (props) {
|
|
31
|
-
var _a, _b;
|
|
32
|
-
var containerRef = React.useRef(null);
|
|
33
|
-
var sketchOuterRef = React.useRef(null);
|
|
34
|
-
var sketchInnerRef = React.useRef(null);
|
|
35
|
-
var sketchCutInnerRef = React.useRef(null);
|
|
36
|
-
var imageToPlaceContainerRef = React.useRef(null);
|
|
37
|
-
var moveableRef = React.useRef(null);
|
|
38
|
-
var helper = React.useState(function () {
|
|
39
|
-
return new MoveableHelper__default['default']();
|
|
40
|
-
})[0];
|
|
41
|
-
var _c = useElementSize(containerRef), containerWidth = _c.width, containerHeight = _c.height;
|
|
42
|
-
var debouncedContainerWidth = useDebounce(containerWidth, 1000);
|
|
43
|
-
var debouncedContainerHeight = useDebounce(containerHeight, 1000);
|
|
44
|
-
var _d = React.useState('LANDSCAPE'), orientation = _d[0], setOrientation = _d[1];
|
|
45
|
-
var _e = React.useState(1280), maxContainerWidth = _e[0], setMaxContainerWidth = _e[1];
|
|
46
|
-
var _f = React.useState(960), maxContainerHeight = _f[0], setMaxContainerHeight = _f[1];
|
|
47
|
-
var _g = React.useState(50), buttonSize = _g[0], setButtonSize = _g[1];
|
|
48
|
-
var _h = React.useState(false), isMobile = _h[0], setIsMobile = _h[1];
|
|
49
|
-
var _j = React.useState(true), resizing = _j[0], setResizing = _j[1];
|
|
50
|
-
var _k = React.useState(false), showRestartConfirmModal = _k[0], setShowRestartConfirmModal = _k[1];
|
|
51
|
-
var _l = React.useState(props.openUploadPopupOnStart), showFileInput = _l[0], setShowFileInput = _l[1];
|
|
52
|
-
var _m = React.useState(), imageToCut = _m[0], setImageToCut = _m[1];
|
|
53
|
-
var _o = React.useState(true), showCutTutorial = _o[0], setShowCutTutorial = _o[1];
|
|
54
|
-
var _p = React.useState(false), showSaveCutAction = _p[0], setShowSaveCutAction = _p[1];
|
|
55
|
-
var _q = React.useState(), imageToPlace = _q[0], setImageToPlace = _q[1];
|
|
56
|
-
var _r = DrawingToolProvider.useDrawingTool(), initSketch = _r.initSketch, initSketchCut = _r.initSketchCut, exportSketchCut = _r.exportSketchCut, currentColour = _r.currentColour, brushSize = _r.brushSize, setBrushSize = _r.setBrushSize, brushType = _r.brushType, setBrushType = _r.setBrushType, undo = _r.undo, redo = _r.redo, restart = _r.restart, setCacheKey = _r.setCacheKey, setAutoCache = _r.setAutoCache, resetCut = _r.resetCut, mergeImage = _r.mergeImage, setToolMode = _r.setToolMode;
|
|
57
|
-
React.useEffect(function () {
|
|
58
|
-
if (typeof props.disableAutoCache === 'boolean') {
|
|
59
|
-
setAutoCache(!props.disableAutoCache);
|
|
60
|
-
}
|
|
61
|
-
if (props.cacheKey)
|
|
62
|
-
setCacheKey(props.cacheKey);
|
|
63
|
-
}, []);
|
|
64
|
-
React.useLayoutEffect(function () {
|
|
65
|
-
if (debouncedContainerHeight !== containerHeight || debouncedContainerWidth !== containerWidth) {
|
|
66
|
-
setResizing(true);
|
|
67
|
-
}
|
|
68
|
-
else if (containerWidth > 0 && containerHeight > 0) {
|
|
69
|
-
setResizing(false);
|
|
70
|
-
if (containerWidth < 768) {
|
|
71
|
-
setIsMobile(true);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
setIsMobile(false);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}, [debouncedContainerWidth, debouncedContainerHeight, containerWidth, containerHeight]);
|
|
78
|
-
React.useLayoutEffect(function () {
|
|
79
|
-
setMaxContainerHeight(containerWidth * 1.4);
|
|
80
|
-
setMaxContainerWidth(containerHeight * 1.4);
|
|
81
|
-
if (containerWidth < containerHeight && containerWidth < 1024) {
|
|
82
|
-
setButtonSize(Math.floor(containerWidth / 11) * 0.85);
|
|
83
|
-
setOrientation('PORTRAIT');
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
if (containerHeight < 420) {
|
|
87
|
-
setButtonSize(Math.floor(containerHeight / 13) * 0.85);
|
|
88
|
-
}
|
|
89
|
-
else if (containerHeight < 1024) {
|
|
90
|
-
setButtonSize(Math.floor(containerHeight / 12) * 0.85);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
setButtonSize(Math.floor(containerHeight / 11) * 0.85);
|
|
94
|
-
}
|
|
95
|
-
setOrientation('LANDSCAPE');
|
|
96
|
-
}
|
|
97
|
-
}, [containerWidth, containerHeight]);
|
|
98
|
-
React.useEffect(function () {
|
|
99
|
-
if (!imageToCut && !resizing && sketchInnerRef.current) {
|
|
100
|
-
initSketch(sketchInnerRef.current);
|
|
101
|
-
}
|
|
102
|
-
}, [resizing, sketchInnerRef, imageToCut]);
|
|
103
|
-
React.useEffect(function () {
|
|
104
|
-
if (!resizing && sketchCutInnerRef.current && imageToCut) {
|
|
105
|
-
initSketchCut(sketchCutInnerRef.current, imageToCut, function () {
|
|
106
|
-
setShowSaveCutAction(true);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}, [resizing, sketchCutInnerRef, imageToCut]);
|
|
110
|
-
var onClickRestart = function () {
|
|
111
|
-
setShowRestartConfirmModal(true);
|
|
112
|
-
};
|
|
113
|
-
var onClickCamera = function () {
|
|
114
|
-
setShowFileInput(true);
|
|
115
|
-
};
|
|
116
|
-
var onImageUploaded = function (image) {
|
|
117
|
-
setShowFileInput(false);
|
|
118
|
-
setImageToCut(image);
|
|
119
|
-
setToolMode("CUT");
|
|
120
|
-
};
|
|
121
|
-
var strokeBrushColour = polished.getLuminance(currentColour.hex) > 0.05 ? polished.darken(0.15, currentColour.hex) : polished.lighten(0.1, currentColour.hex);
|
|
122
|
-
var deselectedButtonColourProps = {
|
|
123
|
-
theme: 'white'
|
|
124
|
-
};
|
|
125
|
-
var selectedButtonColourProps = {
|
|
126
|
-
backgroundColor: currentColour.hex,
|
|
127
|
-
strokeColor: strokeBrushColour,
|
|
128
|
-
dropShadowColor: 'rgba(0,0,0,.3)',
|
|
129
|
-
shadowColor: 'rgba(0,0,0,.5)'
|
|
130
|
-
};
|
|
131
|
-
var eraserBrushColourProps = (brushType === 'eraser' ? selectedButtonColourProps : deselectedButtonColourProps);
|
|
132
|
-
var fillBrushColourProps = (brushType === 'fill' ? selectedButtonColourProps : deselectedButtonColourProps);
|
|
133
|
-
var lineBrushColourProps = (brushType === 'line' ? selectedButtonColourProps : deselectedButtonColourProps);
|
|
134
|
-
var smallLineColourProps = (brushSize === DrawingToolProvider.BrushSize.small ? selectedButtonColourProps : deselectedButtonColourProps);
|
|
135
|
-
var mediumLineColourProps = (brushSize === DrawingToolProvider.BrushSize.medium ? selectedButtonColourProps : deselectedButtonColourProps);
|
|
136
|
-
var largeLineColourProps = (brushSize === DrawingToolProvider.BrushSize.large ? selectedButtonColourProps : deselectedButtonColourProps);
|
|
137
|
-
var sketchStyles;
|
|
138
|
-
if (!resizing && sketchOuterRef && sketchOuterRef.current) {
|
|
139
|
-
sketchStyles = {
|
|
140
|
-
width: sketchOuterRef.current.offsetWidth + "px",
|
|
141
|
-
height: sketchOuterRef.current.offsetHeight + "px",
|
|
142
|
-
position: 'absolute',
|
|
143
|
-
top: '0px',
|
|
144
|
-
left: '0px'
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
var disableToolbars = (showFileInput || showRestartConfirmModal || imageToCut || imageToPlace);
|
|
148
|
-
var inSketchActions = [];
|
|
149
|
-
if (showSaveCutAction) {
|
|
150
|
-
inSketchActions.push({
|
|
151
|
-
key: 'retry-cut',
|
|
152
|
-
component: React__default['default'].createElement(IconButton, { icon: React__default['default'].createElement(Icon, { name: "drawing-tool-undo", fill: "white" }), theme: 'orange', size: isMobile ? "small" : "regular", onClick: function () {
|
|
153
|
-
setShowSaveCutAction(false);
|
|
154
|
-
setShowCutTutorial(true);
|
|
155
|
-
resetCut();
|
|
156
|
-
} }, "Retry")
|
|
157
|
-
}, {
|
|
158
|
-
key: 'save-cut',
|
|
159
|
-
component: React__default['default'].createElement(IconButton, { icon: React__default['default'].createElement(Icon, { name: "tick" }), theme: 'confirm', size: isMobile ? "small" : "regular", onClick: function () {
|
|
160
|
-
setShowSaveCutAction(false);
|
|
161
|
-
setImageToCut(undefined);
|
|
162
|
-
var newImage = new Image;
|
|
163
|
-
newImage.onload = function () {
|
|
164
|
-
setImageToPlace(newImage);
|
|
165
|
-
setToolMode('PLACE');
|
|
166
|
-
};
|
|
167
|
-
newImage.src = exportSketchCut();
|
|
168
|
-
} }, "Save")
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
else if (imageToPlace) {
|
|
172
|
-
inSketchActions.push({
|
|
173
|
-
key: 'cancel-place',
|
|
174
|
-
component: React__default['default'].createElement(IconButton, { icon: React__default['default'].createElement(Icon, { name: "close" }), theme: 'red', size: isMobile ? "small" : "regular", onClick: function () {
|
|
175
|
-
setImageToPlace(undefined);
|
|
176
|
-
setToolMode('DRAW');
|
|
177
|
-
} }, "Cancel")
|
|
178
|
-
}, {
|
|
179
|
-
key: 'save-place',
|
|
180
|
-
component: React__default['default'].createElement(IconButton, { icon: React__default['default'].createElement(Icon, { name: "tick" }), theme: 'confirm', size: isMobile ? "small" : "regular", onClick: function () {
|
|
181
|
-
if (moveableRef.current) {
|
|
182
|
-
var rect = moveableRef.current.getRect();
|
|
183
|
-
mergeImage({
|
|
184
|
-
image: imageToPlace,
|
|
185
|
-
x: rect.left,
|
|
186
|
-
y: rect.top,
|
|
187
|
-
origin: rect.origin,
|
|
188
|
-
width: Math.hypot(rect.pos2[0] - rect.pos1[0], rect.pos2[1] - rect.pos1[1]),
|
|
189
|
-
height: Math.hypot(rect.pos3[0] - rect.pos2[0], rect.pos3[1] - rect.pos2[1]),
|
|
190
|
-
rotation: rect.rotation
|
|
191
|
-
});
|
|
192
|
-
setToolMode('DRAW');
|
|
193
|
-
setImageToPlace(undefined);
|
|
194
|
-
}
|
|
195
|
-
} }, "Save")
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
var headerHeight = 90;
|
|
199
|
-
if (containerHeight < 800 || containerWidth < 728)
|
|
200
|
-
headerHeight = 70;
|
|
201
|
-
if (containerHeight < 500 || containerWidth < 500)
|
|
202
|
-
headerHeight = 50;
|
|
203
|
-
return React__default['default'].createElement(DrawingTool_styles.Container, { ref: containerRef, maxWidth: maxContainerWidth, maxHeight: maxContainerHeight },
|
|
204
|
-
props.showHeader && React__default['default'].createElement(Header, { height: headerHeight, prompt: props.prompt, onBack: props.onBack, onSave: props.onSave }),
|
|
205
|
-
React__default['default'].createElement(DrawingTool_styles.Tool, { hasHeader: props.showHeader, headerHeight: headerHeight, orientation: orientation },
|
|
206
|
-
React__default['default'].createElement(ReactTooltip__default['default'], { effect: "solid", delayShow: 750, multiline: true }),
|
|
207
|
-
React__default['default'].createElement(DrawingTool_styles.LeftToolbarContainer, { orientation: orientation, buttonSize: buttonSize, disabled: disableToolbars },
|
|
208
|
-
React__default['default'].createElement(DrawingTool_styles.ButtonGroup, { orientation: orientation, buttonSize: buttonSize },
|
|
209
|
-
React__default['default'].createElement(Button, { "data-tip": "Start again?", height: buttonSize, round: true, theme: 'red', onClick: onClickRestart },
|
|
210
|
-
React__default['default'].createElement(Icon, { name: 'trash-white' }))),
|
|
211
|
-
React__default['default'].createElement(DrawingTool_styles.ButtonGroup, { orientation: orientation, buttonSize: buttonSize },
|
|
212
|
-
React__default['default'].createElement(Button, { height: buttonSize, round: true, theme: "white", onClick: undo },
|
|
213
|
-
React__default['default'].createElement(Icon, { fill: currentColour.hex, name: 'drawing-tool-undo' })),
|
|
214
|
-
React__default['default'].createElement(Button, { height: buttonSize, round: true, theme: "white", onClick: redo },
|
|
215
|
-
React__default['default'].createElement(Icon, { fill: currentColour.hex, name: 'drawing-tool-redo' }))),
|
|
216
|
-
!props.disableCameraUpload && React__default['default'].createElement(DrawingTool_styles.ButtonGroup, { orientation: orientation, buttonSize: buttonSize },
|
|
217
|
-
React__default['default'].createElement(Button, { "data-tip": "Upload a drawing", height: buttonSize, round: true, theme: 'purple', onClick: onClickCamera },
|
|
218
|
-
React__default['default'].createElement(Icon, { name: 'drawing-tool-camera' }))),
|
|
219
|
-
React__default['default'].createElement(DrawingTool_styles.ButtonGroup, { orientation: orientation, buttonSize: buttonSize },
|
|
220
|
-
React__default['default'].createElement(Button, tslib.__assign({ height: buttonSize, round: true }, eraserBrushColourProps, { onClick: function () { return setBrushType('eraser'); } }),
|
|
221
|
-
React__default['default'].createElement(Icon, { "data-tip": "Eraser", fill: brushType === 'eraser' ? 'white' : currentColour.hex, name: 'drawing-tool-eraser' })),
|
|
222
|
-
React__default['default'].createElement(Button, tslib.__assign({ "data-tip": "Fill brush", height: buttonSize, round: true }, fillBrushColourProps, { onClick: function () { return setBrushType('fill'); } }),
|
|
223
|
-
React__default['default'].createElement(Icon, { fill: brushType === 'fill' ? 'white' : currentColour.hex, name: 'drawing-tool-fill-brush' })),
|
|
224
|
-
React__default['default'].createElement(Button, tslib.__assign({ "data-tip": "Line brush", height: buttonSize, round: true }, lineBrushColourProps, { onClick: function () { return setBrushType('line'); } }),
|
|
225
|
-
React__default['default'].createElement(Icon, { fill: brushType === 'line' ? 'white' : currentColour.hex, name: 'drawing-tool-line-brush' })),
|
|
226
|
-
React__default['default'].createElement(Button, tslib.__assign({ height: buttonSize, round: true }, smallLineColourProps, { onClick: function () { return setBrushSize(DrawingToolProvider.BrushSize.small); } }),
|
|
227
|
-
React__default['default'].createElement(Icon, { fill: brushSize === DrawingToolProvider.BrushSize.small ? 'white' : currentColour.hex, name: 'drawing-tool-small-line' })),
|
|
228
|
-
React__default['default'].createElement(Button, tslib.__assign({ height: buttonSize, round: true }, mediumLineColourProps, { onClick: function () { return setBrushSize(DrawingToolProvider.BrushSize.medium); } }),
|
|
229
|
-
React__default['default'].createElement(Icon, { fill: brushSize === DrawingToolProvider.BrushSize.medium ? 'white' : currentColour.hex, name: 'drawing-tool-medium-line' })),
|
|
230
|
-
React__default['default'].createElement(Button, tslib.__assign({ height: buttonSize, round: true }, largeLineColourProps, { onClick: function () { return setBrushSize(DrawingToolProvider.BrushSize.large); } }),
|
|
231
|
-
React__default['default'].createElement(Icon, { fill: brushSize === DrawingToolProvider.BrushSize.large ? 'white' : currentColour.hex, name: 'drawing-tool-large-line' })))),
|
|
232
|
-
React__default['default'].createElement(DrawingTool_styles.SketchContainer, { orientation: orientation, ref: sketchOuterRef },
|
|
233
|
-
props.showPaperBackground && React__default['default'].createElement(DrawingTool_styles.PaperBackground, { cutMode: imageToCut && true }),
|
|
234
|
-
!imageToCut && sketchStyles && React__default['default'].createElement("div", { style: sketchStyles, ref: sketchInnerRef }),
|
|
235
|
-
imageToCut && sketchStyles && React__default['default'].createElement("div", { style: sketchStyles, ref: sketchCutInnerRef }),
|
|
236
|
-
imageToPlace && sketchStyles && (React__default['default'].createElement("div", { style: tslib.__assign(tslib.__assign({}, sketchStyles), { zIndex: '101' }) },
|
|
237
|
-
React__default['default'].createElement(DrawingTool_styles.ImageToPlaceContainer, null,
|
|
238
|
-
React__default['default'].createElement(DrawingTool_styles.ImageToPlace, { ref: imageToPlaceContainerRef, src: imageToPlace.src })),
|
|
239
|
-
React__default['default'].createElement(Moveable__default['default'], { ref: moveableRef, target: imageToPlaceContainerRef, ables: [index], props: {
|
|
240
|
-
placeable: true,
|
|
241
|
-
}, snappable: true, bounds: { left: 0, top: 0, bottom: (_a = sketchOuterRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight, right: (_b = sketchOuterRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth }, draggable: true, scalable: true, keepRatio: true, rotatable: true, onDragStart: helper.onDragStart, onDrag: helper.onDrag, onScaleStart: helper.onScaleStart, onScale: helper.onScale, onRotateStart: helper.onRotateStart, onRotate: helper.onRotate }))),
|
|
242
|
-
inSketchActions.length && (React__default['default'].createElement(DrawingTool_styles.InSketchActions, null, inSketchActions.map(function (action) { return (React__default['default'].createElement(DrawingTool_styles.InSketchAction, { key: action.key }, action.component)); }))),
|
|
243
|
-
imageToCut && showCutTutorial && React__default['default'].createElement(DrawingTool_styles.CutImageTutorial, { onClick: function () { return setShowCutTutorial(false); } },
|
|
244
|
-
React__default['default'].createElement("div", null, "Now cut out your animal: Click, hold and make sure you draw around it."),
|
|
245
|
-
React__default['default'].createElement("img", { alt: "crop example", src: "https://cdn.nightzookeeper.com/nzk-assets/crop-tutorial.png" }),
|
|
246
|
-
React__default['default'].createElement("div", null,
|
|
247
|
-
React__default['default'].createElement(Button, { size: isMobile ? "small" : "regular", theme: "primary" }, "Ok")))),
|
|
248
|
-
React__default['default'].createElement(DrawingTool_styles.RightToolbarContainer, { orientation: orientation, buttonSize: buttonSize, disabled: disableToolbars },
|
|
249
|
-
React__default['default'].createElement(ColourToolbar, { orientation: orientation, size: buttonSize, currentColour: currentColour }),
|
|
250
|
-
React__default['default'].createElement(OpacityToggle, { orientation: orientation, buttonSize: buttonSize }))),
|
|
251
|
-
showRestartConfirmModal && React__default['default'].createElement(DrawingTool_styles.ModalOverlay, null,
|
|
252
|
-
React__default['default'].createElement(Modal, { title: "Are you sure?", actions: [
|
|
253
|
-
React__default['default'].createElement(Button, { key: 'cancel', size: isMobile ? "small" : "regular", theme: "red", onClick: function () {
|
|
254
|
-
setShowRestartConfirmModal(false);
|
|
255
|
-
} }, "No"),
|
|
256
|
-
React__default['default'].createElement(Button, { key: 'confirm', size: isMobile ? "small" : "regular", theme: "confirm", onClick: function () {
|
|
257
|
-
restart();
|
|
258
|
-
setShowRestartConfirmModal(false);
|
|
259
|
-
} }, "Yes"),
|
|
260
|
-
] })),
|
|
261
|
-
showFileInput && React__default['default'].createElement(DrawingTool_styles.ModalOverlay, null,
|
|
262
|
-
React__default['default'].createElement(FileInput, { isMobile: isMobile, dismiss: function () { return setShowFileInput(false); }, onImageUploaded: onImageUploaded, minImageSize: props.minImageUploadSize })));
|
|
263
|
-
};
|
|
264
|
-
Drawing.defaultProps = {
|
|
265
|
-
prompt: 'Draw your Animal',
|
|
266
|
-
showHeader: true,
|
|
267
|
-
onBack: function () { },
|
|
268
|
-
onSave: function () { },
|
|
269
|
-
showPaperBackground: true,
|
|
270
|
-
disableCameraUpload: false,
|
|
271
|
-
disableAutoCache: false,
|
|
272
|
-
cacheKey: 'nzk-sketch-cache',
|
|
273
|
-
openUploadPopupOnStart: false
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
module.exports = Drawing;
|
|
277
|
-
//# sourceMappingURL=DrawingTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DrawingTool.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Story } from "@storybook/react";
|
|
2
|
-
import { Meta } from "@storybook/react/types-6-0";
|
|
3
|
-
import { Props as DrawingToolProps } from "./DrawingTool";
|
|
4
|
-
declare const _default: Meta<import("@storybook/react").Args>;
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const Primary: Story<DrawingToolProps>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Orientation } from './DrawingTool';
|
|
2
|
-
export declare const Container: import("styled-components").StyledComponent<"div", any, {
|
|
3
|
-
maxWidth: number;
|
|
4
|
-
maxHeight: number;
|
|
5
|
-
}, never>;
|
|
6
|
-
export declare const Tool: import("styled-components").StyledComponent<"div", any, {
|
|
7
|
-
orientation: Orientation;
|
|
8
|
-
hasHeader: boolean;
|
|
9
|
-
headerHeight: number;
|
|
10
|
-
}, never>;
|
|
11
|
-
export declare const ButtonGroup: import("styled-components").StyledComponent<"div", any, {
|
|
12
|
-
orientation: Orientation;
|
|
13
|
-
buttonSize: number;
|
|
14
|
-
}, never>;
|
|
15
|
-
export declare const ColourButtonGroup: import("styled-components").StyledComponent<"div", any, {
|
|
16
|
-
orientation: Orientation;
|
|
17
|
-
buttonSize: number;
|
|
18
|
-
}, never>;
|
|
19
|
-
export declare const ScrollableColours: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
-
export declare const LeftToolbarContainer: import("styled-components").StyledComponent<"div", any, {
|
|
21
|
-
orientation: Orientation;
|
|
22
|
-
buttonSize: number;
|
|
23
|
-
disabled: boolean;
|
|
24
|
-
}, never>;
|
|
25
|
-
export declare const RightToolbarContainer: import("styled-components").StyledComponent<"div", any, {
|
|
26
|
-
orientation: Orientation;
|
|
27
|
-
buttonSize: number;
|
|
28
|
-
disabled: boolean;
|
|
29
|
-
}, never>;
|
|
30
|
-
export declare const SketchContainer: import("styled-components").StyledComponent<"div", any, {
|
|
31
|
-
orientation: Orientation;
|
|
32
|
-
}, never>;
|
|
33
|
-
export declare const PaperBackground: import("styled-components").StyledComponent<"div", any, {
|
|
34
|
-
cutMode?: boolean | undefined;
|
|
35
|
-
}, never>;
|
|
36
|
-
export declare const InSketchActions: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
37
|
-
export declare const InSketchAction: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
38
|
-
export declare const ModalOverlay: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
39
|
-
export declare const ImageToPlaceContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
40
|
-
export declare const ImageToPlace: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
41
|
-
export declare const CutImageTutorial: import("styled-components").StyledComponent<"div", any, {}, never>;
|