labellife-design-tool 2.4.1 → 2.4.2
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/cjs/canvas/workspace.js +321 -92
- package/dist/cjs/canvas/workspace.js.map +1 -1
- package/dist/cjs/index.js +374 -65
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/side-panel/index.js.map +1 -1
- package/dist/cjs/side-panel/side-panel.js.map +1 -1
- package/dist/cjs/toolbar/toolbar.js +538 -31
- package/dist/cjs/toolbar/toolbar.js.map +1 -1
- package/dist/esm/canvas/workspace.js +265 -36
- package/dist/esm/canvas/workspace.js.map +1 -1
- package/dist/esm/index.js +375 -67
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/side-panel/index.js.map +1 -1
- package/dist/esm/side-panel/side-panel.js.map +1 -1
- package/dist/esm/toolbar/toolbar.js +540 -33
- package/dist/esm/toolbar/toolbar.js.map +1 -1
- package/package.json +1 -1
|
@@ -36,6 +36,8 @@ require('@mui/icons-material/AlignVerticalCenter');
|
|
|
36
36
|
require('@mui/icons-material/AlignVerticalBottom');
|
|
37
37
|
var VerticalAlignTopIcon = require('@mui/icons-material/VerticalAlignTop');
|
|
38
38
|
var VerticalAlignBottomIcon = require('@mui/icons-material/VerticalAlignBottom');
|
|
39
|
+
var GestureIcon = require('@mui/icons-material/Gesture');
|
|
40
|
+
var CloseIcon = require('@mui/icons-material/Close');
|
|
39
41
|
var jsxRuntime = require('react/jsx-runtime');
|
|
40
42
|
|
|
41
43
|
function _arrayLikeToArray(r, a) {
|
|
@@ -396,6 +398,433 @@ if (typeof window !== 'undefined' && !window[INPUT_FIELDS_CONFIG_KEY]) {
|
|
|
396
398
|
window[INPUT_FIELDS_CONFIG_KEY] = {};
|
|
397
399
|
}
|
|
398
400
|
|
|
401
|
+
var SliderRow = function SliderRow(_ref) {
|
|
402
|
+
var label = _ref.label,
|
|
403
|
+
value = _ref.value,
|
|
404
|
+
_onChange = _ref.onChange,
|
|
405
|
+
_ref$min = _ref.min,
|
|
406
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
407
|
+
_ref$max = _ref.max,
|
|
408
|
+
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
409
|
+
_ref$step = _ref.step,
|
|
410
|
+
step = _ref$step === void 0 ? 1 : _ref$step;
|
|
411
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
412
|
+
sx: {
|
|
413
|
+
mb: 1
|
|
414
|
+
},
|
|
415
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
416
|
+
variant: "caption",
|
|
417
|
+
sx: {
|
|
418
|
+
color: '#888',
|
|
419
|
+
display: 'block',
|
|
420
|
+
mb: 0.5
|
|
421
|
+
},
|
|
422
|
+
children: label
|
|
423
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
424
|
+
sx: {
|
|
425
|
+
display: 'flex',
|
|
426
|
+
alignItems: 'center',
|
|
427
|
+
gap: 1
|
|
428
|
+
},
|
|
429
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Slider, {
|
|
430
|
+
size: "small",
|
|
431
|
+
value: value,
|
|
432
|
+
onChange: function onChange(_, v) {
|
|
433
|
+
return _onChange(v);
|
|
434
|
+
},
|
|
435
|
+
min: min,
|
|
436
|
+
max: max,
|
|
437
|
+
step: step,
|
|
438
|
+
sx: {
|
|
439
|
+
flex: 1
|
|
440
|
+
}
|
|
441
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
|
|
442
|
+
size: "small",
|
|
443
|
+
type: "number",
|
|
444
|
+
value: typeof value === 'number' ? Math.round(value * 10) / 10 : value,
|
|
445
|
+
onChange: function onChange(e) {
|
|
446
|
+
var v = parseFloat(e.target.value);
|
|
447
|
+
if (!isNaN(v)) _onChange(v);
|
|
448
|
+
},
|
|
449
|
+
onFocus: function onFocus(e) {
|
|
450
|
+
return e.target.select();
|
|
451
|
+
},
|
|
452
|
+
sx: {
|
|
453
|
+
width: 65,
|
|
454
|
+
'& .MuiInputBase-input': {
|
|
455
|
+
fontSize: 12,
|
|
456
|
+
py: 0.5,
|
|
457
|
+
textAlign: 'center'
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
inputProps: {
|
|
461
|
+
min: min,
|
|
462
|
+
max: max,
|
|
463
|
+
step: step
|
|
464
|
+
}
|
|
465
|
+
})]
|
|
466
|
+
})]
|
|
467
|
+
});
|
|
468
|
+
};
|
|
469
|
+
var TextEffectsPanel = mobxReactLite.observer(function (_ref2) {
|
|
470
|
+
var store = _ref2.store;
|
|
471
|
+
var panel = store._toolbarPanel;
|
|
472
|
+
if (!panel || panel.type !== 'effects') return null;
|
|
473
|
+
var element = store.getElementById(panel.elementId);
|
|
474
|
+
if (!element || element.type !== 'text') return null;
|
|
475
|
+
var handleClose = function handleClose() {
|
|
476
|
+
return store.closeToolbarPanel();
|
|
477
|
+
};
|
|
478
|
+
var commit = function commit() {
|
|
479
|
+
return store.history.addUndoState();
|
|
480
|
+
};
|
|
481
|
+
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
482
|
+
sx: {
|
|
483
|
+
width: 280,
|
|
484
|
+
height: '100%',
|
|
485
|
+
overflowY: 'auto',
|
|
486
|
+
overflowX: 'hidden',
|
|
487
|
+
backgroundColor: '#fff',
|
|
488
|
+
borderRight: '1px solid #e0e0e0',
|
|
489
|
+
flexShrink: 0,
|
|
490
|
+
p: 2
|
|
491
|
+
},
|
|
492
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
493
|
+
sx: {
|
|
494
|
+
display: 'flex',
|
|
495
|
+
alignItems: 'center',
|
|
496
|
+
justifyContent: 'space-between',
|
|
497
|
+
mb: 2
|
|
498
|
+
},
|
|
499
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
500
|
+
variant: "subtitle1",
|
|
501
|
+
sx: {
|
|
502
|
+
fontWeight: 600
|
|
503
|
+
},
|
|
504
|
+
children: t('toolbar.textEffects', 'Text Effects')
|
|
505
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.IconButton, {
|
|
506
|
+
size: "small",
|
|
507
|
+
onClick: handleClose,
|
|
508
|
+
children: /*#__PURE__*/jsxRuntime.jsx(CloseIcon, {
|
|
509
|
+
fontSize: "small"
|
|
510
|
+
})
|
|
511
|
+
})]
|
|
512
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
513
|
+
sx: {
|
|
514
|
+
mb: 2
|
|
515
|
+
},
|
|
516
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
517
|
+
sx: {
|
|
518
|
+
display: 'flex',
|
|
519
|
+
alignItems: 'center',
|
|
520
|
+
justifyContent: 'space-between',
|
|
521
|
+
mb: 0.5
|
|
522
|
+
},
|
|
523
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
524
|
+
variant: "body2",
|
|
525
|
+
sx: {
|
|
526
|
+
fontWeight: 500
|
|
527
|
+
},
|
|
528
|
+
children: t('toolbar.blur', 'Blur')
|
|
529
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Switch, {
|
|
530
|
+
size: "small",
|
|
531
|
+
checked: element.blurEnabled,
|
|
532
|
+
onChange: function onChange(e) {
|
|
533
|
+
element.set({
|
|
534
|
+
blurEnabled: e.target.checked
|
|
535
|
+
});
|
|
536
|
+
commit();
|
|
537
|
+
}
|
|
538
|
+
})]
|
|
539
|
+
}), element.blurEnabled && /*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
540
|
+
label: t('toolbar.blur', 'Blur'),
|
|
541
|
+
value: element.blurRadius,
|
|
542
|
+
onChange: function onChange(v) {
|
|
543
|
+
return element.set({
|
|
544
|
+
blurRadius: v
|
|
545
|
+
});
|
|
546
|
+
},
|
|
547
|
+
min: 0,
|
|
548
|
+
max: 40
|
|
549
|
+
})]
|
|
550
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
551
|
+
sx: {
|
|
552
|
+
mb: 2
|
|
553
|
+
},
|
|
554
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
555
|
+
sx: {
|
|
556
|
+
display: 'flex',
|
|
557
|
+
alignItems: 'center',
|
|
558
|
+
justifyContent: 'space-between',
|
|
559
|
+
mb: 0.5
|
|
560
|
+
},
|
|
561
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
562
|
+
variant: "body2",
|
|
563
|
+
sx: {
|
|
564
|
+
fontWeight: 500
|
|
565
|
+
},
|
|
566
|
+
children: t('toolbar.textStroke', 'Text Stroke')
|
|
567
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Switch, {
|
|
568
|
+
size: "small",
|
|
569
|
+
checked: element.strokeWidth > 0,
|
|
570
|
+
onChange: function onChange(e) {
|
|
571
|
+
element.set({
|
|
572
|
+
strokeWidth: e.target.checked ? 2 : 0,
|
|
573
|
+
stroke: element.stroke || '#000000'
|
|
574
|
+
});
|
|
575
|
+
commit();
|
|
576
|
+
}
|
|
577
|
+
})]
|
|
578
|
+
}), element.strokeWidth > 0 && /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
579
|
+
sx: {
|
|
580
|
+
display: 'flex',
|
|
581
|
+
alignItems: 'center',
|
|
582
|
+
gap: 1
|
|
583
|
+
},
|
|
584
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("input", {
|
|
585
|
+
type: "color",
|
|
586
|
+
value: element.stroke || '#000000',
|
|
587
|
+
onChange: function onChange(e) {
|
|
588
|
+
element.set({
|
|
589
|
+
stroke: e.target.value
|
|
590
|
+
});
|
|
591
|
+
commit();
|
|
592
|
+
},
|
|
593
|
+
style: {
|
|
594
|
+
width: 32,
|
|
595
|
+
height: 32,
|
|
596
|
+
border: '1px solid #ccc',
|
|
597
|
+
borderRadius: 4,
|
|
598
|
+
cursor: 'pointer',
|
|
599
|
+
padding: 0
|
|
600
|
+
}
|
|
601
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
|
|
602
|
+
size: "small",
|
|
603
|
+
type: "number",
|
|
604
|
+
value: element.strokeWidth,
|
|
605
|
+
onChange: function onChange(e) {
|
|
606
|
+
var v = parseFloat(e.target.value);
|
|
607
|
+
if (!isNaN(v) && v >= 0) {
|
|
608
|
+
element.set({
|
|
609
|
+
strokeWidth: v
|
|
610
|
+
});
|
|
611
|
+
commit();
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
onFocus: function onFocus(e) {
|
|
615
|
+
return e.target.select();
|
|
616
|
+
},
|
|
617
|
+
sx: {
|
|
618
|
+
width: 65,
|
|
619
|
+
'& .MuiInputBase-input': {
|
|
620
|
+
fontSize: 12,
|
|
621
|
+
py: 0.5,
|
|
622
|
+
textAlign: 'center'
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
inputProps: {
|
|
626
|
+
min: 0,
|
|
627
|
+
max: 20,
|
|
628
|
+
step: 0.5
|
|
629
|
+
}
|
|
630
|
+
})]
|
|
631
|
+
})]
|
|
632
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
633
|
+
sx: {
|
|
634
|
+
mb: 2
|
|
635
|
+
},
|
|
636
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
637
|
+
sx: {
|
|
638
|
+
display: 'flex',
|
|
639
|
+
alignItems: 'center',
|
|
640
|
+
justifyContent: 'space-between',
|
|
641
|
+
mb: 0.5
|
|
642
|
+
},
|
|
643
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
644
|
+
variant: "body2",
|
|
645
|
+
sx: {
|
|
646
|
+
fontWeight: 500
|
|
647
|
+
},
|
|
648
|
+
children: t('toolbar.background', 'Background')
|
|
649
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Switch, {
|
|
650
|
+
size: "small",
|
|
651
|
+
checked: element.backgroundEnabled,
|
|
652
|
+
onChange: function onChange(e) {
|
|
653
|
+
element.set({
|
|
654
|
+
backgroundEnabled: e.target.checked
|
|
655
|
+
});
|
|
656
|
+
commit();
|
|
657
|
+
}
|
|
658
|
+
})]
|
|
659
|
+
}), element.backgroundEnabled && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
660
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
661
|
+
label: t('toolbar.cornerRadius', 'Corner radius'),
|
|
662
|
+
value: element.backgroundCornerRadius,
|
|
663
|
+
onChange: function onChange(v) {
|
|
664
|
+
return element.set({
|
|
665
|
+
backgroundCornerRadius: v
|
|
666
|
+
});
|
|
667
|
+
},
|
|
668
|
+
min: 0,
|
|
669
|
+
max: 50,
|
|
670
|
+
step: 0.5
|
|
671
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
672
|
+
label: t('toolbar.padding', 'Padding'),
|
|
673
|
+
value: element.backgroundPadding,
|
|
674
|
+
onChange: function onChange(v) {
|
|
675
|
+
return element.set({
|
|
676
|
+
backgroundPadding: v
|
|
677
|
+
});
|
|
678
|
+
},
|
|
679
|
+
min: 0,
|
|
680
|
+
max: 100
|
|
681
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
682
|
+
label: t('toolbar.opacity', 'Opacity'),
|
|
683
|
+
value: Math.round(element.backgroundOpacity * 100),
|
|
684
|
+
onChange: function onChange(v) {
|
|
685
|
+
return element.set({
|
|
686
|
+
backgroundOpacity: v / 100
|
|
687
|
+
});
|
|
688
|
+
},
|
|
689
|
+
min: 0,
|
|
690
|
+
max: 100
|
|
691
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
692
|
+
sx: {
|
|
693
|
+
mt: 1
|
|
694
|
+
},
|
|
695
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
696
|
+
variant: "caption",
|
|
697
|
+
sx: {
|
|
698
|
+
color: '#888',
|
|
699
|
+
display: 'block',
|
|
700
|
+
mb: 0.5
|
|
701
|
+
},
|
|
702
|
+
children: t('toolbar.color', 'Color')
|
|
703
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", {
|
|
704
|
+
type: "color",
|
|
705
|
+
value: element.backgroundColor || '#ffffff',
|
|
706
|
+
onChange: function onChange(e) {
|
|
707
|
+
element.set({
|
|
708
|
+
backgroundColor: e.target.value
|
|
709
|
+
});
|
|
710
|
+
commit();
|
|
711
|
+
},
|
|
712
|
+
style: {
|
|
713
|
+
width: 32,
|
|
714
|
+
height: 32,
|
|
715
|
+
border: '1px solid #ccc',
|
|
716
|
+
borderRadius: 4,
|
|
717
|
+
cursor: 'pointer',
|
|
718
|
+
padding: 0
|
|
719
|
+
}
|
|
720
|
+
})]
|
|
721
|
+
})]
|
|
722
|
+
})]
|
|
723
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
724
|
+
sx: {
|
|
725
|
+
mb: 2
|
|
726
|
+
},
|
|
727
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
728
|
+
sx: {
|
|
729
|
+
display: 'flex',
|
|
730
|
+
alignItems: 'center',
|
|
731
|
+
justifyContent: 'space-between',
|
|
732
|
+
mb: 0.5
|
|
733
|
+
},
|
|
734
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
735
|
+
variant: "body2",
|
|
736
|
+
sx: {
|
|
737
|
+
fontWeight: 500
|
|
738
|
+
},
|
|
739
|
+
children: t('toolbar.shadow', 'Shadow')
|
|
740
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Switch, {
|
|
741
|
+
size: "small",
|
|
742
|
+
checked: element.shadowEnabled,
|
|
743
|
+
onChange: function onChange(e) {
|
|
744
|
+
element.set({
|
|
745
|
+
shadowEnabled: e.target.checked
|
|
746
|
+
});
|
|
747
|
+
commit();
|
|
748
|
+
}
|
|
749
|
+
})]
|
|
750
|
+
}), element.shadowEnabled && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
751
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
752
|
+
label: t('toolbar.blur', 'Blur'),
|
|
753
|
+
value: element.shadowBlur,
|
|
754
|
+
onChange: function onChange(v) {
|
|
755
|
+
return element.set({
|
|
756
|
+
shadowBlur: v
|
|
757
|
+
});
|
|
758
|
+
},
|
|
759
|
+
min: 0,
|
|
760
|
+
max: 50
|
|
761
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
762
|
+
label: t('toolbar.offsetX', 'Offset X'),
|
|
763
|
+
value: element.shadowOffsetX,
|
|
764
|
+
onChange: function onChange(v) {
|
|
765
|
+
return element.set({
|
|
766
|
+
shadowOffsetX: v
|
|
767
|
+
});
|
|
768
|
+
},
|
|
769
|
+
min: -50,
|
|
770
|
+
max: 50
|
|
771
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
772
|
+
label: t('toolbar.offsetY', 'Offset Y'),
|
|
773
|
+
value: element.shadowOffsetY,
|
|
774
|
+
onChange: function onChange(v) {
|
|
775
|
+
return element.set({
|
|
776
|
+
shadowOffsetY: v
|
|
777
|
+
});
|
|
778
|
+
},
|
|
779
|
+
min: -50,
|
|
780
|
+
max: 50
|
|
781
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
782
|
+
label: t('toolbar.opacity', 'Opacity'),
|
|
783
|
+
value: Math.round(element.shadowOpacity * 100),
|
|
784
|
+
onChange: function onChange(v) {
|
|
785
|
+
return element.set({
|
|
786
|
+
shadowOpacity: v / 100
|
|
787
|
+
});
|
|
788
|
+
},
|
|
789
|
+
min: 0,
|
|
790
|
+
max: 100
|
|
791
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
792
|
+
sx: {
|
|
793
|
+
mt: 1
|
|
794
|
+
},
|
|
795
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
|
|
796
|
+
variant: "caption",
|
|
797
|
+
sx: {
|
|
798
|
+
color: '#888',
|
|
799
|
+
display: 'block',
|
|
800
|
+
mb: 0.5
|
|
801
|
+
},
|
|
802
|
+
children: t('toolbar.color', 'Color')
|
|
803
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", {
|
|
804
|
+
type: "color",
|
|
805
|
+
value: element.shadowColor || '#000000',
|
|
806
|
+
onChange: function onChange(e) {
|
|
807
|
+
element.set({
|
|
808
|
+
shadowColor: e.target.value
|
|
809
|
+
});
|
|
810
|
+
commit();
|
|
811
|
+
},
|
|
812
|
+
style: {
|
|
813
|
+
width: 32,
|
|
814
|
+
height: 32,
|
|
815
|
+
border: '1px solid #ccc',
|
|
816
|
+
borderRadius: 4,
|
|
817
|
+
cursor: 'pointer',
|
|
818
|
+
padding: 0
|
|
819
|
+
}
|
|
820
|
+
})]
|
|
821
|
+
})]
|
|
822
|
+
})]
|
|
823
|
+
})]
|
|
824
|
+
});
|
|
825
|
+
});
|
|
826
|
+
TextEffectsPanel.displayName = 'TextEffectsPanel';
|
|
827
|
+
|
|
399
828
|
var _excluded = ["fontFamily"];
|
|
400
829
|
var _positionMenuItemSx = {
|
|
401
830
|
textTransform: 'none',
|
|
@@ -1369,10 +1798,85 @@ var PositionButton = mobxReactLite.observer(function (_ref8) {
|
|
|
1369
1798
|
});
|
|
1370
1799
|
});
|
|
1371
1800
|
|
|
1801
|
+
// Curve (text-only) slider popover — same button/popover pattern as
|
|
1802
|
+
// PositionButton, holding the same control previously in the Text
|
|
1803
|
+
// Effects panel's Curve section. No separate enable toggle: curvePower
|
|
1804
|
+
// itself is the on/off state (0 = straight, matching how the renderer
|
|
1805
|
+
// already treats curvePower === 0 as "no curve").
|
|
1806
|
+
var CurveButton = mobxReactLite.observer(function (_ref0) {
|
|
1807
|
+
var element = _ref0.element;
|
|
1808
|
+
var _useState5 = React.useState(null),
|
|
1809
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1810
|
+
anchorEl = _useState6[0],
|
|
1811
|
+
setAnchorEl = _useState6[1];
|
|
1812
|
+
var open = Boolean(anchorEl);
|
|
1813
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1814
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(material.Button, {
|
|
1815
|
+
size: "small",
|
|
1816
|
+
onClick: function onClick(e) {
|
|
1817
|
+
return setAnchorEl(e.currentTarget);
|
|
1818
|
+
},
|
|
1819
|
+
startIcon: /*#__PURE__*/jsxRuntime.jsx(GestureIcon, {
|
|
1820
|
+
sx: {
|
|
1821
|
+
fontSize: '16px !important'
|
|
1822
|
+
}
|
|
1823
|
+
}),
|
|
1824
|
+
sx: _objectSpread2({
|
|
1825
|
+
textTransform: 'none',
|
|
1826
|
+
fontSize: 12,
|
|
1827
|
+
whiteSpace: 'nowrap',
|
|
1828
|
+
px: 1.5,
|
|
1829
|
+
minWidth: 'auto'
|
|
1830
|
+
}, open ? {
|
|
1831
|
+
backgroundColor: '#e3f2fd',
|
|
1832
|
+
color: '#0d83cd'
|
|
1833
|
+
} : {}),
|
|
1834
|
+
children: t('toolbar.curve', 'Curve')
|
|
1835
|
+
}), /*#__PURE__*/jsxRuntime.jsx(material.Popover, {
|
|
1836
|
+
open: open,
|
|
1837
|
+
anchorEl: anchorEl,
|
|
1838
|
+
onClose: function onClose() {
|
|
1839
|
+
return setAnchorEl(null);
|
|
1840
|
+
},
|
|
1841
|
+
anchorOrigin: {
|
|
1842
|
+
vertical: 'bottom',
|
|
1843
|
+
horizontal: 'left'
|
|
1844
|
+
},
|
|
1845
|
+
transformOrigin: {
|
|
1846
|
+
vertical: 'top',
|
|
1847
|
+
horizontal: 'left'
|
|
1848
|
+
},
|
|
1849
|
+
slotProps: {
|
|
1850
|
+
paper: {
|
|
1851
|
+
sx: {
|
|
1852
|
+
mt: 0.5,
|
|
1853
|
+
p: 2,
|
|
1854
|
+
width: 260,
|
|
1855
|
+
borderRadius: '10px',
|
|
1856
|
+
boxShadow: '0 4px 20px rgba(0,0,0,0.12)'
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
},
|
|
1860
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SliderRow, {
|
|
1861
|
+
label: t('toolbar.curve', 'Curve'),
|
|
1862
|
+
value: element.curvePower,
|
|
1863
|
+
onChange: function onChange(v) {
|
|
1864
|
+
return element.set({
|
|
1865
|
+
curveEnabled: true,
|
|
1866
|
+
curvePower: v
|
|
1867
|
+
});
|
|
1868
|
+
},
|
|
1869
|
+
min: -500,
|
|
1870
|
+
max: 500
|
|
1871
|
+
})
|
|
1872
|
+
})]
|
|
1873
|
+
});
|
|
1874
|
+
});
|
|
1875
|
+
|
|
1372
1876
|
// Common controls for all element types
|
|
1373
|
-
var CommonControls = mobxReactLite.observer(function (
|
|
1374
|
-
var element =
|
|
1375
|
-
store =
|
|
1877
|
+
var CommonControls = mobxReactLite.observer(function (_ref1) {
|
|
1878
|
+
var element = _ref1.element,
|
|
1879
|
+
store = _ref1.store;
|
|
1376
1880
|
var isLocked = element.locked;
|
|
1377
1881
|
var handleDuplicate = function handleDuplicate() {
|
|
1378
1882
|
if (element.clone) {
|
|
@@ -1450,6 +1954,9 @@ var CommonControls = mobxReactLite.observer(function (_ref0) {
|
|
|
1450
1954
|
}), /*#__PURE__*/jsxRuntime.jsx(PositionButton, {
|
|
1451
1955
|
element: element,
|
|
1452
1956
|
store: store
|
|
1957
|
+
}), element.type === 'text' && /*#__PURE__*/jsxRuntime.jsx(CurveButton, {
|
|
1958
|
+
element: element,
|
|
1959
|
+
store: store
|
|
1453
1960
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Divider, {
|
|
1454
1961
|
orientation: "vertical",
|
|
1455
1962
|
flexItem: true,
|
|
@@ -1493,26 +2000,26 @@ var CommonControls = mobxReactLite.observer(function (_ref0) {
|
|
|
1493
2000
|
});
|
|
1494
2001
|
|
|
1495
2002
|
// Download button with format/quality popover
|
|
1496
|
-
var DefaultDownloadButton = mobxReactLite.observer(function (
|
|
1497
|
-
var store =
|
|
1498
|
-
var
|
|
1499
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
1500
|
-
anchorEl = _useState6[0],
|
|
1501
|
-
setAnchorEl = _useState6[1];
|
|
1502
|
-
var _useState7 = React.useState('png'),
|
|
2003
|
+
var DefaultDownloadButton = mobxReactLite.observer(function (_ref10) {
|
|
2004
|
+
var store = _ref10.store;
|
|
2005
|
+
var _useState7 = React.useState(null),
|
|
1503
2006
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
1504
|
-
|
|
1505
|
-
|
|
2007
|
+
anchorEl = _useState8[0],
|
|
2008
|
+
setAnchorEl = _useState8[1];
|
|
2009
|
+
var _useState9 = React.useState('png'),
|
|
2010
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
2011
|
+
fileType = _useState0[0],
|
|
2012
|
+
setFileType = _useState0[1];
|
|
1506
2013
|
// Default quality so pixelRatio=1 (output = template's own pixel size).
|
|
1507
2014
|
// qualityToPixelRatio(q) = q * 3, so q = 1/3 → pixelRatio = 1.
|
|
1508
|
-
var
|
|
1509
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
1510
|
-
quality = _useState0[0],
|
|
1511
|
-
setQuality = _useState0[1];
|
|
1512
|
-
var _useState1 = React.useState(false),
|
|
2015
|
+
var _useState1 = React.useState(1 / 3),
|
|
1513
2016
|
_useState10 = _slicedToArray(_useState1, 2),
|
|
1514
|
-
|
|
1515
|
-
|
|
2017
|
+
quality = _useState10[0],
|
|
2018
|
+
setQuality = _useState10[1];
|
|
2019
|
+
var _useState11 = React.useState(false),
|
|
2020
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
2021
|
+
exporting = _useState12[0],
|
|
2022
|
+
setExporting = _useState12[1];
|
|
1516
2023
|
var open = Boolean(anchorEl);
|
|
1517
2024
|
var handleClick = function handleClick(e) {
|
|
1518
2025
|
setAnchorEl(e.currentTarget);
|
|
@@ -1745,15 +2252,15 @@ var DefaultDownloadButton = mobxReactLite.observer(function (_ref1) {
|
|
|
1745
2252
|
});
|
|
1746
2253
|
|
|
1747
2254
|
// Import button — loads a JSON template file into the store
|
|
1748
|
-
var DefaultImportButton = mobxReactLite.observer(function (
|
|
1749
|
-
var store =
|
|
1750
|
-
var
|
|
1751
|
-
|
|
1752
|
-
importing =
|
|
1753
|
-
setImporting =
|
|
2255
|
+
var DefaultImportButton = mobxReactLite.observer(function (_ref12) {
|
|
2256
|
+
var store = _ref12.store;
|
|
2257
|
+
var _useState13 = React.useState(false),
|
|
2258
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
2259
|
+
importing = _useState14[0],
|
|
2260
|
+
setImporting = _useState14[1];
|
|
1754
2261
|
var fileInputRef = React.useRef(null);
|
|
1755
2262
|
var handleFileChange = React.useCallback(/*#__PURE__*/function () {
|
|
1756
|
-
var
|
|
2263
|
+
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(e) {
|
|
1757
2264
|
var _e$target$files;
|
|
1758
2265
|
var file, text, jsonData, _t3;
|
|
1759
2266
|
return _regenerator().w(function (_context2) {
|
|
@@ -1791,7 +2298,7 @@ var DefaultImportButton = mobxReactLite.observer(function (_ref11) {
|
|
|
1791
2298
|
}, _callee2, null, [[2, 4, 5, 6]]);
|
|
1792
2299
|
}));
|
|
1793
2300
|
return function (_x) {
|
|
1794
|
-
return
|
|
2301
|
+
return _ref13.apply(this, arguments);
|
|
1795
2302
|
};
|
|
1796
2303
|
}(), [store]);
|
|
1797
2304
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -1857,10 +2364,10 @@ var rowSx = {
|
|
|
1857
2364
|
display: 'none'
|
|
1858
2365
|
}
|
|
1859
2366
|
};
|
|
1860
|
-
var Toolbar = mobxReactLite.observer(function (
|
|
1861
|
-
var store =
|
|
1862
|
-
|
|
1863
|
-
components =
|
|
2367
|
+
var Toolbar = mobxReactLite.observer(function (_ref14) {
|
|
2368
|
+
var store = _ref14.store,
|
|
2369
|
+
_ref14$components = _ref14.components,
|
|
2370
|
+
components = _ref14$components === void 0 ? {} : _ref14$components;
|
|
1864
2371
|
var ActionControls = components.ActionControls;
|
|
1865
2372
|
var ImportButton = 'ImportButton' in components ? components.ImportButton : DefaultImportButton;
|
|
1866
2373
|
var DownloadButton = 'DownloadButton' in components ? components.DownloadButton : DefaultDownloadButton;
|