@yorab/react-paint 0.6.0 → 0.6.3
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/components/App.js +64 -49
- package/dist/components/Canvas.js +5 -5
- package/dist/components/common/Button.js +4 -4
- package/dist/components/common/Loading.js +3 -3
- package/dist/components/common/Modal.js +8 -4
- package/dist/components/common/Panel.js +5 -2
- package/dist/components/common/Snackbar.js +2 -2
- package/dist/components/settings/ColorField.js +20 -10
- package/dist/components/settings/FontFamilyField.js +5 -2
- package/dist/components/settings/LayoutButton.js +1 -1
- package/dist/components/settings/Layouts.js +10 -10
- package/dist/components/settings/LineArrowField.js +6 -3
- package/dist/components/settings/LineTypeField.js +6 -3
- package/dist/components/settings/PointsNumberField.js +3 -0
- package/dist/components/settings/RangeField.js +6 -3
- package/dist/components/settings/SelectField.js +11 -4
- package/dist/components/settings/SettingsBar.js +162 -73
- package/dist/components/toolbox/EditTextBox.js +7 -7
- package/dist/components/toolbox/LoadFileTool.js +3 -3
- package/dist/components/toolbox/MenuGroup.js +3 -5
- package/dist/components/toolbox/PictureUrlInput.js +1 -1
- package/dist/components/toolbox/Tool.js +3 -3
- package/dist/components/toolbox/Toolbar.js +5 -8
- package/dist/components/toolbox/ToolbarGroup.js +2 -2
- package/dist/constants/icons.js +19 -9
- package/dist/constants/style.js +1 -1
- package/dist/constants/tools.js +22 -22
- package/dist/styles.css +55 -52
- package/dist/utils/intersect.js +1 -0
- package/package.json +1 -1
- package/Changelog.md +0 -96
package/dist/constants/tools.js
CHANGED
|
@@ -276,7 +276,7 @@ var DEFAULT_SHAPE_PICTURE = {
|
|
|
276
276
|
type: _Shapes.ShapeEnum.picture,
|
|
277
277
|
id: "".concat(PREFIX_ID, "picture"),
|
|
278
278
|
icon: _icons.pictureIcon,
|
|
279
|
-
|
|
279
|
+
label: 'Image',
|
|
280
280
|
settings: SETTINGS_DEFAULT_PICTURE
|
|
281
281
|
};
|
|
282
282
|
exports.DEFAULT_SHAPE_PICTURE = DEFAULT_SHAPE_PICTURE;
|
|
@@ -284,7 +284,7 @@ var DEFAULT_SHAPE_BRUSH = {
|
|
|
284
284
|
type: _Shapes.ShapeEnum.brush,
|
|
285
285
|
id: "".concat(PREFIX_ID, "brush"),
|
|
286
286
|
icon: _icons.brushIcon,
|
|
287
|
-
|
|
287
|
+
label: 'Brosse',
|
|
288
288
|
settings: SETTINGS_DEFAULT_BRUSH
|
|
289
289
|
};
|
|
290
290
|
exports.DEFAULT_SHAPE_BRUSH = DEFAULT_SHAPE_BRUSH;
|
|
@@ -292,7 +292,7 @@ var DEFAULT_SHAPE_LINE = {
|
|
|
292
292
|
type: _Shapes.ShapeEnum.line,
|
|
293
293
|
id: "".concat(PREFIX_ID, "line"),
|
|
294
294
|
icon: _icons.arrowIcon,
|
|
295
|
-
|
|
295
|
+
label: 'Ligne',
|
|
296
296
|
settings: SETTINGS_DEFAULT_LINE
|
|
297
297
|
};
|
|
298
298
|
exports.DEFAULT_SHAPE_LINE = DEFAULT_SHAPE_LINE;
|
|
@@ -300,7 +300,7 @@ var DEFAULT_SHAPE_POLYGON = {
|
|
|
300
300
|
type: _Shapes.ShapeEnum.polygon,
|
|
301
301
|
id: "".concat(PREFIX_ID, "polygon"),
|
|
302
302
|
icon: _icons.polygonIcon,
|
|
303
|
-
|
|
303
|
+
label: 'Polygone',
|
|
304
304
|
settings: SETTINGS_DEFAULT_POLYGON
|
|
305
305
|
};
|
|
306
306
|
exports.DEFAULT_SHAPE_POLYGON = DEFAULT_SHAPE_POLYGON;
|
|
@@ -308,7 +308,7 @@ var DEFAULT_SHAPE_CURVE = {
|
|
|
308
308
|
type: _Shapes.ShapeEnum.curve,
|
|
309
309
|
id: "".concat(PREFIX_ID, "curve"),
|
|
310
310
|
icon: _icons.curveIcon,
|
|
311
|
-
|
|
311
|
+
label: 'Courbe',
|
|
312
312
|
settings: SETTINGS_DEFAULT_CURVE
|
|
313
313
|
};
|
|
314
314
|
exports.DEFAULT_SHAPE_CURVE = DEFAULT_SHAPE_CURVE;
|
|
@@ -317,7 +317,7 @@ var DEFAULT_SHAPE_RECT = {
|
|
|
317
317
|
id: "".concat(PREFIX_ID, "rect"),
|
|
318
318
|
icon: _icons.squareIcon,
|
|
319
319
|
// temporary
|
|
320
|
-
|
|
320
|
+
label: 'Rectangle',
|
|
321
321
|
settings: SETTINGS_DEFAULT_RECT
|
|
322
322
|
};
|
|
323
323
|
exports.DEFAULT_SHAPE_RECT = DEFAULT_SHAPE_RECT;
|
|
@@ -325,7 +325,7 @@ var DEFAULT_SHAPE_SQUARE = {
|
|
|
325
325
|
type: _Shapes.ShapeEnum.square,
|
|
326
326
|
id: "".concat(PREFIX_ID, "square"),
|
|
327
327
|
icon: _icons.squareIcon,
|
|
328
|
-
|
|
328
|
+
label: 'Carré',
|
|
329
329
|
settings: SETTINGS_DEFAULT_SQUARE
|
|
330
330
|
};
|
|
331
331
|
exports.DEFAULT_SHAPE_SQUARE = DEFAULT_SHAPE_SQUARE;
|
|
@@ -333,7 +333,7 @@ var DEFAULT_SHAPE_CIRCLE = {
|
|
|
333
333
|
type: _Shapes.ShapeEnum.circle,
|
|
334
334
|
id: "".concat(PREFIX_ID, "circle"),
|
|
335
335
|
icon: _icons.circleIcon,
|
|
336
|
-
|
|
336
|
+
label: 'Cercle',
|
|
337
337
|
settings: SETTINGS_DEFAULT_CIRCLE
|
|
338
338
|
};
|
|
339
339
|
exports.DEFAULT_SHAPE_CIRCLE = DEFAULT_SHAPE_CIRCLE;
|
|
@@ -342,7 +342,7 @@ var DEFAULT_SHAPE_ELLIPSE = {
|
|
|
342
342
|
id: "".concat(PREFIX_ID, "ellipse"),
|
|
343
343
|
icon: _icons.circleIcon,
|
|
344
344
|
// temporary
|
|
345
|
-
|
|
345
|
+
label: 'Ellipse',
|
|
346
346
|
settings: SETTINGS_DEFAULT_ELLIPSE
|
|
347
347
|
};
|
|
348
348
|
exports.DEFAULT_SHAPE_ELLIPSE = DEFAULT_SHAPE_ELLIPSE;
|
|
@@ -350,7 +350,7 @@ var DEFAULT_SHAPE_TEXT = {
|
|
|
350
350
|
type: _Shapes.ShapeEnum.text,
|
|
351
351
|
id: "".concat(PREFIX_ID, "text"),
|
|
352
352
|
icon: _icons.textIcon,
|
|
353
|
-
|
|
353
|
+
label: 'Texte',
|
|
354
354
|
settings: SETTINGS_DEFAULT_TEXT
|
|
355
355
|
};
|
|
356
356
|
exports.DEFAULT_SHAPE_TEXT = DEFAULT_SHAPE_TEXT;
|
|
@@ -359,70 +359,70 @@ exports.DEFAULT_SHAPE_TOOLS = DEFAULT_SHAPE_TOOLS;
|
|
|
359
359
|
var SELECTION_TOOL = {
|
|
360
360
|
id: "".concat(PREFIX_ID, "selection"),
|
|
361
361
|
type: _tools.ActionsEnum.selection,
|
|
362
|
-
icon: _icons.
|
|
363
|
-
|
|
362
|
+
icon: _icons.cursorIcon,
|
|
363
|
+
label: 'Sélection'
|
|
364
364
|
};
|
|
365
365
|
exports.SELECTION_TOOL = SELECTION_TOOL;
|
|
366
366
|
var UNDO_TOOL = {
|
|
367
367
|
id: "".concat(PREFIX_ID, "undo"),
|
|
368
368
|
type: _tools.ActionsEnum.undo,
|
|
369
369
|
icon: _icons.undoIcon,
|
|
370
|
-
|
|
370
|
+
label: 'Undo'
|
|
371
371
|
};
|
|
372
372
|
exports.UNDO_TOOL = UNDO_TOOL;
|
|
373
373
|
var REDO_TOOL = {
|
|
374
374
|
id: "".concat(PREFIX_ID, "redo"),
|
|
375
375
|
type: _tools.ActionsEnum.redo,
|
|
376
376
|
icon: _icons.redoIcon,
|
|
377
|
-
|
|
377
|
+
label: 'Redo'
|
|
378
378
|
};
|
|
379
379
|
exports.REDO_TOOL = REDO_TOOL;
|
|
380
380
|
var CLEAR_TOOL = {
|
|
381
381
|
id: "".concat(PREFIX_ID, "clear"),
|
|
382
382
|
type: _tools.ActionsEnum.clear,
|
|
383
383
|
icon: _icons.clearIcon,
|
|
384
|
-
|
|
384
|
+
label: 'Clear'
|
|
385
385
|
};
|
|
386
386
|
exports.CLEAR_TOOL = CLEAR_TOOL;
|
|
387
387
|
var EXPORT_TOOL = {
|
|
388
388
|
id: "".concat(PREFIX_ID, "export"),
|
|
389
389
|
type: _tools.ActionsEnum["export"],
|
|
390
390
|
icon: _icons.exportFileIcon,
|
|
391
|
-
|
|
391
|
+
label: 'Export PNG'
|
|
392
392
|
};
|
|
393
393
|
exports.EXPORT_TOOL = EXPORT_TOOL;
|
|
394
394
|
var LOAD_TOOL = {
|
|
395
395
|
id: "".concat(PREFIX_ID, "load"),
|
|
396
396
|
type: _tools.ActionsEnum.loadFile,
|
|
397
397
|
icon: _icons.openFileIcon,
|
|
398
|
-
|
|
398
|
+
label: 'Load project'
|
|
399
399
|
};
|
|
400
400
|
exports.LOAD_TOOL = LOAD_TOOL;
|
|
401
401
|
var SAVE_TOOL = {
|
|
402
402
|
id: "".concat(PREFIX_ID, "save"),
|
|
403
403
|
type: _tools.ActionsEnum.saveFile,
|
|
404
404
|
icon: _icons.saveIcon,
|
|
405
|
-
|
|
405
|
+
label: 'Save project'
|
|
406
406
|
};
|
|
407
407
|
exports.SAVE_TOOL = SAVE_TOOL;
|
|
408
408
|
var MOVE_TOOL = {
|
|
409
409
|
id: "".concat(PREFIX_ID, "move"),
|
|
410
410
|
type: _tools.ActionsEnum.move,
|
|
411
|
-
icon: _icons.
|
|
412
|
-
|
|
411
|
+
icon: _icons.cursorIcon,
|
|
412
|
+
label: 'Move'
|
|
413
413
|
};
|
|
414
414
|
exports.MOVE_TOOL = MOVE_TOOL;
|
|
415
415
|
var UPLOAD_PICTURE_TOOL = {
|
|
416
416
|
id: "".concat(PREFIX_ID, "upload-picture"),
|
|
417
417
|
type: _tools.ActionsEnum.uploadPicture,
|
|
418
418
|
icon: _icons.pictureIcon,
|
|
419
|
-
|
|
419
|
+
label: 'Upload picture'
|
|
420
420
|
};
|
|
421
421
|
exports.UPLOAD_PICTURE_TOOL = UPLOAD_PICTURE_TOOL;
|
|
422
422
|
var ADD_URL_PICTURE_TOOL = {
|
|
423
423
|
id: "".concat(PREFIX_ID, "upload-picture"),
|
|
424
424
|
type: _tools.ActionsEnum.addUrlPicture,
|
|
425
425
|
icon: _icons.pictureIcon,
|
|
426
|
-
|
|
426
|
+
label: 'Add picture from URL'
|
|
427
427
|
};
|
|
428
428
|
exports.ADD_URL_PICTURE_TOOL = ADD_URL_PICTURE_TOOL;
|
package/dist/styles.css
CHANGED
|
@@ -31,55 +31,58 @@
|
|
|
31
31
|
min-width: 0;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.
|
|
35
|
-
.
|
|
36
|
-
.
|
|
37
|
-
.
|
|
38
|
-
.
|
|
39
|
-
.
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.
|
|
46
|
-
.
|
|
47
|
-
.
|
|
48
|
-
.
|
|
49
|
-
.
|
|
50
|
-
.
|
|
51
|
-
.
|
|
52
|
-
.
|
|
53
|
-
.
|
|
54
|
-
.
|
|
55
|
-
.
|
|
56
|
-
.
|
|
57
|
-
.
|
|
58
|
-
.
|
|
59
|
-
.
|
|
60
|
-
.
|
|
61
|
-
.
|
|
62
|
-
.
|
|
63
|
-
.
|
|
64
|
-
.
|
|
65
|
-
.
|
|
66
|
-
.
|
|
67
|
-
.
|
|
68
|
-
.
|
|
69
|
-
.
|
|
70
|
-
.
|
|
71
|
-
.
|
|
72
|
-
.
|
|
73
|
-
.
|
|
74
|
-
.
|
|
75
|
-
.
|
|
76
|
-
.
|
|
77
|
-
.
|
|
78
|
-
.
|
|
79
|
-
.
|
|
80
|
-
.
|
|
81
|
-
.
|
|
82
|
-
.
|
|
83
|
-
.
|
|
84
|
-
.
|
|
85
|
-
.
|
|
34
|
+
.se8ufj4{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(--se8ufj4-0);-ms-transform:var(--se8ufj4-0);transform:var(--se8ufj4-0);color:var(--se8ufj4-1);padding:var(--se8ufj4-2);font-size:var(--se8ufj4-3);line-height:var(--se8ufj4-3);font-family:var(--se8ufj4-5);opacity:var(--se8ufj4-6);}.se8ufj4[data-fontbold='true']{font-weight:bold;}.se8ufj4[data-fontitalic='true']{font-style:italic;}
|
|
35
|
+
.s14cny8z{-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;}
|
|
36
|
+
.s16bxms6{position:relative;background-color:var(--canvas-bg);background-repeat:repeat;background-size:16px;overflow:hidden;display:grid;}.s16bxms6[data-grid='true']{background-image:url("data:image/svg+xml,%3Csvg%20id%3D%22svg%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22400%22%20height%3D%22400%22%20viewBox%3D%220%2C%200%2C%20400%2C400%22%3E%3Cg%20id%3D%22svgg%22%3E%3Cpath%20id%3D%22path0%22%20d%3D%22M204.800%2094.600%20C%20204.800%20188.933%2C204.802%20189.200%2C205.600%20189.200%20C%20206.248%20189.200%2C206.400%20189.467%2C206.400%20190.600%20C%20206.400%20191.733%2C206.552%20192.000%2C207.200%20192.000%20C%20207.733%20192.000%2C208.000%20192.267%2C208.000%20192.800%20C%20208.000%20193.244%2C208.267%20193.600%2C208.600%20193.600%20C%20208.933%20193.600%2C209.200%20193.956%2C209.200%20194.400%20C%20209.200%20195.067%2C209.467%20195.200%2C210.800%20195.200%20C%20212.133%20195.200%2C212.400%20195.333%2C212.400%20196.000%20C%20212.400%20196.798%2C212.667%20196.800%2C306.200%20196.800%20L%20400.000%20196.800%20400.000%2098.400%20L%20400.000%200.000%20302.400%200.000%20L%20204.800%200.000%20204.800%2094.600%20M0.000%20302.400%20L%200.000%20400.000%2098.400%20400.000%20L%20196.800%20400.000%20196.800%20306.200%20C%20196.800%20212.667%2C196.798%20212.400%2C196.000%20212.400%20C%20195.333%20212.400%2C195.200%20212.133%2C195.200%20210.800%20C%20195.200%20209.467%2C195.067%20209.200%2C194.400%20209.200%20C%20193.956%20209.200%2C193.600%20208.933%2C193.600%20208.600%20C%20193.600%20208.267%2C193.244%20208.000%2C192.800%20208.000%20C%20192.267%20208.000%2C192.000%20207.733%2C192.000%20207.200%20C%20192.000%20206.552%2C191.733%20206.400%2C190.600%20206.400%20C%20189.467%20206.400%2C189.200%20206.248%2C189.200%20205.600%20C%20189.200%20204.802%2C188.933%20204.800%2C94.600%20204.800%20L%200.000%20204.800%200.000%20302.400%20%22%20stroke%3D%22none%22%20fill%3D%22%23fcfcfc%22%20fill-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3Cpath%20id%3D%22path1%22%20d%3D%22M0.000%20100.000%20L%200.000%20200.000%2096.800%20200.000%20C%20193.333%20200.000%2C193.600%20199.998%2C193.600%20199.200%20C%20193.600%20198.533%2C193.867%20198.400%2C195.200%20198.400%20C%20196.533%20198.400%2C196.800%20198.267%2C196.800%20197.600%20C%20196.800%20197.067%2C197.067%20196.800%2C197.600%20196.800%20C%20198.267%20196.800%2C198.400%20196.533%2C198.400%20195.200%20C%20198.400%20193.867%2C198.533%20193.600%2C199.200%20193.600%20C%20199.998%20193.600%2C200.000%20193.333%2C200.000%2096.800%20L%20200.000%200.000%20100.000%200.000%20L%200.000%200.000%200.000%20100.000%20M208.000%20202.400%20C%20208.000%20203.067%2C207.733%20203.200%2C206.400%20203.200%20C%20205.067%20203.200%2C204.800%20203.333%2C204.800%20204.000%20C%20204.800%20204.533%2C204.533%20204.800%2C204.000%20204.800%20C%20203.333%20204.800%2C203.200%20205.067%2C203.200%20206.400%20C%20203.200%20207.733%2C203.067%20208.000%2C202.400%20208.000%20C%20201.602%20208.000%2C201.600%20208.267%2C201.600%20304.000%20L%20201.600%20400.000%20300.800%20400.000%20L%20400.000%20400.000%20400.000%20300.800%20L%20400.000%20201.600%20304.000%20201.600%20C%20208.267%20201.600%2C208.000%20201.602%2C208.000%20202.400%20%22%20stroke%3D%22none%22%20fill%3D%22%23e4e4e4%22%20fill-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3Cpath%20id%3D%22path2%22%20d%3D%22%22%20stroke%3D%22none%22%20fill%3D%22%23f4100f0%22%20fill-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3Cpath%20id%3D%22path3%22%20d%3D%22%22%20stroke%3D%22none%22%20fill%3D%22%23f4100f0%22%20fill-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3Cpath%20id%3D%22path4%22%20d%3D%22%22%20stroke%3D%22none%22%20fill%3D%22%23f4100f0%22%20fill-rule%3D%22evenodd%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E");}.s16bxms6[data-grow='true']{width:100%;height:100%;}
|
|
37
|
+
.spzzsat{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-width:100%;touch-action:none;display:block;grid-area:1 / 1;}.spzzsat[data-grow='true']{width:100%;}
|
|
38
|
+
.s1egrskk{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;max-width:100%;touch-action:none;display:block;grid-area:1 / 1;cursor:var(--s1egrskk-0);}.s1egrskk[data-grow='true']{width:100%;}
|
|
39
|
+
.sc6yefj{min-width:32px;height:32px;font-size:14px;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;box-sizing:border-box;-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;background:none;border:none;cursor:pointer;border-radius:var(--font-radius);color:var(--font-color);margin:2px 4px;padding:0;}.sc6yefj[data-selected='1']{color:var(--font-selected-color);background:var(--font-selected-bg);}.sc6yefj[data-hidden='1']{visibility:hidden;}.sc6yefj[data-disabled='1']{cursor:default;color:var(--font-disabled-color);background:var(--font-disabled-bg);}.sc6yefj[data-selected='0'][data-disabled='0']{background:var(--font-bg);color:var(--font-color);}.sc6yefj[data-selected='0'][data-disabled='0']:hover{color:var(--font-hover-color);background:var(--font-hover-bg);}.sc6yefj[data-disabled='0']{cursor:pointer;}.sc6yefj svg{fill:currentColor;width:20px;height:20px;}.sc6yefj input{position:absolute;visibility:hidden;}
|
|
40
|
+
.s2aizej{width:100%;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:2px 6px;}
|
|
41
|
+
.s13rkw3s{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;}
|
|
42
|
+
.s1qkcrgj{-webkit-flex:1;-ms-flex:1;flex:1;text-align:left;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;}.s1qkcrgj + .s13rkw3s{margin-left:12px;}
|
|
43
|
+
.s2dsyaf{position:absolute;z-index:3;background:var(--toolbar-bg);bottom:100%;box-shadow:0 3px 8px rgb(0 0 0 / 24%);padding:8px;border-radius:8px;white-space:nowrap;box-sizing:border-box;}.s2dsyaf[data-alignment='left']{left:0;margin:4px;}.s2dsyaf[data-alignment='center']{left:50%;-webkit-transform:translate3d(-50%,0px,0px);-ms-transform:translate3d(-50%,0px,0px);transform:translate3d(-50%,0px,0px);margin:4px 0px;}.s2dsyaf[data-alignment='right']{right:0;margin:4px;}.s2dsyaf[data-fitcontainer='true']{max-width:100%;}
|
|
44
|
+
.s1f032bv{margin-bottom:8px;margin-top:4px;font-size:18px;}
|
|
45
|
+
.sw61axo{display:inline-block;background:var(--toolbar-bg);box-sizing:border-box;overflow-y:auto;min-width:200px;}
|
|
46
|
+
.s1shoasi{margin:2px 0;}.s1shoasi:not(:hover){opacity:0.2;}
|
|
47
|
+
.s1adt0vs{border:3px solid transparent;padding:4px 0px;position:relative;background:var(--toolbar-bg);box-sizing:border-box;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:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}.s1adt0vs[data-is-over='1']{border:3px dotted var(--font-hover-bg);}.s1adt0vs[data-is-dragging='1']{opacity:0.4;}.s1adt0vs[data-selected='1']{color:var(--font-selected-color);background:var(--font-selected-bg);}.s1adt0vs[data-selected='1'] .s1shoasi{color:white;}.s1adt0vs[data-selected='0'][data-disabled='0']{background:var(--font-bg);color:var(--font-color);}.s1adt0vs[data-selected='0'][data-disabled='0']:hover{color:var(--font-hover-color);background:var(--font-hover-bg);}.s1adt0vs[data-disabled='1']{cursor:default;color:var(--font-disabled-color);background:var(--font-disabled-bg);}.s1adt0vs[data-disabled='0']{cursor:move;}.s1adt0vs > span{height:20px;line-height:1;color:#8a8a8a;}.s1adt0vs > span > svg{fill:#8a8a8a;width:20px;height:20px;padding:0 4px;-webkit-transform:scale(0.75);-ms-transform:scale(0.75);transform:scale(0.75);}
|
|
48
|
+
.svyjq0t{margin:2px 0;}.svyjq0t[data-visible='false']{opacity:0.2;}
|
|
49
|
+
.s1vztggb{margin:2px 0;}.s1vztggb[data-locked='false']{opacity:0.2;}
|
|
50
|
+
.s1fgf9tg[data-grid='false'] svg{opacity:0.2;}
|
|
51
|
+
.s1rl6big{-webkit-flex:1;-ms-flex:1;flex:1;}
|
|
52
|
+
.sbpkotp{bottom:0;left:unset;top:unset;max-height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
53
|
+
.s12cgrwn{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;overflow-y:auto;}
|
|
54
|
+
.s1jzw7d9{opacity:0.6;text-align:center;padding:12px 0px;}
|
|
55
|
+
.s3kynji{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;bottom:unset;top:100%;}.s3kynji[data-vertical='1']{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
56
|
+
.s1614rl3{position:relative;display:inline-block;}
|
|
57
|
+
.s1qu0ers{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;bottom:unset;top:100%;}.s1qu0ers[data-vertical='1']{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
58
|
+
.s1y35t9y{position:relative;display:inline-block;}
|
|
59
|
+
.s1hezj2d{z-index:3;position:absolute;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;left:0;right:0;bottom:0;top:0;}.s1hezj2d[data-position='center']{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.s1hezj2d[data-position='bottom']{-webkit-align-items:end;-webkit-box-align:end;-ms-flex-align:end;align-items:end;}
|
|
60
|
+
.spuj31h{display:grid;background:var(--toolbar-bg);box-shadow:0 3px 8px rgb(0 0 0 / 24%);padding:4px;border-radius:8px;white-space:nowrap;position:relative;}
|
|
61
|
+
.s1ulcd40{position:absolute;left:0;top:0;right:0;bottom:0;background:#00000073;}
|
|
62
|
+
.s1rncfwv form{grid-template-columns:3fr 1fr 1fr;}.s1rncfwv form input{color:var(--font-color);border:1px solid var(--font-color);background:var(--toolbar-bg);outline:none;}
|
|
63
|
+
.s1gorp95{-webkit-flex:1;-ms-flex:1;flex:1;position:relative;height:100%;text-align:center;height:36px;}
|
|
64
|
+
.s1ivsaf6{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;max-height:36px;background:var(--toolbar-bg);border-bottom:1px solid var(--divider-color);box-sizing:border-box;}
|
|
65
|
+
.sv0y70r{grid-template-columns:1fr 1fr 1fr;}
|
|
66
|
+
.s1dqu4j7{width:20px;height:20px;box-sizing:border-box;border-radius:50%;}.s1dqu4j7[data-mode='fill']{border:1px solid #80808038;background:var(--s1dqu4j7-0);}.s1dqu4j7[data-mode='stroke']{border:4px solid #80808038;}.s1dqu4j7[data-mode='stroke']:after{content:'';display:block;border-radius:100%;border:2px solid var(--s1dqu4j7-0);position:relative;width:18px;height:18px;left:-3px;top:-3px;box-sizing:border-box;}
|
|
67
|
+
.s1j0ldko{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;}
|
|
68
|
+
.s10ecqf5{width:20px;height:20px;box-sizing:border-box;border-radius:50%;color:var(--s10ecqf5-0);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:baseline;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;font-weight:bold;}
|
|
69
|
+
.layoutPanelOpened .sb1jkk3.sb1jkk3{color:var(--font-selected-color);background:var(--font-selected-bg);}.sb1jkk3[data-hidden='1']{display:none;}
|
|
70
|
+
.s4h1871{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:100%;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;}
|
|
71
|
+
.sfr849o{padding:16px;}
|
|
72
|
+
.s11cdkmf{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;}
|
|
73
|
+
.s16o63ah{font-family:var(--s16o63ah-0);}
|
|
74
|
+
.s1yz5lc1{display:inline-block;width:6px;height:2px;background:transparent;vertical-align:middle;}
|
|
75
|
+
.s1k64iv7{display:inline-block;}.s1k64iv7[data-type='0'] .s1yz5lc1{background:currentColor;}.s1k64iv7[data-type='2']{position:relative;left:3px;}.s1k64iv7[data-type='2'] .s1yz5lc1:nth-child(3n-1){background:currentColor;width:12px;}.s1k64iv7[data-type='2'] .s1yz5lc1:nth-child(n+11){display:none;}.s1k64iv7[data-type='1'] .s1yz5lc1:nth-child(2n+1){background:currentColor;}
|
|
76
|
+
.s1bq28wy{position:absolute;left:0;top:50%;-webkit-transform:translate3d(-25%,-50%,0px);-ms-transform:translate3d(-25%,-50%,0px);transform:translate3d(-25%,-50%,0px);display:inline-block;width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:15px solid currentColor;}
|
|
77
|
+
.sej9ve5{position:absolute;right:0;top:50%;-webkit-transform:translate3d(25%,-50%,0px);-ms-transform:translate3d(25%,-50%,0px);transform:translate3d(25%,-50%,0px);display:inline-block;width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:15px solid currentColor;}
|
|
78
|
+
.s5asd7a{position:relative;display:inline-block;width:60px;height:2px;background:currentColor;vertical-align:middle;}.s5asd7a[data-type='0'] .s1bq28wy,.s5asd7a[data-type='1'] .s1bq28wy{display:none;}.s5asd7a[data-type='0'] .sej9ve5,.s5asd7a[data-type='2'] .sej9ve5{display:none;}
|
|
79
|
+
.s17kh6p4{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;background:var(--toolbar-bg);position:relative;height:36px;border-top:1px solid var(--divider-color);box-sizing:border-box;}
|
|
80
|
+
.s1fluhcn{-webkit-flex:1;-ms-flex:1;flex:1;}
|
|
81
|
+
.sg7vrwb{grid-template-columns:repeat(auto-fill,40px);width:100%;}
|
|
82
|
+
.s1xg1lj6{display:inline-block;padding:12px 48px;margin:4px;max-width:calc(100% - 24px);overflow-wrap:break-word;box-sizing:border-box;-webkit-transition:all 500ms;transition:all 500ms;opacity:0;-webkit-transform:translate3d(0px,40px,0px);-ms-transform:translate3d(0px,40px,0px);transform:translate3d(0px,40px,0px);}.s1xg1lj6[data-type='0']{background:#646464;color:white;}.s1xg1lj6[data-type='1']{background:#c3a200;color:black;}.s1xg1lj6[data-type='2']{background:#911717;color:white;}.s1xg1lj6[data-type='3']{background:#088900;color:white;}.s1xg1lj6[data-is-shown='1']{opacity:1;-webkit-transform:translate3d(0px,0px,0px);-ms-transform:translate3d(0px,0px,0px);transform:translate3d(0px,0px,0px);}.s1xg1lj6[data-is-shown='0']{opacity:0;-webkit-transform:translate3d(0px,40px,0px);-ms-transform:translate3d(0px,40px,0px);transform:translate3d(0px,40px,0px);}
|
|
83
|
+
.sg1lk71{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;position:absolute;z-index:4;bottom:0;left:0;right:0;height:0px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
|
84
|
+
.s15r7ba{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:absolute;z-index:2;top:0;bottom:0;left:0;right:0;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#00000050;-webkit-transition:opacity 300ms linear;transition:opacity 300ms linear;opacity:0;}.s15r7ba[data-loading='visible']{opacity:1;}
|
|
85
|
+
.s19n4ela{width:40px;height:40px;position:relative;-webkit-transform:rotate(10deg);-ms-transform:rotate(10deg);transform:rotate(10deg);-webkit-animation:react-paint-rotation-s19n4ela 1s infinite;animation:react-paint-rotation-s19n4ela 1s infinite;}@-webkit-keyframes react-paint-rotation-s19n4ela{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes react-paint-rotation-s19n4ela{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}
|
|
86
|
+
.ssemdwq{border-radius:50%;position:absolute;width:15px;height:15px;}.ssemdwq:nth-child(1){left:0;background-color:#5c6bc0;}.ssemdwq:nth-child(2){right:0;background-color:#8bc34a;}.ssemdwq:nth-child(3){bottom:0;background-color:#ffb74d;}.ssemdwq:nth-child(4){bottom:0;right:0;background-color:#f44336;}
|
|
87
|
+
.sdhgr8u{--toolbar-bg:var(--sdhgr8u-0);--divider-color:var(--sdhgr8u-1);--font-radius:var(--sdhgr8u-2);--font-disabled-color:var(--sdhgr8u-3);--font-disabled-bg:var(--sdhgr8u-4);--font-color:var(--sdhgr8u-5);--font-bg:var(--sdhgr8u-6);--font-selected-color:var(--sdhgr8u-7);--font-selected-bg:var(--sdhgr8u-8);--font-hover-color:var(--sdhgr8u-9);--font-hover-bg:var(--sdhgr8u-10);--canvas-bg:var(--sdhgr8u-11);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;color:var(--font-color);position:relative;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.sdhgr8u hr{width:100%;border:none;border-top:1px solid var(--divider-color);}.sdhgr8u[data-grow='false']{max-width:var(--sdhgr8u-12);}.sdhgr8u[data-shrink='false']{min-width:var(--sdhgr8u-13);}
|
|
88
|
+
.sm24hcl{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;position:relative;max-width:100%;z-index:1;aspect-ratio:var(--sm24hcl-2);}.sm24hcl[data-grow='true']{width:100%;}.sm24hcl[data-grow='false']{width:var(--sm24hcl-1);}
|
package/dist/utils/intersect.js
CHANGED
|
@@ -128,6 +128,7 @@ exports.applyRotationToVector = applyRotationToVector;
|
|
|
128
128
|
var checkPositionIntersection = function checkPositionIntersection(shape, position, canvasOffset, selectionPadding) {
|
|
129
129
|
var currentScale = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
|
130
130
|
var checkAnchors = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
131
|
+
if (shape.locked) return false;
|
|
131
132
|
var scaleWithMinCap = Math.min(1, currentScale);
|
|
132
133
|
|
|
133
134
|
var _getShapeInfos = (0, _shapeData.getShapeInfos)(shape, selectionPadding),
|
package/package.json
CHANGED
package/Changelog.md
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
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
|