@wordpress/block-editor 15.0.1-next.46f643fa0.0 → 15.1.1-next.0f6f9d12c.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-settings-menu/block-settings-dropdown.js +6 -2
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +2 -2
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/border-radius-control/constants.js +41 -0
- package/build/components/border-radius-control/constants.js.map +1 -0
- package/build/components/border-radius-control/index.js +49 -58
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +1 -1
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/border-radius-control/single-input-control.js +204 -0
- package/build/components/border-radius-control/single-input-control.js.map +1 -0
- package/build/components/border-radius-control/utils.js +161 -4
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +12 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/utils.js +5 -3
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/rich-text/index.js +9 -4
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +19 -8
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -1
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/hooks/duotone.js +2 -2
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/utils.js +4 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +2 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/private-keys.js +2 -1
- package/build/store/private-keys.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +6 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +3 -3
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/border-radius-control/constants.js +34 -0
- package/build-module/components/border-radius-control/constants.js.map +1 -0
- package/build-module/components/border-radius-control/index.js +53 -62
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +1 -1
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/border-radius-control/single-input-control.js +197 -0
- package/build-module/components/border-radius-control/single-input-control.js.map +1 -0
- package/build-module/components/border-radius-control/utils.js +154 -4
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +12 -1
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/utils.js +5 -3
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/rich-text/index.js +9 -4
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +19 -8
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +2 -1
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/hooks/duotone.js +3 -3
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/utils.js +4 -3
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +3 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-keys.js +1 -0
- package/build-module/store/private-keys.js.map +1 -1
- package/build-style/style-rtl.css +17 -23
- package/build-style/style.css +17 -23
- package/package.json +34 -34
- package/src/components/block-settings-menu/block-settings-dropdown.js +22 -14
- package/src/components/block-toolbar/block-toolbar-menu.native.js +3 -3
- package/src/components/block-variation-transforms/style.scss +1 -0
- package/src/components/border-radius-control/constants.js +46 -0
- package/src/components/border-radius-control/index.js +71 -72
- package/src/components/border-radius-control/linked-button.js +1 -1
- package/src/components/border-radius-control/single-input-control.js +277 -0
- package/src/components/border-radius-control/style.scss +16 -21
- package/src/components/border-radius-control/utils.js +178 -5
- package/src/components/global-styles/border-panel.js +12 -1
- package/src/components/global-styles/hooks.js +1 -0
- package/src/components/global-styles/utils.js +6 -1
- package/src/components/media-replace-flow/style.scss +0 -6
- package/src/components/rich-text/index.js +19 -10
- package/src/components/rich-text/use-format-types.js +42 -19
- package/src/components/url-popover/image-url-input-ui.js +2 -1
- package/src/hooks/duotone.js +11 -3
- package/src/hooks/utils.js +4 -0
- package/src/private-apis.js +2 -0
- package/src/store/private-keys.js +1 -0
- package/build/components/border-radius-control/all-input-control.js +0 -65
- package/build/components/border-radius-control/all-input-control.js.map +0 -1
- package/build/components/border-radius-control/input-controls.js +0 -82
- package/build/components/border-radius-control/input-controls.js.map +0 -1
- package/build-module/components/border-radius-control/all-input-control.js +0 -58
- package/build-module/components/border-radius-control/all-input-control.js.map +0 -1
- package/build-module/components/border-radius-control/input-controls.js +0 -75
- package/build-module/components/border-radius-control/input-controls.js.map +0 -1
- package/src/components/border-radius-control/all-input-control.js +0 -67
- package/src/components/border-radius-control/input-controls.js +0 -91
|
@@ -1627,6 +1627,7 @@ iframe[name=editor-canvas] {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
|
|
1629
1629
|
.block-editor-block-variation-transforms {
|
|
1630
|
+
box-sizing: border-box;
|
|
1630
1631
|
padding: 0 52px 16px 16px;
|
|
1631
1632
|
width: 100%;
|
|
1632
1633
|
}
|
|
@@ -1659,6 +1660,11 @@ iframe[name=editor-canvas] {
|
|
|
1659
1660
|
min-width: 230px;
|
|
1660
1661
|
}
|
|
1661
1662
|
|
|
1663
|
+
.components-border-radius-control__header {
|
|
1664
|
+
height: 16px;
|
|
1665
|
+
margin-bottom: 12px;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1662
1668
|
.components-border-radius-control {
|
|
1663
1669
|
border: 0;
|
|
1664
1670
|
padding: 0;
|
|
@@ -1666,22 +1672,7 @@ iframe[name=editor-canvas] {
|
|
|
1666
1672
|
margin-bottom: 12px;
|
|
1667
1673
|
}
|
|
1668
1674
|
.components-border-radius-control legend {
|
|
1669
|
-
margin-bottom: 8px;
|
|
1670
|
-
}
|
|
1671
|
-
.components-border-radius-control .components-border-radius-control__wrapper {
|
|
1672
|
-
display: flex;
|
|
1673
|
-
justify-content: space-between;
|
|
1674
|
-
align-items: flex-start;
|
|
1675
|
-
}
|
|
1676
|
-
.components-border-radius-control .components-border-radius-control__wrapper .components-border-radius-control__unit-control {
|
|
1677
|
-
width: calc((100% - 16px) / 2);
|
|
1678
1675
|
margin-bottom: 0;
|
|
1679
|
-
margin-left: 16px;
|
|
1680
|
-
flex-shrink: 0;
|
|
1681
|
-
}
|
|
1682
|
-
.components-border-radius-control .components-border-radius-control__wrapper .components-border-radius-control__range-control {
|
|
1683
|
-
flex: 1;
|
|
1684
|
-
margin-left: 12px;
|
|
1685
1676
|
}
|
|
1686
1677
|
.components-border-radius-control .components-border-radius-control__input-controls-wrapper {
|
|
1687
1678
|
display: grid;
|
|
@@ -1689,15 +1680,23 @@ iframe[name=editor-canvas] {
|
|
|
1689
1680
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1690
1681
|
margin-left: 12px;
|
|
1691
1682
|
}
|
|
1692
|
-
.components-border-radius-control .
|
|
1683
|
+
.components-border-radius-control .components-border-radius-control__linked-button {
|
|
1693
1684
|
display: flex;
|
|
1694
1685
|
justify-content: center;
|
|
1695
|
-
margin-top: 8px;
|
|
1696
1686
|
}
|
|
1697
|
-
.components-border-radius-control .
|
|
1687
|
+
.components-border-radius-control .components-border-radius-control__linked-button svg {
|
|
1698
1688
|
margin-left: 0;
|
|
1699
1689
|
}
|
|
1700
1690
|
|
|
1691
|
+
.components-border-radius-control__custom-select-control,
|
|
1692
|
+
.components-border-radius-control__range-control {
|
|
1693
|
+
flex: 1;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
.components-border-radius-control__icon {
|
|
1697
|
+
flex: 0 0 auto;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1701
1700
|
.block-editor-color-gradient-control .block-editor-color-gradient-control__color-indicator {
|
|
1702
1701
|
margin-bottom: 12px;
|
|
1703
1702
|
}
|
|
@@ -3184,11 +3183,6 @@ iframe[name=editor-canvas] {
|
|
|
3184
3183
|
padding: 0;
|
|
3185
3184
|
margin: 0;
|
|
3186
3185
|
}
|
|
3187
|
-
.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-item-title,
|
|
3188
|
-
.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-item-info {
|
|
3189
|
-
max-width: 200px;
|
|
3190
|
-
white-space: nowrap;
|
|
3191
|
-
}
|
|
3192
3186
|
.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__tools {
|
|
3193
3187
|
justify-content: flex-end;
|
|
3194
3188
|
padding: 16px var(--wp-admin-border-width-focus) var(--wp-admin-border-width-focus);
|
package/build-style/style.css
CHANGED
|
@@ -1627,6 +1627,7 @@ iframe[name=editor-canvas] {
|
|
|
1627
1627
|
}
|
|
1628
1628
|
|
|
1629
1629
|
.block-editor-block-variation-transforms {
|
|
1630
|
+
box-sizing: border-box;
|
|
1630
1631
|
padding: 0 16px 16px 52px;
|
|
1631
1632
|
width: 100%;
|
|
1632
1633
|
}
|
|
@@ -1659,6 +1660,11 @@ iframe[name=editor-canvas] {
|
|
|
1659
1660
|
min-width: 230px;
|
|
1660
1661
|
}
|
|
1661
1662
|
|
|
1663
|
+
.components-border-radius-control__header {
|
|
1664
|
+
height: 16px;
|
|
1665
|
+
margin-bottom: 12px;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1662
1668
|
.components-border-radius-control {
|
|
1663
1669
|
border: 0;
|
|
1664
1670
|
padding: 0;
|
|
@@ -1666,22 +1672,7 @@ iframe[name=editor-canvas] {
|
|
|
1666
1672
|
margin-bottom: 12px;
|
|
1667
1673
|
}
|
|
1668
1674
|
.components-border-radius-control legend {
|
|
1669
|
-
margin-bottom: 8px;
|
|
1670
|
-
}
|
|
1671
|
-
.components-border-radius-control .components-border-radius-control__wrapper {
|
|
1672
|
-
display: flex;
|
|
1673
|
-
justify-content: space-between;
|
|
1674
|
-
align-items: flex-start;
|
|
1675
|
-
}
|
|
1676
|
-
.components-border-radius-control .components-border-radius-control__wrapper .components-border-radius-control__unit-control {
|
|
1677
|
-
width: calc((100% - 16px) / 2);
|
|
1678
1675
|
margin-bottom: 0;
|
|
1679
|
-
margin-right: 16px;
|
|
1680
|
-
flex-shrink: 0;
|
|
1681
|
-
}
|
|
1682
|
-
.components-border-radius-control .components-border-radius-control__wrapper .components-border-radius-control__range-control {
|
|
1683
|
-
flex: 1;
|
|
1684
|
-
margin-right: 12px;
|
|
1685
1676
|
}
|
|
1686
1677
|
.components-border-radius-control .components-border-radius-control__input-controls-wrapper {
|
|
1687
1678
|
display: grid;
|
|
@@ -1689,15 +1680,23 @@ iframe[name=editor-canvas] {
|
|
|
1689
1680
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1690
1681
|
margin-right: 12px;
|
|
1691
1682
|
}
|
|
1692
|
-
.components-border-radius-control .
|
|
1683
|
+
.components-border-radius-control .components-border-radius-control__linked-button {
|
|
1693
1684
|
display: flex;
|
|
1694
1685
|
justify-content: center;
|
|
1695
|
-
margin-top: 8px;
|
|
1696
1686
|
}
|
|
1697
|
-
.components-border-radius-control .
|
|
1687
|
+
.components-border-radius-control .components-border-radius-control__linked-button svg {
|
|
1698
1688
|
margin-right: 0;
|
|
1699
1689
|
}
|
|
1700
1690
|
|
|
1691
|
+
.components-border-radius-control__custom-select-control,
|
|
1692
|
+
.components-border-radius-control__range-control {
|
|
1693
|
+
flex: 1;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
.components-border-radius-control__icon {
|
|
1697
|
+
flex: 0 0 auto;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1701
1700
|
.block-editor-color-gradient-control .block-editor-color-gradient-control__color-indicator {
|
|
1702
1701
|
margin-bottom: 12px;
|
|
1703
1702
|
}
|
|
@@ -3186,11 +3185,6 @@ iframe[name=editor-canvas] {
|
|
|
3186
3185
|
padding: 0;
|
|
3187
3186
|
margin: 0;
|
|
3188
3187
|
}
|
|
3189
|
-
.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-item-title,
|
|
3190
|
-
.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__search-item-info {
|
|
3191
|
-
max-width: 200px;
|
|
3192
|
-
white-space: nowrap;
|
|
3193
|
-
}
|
|
3194
3188
|
.block-editor-media-flow__url-input .block-editor-link-control .block-editor-link-control__tools {
|
|
3195
3189
|
justify-content: flex-end;
|
|
3196
3190
|
padding: 16px var(--wp-admin-border-width-focus) var(--wp-admin-border-width-focus);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.1.1-next.0f6f9d12c.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,38 +37,38 @@
|
|
|
37
37
|
"@emotion/react": "^11.7.1",
|
|
38
38
|
"@emotion/styled": "^11.6.0",
|
|
39
39
|
"@react-spring/web": "^9.4.5",
|
|
40
|
-
"@wordpress/a11y": "^4.
|
|
41
|
-
"@wordpress/api-fetch": "^7.
|
|
42
|
-
"@wordpress/blob": "^4.
|
|
43
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
44
|
-
"@wordpress/blocks": "^15.
|
|
45
|
-
"@wordpress/commands": "^1.
|
|
46
|
-
"@wordpress/components": "^30.
|
|
47
|
-
"@wordpress/compose": "^7.
|
|
48
|
-
"@wordpress/data": "^10.
|
|
49
|
-
"@wordpress/date": "^5.
|
|
50
|
-
"@wordpress/deprecated": "^4.
|
|
51
|
-
"@wordpress/dom": "^4.
|
|
52
|
-
"@wordpress/element": "^6.
|
|
53
|
-
"@wordpress/escape-html": "^3.
|
|
54
|
-
"@wordpress/hooks": "^4.
|
|
55
|
-
"@wordpress/html-entities": "^4.
|
|
56
|
-
"@wordpress/i18n": "^6.
|
|
57
|
-
"@wordpress/icons": "^10.
|
|
58
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
59
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
60
|
-
"@wordpress/keycodes": "^4.
|
|
61
|
-
"@wordpress/notices": "^5.
|
|
62
|
-
"@wordpress/preferences": "^4.
|
|
63
|
-
"@wordpress/priority-queue": "^3.
|
|
64
|
-
"@wordpress/private-apis": "^1.
|
|
65
|
-
"@wordpress/rich-text": "^7.
|
|
66
|
-
"@wordpress/style-engine": "^2.
|
|
67
|
-
"@wordpress/token-list": "^3.
|
|
68
|
-
"@wordpress/upload-media": "^0.
|
|
69
|
-
"@wordpress/url": "^4.
|
|
70
|
-
"@wordpress/warning": "^3.
|
|
71
|
-
"@wordpress/wordcount": "^4.
|
|
40
|
+
"@wordpress/a11y": "^4.28.1-next.0f6f9d12c.0",
|
|
41
|
+
"@wordpress/api-fetch": "^7.28.1-next.0f6f9d12c.0",
|
|
42
|
+
"@wordpress/blob": "^4.28.1-next.0f6f9d12c.0",
|
|
43
|
+
"@wordpress/block-serialization-default-parser": "^5.28.1-next.0f6f9d12c.0",
|
|
44
|
+
"@wordpress/blocks": "^15.1.1-next.0f6f9d12c.0",
|
|
45
|
+
"@wordpress/commands": "^1.28.1-next.0f6f9d12c.0",
|
|
46
|
+
"@wordpress/components": "^30.2.1-next.0f6f9d12c.0",
|
|
47
|
+
"@wordpress/compose": "^7.28.1-next.0f6f9d12c.0",
|
|
48
|
+
"@wordpress/data": "^10.28.1-next.0f6f9d12c.0",
|
|
49
|
+
"@wordpress/date": "^5.28.1-next.0f6f9d12c.0",
|
|
50
|
+
"@wordpress/deprecated": "^4.28.1-next.0f6f9d12c.0",
|
|
51
|
+
"@wordpress/dom": "^4.28.1-next.0f6f9d12c.0",
|
|
52
|
+
"@wordpress/element": "^6.28.1-next.0f6f9d12c.0",
|
|
53
|
+
"@wordpress/escape-html": "^3.28.1-next.0f6f9d12c.0",
|
|
54
|
+
"@wordpress/hooks": "^4.28.1-next.0f6f9d12c.0",
|
|
55
|
+
"@wordpress/html-entities": "^4.28.1-next.0f6f9d12c.0",
|
|
56
|
+
"@wordpress/i18n": "^6.1.1-next.0f6f9d12c.0",
|
|
57
|
+
"@wordpress/icons": "^10.28.2-next.0f6f9d12c.0",
|
|
58
|
+
"@wordpress/is-shallow-equal": "^5.28.1-next.0f6f9d12c.0",
|
|
59
|
+
"@wordpress/keyboard-shortcuts": "^5.28.1-next.0f6f9d12c.0",
|
|
60
|
+
"@wordpress/keycodes": "^4.28.1-next.0f6f9d12c.0",
|
|
61
|
+
"@wordpress/notices": "^5.28.1-next.0f6f9d12c.0",
|
|
62
|
+
"@wordpress/preferences": "^4.28.1-next.0f6f9d12c.0",
|
|
63
|
+
"@wordpress/priority-queue": "^3.28.1-next.0f6f9d12c.0",
|
|
64
|
+
"@wordpress/private-apis": "^1.28.1-next.0f6f9d12c.0",
|
|
65
|
+
"@wordpress/rich-text": "^7.28.1-next.0f6f9d12c.0",
|
|
66
|
+
"@wordpress/style-engine": "^2.28.1-next.0f6f9d12c.0",
|
|
67
|
+
"@wordpress/token-list": "^3.28.1-next.0f6f9d12c.0",
|
|
68
|
+
"@wordpress/upload-media": "^0.13.1-next.0f6f9d12c.0",
|
|
69
|
+
"@wordpress/url": "^4.28.1-next.0f6f9d12c.0",
|
|
70
|
+
"@wordpress/warning": "^3.28.1-next.0f6f9d12c.0",
|
|
71
|
+
"@wordpress/wordcount": "^4.28.1-next.0f6f9d12c.0",
|
|
72
72
|
"change-case": "^4.1.2",
|
|
73
73
|
"clsx": "^2.1.1",
|
|
74
74
|
"colord": "^2.7.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "7d4f4367e2f76deddf4a09b540e6b2f9f4c3fe9f"
|
|
95
95
|
}
|
|
@@ -88,6 +88,7 @@ export function BlockSettingsDropdown( {
|
|
|
88
88
|
selectedBlockClientIds,
|
|
89
89
|
openedBlockSettingsMenu,
|
|
90
90
|
isContentOnly,
|
|
91
|
+
isNavigationMode,
|
|
91
92
|
isZoomOut,
|
|
92
93
|
} = useSelect(
|
|
93
94
|
( select ) => {
|
|
@@ -99,6 +100,7 @@ export function BlockSettingsDropdown( {
|
|
|
99
100
|
getBlockAttributes,
|
|
100
101
|
getOpenedBlockSettingsMenu,
|
|
101
102
|
getBlockEditingMode,
|
|
103
|
+
isNavigationMode: _isNavigationMode,
|
|
102
104
|
isZoomOut: _isZoomOut,
|
|
103
105
|
} = unlock( select( blockEditorStore ) );
|
|
104
106
|
|
|
@@ -124,6 +126,7 @@ export function BlockSettingsDropdown( {
|
|
|
124
126
|
openedBlockSettingsMenu: getOpenedBlockSettingsMenu(),
|
|
125
127
|
isContentOnly:
|
|
126
128
|
getBlockEditingMode( firstBlockClientId ) === 'contentOnly',
|
|
129
|
+
isNavigationMode: _isNavigationMode(),
|
|
127
130
|
isZoomOut: _isZoomOut(),
|
|
128
131
|
};
|
|
129
132
|
},
|
|
@@ -155,6 +158,7 @@ export function BlockSettingsDropdown( {
|
|
|
155
158
|
};
|
|
156
159
|
}, [] );
|
|
157
160
|
const hasSelectedBlocks = selectedBlockClientIds.length > 0;
|
|
161
|
+
const isContentOnlyWriteMode = isNavigationMode && isContentOnly;
|
|
158
162
|
|
|
159
163
|
async function updateSelectionAfterDuplicate( clientIdsPromise ) {
|
|
160
164
|
if ( ! __experimentalSelectBlock ) {
|
|
@@ -278,20 +282,24 @@ export function BlockSettingsDropdown( {
|
|
|
278
282
|
clientId={ firstBlockClientId }
|
|
279
283
|
/>
|
|
280
284
|
) }
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
285
|
+
{ ! isContentOnlyWriteMode && (
|
|
286
|
+
<CopyMenuItem
|
|
287
|
+
clientIds={ clientIds }
|
|
288
|
+
onCopy={ onCopy }
|
|
289
|
+
shortcut={ shortcuts.copy }
|
|
290
|
+
/>
|
|
291
|
+
) }
|
|
292
|
+
{ ! isContentOnlyWriteMode && (
|
|
293
|
+
<CopyMenuItem
|
|
294
|
+
clientIds={ clientIds }
|
|
295
|
+
label={ __( 'Cut' ) }
|
|
296
|
+
eventType="cut"
|
|
297
|
+
shortcut={ shortcuts.cut }
|
|
298
|
+
__experimentalUpdateSelection={
|
|
299
|
+
! __experimentalSelectBlock
|
|
300
|
+
}
|
|
301
|
+
/>
|
|
302
|
+
) }
|
|
295
303
|
{ canDuplicate && (
|
|
296
304
|
<MenuItem
|
|
297
305
|
onClick={ pipe(
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import { __, sprintf } from '@wordpress/i18n';
|
|
27
27
|
import { withDispatch, withSelect, useSelect } from '@wordpress/data';
|
|
28
28
|
import { withInstanceId, compose } from '@wordpress/compose';
|
|
29
|
-
import {
|
|
29
|
+
import { moreHorizontal } from '@wordpress/icons';
|
|
30
30
|
import { useRef, useState } from '@wordpress/element';
|
|
31
31
|
import { store as noticesStore } from '@wordpress/notices';
|
|
32
32
|
import { store as reusableBlocksStore } from '@wordpress/reusable-blocks';
|
|
@@ -255,7 +255,7 @@ const BlockActionsMenu = ( {
|
|
|
255
255
|
<ToolbarGroup>
|
|
256
256
|
<ToolbarButton
|
|
257
257
|
title={ __( 'Open Block Actions Menu' ) }
|
|
258
|
-
icon={
|
|
258
|
+
icon={ moreHorizontal }
|
|
259
259
|
disabled
|
|
260
260
|
/>
|
|
261
261
|
</ToolbarGroup>
|
|
@@ -298,7 +298,7 @@ const BlockActionsMenu = ( {
|
|
|
298
298
|
<ToolbarButton
|
|
299
299
|
title={ __( 'Open Block Actions Menu' ) }
|
|
300
300
|
onClick={ onPickerPresent }
|
|
301
|
-
icon={
|
|
301
|
+
icon={ moreHorizontal }
|
|
302
302
|
extraProps={ {
|
|
303
303
|
hint: accessibilityHint,
|
|
304
304
|
} }
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import {
|
|
6
|
+
cornerAll,
|
|
7
|
+
cornerBottomLeft,
|
|
8
|
+
cornerBottomRight,
|
|
9
|
+
cornerTopLeft,
|
|
10
|
+
cornerTopRight,
|
|
11
|
+
} from '@wordpress/icons';
|
|
12
|
+
|
|
13
|
+
export const DEFAULT_VALUES = {
|
|
14
|
+
topLeft: undefined,
|
|
15
|
+
topRight: undefined,
|
|
16
|
+
bottomLeft: undefined,
|
|
17
|
+
bottomRight: undefined,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const RANGE_CONTROL_MAX_SIZE = 8;
|
|
21
|
+
|
|
22
|
+
export const EMPTY_ARRAY = [];
|
|
23
|
+
|
|
24
|
+
export const CORNERS = {
|
|
25
|
+
all: __( 'Border radius' ),
|
|
26
|
+
topLeft: __( 'Top left' ),
|
|
27
|
+
topRight: __( 'Top right' ),
|
|
28
|
+
bottomLeft: __( 'Bottom left' ),
|
|
29
|
+
bottomRight: __( 'Bottom right' ),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const ICONS = {
|
|
33
|
+
all: cornerAll,
|
|
34
|
+
topLeft: cornerTopLeft,
|
|
35
|
+
topRight: cornerTopRight,
|
|
36
|
+
bottomLeft: cornerBottomLeft,
|
|
37
|
+
bottomRight: cornerBottomRight,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const MIN_BORDER_RADIUS_VALUE = 0;
|
|
41
|
+
|
|
42
|
+
export const MAX_BORDER_RADIUS_VALUES = {
|
|
43
|
+
px: 100,
|
|
44
|
+
em: 20,
|
|
45
|
+
rem: 20,
|
|
46
|
+
};
|
|
@@ -3,39 +3,52 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
BaseControl,
|
|
6
|
-
RangeControl,
|
|
7
6
|
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
|
|
8
7
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
8
|
+
__experimentalVStack as VStack,
|
|
9
|
+
__experimentalHStack as HStack,
|
|
9
10
|
} from '@wordpress/components';
|
|
10
|
-
import { useState } from '@wordpress/element';
|
|
11
|
+
import { useState, useMemo } from '@wordpress/element';
|
|
11
12
|
import { __ } from '@wordpress/i18n';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
15
16
|
*/
|
|
16
|
-
import AllInputControl from './all-input-control';
|
|
17
|
-
import InputControls from './input-controls';
|
|
18
17
|
import LinkedButton from './linked-button';
|
|
19
18
|
import { useSettings } from '../use-settings';
|
|
19
|
+
import { hasDefinedValues, hasMixedValues } from './utils';
|
|
20
|
+
import SingleInputControl from './single-input-control';
|
|
20
21
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} from './utils';
|
|
22
|
+
DEFAULT_VALUES,
|
|
23
|
+
RANGE_CONTROL_MAX_SIZE,
|
|
24
|
+
EMPTY_ARRAY,
|
|
25
|
+
} from './constants';
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
function useBorderRadiusSizes( presets ) {
|
|
28
|
+
const defaultSizes = presets?.default ?? EMPTY_ARRAY;
|
|
29
|
+
const customSizes = presets?.custom ?? EMPTY_ARRAY;
|
|
30
|
+
const themeSizes = presets?.theme ?? EMPTY_ARRAY;
|
|
31
|
+
|
|
32
|
+
return useMemo( () => {
|
|
33
|
+
const sizes = [
|
|
34
|
+
{ name: __( 'None' ), slug: '0', size: 0 },
|
|
35
|
+
...customSizes,
|
|
36
|
+
...themeSizes,
|
|
37
|
+
...defaultSizes,
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
return sizes.length > RANGE_CONTROL_MAX_SIZE
|
|
41
|
+
? [
|
|
42
|
+
{
|
|
43
|
+
name: __( 'Default' ),
|
|
44
|
+
slug: 'default',
|
|
45
|
+
size: undefined,
|
|
46
|
+
},
|
|
47
|
+
...sizes,
|
|
48
|
+
]
|
|
49
|
+
: sizes;
|
|
50
|
+
}, [ customSizes, themeSizes, defaultSizes ] );
|
|
51
|
+
}
|
|
39
52
|
|
|
40
53
|
/**
|
|
41
54
|
* Control to display border radius options.
|
|
@@ -43,14 +56,15 @@ const MAX_BORDER_RADIUS_VALUES = {
|
|
|
43
56
|
* @param {Object} props Component props.
|
|
44
57
|
* @param {Function} props.onChange Callback to handle onChange.
|
|
45
58
|
* @param {Object} props.values Border radius values.
|
|
59
|
+
* @param {Object} props.presets Border radius presets.
|
|
46
60
|
*
|
|
47
61
|
* @return {Element} Custom border radius control.
|
|
48
62
|
*/
|
|
49
|
-
export default function BorderRadiusControl( { onChange, values } ) {
|
|
63
|
+
export default function BorderRadiusControl( { onChange, values, presets } ) {
|
|
50
64
|
const [ isLinked, setIsLinked ] = useState(
|
|
51
65
|
! hasDefinedValues( values ) || ! hasMixedValues( values )
|
|
52
66
|
);
|
|
53
|
-
|
|
67
|
+
const options = useBorderRadiusSizes( presets );
|
|
54
68
|
// Tracking selected units via internal state allows filtering of CSS unit
|
|
55
69
|
// only values from being saved while maintaining preexisting unit selection
|
|
56
70
|
// behaviour. Filtering CSS unit only values prevents invalid style values.
|
|
@@ -72,64 +86,49 @@ export default function BorderRadiusControl( { onChange, values } ) {
|
|
|
72
86
|
availableUnits: availableUnits || [ 'px', 'em', 'rem' ],
|
|
73
87
|
} );
|
|
74
88
|
|
|
75
|
-
const unit = getAllUnit( selectedUnits );
|
|
76
|
-
const unitConfig = units && units.find( ( item ) => item.value === unit );
|
|
77
|
-
const step = unitConfig?.step || 1;
|
|
78
|
-
|
|
79
|
-
const [ allValue ] = parseQuantityAndUnitFromRawValue(
|
|
80
|
-
getAllValue( values )
|
|
81
|
-
);
|
|
82
|
-
|
|
83
89
|
const toggleLinked = () => setIsLinked( ! isLinked );
|
|
84
90
|
|
|
85
|
-
const handleSliderChange = ( next ) => {
|
|
86
|
-
onChange( next !== undefined ? `${ next }${ unit }` : undefined );
|
|
87
|
-
};
|
|
88
|
-
|
|
89
91
|
return (
|
|
90
92
|
<fieldset className="components-border-radius-control">
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{ isLinked
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
min={ MIN_BORDER_RADIUS_VALUE }
|
|
101
|
-
onChange={ onChange }
|
|
102
|
-
selectedUnits={ selectedUnits }
|
|
103
|
-
setSelectedUnits={ setSelectedUnits }
|
|
104
|
-
units={ units }
|
|
105
|
-
/>
|
|
106
|
-
<RangeControl
|
|
107
|
-
__next40pxDefaultSize
|
|
108
|
-
label={ __( 'Border radius' ) }
|
|
109
|
-
hideLabelFromVision
|
|
110
|
-
className="components-border-radius-control__range-control"
|
|
111
|
-
value={ allValue ?? '' }
|
|
112
|
-
min={ MIN_BORDER_RADIUS_VALUE }
|
|
113
|
-
max={ MAX_BORDER_RADIUS_VALUES[ unit ] }
|
|
114
|
-
initialPosition={ 0 }
|
|
115
|
-
withInputField={ false }
|
|
116
|
-
onChange={ handleSliderChange }
|
|
117
|
-
step={ step }
|
|
118
|
-
__nextHasNoMarginBottom
|
|
119
|
-
/>
|
|
120
|
-
</>
|
|
121
|
-
) : (
|
|
122
|
-
<InputControls
|
|
123
|
-
min={ MIN_BORDER_RADIUS_VALUE }
|
|
93
|
+
<HStack className="components-border-radius-control__header">
|
|
94
|
+
<BaseControl.VisualLabel as="legend">
|
|
95
|
+
{ __( 'Radius' ) }
|
|
96
|
+
</BaseControl.VisualLabel>
|
|
97
|
+
<LinkedButton onClick={ toggleLinked } isLinked={ isLinked } />
|
|
98
|
+
</HStack>
|
|
99
|
+
{ isLinked ? (
|
|
100
|
+
<>
|
|
101
|
+
<SingleInputControl
|
|
124
102
|
onChange={ onChange }
|
|
125
103
|
selectedUnits={ selectedUnits }
|
|
126
104
|
setSelectedUnits={ setSelectedUnits }
|
|
127
|
-
values={ values
|
|
105
|
+
values={ values }
|
|
128
106
|
units={ units }
|
|
107
|
+
corner="all"
|
|
108
|
+
presets={ options }
|
|
129
109
|
/>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
110
|
+
</>
|
|
111
|
+
) : (
|
|
112
|
+
<VStack>
|
|
113
|
+
{ [
|
|
114
|
+
'topLeft',
|
|
115
|
+
'topRight',
|
|
116
|
+
'bottomLeft',
|
|
117
|
+
'bottomRight',
|
|
118
|
+
].map( ( corner ) => (
|
|
119
|
+
<SingleInputControl
|
|
120
|
+
key={ corner }
|
|
121
|
+
onChange={ onChange }
|
|
122
|
+
selectedUnits={ selectedUnits }
|
|
123
|
+
setSelectedUnits={ setSelectedUnits }
|
|
124
|
+
values={ values || DEFAULT_VALUES }
|
|
125
|
+
units={ units }
|
|
126
|
+
corner={ corner }
|
|
127
|
+
presets={ options }
|
|
128
|
+
/>
|
|
129
|
+
) ) }
|
|
130
|
+
</VStack>
|
|
131
|
+
) }
|
|
133
132
|
</fieldset>
|
|
134
133
|
);
|
|
135
134
|
}
|
|
@@ -11,7 +11,7 @@ export default function LinkedButton( { isLinked, ...props } ) {
|
|
|
11
11
|
return (
|
|
12
12
|
<Button
|
|
13
13
|
{ ...props }
|
|
14
|
-
className="
|
|
14
|
+
className="components-border-radius-control__linked-button"
|
|
15
15
|
size="small"
|
|
16
16
|
icon={ isLinked ? link : linkOff }
|
|
17
17
|
iconSize={ 24 }
|