@wordpress/block-editor 15.8.1-next.dc3f6d3c1.0 → 15.9.1-next.8b30e05b0.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 +4 -0
- package/build/components/block-list/index.js +2 -1
- package/build/components/block-list/index.js.map +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
- package/build/components/block-lock/modal.js +5 -5
- package/build/components/block-lock/modal.js.map +2 -2
- package/build/components/block-lock/use-block-lock.js +10 -13
- package/build/components/block-lock/use-block-lock.js.map +2 -2
- package/build/components/block-settings-menu-controls/index.js +1 -1
- package/build/components/block-settings-menu-controls/index.js.map +2 -2
- package/build/components/block-tools/index.js +56 -45
- package/build/components/block-tools/index.js.map +3 -3
- package/build/components/block-visibility/toolbar.js +1 -1
- package/build/components/block-visibility/toolbar.js.map +1 -1
- package/build/components/content-only-controls/fields-dropdown-menu.js +66 -0
- package/build/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
- package/build/components/content-only-controls/index.js +225 -44
- package/build/components/content-only-controls/index.js.map +3 -3
- package/build/components/content-only-controls/link/index.js +92 -103
- package/build/components/content-only-controls/link/index.js.map +3 -3
- package/build/components/content-only-controls/media/index.js +134 -134
- package/build/components/content-only-controls/media/index.js.map +3 -3
- package/build/components/content-only-controls/rich-text/index.js +65 -74
- package/build/components/content-only-controls/rich-text/index.js.map +3 -3
- package/build/components/font-family/index.js +1 -15
- package/build/components/font-family/index.js.map +2 -2
- package/build/components/global-styles/dimensions-panel.js +35 -2
- package/build/components/global-styles/dimensions-panel.js.map +2 -2
- package/build/components/global-styles/hooks.js +1 -1
- package/build/components/global-styles/hooks.js.map +2 -2
- package/build/components/global-styles/typography-panel.js +1 -2
- package/build/components/global-styles/typography-panel.js.map +2 -2
- package/build/components/index.js +3 -0
- package/build/components/index.js.map +2 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
- package/build/components/link-control/index.js +15 -7
- package/build/components/link-control/index.js.map +2 -2
- package/build/components/list-view/block-select-button.js +3 -11
- package/build/components/list-view/block-select-button.js.map +2 -2
- package/build/components/list-view/block.js +9 -7
- package/build/components/list-view/block.js.map +2 -2
- package/build/components/media-placeholder/index.js +17 -4
- package/build/components/media-placeholder/index.js.map +2 -2
- package/build/components/media-placeholder/utils.js +60 -0
- package/build/components/media-placeholder/utils.js.map +7 -0
- package/build/components/media-replace-flow/index.js +20 -3
- package/build/components/media-replace-flow/index.js.map +2 -2
- package/build/components/tool-selector/index.js +46 -0
- package/build/components/tool-selector/index.js.map +7 -0
- package/build/components/use-block-commands/index.js +1 -1
- package/build/components/use-block-commands/index.js.map +2 -2
- package/build/components/use-block-drop-zone/index.js +1 -5
- package/build/components/use-block-drop-zone/index.js.map +2 -2
- package/build/hooks/dimensions.js +3 -3
- package/build/hooks/dimensions.js.map +2 -2
- package/build/hooks/metadata.js +1 -1
- package/build/hooks/metadata.js.map +2 -2
- package/build/hooks/utils.js +5 -1
- package/build/hooks/utils.js.map +2 -2
- package/build/store/private-selectors.js +43 -3
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +2 -1
- package/build/store/reducer.js.map +2 -2
- package/build/store/selectors.js +6 -4
- package/build/store/selectors.js.map +2 -2
- package/build-module/components/block-list/index.js +2 -1
- package/build-module/components/block-list/index.js.map +2 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
- package/build-module/components/block-lock/modal.js +5 -5
- package/build-module/components/block-lock/modal.js.map +2 -2
- package/build-module/components/block-lock/use-block-lock.js +10 -13
- package/build-module/components/block-lock/use-block-lock.js.map +2 -2
- package/build-module/components/block-settings-menu-controls/index.js +1 -1
- package/build-module/components/block-settings-menu-controls/index.js.map +2 -2
- package/build-module/components/block-tools/index.js +56 -45
- package/build-module/components/block-tools/index.js.map +2 -2
- package/build-module/components/block-visibility/toolbar.js +1 -1
- package/build-module/components/block-visibility/toolbar.js.map +1 -1
- package/build-module/components/content-only-controls/fields-dropdown-menu.js +45 -0
- package/build-module/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
- package/build-module/components/content-only-controls/index.js +229 -46
- package/build-module/components/content-only-controls/index.js.map +2 -2
- package/build-module/components/content-only-controls/link/index.js +92 -104
- package/build-module/components/content-only-controls/link/index.js.map +2 -2
- package/build-module/components/content-only-controls/media/index.js +134 -135
- package/build-module/components/content-only-controls/media/index.js.map +2 -2
- package/build-module/components/content-only-controls/rich-text/index.js +67 -81
- package/build-module/components/content-only-controls/rich-text/index.js.map +2 -2
- package/build-module/components/font-family/index.js +1 -15
- package/build-module/components/font-family/index.js.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.js +35 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +2 -2
- package/build-module/components/global-styles/typography-panel.js +1 -2
- package/build-module/components/global-styles/typography-panel.js.map +2 -2
- package/build-module/components/index.js +2 -0
- package/build-module/components/index.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
- package/build-module/components/link-control/index.js +16 -8
- package/build-module/components/link-control/index.js.map +2 -2
- package/build-module/components/list-view/block-select-button.js +3 -11
- package/build-module/components/list-view/block-select-button.js.map +2 -2
- package/build-module/components/list-view/block.js +9 -7
- package/build-module/components/list-view/block.js.map +2 -2
- package/build-module/components/media-placeholder/index.js +18 -5
- package/build-module/components/media-placeholder/index.js.map +2 -2
- package/build-module/components/media-placeholder/utils.js +35 -0
- package/build-module/components/media-placeholder/utils.js.map +7 -0
- package/build-module/components/media-replace-flow/index.js +20 -3
- package/build-module/components/media-replace-flow/index.js.map +2 -2
- package/build-module/components/tool-selector/index.js +15 -0
- package/build-module/components/tool-selector/index.js.map +7 -0
- package/build-module/components/use-block-commands/index.js +1 -1
- package/build-module/components/use-block-commands/index.js.map +2 -2
- package/build-module/components/use-block-drop-zone/index.js +1 -5
- package/build-module/components/use-block-drop-zone/index.js.map +2 -2
- package/build-module/hooks/dimensions.js +3 -3
- package/build-module/hooks/dimensions.js.map +2 -2
- package/build-module/hooks/metadata.js +1 -1
- package/build-module/hooks/metadata.js.map +2 -2
- package/build-module/hooks/utils.js +5 -1
- package/build-module/hooks/utils.js.map +2 -2
- package/build-module/store/private-selectors.js +39 -3
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +2 -1
- package/build-module/store/reducer.js.map +2 -2
- package/build-module/store/selectors.js +6 -4
- package/build-module/store/selectors.js.map +2 -2
- package/build-style/content-rtl.css +3 -0
- package/build-style/content.css +3 -0
- package/build-style/style-rtl.css +14 -5
- package/build-style/style.css +14 -5
- package/package.json +38 -37
- package/src/components/block-list/content.scss +5 -0
- package/src/components/block-list/index.js +3 -1
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +34 -3
- package/src/components/block-lock/modal.js +6 -5
- package/src/components/block-lock/use-block-lock.js +10 -14
- package/src/components/block-patterns-list/stories/{index.story.js → index.story.jsx} +3 -1
- package/src/components/block-settings-menu-controls/index.js +1 -1
- package/src/components/block-tools/index.js +15 -2
- package/src/components/block-tools/style.scss +4 -0
- package/src/components/block-visibility/toolbar.js +1 -1
- package/src/components/content-only-controls/fields-dropdown-menu.js +53 -0
- package/src/components/content-only-controls/index.js +314 -50
- package/src/components/content-only-controls/link/index.js +62 -57
- package/src/components/content-only-controls/media/index.js +177 -156
- package/src/components/content-only-controls/rich-text/index.js +30 -44
- package/src/components/content-only-controls/styles.scss +10 -1
- package/src/components/font-family/README.md +0 -9
- package/src/components/font-family/index.js +1 -16
- package/src/components/font-family/stories/{index.story.js → index.story.jsx} +0 -1
- package/src/components/global-styles/dimensions-panel.js +36 -0
- package/src/components/global-styles/hooks.js +1 -1
- package/src/components/global-styles/typography-panel.js +0 -1
- package/src/components/index.js +4 -0
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -5
- package/src/components/link-control/index.js +36 -12
- package/src/components/list-view/block-select-button.js +22 -30
- package/src/components/list-view/block.js +9 -7
- package/src/components/media-placeholder/index.js +20 -5
- package/src/components/media-placeholder/test/get-computed-accept-attribute.js +164 -0
- package/src/components/media-placeholder/utils.js +65 -0
- package/src/components/media-replace-flow/index.js +22 -3
- package/src/components/tool-selector/index.js +19 -0
- package/src/components/use-block-commands/index.js +1 -1
- package/src/components/use-block-drop-zone/index.js +1 -5
- package/src/hooks/dimensions.js +8 -3
- package/src/hooks/metadata.js +1 -1
- package/src/hooks/test/metadata.js +1 -1
- package/src/hooks/utils.js +4 -0
- package/src/store/private-selectors.js +123 -6
- package/src/store/reducer.js +3 -0
- package/src/store/selectors.js +6 -4
- package/src/store/test/private-selectors.js +242 -0
- package/src/store/test/reducer.js +17 -7
- package/src/style.scss +0 -1
- package/tsconfig.json +1 -0
- package/build/components/content-only-controls/plain-text/index.js +0 -68
- package/build/components/content-only-controls/plain-text/index.js.map +0 -7
- package/build-module/components/content-only-controls/plain-text/index.js +0 -50
- package/build-module/components/content-only-controls/plain-text/index.js.map +0 -7
- package/src/components/content-only-controls/plain-text/index.js +0 -49
- package/src/components/font-family/style.scss +0 -7
- /package/src/components/alignment-control/stories/{aliginment-toolbar.story.js → aliginment-toolbar.story.jsx} +0 -0
- /package/src/components/alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-alignment-matrix-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-draggable/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-heading-level-dropdown/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-mover/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-title/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/border-radius-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/date-format-picker/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{aspect-ratio-tool.story.js → aspect-ratio-tool.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{scale-tool.story.js → scale-tool.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{width-height-tool.story.js → width-height-tool.story.jsx} +0 -0
- /package/src/components/height-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/inserter/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/line-height-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/plain-text/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/resolution-tool/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/tabbed-sidebar/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-decoration-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-transform-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/unit-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/url-popover/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/warning/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/writing-mode-control/stories/{index.story.js → index.story.jsx} +0 -0
|
@@ -279,6 +279,9 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
279
279
|
.block-editor-block-list__layout .block-editor-block-list__block[draggable=true], .block-editor-block-list__layout .block-editor-block-list__block[data-draggable=true] {
|
|
280
280
|
cursor: grab;
|
|
281
281
|
}
|
|
282
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected {
|
|
283
|
+
cursor: default;
|
|
284
|
+
}
|
|
282
285
|
.block-editor-block-list__layout .block-editor-block-list__block[contenteditable],
|
|
283
286
|
.block-editor-block-list__layout .block-editor-block-list__block [contenteditable] {
|
|
284
287
|
cursor: text;
|
package/build-style/content.css
CHANGED
|
@@ -279,6 +279,9 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
279
279
|
.block-editor-block-list__layout .block-editor-block-list__block[draggable=true], .block-editor-block-list__layout .block-editor-block-list__block[data-draggable=true] {
|
|
280
280
|
cursor: grab;
|
|
281
281
|
}
|
|
282
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected {
|
|
283
|
+
cursor: default;
|
|
284
|
+
}
|
|
282
285
|
.block-editor-block-list__layout .block-editor-block-list__block[contenteditable],
|
|
283
286
|
.block-editor-block-list__layout .block-editor-block-list__block [contenteditable] {
|
|
284
287
|
cursor: text;
|
|
@@ -531,6 +531,10 @@ iframe[name=editor-canvas] {
|
|
|
531
531
|
right: 50%;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
+
.block-editor-block-tools--is-dragging > .popover-slot {
|
|
535
|
+
display: none;
|
|
536
|
+
}
|
|
537
|
+
|
|
534
538
|
.block-editor-block-lock-modal {
|
|
535
539
|
z-index: 1000001;
|
|
536
540
|
}
|
|
@@ -1735,7 +1739,7 @@ block-editor-content-only-controls__media-thumbnail {
|
|
|
1735
1739
|
}
|
|
1736
1740
|
|
|
1737
1741
|
.block-editor-content-only-controls__screen.components-navigator-screen {
|
|
1738
|
-
padding: 8px 0
|
|
1742
|
+
padding: 8px 0 16px 0;
|
|
1739
1743
|
}
|
|
1740
1744
|
.block-editor-content-only-controls__screen {
|
|
1741
1745
|
border-top: 1px solid #e0e0e0;
|
|
@@ -1755,6 +1759,15 @@ block-editor-content-only-controls__media-thumbnail {
|
|
|
1755
1759
|
width: 100%;
|
|
1756
1760
|
}
|
|
1757
1761
|
|
|
1762
|
+
.block-editor-content-only-controls__fields-container {
|
|
1763
|
+
padding: 0 16px;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
.block-editor-content-only-controls__fields-header {
|
|
1767
|
+
padding: 8px 0;
|
|
1768
|
+
margin-bottom: 4px;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1758
1771
|
.block-editor-date-format-picker {
|
|
1759
1772
|
margin: 0 0 16px;
|
|
1760
1773
|
padding: 0;
|
|
@@ -1788,10 +1801,6 @@ block-editor-content-only-controls__media-thumbnail {
|
|
|
1788
1801
|
text-transform: capitalize;
|
|
1789
1802
|
}
|
|
1790
1803
|
|
|
1791
|
-
.block-editor-font-family-control:not(.is-next-has-no-margin-bottom) {
|
|
1792
|
-
margin-bottom: 8px;
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
1804
|
.block-editor-global-styles__toggle-icon {
|
|
1796
1805
|
fill: currentColor;
|
|
1797
1806
|
}
|
package/build-style/style.css
CHANGED
|
@@ -531,6 +531,10 @@ iframe[name=editor-canvas] {
|
|
|
531
531
|
left: 50%;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
+
.block-editor-block-tools--is-dragging > .popover-slot {
|
|
535
|
+
display: none;
|
|
536
|
+
}
|
|
537
|
+
|
|
534
538
|
.block-editor-block-lock-modal {
|
|
535
539
|
z-index: 1000001;
|
|
536
540
|
}
|
|
@@ -1735,7 +1739,7 @@ block-editor-content-only-controls__media-thumbnail {
|
|
|
1735
1739
|
}
|
|
1736
1740
|
|
|
1737
1741
|
.block-editor-content-only-controls__screen.components-navigator-screen {
|
|
1738
|
-
padding: 8px 0
|
|
1742
|
+
padding: 8px 0 16px 0;
|
|
1739
1743
|
}
|
|
1740
1744
|
.block-editor-content-only-controls__screen {
|
|
1741
1745
|
border-top: 1px solid #e0e0e0;
|
|
@@ -1755,6 +1759,15 @@ block-editor-content-only-controls__media-thumbnail {
|
|
|
1755
1759
|
width: 100%;
|
|
1756
1760
|
}
|
|
1757
1761
|
|
|
1762
|
+
.block-editor-content-only-controls__fields-container {
|
|
1763
|
+
padding: 0 16px;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
.block-editor-content-only-controls__fields-header {
|
|
1767
|
+
padding: 8px 0;
|
|
1768
|
+
margin-bottom: 4px;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1758
1771
|
.block-editor-date-format-picker {
|
|
1759
1772
|
margin: 0 0 16px;
|
|
1760
1773
|
padding: 0;
|
|
@@ -1788,10 +1801,6 @@ block-editor-content-only-controls__media-thumbnail {
|
|
|
1788
1801
|
text-transform: capitalize;
|
|
1789
1802
|
}
|
|
1790
1803
|
|
|
1791
|
-
.block-editor-font-family-control:not(.is-next-has-no-margin-bottom) {
|
|
1792
|
-
margin-bottom: 8px;
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
1804
|
.block-editor-global-styles__toggle-icon {
|
|
1796
1805
|
fill: currentColor;
|
|
1797
1806
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.9.1-next.8b30e05b0.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -55,41 +55,42 @@
|
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
56
56
|
"@emotion/styled": "^11.6.0",
|
|
57
57
|
"@react-spring/web": "^9.4.5",
|
|
58
|
-
"@wordpress/a11y": "^4.
|
|
59
|
-
"@wordpress/api-fetch": "^7.
|
|
60
|
-
"@wordpress/base-styles": "^6.
|
|
61
|
-
"@wordpress/blob": "^4.
|
|
62
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
63
|
-
"@wordpress/blocks": "^15.
|
|
64
|
-
"@wordpress/commands": "^1.
|
|
65
|
-
"@wordpress/components": "^30.
|
|
66
|
-
"@wordpress/compose": "^7.
|
|
67
|
-
"@wordpress/data": "^10.
|
|
68
|
-
"@wordpress/
|
|
69
|
-
"@wordpress/
|
|
70
|
-
"@wordpress/
|
|
71
|
-
"@wordpress/
|
|
72
|
-
"@wordpress/
|
|
73
|
-
"@wordpress/
|
|
74
|
-
"@wordpress/
|
|
75
|
-
"@wordpress/
|
|
76
|
-
"@wordpress/
|
|
77
|
-
"@wordpress/
|
|
78
|
-
"@wordpress/
|
|
79
|
-
"@wordpress/
|
|
80
|
-
"@wordpress/
|
|
81
|
-
"@wordpress/
|
|
82
|
-
"@wordpress/
|
|
83
|
-
"@wordpress/
|
|
84
|
-
"@wordpress/
|
|
85
|
-
"@wordpress/
|
|
86
|
-
"@wordpress/
|
|
87
|
-
"@wordpress/
|
|
88
|
-
"@wordpress/
|
|
89
|
-
"@wordpress/
|
|
90
|
-
"@wordpress/
|
|
91
|
-
"@wordpress/
|
|
92
|
-
"@wordpress/
|
|
58
|
+
"@wordpress/a11y": "^4.36.1-next.8b30e05b0.0",
|
|
59
|
+
"@wordpress/api-fetch": "^7.36.1-next.8b30e05b0.0",
|
|
60
|
+
"@wordpress/base-styles": "^6.12.1-next.8b30e05b0.0",
|
|
61
|
+
"@wordpress/blob": "^4.36.1-next.8b30e05b0.0",
|
|
62
|
+
"@wordpress/block-serialization-default-parser": "^5.36.1-next.8b30e05b0.0",
|
|
63
|
+
"@wordpress/blocks": "^15.9.1-next.8b30e05b0.0",
|
|
64
|
+
"@wordpress/commands": "^1.36.1-next.8b30e05b0.0",
|
|
65
|
+
"@wordpress/components": "^30.9.1-next.8b30e05b0.0",
|
|
66
|
+
"@wordpress/compose": "^7.36.1-next.8b30e05b0.0",
|
|
67
|
+
"@wordpress/data": "^10.36.1-next.8b30e05b0.0",
|
|
68
|
+
"@wordpress/dataviews": "^11.0.1-next.8b30e05b0.0",
|
|
69
|
+
"@wordpress/date": "^5.36.1-next.8b30e05b0.0",
|
|
70
|
+
"@wordpress/deprecated": "^4.36.1-next.8b30e05b0.0",
|
|
71
|
+
"@wordpress/dom": "^4.36.1-next.8b30e05b0.0",
|
|
72
|
+
"@wordpress/element": "^6.36.1-next.8b30e05b0.0",
|
|
73
|
+
"@wordpress/escape-html": "^3.36.1-next.8b30e05b0.0",
|
|
74
|
+
"@wordpress/global-styles-engine": "^1.3.1-next.8b30e05b0.0",
|
|
75
|
+
"@wordpress/hooks": "^4.36.1-next.8b30e05b0.0",
|
|
76
|
+
"@wordpress/html-entities": "^4.36.1-next.8b30e05b0.0",
|
|
77
|
+
"@wordpress/i18n": "^6.9.1-next.8b30e05b0.0",
|
|
78
|
+
"@wordpress/icons": "^11.3.1-next.8b30e05b0.0",
|
|
79
|
+
"@wordpress/interactivity": "^6.36.1-next.8b30e05b0.0",
|
|
80
|
+
"@wordpress/is-shallow-equal": "^5.36.1-next.8b30e05b0.0",
|
|
81
|
+
"@wordpress/keyboard-shortcuts": "^5.36.1-next.8b30e05b0.0",
|
|
82
|
+
"@wordpress/keycodes": "^4.36.1-next.8b30e05b0.0",
|
|
83
|
+
"@wordpress/notices": "^5.36.1-next.8b30e05b0.0",
|
|
84
|
+
"@wordpress/preferences": "^4.36.1-next.8b30e05b0.0",
|
|
85
|
+
"@wordpress/priority-queue": "^3.36.1-next.8b30e05b0.0",
|
|
86
|
+
"@wordpress/private-apis": "^1.36.1-next.8b30e05b0.0",
|
|
87
|
+
"@wordpress/rich-text": "^7.36.1-next.8b30e05b0.0",
|
|
88
|
+
"@wordpress/style-engine": "^2.36.1-next.8b30e05b0.0",
|
|
89
|
+
"@wordpress/token-list": "^3.36.1-next.8b30e05b0.0",
|
|
90
|
+
"@wordpress/upload-media": "^0.21.1-next.8b30e05b0.0",
|
|
91
|
+
"@wordpress/url": "^4.36.1-next.8b30e05b0.0",
|
|
92
|
+
"@wordpress/warning": "^3.36.1-next.8b30e05b0.0",
|
|
93
|
+
"@wordpress/wordcount": "^4.36.1-next.8b30e05b0.0",
|
|
93
94
|
"change-case": "^4.1.2",
|
|
94
95
|
"clsx": "^2.1.1",
|
|
95
96
|
"colord": "^2.7.0",
|
|
@@ -112,5 +113,5 @@
|
|
|
112
113
|
"publishConfig": {
|
|
113
114
|
"access": "public"
|
|
114
115
|
},
|
|
115
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "2466f6bc223f8be98c55e1ac7270e8c3e413eaaf"
|
|
116
117
|
}
|
|
@@ -222,6 +222,11 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
222
222
|
cursor: grab;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
// Dragging multi selected blocks is not supported yet.
|
|
226
|
+
&.is-multi-selected {
|
|
227
|
+
cursor: default;
|
|
228
|
+
}
|
|
229
|
+
|
|
225
230
|
&[contenteditable],
|
|
226
231
|
[contenteditable] {
|
|
227
232
|
cursor: text;
|
|
@@ -226,6 +226,8 @@ function Items( {
|
|
|
226
226
|
rootClientId === selectedBlockClientId
|
|
227
227
|
);
|
|
228
228
|
|
|
229
|
+
const templateLock = getTemplateLock( rootClientId );
|
|
230
|
+
|
|
229
231
|
return {
|
|
230
232
|
order: _order,
|
|
231
233
|
selectedBlocks: selectedBlockClientIds,
|
|
@@ -238,7 +240,7 @@ function Items( {
|
|
|
238
240
|
rootClientId
|
|
239
241
|
) ) &&
|
|
240
242
|
getBlockEditingMode( rootClientId ) !== 'disabled' &&
|
|
241
|
-
!
|
|
243
|
+
( ! templateLock || templateLock === 'contentOnly' ) &&
|
|
242
244
|
hasAppender &&
|
|
243
245
|
! _isZoomOut() &&
|
|
244
246
|
( hasCustomAppender ||
|
|
@@ -25,15 +25,20 @@ function isColorTransparent( color ) {
|
|
|
25
25
|
* @param {string} clientId Block client ID.
|
|
26
26
|
*/
|
|
27
27
|
export function useEventHandlers( { clientId, isSelected } ) {
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const {
|
|
29
|
+
getBlockRootClientId,
|
|
30
|
+
isZoomOut,
|
|
31
|
+
hasMultiSelection,
|
|
32
|
+
isSectionBlock,
|
|
33
|
+
editedContentOnlySection,
|
|
34
|
+
} = unlock( useSelect( blockEditorStore ) );
|
|
31
35
|
const {
|
|
32
36
|
insertAfterBlock,
|
|
33
37
|
removeBlock,
|
|
34
38
|
resetZoomLevel,
|
|
35
39
|
startDraggingBlocks,
|
|
36
40
|
stopDraggingBlocks,
|
|
41
|
+
editContentOnlySection,
|
|
37
42
|
} = unlock( useDispatch( blockEditorStore ) );
|
|
38
43
|
|
|
39
44
|
return useRefEffect(
|
|
@@ -282,9 +287,32 @@ export function useEventHandlers( { clientId, isSelected } ) {
|
|
|
282
287
|
node.addEventListener( 'keydown', onKeyDown );
|
|
283
288
|
node.addEventListener( 'dragstart', onDragStart );
|
|
284
289
|
|
|
290
|
+
/**
|
|
291
|
+
* Handles double-click events on section blocks to edit content only section.
|
|
292
|
+
*
|
|
293
|
+
* @param {MouseEvent} event Double-click event.
|
|
294
|
+
*/
|
|
295
|
+
function onDoubleClick( event ) {
|
|
296
|
+
const isSection = isSectionBlock( clientId );
|
|
297
|
+
const isAlreadyEditing = editedContentOnlySection === clientId;
|
|
298
|
+
|
|
299
|
+
if ( isSection && ! isAlreadyEditing ) {
|
|
300
|
+
event.preventDefault();
|
|
301
|
+
editContentOnlySection( clientId );
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// Only add double-click listener if experimental flag is enabled
|
|
306
|
+
if ( window?.__experimentalContentOnlyPatternInsertion ) {
|
|
307
|
+
node.addEventListener( 'dblclick', onDoubleClick );
|
|
308
|
+
}
|
|
309
|
+
|
|
285
310
|
return () => {
|
|
286
311
|
node.removeEventListener( 'keydown', onKeyDown );
|
|
287
312
|
node.removeEventListener( 'dragstart', onDragStart );
|
|
313
|
+
if ( window?.__experimentalContentOnlyPatternInsertion ) {
|
|
314
|
+
node.removeEventListener( 'dblclick', onDoubleClick );
|
|
315
|
+
}
|
|
288
316
|
};
|
|
289
317
|
},
|
|
290
318
|
[
|
|
@@ -298,6 +326,9 @@ export function useEventHandlers( { clientId, isSelected } ) {
|
|
|
298
326
|
hasMultiSelection,
|
|
299
327
|
startDraggingBlocks,
|
|
300
328
|
stopDraggingBlocks,
|
|
329
|
+
isSectionBlock,
|
|
330
|
+
editedContentOnlySection,
|
|
331
|
+
editContentOnlySection,
|
|
301
332
|
]
|
|
302
333
|
);
|
|
303
334
|
}
|
|
@@ -42,7 +42,8 @@ function getTemplateLockValue( lock ) {
|
|
|
42
42
|
|
|
43
43
|
export default function BlockLockModal( { clientId, onClose } ) {
|
|
44
44
|
const [ lock, setLock ] = useState( { move: false, remove: false } );
|
|
45
|
-
const {
|
|
45
|
+
const { isEditLocked, isMoveLocked, isRemoveLocked } =
|
|
46
|
+
useBlockLock( clientId );
|
|
46
47
|
const { allowsEditLocking, templateLock, hasTemplateLock } = useSelect(
|
|
47
48
|
( select ) => {
|
|
48
49
|
const { getBlockName, getBlockAttributes } =
|
|
@@ -66,11 +67,11 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
66
67
|
|
|
67
68
|
useEffect( () => {
|
|
68
69
|
setLock( {
|
|
69
|
-
move:
|
|
70
|
-
remove:
|
|
71
|
-
...( allowsEditLocking ? { edit:
|
|
70
|
+
move: isMoveLocked,
|
|
71
|
+
remove: isRemoveLocked,
|
|
72
|
+
...( allowsEditLocking ? { edit: isEditLocked } : {} ),
|
|
72
73
|
} );
|
|
73
|
-
}, [
|
|
74
|
+
}, [ isEditLocked, isMoveLocked, isRemoveLocked, allowsEditLocking ] );
|
|
74
75
|
|
|
75
76
|
const isAllChecked = Object.values( lock ).every( Boolean );
|
|
76
77
|
const isMixed = Object.values( lock ).some( Boolean ) && ! isAllChecked;
|
|
@@ -7,6 +7,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { store as blockEditorStore } from '../../store';
|
|
10
|
+
import { unlock } from '../../lock-unlock';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Return details about the block lock status.
|
|
@@ -19,25 +20,20 @@ export default function useBlockLock( clientId ) {
|
|
|
19
20
|
return useSelect(
|
|
20
21
|
( select ) => {
|
|
21
22
|
const {
|
|
22
|
-
canEditBlock,
|
|
23
|
-
canMoveBlock,
|
|
24
|
-
canRemoveBlock,
|
|
25
23
|
canLockBlockType,
|
|
26
24
|
getBlockName,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const canRemove = canRemoveBlock( clientId );
|
|
25
|
+
isEditLockedBlock,
|
|
26
|
+
isMoveLockedBlock,
|
|
27
|
+
isRemoveLockedBlock,
|
|
28
|
+
isLockedBlock,
|
|
29
|
+
} = unlock( select( blockEditorStore ) );
|
|
33
30
|
|
|
34
31
|
return {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
isEditLocked: isEditLockedBlock( clientId ),
|
|
33
|
+
isMoveLocked: isMoveLockedBlock( clientId ),
|
|
34
|
+
isRemoveLocked: isRemoveLockedBlock( clientId ),
|
|
38
35
|
canLock: canLockBlockType( getBlockName( clientId ) ),
|
|
39
|
-
|
|
40
|
-
isLocked: ! canEdit || ! canMove || ! canRemove,
|
|
36
|
+
isLocked: isLockedBlock( clientId ),
|
|
41
37
|
};
|
|
42
38
|
},
|
|
43
39
|
[ clientId ]
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import blockLibraryStyles from '!!raw-loader!../../../../../block-library/build-style/style.css';
|
|
5
|
+
import { fn } from '@storybook/test';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -32,6 +33,8 @@ export const Default = {
|
|
|
32
33
|
isDraggable: false,
|
|
33
34
|
label: 'Block patterns story',
|
|
34
35
|
showTitlesAsTooltip: false,
|
|
36
|
+
onClickPattern: fn(),
|
|
37
|
+
onHover: fn(),
|
|
35
38
|
},
|
|
36
39
|
argTypes: {
|
|
37
40
|
blockPatterns: { description: 'The patterns to render.' },
|
|
@@ -58,7 +61,6 @@ export const Default = {
|
|
|
58
61
|
},
|
|
59
62
|
},
|
|
60
63
|
parameters: {
|
|
61
|
-
actions: { argTypesRegex: '^on.*' },
|
|
62
64
|
controls: { expanded: true },
|
|
63
65
|
},
|
|
64
66
|
};
|
|
@@ -50,7 +50,7 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
|
|
|
50
50
|
canToggleSelectedBlocksVisibility: getBlocksByClientId(
|
|
51
51
|
ids
|
|
52
52
|
).every( ( block ) =>
|
|
53
|
-
hasBlockSupport( block.name, '
|
|
53
|
+
hasBlockSupport( block.name, 'visibility', true )
|
|
54
54
|
),
|
|
55
55
|
};
|
|
56
56
|
},
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -219,7 +224,7 @@ export default function BlockTools( {
|
|
|
219
224
|
const canToggleBlockVisibility = blocks.every( ( block ) =>
|
|
220
225
|
hasBlockSupport(
|
|
221
226
|
getBlockName( block.clientId ),
|
|
222
|
-
'
|
|
227
|
+
'visibility',
|
|
223
228
|
true
|
|
224
229
|
)
|
|
225
230
|
);
|
|
@@ -262,7 +267,15 @@ export default function BlockTools( {
|
|
|
262
267
|
|
|
263
268
|
return (
|
|
264
269
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
265
|
-
<div
|
|
270
|
+
<div
|
|
271
|
+
{ ...props }
|
|
272
|
+
onKeyDown={ onKeyDown }
|
|
273
|
+
// Popover slots cannot be unmounted during dragging because the
|
|
274
|
+
// will just be rendered in a fallback popover slot instead.
|
|
275
|
+
className={ clsx( props.className, {
|
|
276
|
+
'block-editor-block-tools--is-dragging': isDragging,
|
|
277
|
+
} ) }
|
|
278
|
+
>
|
|
266
279
|
<InsertionPointOpenRef.Provider value={ useRef( false ) }>
|
|
267
280
|
{ ! isTyping && ! isZoomOutMode && (
|
|
268
281
|
<InsertionPoint
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
|
|
5
|
+
import { moreVertical, check } from '@wordpress/icons';
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { useInspectorPopoverPlacement } from './use-inspector-popover-placement';
|
|
12
|
+
|
|
13
|
+
export default function FieldsDropdownMenu( {
|
|
14
|
+
fields,
|
|
15
|
+
visibleFields,
|
|
16
|
+
onToggleField,
|
|
17
|
+
} ) {
|
|
18
|
+
const { popoverProps } = useInspectorPopoverPlacement();
|
|
19
|
+
|
|
20
|
+
if ( ! fields || fields.length === 0 ) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<DropdownMenu
|
|
26
|
+
icon={ moreVertical }
|
|
27
|
+
label={ __( 'Options' ) }
|
|
28
|
+
popoverProps={ popoverProps }
|
|
29
|
+
>
|
|
30
|
+
{ ( { onClose } ) => (
|
|
31
|
+
<MenuGroup label={ __( 'Show / Hide' ) }>
|
|
32
|
+
{ fields.map( ( field ) => {
|
|
33
|
+
const isVisible = visibleFields.includes( field.id );
|
|
34
|
+
return (
|
|
35
|
+
<MenuItem
|
|
36
|
+
key={ field.id }
|
|
37
|
+
isSelected={ isVisible }
|
|
38
|
+
onClick={ () => {
|
|
39
|
+
onToggleField( field.id );
|
|
40
|
+
onClose();
|
|
41
|
+
} }
|
|
42
|
+
role="menuitemcheckbox"
|
|
43
|
+
icon={ isVisible ? check : null }
|
|
44
|
+
>
|
|
45
|
+
{ field.label }
|
|
46
|
+
</MenuItem>
|
|
47
|
+
);
|
|
48
|
+
} ) }
|
|
49
|
+
</MenuGroup>
|
|
50
|
+
) }
|
|
51
|
+
</DropdownMenu>
|
|
52
|
+
);
|
|
53
|
+
}
|