@wordpress/edit-site 3.0.11 → 3.0.15
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/build/components/add-new-template/new-template-part.js +34 -17
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +41 -22
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/index.js +3 -1
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +4 -4
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +71 -0
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -0
- package/build/components/global-styles/hooks.js +5 -5
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +11 -5
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +3 -1
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +23 -3
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +3 -1
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +3 -1
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +54 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -0
- package/build/components/global-styles/screen-typography.js +74 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +28 -8
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +12 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +2 -2
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/list/actions/index.js +104 -0
- package/build/components/list/actions/index.js.map +1 -0
- package/build/components/list/actions/rename-menu-item.js +112 -0
- package/build/components/list/actions/rename-menu-item.js.map +1 -0
- package/build/components/list/added-by.js +180 -0
- package/build/components/list/added-by.js.map +1 -0
- package/build/components/list/index.js +18 -3
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +58 -67
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +12 -11
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +28 -11
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +14 -5
- package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build/components/template-details/edit-template-title.js +33 -0
- package/build/components/template-details/edit-template-title.js.map +1 -0
- package/build/components/template-details/index.js +6 -2
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +1 -1
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/index.js +8 -2
- package/build/index.js.map +1 -1
- package/build/store/actions.js +47 -18
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +25 -5
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +30 -16
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +40 -23
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/index.js +2 -1
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +5 -5
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +60 -0
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +5 -5
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +12 -5
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +3 -1
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +22 -3
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +3 -1
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +3 -1
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +41 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -0
- package/build-module/components/global-styles/screen-typography.js +70 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +28 -8
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +11 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +2 -2
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/list/actions/index.js +85 -0
- package/build-module/components/list/actions/index.js.map +1 -0
- package/build-module/components/list/actions/rename-menu-item.js +101 -0
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -0
- package/build-module/components/list/added-by.js +166 -0
- package/build-module/components/list/added-by.js.map +1 -0
- package/build-module/components/list/index.js +15 -3
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +60 -69
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +11 -12
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +26 -12
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +14 -6
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
- package/build-module/components/template-details/edit-template-title.js +23 -0
- package/build-module/components/template-details/edit-template-title.js.map +1 -0
- package/build-module/components/template-details/index.js +5 -2
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +1 -1
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/index.js +8 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +48 -19
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +21 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +146 -21
- package/build-style/style.css +146 -21
- package/package.json +10 -8
- package/src/components/add-new-template/new-template-part.js +32 -17
- package/src/components/add-new-template/new-template.js +39 -19
- package/src/components/block-editor/index.js +2 -0
- package/src/components/global-styles/color-palette-panel.js +5 -5
- package/src/components/global-styles/gradients-palette-panel.js +99 -0
- package/src/components/global-styles/hooks.js +4 -4
- package/src/components/global-styles/palette.js +30 -10
- package/src/components/global-styles/screen-background-color.js +2 -0
- package/src/components/global-styles/screen-color-palette.js +30 -3
- package/src/components/global-styles/screen-link-color.js +2 -0
- package/src/components/global-styles/screen-text-color.js +2 -0
- package/src/components/global-styles/screen-typography-element.js +39 -0
- package/src/components/global-styles/screen-typography.js +84 -3
- package/src/components/global-styles/style.scss +45 -6
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/test/utils.js +1 -1
- package/src/components/global-styles/typography-panel.js +37 -7
- package/src/components/global-styles/ui.js +9 -0
- package/src/components/global-styles/use-global-styles-output.js +2 -2
- package/src/components/global-styles/utils.js +1 -1
- package/src/components/list/actions/index.js +95 -0
- package/src/components/list/actions/rename-menu-item.js +134 -0
- package/src/components/list/added-by.js +179 -0
- package/src/components/list/index.js +27 -11
- package/src/components/list/style.scss +106 -11
- package/src/components/list/table.js +65 -75
- package/src/components/navigation-sidebar/index.js +9 -16
- package/src/components/navigation-sidebar/navigation-panel/index.js +25 -9
- package/src/components/navigation-sidebar/navigation-toggle/index.js +29 -17
- package/src/components/navigation-sidebar/navigation-toggle/test/index.js +2 -0
- package/src/components/sidebar/style.scss +2 -1
- package/src/components/template-details/edit-template-title.js +28 -0
- package/src/components/template-details/index.js +13 -8
- package/src/components/template-details/template-areas.js +1 -1
- package/src/index.js +10 -2
- package/src/store/actions.js +82 -34
- package/src/store/selectors.js +22 -4
- package/src/store/test/actions.js +0 -24
- package/src/store/test/selectors.js +24 -0
|
@@ -535,6 +535,30 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
535
535
|
padding: 0;
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
+
.edit-site-typography-panel__preview {
|
|
539
|
+
display: flex;
|
|
540
|
+
align-items: center;
|
|
541
|
+
justify-content: center;
|
|
542
|
+
min-height: 100px;
|
|
543
|
+
margin-bottom: 16px;
|
|
544
|
+
background: #f0f0f0;
|
|
545
|
+
border-radius: 2px;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.edit-site-global-styles-screen-typography {
|
|
549
|
+
margin: 16px;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.edit-site-global-styles-screen-typography__indicator {
|
|
553
|
+
height: 24px;
|
|
554
|
+
width: 24px;
|
|
555
|
+
font-size: 14px;
|
|
556
|
+
display: flex !important;
|
|
557
|
+
align-items: center;
|
|
558
|
+
justify-content: center;
|
|
559
|
+
border-radius: 2px;
|
|
560
|
+
}
|
|
561
|
+
|
|
538
562
|
.edit-site-global-styles-screen-colors {
|
|
539
563
|
margin: 16px;
|
|
540
564
|
}
|
|
@@ -542,13 +566,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
542
566
|
margin-right: 0;
|
|
543
567
|
display: block;
|
|
544
568
|
border-radius: 50%;
|
|
545
|
-
border: 0;
|
|
546
569
|
height: 24px;
|
|
547
570
|
width: 24px;
|
|
548
571
|
padding: 0;
|
|
549
|
-
|
|
550
|
-
background
|
|
551
|
-
background-size: calc(2 * 5px) calc(2 * 5px);
|
|
572
|
+
border: 1px solid #ddd;
|
|
573
|
+
background: linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
552
574
|
}
|
|
553
575
|
|
|
554
576
|
.edit-site-global-styles-header__description {
|
|
@@ -561,6 +583,23 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
561
583
|
font-weight: 500;
|
|
562
584
|
}
|
|
563
585
|
|
|
586
|
+
.edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle {
|
|
587
|
+
margin-left: 16px;
|
|
588
|
+
margin-right: 16px;
|
|
589
|
+
width: unset;
|
|
590
|
+
}
|
|
591
|
+
.edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle .components-toggle-group-control {
|
|
592
|
+
min-height: 32px;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
h2.edit-site-global-styles-gradient-palette-panel__duotone-heading.components-heading {
|
|
596
|
+
text-transform: uppercase;
|
|
597
|
+
line-height: 24px;
|
|
598
|
+
font-weight: 500;
|
|
599
|
+
font-size: 11px;
|
|
600
|
+
margin-bottom: 8px;
|
|
601
|
+
}
|
|
602
|
+
|
|
564
603
|
.edit-site-header {
|
|
565
604
|
align-items: center;
|
|
566
605
|
background-color: #fff;
|
|
@@ -1099,12 +1138,14 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1099
1138
|
|
|
1100
1139
|
.edit-site-list-table {
|
|
1101
1140
|
width: 100%;
|
|
1102
|
-
border: 1px solid #
|
|
1141
|
+
border: 1px solid #ddd;
|
|
1103
1142
|
border-radius: 2px;
|
|
1104
1143
|
margin: 0;
|
|
1105
1144
|
overflow: hidden;
|
|
1145
|
+
border-spacing: 0;
|
|
1146
|
+
max-width: 960px;
|
|
1106
1147
|
}
|
|
1107
|
-
.edit-site-list-table
|
|
1148
|
+
.edit-site-list-table tr {
|
|
1108
1149
|
display: flex;
|
|
1109
1150
|
align-items: center;
|
|
1110
1151
|
padding: 16px;
|
|
@@ -1112,36 +1153,119 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1112
1153
|
border-top: 1px solid #f0f0f0;
|
|
1113
1154
|
margin: 0;
|
|
1114
1155
|
}
|
|
1156
|
+
.edit-site-list-table tr:first-child {
|
|
1157
|
+
border-top: 0;
|
|
1158
|
+
}
|
|
1115
1159
|
@media (min-width: 782px) {
|
|
1116
|
-
.edit-site-list-table
|
|
1160
|
+
.edit-site-list-table tr {
|
|
1117
1161
|
padding: 24px 32px;
|
|
1118
1162
|
}
|
|
1119
1163
|
}
|
|
1120
|
-
.edit-site-list-table
|
|
1121
|
-
width: calc(60% -
|
|
1164
|
+
.edit-site-list-table tr .edit-site-list-table-column:nth-child(1) {
|
|
1165
|
+
width: calc(60% - 18px);
|
|
1166
|
+
padding-left: 24px;
|
|
1122
1167
|
}
|
|
1123
|
-
.edit-site-list-table
|
|
1124
|
-
display: block;
|
|
1168
|
+
.edit-site-list-table tr .edit-site-list-table-column:nth-child(1) a {
|
|
1169
|
+
display: inline-block;
|
|
1125
1170
|
text-decoration: none;
|
|
1126
1171
|
font-weight: 500;
|
|
1127
1172
|
margin-bottom: 4px;
|
|
1128
1173
|
}
|
|
1129
|
-
.edit-site-list-table
|
|
1130
|
-
width: calc(40% -
|
|
1174
|
+
.edit-site-list-table tr .edit-site-list-table-column:nth-child(2) {
|
|
1175
|
+
width: calc(40% - 18px);
|
|
1131
1176
|
}
|
|
1132
|
-
.edit-site-list-table
|
|
1177
|
+
.edit-site-list-table tr .edit-site-list-table-column:nth-child(3) {
|
|
1133
1178
|
min-width: 36px;
|
|
1179
|
+
flex-shrink: 0;
|
|
1134
1180
|
}
|
|
1135
|
-
.edit-site-list-table
|
|
1136
|
-
border-bottom: 1px solid #e0e0e0;
|
|
1181
|
+
.edit-site-list-table tr.edit-site-list-table-head {
|
|
1137
1182
|
font-size: 16px;
|
|
1138
|
-
font-weight:
|
|
1183
|
+
font-weight: 600;
|
|
1139
1184
|
text-align: right;
|
|
1140
|
-
color: #
|
|
1185
|
+
color: #1e1e1e;
|
|
1141
1186
|
border-top: none;
|
|
1187
|
+
border-bottom: 1px solid #ddd;
|
|
1142
1188
|
}
|
|
1143
|
-
.edit-site-list-table
|
|
1144
|
-
|
|
1189
|
+
.edit-site-list-table tr.edit-site-list-table-head th {
|
|
1190
|
+
font-weight: inherit;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
@media (min-width: 782px) {
|
|
1194
|
+
.edit-site-list.is-navigation-open .components-snackbar-list {
|
|
1195
|
+
margin-right: 300px;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
@media (min-width: 782px) {
|
|
1200
|
+
.edit-site-list__rename-modal .components-base-control {
|
|
1201
|
+
width: 320px;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
.edit-site-list__rename-modal .components-modal__header {
|
|
1205
|
+
border-bottom: none;
|
|
1206
|
+
}
|
|
1207
|
+
.edit-site-list__rename-modal .components-modal__content::before {
|
|
1208
|
+
margin-bottom: 4px;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
.edit-site-list__rename-modal-actions {
|
|
1212
|
+
margin-top: 12px;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.edit-site-template__actions button:not(:last-child) {
|
|
1216
|
+
margin-left: 8px;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
.edit-site-list-added-by__icon {
|
|
1220
|
+
display: flex;
|
|
1221
|
+
flex-shrink: 0;
|
|
1222
|
+
position: relative;
|
|
1223
|
+
align-items: center;
|
|
1224
|
+
justify-content: center;
|
|
1225
|
+
width: 32px;
|
|
1226
|
+
height: 32px;
|
|
1227
|
+
background: #2f2f2f;
|
|
1228
|
+
border-radius: 100%;
|
|
1229
|
+
}
|
|
1230
|
+
.edit-site-list-added-by__icon svg {
|
|
1231
|
+
fill: #fff;
|
|
1232
|
+
}
|
|
1233
|
+
.edit-site-list-added-by__icon.is-customized::after {
|
|
1234
|
+
position: absolute;
|
|
1235
|
+
content: "";
|
|
1236
|
+
background: var(--wp-admin-theme-color);
|
|
1237
|
+
height: 8px;
|
|
1238
|
+
width: 8px;
|
|
1239
|
+
outline: 2px solid #fff;
|
|
1240
|
+
border-radius: 100%;
|
|
1241
|
+
top: -1px;
|
|
1242
|
+
left: -1px;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.edit-site-list-added-by__avatar {
|
|
1246
|
+
flex-shrink: 0;
|
|
1247
|
+
overflow: hidden;
|
|
1248
|
+
border-radius: 100%;
|
|
1249
|
+
background: #2f2f2f;
|
|
1250
|
+
width: 32px;
|
|
1251
|
+
height: 32px;
|
|
1252
|
+
}
|
|
1253
|
+
.edit-site-list-added-by__avatar img {
|
|
1254
|
+
width: 32px;
|
|
1255
|
+
height: 32px;
|
|
1256
|
+
-o-object-fit: cover;
|
|
1257
|
+
object-fit: cover;
|
|
1258
|
+
opacity: 0;
|
|
1259
|
+
transition: opacity 0.1s linear;
|
|
1260
|
+
}
|
|
1261
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1262
|
+
.edit-site-list-added-by__avatar img {
|
|
1263
|
+
transition-duration: 0s;
|
|
1264
|
+
transition-delay: 0s;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
.edit-site-list-added-by__avatar.is-loaded img {
|
|
1268
|
+
opacity: 1;
|
|
1145
1269
|
}
|
|
1146
1270
|
|
|
1147
1271
|
.edit-site-new-template-dropdown .components-dropdown-menu__toggle {
|
|
@@ -1212,7 +1336,8 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1212
1336
|
padding: 0 16px;
|
|
1213
1337
|
}
|
|
1214
1338
|
|
|
1215
|
-
.edit-site-global-styles-color-palette-panel
|
|
1339
|
+
.edit-site-global-styles-color-palette-panel,
|
|
1340
|
+
.edit-site-global-styles-gradient-palette-panel {
|
|
1216
1341
|
padding: 16px;
|
|
1217
1342
|
}
|
|
1218
1343
|
|
package/build-style/style.css
CHANGED
|
@@ -535,6 +535,30 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
535
535
|
padding: 0;
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
+
.edit-site-typography-panel__preview {
|
|
539
|
+
display: flex;
|
|
540
|
+
align-items: center;
|
|
541
|
+
justify-content: center;
|
|
542
|
+
min-height: 100px;
|
|
543
|
+
margin-bottom: 16px;
|
|
544
|
+
background: #f0f0f0;
|
|
545
|
+
border-radius: 2px;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.edit-site-global-styles-screen-typography {
|
|
549
|
+
margin: 16px;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.edit-site-global-styles-screen-typography__indicator {
|
|
553
|
+
height: 24px;
|
|
554
|
+
width: 24px;
|
|
555
|
+
font-size: 14px;
|
|
556
|
+
display: flex !important;
|
|
557
|
+
align-items: center;
|
|
558
|
+
justify-content: center;
|
|
559
|
+
border-radius: 2px;
|
|
560
|
+
}
|
|
561
|
+
|
|
538
562
|
.edit-site-global-styles-screen-colors {
|
|
539
563
|
margin: 16px;
|
|
540
564
|
}
|
|
@@ -542,13 +566,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
542
566
|
margin-left: 0;
|
|
543
567
|
display: block;
|
|
544
568
|
border-radius: 50%;
|
|
545
|
-
border: 0;
|
|
546
569
|
height: 24px;
|
|
547
570
|
width: 24px;
|
|
548
571
|
padding: 0;
|
|
549
|
-
|
|
550
|
-
background
|
|
551
|
-
background-size: calc(2 * 5px) calc(2 * 5px);
|
|
572
|
+
border: 1px solid #ddd;
|
|
573
|
+
background: linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
552
574
|
}
|
|
553
575
|
|
|
554
576
|
.edit-site-global-styles-header__description {
|
|
@@ -561,6 +583,23 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
561
583
|
font-weight: 500;
|
|
562
584
|
}
|
|
563
585
|
|
|
586
|
+
.edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle {
|
|
587
|
+
margin-right: 16px;
|
|
588
|
+
margin-left: 16px;
|
|
589
|
+
width: unset;
|
|
590
|
+
}
|
|
591
|
+
.edit-site-screen-color-palette-toggle.edit-site-screen-color-palette-toggle .components-toggle-group-control {
|
|
592
|
+
min-height: 32px;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
h2.edit-site-global-styles-gradient-palette-panel__duotone-heading.components-heading {
|
|
596
|
+
text-transform: uppercase;
|
|
597
|
+
line-height: 24px;
|
|
598
|
+
font-weight: 500;
|
|
599
|
+
font-size: 11px;
|
|
600
|
+
margin-bottom: 8px;
|
|
601
|
+
}
|
|
602
|
+
|
|
564
603
|
.edit-site-header {
|
|
565
604
|
align-items: center;
|
|
566
605
|
background-color: #fff;
|
|
@@ -1099,12 +1138,14 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1099
1138
|
|
|
1100
1139
|
.edit-site-list-table {
|
|
1101
1140
|
width: 100%;
|
|
1102
|
-
border: 1px solid #
|
|
1141
|
+
border: 1px solid #ddd;
|
|
1103
1142
|
border-radius: 2px;
|
|
1104
1143
|
margin: 0;
|
|
1105
1144
|
overflow: hidden;
|
|
1145
|
+
border-spacing: 0;
|
|
1146
|
+
max-width: 960px;
|
|
1106
1147
|
}
|
|
1107
|
-
.edit-site-list-table
|
|
1148
|
+
.edit-site-list-table tr {
|
|
1108
1149
|
display: flex;
|
|
1109
1150
|
align-items: center;
|
|
1110
1151
|
padding: 16px;
|
|
@@ -1112,36 +1153,119 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1112
1153
|
border-top: 1px solid #f0f0f0;
|
|
1113
1154
|
margin: 0;
|
|
1114
1155
|
}
|
|
1156
|
+
.edit-site-list-table tr:first-child {
|
|
1157
|
+
border-top: 0;
|
|
1158
|
+
}
|
|
1115
1159
|
@media (min-width: 782px) {
|
|
1116
|
-
.edit-site-list-table
|
|
1160
|
+
.edit-site-list-table tr {
|
|
1117
1161
|
padding: 24px 32px;
|
|
1118
1162
|
}
|
|
1119
1163
|
}
|
|
1120
|
-
.edit-site-list-table
|
|
1121
|
-
width: calc(60% -
|
|
1164
|
+
.edit-site-list-table tr .edit-site-list-table-column:nth-child(1) {
|
|
1165
|
+
width: calc(60% - 18px);
|
|
1166
|
+
padding-right: 24px;
|
|
1122
1167
|
}
|
|
1123
|
-
.edit-site-list-table
|
|
1124
|
-
display: block;
|
|
1168
|
+
.edit-site-list-table tr .edit-site-list-table-column:nth-child(1) a {
|
|
1169
|
+
display: inline-block;
|
|
1125
1170
|
text-decoration: none;
|
|
1126
1171
|
font-weight: 500;
|
|
1127
1172
|
margin-bottom: 4px;
|
|
1128
1173
|
}
|
|
1129
|
-
.edit-site-list-table
|
|
1130
|
-
width: calc(40% -
|
|
1174
|
+
.edit-site-list-table tr .edit-site-list-table-column:nth-child(2) {
|
|
1175
|
+
width: calc(40% - 18px);
|
|
1131
1176
|
}
|
|
1132
|
-
.edit-site-list-table
|
|
1177
|
+
.edit-site-list-table tr .edit-site-list-table-column:nth-child(3) {
|
|
1133
1178
|
min-width: 36px;
|
|
1179
|
+
flex-shrink: 0;
|
|
1134
1180
|
}
|
|
1135
|
-
.edit-site-list-table
|
|
1136
|
-
border-bottom: 1px solid #e0e0e0;
|
|
1181
|
+
.edit-site-list-table tr.edit-site-list-table-head {
|
|
1137
1182
|
font-size: 16px;
|
|
1138
|
-
font-weight:
|
|
1183
|
+
font-weight: 600;
|
|
1139
1184
|
text-align: left;
|
|
1140
|
-
color: #
|
|
1185
|
+
color: #1e1e1e;
|
|
1141
1186
|
border-top: none;
|
|
1187
|
+
border-bottom: 1px solid #ddd;
|
|
1142
1188
|
}
|
|
1143
|
-
.edit-site-list-table
|
|
1144
|
-
|
|
1189
|
+
.edit-site-list-table tr.edit-site-list-table-head th {
|
|
1190
|
+
font-weight: inherit;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
@media (min-width: 782px) {
|
|
1194
|
+
.edit-site-list.is-navigation-open .components-snackbar-list {
|
|
1195
|
+
margin-left: 300px;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
@media (min-width: 782px) {
|
|
1200
|
+
.edit-site-list__rename-modal .components-base-control {
|
|
1201
|
+
width: 320px;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
.edit-site-list__rename-modal .components-modal__header {
|
|
1205
|
+
border-bottom: none;
|
|
1206
|
+
}
|
|
1207
|
+
.edit-site-list__rename-modal .components-modal__content::before {
|
|
1208
|
+
margin-bottom: 4px;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
.edit-site-list__rename-modal-actions {
|
|
1212
|
+
margin-top: 12px;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
.edit-site-template__actions button:not(:last-child) {
|
|
1216
|
+
margin-right: 8px;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
.edit-site-list-added-by__icon {
|
|
1220
|
+
display: flex;
|
|
1221
|
+
flex-shrink: 0;
|
|
1222
|
+
position: relative;
|
|
1223
|
+
align-items: center;
|
|
1224
|
+
justify-content: center;
|
|
1225
|
+
width: 32px;
|
|
1226
|
+
height: 32px;
|
|
1227
|
+
background: #2f2f2f;
|
|
1228
|
+
border-radius: 100%;
|
|
1229
|
+
}
|
|
1230
|
+
.edit-site-list-added-by__icon svg {
|
|
1231
|
+
fill: #fff;
|
|
1232
|
+
}
|
|
1233
|
+
.edit-site-list-added-by__icon.is-customized::after {
|
|
1234
|
+
position: absolute;
|
|
1235
|
+
content: "";
|
|
1236
|
+
background: var(--wp-admin-theme-color);
|
|
1237
|
+
height: 8px;
|
|
1238
|
+
width: 8px;
|
|
1239
|
+
outline: 2px solid #fff;
|
|
1240
|
+
border-radius: 100%;
|
|
1241
|
+
top: -1px;
|
|
1242
|
+
right: -1px;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
.edit-site-list-added-by__avatar {
|
|
1246
|
+
flex-shrink: 0;
|
|
1247
|
+
overflow: hidden;
|
|
1248
|
+
border-radius: 100%;
|
|
1249
|
+
background: #2f2f2f;
|
|
1250
|
+
width: 32px;
|
|
1251
|
+
height: 32px;
|
|
1252
|
+
}
|
|
1253
|
+
.edit-site-list-added-by__avatar img {
|
|
1254
|
+
width: 32px;
|
|
1255
|
+
height: 32px;
|
|
1256
|
+
-o-object-fit: cover;
|
|
1257
|
+
object-fit: cover;
|
|
1258
|
+
opacity: 0;
|
|
1259
|
+
transition: opacity 0.1s linear;
|
|
1260
|
+
}
|
|
1261
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1262
|
+
.edit-site-list-added-by__avatar img {
|
|
1263
|
+
transition-duration: 0s;
|
|
1264
|
+
transition-delay: 0s;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
.edit-site-list-added-by__avatar.is-loaded img {
|
|
1268
|
+
opacity: 1;
|
|
1145
1269
|
}
|
|
1146
1270
|
|
|
1147
1271
|
.edit-site-new-template-dropdown .components-dropdown-menu__toggle {
|
|
@@ -1212,7 +1336,8 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1212
1336
|
padding: 0 16px;
|
|
1213
1337
|
}
|
|
1214
1338
|
|
|
1215
|
-
.edit-site-global-styles-color-palette-panel
|
|
1339
|
+
.edit-site-global-styles-color-palette-panel,
|
|
1340
|
+
.edit-site-global-styles-gradient-palette-panel {
|
|
1216
1341
|
padding: 16px;
|
|
1217
1342
|
}
|
|
1218
1343
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.15",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -29,28 +29,30 @@
|
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
30
|
"@wordpress/a11y": "^3.2.4",
|
|
31
31
|
"@wordpress/api-fetch": "^5.2.6",
|
|
32
|
-
"@wordpress/block-editor": "^8.0.
|
|
33
|
-
"@wordpress/block-library": "^6.0.
|
|
32
|
+
"@wordpress/block-editor": "^8.0.9",
|
|
33
|
+
"@wordpress/block-library": "^6.0.13",
|
|
34
34
|
"@wordpress/blocks": "^11.1.4",
|
|
35
|
-
"@wordpress/components": "^19.
|
|
35
|
+
"@wordpress/components": "^19.1.3",
|
|
36
36
|
"@wordpress/compose": "^5.0.6",
|
|
37
|
-
"@wordpress/core-data": "^4.0.
|
|
37
|
+
"@wordpress/core-data": "^4.0.8",
|
|
38
38
|
"@wordpress/data": "^6.1.4",
|
|
39
39
|
"@wordpress/data-controls": "^2.2.7",
|
|
40
|
-
"@wordpress/editor": "^12.0.
|
|
40
|
+
"@wordpress/editor": "^12.0.12",
|
|
41
41
|
"@wordpress/element": "^4.0.4",
|
|
42
42
|
"@wordpress/hooks": "^3.2.2",
|
|
43
43
|
"@wordpress/html-entities": "^3.2.3",
|
|
44
44
|
"@wordpress/i18n": "^4.2.4",
|
|
45
45
|
"@wordpress/icons": "^6.1.1",
|
|
46
|
-
"@wordpress/interface": "^4.1.
|
|
46
|
+
"@wordpress/interface": "^4.1.11",
|
|
47
47
|
"@wordpress/keyboard-shortcuts": "^3.0.6",
|
|
48
48
|
"@wordpress/keycodes": "^3.2.4",
|
|
49
49
|
"@wordpress/media-utils": "^3.0.5",
|
|
50
50
|
"@wordpress/notices": "^3.2.7",
|
|
51
51
|
"@wordpress/plugins": "^4.0.6",
|
|
52
52
|
"@wordpress/primitives": "^3.0.4",
|
|
53
|
+
"@wordpress/reusable-blocks": "^3.0.15",
|
|
53
54
|
"@wordpress/url": "^3.3.1",
|
|
55
|
+
"@wordpress/viewport": "^4.0.6",
|
|
54
56
|
"classnames": "^2.3.1",
|
|
55
57
|
"downloadjs": "^1.4.7",
|
|
56
58
|
"file-saver": "^2.0.2",
|
|
@@ -61,5 +63,5 @@
|
|
|
61
63
|
"publishConfig": {
|
|
62
64
|
"access": "public"
|
|
63
65
|
},
|
|
64
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "f8c50499a12f926661103acfaeea6780d85b947b"
|
|
65
67
|
}
|
|
@@ -7,9 +7,12 @@ import { kebabCase } from 'lodash';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useState } from '@wordpress/element';
|
|
10
|
+
import { useDispatch } from '@wordpress/data';
|
|
10
11
|
import { Button } from '@wordpress/components';
|
|
11
12
|
import { addQueryArgs } from '@wordpress/url';
|
|
12
13
|
import apiFetch from '@wordpress/api-fetch';
|
|
14
|
+
import { __ } from '@wordpress/i18n';
|
|
15
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* Internal dependencies
|
|
@@ -18,31 +21,43 @@ import CreateTemplatePartModal from '../create-template-part-modal';
|
|
|
18
21
|
|
|
19
22
|
export default function NewTemplatePart( { postType } ) {
|
|
20
23
|
const [ isModalOpen, setIsModalOpen ] = useState( false );
|
|
24
|
+
const { createErrorNotice } = useDispatch( noticesStore );
|
|
21
25
|
|
|
22
26
|
async function createTemplatePart( { title, area } ) {
|
|
23
27
|
if ( ! title ) {
|
|
28
|
+
createErrorNotice( __( 'Title is not defined.' ), {
|
|
29
|
+
type: 'snackbar',
|
|
30
|
+
} );
|
|
24
31
|
return;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
try {
|
|
35
|
+
const templatePart = await apiFetch( {
|
|
36
|
+
path: '/wp/v2/template-parts',
|
|
37
|
+
method: 'POST',
|
|
38
|
+
data: {
|
|
39
|
+
slug: kebabCase( title ),
|
|
40
|
+
title,
|
|
41
|
+
content: '',
|
|
42
|
+
area,
|
|
43
|
+
},
|
|
44
|
+
} );
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
// Navigate to the created template part editor.
|
|
47
|
+
window.location.href = addQueryArgs( window.location.href, {
|
|
48
|
+
postId: templatePart.id,
|
|
49
|
+
postType: 'wp_template_part',
|
|
50
|
+
} );
|
|
51
|
+
} catch ( error ) {
|
|
52
|
+
const errorMessage =
|
|
53
|
+
error.message && error.code !== 'unknown_error'
|
|
54
|
+
? error.message
|
|
55
|
+
: __(
|
|
56
|
+
'An error occurred while creating the template part.'
|
|
57
|
+
);
|
|
43
58
|
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
createErrorNotice( errorMessage, { type: 'snackbar' } );
|
|
60
|
+
}
|
|
46
61
|
}
|
|
47
62
|
|
|
48
63
|
return (
|
|
@@ -12,11 +12,13 @@ import {
|
|
|
12
12
|
MenuItem,
|
|
13
13
|
NavigableMenu,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
|
-
import { useSelect } from '@wordpress/data';
|
|
15
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
16
16
|
import { store as coreStore } from '@wordpress/core-data';
|
|
17
17
|
import { store as editorStore } from '@wordpress/editor';
|
|
18
18
|
import { addQueryArgs } from '@wordpress/url';
|
|
19
19
|
import apiFetch from '@wordpress/api-fetch';
|
|
20
|
+
import { __ } from '@wordpress/i18n';
|
|
21
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
20
22
|
|
|
21
23
|
const DEFAULT_TEMPLATE_SLUGS = [
|
|
22
24
|
'front-page',
|
|
@@ -33,7 +35,8 @@ export default function NewTemplate( { postType } ) {
|
|
|
33
35
|
( select ) => ( {
|
|
34
36
|
templates: select( coreStore ).getEntityRecords(
|
|
35
37
|
'postType',
|
|
36
|
-
'wp_template'
|
|
38
|
+
'wp_template',
|
|
39
|
+
{ per_page: -1 }
|
|
37
40
|
),
|
|
38
41
|
defaultTemplateTypes: select(
|
|
39
42
|
editorStore
|
|
@@ -41,27 +44,44 @@ export default function NewTemplate( { postType } ) {
|
|
|
41
44
|
} ),
|
|
42
45
|
[]
|
|
43
46
|
);
|
|
47
|
+
const { createErrorNotice } = useDispatch( noticesStore );
|
|
44
48
|
|
|
45
49
|
async function createTemplate( { slug } ) {
|
|
46
|
-
|
|
50
|
+
try {
|
|
51
|
+
const { title, description } = find( defaultTemplateTypes, {
|
|
52
|
+
slug,
|
|
53
|
+
} );
|
|
47
54
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
const template = await apiFetch( {
|
|
56
|
+
path: '/wp/v2/templates',
|
|
57
|
+
method: 'POST',
|
|
58
|
+
data: {
|
|
59
|
+
excerpt: description,
|
|
60
|
+
// Slugs need to be strings, so this is for template `404`
|
|
61
|
+
slug: slug.toString(),
|
|
62
|
+
status: 'publish',
|
|
63
|
+
title,
|
|
64
|
+
},
|
|
65
|
+
} );
|
|
59
66
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
// Navigate to the created template editor.
|
|
68
|
+
window.location.href = addQueryArgs( window.location.href, {
|
|
69
|
+
postId: template.id,
|
|
70
|
+
postType: 'wp_template',
|
|
71
|
+
} );
|
|
72
|
+
|
|
73
|
+
// Wait for async navigation to happen before closing the modal.
|
|
74
|
+
await new Promise( () => {} );
|
|
75
|
+
} catch ( error ) {
|
|
76
|
+
const errorMessage =
|
|
77
|
+
error.message && error.code !== 'unknown_error'
|
|
78
|
+
? error.message
|
|
79
|
+
: __( 'An error occurred while creating the template.' );
|
|
80
|
+
|
|
81
|
+
createErrorNotice( errorMessage, {
|
|
82
|
+
type: 'snackbar',
|
|
83
|
+
} );
|
|
84
|
+
}
|
|
65
85
|
}
|
|
66
86
|
|
|
67
87
|
const existingTemplateSlugs = map( templates, 'slug' );
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
store as blockEditorStore,
|
|
21
21
|
} from '@wordpress/block-editor';
|
|
22
22
|
import { useMergeRefs, useViewportMatch } from '@wordpress/compose';
|
|
23
|
+
import { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Internal dependencies
|
|
@@ -132,6 +133,7 @@ export default function BlockEditor( { setIsInserterOpen } ) {
|
|
|
132
133
|
) }
|
|
133
134
|
</__unstableBlockSettingsMenuFirstItem>
|
|
134
135
|
</BlockTools>
|
|
136
|
+
<ReusableBlocksMenuItems />
|
|
135
137
|
</BlockEditorProvider>
|
|
136
138
|
);
|
|
137
139
|
}
|