@wordpress/block-editor 15.13.2-next.v.202602241322.0 → 15.13.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/build/components/block-bindings/attribute-control.cjs +5 -2
- package/build/components/block-bindings/attribute-control.cjs.map +2 -2
- package/build/components/block-inspector/edit-contents.cjs +5 -4
- package/build/components/block-inspector/edit-contents.cjs.map +2 -2
- package/build/components/block-list/block-html.cjs +6 -2
- package/build/components/block-list/block-html.cjs.map +2 -2
- package/build/components/block-list/block.cjs +9 -1
- package/build/components/block-list/block.cjs.map +2 -2
- package/build/components/block-list/use-block-props/index.cjs +10 -1
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-settings-menu-controls/index.cjs +1 -0
- package/build/components/block-settings-menu-controls/index.cjs.map +2 -2
- package/build/components/block-styles/index.cjs +7 -1
- package/build/components/block-styles/index.cjs.map +3 -3
- package/build/components/block-switcher/block-transformations-menu.cjs +2 -0
- package/build/components/block-switcher/block-transformations-menu.cjs.map +2 -2
- package/build/components/block-switcher/block-variation-transformations.cjs +2 -0
- package/build/components/block-switcher/block-variation-transformations.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +1 -1
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +8 -4
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-tools/index.cjs +4 -3
- package/build/components/block-tools/index.cjs.map +2 -2
- package/build/components/block-variation-transforms/index.cjs +11 -5
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/block-visibility/modal.cjs +2 -2
- package/build/components/block-visibility/modal.cjs.map +1 -1
- package/build/components/block-visibility/use-block-visibility.cjs +4 -3
- package/build/components/block-visibility/use-block-visibility.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +6 -1
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
- package/build/components/iframe/index.cjs +1 -3
- package/build/components/iframe/index.cjs.map +2 -2
- package/build/components/iframe/use-scale-canvas.cjs +0 -1
- package/build/components/iframe/use-scale-canvas.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +8 -4
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
- package/build/components/link-picker/link-preview.cjs +2 -1
- package/build/components/link-picker/link-preview.cjs.map +3 -3
- package/build/components/provider/index.cjs +23 -7
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/provider/use-media-upload-settings.cjs +1 -0
- package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
- package/build/components/writing-flow/use-arrow-nav.cjs +1 -1
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/hooks/auto-inspector-controls.cjs +26 -2
- package/build/hooks/auto-inspector-controls.cjs.map +3 -3
- package/build/hooks/cross-origin-isolation.cjs +9 -75
- package/build/hooks/cross-origin-isolation.cjs.map +2 -2
- package/build/hooks/custom-css.cjs +26 -0
- package/build/hooks/custom-css.cjs.map +3 -3
- package/build/private-apis.cjs +1 -0
- package/build/private-apis.cjs.map +2 -2
- package/build/store/actions.cjs +0 -8
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-keys.cjs +3 -0
- package/build/store/private-keys.cjs.map +2 -2
- package/build/store/private-selectors.cjs +4 -3
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +78 -74
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +16 -14
- package/build/store/selectors.cjs.map +2 -2
- package/build-module/components/block-bindings/attribute-control.mjs +5 -2
- package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
- package/build-module/components/block-inspector/edit-contents.mjs +5 -4
- package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
- package/build-module/components/block-list/block-html.mjs +7 -3
- package/build-module/components/block-list/block-html.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +10 -2
- package/build-module/components/block-list/block.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/index.mjs +11 -2
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- package/build-module/components/block-settings-menu-controls/index.mjs +1 -0
- package/build-module/components/block-settings-menu-controls/index.mjs.map +2 -2
- package/build-module/components/block-styles/index.mjs +7 -1
- package/build-module/components/block-styles/index.mjs.map +2 -2
- package/build-module/components/block-switcher/block-transformations-menu.mjs +2 -0
- package/build-module/components/block-switcher/block-transformations-menu.mjs.map +2 -2
- package/build-module/components/block-switcher/block-variation-transformations.mjs +2 -0
- package/build-module/components/block-switcher/block-variation-transformations.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +1 -1
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +8 -4
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-tools/index.mjs +4 -3
- package/build-module/components/block-tools/index.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +11 -5
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +2 -2
- package/build-module/components/block-visibility/modal.mjs.map +1 -1
- package/build-module/components/block-visibility/use-block-visibility.mjs +4 -3
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +6 -1
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
- package/build-module/components/iframe/index.mjs +2 -9
- package/build-module/components/iframe/index.mjs.map +2 -2
- package/build-module/components/iframe/use-scale-canvas.mjs +0 -1
- package/build-module/components/iframe/use-scale-canvas.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +8 -4
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
- package/build-module/components/link-picker/link-preview.mjs +2 -1
- package/build-module/components/link-picker/link-preview.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +23 -7
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-media-upload-settings.mjs +1 -0
- package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/hooks/auto-inspector-controls.mjs +28 -4
- package/build-module/hooks/auto-inspector-controls.mjs.map +2 -2
- package/build-module/hooks/cross-origin-isolation.mjs +9 -75
- package/build-module/hooks/cross-origin-isolation.mjs.map +2 -2
- package/build-module/hooks/custom-css.mjs +28 -2
- package/build-module/hooks/custom-css.mjs.map +2 -2
- package/build-module/private-apis.mjs +3 -1
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +0 -8
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +2 -0
- package/build-module/store/private-keys.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +4 -3
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +78 -73
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +16 -14
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-style/content-rtl.css +25 -0
- package/build-style/content.css +25 -0
- package/build-style/style-rtl.css +3 -0
- package/build-style/style.css +3 -0
- package/package.json +39 -39
- package/src/components/block-bindings/attribute-control.js +8 -3
- package/src/components/block-inspector/edit-contents.js +5 -3
- package/src/components/block-list/block-html.js +13 -3
- package/src/components/block-list/block.js +10 -1
- package/src/components/block-list/content.scss +35 -0
- package/src/components/block-list/use-block-props/index.js +11 -1
- package/src/components/block-settings-menu-controls/index.js +1 -0
- package/src/components/block-styles/index.js +7 -1
- package/src/components/block-switcher/block-transformations-menu.js +2 -0
- package/src/components/block-switcher/block-variation-transformations.js +2 -0
- package/src/components/block-toolbar/block-toolbar-icon.js +6 -1
- package/src/components/block-toolbar/index.js +7 -2
- package/src/components/block-tools/index.js +11 -4
- package/src/components/block-tools/style.scss +5 -0
- package/src/components/block-variation-transforms/index.js +41 -36
- package/src/components/block-visibility/use-block-visibility.js +4 -2
- package/src/components/block-visibility/viewport-visibility-info.js +8 -1
- package/src/components/dimensions-tool/scale-tool.js +2 -2
- package/src/components/iframe/index.js +2 -12
- package/src/components/iframe/use-scale-canvas.js +0 -1
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +9 -5
- package/src/components/link-picker/link-preview.js +2 -1
- package/src/components/provider/index.js +49 -6
- package/src/components/provider/use-media-upload-settings.js +1 -0
- package/src/components/writing-flow/use-arrow-nav.js +9 -2
- package/src/hooks/auto-inspector-controls.js +31 -4
- package/src/hooks/cross-origin-isolation.js +10 -109
- package/src/hooks/custom-css.js +36 -2
- package/src/hooks/test/cross-origin-isolation.js +15 -42
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +0 -8
- package/src/store/private-keys.js +1 -0
- package/src/store/private-selectors.js +6 -3
- package/src/store/reducer.js +119 -97
- package/src/store/selectors.js +59 -22
- package/src/store/test/private-selectors.js +67 -34
- package/src/store/test/reducer.js +545 -57
- package/src/store/test/selectors.js +611 -53
|
@@ -199,6 +199,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
199
199
|
outline-style: solid;
|
|
200
200
|
outline-width: calc(1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
201
201
|
outline-offset: calc(1 * -1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
202
|
+
box-shadow: inset 0 0 0 calc(1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1) + 0.5px) rgba(255, 255, 255, 0.7);
|
|
202
203
|
z-index: 1;
|
|
203
204
|
}
|
|
204
205
|
.block-editor-block-list__layout .block-editor-block-list__block.is-block-hidden {
|
|
@@ -264,6 +265,18 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
264
265
|
.block-editor-block-list__layout .block-editor-block-list__block.has-warning .block-editor-warning {
|
|
265
266
|
pointer-events: all;
|
|
266
267
|
}
|
|
268
|
+
.block-editor-block-list__layout .block-editor-block-list__block.has-warning::after {
|
|
269
|
+
content: "";
|
|
270
|
+
position: absolute;
|
|
271
|
+
top: 0;
|
|
272
|
+
left: 0;
|
|
273
|
+
bottom: 0;
|
|
274
|
+
right: 0;
|
|
275
|
+
background-color: rgba(255, 255, 255, 0.4);
|
|
276
|
+
}
|
|
277
|
+
.block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-multi-selected::after {
|
|
278
|
+
background-color: transparent;
|
|
279
|
+
}
|
|
267
280
|
.block-editor-block-list__layout .block-editor-block-list__block[data-clear=true] {
|
|
268
281
|
float: none;
|
|
269
282
|
}
|
|
@@ -293,6 +306,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
293
306
|
outline-style: solid;
|
|
294
307
|
outline-width: calc(1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
295
308
|
outline-offset: calc(1 * -1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
309
|
+
box-shadow: inset 0 0 0 calc(1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1) + 0.5px) rgba(255, 255, 255, 0.7);
|
|
296
310
|
}
|
|
297
311
|
|
|
298
312
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).wp-block-template-part.is-hovered::after, .is-outline-mode .block-editor-block-list__block:not(.remove-outline).wp-block-template-part.is-selected::after, .is-outline-mode .block-editor-block-list__block:not(.remove-outline).wp-block-template-part.is-highlighted::after,
|
|
@@ -442,6 +456,17 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
442
456
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
443
457
|
}
|
|
444
458
|
|
|
459
|
+
/**
|
|
460
|
+
* Warnings.
|
|
461
|
+
*/
|
|
462
|
+
.block-editor-block-list__block .block-editor-warning {
|
|
463
|
+
z-index: 5;
|
|
464
|
+
position: relative;
|
|
465
|
+
}
|
|
466
|
+
.block-editor-block-list__block .block-editor-warning.block-editor-block-list__block-crash-warning {
|
|
467
|
+
margin-bottom: auto;
|
|
468
|
+
}
|
|
469
|
+
|
|
445
470
|
.block-editor-block-list__zoom-out-separator {
|
|
446
471
|
/* same color as the iframe's background */
|
|
447
472
|
background: #ddd;
|
package/build-style/content.css
CHANGED
|
@@ -199,6 +199,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
199
199
|
outline-style: solid;
|
|
200
200
|
outline-width: calc(1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
201
201
|
outline-offset: calc(1 * -1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
202
|
+
box-shadow: inset 0 0 0 calc(1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1) + 0.5px) rgba(255, 255, 255, 0.7);
|
|
202
203
|
z-index: 1;
|
|
203
204
|
}
|
|
204
205
|
.block-editor-block-list__layout .block-editor-block-list__block.is-block-hidden {
|
|
@@ -264,6 +265,18 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
264
265
|
.block-editor-block-list__layout .block-editor-block-list__block.has-warning .block-editor-warning {
|
|
265
266
|
pointer-events: all;
|
|
266
267
|
}
|
|
268
|
+
.block-editor-block-list__layout .block-editor-block-list__block.has-warning::after {
|
|
269
|
+
content: "";
|
|
270
|
+
position: absolute;
|
|
271
|
+
top: 0;
|
|
272
|
+
right: 0;
|
|
273
|
+
bottom: 0;
|
|
274
|
+
left: 0;
|
|
275
|
+
background-color: rgba(255, 255, 255, 0.4);
|
|
276
|
+
}
|
|
277
|
+
.block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-multi-selected::after {
|
|
278
|
+
background-color: transparent;
|
|
279
|
+
}
|
|
267
280
|
.block-editor-block-list__layout .block-editor-block-list__block[data-clear=true] {
|
|
268
281
|
float: none;
|
|
269
282
|
}
|
|
@@ -293,6 +306,7 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
293
306
|
outline-style: solid;
|
|
294
307
|
outline-width: calc(1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
295
308
|
outline-offset: calc(1 * -1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
309
|
+
box-shadow: inset 0 0 0 calc(1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1) + 0.5px) rgba(255, 255, 255, 0.7);
|
|
296
310
|
}
|
|
297
311
|
|
|
298
312
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).wp-block-template-part.is-hovered::after, .is-outline-mode .block-editor-block-list__block:not(.remove-outline).wp-block-template-part.is-selected::after, .is-outline-mode .block-editor-block-list__block:not(.remove-outline).wp-block-template-part.is-highlighted::after,
|
|
@@ -442,6 +456,17 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
442
456
|
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
443
457
|
}
|
|
444
458
|
|
|
459
|
+
/**
|
|
460
|
+
* Warnings.
|
|
461
|
+
*/
|
|
462
|
+
.block-editor-block-list__block .block-editor-warning {
|
|
463
|
+
z-index: 5;
|
|
464
|
+
position: relative;
|
|
465
|
+
}
|
|
466
|
+
.block-editor-block-list__block .block-editor-warning.block-editor-block-list__block-crash-warning {
|
|
467
|
+
margin-bottom: auto;
|
|
468
|
+
}
|
|
469
|
+
|
|
445
470
|
.block-editor-block-list__zoom-out-separator {
|
|
446
471
|
/* same color as the iframe's background */
|
|
447
472
|
background: #ddd;
|
|
@@ -502,6 +502,9 @@ iframe[name=editor-canvas] {
|
|
|
502
502
|
right: auto;
|
|
503
503
|
margin-right: -1px;
|
|
504
504
|
}
|
|
505
|
+
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector::after {
|
|
506
|
+
display: inline-flex;
|
|
507
|
+
}
|
|
505
508
|
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-mover__move-button-container,
|
|
506
509
|
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-toolbar__block-controls .block-editor-block-mover {
|
|
507
510
|
border-right: 1px solid #1e1e1e;
|
package/build-style/style.css
CHANGED
|
@@ -502,6 +502,9 @@ iframe[name=editor-canvas] {
|
|
|
502
502
|
left: auto;
|
|
503
503
|
margin-left: -1px;
|
|
504
504
|
}
|
|
505
|
+
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector::after {
|
|
506
|
+
display: inline-flex;
|
|
507
|
+
}
|
|
505
508
|
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-mover__move-button-container,
|
|
506
509
|
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-toolbar__block-controls .block-editor-block-mover {
|
|
507
510
|
border-left: 1px solid #1e1e1e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "15.13.2
|
|
3
|
+
"version": "15.13.2",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -61,43 +61,43 @@
|
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@react-spring/web": "^9.4.5",
|
|
64
|
-
"@wordpress/a11y": "^4.40.1
|
|
65
|
-
"@wordpress/api-fetch": "^7.40.1
|
|
66
|
-
"@wordpress/base-styles": "^6.16.1
|
|
67
|
-
"@wordpress/blob": "^4.40.1
|
|
68
|
-
"@wordpress/block-serialization-default-parser": "^5.40.1
|
|
69
|
-
"@wordpress/blocks": "^15.13.1
|
|
70
|
-
"@wordpress/commands": "^1.40.1
|
|
71
|
-
"@wordpress/components": "^32.
|
|
72
|
-
"@wordpress/compose": "^7.40.1
|
|
73
|
-
"@wordpress/data": "^10.40.1
|
|
74
|
-
"@wordpress/dataviews": "^12.
|
|
75
|
-
"@wordpress/date": "^5.40.1
|
|
76
|
-
"@wordpress/deprecated": "^4.40.1
|
|
77
|
-
"@wordpress/dom": "^4.40.1
|
|
78
|
-
"@wordpress/element": "^6.40.1
|
|
79
|
-
"@wordpress/escape-html": "^3.40.1
|
|
80
|
-
"@wordpress/global-styles-engine": "^1.7.1
|
|
81
|
-
"@wordpress/hooks": "^4.40.1
|
|
82
|
-
"@wordpress/html-entities": "^4.40.1
|
|
83
|
-
"@wordpress/i18n": "^6.13.1
|
|
84
|
-
"@wordpress/icons": "^11.7.1
|
|
85
|
-
"@wordpress/image-cropper": "^1.4.1
|
|
86
|
-
"@wordpress/interactivity": "^6.40.1
|
|
87
|
-
"@wordpress/is-shallow-equal": "^5.40.1
|
|
88
|
-
"@wordpress/keyboard-shortcuts": "^5.40.1
|
|
89
|
-
"@wordpress/keycodes": "^4.40.1
|
|
90
|
-
"@wordpress/notices": "^5.40.1
|
|
91
|
-
"@wordpress/preferences": "^4.40.1
|
|
92
|
-
"@wordpress/priority-queue": "^3.40.1
|
|
93
|
-
"@wordpress/private-apis": "^1.40.1
|
|
94
|
-
"@wordpress/rich-text": "^7.40.1
|
|
95
|
-
"@wordpress/style-engine": "^2.40.1
|
|
96
|
-
"@wordpress/token-list": "^3.40.1
|
|
97
|
-
"@wordpress/upload-media": "^0.25.2
|
|
98
|
-
"@wordpress/url": "^4.40.1
|
|
99
|
-
"@wordpress/warning": "^3.40.1
|
|
100
|
-
"@wordpress/wordcount": "^4.40.1
|
|
64
|
+
"@wordpress/a11y": "^4.40.1",
|
|
65
|
+
"@wordpress/api-fetch": "^7.40.1",
|
|
66
|
+
"@wordpress/base-styles": "^6.16.1",
|
|
67
|
+
"@wordpress/blob": "^4.40.1",
|
|
68
|
+
"@wordpress/block-serialization-default-parser": "^5.40.1",
|
|
69
|
+
"@wordpress/blocks": "^15.13.1",
|
|
70
|
+
"@wordpress/commands": "^1.40.1",
|
|
71
|
+
"@wordpress/components": "^32.2.1",
|
|
72
|
+
"@wordpress/compose": "^7.40.1",
|
|
73
|
+
"@wordpress/data": "^10.40.1",
|
|
74
|
+
"@wordpress/dataviews": "^12.0.1",
|
|
75
|
+
"@wordpress/date": "^5.40.1",
|
|
76
|
+
"@wordpress/deprecated": "^4.40.1",
|
|
77
|
+
"@wordpress/dom": "^4.40.1",
|
|
78
|
+
"@wordpress/element": "^6.40.1",
|
|
79
|
+
"@wordpress/escape-html": "^3.40.1",
|
|
80
|
+
"@wordpress/global-styles-engine": "^1.7.1",
|
|
81
|
+
"@wordpress/hooks": "^4.40.1",
|
|
82
|
+
"@wordpress/html-entities": "^4.40.1",
|
|
83
|
+
"@wordpress/i18n": "^6.13.1",
|
|
84
|
+
"@wordpress/icons": "^11.7.1",
|
|
85
|
+
"@wordpress/image-cropper": "^1.4.1",
|
|
86
|
+
"@wordpress/interactivity": "^6.40.1",
|
|
87
|
+
"@wordpress/is-shallow-equal": "^5.40.1",
|
|
88
|
+
"@wordpress/keyboard-shortcuts": "^5.40.1",
|
|
89
|
+
"@wordpress/keycodes": "^4.40.1",
|
|
90
|
+
"@wordpress/notices": "^5.40.1",
|
|
91
|
+
"@wordpress/preferences": "^4.40.1",
|
|
92
|
+
"@wordpress/priority-queue": "^3.40.1",
|
|
93
|
+
"@wordpress/private-apis": "^1.40.1",
|
|
94
|
+
"@wordpress/rich-text": "^7.40.1",
|
|
95
|
+
"@wordpress/style-engine": "^2.40.1",
|
|
96
|
+
"@wordpress/token-list": "^3.40.1",
|
|
97
|
+
"@wordpress/upload-media": "^0.25.2",
|
|
98
|
+
"@wordpress/url": "^4.40.1",
|
|
99
|
+
"@wordpress/warning": "^3.40.1",
|
|
100
|
+
"@wordpress/wordcount": "^4.40.1",
|
|
101
101
|
"change-case": "^4.1.2",
|
|
102
102
|
"clsx": "^2.1.1",
|
|
103
103
|
"colord": "^2.7.0",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"publishConfig": {
|
|
125
125
|
"access": "public"
|
|
126
126
|
},
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "adb6623c9f32490cfc73c7ac7f122578c1f10c65"
|
|
128
128
|
}
|
|
@@ -50,10 +50,15 @@ export default function BlockBindingsAttributeControl( {
|
|
|
50
50
|
getBlockType,
|
|
51
51
|
} = unlock( select( blocksStore ) );
|
|
52
52
|
|
|
53
|
-
const
|
|
54
|
-
getBlockType( blockName ).attributes?.[ attribute ]
|
|
53
|
+
const _attribute =
|
|
54
|
+
getBlockType( blockName ).attributes?.[ attribute ];
|
|
55
|
+
|
|
56
|
+
if ( _attribute?.enum ) {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
const attributeType =
|
|
56
|
-
|
|
61
|
+
_attribute?.type === 'rich-text' ? 'string' : _attribute?.type;
|
|
57
62
|
|
|
58
63
|
const sourceFields = {};
|
|
59
64
|
Object.entries( getAllBlockBindingsSources() ).forEach(
|
|
@@ -92,19 +92,21 @@ export default function EditContents( { clientId } ) {
|
|
|
92
92
|
stopEditingContentOnlySection,
|
|
93
93
|
} = useContentOnlySectionEdit( clientId );
|
|
94
94
|
|
|
95
|
-
const { block, onNavigateToEntityRecord } = useSelect(
|
|
95
|
+
const { block, onNavigateToEntityRecord, canEdit } = useSelect(
|
|
96
96
|
( select ) => {
|
|
97
|
-
const { getBlock, getSettings } =
|
|
97
|
+
const { getBlock, getSettings, canEditBlock } =
|
|
98
|
+
select( blockEditorStore );
|
|
98
99
|
return {
|
|
99
100
|
block: getBlock( clientId ),
|
|
100
101
|
onNavigateToEntityRecord:
|
|
101
102
|
getSettings().onNavigateToEntityRecord,
|
|
103
|
+
canEdit: canEditBlock( clientId ),
|
|
102
104
|
};
|
|
103
105
|
},
|
|
104
106
|
[ clientId ]
|
|
105
107
|
);
|
|
106
108
|
|
|
107
|
-
if ( ! isWithinSection && ! isWithinEditedSection ) {
|
|
109
|
+
if ( ! canEdit || ( ! isWithinSection && ! isWithinEditedSection ) ) {
|
|
108
110
|
return null;
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -6,7 +6,7 @@ import TextareaAutosize from 'react-autosize-textarea';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useEffect, useState } from '@wordpress/element';
|
|
9
|
+
import { useEffect, useMemo, useState } from '@wordpress/element';
|
|
10
10
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
11
|
import {
|
|
12
12
|
getBlockAttributes,
|
|
@@ -28,6 +28,16 @@ function BlockHTML( { clientId } ) {
|
|
|
28
28
|
[ clientId ]
|
|
29
29
|
);
|
|
30
30
|
const { updateBlock } = useDispatch( blockEditorStore );
|
|
31
|
+
|
|
32
|
+
// Derive block content as a primitive string so the effect only fires
|
|
33
|
+
// when the serialized content genuinely changes, not when the block
|
|
34
|
+
// object reference changes (which happens on every RESET_BLOCKS during
|
|
35
|
+
// RTC sync, even for unchanged blocks).
|
|
36
|
+
const blockContent = useMemo(
|
|
37
|
+
() => ( block ? getBlockContent( block ) : '' ),
|
|
38
|
+
[ block ]
|
|
39
|
+
);
|
|
40
|
+
|
|
31
41
|
const onChange = () => {
|
|
32
42
|
const blockType = getBlockType( block.name );
|
|
33
43
|
|
|
@@ -64,8 +74,8 @@ function BlockHTML( { clientId } ) {
|
|
|
64
74
|
};
|
|
65
75
|
|
|
66
76
|
useEffect( () => {
|
|
67
|
-
setHtml(
|
|
68
|
-
}, [
|
|
77
|
+
setHtml( blockContent );
|
|
78
|
+
}, [ blockContent ] );
|
|
69
79
|
|
|
70
80
|
return (
|
|
71
81
|
<TextareaAutosize
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from '@wordpress/blocks';
|
|
24
24
|
import { withFilters } from '@wordpress/components';
|
|
25
25
|
import { withDispatch, useSelect } from '@wordpress/data';
|
|
26
|
-
import { compose } from '@wordpress/compose';
|
|
26
|
+
import { compose, useRefEffect } from '@wordpress/compose';
|
|
27
27
|
import { safeHTML } from '@wordpress/dom';
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -741,10 +741,19 @@ function BlockListBlockProvider( props ) {
|
|
|
741
741
|
[ clientId, rootClientId ]
|
|
742
742
|
);
|
|
743
743
|
|
|
744
|
+
const defaultViewRef = useRefEffect( ( element ) => {
|
|
745
|
+
if ( element ) {
|
|
746
|
+
const { ownerDocument } = element;
|
|
747
|
+
const { defaultView } = ownerDocument;
|
|
748
|
+
defaultViewRef.current = defaultView;
|
|
749
|
+
}
|
|
750
|
+
}, [] );
|
|
751
|
+
|
|
744
752
|
// Use block visibility hook with data from existing useSelect to avoid extra subscription
|
|
745
753
|
const { isBlockCurrentlyHidden } = useBlockVisibility( {
|
|
746
754
|
blockVisibility: selectedProps?.blockVisibility,
|
|
747
755
|
deviceType: selectedProps?.deviceType,
|
|
756
|
+
view: defaultViewRef.current,
|
|
748
757
|
} );
|
|
749
758
|
|
|
750
759
|
// Users of the editor.BlockListBlock filter used to be able to
|
|
@@ -191,6 +191,22 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
// Scrim overlay.
|
|
195
|
+
&.has-warning::after {
|
|
196
|
+
content: "";
|
|
197
|
+
position: absolute;
|
|
198
|
+
top: 0;
|
|
199
|
+
right: 0;
|
|
200
|
+
bottom: 0;
|
|
201
|
+
left: 0;
|
|
202
|
+
background-color: rgba($white, 0.4);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Avoid conflict with the multi-selection highlight color.
|
|
206
|
+
&.has-warning.is-multi-selected::after {
|
|
207
|
+
background-color: transparent;
|
|
208
|
+
}
|
|
209
|
+
|
|
194
210
|
// Clear floats.
|
|
195
211
|
&[data-clear="true"] {
|
|
196
212
|
float: none;
|
|
@@ -399,6 +415,25 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
399
415
|
}
|
|
400
416
|
}
|
|
401
417
|
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Warnings.
|
|
421
|
+
*/
|
|
422
|
+
|
|
423
|
+
.block-editor-block-list__block .block-editor-warning {
|
|
424
|
+
z-index: z-index(".block-editor-warning");
|
|
425
|
+
position: relative;
|
|
426
|
+
|
|
427
|
+
&.block-editor-block-list__block-crash-warning {
|
|
428
|
+
// The block crash warning has no block preview underneath it.
|
|
429
|
+
// The lack of a preview combined with the negative margin that
|
|
430
|
+
// the warning normally has results in crashed blocks overlapping
|
|
431
|
+
// any blocks that come after them. Resetting the margin to `auto`
|
|
432
|
+
// solves this.
|
|
433
|
+
margin-bottom: auto;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
402
437
|
.block-editor-block-list__zoom-out-separator {
|
|
403
438
|
/* same color as the iframe's background */
|
|
404
439
|
background: $gray-300;
|
|
@@ -9,7 +9,7 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { useContext } from '@wordpress/element';
|
|
10
10
|
import { __, sprintf } from '@wordpress/i18n';
|
|
11
11
|
import { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';
|
|
12
|
-
import { useMergeRefs, useDisabled } from '@wordpress/compose';
|
|
12
|
+
import { useMergeRefs, useDisabled, useRefEffect } from '@wordpress/compose';
|
|
13
13
|
import warning from '@wordpress/warning';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -107,6 +107,14 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
107
107
|
deviceType,
|
|
108
108
|
} = useContext( PrivateBlockContext );
|
|
109
109
|
|
|
110
|
+
const defaultViewRef = useRefEffect( ( element ) => {
|
|
111
|
+
if ( element ) {
|
|
112
|
+
const { ownerDocument } = element;
|
|
113
|
+
const { defaultView } = ownerDocument;
|
|
114
|
+
defaultViewRef.current = defaultView;
|
|
115
|
+
}
|
|
116
|
+
}, [] );
|
|
117
|
+
|
|
110
118
|
// translators: %s: Type of block (i.e. Text, Image etc)
|
|
111
119
|
const blockLabel = sprintf( __( 'Block: %s' ), blockTitle );
|
|
112
120
|
const htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';
|
|
@@ -114,6 +122,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
114
122
|
const isHoverEnabled = ! isWithinSectionBlock;
|
|
115
123
|
const mergedRefs = useMergeRefs( [
|
|
116
124
|
props.ref,
|
|
125
|
+
defaultViewRef,
|
|
117
126
|
useFocusFirstElement( { clientId, initialPosition } ),
|
|
118
127
|
useBlockRefProvider( clientId ),
|
|
119
128
|
useFocusHandler( clientId ),
|
|
@@ -144,6 +153,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
144
153
|
const { isBlockCurrentlyHidden } = useBlockVisibility( {
|
|
145
154
|
blockVisibility,
|
|
146
155
|
deviceType,
|
|
156
|
+
view: defaultViewRef.current,
|
|
147
157
|
} );
|
|
148
158
|
|
|
149
159
|
// Ensures it warns only inside the `edit` implementation for the block.
|
|
@@ -7,6 +7,7 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useState } from '@wordpress/element';
|
|
10
|
+
import { useSelect } from '@wordpress/data';
|
|
10
11
|
import { debounce, useViewportMatch } from '@wordpress/compose';
|
|
11
12
|
import {
|
|
12
13
|
Button,
|
|
@@ -24,11 +25,16 @@ import BlockStylesPreviewPanel from './preview-panel';
|
|
|
24
25
|
import useStylesForBlocks from './use-styles-for-block';
|
|
25
26
|
import { useToolsPanelDropdownMenuProps } from '../global-styles/utils';
|
|
26
27
|
import { getDefaultStyle } from './utils';
|
|
28
|
+
import { store as blockEditorStore } from '../../store';
|
|
27
29
|
|
|
28
30
|
const noop = () => {};
|
|
29
31
|
|
|
30
32
|
// Block Styles component for the Settings Sidebar.
|
|
31
33
|
function BlockStyles( { clientId, onSwitch = noop, onHoverClassName = noop } ) {
|
|
34
|
+
const canEdit = useSelect(
|
|
35
|
+
( select ) => select( blockEditorStore ).canEditBlock( clientId ),
|
|
36
|
+
[ clientId ]
|
|
37
|
+
);
|
|
32
38
|
const {
|
|
33
39
|
onSelect,
|
|
34
40
|
stylesToRender,
|
|
@@ -43,7 +49,7 @@ function BlockStyles( { clientId, onSwitch = noop, onHoverClassName = noop } ) {
|
|
|
43
49
|
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
44
50
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
45
51
|
|
|
46
|
-
if ( ! stylesToRender || stylesToRender.length === 0 ) {
|
|
52
|
+
if ( ! canEdit || ! stylesToRender || stylesToRender.length === 0 ) {
|
|
47
53
|
return null;
|
|
48
54
|
}
|
|
49
55
|
|
|
@@ -176,6 +176,8 @@ function BlockTransformationItem( {
|
|
|
176
176
|
disabled={ isDisabled }
|
|
177
177
|
onMouseLeave={ () => setHoveredTransformItemName( null ) }
|
|
178
178
|
onMouseEnter={ () => setHoveredTransformItemName( name ) }
|
|
179
|
+
onFocus={ () => setHoveredTransformItemName( name ) }
|
|
180
|
+
onBlur={ () => setHoveredTransformItemName( null ) }
|
|
179
181
|
>
|
|
180
182
|
<BlockIcon icon={ icon } showColors />
|
|
181
183
|
{ title }
|
|
@@ -100,6 +100,8 @@ function BlockVariationTransformationItem( {
|
|
|
100
100
|
} }
|
|
101
101
|
onMouseLeave={ () => setHoveredTransformItemName( null ) }
|
|
102
102
|
onMouseEnter={ () => setHoveredTransformItemName( name ) }
|
|
103
|
+
onFocus={ () => setHoveredTransformItemName( name ) }
|
|
104
|
+
onBlur={ () => setHoveredTransformItemName( null ) }
|
|
103
105
|
>
|
|
104
106
|
<BlockIcon icon={ icon } showColors />
|
|
105
107
|
{ title }
|
|
@@ -71,7 +71,12 @@ function getBlockIconVariant( { select, clientIds } ) {
|
|
|
71
71
|
|
|
72
72
|
if ( _showBlockSwitcher ) {
|
|
73
73
|
return 'switcher';
|
|
74
|
-
} else if (
|
|
74
|
+
} else if (
|
|
75
|
+
isContentOnlyMode &&
|
|
76
|
+
hasBlockStyles &&
|
|
77
|
+
! hasPatternOverrides &&
|
|
78
|
+
canEdit
|
|
79
|
+
) {
|
|
75
80
|
return 'styles-only';
|
|
76
81
|
} else if ( _showPatternOverrides ) {
|
|
77
82
|
return 'pattern-overrides';
|
|
@@ -78,7 +78,9 @@ export function PrivateBlockToolbar( {
|
|
|
78
78
|
showBlockVisibilityButton,
|
|
79
79
|
showSwitchSectionStyleButton,
|
|
80
80
|
areSelectedBlocksHiddenOnViewport,
|
|
81
|
+
canEdit,
|
|
81
82
|
} = useSelect( ( select ) => {
|
|
83
|
+
const { canEditBlock } = select( blockEditorStore );
|
|
82
84
|
const {
|
|
83
85
|
getBlockName,
|
|
84
86
|
getBlockMode,
|
|
@@ -122,7 +124,9 @@ export function PrivateBlockToolbar( {
|
|
|
122
124
|
|
|
123
125
|
const _isZoomOut = isZoomOut();
|
|
124
126
|
const _isSectionBlock = isSectionBlock( selectedBlockClientId );
|
|
125
|
-
const
|
|
127
|
+
const _canEditBlock = canEditBlock( selectedBlockClientId );
|
|
128
|
+
const _showSwitchSectionStyleButton =
|
|
129
|
+
_canEditBlock && ( _isZoomOut || _isSectionBlock );
|
|
126
130
|
|
|
127
131
|
const _currentDeviceType =
|
|
128
132
|
getSettings()?.[ deviceTypeKey ]?.toLowerCase() || 'desktop';
|
|
@@ -161,6 +165,7 @@ export function PrivateBlockToolbar( {
|
|
|
161
165
|
showSwitchSectionStyleButton: _showSwitchSectionStyleButton,
|
|
162
166
|
areSelectedBlocksHiddenOnViewport:
|
|
163
167
|
_areSelectedBlocksHiddenOnViewport,
|
|
168
|
+
canEdit: _canEditBlock,
|
|
164
169
|
};
|
|
165
170
|
}, [] );
|
|
166
171
|
|
|
@@ -245,7 +250,7 @@ export function PrivateBlockToolbar( {
|
|
|
245
250
|
shouldShowVisualToolbar &&
|
|
246
251
|
isMultiToolbar &&
|
|
247
252
|
showGroupButtons && <BlockGroupToolbar /> }
|
|
248
|
-
{ ! isMultiToolbar && (
|
|
253
|
+
{ ! isMultiToolbar && canEdit && (
|
|
249
254
|
<EditSectionButton clientId={ blockClientIds[ 0 ] } />
|
|
250
255
|
) }
|
|
251
256
|
{ ! areSelectedBlocksHiddenOnViewport && showShuffleButton && (
|
|
@@ -92,6 +92,7 @@ export default function BlockTools( {
|
|
|
92
92
|
getBlockName,
|
|
93
93
|
isGroupable,
|
|
94
94
|
getEditedContentOnlySection,
|
|
95
|
+
canEditBlock,
|
|
95
96
|
} = unlock( useSelect( blockEditorStore ) );
|
|
96
97
|
const { getGroupingBlockName } = useSelect( blocksStore );
|
|
97
98
|
const { showEmptyBlockSideInserter, showBlockToolbarPopover } =
|
|
@@ -234,7 +235,10 @@ export default function BlockTools( {
|
|
|
234
235
|
if ( clientIds.length === 1 ) {
|
|
235
236
|
const isContentOnly =
|
|
236
237
|
getBlockEditingMode( clientIds[ 0 ] ) === 'contentOnly';
|
|
237
|
-
const canRenameBlock =
|
|
238
|
+
const canRenameBlock =
|
|
239
|
+
canRename &&
|
|
240
|
+
! isContentOnly &&
|
|
241
|
+
canEditBlock( clientIds[ 0 ] );
|
|
238
242
|
if ( canRenameBlock ) {
|
|
239
243
|
event.preventDefault();
|
|
240
244
|
setRenamingBlockClientId( clientIds[ 0 ] );
|
|
@@ -255,11 +259,14 @@ export default function BlockTools( {
|
|
|
255
259
|
return;
|
|
256
260
|
}
|
|
257
261
|
|
|
258
|
-
// Don't allow visibility toggle for blocks that
|
|
259
|
-
//
|
|
262
|
+
// Don't allow visibility toggle for blocks that are not in the
|
|
263
|
+
// default editing mode or when block editing is disabled
|
|
264
|
+
// (e.g. Revisions UI with isPreviewMode).
|
|
260
265
|
if (
|
|
261
266
|
clientIds.some(
|
|
262
|
-
( id ) =>
|
|
267
|
+
( id ) =>
|
|
268
|
+
getBlockEditingMode( id ) !== 'default' ||
|
|
269
|
+
! canEditBlock( id )
|
|
263
270
|
)
|
|
264
271
|
) {
|
|
265
272
|
return;
|
|
@@ -191,6 +191,11 @@
|
|
|
191
191
|
position: relative;
|
|
192
192
|
left: auto;
|
|
193
193
|
margin-left: -$border-width;
|
|
194
|
+
|
|
195
|
+
// Show the dot divider since the parent selector is inline.
|
|
196
|
+
&::after {
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
}
|
|
194
199
|
}
|
|
195
200
|
|
|
196
201
|
.block-editor-block-mover__move-button-container,
|