@wordpress/editor 13.34.0 → 13.35.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 +10 -4
- package/build/bindings/pattern-overrides.js +70 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +126 -0
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build/components/collapsible-block-toolbar/index.js +2 -2
- package/build/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build/components/document-bar/index.js +2 -2
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/item.js +2 -2
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +15 -18
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/index.js +19 -8
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +130 -0
- package/build/components/global-styles-provider/index.js.map +1 -0
- package/build/components/header/index.js +147 -0
- package/build/components/header/index.js.map +1 -0
- package/build/components/inserter-sidebar/index.js +56 -31
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/post-actions/actions.js +122 -64
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +7 -14
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-card-panel/index.js +5 -29
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +28 -8
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-discussion/panel.js +103 -21
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/panel.js +2 -2
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-format/panel.js +27 -0
- package/build/components/post-format/panel.js.map +1 -0
- package/build/components/post-panel-row/index.js +2 -2
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-panel-section/index.js +28 -0
- package/build/components/post-panel-section/index.js.map +1 -0
- package/build/components/post-pingbacks/index.js +5 -2
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-saved-state/index.js +2 -2
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-slug/panel.js +27 -0
- package/build/components/post-slug/panel.js.map +1 -0
- package/build/components/post-status/index.js +4 -4
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/panel.js +21 -0
- package/build/components/post-sticky/panel.js.map +1 -0
- package/build/components/post-title/index.js +2 -2
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +2 -2
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +90 -0
- package/build/components/post-transform-panel/hooks.js.map +1 -0
- package/build/components/post-transform-panel/index.js +101 -0
- package/build/components/post-transform-panel/index.js.map +1 -0
- package/build/components/post-trash/panel.js +18 -0
- package/build/components/post-trash/panel.js.map +1 -0
- package/build/components/post-type-support-check/index.js +1 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +3 -3
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/index.js +3 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +21 -3
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/constants.js +11 -0
- package/build/components/sidebar/constants.js.map +1 -0
- package/build/components/sidebar/header.js +53 -0
- package/build/components/sidebar/header.js.map +1 -0
- package/build/components/sidebar/index.js +157 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar/post-summary.js +84 -0
- package/build/components/sidebar/post-summary.js.map +1 -0
- package/build/components/start-page-options/index.js +5 -7
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +192 -0
- package/build/components/start-template-options/index.js.map +1 -0
- package/build/components/template-content-panel/index.js +38 -0
- package/build/components/template-content-panel/index.js.map +1 -0
- package/build/hooks/pattern-overrides.js +10 -5
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/private-apis.js +7 -12
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +72 -0
- package/build/private-apis.native.js.map +1 -0
- package/build/store/private-selectors.js +6 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +15 -0
- package/build/store/reducer.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +69 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +119 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- package/build-module/components/collapsible-block-toolbar/index.js +2 -2
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +2 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +2 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +16 -19
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +19 -8
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +120 -0
- package/build-module/components/global-styles-provider/index.js.map +1 -0
- package/build-module/components/header/index.js +139 -0
- package/build-module/components/header/index.js.map +1 -0
- package/build-module/components/inserter-sidebar/index.js +59 -34
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +125 -66
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +7 -14
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +7 -30
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +30 -10
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +105 -23
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +2 -2
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-format/panel.js +18 -0
- package/build-module/components/post-format/panel.js.map +1 -0
- package/build-module/components/post-panel-row/index.js +2 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-panel-section/index.js +20 -0
- package/build-module/components/post-panel-section/index.js.map +1 -0
- package/build-module/components/post-pingbacks/index.js +6 -3
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +2 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-slug/panel.js +18 -0
- package/build-module/components/post-slug/panel.js.map +1 -0
- package/build-module/components/post-status/index.js +4 -4
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/panel.js +12 -0
- package/build-module/components/post-sticky/panel.js.map +1 -0
- package/build-module/components/post-title/index.js +2 -2
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +2 -2
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +83 -0
- package/build-module/components/post-transform-panel/hooks.js.map +1 -0
- package/build-module/components/post-transform-panel/index.js +94 -0
- package/build-module/components/post-transform-panel/index.js.map +1 -0
- package/build-module/components/post-trash/panel.js +10 -0
- package/build-module/components/post-trash/panel.js.map +1 -0
- package/build-module/components/post-type-support-check/index.js +1 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +3 -3
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/index.js +3 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +21 -3
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/constants.js +5 -0
- package/build-module/components/sidebar/constants.js.map +1 -0
- package/build-module/components/sidebar/header.js +46 -0
- package/build-module/components/sidebar/header.js.map +1 -0
- package/build-module/components/sidebar/index.js +149 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar/post-summary.js +77 -0
- package/build-module/components/sidebar/post-summary.js.map +1 -0
- package/build-module/components/start-page-options/index.js +5 -7
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +185 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- package/build-module/components/template-content-panel/index.js +31 -0
- package/build-module/components/template-content-panel/index.js.map +1 -0
- package/build-module/hooks/pattern-overrides.js +10 -5
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +7 -12
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +62 -0
- package/build-module/private-apis.native.js.map +1 -0
- package/build-module/store/private-selectors.js +3 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +14 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +328 -18
- package/build-style/style.css +328 -18
- package/package.json +38 -36
- package/src/bindings/pattern-overrides.js +83 -1
- package/src/components/autocompleters/style.scss +1 -2
- package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
- package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
- package/src/components/block-settings-menu/style.scss +4 -0
- package/src/components/collapsible-block-toolbar/index.js +2 -2
- package/src/components/document-bar/index.js +2 -2
- package/src/components/document-outline/item.js +2 -2
- package/src/components/document-tools/index.js +19 -21
- package/src/components/editor-canvas/index.js +18 -6
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
- package/src/components/global-styles-provider/index.js +162 -0
- package/src/components/header/index.js +154 -0
- package/src/components/header/style.scss +231 -0
- package/src/components/inserter-sidebar/index.js +52 -29
- package/src/components/inserter-sidebar/style.scss +10 -3
- package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/src/components/list-view-sidebar/style.scss +1 -0
- package/src/components/page-attributes/test/order.js +5 -1
- package/src/components/post-actions/actions.js +256 -150
- package/src/components/post-actions/index.js +5 -38
- package/src/components/post-card-panel/index.js +39 -85
- package/src/components/post-comments/index.js +47 -9
- package/src/components/post-discussion/panel.js +108 -31
- package/src/components/post-discussion/style.scss +26 -0
- package/src/components/post-excerpt/panel.js +2 -2
- package/src/components/post-format/panel.js +22 -0
- package/src/components/post-format/style.scss +6 -0
- package/src/components/post-last-revision/test/check.js +5 -1
- package/src/components/post-panel-row/index.js +2 -2
- package/src/components/post-panel-section/index.js +19 -0
- package/src/components/post-panel-section/style.scss +3 -0
- package/src/components/post-pingbacks/index.js +11 -2
- package/src/components/post-publish-panel/style.scss +5 -0
- package/src/components/post-saved-state/index.js +2 -2
- package/src/components/post-slug/panel.js +22 -0
- package/src/components/post-slug/style.scss +5 -0
- package/src/components/post-slug/test/index.js +5 -1
- package/src/components/post-status/index.js +4 -4
- package/src/components/post-sticky/panel.js +18 -0
- package/src/components/post-title/index.js +2 -2
- package/src/components/post-title/post-title-raw.js +2 -2
- package/src/components/post-transform-panel/hooks.js +114 -0
- package/src/components/post-transform-panel/index.js +99 -0
- package/src/components/post-trash/panel.js +13 -0
- package/src/components/post-type-support-check/index.js +1 -1
- package/src/components/post-type-support-check/test/index.js +2 -2
- package/src/components/preferences-modal/index.js +3 -3
- package/src/components/provider/index.js +4 -0
- package/src/components/provider/use-block-editor-settings.js +19 -4
- package/src/components/sidebar/constants.js +4 -0
- package/src/components/sidebar/header.js +49 -0
- package/src/components/sidebar/index.js +200 -0
- package/src/components/sidebar/post-summary.js +104 -0
- package/src/components/sidebar/style.scss +18 -0
- package/src/components/start-page-options/index.js +6 -4
- package/src/components/start-template-options/index.js +219 -0
- package/src/components/start-template-options/style.scss +55 -0
- package/src/components/template-areas/style.scss +0 -1
- package/src/components/template-content-panel/index.js +36 -0
- package/src/hooks/pattern-overrides.js +12 -6
- package/src/private-apis.js +10 -12
- package/src/private-apis.native.js +61 -0
- package/src/store/private-selectors.js +3 -0
- package/src/store/reducer.js +12 -0
- package/src/style.scss +7 -0
- package/src/components/post-slug/test/check.js +0 -17
package/build-style/style.css
CHANGED
|
@@ -124,7 +124,8 @@
|
|
|
124
124
|
|
|
125
125
|
.interface-complementary-area-header {
|
|
126
126
|
background: #fff;
|
|
127
|
-
padding-right:
|
|
127
|
+
padding-right: 12px;
|
|
128
|
+
gap: 8px;
|
|
128
129
|
}
|
|
129
130
|
.interface-complementary-area-header .interface-complementary-area-header__title {
|
|
130
131
|
margin: 0;
|
|
@@ -142,12 +143,6 @@
|
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
|
|
145
|
-
@media (min-width: 782px) {
|
|
146
|
-
.components-panel__header + .interface-complementary-area-header {
|
|
147
|
-
margin-top: 0;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
146
|
.interface-complementary-area {
|
|
152
147
|
background: #fff;
|
|
153
148
|
color: #1e1e1e;
|
|
@@ -174,11 +169,11 @@
|
|
|
174
169
|
top: 0;
|
|
175
170
|
z-index: 1;
|
|
176
171
|
}
|
|
177
|
-
.interface-complementary-area .components-panel__header.
|
|
172
|
+
.interface-complementary-area .components-panel__header.editor-sidebar__panel-tabs {
|
|
178
173
|
top: 48px;
|
|
179
174
|
}
|
|
180
175
|
@media (min-width: 782px) {
|
|
181
|
-
.interface-complementary-area .components-panel__header.
|
|
176
|
+
.interface-complementary-area .components-panel__header.editor-sidebar__panel-tabs {
|
|
182
177
|
top: 0;
|
|
183
178
|
}
|
|
184
179
|
}
|
|
@@ -187,6 +182,7 @@
|
|
|
187
182
|
}
|
|
188
183
|
.interface-complementary-area h2 {
|
|
189
184
|
font-size: 13px;
|
|
185
|
+
font-weight: 500;
|
|
190
186
|
color: #1e1e1e;
|
|
191
187
|
margin-bottom: 1.5em;
|
|
192
188
|
}
|
|
@@ -242,7 +238,7 @@ html.interface-interface-skeleton__html-container {
|
|
|
242
238
|
width: 100%;
|
|
243
239
|
}
|
|
244
240
|
@media (min-width: 782px) {
|
|
245
|
-
html.interface-interface-skeleton__html-container {
|
|
241
|
+
html.interface-interface-skeleton__html-container:not(:has(.is-zoom-out)) {
|
|
246
242
|
position: initial;
|
|
247
243
|
width: initial;
|
|
248
244
|
}
|
|
@@ -471,9 +467,8 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
471
467
|
}
|
|
472
468
|
|
|
473
469
|
.editor-autocompleters__user .editor-autocompleters__no-avatar::before {
|
|
474
|
-
/* stylelint-disable */
|
|
470
|
+
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword -- dashicons don't need a generic family keyword. */
|
|
475
471
|
font: normal 20px/1 dashicons;
|
|
476
|
-
/* stylelint-enable */
|
|
477
472
|
content: "";
|
|
478
473
|
margin-right: 5px;
|
|
479
474
|
vertical-align: middle;
|
|
@@ -644,6 +639,11 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
644
639
|
margin-left: 2px;
|
|
645
640
|
}
|
|
646
641
|
|
|
642
|
+
.editor-content-only-settings-menu__description {
|
|
643
|
+
padding: 8px;
|
|
644
|
+
min-width: 235px;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
647
|
.editor-document-bar {
|
|
648
648
|
display: flex;
|
|
649
649
|
align-items: center;
|
|
@@ -964,6 +964,206 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
964
964
|
box-shadow: 0 0.7px 1px rgba(0, 0, 0, 0.15), 0 2.7px 3.8px -0.2px rgba(0, 0, 0, 0.15), 0 5.5px 7.8px -0.3px rgba(0, 0, 0, 0.15), 0.1px 11.5px 16.4px -0.5px rgba(0, 0, 0, 0.15);
|
|
965
965
|
}
|
|
966
966
|
|
|
967
|
+
.editor-header {
|
|
968
|
+
height: 60px;
|
|
969
|
+
background: #fff;
|
|
970
|
+
display: flex;
|
|
971
|
+
flex-wrap: wrap;
|
|
972
|
+
align-items: center;
|
|
973
|
+
max-width: 100vw;
|
|
974
|
+
justify-content: space-between;
|
|
975
|
+
}
|
|
976
|
+
@media (min-width: 280px) {
|
|
977
|
+
.editor-header {
|
|
978
|
+
flex-wrap: nowrap;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.editor-header__toolbar {
|
|
983
|
+
display: flex;
|
|
984
|
+
flex-shrink: 8;
|
|
985
|
+
flex-grow: 3;
|
|
986
|
+
overflow: hidden;
|
|
987
|
+
padding: 2px 0;
|
|
988
|
+
align-items: center;
|
|
989
|
+
}
|
|
990
|
+
@media (min-width: 782px) {
|
|
991
|
+
.editor-header__toolbar {
|
|
992
|
+
padding-right: var(--wp-admin-border-width-focus);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
.editor-header__toolbar .table-of-contents {
|
|
996
|
+
display: none;
|
|
997
|
+
}
|
|
998
|
+
@media (min-width: 600px) {
|
|
999
|
+
.editor-header__toolbar .table-of-contents {
|
|
1000
|
+
display: block;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.editor-header__center {
|
|
1005
|
+
flex-grow: 1;
|
|
1006
|
+
display: flex;
|
|
1007
|
+
justify-content: center;
|
|
1008
|
+
}
|
|
1009
|
+
.editor-header__center.is-collapsed {
|
|
1010
|
+
display: none;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Buttons on the right side
|
|
1015
|
+
*/
|
|
1016
|
+
.editor-header__settings {
|
|
1017
|
+
display: inline-flex;
|
|
1018
|
+
align-items: center;
|
|
1019
|
+
flex-wrap: nowrap;
|
|
1020
|
+
padding-right: 4px;
|
|
1021
|
+
gap: 8px;
|
|
1022
|
+
}
|
|
1023
|
+
@media (min-width: 600px) {
|
|
1024
|
+
.editor-header__settings {
|
|
1025
|
+
padding-right: 8px;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* Show icon labels.
|
|
1031
|
+
*/
|
|
1032
|
+
.show-icon-labels.interface-pinned-items .components-button.has-icon,
|
|
1033
|
+
.show-icon-labels .editor-header .components-button.has-icon {
|
|
1034
|
+
width: auto;
|
|
1035
|
+
}
|
|
1036
|
+
.show-icon-labels.interface-pinned-items .components-button.has-icon svg,
|
|
1037
|
+
.show-icon-labels .editor-header .components-button.has-icon svg {
|
|
1038
|
+
display: none;
|
|
1039
|
+
}
|
|
1040
|
+
.show-icon-labels.interface-pinned-items .components-button.has-icon::after,
|
|
1041
|
+
.show-icon-labels .editor-header .components-button.has-icon::after {
|
|
1042
|
+
content: attr(aria-label);
|
|
1043
|
+
}
|
|
1044
|
+
.show-icon-labels.interface-pinned-items .components-button.has-icon[aria-disabled=true],
|
|
1045
|
+
.show-icon-labels .editor-header .components-button.has-icon[aria-disabled=true] {
|
|
1046
|
+
background-color: transparent;
|
|
1047
|
+
}
|
|
1048
|
+
.show-icon-labels.interface-pinned-items .is-tertiary:active,
|
|
1049
|
+
.show-icon-labels .editor-header .is-tertiary:active {
|
|
1050
|
+
box-shadow: 0 0 0 1.5px var(--wp-admin-theme-color);
|
|
1051
|
+
background-color: transparent;
|
|
1052
|
+
}
|
|
1053
|
+
.show-icon-labels.interface-pinned-items .components-button.has-icon.button-toggle svg,
|
|
1054
|
+
.show-icon-labels .editor-header .components-button.has-icon.button-toggle svg {
|
|
1055
|
+
display: block;
|
|
1056
|
+
}
|
|
1057
|
+
.show-icon-labels.interface-pinned-items .components-button.has-icon.button-toggle::after,
|
|
1058
|
+
.show-icon-labels .editor-header .components-button.has-icon.button-toggle::after {
|
|
1059
|
+
content: none;
|
|
1060
|
+
}
|
|
1061
|
+
.show-icon-labels.interface-pinned-items .components-menu-items-choice .components-menu-items__item-icon.components-menu-items__item-icon,
|
|
1062
|
+
.show-icon-labels .editor-header .components-menu-items-choice .components-menu-items__item-icon.components-menu-items__item-icon {
|
|
1063
|
+
display: block;
|
|
1064
|
+
}
|
|
1065
|
+
.show-icon-labels.interface-pinned-items .editor-document-tools__inserter-toggle.editor-document-tools__inserter-toggle,
|
|
1066
|
+
.show-icon-labels.interface-pinned-items .interface-pinned-items .components-button,
|
|
1067
|
+
.show-icon-labels .editor-header .editor-document-tools__inserter-toggle.editor-document-tools__inserter-toggle,
|
|
1068
|
+
.show-icon-labels .editor-header .interface-pinned-items .components-button {
|
|
1069
|
+
padding-left: 8px;
|
|
1070
|
+
padding-right: 8px;
|
|
1071
|
+
}
|
|
1072
|
+
@media (min-width: 600px) {
|
|
1073
|
+
.show-icon-labels.interface-pinned-items .editor-document-tools__inserter-toggle.editor-document-tools__inserter-toggle,
|
|
1074
|
+
.show-icon-labels.interface-pinned-items .interface-pinned-items .components-button,
|
|
1075
|
+
.show-icon-labels .editor-header .editor-document-tools__inserter-toggle.editor-document-tools__inserter-toggle,
|
|
1076
|
+
.show-icon-labels .editor-header .interface-pinned-items .components-button {
|
|
1077
|
+
padding-left: 12px;
|
|
1078
|
+
padding-right: 12px;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
.show-icon-labels.interface-pinned-items .editor-post-save-draft.editor-post-save-draft::after,
|
|
1082
|
+
.show-icon-labels.interface-pinned-items .editor-post-saved-state.editor-post-saved-state::after,
|
|
1083
|
+
.show-icon-labels .editor-header .editor-post-save-draft.editor-post-save-draft::after,
|
|
1084
|
+
.show-icon-labels .editor-header .editor-post-saved-state.editor-post-saved-state::after {
|
|
1085
|
+
content: none;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
.show-icon-labels .editor-header__toolbar .block-editor-block-mover {
|
|
1089
|
+
border-left: none;
|
|
1090
|
+
}
|
|
1091
|
+
.show-icon-labels .editor-header__toolbar .block-editor-block-mover::before {
|
|
1092
|
+
content: "";
|
|
1093
|
+
width: 1px;
|
|
1094
|
+
height: 24px;
|
|
1095
|
+
background-color: #ddd;
|
|
1096
|
+
margin-top: 4px;
|
|
1097
|
+
margin-left: 8px;
|
|
1098
|
+
}
|
|
1099
|
+
.show-icon-labels .editor-header__toolbar .block-editor-block-mover .block-editor-block-mover__move-button-container::before {
|
|
1100
|
+
width: calc(100% - 24px);
|
|
1101
|
+
background: #ddd;
|
|
1102
|
+
left: calc(50% + 1px);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
.show-icon-labels.interface-pinned-items {
|
|
1106
|
+
padding: 6px 12px 12px;
|
|
1107
|
+
margin-top: 0;
|
|
1108
|
+
margin-bottom: 0;
|
|
1109
|
+
margin-left: -12px;
|
|
1110
|
+
margin-right: -12px;
|
|
1111
|
+
border-bottom: 1px solid #ccc;
|
|
1112
|
+
display: block;
|
|
1113
|
+
}
|
|
1114
|
+
.show-icon-labels.interface-pinned-items > .components-button.has-icon {
|
|
1115
|
+
margin: 0;
|
|
1116
|
+
padding: 6px 6px 6px 8px;
|
|
1117
|
+
width: 14.625rem;
|
|
1118
|
+
justify-content: flex-start;
|
|
1119
|
+
}
|
|
1120
|
+
.show-icon-labels.interface-pinned-items > .components-button.has-icon[aria-expanded=true] svg {
|
|
1121
|
+
display: block;
|
|
1122
|
+
max-width: 24px;
|
|
1123
|
+
}
|
|
1124
|
+
.show-icon-labels.interface-pinned-items > .components-button.has-icon[aria-expanded=false] {
|
|
1125
|
+
padding-left: 40px;
|
|
1126
|
+
}
|
|
1127
|
+
.show-icon-labels.interface-pinned-items > .components-button.has-icon svg {
|
|
1128
|
+
margin-right: 8px;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
@media (min-width: 600px) {
|
|
1132
|
+
.editor-header__post-preview-button {
|
|
1133
|
+
display: none;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
.is-distraction-free .interface-interface-skeleton__header {
|
|
1138
|
+
border-bottom: none;
|
|
1139
|
+
}
|
|
1140
|
+
.is-distraction-free .editor-header {
|
|
1141
|
+
background-color: #fff;
|
|
1142
|
+
border-bottom: 1px solid #e0e0e0;
|
|
1143
|
+
position: absolute;
|
|
1144
|
+
width: 100%;
|
|
1145
|
+
}
|
|
1146
|
+
.is-distraction-free .editor-header > .edit-post-header__settings > .edit-post-header__post-preview-button {
|
|
1147
|
+
visibility: hidden;
|
|
1148
|
+
}
|
|
1149
|
+
.is-distraction-free .editor-header > .editor-header__toolbar .editor-document-tools__document-overview-toggle, .is-distraction-free .editor-header > .editor-header__settings > .editor-preview-dropdown, .is-distraction-free .editor-header > .editor-header__settings > .interface-pinned-items {
|
|
1150
|
+
display: none;
|
|
1151
|
+
}
|
|
1152
|
+
.is-distraction-free .interface-interface-skeleton__header:focus-within {
|
|
1153
|
+
opacity: 1 !important;
|
|
1154
|
+
}
|
|
1155
|
+
.is-distraction-free .interface-interface-skeleton__header:focus-within div {
|
|
1156
|
+
transform: translateX(0) translateZ(0) !important;
|
|
1157
|
+
}
|
|
1158
|
+
.is-distraction-free .components-editor-notices__dismissible {
|
|
1159
|
+
position: absolute;
|
|
1160
|
+
z-index: 35;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
.components-popover.more-menu-dropdown__content {
|
|
1164
|
+
z-index: 99998;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
967
1167
|
.editor-inserter-sidebar {
|
|
968
1168
|
box-sizing: border-box;
|
|
969
1169
|
height: 100%;
|
|
@@ -976,11 +1176,16 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
976
1176
|
box-sizing: inherit;
|
|
977
1177
|
}
|
|
978
1178
|
|
|
979
|
-
.editor-inserter-sidebar__header {
|
|
980
|
-
|
|
1179
|
+
.block-editor-inserter-sidebar__header {
|
|
1180
|
+
border-bottom: 1px solid #ddd;
|
|
981
1181
|
padding-right: 8px;
|
|
982
1182
|
display: flex;
|
|
983
|
-
justify-content:
|
|
1183
|
+
justify-content: space-between;
|
|
1184
|
+
}
|
|
1185
|
+
.block-editor-inserter-sidebar__header .block-editor-inserter-sidebar__close-button {
|
|
1186
|
+
/* stylelint-disable-next-line property-disallowed-list -- This should be refactored to avoid order if possible */
|
|
1187
|
+
order: 1;
|
|
1188
|
+
align-self: center;
|
|
984
1189
|
}
|
|
985
1190
|
|
|
986
1191
|
.editor-inserter-sidebar__content {
|
|
@@ -1056,6 +1261,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1056
1261
|
}
|
|
1057
1262
|
.editor-list-view-sidebar .editor-list-view-sidebar__close-button {
|
|
1058
1263
|
background: #fff;
|
|
1264
|
+
/* stylelint-disable-next-line property-disallowed-list -- This should be removed when https://github.com/WordPress/gutenberg/issues/59013 is fixed. */
|
|
1059
1265
|
order: 1;
|
|
1060
1266
|
align-self: center;
|
|
1061
1267
|
margin-right: 12px;
|
|
@@ -1189,6 +1395,29 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1189
1395
|
color: inherit;
|
|
1190
1396
|
}
|
|
1191
1397
|
|
|
1398
|
+
.editor-post-discussion__panel-dialog .editor-post-discussion {
|
|
1399
|
+
min-width: 248px;
|
|
1400
|
+
margin: 8px;
|
|
1401
|
+
}
|
|
1402
|
+
.editor-post-discussion__panel-dialog .editor-post-discussion .components-radio-control__option {
|
|
1403
|
+
align-items: flex-start;
|
|
1404
|
+
}
|
|
1405
|
+
.editor-post-discussion__panel-dialog .editor-post-discussion .components-radio-control__label .components-text {
|
|
1406
|
+
display: block;
|
|
1407
|
+
margin-top: 4px;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
.editor-post-discussion__panel-toggle.components-button {
|
|
1411
|
+
height: auto;
|
|
1412
|
+
}
|
|
1413
|
+
.editor-post-discussion__panel-toggle .components-text {
|
|
1414
|
+
color: inherit;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
.editor-post-discussion__panel-dialog .components-popover__content {
|
|
1418
|
+
min-width: 320px;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1192
1421
|
.editor-post-excerpt__textarea {
|
|
1193
1422
|
width: 100%;
|
|
1194
1423
|
margin-bottom: 10px;
|
|
@@ -1298,6 +1527,12 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1298
1527
|
margin: 4px 0 0 0;
|
|
1299
1528
|
}
|
|
1300
1529
|
|
|
1530
|
+
.editor-post-format__panel {
|
|
1531
|
+
display: flex;
|
|
1532
|
+
flex-direction: column;
|
|
1533
|
+
align-items: stretch;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1301
1536
|
.editor-post-last-edited-panel {
|
|
1302
1537
|
color: #757575;
|
|
1303
1538
|
}
|
|
@@ -1362,6 +1597,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1362
1597
|
align-items: center;
|
|
1363
1598
|
}
|
|
1364
1599
|
|
|
1600
|
+
.editor-post-panel__section {
|
|
1601
|
+
padding: 16px;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1365
1604
|
.editor-post-publish-panel {
|
|
1366
1605
|
background: #fff;
|
|
1367
1606
|
}
|
|
@@ -1475,6 +1714,10 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
1475
1714
|
.editor-post-publish-panel__prepublish .editor-post-visibility__dialog-legend {
|
|
1476
1715
|
display: none;
|
|
1477
1716
|
}
|
|
1717
|
+
.editor-post-publish-panel__prepublish .components-panel__body-title .components-button {
|
|
1718
|
+
align-items: flex-start;
|
|
1719
|
+
text-wrap: pretty;
|
|
1720
|
+
}
|
|
1478
1721
|
|
|
1479
1722
|
.post-publish-panel__postpublish .components-panel__body {
|
|
1480
1723
|
border-bottom: 1px solid #e0e0e0;
|
|
@@ -1637,6 +1880,12 @@ body.is-fullscreen-mode .edit-site-editor__interface-skeleton .editor-post-publi
|
|
|
1637
1880
|
line-height: inherit;
|
|
1638
1881
|
}
|
|
1639
1882
|
|
|
1883
|
+
.editor-post-slug {
|
|
1884
|
+
display: flex;
|
|
1885
|
+
flex-direction: column;
|
|
1886
|
+
align-items: stretch;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1640
1889
|
.editor-post-status {
|
|
1641
1890
|
max-width: 100%;
|
|
1642
1891
|
}
|
|
@@ -1884,6 +2133,8 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
|
|
|
1884
2133
|
border-radius: 50%;
|
|
1885
2134
|
width: 24px;
|
|
1886
2135
|
height: 24px;
|
|
2136
|
+
min-width: 24px;
|
|
2137
|
+
max-width: 24px;
|
|
1887
2138
|
margin-top: 2px;
|
|
1888
2139
|
}
|
|
1889
2140
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -1918,6 +2169,8 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
|
|
|
1918
2169
|
.editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio] {
|
|
1919
2170
|
height: 20px;
|
|
1920
2171
|
width: 20px;
|
|
2172
|
+
min-width: 20px;
|
|
2173
|
+
max-width: 20px;
|
|
1921
2174
|
}
|
|
1922
2175
|
}
|
|
1923
2176
|
.editor-post-visibility__fieldset .editor-post-visibility__radio[type=radio]:checked::before {
|
|
@@ -2065,6 +2318,66 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
|
|
|
2065
2318
|
width: 100%;
|
|
2066
2319
|
}
|
|
2067
2320
|
|
|
2321
|
+
.editor-start-template-options__modal .editor-start-template-options__modal__actions {
|
|
2322
|
+
position: absolute;
|
|
2323
|
+
bottom: 0;
|
|
2324
|
+
width: 100%;
|
|
2325
|
+
height: 92px;
|
|
2326
|
+
background-color: #fff;
|
|
2327
|
+
margin-left: -32px;
|
|
2328
|
+
margin-right: -32px;
|
|
2329
|
+
padding-left: 32px;
|
|
2330
|
+
padding-right: 32px;
|
|
2331
|
+
border-top: 1px solid #ddd;
|
|
2332
|
+
z-index: 1;
|
|
2333
|
+
}
|
|
2334
|
+
.editor-start-template-options__modal .block-editor-block-patterns-list {
|
|
2335
|
+
padding-bottom: 92px;
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
.editor-start-template-options__modal-content .block-editor-block-patterns-list {
|
|
2339
|
+
column-count: 2;
|
|
2340
|
+
column-gap: 24px;
|
|
2341
|
+
}
|
|
2342
|
+
@media (min-width: 782px) {
|
|
2343
|
+
.editor-start-template-options__modal-content .block-editor-block-patterns-list {
|
|
2344
|
+
column-count: 3;
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
@media (min-width: 1280px) {
|
|
2348
|
+
.editor-start-template-options__modal-content .block-editor-block-patterns-list {
|
|
2349
|
+
column-count: 4;
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
.editor-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item {
|
|
2353
|
+
break-inside: avoid-column;
|
|
2354
|
+
}
|
|
2355
|
+
.editor-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-patterns-list__item-title {
|
|
2356
|
+
display: none;
|
|
2357
|
+
}
|
|
2358
|
+
.editor-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__item:not(:focus):not(:hover) .block-editor-block-preview__container {
|
|
2359
|
+
box-shadow: 0 0 0 1px #ddd;
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
.components-panel__header.editor-sidebar__panel-tabs {
|
|
2363
|
+
padding-left: 0;
|
|
2364
|
+
padding-right: 16px;
|
|
2365
|
+
}
|
|
2366
|
+
.components-panel__header.editor-sidebar__panel-tabs .components-button.has-icon {
|
|
2367
|
+
padding: 0;
|
|
2368
|
+
min-width: 24px;
|
|
2369
|
+
height: 24px;
|
|
2370
|
+
}
|
|
2371
|
+
@media (min-width: 782px) {
|
|
2372
|
+
.components-panel__header.editor-sidebar__panel-tabs .components-button.has-icon {
|
|
2373
|
+
display: flex;
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
.editor-post-summary .components-v-stack:empty {
|
|
2378
|
+
display: none;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2068
2381
|
.table-of-contents__popover.components-popover .components-popover__content {
|
|
2069
2382
|
min-width: 380px;
|
|
2070
2383
|
}
|
|
@@ -2134,9 +2447,6 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
|
|
|
2134
2447
|
font-weight: 600;
|
|
2135
2448
|
}
|
|
2136
2449
|
|
|
2137
|
-
.editor-template-areas {
|
|
2138
|
-
margin-top: 16px;
|
|
2139
|
-
}
|
|
2140
2450
|
.editor-template-areas__list {
|
|
2141
2451
|
margin: 0;
|
|
2142
2452
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.35.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,41 +31,43 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/blob": "^3.
|
|
37
|
-
"@wordpress/block-editor": "^12.
|
|
38
|
-
"@wordpress/blocks": "^12.
|
|
39
|
-
"@wordpress/commands": "^0.
|
|
40
|
-
"@wordpress/components": "^27.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/core-data": "^6.
|
|
43
|
-
"@wordpress/data": "^9.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/html-entities": "^3.
|
|
50
|
-
"@wordpress/i18n": "^4.
|
|
51
|
-
"@wordpress/icons": "^9.
|
|
52
|
-
"@wordpress/interface": "^5.
|
|
53
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
54
|
-
"@wordpress/keycodes": "^3.
|
|
55
|
-
"@wordpress/media-utils": "^4.
|
|
56
|
-
"@wordpress/notices": "^4.
|
|
57
|
-
"@wordpress/patterns": "^1.
|
|
58
|
-
"@wordpress/plugins": "^6.
|
|
59
|
-
"@wordpress/preferences": "^3.
|
|
60
|
-
"@wordpress/private-apis": "^0.
|
|
61
|
-
"@wordpress/reusable-blocks": "^4.
|
|
62
|
-
"@wordpress/rich-text": "^6.
|
|
63
|
-
"@wordpress/server-side-render": "^4.
|
|
64
|
-
"@wordpress/url": "^3.
|
|
65
|
-
"@wordpress/warning": "^2.
|
|
66
|
-
"@wordpress/wordcount": "^3.
|
|
67
|
-
"
|
|
34
|
+
"@wordpress/a11y": "^3.58.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.55.0",
|
|
36
|
+
"@wordpress/blob": "^3.58.0",
|
|
37
|
+
"@wordpress/block-editor": "^12.26.0",
|
|
38
|
+
"@wordpress/blocks": "^12.35.0",
|
|
39
|
+
"@wordpress/commands": "^0.29.0",
|
|
40
|
+
"@wordpress/components": "^27.6.0",
|
|
41
|
+
"@wordpress/compose": "^6.35.0",
|
|
42
|
+
"@wordpress/core-data": "^6.35.0",
|
|
43
|
+
"@wordpress/data": "^9.28.0",
|
|
44
|
+
"@wordpress/date": "^4.58.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.58.0",
|
|
46
|
+
"@wordpress/dom": "^3.58.0",
|
|
47
|
+
"@wordpress/element": "^5.35.0",
|
|
48
|
+
"@wordpress/hooks": "^3.58.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.58.0",
|
|
50
|
+
"@wordpress/i18n": "^4.58.0",
|
|
51
|
+
"@wordpress/icons": "^9.49.0",
|
|
52
|
+
"@wordpress/interface": "^5.35.0",
|
|
53
|
+
"@wordpress/keyboard-shortcuts": "^4.35.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.58.0",
|
|
55
|
+
"@wordpress/media-utils": "^4.49.0",
|
|
56
|
+
"@wordpress/notices": "^4.26.0",
|
|
57
|
+
"@wordpress/patterns": "^1.19.0",
|
|
58
|
+
"@wordpress/plugins": "^6.26.0",
|
|
59
|
+
"@wordpress/preferences": "^3.35.0",
|
|
60
|
+
"@wordpress/private-apis": "^0.40.0",
|
|
61
|
+
"@wordpress/reusable-blocks": "^4.35.0",
|
|
62
|
+
"@wordpress/rich-text": "^6.35.0",
|
|
63
|
+
"@wordpress/server-side-render": "^4.35.0",
|
|
64
|
+
"@wordpress/url": "^3.59.0",
|
|
65
|
+
"@wordpress/warning": "^2.58.0",
|
|
66
|
+
"@wordpress/wordcount": "^3.58.0",
|
|
67
|
+
"clsx": "^2.1.1",
|
|
68
68
|
"date-fns": "^3.6.0",
|
|
69
|
+
"deepmerge": "^4.3.0",
|
|
70
|
+
"is-plain-object": "^5.0.0",
|
|
69
71
|
"memize": "^2.1.0",
|
|
70
72
|
"react-autosize-textarea": "^7.1.0",
|
|
71
73
|
"remove-accents": "^0.5.0"
|
|
@@ -77,5 +79,5 @@
|
|
|
77
79
|
"publishConfig": {
|
|
78
80
|
"access": "public"
|
|
79
81
|
},
|
|
80
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "42f38f287506a6b3ed8ccba839b18ad066821044"
|
|
81
83
|
}
|
|
@@ -2,10 +2,92 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { _x } from '@wordpress/i18n';
|
|
5
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
+
|
|
7
|
+
const CONTENT = 'content';
|
|
5
8
|
|
|
6
9
|
export default {
|
|
7
10
|
name: 'core/pattern-overrides',
|
|
8
11
|
label: _x( 'Pattern Overrides', 'block bindings source' ),
|
|
9
|
-
|
|
12
|
+
getValue( { registry, clientId, attributeName } ) {
|
|
13
|
+
const { getBlockAttributes, getBlockParentsByBlockName } =
|
|
14
|
+
registry.select( blockEditorStore );
|
|
15
|
+
const currentBlockAttributes = getBlockAttributes( clientId );
|
|
16
|
+
const [ patternClientId ] = getBlockParentsByBlockName(
|
|
17
|
+
clientId,
|
|
18
|
+
'core/block',
|
|
19
|
+
true
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const overridableValue =
|
|
23
|
+
getBlockAttributes( patternClientId )?.[ CONTENT ]?.[
|
|
24
|
+
currentBlockAttributes?.metadata?.name
|
|
25
|
+
]?.[ attributeName ];
|
|
26
|
+
|
|
27
|
+
// If there is no pattern client ID, or it is not overwritten, return the default value.
|
|
28
|
+
if ( ! patternClientId || overridableValue === undefined ) {
|
|
29
|
+
return currentBlockAttributes[ attributeName ];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return overridableValue === '' ? undefined : overridableValue;
|
|
33
|
+
},
|
|
34
|
+
setValues( { registry, clientId, attributes } ) {
|
|
35
|
+
const { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =
|
|
36
|
+
registry.select( blockEditorStore );
|
|
37
|
+
const currentBlockAttributes = getBlockAttributes( clientId );
|
|
38
|
+
const blockName = currentBlockAttributes?.metadata?.name;
|
|
39
|
+
if ( ! blockName ) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const [ patternClientId ] = getBlockParentsByBlockName(
|
|
44
|
+
clientId,
|
|
45
|
+
'core/block',
|
|
46
|
+
true
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// If there is no pattern client ID, sync blocks with the same name and same attributes.
|
|
50
|
+
if ( ! patternClientId ) {
|
|
51
|
+
const syncBlocksWithSameName = ( blocks ) => {
|
|
52
|
+
for ( const block of blocks ) {
|
|
53
|
+
if ( block.attributes?.metadata?.name === blockName ) {
|
|
54
|
+
registry
|
|
55
|
+
.dispatch( blockEditorStore )
|
|
56
|
+
.updateBlockAttributes(
|
|
57
|
+
block.clientId,
|
|
58
|
+
attributes
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
syncBlocksWithSameName( block.innerBlocks );
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
syncBlocksWithSameName( getBlocks() );
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const currentBindingValue =
|
|
69
|
+
getBlockAttributes( patternClientId )?.[ CONTENT ];
|
|
70
|
+
registry
|
|
71
|
+
.dispatch( blockEditorStore )
|
|
72
|
+
.updateBlockAttributes( patternClientId, {
|
|
73
|
+
[ CONTENT ]: {
|
|
74
|
+
...currentBindingValue,
|
|
75
|
+
[ blockName ]: {
|
|
76
|
+
...currentBindingValue?.[ blockName ],
|
|
77
|
+
...Object.entries( attributes ).reduce(
|
|
78
|
+
( acc, [ key, value ] ) => {
|
|
79
|
+
// TODO: We need a way to represent `undefined` in the serialized overrides.
|
|
80
|
+
// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871
|
|
81
|
+
// We use an empty string to represent undefined for now until
|
|
82
|
+
// we support a richer format for overrides and the block bindings API.
|
|
83
|
+
acc[ key ] = value === undefined ? '' : value;
|
|
84
|
+
return acc;
|
|
85
|
+
},
|
|
86
|
+
{}
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
} );
|
|
91
|
+
},
|
|
10
92
|
lockAttributesEditing: false,
|
|
11
93
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
.editor-autocompleters__user {
|
|
2
2
|
.editor-autocompleters__no-avatar::before {
|
|
3
|
-
/* stylelint-disable */
|
|
3
|
+
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword -- dashicons don't need a generic family keyword. */
|
|
4
4
|
font: normal 20px/1 dashicons;
|
|
5
|
-
/* stylelint-enable */
|
|
6
5
|
content: "\f110";
|
|
7
6
|
margin-right: 5px;
|
|
8
7
|
vertical-align: middle;
|