@standhigher/react-email-editor 0.2.0 → 0.3.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 +25 -0
- package/README.md +36 -9
- package/README.zh-CN.md +36 -9
- package/dist/index.d.ts +308 -105
- package/dist/index.js +4512 -4016
- package/dist/styles.css +216 -39
- package/docs/custom-blocks.md +491 -0
- package/docs/custom-blocks.zh-CN.md +490 -0
- package/package.json +3 -1
package/dist/styles.css
CHANGED
|
@@ -248,6 +248,46 @@
|
|
|
248
248
|
cursor: default;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
+
.ree-switch-control {
|
|
252
|
+
width: 100%;
|
|
253
|
+
justify-content: space-between;
|
|
254
|
+
flex-direction: row-reverse;
|
|
255
|
+
font-size: 13px;
|
|
256
|
+
color: var(--ree-muted, #6d7175);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.ree-switch-control input {
|
|
260
|
+
display: flex;
|
|
261
|
+
align-items: center;
|
|
262
|
+
width: 32px;
|
|
263
|
+
height: 20px;
|
|
264
|
+
padding: 2px;
|
|
265
|
+
border: 0;
|
|
266
|
+
border-radius: 999px;
|
|
267
|
+
background: #b5b5b5;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.ree-switch-control input::before,
|
|
271
|
+
.ree-switch-control input:checked::before {
|
|
272
|
+
content: "";
|
|
273
|
+
width: 16px;
|
|
274
|
+
height: 16px;
|
|
275
|
+
margin: 0;
|
|
276
|
+
border: 0;
|
|
277
|
+
border-radius: 50%;
|
|
278
|
+
background: #ffffff;
|
|
279
|
+
transform: none;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.ree-switch-control input:checked::before {
|
|
283
|
+
transform: translateX(12px);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.ree-switch-control input:focus-visible {
|
|
287
|
+
border: 2px solid #202223;
|
|
288
|
+
padding: 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
251
291
|
.ree-range {
|
|
252
292
|
-webkit-appearance: none;
|
|
253
293
|
appearance: none;
|
|
@@ -375,6 +415,75 @@
|
|
|
375
415
|
padding: calc(var(--ree-button-padding-y) - 1px) calc(var(--ree-button-padding-x) - 1px);
|
|
376
416
|
}
|
|
377
417
|
|
|
418
|
+
.ree-btn-icon {
|
|
419
|
+
display: inline-flex;
|
|
420
|
+
align-items: center;
|
|
421
|
+
justify-content: center;
|
|
422
|
+
flex-shrink: 0;
|
|
423
|
+
width: 30px;
|
|
424
|
+
height: 30px;
|
|
425
|
+
--ree-button-padding-y: 0px;
|
|
426
|
+
--ree-button-padding-x: 0px;
|
|
427
|
+
border-color: transparent;
|
|
428
|
+
border-radius: 6px;
|
|
429
|
+
background: transparent;
|
|
430
|
+
color: var(--ree-muted);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.ree-btn-icon:hover {
|
|
434
|
+
border-color: transparent;
|
|
435
|
+
color: var(--ree-text);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.ree-btn-icon:focus-visible {
|
|
439
|
+
padding: 0;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.ree-btn-has-tooltip {
|
|
443
|
+
position: relative;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.ree-block-tooltip,
|
|
447
|
+
.ree-btn-tooltip {
|
|
448
|
+
position: absolute;
|
|
449
|
+
top: calc(100% + 8px);
|
|
450
|
+
left: 0;
|
|
451
|
+
z-index: 10;
|
|
452
|
+
display: none;
|
|
453
|
+
padding: 6px 9px;
|
|
454
|
+
border-radius: var(--ree-radius-sm);
|
|
455
|
+
background: var(--ree-text);
|
|
456
|
+
color: var(--ree-panel);
|
|
457
|
+
box-shadow: var(--ree-shadow-md);
|
|
458
|
+
font-size: 12px;
|
|
459
|
+
font-weight: 500;
|
|
460
|
+
line-height: 1.4;
|
|
461
|
+
white-space: nowrap;
|
|
462
|
+
cursor: default;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.ree-block-tooltip::before,
|
|
466
|
+
.ree-btn-tooltip::before {
|
|
467
|
+
content: "";
|
|
468
|
+
position: absolute;
|
|
469
|
+
top: -8px;
|
|
470
|
+
left: 0;
|
|
471
|
+
width: 100%;
|
|
472
|
+
height: 8px;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.ree-btn-tooltip {
|
|
476
|
+
text-transform: none;
|
|
477
|
+
letter-spacing: normal;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.ree-block-btn:hover .ree-block-tooltip,
|
|
481
|
+
.ree-block-btn:focus-visible .ree-block-tooltip,
|
|
482
|
+
.ree-btn-has-tooltip:hover .ree-btn-tooltip,
|
|
483
|
+
.ree-btn-has-tooltip:focus-visible .ree-btn-tooltip {
|
|
484
|
+
display: block;
|
|
485
|
+
}
|
|
486
|
+
|
|
378
487
|
.ree-reset {
|
|
379
488
|
appearance: none;
|
|
380
489
|
display: inline-flex;
|
|
@@ -534,17 +643,28 @@
|
|
|
534
643
|
color: var(--ree-text);
|
|
535
644
|
}
|
|
536
645
|
|
|
537
|
-
.ree-subject-
|
|
646
|
+
.ree-subject-field {
|
|
647
|
+
position: relative;
|
|
538
648
|
flex: 1 1 360px;
|
|
539
|
-
min-width: 240px;
|
|
540
|
-
|
|
649
|
+
min-width: min(240px, 100%);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.ree-subject-input {
|
|
653
|
+
--ree-control-padding-end: 76px;
|
|
541
654
|
}
|
|
542
655
|
|
|
543
656
|
.ree-subject-count {
|
|
544
|
-
|
|
657
|
+
position: absolute;
|
|
658
|
+
top: 0;
|
|
659
|
+
right: 12px;
|
|
660
|
+
bottom: 0;
|
|
661
|
+
display: flex;
|
|
662
|
+
align-items: center;
|
|
545
663
|
color: var(--ree-muted);
|
|
546
664
|
font-size: 13px;
|
|
547
665
|
font-variant-numeric: tabular-nums;
|
|
666
|
+
white-space: nowrap;
|
|
667
|
+
pointer-events: none;
|
|
548
668
|
}
|
|
549
669
|
|
|
550
670
|
.ree-personalization {
|
|
@@ -741,6 +861,47 @@
|
|
|
741
861
|
flex-shrink: 0;
|
|
742
862
|
}
|
|
743
863
|
|
|
864
|
+
.ree-library-head {
|
|
865
|
+
justify-content: space-between;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
.ree-col-left.is-collapsed {
|
|
869
|
+
width: 52px;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.ree-col-left.is-collapsed .ree-library-head {
|
|
873
|
+
justify-content: center;
|
|
874
|
+
padding-left: 7px;
|
|
875
|
+
padding-right: 7px;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
.ree-col-left:not(.is-collapsed) .ree-library-expand,
|
|
879
|
+
.ree-col-left.is-collapsed .ree-library-collapse,
|
|
880
|
+
.ree-col-left.is-collapsed .ree-library-label {
|
|
881
|
+
display: none;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
@media (width < 1375px) {
|
|
885
|
+
.ree-col-left:not(.is-expanded) {
|
|
886
|
+
width: 52px;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.ree-col-left:not(.is-expanded) .ree-library-head {
|
|
890
|
+
justify-content: center;
|
|
891
|
+
padding-left: 7px;
|
|
892
|
+
padding-right: 7px;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.ree-col-left:not(.is-expanded) .ree-library-label,
|
|
896
|
+
.ree-col-left:not(.is-expanded) .ree-library-collapse {
|
|
897
|
+
display: none;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.ree-col-left:not(.is-expanded) .ree-library-expand {
|
|
901
|
+
display: inline-flex;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
744
905
|
.ree-col-center {
|
|
745
906
|
flex: 1;
|
|
746
907
|
min-width: 0;
|
|
@@ -812,6 +973,42 @@
|
|
|
812
973
|
font-weight: 500;
|
|
813
974
|
}
|
|
814
975
|
|
|
976
|
+
.ree-col-left.is-collapsed .ree-lib {
|
|
977
|
+
grid-template-columns: 1fr;
|
|
978
|
+
gap: 8px;
|
|
979
|
+
padding: 12px 7px;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.ree-col-left.is-collapsed .ree-lib-item {
|
|
983
|
+
justify-content: center;
|
|
984
|
+
min-height: 38px;
|
|
985
|
+
gap: 0;
|
|
986
|
+
padding: 8px;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
.ree-col-left.is-collapsed .ree-lib-title {
|
|
990
|
+
display: none;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
@media (width < 1375px) {
|
|
994
|
+
.ree-col-left:not(.is-expanded) .ree-lib {
|
|
995
|
+
grid-template-columns: 1fr;
|
|
996
|
+
gap: 8px;
|
|
997
|
+
padding: 12px 7px;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.ree-col-left:not(.is-expanded) .ree-lib-item {
|
|
1001
|
+
justify-content: center;
|
|
1002
|
+
min-height: 38px;
|
|
1003
|
+
gap: 0;
|
|
1004
|
+
padding: 8px;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.ree-col-left:not(.is-expanded) .ree-lib-title {
|
|
1008
|
+
display: none;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
815
1012
|
|
|
816
1013
|
/* ---------- 画布 ---------- */
|
|
817
1014
|
|
|
@@ -1093,38 +1290,6 @@
|
|
|
1093
1290
|
color: var(--ree-danger);
|
|
1094
1291
|
}
|
|
1095
1292
|
|
|
1096
|
-
.ree-block-tooltip {
|
|
1097
|
-
position: absolute;
|
|
1098
|
-
top: calc(100% + 8px);
|
|
1099
|
-
left: 0;
|
|
1100
|
-
z-index: 10;
|
|
1101
|
-
display: none;
|
|
1102
|
-
padding: 6px 9px;
|
|
1103
|
-
border-radius: var(--ree-radius-sm);
|
|
1104
|
-
background: var(--ree-text);
|
|
1105
|
-
color: var(--ree-panel);
|
|
1106
|
-
box-shadow: var(--ree-shadow-md);
|
|
1107
|
-
font-size: 12px;
|
|
1108
|
-
font-weight: 500;
|
|
1109
|
-
line-height: 1.4;
|
|
1110
|
-
white-space: nowrap;
|
|
1111
|
-
cursor: default;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
.ree-block-tooltip::before {
|
|
1115
|
-
content: "";
|
|
1116
|
-
position: absolute;
|
|
1117
|
-
top: -8px;
|
|
1118
|
-
left: 0;
|
|
1119
|
-
width: 100%;
|
|
1120
|
-
height: 8px;
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
.ree-block-btn:hover .ree-block-tooltip,
|
|
1124
|
-
.ree-block-btn:focus-visible .ree-block-tooltip {
|
|
1125
|
-
display: block;
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
1293
|
.ree-block-content {
|
|
1129
1294
|
width: 100%;
|
|
1130
1295
|
overflow: hidden;
|
|
@@ -1650,13 +1815,13 @@
|
|
|
1650
1815
|
padding-bottom: var(--ree-inspector-section-space);
|
|
1651
1816
|
}
|
|
1652
1817
|
|
|
1653
|
-
/*
|
|
1654
|
-
.ree-inspector-
|
|
1818
|
+
/* Body 没有标题区,容器顶部留白会叠到第一个类目上。 */
|
|
1819
|
+
.ree-inspector-body {
|
|
1655
1820
|
padding-top: 0;
|
|
1656
1821
|
padding-bottom: 0;
|
|
1657
1822
|
}
|
|
1658
1823
|
|
|
1659
|
-
.ree-inspector-
|
|
1824
|
+
.ree-inspector-body > .ree-inspector-section:first-child {
|
|
1660
1825
|
border-top: 0;
|
|
1661
1826
|
}
|
|
1662
1827
|
|
|
@@ -1904,3 +2069,15 @@
|
|
|
1904
2069
|
cursor: grabbing;
|
|
1905
2070
|
font-weight: 500;
|
|
1906
2071
|
}
|
|
2072
|
+
|
|
2073
|
+
.ree-plugin-field { min-width: 0; }
|
|
2074
|
+
.ree-plugin-error { margin: 8px 0; padding: 8px; color: #b42318; font-size: 13px; overflow-wrap: anywhere; }
|
|
2075
|
+
.ree-plugin-empty { margin: 6px 0; color: #737373; font-size: 12px; }
|
|
2076
|
+
.ree-plugin-list { min-width: 0; margin: 0; padding: 10px; border: 1px solid #e3e3e5; border-radius: 6px; }
|
|
2077
|
+
.ree-plugin-list-item { display: grid; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e3e3e5; }
|
|
2078
|
+
.ree-plugin-list-actions { display: flex; align-items: center; gap: 4px; }
|
|
2079
|
+
.ree-plugin-list-actions > span { margin-right: auto; }
|
|
2080
|
+
.ree-plugin-image { display: block; max-width: 100%; max-height: 120px; object-fit: contain; }
|
|
2081
|
+
.ree-plugin-richtext { min-height: 64px; padding: 8px; border: 1px solid #e3e3e5; border-radius: 4px; }
|
|
2082
|
+
.ree-plugin-richtext:focus-within { border-color: #000000; }
|
|
2083
|
+
.ree-plugin-richtext .ProseMirror { min-height: 48px; outline: none; }
|