@zhenryx/react-editor 0.1.0 → 0.1.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/style.css CHANGED
@@ -546,7 +546,7 @@
546
546
  padding: 4px 8px;
547
547
  }
548
548
  .rre-root.is-narrow .rre-tools-scroll {
549
- padding-right: 128px;
549
+ padding-right: 0;
550
550
  }
551
551
  .rre-root.is-narrow .rre-tool {
552
552
  min-width: 46px;
@@ -559,10 +559,15 @@
559
559
  height: 17px;
560
560
  }
561
561
  .rre-root.is-narrow .rre-right {
562
- right: 8px;
563
- padding: 0;
562
+ position: static;
563
+ top: auto;
564
+ right: auto;
565
+ order: 2;
566
+ padding: 0 8px 0 10px;
567
+ border-left: 1px solid var(--rre-line-soft);
564
568
  background: #fff;
565
- box-shadow: -10px 0 12px rgba(255, 255, 255, 0.95);
569
+ box-shadow: none;
570
+ transform: none;
566
571
  }
567
572
  .rre-root.is-narrow .rre-switch {
568
573
  height: 32px;
@@ -735,7 +740,7 @@
735
740
  padding-right: 140px;
736
741
  }
737
742
  .rre-root.is-narrow .rre-tools-scroll {
738
- padding-right: 128px;
743
+ padding-right: 0;
739
744
  }
740
745
  .rre-root .rre-run-mask {
741
746
  position: fixed;
@@ -959,6 +964,216 @@
959
964
  border-left: 0;
960
965
  }
961
966
  }
967
+
968
+ /* ============================================================
969
+ 图片尺寸 / 对齐 / 图注 + 选中框 + 图像属性(2026-11-19)
970
+ ============================================================ */
971
+ .rre-root .rre-input img[data-kb-w] {
972
+ width: var(--kbw, 75%);
973
+ height: var(--kbh, auto);
974
+ max-width: 100%;
975
+ }
976
+ .rre-root .rre-input img[data-kb-align=center] {
977
+ display: block;
978
+ margin-left: auto;
979
+ margin-right: auto;
980
+ }
981
+ .rre-root .rre-input img[data-kb-align=left] {
982
+ display: block;
983
+ margin-right: auto;
984
+ margin-left: 0;
985
+ }
986
+ .rre-root .rre-input img[data-kb-align=right] {
987
+ display: block;
988
+ margin-left: auto;
989
+ margin-right: 0;
990
+ }
991
+ .rre-root .rre-input figure.kb-figure {
992
+ margin: 14px 0;
993
+ }
994
+ .rre-root .rre-input figure.kb-figure[data-kb-align=center] {
995
+ text-align: center;
996
+ }
997
+ .rre-root .rre-input figure.kb-figure[data-kb-align=right] {
998
+ text-align: right;
999
+ }
1000
+ .rre-root .rre-input .kb-figure figcaption {
1001
+ margin-top: 6px;
1002
+ color: var(--rre-muted);
1003
+ font-size: 12px;
1004
+ line-height: 1.6;
1005
+ }
1006
+ .rre-root {
1007
+ /* 选中框 */
1008
+ }
1009
+ .rre-root .rre-img-tool {
1010
+ position: fixed;
1011
+ z-index: 90;
1012
+ border: 2px solid #2b7fff;
1013
+ border-radius: 2px;
1014
+ pointer-events: none;
1015
+ }
1016
+ .rre-root .rre-img-edit {
1017
+ position: absolute;
1018
+ bottom: -30px;
1019
+ left: 50%;
1020
+ display: inline-flex;
1021
+ align-items: center;
1022
+ justify-content: center;
1023
+ height: 30px;
1024
+ padding: 0 14px;
1025
+ border: 0;
1026
+ border-radius: 5px;
1027
+ background: rgba(17, 24, 39, 0.86);
1028
+ color: #fff;
1029
+ font: inherit;
1030
+ font-size: 12px;
1031
+ cursor: pointer;
1032
+ pointer-events: auto;
1033
+ transform: translateX(-50%);
1034
+ }
1035
+ .rre-root .rre-img-handle {
1036
+ position: absolute;
1037
+ right: -6px;
1038
+ bottom: -6px;
1039
+ width: 13px;
1040
+ height: 13px;
1041
+ border: 2px solid #fff;
1042
+ border-radius: 2px;
1043
+ background: #2b7fff;
1044
+ cursor: nwse-resize;
1045
+ pointer-events: auto;
1046
+ }
1047
+ .rre-root {
1048
+ /* 图像属性弹窗 */
1049
+ }
1050
+ .rre-root .rre-img-dialog-mask {
1051
+ position: fixed;
1052
+ inset: 0;
1053
+ z-index: 130;
1054
+ display: flex;
1055
+ align-items: center;
1056
+ justify-content: center;
1057
+ padding: 16px;
1058
+ background: rgba(15, 23, 42, 0.4);
1059
+ }
1060
+ .rre-root .rre-img-dialog {
1061
+ width: min(520px, 100%);
1062
+ max-height: calc(100vh - 32px);
1063
+ overflow: auto;
1064
+ padding: 18px 20px;
1065
+ border-radius: 8px;
1066
+ background: #fff;
1067
+ box-shadow: 0 24px 60px rgba(17, 24, 39, 0.28);
1068
+ }
1069
+ .rre-root .rre-img-dialog-head {
1070
+ display: flex;
1071
+ align-items: center;
1072
+ justify-content: space-between;
1073
+ margin-bottom: 14px;
1074
+ }
1075
+ .rre-root .rre-img-dialog-head b {
1076
+ color: var(--rre-ink);
1077
+ font-size: 15px;
1078
+ }
1079
+ .rre-root .rre-img-dialog-head button {
1080
+ width: 24px;
1081
+ height: 24px;
1082
+ padding: 0;
1083
+ border: 0;
1084
+ border-radius: 5px;
1085
+ background: transparent;
1086
+ color: var(--rre-muted);
1087
+ font-size: 18px;
1088
+ line-height: 1;
1089
+ cursor: pointer;
1090
+ }
1091
+ .rre-root .rre-img-field {
1092
+ display: flex;
1093
+ flex-direction: column;
1094
+ gap: 6px;
1095
+ margin-bottom: 10px;
1096
+ }
1097
+ .rre-root .rre-img-field > span {
1098
+ color: var(--rre-muted);
1099
+ font-size: 11px;
1100
+ }
1101
+ .rre-root .rre-img-field input {
1102
+ height: 32px;
1103
+ padding: 0 9px;
1104
+ border: 1px solid var(--rre-line);
1105
+ border-radius: 5px;
1106
+ background: #fff;
1107
+ color: var(--rre-ink);
1108
+ font: inherit;
1109
+ font-size: 13px;
1110
+ outline: none;
1111
+ }
1112
+ .rre-root .rre-img-field input:focus {
1113
+ border-color: var(--rre-accent);
1114
+ }
1115
+ .rre-root .rre-img-size {
1116
+ display: flex;
1117
+ align-items: flex-end;
1118
+ gap: 10px;
1119
+ }
1120
+ .rre-root .rre-img-size .rre-img-field {
1121
+ flex: 1;
1122
+ min-width: 0;
1123
+ }
1124
+ .rre-root .rre-img-size-tools {
1125
+ display: flex;
1126
+ gap: 4px;
1127
+ margin-bottom: 13px;
1128
+ }
1129
+ .rre-root .rre-img-size-tools button {
1130
+ display: inline-flex;
1131
+ align-items: center;
1132
+ justify-content: center;
1133
+ width: 30px;
1134
+ height: 30px;
1135
+ padding: 0;
1136
+ border: 1px solid var(--rre-line);
1137
+ border-radius: 5px;
1138
+ background: #f8fafc;
1139
+ color: var(--rre-muted);
1140
+ cursor: pointer;
1141
+ }
1142
+ .rre-root .rre-img-size-tools button.is-on {
1143
+ border-color: var(--rre-accent);
1144
+ background: var(--rre-accent-soft);
1145
+ color: var(--rre-accent-deep);
1146
+ }
1147
+ .rre-root .rre-img-align {
1148
+ display: flex;
1149
+ flex-wrap: wrap;
1150
+ align-items: center;
1151
+ gap: 12px;
1152
+ margin: 4px 0 10px;
1153
+ color: var(--rre-muted);
1154
+ font-size: 12px;
1155
+ }
1156
+ .rre-root .rre-img-align label {
1157
+ display: inline-flex;
1158
+ align-items: center;
1159
+ gap: 4px;
1160
+ color: var(--rre-ink-2);
1161
+ font-size: 12px;
1162
+ }
1163
+ .rre-root .rre-img-caption-toggle {
1164
+ display: flex;
1165
+ align-items: center;
1166
+ gap: 6px;
1167
+ margin: 6px 0 10px;
1168
+ color: var(--rre-ink-2);
1169
+ font-size: 12px;
1170
+ }
1171
+ .rre-root .rre-img-dialog-foot {
1172
+ display: flex;
1173
+ justify-content: flex-end;
1174
+ gap: 8px;
1175
+ margin-top: 8px;
1176
+ }
962
1177
  @charset "UTF-8";
963
1178
  .rre-md-root {
964
1179
  --rre-line: #e3e8ef;
@@ -987,6 +1202,7 @@
987
1202
  flex: none;
988
1203
  align-items: center;
989
1204
  justify-content: space-between;
1205
+ gap: 8px;
990
1206
  padding: 8px 12px;
991
1207
  border-bottom: 1px solid var(--rre-line-soft);
992
1208
  background: #fff;
@@ -994,8 +1210,15 @@
994
1210
  .rre-md-root .rre-md-mode-group {
995
1211
  display: flex;
996
1212
  gap: 4px;
1213
+ min-width: 0;
1214
+ overflow-x: auto;
1215
+ scrollbar-width: none;
1216
+ }
1217
+ .rre-md-root .rre-md-mode-group::-webkit-scrollbar {
1218
+ display: none;
997
1219
  }
998
1220
  .rre-md-root .rre-md-mode-group button {
1221
+ flex: none;
999
1222
  height: 30px;
1000
1223
  padding: 0 12px;
1001
1224
  border: 0;
@@ -1890,3 +2113,36 @@
1890
2113
  right: 6px;
1891
2114
  }
1892
2115
  }
2116
+ /* 图片尺寸 / 对齐 / 图注(预览) */
2117
+ .rre-md-root .rre-md-preview img[data-kb-w] {
2118
+ width: var(--kbw, 75%);
2119
+ height: var(--kbh, auto);
2120
+ max-width: 100%;
2121
+ }
2122
+ .rre-md-root .rre-md-preview img[data-kb-align=center] {
2123
+ display: block;
2124
+ margin-left: auto;
2125
+ margin-right: auto;
2126
+ }
2127
+ .rre-md-root .rre-md-preview img[data-kb-align=left] {
2128
+ display: block;
2129
+ margin-right: auto;
2130
+ margin-left: 0;
2131
+ }
2132
+ .rre-md-root .rre-md-preview img[data-kb-align=right] {
2133
+ display: block;
2134
+ margin-left: auto;
2135
+ margin-right: 0;
2136
+ }
2137
+ .rre-md-root .rre-md-preview figure.kb-figure {
2138
+ margin: 14px 0;
2139
+ }
2140
+ .rre-md-root .rre-md-preview figure.kb-figure[data-kb-align=center] {
2141
+ text-align: center;
2142
+ }
2143
+ .rre-md-root .rre-md-preview .kb-figure figcaption {
2144
+ margin-top: 6px;
2145
+ color: var(--rre-muted);
2146
+ font-size: 12px;
2147
+ line-height: 1.6;
2148
+ }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.0",
6
+ "version": "0.1.2",
7
7
  "description": "A Markdown-backed rich text editor for React 19",
8
8
  "type": "module",
9
9
  "sideEffects": [