@wordpress/block-editor 12.6.0 → 12.7.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 +2 -0
- package/README.md +2 -2
- package/build/autocompleters/block.js +6 -2
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-editing-mode/index.js +1 -1
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-list/block.js +4 -2
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/index.js +2 -4
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-parent-selector/index.js +6 -21
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-preview/auto.js +6 -1
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +3 -17
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-toolbar/index.js +4 -34
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/utils.js +56 -51
- package/build/components/block-toolbar/utils.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +4 -2
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +10 -20
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/editor-styles/index.js +2 -2
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +11 -11
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/global-styles/behaviors-panel.js +66 -0
- package/build/components/global-styles/behaviors-panel.js.map +1 -0
- package/build/components/global-styles/hooks.js +118 -4
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +20 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +4 -4
- package/build/components/global-styles/typography-utils.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/inserter/hooks/use-block-types-state.js +6 -2
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-debounced-input.js +5 -7
- package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +3 -2
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +3 -2
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter-list-item/index.js +1 -1
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/link-control/index.js +47 -6
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +3 -3
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +6 -1
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/media-replace-flow/index.native.js +15 -3
- package/build/components/media-replace-flow/index.native.js.map +1 -1
- package/build/components/rich-text/format-edit.js +57 -28
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/get-rich-text-values.js +11 -18
- package/build/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +2 -2
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/hooks/behaviors.js +5 -12
- package/build/hooks/behaviors.js.map +1 -1
- package/build/hooks/border.js +2 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/style.js +11 -2
- package/build/hooks/style.js.map +1 -1
- package/build/private-apis.js +4 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +2 -3
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +4 -71
- package/build/store/selectors.js.map +1 -1
- package/build-module/autocompleters/block.js +7 -3
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +1 -1
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-list/block.js +4 -2
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/index.js +2 -3
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +7 -22
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +6 -1
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +4 -18
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +6 -36
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/utils.js +54 -49
- package/build-module/components/block-toolbar/utils.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +4 -2
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +13 -23
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/editor-styles/index.js +2 -2
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +11 -11
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/global-styles/behaviors-panel.js +57 -0
- package/build-module/components/global-styles/behaviors-panel.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +115 -5
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +2 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +4 -4
- package/build-module/components/global-styles/typography-utils.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/inserter/hooks/use-block-types-state.js +7 -3
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +5 -7
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +3 -2
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +3 -2
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +1 -1
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/link-control/index.js +45 -6
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +3 -3
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +6 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/media-replace-flow/index.native.js +15 -3
- package/build-module/components/media-replace-flow/index.native.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +51 -26
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/get-rich-text-values.js +13 -18
- package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +2 -2
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/hooks/behaviors.js +5 -12
- package/build-module/hooks/behaviors.js.map +1 -1
- package/build-module/hooks/border.js +2 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/style.js +11 -2
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +2 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +4 -69
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +18 -5
- package/build-style/style.css +18 -5
- package/package.json +31 -31
- package/src/autocompleters/block.js +21 -6
- package/src/components/block-draggable/test/index.native.js +2 -3
- package/src/components/block-editing-mode/index.js +1 -1
- package/src/components/block-list/block.js +6 -1
- package/src/components/block-list/index.js +3 -6
- package/src/components/block-list/test/block-invalid-warning.native.js +8 -1
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +24 -0
- package/src/components/block-parent-selector/index.js +30 -42
- package/src/components/block-preview/auto.js +8 -1
- package/src/components/block-preview/style.scss +2 -1
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -13
- package/src/components/block-toolbar/index.js +36 -63
- package/src/components/block-toolbar/utils.js +57 -45
- package/src/components/block-tools/block-contextual-toolbar.js +43 -35
- package/src/components/block-tools/style.scss +17 -5
- package/src/components/block-variation-picker/index.native.js +52 -72
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/editor-styles/index.js +2 -2
- package/src/components/font-sizes/fluid-utils.js +17 -17
- package/src/components/font-sizes/test/fluid-utils.js +6 -6
- package/src/components/global-styles/behaviors-panel.js +71 -0
- package/src/components/global-styles/hooks.js +114 -5
- package/src/components/global-styles/index.js +3 -0
- package/src/components/global-styles/test/typography-utils.js +6 -6
- package/src/components/global-styles/typography-utils.js +4 -4
- package/src/components/global-styles/utils.js +2 -1
- package/src/components/inserter/hooks/use-block-types-state.js +15 -6
- package/src/components/inserter/hooks/use-debounced-input.js +8 -7
- package/src/components/inserter/hooks/use-patterns-state.js +2 -1
- package/src/components/inserter/reusable-blocks-tab.js +4 -1
- package/src/components/inserter-list-item/index.js +3 -1
- package/src/components/link-control/README.md +12 -3
- package/src/components/link-control/index.js +43 -6
- package/src/components/link-control/link-preview.js +6 -4
- package/src/components/link-control/style.scss +3 -2
- package/src/components/link-control/test/index.js +2 -1
- package/src/components/list-view/use-list-view-drop-zone.js +5 -1
- package/src/components/media-replace-flow/index.native.js +12 -3
- package/src/components/media-upload/test/index.native.js +1 -0
- package/src/components/rich-text/format-edit.js +62 -38
- package/src/components/rich-text/get-rich-text-values.js +22 -28
- package/src/components/spacing-sizes-control/test/utils.js +9 -1
- package/src/components/spacing-sizes-control/utils.js +2 -2
- package/src/hooks/behaviors.js +10 -16
- package/src/hooks/border.js +2 -1
- package/src/hooks/style.js +7 -3
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +22 -28
- package/src/store/selectors.js +3 -80
- package/src/store/test/selectors.js +7 -6
|
@@ -332,6 +332,14 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
332
332
|
.block-editor-block-contextual-toolbar:has(.block-editor-block-toolbar:empty) {
|
|
333
333
|
display: none;
|
|
334
334
|
}
|
|
335
|
+
.block-editor-block-contextual-toolbar.is-collapsed::after {
|
|
336
|
+
content: "";
|
|
337
|
+
position: absolute;
|
|
338
|
+
right: 100%;
|
|
339
|
+
width: 48px;
|
|
340
|
+
height: 100%;
|
|
341
|
+
background: linear-gradient(to left, #fff, transparent);
|
|
342
|
+
}
|
|
335
343
|
@media (min-width: 782px) {
|
|
336
344
|
.block-editor-block-contextual-toolbar.is-fixed {
|
|
337
345
|
margin-right: 180px;
|
|
@@ -351,11 +359,11 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
351
359
|
.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
|
|
352
360
|
width: initial;
|
|
353
361
|
}
|
|
354
|
-
.block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar
|
|
362
|
+
.block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar {
|
|
355
363
|
flex-grow: initial;
|
|
356
364
|
width: initial;
|
|
357
365
|
}
|
|
358
|
-
.block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar
|
|
366
|
+
.block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar::before {
|
|
359
367
|
content: "";
|
|
360
368
|
width: 1px;
|
|
361
369
|
height: 24px;
|
|
@@ -473,7 +481,10 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
473
481
|
}
|
|
474
482
|
@media (min-width: 960px) {
|
|
475
483
|
.block-editor-block-contextual-toolbar.is-fixed {
|
|
476
|
-
width:
|
|
484
|
+
width: auto;
|
|
485
|
+
}
|
|
486
|
+
.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
487
|
+
width: calc(100% - 280px - 256px);
|
|
477
488
|
}
|
|
478
489
|
}
|
|
479
490
|
|
|
@@ -1011,6 +1022,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1011
1022
|
overflow: hidden;
|
|
1012
1023
|
}
|
|
1013
1024
|
.block-editor-block-preview__container .block-editor-block-preview__content {
|
|
1025
|
+
width: 100%;
|
|
1014
1026
|
top: 0;
|
|
1015
1027
|
right: 0;
|
|
1016
1028
|
transform-origin: top right;
|
|
@@ -1972,7 +1984,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1972
1984
|
flex-direction: row-reverse;
|
|
1973
1985
|
justify-content: flex-start;
|
|
1974
1986
|
gap: 8px;
|
|
1975
|
-
padding: 8px;
|
|
1987
|
+
padding: 8px 16px 16px;
|
|
1976
1988
|
order: 20;
|
|
1977
1989
|
}
|
|
1978
1990
|
|
|
@@ -2077,9 +2089,9 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
2077
2089
|
}
|
|
2078
2090
|
.block-editor-link-control__search-item .block-editor-link-control__search-item-title {
|
|
2079
2091
|
display: block;
|
|
2080
|
-
margin-bottom: 0.2em;
|
|
2081
2092
|
font-weight: 500;
|
|
2082
2093
|
position: relative;
|
|
2094
|
+
line-height: 24px;
|
|
2083
2095
|
}
|
|
2084
2096
|
.block-editor-link-control__search-item .block-editor-link-control__search-item-title mark {
|
|
2085
2097
|
font-weight: 600;
|
|
@@ -2141,6 +2153,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
2141
2153
|
display: flex;
|
|
2142
2154
|
flex-direction: row;
|
|
2143
2155
|
width: 100%;
|
|
2156
|
+
align-items: center;
|
|
2144
2157
|
}
|
|
2145
2158
|
|
|
2146
2159
|
.block-editor-link-control__search-item-bottom {
|
package/build-style/style.css
CHANGED
|
@@ -332,6 +332,14 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
332
332
|
.block-editor-block-contextual-toolbar:has(.block-editor-block-toolbar:empty) {
|
|
333
333
|
display: none;
|
|
334
334
|
}
|
|
335
|
+
.block-editor-block-contextual-toolbar.is-collapsed::after {
|
|
336
|
+
content: "";
|
|
337
|
+
position: absolute;
|
|
338
|
+
left: 100%;
|
|
339
|
+
width: 48px;
|
|
340
|
+
height: 100%;
|
|
341
|
+
background: linear-gradient(to right, #fff, transparent);
|
|
342
|
+
}
|
|
335
343
|
@media (min-width: 782px) {
|
|
336
344
|
.block-editor-block-contextual-toolbar.is-fixed {
|
|
337
345
|
margin-left: 180px;
|
|
@@ -351,11 +359,11 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
351
359
|
.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
|
|
352
360
|
width: initial;
|
|
353
361
|
}
|
|
354
|
-
.block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar
|
|
362
|
+
.block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar {
|
|
355
363
|
flex-grow: initial;
|
|
356
364
|
width: initial;
|
|
357
365
|
}
|
|
358
|
-
.block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar
|
|
366
|
+
.block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar::before {
|
|
359
367
|
content: "";
|
|
360
368
|
width: 1px;
|
|
361
369
|
height: 24px;
|
|
@@ -473,7 +481,10 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
473
481
|
}
|
|
474
482
|
@media (min-width: 960px) {
|
|
475
483
|
.block-editor-block-contextual-toolbar.is-fixed {
|
|
476
|
-
width:
|
|
484
|
+
width: auto;
|
|
485
|
+
}
|
|
486
|
+
.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
487
|
+
width: calc(100% - 280px - 256px);
|
|
477
488
|
}
|
|
478
489
|
}
|
|
479
490
|
|
|
@@ -1011,6 +1022,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1011
1022
|
overflow: hidden;
|
|
1012
1023
|
}
|
|
1013
1024
|
.block-editor-block-preview__container .block-editor-block-preview__content {
|
|
1025
|
+
width: 100%;
|
|
1014
1026
|
top: 0;
|
|
1015
1027
|
left: 0;
|
|
1016
1028
|
transform-origin: top left;
|
|
@@ -1973,7 +1985,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
1973
1985
|
flex-direction: row-reverse;
|
|
1974
1986
|
justify-content: flex-start;
|
|
1975
1987
|
gap: 8px;
|
|
1976
|
-
padding: 8px;
|
|
1988
|
+
padding: 8px 16px 16px;
|
|
1977
1989
|
order: 20;
|
|
1978
1990
|
}
|
|
1979
1991
|
|
|
@@ -2078,9 +2090,9 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
2078
2090
|
}
|
|
2079
2091
|
.block-editor-link-control__search-item .block-editor-link-control__search-item-title {
|
|
2080
2092
|
display: block;
|
|
2081
|
-
margin-bottom: 0.2em;
|
|
2082
2093
|
font-weight: 500;
|
|
2083
2094
|
position: relative;
|
|
2095
|
+
line-height: 24px;
|
|
2084
2096
|
}
|
|
2085
2097
|
.block-editor-link-control__search-item .block-editor-link-control__search-item-title mark {
|
|
2086
2098
|
font-weight: 600;
|
|
@@ -2142,6 +2154,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
|
|
|
2142
2154
|
display: flex;
|
|
2143
2155
|
flex-direction: row;
|
|
2144
2156
|
width: 100%;
|
|
2157
|
+
align-items: center;
|
|
2145
2158
|
}
|
|
2146
2159
|
|
|
2147
2160
|
.block-editor-link-control__search-item-bottom {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.7.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -35,35 +35,35 @@
|
|
|
35
35
|
"@emotion/react": "^11.7.1",
|
|
36
36
|
"@emotion/styled": "^11.6.0",
|
|
37
37
|
"@react-spring/web": "^9.4.5",
|
|
38
|
-
"@wordpress/a11y": "^3.
|
|
39
|
-
"@wordpress/api-fetch": "^6.
|
|
40
|
-
"@wordpress/blob": "^3.
|
|
41
|
-
"@wordpress/blocks": "^12.
|
|
42
|
-
"@wordpress/components": "^25.
|
|
43
|
-
"@wordpress/compose": "^6.
|
|
44
|
-
"@wordpress/data": "^9.
|
|
45
|
-
"@wordpress/date": "^4.
|
|
46
|
-
"@wordpress/deprecated": "^3.
|
|
47
|
-
"@wordpress/dom": "^3.
|
|
48
|
-
"@wordpress/element": "^5.
|
|
49
|
-
"@wordpress/escape-html": "^2.
|
|
50
|
-
"@wordpress/hooks": "^3.
|
|
51
|
-
"@wordpress/html-entities": "^3.
|
|
52
|
-
"@wordpress/i18n": "^4.
|
|
53
|
-
"@wordpress/icons": "^9.
|
|
54
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
55
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
56
|
-
"@wordpress/keycodes": "^3.
|
|
57
|
-
"@wordpress/notices": "^4.
|
|
58
|
-
"@wordpress/preferences": "^3.
|
|
59
|
-
"@wordpress/private-apis": "^0.
|
|
60
|
-
"@wordpress/rich-text": "^6.
|
|
61
|
-
"@wordpress/shortcode": "^3.
|
|
62
|
-
"@wordpress/style-engine": "^1.
|
|
63
|
-
"@wordpress/token-list": "^2.
|
|
64
|
-
"@wordpress/url": "^3.
|
|
65
|
-
"@wordpress/warning": "^2.
|
|
66
|
-
"@wordpress/wordcount": "^3.
|
|
38
|
+
"@wordpress/a11y": "^3.39.0",
|
|
39
|
+
"@wordpress/api-fetch": "^6.36.0",
|
|
40
|
+
"@wordpress/blob": "^3.39.0",
|
|
41
|
+
"@wordpress/blocks": "^12.16.0",
|
|
42
|
+
"@wordpress/components": "^25.5.0",
|
|
43
|
+
"@wordpress/compose": "^6.16.0",
|
|
44
|
+
"@wordpress/data": "^9.9.0",
|
|
45
|
+
"@wordpress/date": "^4.39.0",
|
|
46
|
+
"@wordpress/deprecated": "^3.39.0",
|
|
47
|
+
"@wordpress/dom": "^3.39.0",
|
|
48
|
+
"@wordpress/element": "^5.16.0",
|
|
49
|
+
"@wordpress/escape-html": "^2.39.0",
|
|
50
|
+
"@wordpress/hooks": "^3.39.0",
|
|
51
|
+
"@wordpress/html-entities": "^3.39.0",
|
|
52
|
+
"@wordpress/i18n": "^4.39.0",
|
|
53
|
+
"@wordpress/icons": "^9.30.0",
|
|
54
|
+
"@wordpress/is-shallow-equal": "^4.39.0",
|
|
55
|
+
"@wordpress/keyboard-shortcuts": "^4.16.0",
|
|
56
|
+
"@wordpress/keycodes": "^3.39.0",
|
|
57
|
+
"@wordpress/notices": "^4.7.0",
|
|
58
|
+
"@wordpress/preferences": "^3.16.0",
|
|
59
|
+
"@wordpress/private-apis": "^0.21.0",
|
|
60
|
+
"@wordpress/rich-text": "^6.16.0",
|
|
61
|
+
"@wordpress/shortcode": "^3.39.0",
|
|
62
|
+
"@wordpress/style-engine": "^1.22.0",
|
|
63
|
+
"@wordpress/token-list": "^2.39.0",
|
|
64
|
+
"@wordpress/url": "^3.40.0",
|
|
65
|
+
"@wordpress/warning": "^2.39.0",
|
|
66
|
+
"@wordpress/wordcount": "^3.39.0",
|
|
67
67
|
"change-case": "^4.1.2",
|
|
68
68
|
"classnames": "^2.3.1",
|
|
69
69
|
"colord": "^2.7.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "b898cf1dc8e70841d1647ea0994ac6278acc18a7"
|
|
89
89
|
}
|
|
@@ -5,6 +5,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
5
5
|
import {
|
|
6
6
|
createBlock,
|
|
7
7
|
createBlocksFromInnerBlocksTemplate,
|
|
8
|
+
parse,
|
|
8
9
|
} from '@wordpress/blocks';
|
|
9
10
|
import { useMemo } from '@wordpress/element';
|
|
10
11
|
|
|
@@ -116,14 +117,28 @@ function createBlockCompleter() {
|
|
|
116
117
|
return ! ( /\S/.test( before ) || /\S/.test( after ) );
|
|
117
118
|
},
|
|
118
119
|
getOptionCompletion( inserterItem ) {
|
|
119
|
-
const {
|
|
120
|
+
const {
|
|
121
|
+
name,
|
|
122
|
+
initialAttributes,
|
|
123
|
+
innerBlocks,
|
|
124
|
+
syncStatus,
|
|
125
|
+
content,
|
|
126
|
+
} = inserterItem;
|
|
127
|
+
|
|
120
128
|
return {
|
|
121
129
|
action: 'replace',
|
|
122
|
-
value:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
value:
|
|
131
|
+
syncStatus === 'unsynced'
|
|
132
|
+
? parse( content, {
|
|
133
|
+
__unstableSkipMigrationLogs: true,
|
|
134
|
+
} )
|
|
135
|
+
: createBlock(
|
|
136
|
+
name,
|
|
137
|
+
initialAttributes,
|
|
138
|
+
createBlocksFromInnerBlocksTemplate(
|
|
139
|
+
innerBlocks
|
|
140
|
+
)
|
|
141
|
+
),
|
|
127
142
|
};
|
|
128
143
|
},
|
|
129
144
|
};
|
|
@@ -16,7 +16,6 @@ import TextInputState from 'react-native/Libraries/Components/TextInput/TextInpu
|
|
|
16
16
|
*/
|
|
17
17
|
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
18
18
|
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
19
|
-
import '@wordpress/jest-console';
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Internal dependencies
|
|
@@ -383,7 +382,7 @@ describe( 'BlockDraggable', () => {
|
|
|
383
382
|
// activate the gesture. Since this not available in tests, the library
|
|
384
383
|
// displays a warning message.
|
|
385
384
|
expect( console ).toHaveWarnedWith(
|
|
386
|
-
'[
|
|
385
|
+
'[Reanimated] You can not use setGestureState in non-worklet function.'
|
|
387
386
|
);
|
|
388
387
|
expect( getEditorHtml() ).toMatchSnapshot(
|
|
389
388
|
'Paragraph block moved from first to second position'
|
|
@@ -411,7 +410,7 @@ describe( 'BlockDraggable', () => {
|
|
|
411
410
|
// activate the gesture. Since this not available in tests, the library
|
|
412
411
|
// displays a warning message.
|
|
413
412
|
expect( console ).toHaveWarnedWith(
|
|
414
|
-
'[
|
|
413
|
+
'[Reanimated] You can not use setGestureState in non-worklet function.'
|
|
415
414
|
);
|
|
416
415
|
expect( getEditorHtml() ).toMatchSnapshot(
|
|
417
416
|
'Spacer block moved from third to first position'
|
|
@@ -505,9 +505,14 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
505
505
|
) {
|
|
506
506
|
__unstableMarkLastChangeAsPersistent();
|
|
507
507
|
}
|
|
508
|
+
//Unsynced patterns are nested in an array so we need to flatten them.
|
|
509
|
+
const replacementBlocks =
|
|
510
|
+
blocks?.length === 1 && Array.isArray( blocks[ 0 ] )
|
|
511
|
+
? blocks[ 0 ]
|
|
512
|
+
: blocks;
|
|
508
513
|
replaceBlocks(
|
|
509
514
|
[ ownProps.clientId ],
|
|
510
|
-
|
|
515
|
+
replacementBlocks,
|
|
511
516
|
indexToSelect,
|
|
512
517
|
initialPosition
|
|
513
518
|
);
|
|
@@ -33,7 +33,6 @@ import { useInBetweenInserter } from './use-in-between-inserter';
|
|
|
33
33
|
import { store as blockEditorStore } from '../../store';
|
|
34
34
|
import { usePreParsePatterns } from '../../utils/pre-parse-patterns';
|
|
35
35
|
import { LayoutProvider, defaultLayout } from './layout';
|
|
36
|
-
import BlockToolsBackCompat from '../block-tools/back-compat';
|
|
37
36
|
import { useBlockSelectionClearer } from '../block-selection-clearer';
|
|
38
37
|
import { useInnerBlocksProps } from '../inner-blocks';
|
|
39
38
|
import {
|
|
@@ -127,11 +126,9 @@ function Root( { className, ...settings } ) {
|
|
|
127
126
|
export default function BlockList( settings ) {
|
|
128
127
|
usePreParsePatterns();
|
|
129
128
|
return (
|
|
130
|
-
<
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
</BlockEditContextProvider>
|
|
134
|
-
</BlockToolsBackCompat>
|
|
129
|
+
<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>
|
|
130
|
+
<Root { ...settings } />
|
|
131
|
+
</BlockEditContextProvider>
|
|
135
132
|
);
|
|
136
133
|
}
|
|
137
134
|
|
|
@@ -19,6 +19,10 @@ describe( 'Block invalid warning', () => {
|
|
|
19
19
|
<div styless="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
20
20
|
<!-- /wp:spacer -->`,
|
|
21
21
|
} );
|
|
22
|
+
expect( console ).toHaveErrored();
|
|
23
|
+
expect( console ).toHaveWarnedWith(
|
|
24
|
+
'Encountered unexpected attribute `styless`.'
|
|
25
|
+
);
|
|
22
26
|
|
|
23
27
|
// Assert
|
|
24
28
|
const warningElement = screen.getByText( /Problem displaying block./ );
|
|
@@ -32,7 +36,10 @@ describe( 'Block invalid warning', () => {
|
|
|
32
36
|
<div styless="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
|
|
33
37
|
<!-- /wp:spacer -->`,
|
|
34
38
|
} );
|
|
35
|
-
|
|
39
|
+
expect( console ).toHaveErrored();
|
|
40
|
+
expect( console ).toHaveWarnedWith(
|
|
41
|
+
'Encountered unexpected attribute `styless`.'
|
|
42
|
+
);
|
|
36
43
|
// Act
|
|
37
44
|
fireEvent.press( screen.getByText( /Problem displaying block./ ) );
|
|
38
45
|
const spacerBlock = getBlock( screen, 'Spacer' );
|
|
@@ -63,7 +63,19 @@ exports[`Block Mover Picker should render without crashing and match snapshot 1`
|
|
|
63
63
|
accessibilityRole="button"
|
|
64
64
|
accessibilityState={
|
|
65
65
|
{
|
|
66
|
+
"busy": undefined,
|
|
67
|
+
"checked": undefined,
|
|
66
68
|
"disabled": false,
|
|
69
|
+
"expanded": undefined,
|
|
70
|
+
"selected": undefined,
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
accessibilityValue={
|
|
74
|
+
{
|
|
75
|
+
"max": undefined,
|
|
76
|
+
"min": undefined,
|
|
77
|
+
"now": undefined,
|
|
78
|
+
"text": undefined,
|
|
67
79
|
}
|
|
68
80
|
}
|
|
69
81
|
accessible={true}
|
|
@@ -130,7 +142,19 @@ exports[`Block Mover Picker should render without crashing and match snapshot 1`
|
|
|
130
142
|
accessibilityRole="button"
|
|
131
143
|
accessibilityState={
|
|
132
144
|
{
|
|
145
|
+
"busy": undefined,
|
|
146
|
+
"checked": undefined,
|
|
133
147
|
"disabled": true,
|
|
148
|
+
"expanded": undefined,
|
|
149
|
+
"selected": undefined,
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
accessibilityValue={
|
|
153
|
+
{
|
|
154
|
+
"max": undefined,
|
|
155
|
+
"min": undefined,
|
|
156
|
+
"now": undefined,
|
|
157
|
+
"text": undefined,
|
|
134
158
|
}
|
|
135
159
|
}
|
|
136
160
|
accessible={true}
|
|
@@ -12,7 +12,7 @@ import { useRef } from '@wordpress/element';
|
|
|
12
12
|
*/
|
|
13
13
|
import useBlockDisplayInformation from '../use-block-display-information';
|
|
14
14
|
import BlockIcon from '../block-icon';
|
|
15
|
-
import {
|
|
15
|
+
import { useShowHoveredOrFocusedGestures } from '../block-toolbar/utils';
|
|
16
16
|
import { store as blockEditorStore } from '../../store';
|
|
17
17
|
import { unlock } from '../../lock-unlock';
|
|
18
18
|
|
|
@@ -23,52 +23,40 @@ import { unlock } from '../../lock-unlock';
|
|
|
23
23
|
* @return {WPComponent} Parent block selector.
|
|
24
24
|
*/
|
|
25
25
|
export default function BlockParentSelector() {
|
|
26
|
-
const { selectBlock
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
true
|
|
53
|
-
),
|
|
54
|
-
isDistractionFree: settings.isDistractionFree,
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
[]
|
|
58
|
-
);
|
|
26
|
+
const { selectBlock } = useDispatch( blockEditorStore );
|
|
27
|
+
const { firstParentClientId, isVisible } = useSelect( ( select ) => {
|
|
28
|
+
const {
|
|
29
|
+
getBlockName,
|
|
30
|
+
getBlockParents,
|
|
31
|
+
getSelectedBlockClientId,
|
|
32
|
+
getBlockEditingMode,
|
|
33
|
+
} = unlock( select( blockEditorStore ) );
|
|
34
|
+
const { hasBlockSupport } = select( blocksStore );
|
|
35
|
+
const selectedBlockClientId = getSelectedBlockClientId();
|
|
36
|
+
const parents = getBlockParents( selectedBlockClientId );
|
|
37
|
+
const _firstParentClientId = parents[ parents.length - 1 ];
|
|
38
|
+
const parentBlockName = getBlockName( _firstParentClientId );
|
|
39
|
+
const _parentBlockType = getBlockType( parentBlockName );
|
|
40
|
+
return {
|
|
41
|
+
firstParentClientId: _firstParentClientId,
|
|
42
|
+
isVisible:
|
|
43
|
+
_firstParentClientId &&
|
|
44
|
+
getBlockEditingMode( _firstParentClientId ) === 'default' &&
|
|
45
|
+
hasBlockSupport(
|
|
46
|
+
_parentBlockType,
|
|
47
|
+
'__experimentalParentSelector',
|
|
48
|
+
true
|
|
49
|
+
),
|
|
50
|
+
};
|
|
51
|
+
}, [] );
|
|
59
52
|
const blockInformation = useBlockDisplayInformation( firstParentClientId );
|
|
60
53
|
|
|
61
54
|
// Allows highlighting the parent block outline when focusing or hovering
|
|
62
55
|
// the parent block selector within the child.
|
|
63
56
|
const nodeRef = useRef();
|
|
64
|
-
const
|
|
57
|
+
const showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures( {
|
|
65
58
|
ref: nodeRef,
|
|
66
|
-
|
|
67
|
-
if ( isFocused && isDistractionFree ) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
toggleBlockHighlight( firstParentClientId, isFocused );
|
|
71
|
-
},
|
|
59
|
+
highlightParent: true,
|
|
72
60
|
} );
|
|
73
61
|
|
|
74
62
|
if ( ! isVisible ) {
|
|
@@ -80,7 +68,7 @@ export default function BlockParentSelector() {
|
|
|
80
68
|
className="block-editor-block-parent-selector"
|
|
81
69
|
key={ firstParentClientId }
|
|
82
70
|
ref={ nodeRef }
|
|
83
|
-
{ ...
|
|
71
|
+
{ ...showHoveredOrFocusedGestures }
|
|
84
72
|
>
|
|
85
73
|
<ToolbarButton
|
|
86
74
|
className="block-editor-block-parent-selector__button"
|
|
@@ -58,12 +58,19 @@ function ScaledBlockPreview( {
|
|
|
58
58
|
MemoizedBlockList = MemoizedBlockList || pure( BlockList );
|
|
59
59
|
|
|
60
60
|
const scale = containerWidth / viewportWidth;
|
|
61
|
+
const aspectRatio = contentHeight
|
|
62
|
+
? containerWidth / ( contentHeight * scale )
|
|
63
|
+
: 0;
|
|
61
64
|
return (
|
|
62
65
|
<Disabled
|
|
63
66
|
className="block-editor-block-preview__content"
|
|
64
67
|
style={ {
|
|
65
68
|
transform: `scale(${ scale })`,
|
|
66
|
-
height
|
|
69
|
+
// Using width + aspect-ratio instead of height here triggers browsers' native
|
|
70
|
+
// handling of scrollbar's visibility. It prevents the flickering issue seen
|
|
71
|
+
// in https://github.com/WordPress/gutenberg/issues/52027.
|
|
72
|
+
// See https://github.com/WordPress/gutenberg/pull/52921 for more info.
|
|
73
|
+
aspectRatio,
|
|
67
74
|
maxHeight:
|
|
68
75
|
contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined,
|
|
69
76
|
minHeight,
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
|
|
13
13
|
.block-editor-block-preview__content {
|
|
14
|
-
// This element receives inline styles for
|
|
14
|
+
// This element receives inline styles for transform-scale and aspect-ratio.
|
|
15
15
|
// Those inline styles are calculated to fit a perfect thumbnail.
|
|
16
|
+
width: 100%;
|
|
16
17
|
|
|
17
18
|
// Vertical alignment. It works with the transform: translate(-50%, -50%)`,
|
|
18
19
|
top: 0;
|
|
@@ -31,7 +31,7 @@ import BlockHTMLConvertButton from './block-html-convert-button';
|
|
|
31
31
|
import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
|
|
32
32
|
import BlockSettingsMenuControls from '../block-settings-menu-controls';
|
|
33
33
|
import { store as blockEditorStore } from '../../store';
|
|
34
|
-
import {
|
|
34
|
+
import { useShowHoveredOrFocusedGestures } from '../block-toolbar/utils';
|
|
35
35
|
|
|
36
36
|
const POPOVER_PROPS = {
|
|
37
37
|
className: 'block-editor-block-settings-menu__popover',
|
|
@@ -60,7 +60,6 @@ export function BlockSettingsDropdown( {
|
|
|
60
60
|
const firstBlockClientId = blockClientIds[ 0 ];
|
|
61
61
|
const {
|
|
62
62
|
firstParentClientId,
|
|
63
|
-
isDistractionFree,
|
|
64
63
|
onlyBlock,
|
|
65
64
|
parentBlockType,
|
|
66
65
|
previousBlockClientId,
|
|
@@ -73,7 +72,6 @@ export function BlockSettingsDropdown( {
|
|
|
73
72
|
getBlockRootClientId,
|
|
74
73
|
getPreviousBlockClientId,
|
|
75
74
|
getSelectedBlockClientIds,
|
|
76
|
-
getSettings,
|
|
77
75
|
getBlockAttributes,
|
|
78
76
|
} = select( blockEditorStore );
|
|
79
77
|
|
|
@@ -86,7 +84,6 @@ export function BlockSettingsDropdown( {
|
|
|
86
84
|
|
|
87
85
|
return {
|
|
88
86
|
firstParentClientId: _firstParentClientId,
|
|
89
|
-
isDistractionFree: getSettings().isDistractionFree,
|
|
90
87
|
onlyBlock: 1 === getBlockCount( _firstParentClientId ),
|
|
91
88
|
parentBlockType:
|
|
92
89
|
_firstParentClientId &&
|
|
@@ -122,8 +119,7 @@ export function BlockSettingsDropdown( {
|
|
|
122
119
|
}, [] );
|
|
123
120
|
const isMatch = __unstableUseShortcutEventMatch();
|
|
124
121
|
|
|
125
|
-
const { selectBlock
|
|
126
|
-
useDispatch( blockEditorStore );
|
|
122
|
+
const { selectBlock } = useDispatch( blockEditorStore );
|
|
127
123
|
const hasSelectedBlocks = selectedBlockClientIds.length > 0;
|
|
128
124
|
|
|
129
125
|
const updateSelectionAfterDuplicate = useCallback(
|
|
@@ -168,14 +164,9 @@ export function BlockSettingsDropdown( {
|
|
|
168
164
|
// Allows highlighting the parent block outline when focusing or hovering
|
|
169
165
|
// the parent block selector within the child.
|
|
170
166
|
const selectParentButtonRef = useRef();
|
|
171
|
-
const
|
|
167
|
+
const showParentOutlineGestures = useShowHoveredOrFocusedGestures( {
|
|
172
168
|
ref: selectParentButtonRef,
|
|
173
|
-
|
|
174
|
-
if ( isFocused && isDistractionFree ) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
toggleBlockHighlight( firstParentClientId, isFocused );
|
|
178
|
-
},
|
|
169
|
+
highlightParent: true,
|
|
179
170
|
} );
|
|
180
171
|
|
|
181
172
|
// This can occur when the selected block (the parent)
|