@yorab/react-paint 0.5.0 → 0.6.0
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/Changelog.md +96 -0
- package/README.md +0 -7
- package/dist/components/App.js +69 -49
- package/dist/components/Canvas.js +7 -7
- package/dist/components/common/Button.js +4 -4
- package/dist/components/common/Loading.js +3 -3
- package/dist/components/common/Modal.js +3 -3
- package/dist/components/common/Panel.js +2 -2
- package/dist/components/common/Snackbar.js +2 -2
- package/dist/components/settings/ColorField.js +4 -4
- package/dist/components/settings/FontFamilyField.js +3 -3
- package/dist/components/settings/LayoutButton.js +1 -1
- package/dist/components/settings/Layouts.js +18 -9
- package/dist/components/settings/LineArrowField.js +4 -4
- package/dist/components/settings/LineTypeField.js +3 -3
- package/dist/components/settings/PointsNumberField.js +1 -1
- package/dist/components/settings/RangeField.js +1 -1
- package/dist/components/settings/SelectField.js +1 -1
- package/dist/components/settings/SettingsBar.js +105 -79
- package/dist/components/settings/ToggleField.js +56 -0
- package/dist/components/toolbox/EditTextBox.js +23 -16
- package/dist/components/toolbox/MenuGroup.js +10 -8
- package/dist/components/toolbox/PictureUrlInput.js +1 -1
- package/dist/components/toolbox/Toolbar.js +12 -4
- package/dist/components/toolbox/ToolbarGroup.js +13 -11
- package/dist/constants/icons.js +6 -2
- package/dist/constants/tools.js +8 -0
- package/dist/hooks/useDoubleClick.js +46 -0
- package/dist/hooks/useDrawableCanvas.js +29 -45
- package/dist/styles.css +52 -51
- package/dist/utils/data.js +27 -5
- package/dist/utils/draw.js +3 -3
- package/dist/utils/file.js +15 -14
- package/dist/utils/selection.js +1 -1
- package/dist/utils/transform.js +23 -10
- package/package.json +1 -1
package/Changelog.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# V0.6.0
|
|
2
|
+
|
|
3
|
+
- Fix text opacity range dancing in edit mode
|
|
4
|
+
- Fix opacity not visually shown in edit mode
|
|
5
|
+
- add delete button in layouts panel and update style
|
|
6
|
+
- update shape selection priority : use layers order, unless an anchor is
|
|
7
|
+
- stored data format updated
|
|
8
|
+
|
|
9
|
+
# V0.5.1
|
|
10
|
+
|
|
11
|
+
- add possibility to update default settings for a tool
|
|
12
|
+
- fix png export not working with url pic
|
|
13
|
+
- fix pictures missing id
|
|
14
|
+
- fix text tool
|
|
15
|
+
- double click for editing text is now working on mobile
|
|
16
|
+
- add bold and italic for text
|
|
17
|
+
|
|
18
|
+
# V0.5.0
|
|
19
|
+
|
|
20
|
+
- Add tool presets feature
|
|
21
|
+
|
|
22
|
+
# V.0.4.2
|
|
23
|
+
|
|
24
|
+
- fix toolgroup not displayed
|
|
25
|
+
- add passive prop to event listener
|
|
26
|
+
|
|
27
|
+
# V.0.4.1
|
|
28
|
+
|
|
29
|
+
- prevent mounting selection canvas when viewer mode
|
|
30
|
+
- prevent drawing selection when not needed
|
|
31
|
+
- Click on toolbar tool group always enable a tool
|
|
32
|
+
- fix input and select options not being impacted by
|
|
33
|
+
- new reponsive for toolbar
|
|
34
|
+
|
|
35
|
+
# V.0.4.0
|
|
36
|
+
|
|
37
|
+
- Add possibility to customize UI from props
|
|
38
|
+
|
|
39
|
+
# V.0.3.1
|
|
40
|
+
|
|
41
|
+
- Add prop to change canvas background color
|
|
42
|
+
- Move some props to options
|
|
43
|
+
- fix Picture shape not being saved and not triggering onDataChanged
|
|
44
|
+
- small picture are upscaled to fit container when imported
|
|
45
|
+
- Add prop to choose to display save/load/export
|
|
46
|
+
|
|
47
|
+
# V.0.3.0 :
|
|
48
|
+
|
|
49
|
+
- prevent picture from url submit to reload page
|
|
50
|
+
- add gridVisible prop and default to false
|
|
51
|
+
- rename withLayouts to layersManipulation and reduce possible values
|
|
52
|
+
- move every options inside options prop
|
|
53
|
+
- remove ajv and any kind of json validation
|
|
54
|
+
- limit snackbar use on success and always log errors
|
|
55
|
+
- fit size and center uploaded picture
|
|
56
|
+
- Add new viewer mode
|
|
57
|
+
- add borders on bars
|
|
58
|
+
- display shape id in layer panel
|
|
59
|
+
- Export : round values to 2 decimal points
|
|
60
|
+
- Export and import : remove temporary values (id) from stored file
|
|
61
|
+
- Clean unknown shape format from imported data
|
|
62
|
+
- Use ref for onDataChanged prop to avoid rerender if callback changes
|
|
63
|
+
- Calculate container size to resize canvas instead of CSS
|
|
64
|
+
- use requestAnimationFrame to improve perf
|
|
65
|
+
- fix TextEdit position and size not working with canvas resized
|
|
66
|
+
- fix anchors area becoming too small after rezsize
|
|
67
|
+
- add MIT license to project
|
|
68
|
+
- other minor fixes
|
|
69
|
+
- minor design improvements
|
|
70
|
+
|
|
71
|
+
# V.0.2.2 :
|
|
72
|
+
|
|
73
|
+
- Migrate to react 18
|
|
74
|
+
- fix Picture type
|
|
75
|
+
- change pen join and cap to round
|
|
76
|
+
- replace loading snackbar with proper loader
|
|
77
|
+
- support for canGrow and canShrink prop
|
|
78
|
+
- rename project
|
|
79
|
+
- release on npm
|
|
80
|
+
|
|
81
|
+
# V.0.2.1 :
|
|
82
|
+
|
|
83
|
+
- better ui for input modal
|
|
84
|
+
- lock functionnality
|
|
85
|
+
- toggle grid
|
|
86
|
+
- layouts panel UI
|
|
87
|
+
|
|
88
|
+
# V.0.2.0 :
|
|
89
|
+
|
|
90
|
+
- fix for scaling brush
|
|
91
|
+
- fix snackbar
|
|
92
|
+
- refonte UI toolbar
|
|
93
|
+
- update examples
|
|
94
|
+
- button with icons
|
|
95
|
+
- mini toolbar to fix
|
|
96
|
+
- provide tool for url only
|
package/README.md
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
# known issues :
|
|
2
2
|
|
|
3
|
-
## To resolve before beta release
|
|
4
|
-
|
|
5
|
-
- Text tool broken since 0.2.2
|
|
6
|
-
- double click not working with touch (fix: fake it counting delay between touch)
|
|
7
|
-
- selected style not saved when changing tool (since presets)
|
|
8
|
-
|
|
9
3
|
## mobile/touch
|
|
10
4
|
|
|
11
5
|
- dnd layout on mobile not working (fix : use dnd lib, or add touch listener to fake dnd, or provide alt UI)
|
|
@@ -15,5 +9,4 @@
|
|
|
15
9
|
- TextEdit cursor overflow MINOR (quick fix : edit on modale ?)
|
|
16
10
|
- TextEdit copy/paste containing html breaks display
|
|
17
11
|
- circle resizing only goes one direction
|
|
18
|
-
- New text component opacity range is dancing
|
|
19
12
|
- adding padding to selection result in wrong intersection calculs
|
package/dist/components/App.js
CHANGED
|
@@ -59,6 +59,8 @@ var _toolbar = require("../utils/toolbar");
|
|
|
59
59
|
|
|
60
60
|
var _tools = require("../constants/tools");
|
|
61
61
|
|
|
62
|
+
var _fp = _interopRequireDefault(require("lodash/fp"));
|
|
63
|
+
|
|
62
64
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
63
65
|
|
|
64
66
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -69,49 +71,49 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
69
71
|
|
|
70
72
|
var StyledApp = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
71
73
|
name: "StyledApp",
|
|
72
|
-
"class": "
|
|
74
|
+
"class": "s1v9piyg",
|
|
73
75
|
vars: {
|
|
74
|
-
"
|
|
76
|
+
"s1v9piyg-0": [function (props) {
|
|
75
77
|
return props.toolbarBackgroundColor;
|
|
76
78
|
}],
|
|
77
|
-
"
|
|
79
|
+
"s1v9piyg-1": [function (props) {
|
|
78
80
|
return props.dividerColor;
|
|
79
81
|
}],
|
|
80
|
-
"
|
|
82
|
+
"s1v9piyg-2": [function (props) {
|
|
81
83
|
return props.fontRadius;
|
|
82
84
|
}, "px"],
|
|
83
|
-
"
|
|
85
|
+
"s1v9piyg-3": [function (props) {
|
|
84
86
|
return props.fontDisabledColor;
|
|
85
87
|
}],
|
|
86
|
-
"
|
|
88
|
+
"s1v9piyg-4": [function (props) {
|
|
87
89
|
return props.fontDisabledBackgroundColor;
|
|
88
90
|
}],
|
|
89
|
-
"
|
|
91
|
+
"s1v9piyg-5": [function (props) {
|
|
90
92
|
return props.fontColor;
|
|
91
93
|
}],
|
|
92
|
-
"
|
|
94
|
+
"s1v9piyg-6": [function (props) {
|
|
93
95
|
return props.fontBackgroundColor;
|
|
94
96
|
}],
|
|
95
|
-
"
|
|
97
|
+
"s1v9piyg-7": [function (props) {
|
|
96
98
|
return props.fontSelectedColor;
|
|
97
99
|
}],
|
|
98
|
-
"
|
|
100
|
+
"s1v9piyg-8": [function (props) {
|
|
99
101
|
return props.fontSelectedBackgroundColor;
|
|
100
102
|
}],
|
|
101
|
-
"
|
|
103
|
+
"s1v9piyg-9": [function (props) {
|
|
102
104
|
return props.fontHoverColor;
|
|
103
105
|
}],
|
|
104
|
-
"
|
|
106
|
+
"s1v9piyg-10": [function (props) {
|
|
105
107
|
return props.fontHoverBackgroundColor;
|
|
106
108
|
}],
|
|
107
|
-
"
|
|
109
|
+
"s1v9piyg-11": [function (props) {
|
|
108
110
|
return props.canvasBackgroundColor;
|
|
109
111
|
}],
|
|
110
|
-
"
|
|
112
|
+
"s1v9piyg-12": [function (_ref) {
|
|
111
113
|
var canvasWidth = _ref.canvasWidth;
|
|
112
114
|
return "min(100%, ".concat(canvasWidth, "px)");
|
|
113
115
|
}],
|
|
114
|
-
"
|
|
116
|
+
"s1v9piyg-13": [function (_ref2) {
|
|
115
117
|
var canvasWidth = _ref2.canvasWidth;
|
|
116
118
|
return canvasWidth;
|
|
117
119
|
}, "px"]
|
|
@@ -119,13 +121,13 @@ var StyledApp = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
|
119
121
|
});
|
|
120
122
|
var StyledRow = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
121
123
|
name: "StyledRow",
|
|
122
|
-
"class": "
|
|
124
|
+
"class": "s6o5tmu",
|
|
123
125
|
vars: {
|
|
124
|
-
"
|
|
126
|
+
"s6o5tmu-1": [function (_ref3) {
|
|
125
127
|
var width = _ref3.width;
|
|
126
128
|
return width;
|
|
127
129
|
}, "px"],
|
|
128
|
-
"
|
|
130
|
+
"s6o5tmu-2": [function (_ref4) {
|
|
129
131
|
var aspectRatio = _ref4.aspectRatio;
|
|
130
132
|
return aspectRatio;
|
|
131
133
|
}]
|
|
@@ -219,7 +221,14 @@ var App = function App(_ref5) {
|
|
|
219
221
|
canvasSize = _useState2[0],
|
|
220
222
|
setCanvasSize = _useState2[1];
|
|
221
223
|
|
|
222
|
-
var
|
|
224
|
+
var _useState3 = (0, _react.useState)((0, _toolbar.sanitizeTools)(availableToolsFromProps, withUploadPicture || withUrlPicture)),
|
|
225
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
226
|
+
availableTools = _useState4[0],
|
|
227
|
+
setAvailableTools = _useState4[1];
|
|
228
|
+
|
|
229
|
+
(0, _react.useEffect)(function () {
|
|
230
|
+
setAvailableTools((0, _toolbar.sanitizeTools)(availableToolsFromProps, withUploadPicture || withUrlPicture));
|
|
231
|
+
}, [availableToolsFromProps, withUploadPicture, withUrlPicture]);
|
|
223
232
|
|
|
224
233
|
var _useComponent = (0, _useComponent2["default"])({
|
|
225
234
|
disabled: disabled,
|
|
@@ -227,42 +236,42 @@ var App = function App(_ref5) {
|
|
|
227
236
|
}),
|
|
228
237
|
isInsideComponent = _useComponent.isInsideComponent;
|
|
229
238
|
|
|
230
|
-
var _useState3 = (0, _react.useState)(false),
|
|
231
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
232
|
-
isLoading = _useState4[0],
|
|
233
|
-
setIsLoading = _useState4[1];
|
|
234
|
-
|
|
235
239
|
var _useState5 = (0, _react.useState)(false),
|
|
236
240
|
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
237
|
-
|
|
238
|
-
|
|
241
|
+
isLoading = _useState6[0],
|
|
242
|
+
setIsLoading = _useState6[1];
|
|
239
243
|
|
|
240
|
-
var _useState7 = (0, _react.useState)(
|
|
244
|
+
var _useState7 = (0, _react.useState)(false),
|
|
241
245
|
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
242
|
-
|
|
243
|
-
|
|
246
|
+
isLayoutPanelShown = _useState8[0],
|
|
247
|
+
setIsLayoutPanelShown = _useState8[1];
|
|
244
248
|
|
|
245
|
-
var _useState9 = (0, _react.useState)(
|
|
249
|
+
var _useState9 = (0, _react.useState)([0, 0]),
|
|
246
250
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
247
|
-
|
|
248
|
-
|
|
251
|
+
canvasOffset = _useState10[0],
|
|
252
|
+
setCanvasOffset = _useState10[1];
|
|
249
253
|
|
|
250
|
-
var _useState11 = (0, _react.useState)(
|
|
254
|
+
var _useState11 = (0, _react.useState)(undefined),
|
|
251
255
|
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
252
|
-
|
|
253
|
-
|
|
256
|
+
canvasOffsetStartPosition = _useState12[0],
|
|
257
|
+
setCanvasOffsetStartPosition = _useState12[1];
|
|
254
258
|
|
|
255
|
-
var _useState13 = (0, _react.useState)(
|
|
256
|
-
mode: _Mode.SelectionModeLib["default"]
|
|
257
|
-
}),
|
|
259
|
+
var _useState13 = (0, _react.useState)(_tools.SELECTION_TOOL),
|
|
258
260
|
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
259
|
-
|
|
260
|
-
|
|
261
|
+
activeTool = _useState14[0],
|
|
262
|
+
setActiveTool = _useState14[1];
|
|
261
263
|
|
|
262
|
-
var _useState15 = (0, _react.useState)(
|
|
264
|
+
var _useState15 = (0, _react.useState)({
|
|
265
|
+
mode: _Mode.SelectionModeLib["default"]
|
|
266
|
+
}),
|
|
263
267
|
_useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
|
|
264
|
-
|
|
265
|
-
|
|
268
|
+
selectionMode = _useState16[0],
|
|
269
|
+
setSelectionMode = _useState16[1];
|
|
270
|
+
|
|
271
|
+
var _useState17 = (0, _react.useState)(gridVisible),
|
|
272
|
+
_useState18 = (0, _slicedToArray2["default"])(_useState17, 2),
|
|
273
|
+
withGrid = _useState18[0],
|
|
274
|
+
setWithGrid = _useState18[1];
|
|
266
275
|
|
|
267
276
|
var _useShapes = (0, _useShapes2["default"])(onDataChanged),
|
|
268
277
|
shapesRef = _useShapes.shapesRef,
|
|
@@ -291,6 +300,16 @@ var App = function App(_ref5) {
|
|
|
291
300
|
setSelectedShape(undefined);
|
|
292
301
|
setActiveTool(tool);
|
|
293
302
|
}, [setSelectedShape]);
|
|
303
|
+
var updateToolSettings = (0, _react.useCallback)(function (toolId, field, value) {
|
|
304
|
+
setAvailableTools(function (availableTools) {
|
|
305
|
+
return availableTools.map(function (tool) {
|
|
306
|
+
return tool.id === toolId ? _fp["default"].set(['settings', field, 'default'], value, tool) : tool;
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
setActiveTool(function (activeTool) {
|
|
310
|
+
return activeTool.id === toolId ? _fp["default"].set(['settings', field, 'default'], value, activeTool) : activeTool;
|
|
311
|
+
});
|
|
312
|
+
}, []);
|
|
294
313
|
var undoAction = (0, _react.useCallback)(function () {
|
|
295
314
|
selectTool(_tools.SELECTION_TOOL);
|
|
296
315
|
backwardShape();
|
|
@@ -343,7 +362,7 @@ var App = function App(_ref5) {
|
|
|
343
362
|
setIsLoading(true);
|
|
344
363
|
|
|
345
364
|
try {
|
|
346
|
-
var content = (0, _file.encodeShapesInString)(shapesRef.current);
|
|
365
|
+
var content = (0, _file.encodeShapesInString)(shapesRef.current, canvasWidth, canvasHeight);
|
|
347
366
|
|
|
348
367
|
if (!content) {
|
|
349
368
|
throw new Error("L'encodage a échoué");
|
|
@@ -363,7 +382,7 @@ var App = function App(_ref5) {
|
|
|
363
382
|
} finally {
|
|
364
383
|
setIsLoading(false);
|
|
365
384
|
}
|
|
366
|
-
}, [shapesRef, addSnackbar]);
|
|
385
|
+
}, [shapesRef, addSnackbar, canvasWidth, canvasHeight]);
|
|
367
386
|
var loadJson = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
368
387
|
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(json) {
|
|
369
388
|
var shapes;
|
|
@@ -372,7 +391,7 @@ var App = function App(_ref5) {
|
|
|
372
391
|
switch (_context.prev = _context.next) {
|
|
373
392
|
case 0:
|
|
374
393
|
_context.next = 2;
|
|
375
|
-
return (0, _file.
|
|
394
|
+
return (0, _file.decodeImportedData)(json);
|
|
376
395
|
|
|
377
396
|
case 2:
|
|
378
397
|
shapes = _context.sent;
|
|
@@ -493,7 +512,7 @@ var App = function App(_ref5) {
|
|
|
493
512
|
return _ref8.apply(this, arguments);
|
|
494
513
|
};
|
|
495
514
|
}(), [addPictureShape, selectShape, addSnackbar, canvasWidth, canvasHeight]);
|
|
496
|
-
var onResized = (0, _react.useCallback)(function (measuredWidth
|
|
515
|
+
var onResized = (0, _react.useCallback)(function (measuredWidth) {
|
|
497
516
|
var scaleRatio = measuredWidth / canvasWidth;
|
|
498
517
|
setCanvasSize({
|
|
499
518
|
width: measuredWidth,
|
|
@@ -531,7 +550,7 @@ var App = function App(_ref5) {
|
|
|
531
550
|
return canvasRef.current ? (0, _file.getCanvasImage)(shapesRef.current, canvasOffset, canvasWidth, canvasHeight, canvasSelectionPadding) : undefined;
|
|
532
551
|
},
|
|
533
552
|
getCurrentData: function getCurrentData() {
|
|
534
|
-
return (0, _data.
|
|
553
|
+
return (0, _data.buildDataToExport)(shapesRef.current, canvasWidth, canvasHeight);
|
|
535
554
|
}
|
|
536
555
|
};
|
|
537
556
|
}, [apiRef, shapesRef, canvasOffset, canvasWidth, canvasHeight, canvasSelectionPadding]);
|
|
@@ -628,7 +647,8 @@ var App = function App(_ref5) {
|
|
|
628
647
|
setIsLayoutPanelShown(function (prev) {
|
|
629
648
|
return !prev;
|
|
630
649
|
});
|
|
631
|
-
}
|
|
650
|
+
},
|
|
651
|
+
updateToolSettings: updateToolSettings
|
|
632
652
|
}), /*#__PURE__*/_react["default"].createElement(_Loading["default"], {
|
|
633
653
|
isLoading: isLoading
|
|
634
654
|
}), /*#__PURE__*/_react["default"].createElement(_Snackbar["default"], {
|
|
@@ -73,21 +73,21 @@ var renderSelectionCanvas = function renderSelectionCanvas(selectionCtx, selecti
|
|
|
73
73
|
|
|
74
74
|
var StyledCanvasBox = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
75
75
|
name: "StyledCanvasBox",
|
|
76
|
-
"class": "
|
|
76
|
+
"class": "s9czb9p"
|
|
77
77
|
});
|
|
78
78
|
var StyledCanvasContainer = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
79
79
|
name: "StyledCanvasContainer",
|
|
80
|
-
"class": "
|
|
80
|
+
"class": "s1538eht"
|
|
81
81
|
});
|
|
82
82
|
var StyledDrawCanvas = /*#__PURE__*/(0, _react2.styled)("canvas")({
|
|
83
83
|
name: "StyledDrawCanvas",
|
|
84
|
-
"class": "
|
|
84
|
+
"class": "s101qxdc"
|
|
85
85
|
});
|
|
86
86
|
var StyledSelectionCanvas = /*#__PURE__*/(0, _react2.styled)("canvas")({
|
|
87
87
|
name: "StyledSelectionCanvas",
|
|
88
|
-
"class": "
|
|
88
|
+
"class": "sa4oq48",
|
|
89
89
|
vars: {
|
|
90
|
-
"
|
|
90
|
+
"sa4oq48-0": [function (_ref) {
|
|
91
91
|
var cursor = _ref.cursor;
|
|
92
92
|
return cursor;
|
|
93
93
|
}]
|
|
@@ -151,7 +151,7 @@ var Canvas = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
151
151
|
hoverMode = _useDrawableCanvas.hoverMode;
|
|
152
152
|
|
|
153
153
|
var updateSelectedShapeText = (0, _react.useCallback)(function (newText) {
|
|
154
|
-
var _drawCanvasRef$curren, _newShape$style;
|
|
154
|
+
var _drawCanvasRef$curren, _newShape$style$fontB, _newShape$style, _newShape$style$fontI, _newShape$style2, _newShape$style3;
|
|
155
155
|
|
|
156
156
|
if ((selectedShape === null || selectedShape === void 0 ? void 0 : selectedShape.type) !== _Shapes.ShapeEnum.text) return;
|
|
157
157
|
var ctx = (_drawCanvasRef$curren = drawCanvasRef.current) === null || _drawCanvasRef$curren === void 0 ? void 0 : _drawCanvasRef$curren.getContext('2d');
|
|
@@ -159,7 +159,7 @@ var Canvas = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, ref) {
|
|
|
159
159
|
|
|
160
160
|
var newShape = _fp["default"].set('value', newText, selectedShape);
|
|
161
161
|
|
|
162
|
-
var newWidth = (0, _transform.calculateTextWidth)(ctx, newShape.value, newShape.fontSize, (_newShape$style = newShape.style) === null || _newShape$style === void 0 ? void 0 : _newShape$style.fontFamily);
|
|
162
|
+
var newWidth = (0, _transform.calculateTextWidth)(ctx, newShape.value, newShape.fontSize, (_newShape$style$fontB = (_newShape$style = newShape.style) === null || _newShape$style === void 0 ? void 0 : _newShape$style.fontBold) !== null && _newShape$style$fontB !== void 0 ? _newShape$style$fontB : false, (_newShape$style$fontI = (_newShape$style2 = newShape.style) === null || _newShape$style2 === void 0 ? void 0 : _newShape$style2.fontItalic) !== null && _newShape$style$fontI !== void 0 ? _newShape$style$fontI : false, (_newShape$style3 = newShape.style) === null || _newShape$style3 === void 0 ? void 0 : _newShape$style3.fontFamily);
|
|
163
163
|
|
|
164
164
|
var resizedShape = _objectSpread(_objectSpread({}, newShape), {}, {
|
|
165
165
|
width: newWidth,
|
|
@@ -19,19 +19,19 @@ var _excluded = ["hidden", "disabled", "selected", "icon", "children", "classNam
|
|
|
19
19
|
_excluded2 = ["hidden", "disabled", "selected", "icon", "children", "type"];
|
|
20
20
|
var StyledButton = /*#__PURE__*/(0, _react2.styled)("button")({
|
|
21
21
|
name: "StyledButton",
|
|
22
|
-
"class": "
|
|
22
|
+
"class": "sq3bzv4"
|
|
23
23
|
});
|
|
24
24
|
var StyledButtonContent = /*#__PURE__*/(0, _react2.styled)("span")({
|
|
25
25
|
name: "StyledButtonContent",
|
|
26
|
-
"class": "
|
|
26
|
+
"class": "sst453j"
|
|
27
27
|
});
|
|
28
28
|
var StyledIcon = /*#__PURE__*/(0, _react2.styled)("span")({
|
|
29
29
|
name: "StyledIcon",
|
|
30
|
-
"class": "
|
|
30
|
+
"class": "s1q5lsc2"
|
|
31
31
|
});
|
|
32
32
|
var StyledChildren = /*#__PURE__*/(0, _react2.styled)("span")({
|
|
33
33
|
name: "StyledChildren",
|
|
34
|
-
"class": "
|
|
34
|
+
"class": "s1dis2j8"
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
var Button = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
@@ -24,15 +24,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
24
24
|
var TRANSITION_DURATION = 300;
|
|
25
25
|
var StyledLoading = /*#__PURE__*/(0, _react.styled)("div")({
|
|
26
26
|
name: "StyledLoading",
|
|
27
|
-
"class": "
|
|
27
|
+
"class": "s9j48u3"
|
|
28
28
|
});
|
|
29
29
|
var StyledLoader = /*#__PURE__*/(0, _react.styled)("div")({
|
|
30
30
|
name: "StyledLoader",
|
|
31
|
-
"class": "
|
|
31
|
+
"class": "s4auclc"
|
|
32
32
|
});
|
|
33
33
|
var StyledShape = /*#__PURE__*/(0, _react.styled)("div")({
|
|
34
34
|
name: "StyledShape",
|
|
35
|
-
"class": "
|
|
35
|
+
"class": "s1l3fbq"
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
var Loading = function Loading(_ref) {
|
|
@@ -15,15 +15,15 @@ var _style = require("../../constants/style");
|
|
|
15
15
|
|
|
16
16
|
var StyledModal = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
17
17
|
name: "StyledModal",
|
|
18
|
-
"class": "
|
|
18
|
+
"class": "s1c8tp02"
|
|
19
19
|
});
|
|
20
20
|
var StyledPanel = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
21
21
|
name: "StyledPanel",
|
|
22
|
-
"class": "
|
|
22
|
+
"class": "svkxpz4"
|
|
23
23
|
});
|
|
24
24
|
var StyledMask = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
25
25
|
name: "StyledMask",
|
|
26
|
-
"class": "
|
|
26
|
+
"class": "s1s9jyyg"
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
var Modal = function Modal(_ref) {
|
|
@@ -19,11 +19,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
19
19
|
|
|
20
20
|
var StyledPanel = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
21
21
|
name: "StyledPanel",
|
|
22
|
-
"class": "
|
|
22
|
+
"class": "s1xzg253"
|
|
23
23
|
});
|
|
24
24
|
var StyledTitle = /*#__PURE__*/(0, _react2.styled)("h3")({
|
|
25
25
|
name: "StyledTitle",
|
|
26
|
-
"class": "
|
|
26
|
+
"class": "s17qj3jh"
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
var Panel = function Panel(_ref) {
|
|
@@ -27,11 +27,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
27
27
|
|
|
28
28
|
var StyledSnackbar = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
29
29
|
name: "StyledSnackbar",
|
|
30
|
-
"class": "
|
|
30
|
+
"class": "s1xssqat"
|
|
31
31
|
});
|
|
32
32
|
var StyledSnackbarContainer = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
33
33
|
name: "StyledSnackbarContainer",
|
|
34
|
-
"class": "
|
|
34
|
+
"class": "s1bgtt22"
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
var Snackbar = function Snackbar(_ref) {
|
|
@@ -29,9 +29,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
|
|
30
30
|
var StyledColor = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
31
31
|
name: "StyledColor",
|
|
32
|
-
"class": "
|
|
32
|
+
"class": "snh2jyk",
|
|
33
33
|
vars: {
|
|
34
|
-
"
|
|
34
|
+
"snh2jyk-0": [function (_ref) {
|
|
35
35
|
var color = _ref.color;
|
|
36
36
|
return color;
|
|
37
37
|
}]
|
|
@@ -39,9 +39,9 @@ var StyledColor = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
|
39
39
|
});
|
|
40
40
|
var StyledCustomColor = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
41
41
|
name: "StyledCustomColor",
|
|
42
|
-
"class": "
|
|
42
|
+
"class": "sfm1cqx",
|
|
43
43
|
vars: {
|
|
44
|
-
"
|
|
44
|
+
"sfm1cqx-0": [function (_ref2) {
|
|
45
45
|
var color = _ref2.color;
|
|
46
46
|
return color;
|
|
47
47
|
}]
|
|
@@ -17,9 +17,9 @@ var _fp = _interopRequireDefault(require("lodash/fp"));
|
|
|
17
17
|
|
|
18
18
|
var StyledOption = /*#__PURE__*/(0, _react2.styled)("span")({
|
|
19
19
|
name: "StyledOption",
|
|
20
|
-
"class": "
|
|
20
|
+
"class": "smpmxx5",
|
|
21
21
|
vars: {
|
|
22
|
-
"
|
|
22
|
+
"smpmxx5-0": [function (_ref) {
|
|
23
23
|
var family = _ref.family;
|
|
24
24
|
return family;
|
|
25
25
|
}]
|
|
@@ -48,7 +48,7 @@ var FontFamilyField = function FontFamilyField(_ref3) {
|
|
|
48
48
|
CustomOption: FontFamilyOption,
|
|
49
49
|
title: "Font",
|
|
50
50
|
disabled: disabled,
|
|
51
|
-
field: "
|
|
51
|
+
field: "fontFamily",
|
|
52
52
|
values: values,
|
|
53
53
|
defaultValue: defaultValue,
|
|
54
54
|
valueChanged: valueChanged
|
|
@@ -17,7 +17,7 @@ var _Button = _interopRequireDefault(require("../common/Button"));
|
|
|
17
17
|
|
|
18
18
|
var StyleToggleLayoutButton = /*#__PURE__*/(0, _react2.styled)(_Button["default"])({
|
|
19
19
|
name: "StyleToggleLayoutButton",
|
|
20
|
-
"class": "
|
|
20
|
+
"class": "sj7hhjx"
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
var LayoutButton = function LayoutButton(_ref) {
|
|
@@ -33,39 +33,43 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
33
33
|
|
|
34
34
|
var StyledLayouts = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
35
35
|
name: "StyledLayouts",
|
|
36
|
-
"class": "
|
|
36
|
+
"class": "su3a8bs"
|
|
37
|
+
});
|
|
38
|
+
var StyledRemoveButton = /*#__PURE__*/(0, _react2.styled)(_Button["default"])({
|
|
39
|
+
name: "StyledRemoveButton",
|
|
40
|
+
"class": "szboplp"
|
|
37
41
|
});
|
|
38
42
|
var StyledLayout = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
39
43
|
name: "StyledLayout",
|
|
40
|
-
"class": "
|
|
44
|
+
"class": "sff5xt"
|
|
41
45
|
});
|
|
42
46
|
var StyledVisibleButton = /*#__PURE__*/(0, _react2.styled)(_Button["default"])({
|
|
43
47
|
name: "StyledVisibleButton",
|
|
44
|
-
"class": "
|
|
48
|
+
"class": "sj3bift"
|
|
45
49
|
});
|
|
46
50
|
var StyledLockedButton = /*#__PURE__*/(0, _react2.styled)(_Button["default"])({
|
|
47
51
|
name: "StyledLockedButton",
|
|
48
|
-
"class": "
|
|
52
|
+
"class": "s10ip0a4"
|
|
49
53
|
});
|
|
50
54
|
var StyledGridButton = /*#__PURE__*/(0, _react2.styled)(_Button["default"])({
|
|
51
55
|
name: "StyledGridButton",
|
|
52
|
-
"class": "
|
|
56
|
+
"class": "s1j9uq9o"
|
|
53
57
|
});
|
|
54
58
|
var StyledSeparator = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
55
59
|
name: "StyledSeparator",
|
|
56
|
-
"class": "
|
|
60
|
+
"class": "s156ddbb"
|
|
57
61
|
});
|
|
58
62
|
var StyledPanelLayouts = /*#__PURE__*/(0, _react2.styled)(_Panel["default"])({
|
|
59
63
|
name: "StyledPanelLayouts",
|
|
60
|
-
"class": "
|
|
64
|
+
"class": "s11gt4hl"
|
|
61
65
|
});
|
|
62
66
|
var StyledScrollingContent = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
63
67
|
name: "StyledScrollingContent",
|
|
64
|
-
"class": "
|
|
68
|
+
"class": "s13cxqhq"
|
|
65
69
|
});
|
|
66
70
|
var StyledPlaceholder = /*#__PURE__*/(0, _react2.styled)("div")({
|
|
67
71
|
name: "StyledPlaceholder",
|
|
68
|
-
"class": "
|
|
72
|
+
"class": "s1idv8qv"
|
|
69
73
|
});
|
|
70
74
|
|
|
71
75
|
var Layout = function Layout(_ref) {
|
|
@@ -147,6 +151,11 @@ var Layout = function Layout(_ref) {
|
|
|
147
151
|
selected: selected,
|
|
148
152
|
onClick: onToggleShapeLock,
|
|
149
153
|
icon: shape.locked ? _icons.lockedIcon : _icons.unlockedIcon
|
|
154
|
+
}), /*#__PURE__*/_react["default"].createElement(StyledRemoveButton, {
|
|
155
|
+
title: "Remove",
|
|
156
|
+
disabled: disabled,
|
|
157
|
+
onClick: onRemove,
|
|
158
|
+
icon: _icons.trashIcon
|
|
150
159
|
}));
|
|
151
160
|
};
|
|
152
161
|
|
|
@@ -17,15 +17,15 @@ var _fp = _interopRequireDefault(require("lodash/fp"));
|
|
|
17
17
|
|
|
18
18
|
var StyledLeftTriangle = /*#__PURE__*/(0, _react2.styled)("span")({
|
|
19
19
|
name: "StyledLeftTriangle",
|
|
20
|
-
"class": "
|
|
20
|
+
"class": "s1xxj4yl"
|
|
21
21
|
});
|
|
22
22
|
var StyledRightTriangle = /*#__PURE__*/(0, _react2.styled)("span")({
|
|
23
23
|
name: "StyledRightTriangle",
|
|
24
|
-
"class": "
|
|
24
|
+
"class": "sbd6jc8"
|
|
25
25
|
});
|
|
26
26
|
var StyledOption = /*#__PURE__*/(0, _react2.styled)("span")({
|
|
27
27
|
name: "StyledOption",
|
|
28
|
-
"class": "
|
|
28
|
+
"class": "scawaat"
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
var LineArrowOption = function LineArrowOption(_ref) {
|
|
@@ -50,7 +50,7 @@ var LineArrowField = function LineArrowField(_ref2) {
|
|
|
50
50
|
CustomOption: LineArrowOption,
|
|
51
51
|
title: "Fl\xE8ches",
|
|
52
52
|
disabled: disabled,
|
|
53
|
-
field: "
|
|
53
|
+
field: "lineArrow",
|
|
54
54
|
values: values,
|
|
55
55
|
defaultValue: defaultValue,
|
|
56
56
|
valueChanged: valueChanged
|