@wordpress/block-editor 12.19.3 → 12.20.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/build/components/block-canvas/index.js +2 -0
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.js +14 -17
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-inspector/index.js +0 -3
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/index.js +9 -9
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-preview/index.js +4 -0
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-parent-selector-menu-item.js +54 -0
- package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js +9 -37
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/child-layout-control/index.js +37 -5
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +0 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +1 -2
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +30 -19
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +0 -4
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/observe-typing/index.js +5 -10
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +1 -31
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/index.js +1 -2
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +7 -14
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +5 -8
- package/build/components/url-input/index.js.map +1 -1
- package/build/hooks/layout-child.js +50 -1
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/position.js +0 -1
- package/build/hooks/position.js.map +1 -1
- package/build/layouts/grid.js +105 -12
- package/build/layouts/grid.js.map +1 -1
- package/build/store/actions.js +2 -30
- package/build/store/actions.js.map +1 -1
- package/build-module/components/block-canvas/index.js +2 -0
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +14 -17
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -4
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/index.js +9 -9
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-preview/index.js +4 -0
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +46 -0
- package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -40
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +38 -6
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +0 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +1 -2
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +30 -19
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +0 -4
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/observe-typing/index.js +5 -10
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +1 -31
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -2
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +8 -14
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +5 -8
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/hooks/layout-child.js +50 -1
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/position.js +0 -1
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/layouts/grid.js +107 -14
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/store/actions.js +2 -30
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +12 -17
- package/build-style/style.css +12 -17
- package/package.json +31 -32
- package/src/components/block-canvas/index.js +2 -0
- package/src/components/block-heading-level-dropdown/index.js +17 -25
- package/src/components/block-inspector/index.js +0 -11
- package/src/components/block-list/index.js +55 -55
- package/src/components/block-preview/index.js +6 -1
- package/src/components/block-settings-menu/block-parent-selector-menu-item.js +50 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +9 -50
- package/src/components/block-styles/style.scss +0 -4
- package/src/components/block-toolbar/style.scss +11 -6
- package/src/components/child-layout-control/index.js +85 -44
- package/src/components/date-format-picker/index.js +0 -1
- package/src/components/font-appearance-control/index.js +0 -1
- package/src/components/global-styles/dimensions-panel.js +36 -24
- package/src/components/global-styles/test/use-global-styles-output.js +3 -2
- package/src/components/inspector-controls-tabs/styles-tab.js +0 -7
- package/src/components/observe-typing/index.js +7 -10
- package/src/components/rich-text/format-toolbar-container.js +1 -48
- package/src/components/rich-text/index.js +0 -1
- package/src/components/skip-to-selected-block/index.js +10 -13
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
- package/src/components/url-input/index.js +6 -15
- package/src/hooks/anchor.scss +1 -1
- package/src/hooks/layout-child.js +53 -1
- package/src/hooks/position.js +0 -1
- package/src/layouts/grid.js +131 -52
- package/src/layouts/test/grid.js +16 -2
- package/src/store/actions.js +2 -38
- package/src/store/test/actions.js +0 -101
- package/src/style.scss +0 -1
- package/build/components/default-style-picker/index.js +0 -70
- package/build/components/default-style-picker/index.js.map +0 -1
- package/build-module/components/default-style-picker/index.js +0 -63
- package/build-module/components/default-style-picker/index.js.map +0 -1
- package/src/components/block-settings-menu/style.scss +0 -3
- package/src/components/default-style-picker/index.js +0 -70
|
@@ -782,7 +782,7 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
782
782
|
outline: none;
|
|
783
783
|
}
|
|
784
784
|
.components-button.block-editor-block-mover-button:focus-visible::before {
|
|
785
|
-
box-shadow: inset 0 0 0 1px
|
|
785
|
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
786
786
|
outline: 2px solid transparent;
|
|
787
787
|
}
|
|
788
788
|
|
|
@@ -957,14 +957,6 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
957
957
|
z-index: 1000001;
|
|
958
958
|
}
|
|
959
959
|
|
|
960
|
-
.block-editor-block-settings-menu__popover .components-dropdown-menu__menu {
|
|
961
|
-
padding: 0;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
.block-editor-block-styles + .default-style-picker__default-switcher {
|
|
965
|
-
margin-top: 16px;
|
|
966
|
-
}
|
|
967
|
-
|
|
968
960
|
.block-editor-block-styles__preview-panel {
|
|
969
961
|
display: none;
|
|
970
962
|
z-index: 90;
|
|
@@ -1002,7 +994,7 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
1002
994
|
color: #fff;
|
|
1003
995
|
}
|
|
1004
996
|
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item:focus, .block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active:focus {
|
|
1005
|
-
box-shadow: inset 0 0 0 1px
|
|
997
|
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1006
998
|
outline: 2px solid transparent;
|
|
1007
999
|
}
|
|
1008
1000
|
.block-editor-block-styles__variants .block-editor-block-styles__item-text {
|
|
@@ -2005,7 +1997,7 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
2005
1997
|
box-shadow: none;
|
|
2006
1998
|
}
|
|
2007
1999
|
.block-editor-link-control__search-item .block-editor-link-control__search-item-title:focus-visible {
|
|
2008
|
-
box-shadow: inset 0 0 0 1px
|
|
2000
|
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
2009
2001
|
outline: 2px solid transparent;
|
|
2010
2002
|
text-decoration: none;
|
|
2011
2003
|
}
|
|
@@ -3150,7 +3142,7 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
3150
3142
|
}
|
|
3151
3143
|
|
|
3152
3144
|
.html-anchor-control .components-external-link {
|
|
3153
|
-
display: block;
|
|
3145
|
+
display: inline-block;
|
|
3154
3146
|
margin-top: 8px;
|
|
3155
3147
|
}
|
|
3156
3148
|
|
|
@@ -3521,16 +3513,14 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
3521
3513
|
}
|
|
3522
3514
|
.show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
|
|
3523
3515
|
width: auto;
|
|
3516
|
+
position: relative;
|
|
3524
3517
|
}
|
|
3525
3518
|
@media (min-width: 600px) {
|
|
3526
|
-
.show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
|
|
3527
|
-
position: relative;
|
|
3528
|
-
}
|
|
3529
|
-
.show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container::before {
|
|
3519
|
+
.show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
|
|
3530
3520
|
content: "";
|
|
3531
3521
|
height: 1px;
|
|
3532
3522
|
width: 100%;
|
|
3533
|
-
background: #
|
|
3523
|
+
background: #e0e0e0;
|
|
3534
3524
|
position: absolute;
|
|
3535
3525
|
top: 50%;
|
|
3536
3526
|
right: 50%;
|
|
@@ -3538,6 +3528,11 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
3538
3528
|
margin-top: -0.5px;
|
|
3539
3529
|
}
|
|
3540
3530
|
}
|
|
3531
|
+
@media (min-width: 782px) {
|
|
3532
|
+
.show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
|
|
3533
|
+
background: #1e1e1e;
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3541
3536
|
.show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,
|
|
3542
3537
|
.show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
|
|
3543
3538
|
padding-right: 6px;
|
package/build-style/style.css
CHANGED
|
@@ -782,7 +782,7 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
782
782
|
outline: none;
|
|
783
783
|
}
|
|
784
784
|
.components-button.block-editor-block-mover-button:focus-visible::before {
|
|
785
|
-
box-shadow: inset 0 0 0 1px
|
|
785
|
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
786
786
|
outline: 2px solid transparent;
|
|
787
787
|
}
|
|
788
788
|
|
|
@@ -957,14 +957,6 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
957
957
|
z-index: 1000001;
|
|
958
958
|
}
|
|
959
959
|
|
|
960
|
-
.block-editor-block-settings-menu__popover .components-dropdown-menu__menu {
|
|
961
|
-
padding: 0;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
.block-editor-block-styles + .default-style-picker__default-switcher {
|
|
965
|
-
margin-top: 16px;
|
|
966
|
-
}
|
|
967
|
-
|
|
968
960
|
.block-editor-block-styles__preview-panel {
|
|
969
961
|
display: none;
|
|
970
962
|
z-index: 90;
|
|
@@ -1002,7 +994,7 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
1002
994
|
color: #fff;
|
|
1003
995
|
}
|
|
1004
996
|
.block-editor-block-styles__variants button.components-button.block-editor-block-styles__item:focus, .block-editor-block-styles__variants button.components-button.block-editor-block-styles__item.is-active:focus {
|
|
1005
|
-
box-shadow: inset 0 0 0 1px
|
|
997
|
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1006
998
|
outline: 2px solid transparent;
|
|
1007
999
|
}
|
|
1008
1000
|
.block-editor-block-styles__variants .block-editor-block-styles__item-text {
|
|
@@ -2006,7 +1998,7 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
2006
1998
|
box-shadow: none;
|
|
2007
1999
|
}
|
|
2008
2000
|
.block-editor-link-control__search-item .block-editor-link-control__search-item-title:focus-visible {
|
|
2009
|
-
box-shadow: inset 0 0 0 1px
|
|
2001
|
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
2010
2002
|
outline: 2px solid transparent;
|
|
2011
2003
|
text-decoration: none;
|
|
2012
2004
|
}
|
|
@@ -3151,7 +3143,7 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
3151
3143
|
}
|
|
3152
3144
|
|
|
3153
3145
|
.html-anchor-control .components-external-link {
|
|
3154
|
-
display: block;
|
|
3146
|
+
display: inline-block;
|
|
3155
3147
|
margin-top: 8px;
|
|
3156
3148
|
}
|
|
3157
3149
|
|
|
@@ -3522,16 +3514,14 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
3522
3514
|
}
|
|
3523
3515
|
.show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
|
|
3524
3516
|
width: auto;
|
|
3517
|
+
position: relative;
|
|
3525
3518
|
}
|
|
3526
3519
|
@media (min-width: 600px) {
|
|
3527
|
-
.show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
|
|
3528
|
-
position: relative;
|
|
3529
|
-
}
|
|
3530
|
-
.show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container::before {
|
|
3520
|
+
.show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
|
|
3531
3521
|
content: "";
|
|
3532
3522
|
height: 1px;
|
|
3533
3523
|
width: 100%;
|
|
3534
|
-
background: #
|
|
3524
|
+
background: #e0e0e0;
|
|
3535
3525
|
position: absolute;
|
|
3536
3526
|
top: 50%;
|
|
3537
3527
|
left: 50%;
|
|
@@ -3539,6 +3529,11 @@ iframe[name=editor-canvas].has-editor-padding {
|
|
|
3539
3529
|
margin-top: -0.5px;
|
|
3540
3530
|
}
|
|
3541
3531
|
}
|
|
3532
|
+
@media (min-width: 782px) {
|
|
3533
|
+
.show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
|
|
3534
|
+
background: #1e1e1e;
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3542
3537
|
.show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,
|
|
3543
3538
|
.show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
|
|
3544
3539
|
padding-left: 6px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.20.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -35,41 +35,40 @@
|
|
|
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/commands": "^0.
|
|
43
|
-
"@wordpress/components": "^
|
|
44
|
-
"@wordpress/compose": "^6.
|
|
45
|
-
"@wordpress/data": "^9.
|
|
46
|
-
"@wordpress/date": "^4.
|
|
47
|
-
"@wordpress/deprecated": "^3.
|
|
48
|
-
"@wordpress/dom": "^3.
|
|
49
|
-
"@wordpress/element": "^5.
|
|
50
|
-
"@wordpress/escape-html": "^2.
|
|
51
|
-
"@wordpress/hooks": "^3.
|
|
52
|
-
"@wordpress/html-entities": "^3.
|
|
53
|
-
"@wordpress/i18n": "^4.
|
|
54
|
-
"@wordpress/icons": "^9.
|
|
55
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
56
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
57
|
-
"@wordpress/keycodes": "^3.
|
|
58
|
-
"@wordpress/notices": "^4.
|
|
59
|
-
"@wordpress/preferences": "^3.
|
|
60
|
-
"@wordpress/private-apis": "^0.
|
|
61
|
-
"@wordpress/rich-text": "^6.
|
|
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.52.0",
|
|
39
|
+
"@wordpress/api-fetch": "^6.49.0",
|
|
40
|
+
"@wordpress/blob": "^3.52.0",
|
|
41
|
+
"@wordpress/blocks": "^12.29.0",
|
|
42
|
+
"@wordpress/commands": "^0.23.0",
|
|
43
|
+
"@wordpress/components": "^27.0.0",
|
|
44
|
+
"@wordpress/compose": "^6.29.0",
|
|
45
|
+
"@wordpress/data": "^9.22.0",
|
|
46
|
+
"@wordpress/date": "^4.52.0",
|
|
47
|
+
"@wordpress/deprecated": "^3.52.0",
|
|
48
|
+
"@wordpress/dom": "^3.52.0",
|
|
49
|
+
"@wordpress/element": "^5.29.0",
|
|
50
|
+
"@wordpress/escape-html": "^2.52.0",
|
|
51
|
+
"@wordpress/hooks": "^3.52.0",
|
|
52
|
+
"@wordpress/html-entities": "^3.52.0",
|
|
53
|
+
"@wordpress/i18n": "^4.52.0",
|
|
54
|
+
"@wordpress/icons": "^9.43.0",
|
|
55
|
+
"@wordpress/is-shallow-equal": "^4.52.0",
|
|
56
|
+
"@wordpress/keyboard-shortcuts": "^4.29.0",
|
|
57
|
+
"@wordpress/keycodes": "^3.52.0",
|
|
58
|
+
"@wordpress/notices": "^4.20.0",
|
|
59
|
+
"@wordpress/preferences": "^3.29.0",
|
|
60
|
+
"@wordpress/private-apis": "^0.34.0",
|
|
61
|
+
"@wordpress/rich-text": "^6.29.0",
|
|
62
|
+
"@wordpress/style-engine": "^1.35.0",
|
|
63
|
+
"@wordpress/token-list": "^2.52.0",
|
|
64
|
+
"@wordpress/url": "^3.53.0",
|
|
65
|
+
"@wordpress/warning": "^2.52.0",
|
|
66
|
+
"@wordpress/wordcount": "^3.52.0",
|
|
67
67
|
"change-case": "^4.1.2",
|
|
68
68
|
"classnames": "^2.3.1",
|
|
69
69
|
"colord": "^2.7.0",
|
|
70
70
|
"deepmerge": "^4.3.0",
|
|
71
71
|
"diff": "^4.0.2",
|
|
72
|
-
"dom-scroll-into-view": "^1.2.1",
|
|
73
72
|
"fast-deep-equal": "^3.1.3",
|
|
74
73
|
"memize": "^2.1.0",
|
|
75
74
|
"postcss": "^8.4.21",
|
|
@@ -87,5 +86,5 @@
|
|
|
87
86
|
"publishConfig": {
|
|
88
87
|
"access": "public"
|
|
89
88
|
},
|
|
90
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "c139588f4c668b38bafbc5431f2f4e3903dbe683"
|
|
91
90
|
}
|
|
@@ -14,6 +14,7 @@ import Iframe from '../iframe';
|
|
|
14
14
|
import WritingFlow from '../writing-flow';
|
|
15
15
|
import { useMouseMoveTypingReset } from '../observe-typing';
|
|
16
16
|
import { useBlockSelectionClearer } from '../block-selection-clearer';
|
|
17
|
+
import { useBlockCommands } from '../use-block-commands';
|
|
17
18
|
|
|
18
19
|
export function ExperimentalBlockCanvas( {
|
|
19
20
|
shouldIframe = true,
|
|
@@ -23,6 +24,7 @@ export function ExperimentalBlockCanvas( {
|
|
|
23
24
|
contentRef: contentRefProp,
|
|
24
25
|
iframeProps,
|
|
25
26
|
} ) {
|
|
27
|
+
useBlockCommands();
|
|
26
28
|
const resetTypingRef = useMouseMoveTypingReset();
|
|
27
29
|
const clearerRef = useBlockSelectionClearer();
|
|
28
30
|
const localRef = useRef();
|
|
@@ -46,31 +46,23 @@ export default function HeadingLevelDropdown( {
|
|
|
46
46
|
icon={ <HeadingLevelIcon level={ value } /> }
|
|
47
47
|
label={ __( 'Change level' ) }
|
|
48
48
|
controls={ options.map( ( targetLevel ) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
),
|
|
67
|
-
isActive,
|
|
68
|
-
onClick() {
|
|
69
|
-
onChange( targetLevel );
|
|
70
|
-
},
|
|
71
|
-
role: 'menuitemradio',
|
|
72
|
-
};
|
|
73
|
-
}
|
|
49
|
+
const isActive = targetLevel === value;
|
|
50
|
+
return {
|
|
51
|
+
icon: <HeadingLevelIcon level={ targetLevel } />,
|
|
52
|
+
title:
|
|
53
|
+
targetLevel === 0
|
|
54
|
+
? __( 'Paragraph' )
|
|
55
|
+
: sprintf(
|
|
56
|
+
// translators: %s: heading level e.g: "1", "2", "3"
|
|
57
|
+
__( 'Heading %d' ),
|
|
58
|
+
targetLevel
|
|
59
|
+
),
|
|
60
|
+
isActive,
|
|
61
|
+
onClick() {
|
|
62
|
+
onChange( targetLevel );
|
|
63
|
+
},
|
|
64
|
+
role: 'menuitemradio',
|
|
65
|
+
};
|
|
74
66
|
} ) }
|
|
75
67
|
/>
|
|
76
68
|
);
|
|
@@ -5,7 +5,6 @@ import { __ } from '@wordpress/i18n';
|
|
|
5
5
|
import {
|
|
6
6
|
getBlockType,
|
|
7
7
|
getUnregisteredTypeHandlerName,
|
|
8
|
-
hasBlockSupport,
|
|
9
8
|
store as blocksStore,
|
|
10
9
|
} from '@wordpress/blocks';
|
|
11
10
|
import { PanelBody, __unstableMotion as motion } from '@wordpress/components';
|
|
@@ -21,7 +20,6 @@ import BlockVariationTransforms from '../block-variation-transforms';
|
|
|
21
20
|
import useBlockDisplayInformation from '../use-block-display-information';
|
|
22
21
|
import { store as blockEditorStore } from '../../store';
|
|
23
22
|
import BlockStyles from '../block-styles';
|
|
24
|
-
import DefaultStylePicker from '../default-style-picker';
|
|
25
23
|
import { default as InspectorControls } from '../inspector-controls';
|
|
26
24
|
import { default as InspectorControlsTabs } from '../inspector-controls-tabs';
|
|
27
25
|
import useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';
|
|
@@ -275,15 +273,6 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
|
|
|
275
273
|
<div>
|
|
276
274
|
<PanelBody title={ __( 'Styles' ) }>
|
|
277
275
|
<BlockStyles clientId={ clientId } />
|
|
278
|
-
{ hasBlockSupport(
|
|
279
|
-
blockName,
|
|
280
|
-
'defaultStylePicker',
|
|
281
|
-
true
|
|
282
|
-
) && (
|
|
283
|
-
<DefaultStylePicker
|
|
284
|
-
blockName={ blockName }
|
|
285
|
-
/>
|
|
286
|
-
) }
|
|
287
276
|
</PanelBody>
|
|
288
277
|
</div>
|
|
289
278
|
) }
|
|
@@ -46,19 +46,26 @@ const pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();
|
|
|
46
46
|
|
|
47
47
|
function Root( { className, ...settings } ) {
|
|
48
48
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
const {
|
|
50
|
+
isOutlineMode,
|
|
51
|
+
isFocusMode,
|
|
52
|
+
editorMode,
|
|
53
|
+
temporarilyEditingAsBlocks,
|
|
54
|
+
} = useSelect( ( select ) => {
|
|
55
|
+
const {
|
|
56
|
+
getSettings,
|
|
57
|
+
__unstableGetEditorMode,
|
|
58
|
+
__unstableGetTemporarilyEditingAsBlocks,
|
|
59
|
+
} = select( blockEditorStore );
|
|
60
|
+
const { outlineMode, focusMode } = getSettings();
|
|
61
|
+
return {
|
|
62
|
+
isOutlineMode: outlineMode,
|
|
63
|
+
isFocusMode: focusMode,
|
|
64
|
+
editorMode: __unstableGetEditorMode(),
|
|
65
|
+
temporarilyEditingAsBlocks:
|
|
66
|
+
__unstableGetTemporarilyEditingAsBlocks(),
|
|
67
|
+
};
|
|
68
|
+
}, [] );
|
|
62
69
|
const registry = useRegistry();
|
|
63
70
|
const { setBlockVisibility } = useDispatch( blockEditorStore );
|
|
64
71
|
|
|
@@ -115,6 +122,11 @@ function Root( { className, ...settings } ) {
|
|
|
115
122
|
return (
|
|
116
123
|
<IntersectionObserver.Provider value={ intersectionObserver }>
|
|
117
124
|
<div { ...innerBlocksProps } />
|
|
125
|
+
{ !! temporarilyEditingAsBlocks && (
|
|
126
|
+
<StopEditingAsBlocksOnOutsideSelect
|
|
127
|
+
clientId={ temporarilyEditingAsBlocks }
|
|
128
|
+
/>
|
|
129
|
+
) }
|
|
118
130
|
</IntersectionObserver.Provider>
|
|
119
131
|
);
|
|
120
132
|
}
|
|
@@ -159,43 +171,36 @@ function Items( {
|
|
|
159
171
|
// function on every render.
|
|
160
172
|
const hasAppender = CustomAppender !== false;
|
|
161
173
|
const hasCustomAppender = !! CustomAppender;
|
|
162
|
-
const {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
__unstableGetEditorMode() !== 'zoom-out'
|
|
193
|
-
: rootClientId === selectedBlockClientId ||
|
|
194
|
-
( ! rootClientId && ! selectedBlockClientId ) ),
|
|
195
|
-
};
|
|
196
|
-
},
|
|
197
|
-
[ rootClientId, hasAppender, hasCustomAppender ]
|
|
198
|
-
);
|
|
174
|
+
const { order, selectedBlocks, visibleBlocks, shouldRenderAppender } =
|
|
175
|
+
useSelect(
|
|
176
|
+
( select ) => {
|
|
177
|
+
const {
|
|
178
|
+
getBlockOrder,
|
|
179
|
+
getSelectedBlockClientId,
|
|
180
|
+
getSelectedBlockClientIds,
|
|
181
|
+
__unstableGetVisibleBlocks,
|
|
182
|
+
getTemplateLock,
|
|
183
|
+
getBlockEditingMode,
|
|
184
|
+
__unstableGetEditorMode,
|
|
185
|
+
} = select( blockEditorStore );
|
|
186
|
+
const selectedBlockClientId = getSelectedBlockClientId();
|
|
187
|
+
return {
|
|
188
|
+
order: getBlockOrder( rootClientId ),
|
|
189
|
+
selectedBlocks: getSelectedBlockClientIds(),
|
|
190
|
+
visibleBlocks: __unstableGetVisibleBlocks(),
|
|
191
|
+
shouldRenderAppender:
|
|
192
|
+
hasAppender &&
|
|
193
|
+
( hasCustomAppender
|
|
194
|
+
? ! getTemplateLock( rootClientId ) &&
|
|
195
|
+
getBlockEditingMode( rootClientId ) !==
|
|
196
|
+
'disabled' &&
|
|
197
|
+
__unstableGetEditorMode() !== 'zoom-out'
|
|
198
|
+
: rootClientId === selectedBlockClientId ||
|
|
199
|
+
( ! rootClientId && ! selectedBlockClientId ) ),
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
[ rootClientId, hasAppender, hasCustomAppender ]
|
|
203
|
+
);
|
|
199
204
|
|
|
200
205
|
return (
|
|
201
206
|
<LayoutProvider value={ layout }>
|
|
@@ -216,11 +221,6 @@ function Items( {
|
|
|
216
221
|
</AsyncModeProvider>
|
|
217
222
|
) ) }
|
|
218
223
|
{ order.length < 1 && placeholder }
|
|
219
|
-
{ !! temporarilyEditingAsBlocks && (
|
|
220
|
-
<StopEditingAsBlocksOnOutsideSelect
|
|
221
|
-
clientId={ temporarilyEditingAsBlocks }
|
|
222
|
-
/>
|
|
223
|
-
) }
|
|
224
224
|
{ shouldRenderAppender && (
|
|
225
225
|
<BlockListAppender
|
|
226
226
|
tagName={ __experimentalAppenderTagName }
|
|
@@ -54,7 +54,11 @@ export function BlockPreview( {
|
|
|
54
54
|
[]
|
|
55
55
|
);
|
|
56
56
|
const settings = useMemo(
|
|
57
|
-
() => ( {
|
|
57
|
+
() => ( {
|
|
58
|
+
...originalSettings,
|
|
59
|
+
focusMode: false, // Disable "Spotlight mode".
|
|
60
|
+
__unstableIsPreviewMode: true,
|
|
61
|
+
} ),
|
|
58
62
|
[ originalSettings ]
|
|
59
63
|
);
|
|
60
64
|
const renderedBlocks = useMemo(
|
|
@@ -117,6 +121,7 @@ export function useBlockPreview( { blocks, props = {}, layout } ) {
|
|
|
117
121
|
() => ( {
|
|
118
122
|
...originalSettings,
|
|
119
123
|
styles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.
|
|
124
|
+
focusMode: false, // Disable "Spotlight mode".
|
|
120
125
|
__unstableIsPreviewMode: true,
|
|
121
126
|
} ),
|
|
122
127
|
[ originalSettings ]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useRef } from '@wordpress/element';
|
|
5
|
+
import { MenuItem } from '@wordpress/components';
|
|
6
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
7
|
+
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import BlockIcon from '../block-icon';
|
|
14
|
+
import { useShowHoveredOrFocusedGestures } from '../block-toolbar/utils';
|
|
15
|
+
import { store as blockEditorStore } from '../../store';
|
|
16
|
+
|
|
17
|
+
export default function BlockParentSelectorMenuItem( {
|
|
18
|
+
parentClientId,
|
|
19
|
+
parentBlockType,
|
|
20
|
+
} ) {
|
|
21
|
+
const isSmallViewport = useViewportMatch( 'medium', '<' );
|
|
22
|
+
const { selectBlock } = useDispatch( blockEditorStore );
|
|
23
|
+
|
|
24
|
+
// Allows highlighting the parent block outline when focusing or hovering
|
|
25
|
+
// the parent block selector within the child.
|
|
26
|
+
const menuItemRef = useRef();
|
|
27
|
+
const gesturesProps = useShowHoveredOrFocusedGestures( {
|
|
28
|
+
ref: menuItemRef,
|
|
29
|
+
highlightParent: true,
|
|
30
|
+
} );
|
|
31
|
+
|
|
32
|
+
if ( ! isSmallViewport ) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<MenuItem
|
|
38
|
+
{ ...gesturesProps }
|
|
39
|
+
ref={ menuItemRef }
|
|
40
|
+
icon={ <BlockIcon icon={ parentBlockType.icon } /> }
|
|
41
|
+
onClick={ () => selectBlock( parentClientId ) }
|
|
42
|
+
>
|
|
43
|
+
{ sprintf(
|
|
44
|
+
/* translators: %s: Name of the block's parent. */
|
|
45
|
+
__( 'Select parent block (%s)' ),
|
|
46
|
+
parentBlockType.title
|
|
47
|
+
) }
|
|
48
|
+
</MenuItem>
|
|
49
|
+
);
|
|
50
|
+
}
|