@wordpress/block-editor 12.17.0 → 12.18.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 +4 -0
- package/README.md +32 -0
- package/build/components/block-draggable/index.js +11 -3
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-edit/context.js +3 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +4 -2
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +6 -3
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-inspector/index.js +5 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +4 -3
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +9 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +30 -4
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/private-block-context.js +1 -1
- package/build/components/block-list/private-block-context.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/toolbar.js +8 -2
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-popover/inbetween.js +15 -3
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-preview/auto.js +1 -1
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +3 -2
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +2 -4
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +12 -1
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/index.js +119 -90
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +10 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +7 -1
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +5 -14
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +7 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +3 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +31 -14
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +99 -0
- package/build/components/iframe/get-compatibility-styles.js.map +1 -0
- package/build/components/iframe/index.js +2 -3
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.js +16 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +16 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +2 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +3 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/link-control/link-preview.js +30 -26
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -9
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block-contents.js +3 -1
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block.js +10 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +29 -8
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +100 -32
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +52 -4
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +2 -2
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-list-view-block-indexes.js +30 -0
- package/build/components/list-view/use-list-view-block-indexes.js.map +1 -0
- package/build/components/list-view/use-list-view-drop-zone.js +56 -5
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +92 -0
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +21 -0
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/rich-text/index.js +30 -6
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +9 -9
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +30 -7
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +50 -8
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/hooks/block-hooks.js +5 -14
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/content-lock-ui.js +17 -42
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/effects.js +66 -0
- package/build/hooks/effects.js.map +1 -0
- package/build/hooks/index.js +15 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +13 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/style.js +6 -2
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +2 -1
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.native.js +2 -2
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +115 -0
- package/build/hooks/use-bindings-attributes.js.map +1 -0
- package/build/hooks/use-shadow-props.js +46 -0
- package/build/hooks/use-shadow-props.js.map +1 -0
- package/build/hooks/utils.js +11 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +14 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +10 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +2 -0
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +37 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +60 -9
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +44 -3
- package/build/store/reducer.js.map +1 -1
- package/build/store/resolvers.js +27 -0
- package/build/store/resolvers.js.map +1 -0
- package/build/store/selectors.js +94 -56
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -26
- package/build/store/utils.js.map +1 -1
- package/build/utils/index.js +0 -16
- package/build/utils/index.js.map +1 -1
- package/build/utils/math.js +13 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +17 -0
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +37 -27
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +11 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-edit/context.js +1 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +5 -3
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +7 -4
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +5 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +6 -5
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +11 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +31 -5
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/private-block-context.js +1 -1
- package/build-module/components/block-list/private-block-context.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +8 -2
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +15 -3
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-preview/auto.js +3 -3
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -2
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -4
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +12 -1
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/index.js +116 -86
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +10 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +7 -1
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +5 -14
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +7 -1
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +3 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +32 -15
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +93 -0
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -0
- package/build-module/components/iframe/index.js +2 -3
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +2 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +3 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +32 -28
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -8
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +3 -1
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block.js +10 -1
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +30 -9
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +99 -32
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +54 -6
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -2
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-list-view-block-indexes.js +23 -0
- package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -0
- package/build-module/components/list-view/use-list-view-drop-zone.js +58 -7
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +91 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +17 -0
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +30 -6
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +9 -9
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +31 -8
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +51 -9
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/hooks/block-hooks.js +5 -14
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +19 -43
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/effects.js +51 -0
- package/build-module/hooks/effects.js.map +1 -0
- package/build-module/hooks/index.js +3 -2
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/style.js +6 -2
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +2 -1
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.native.js +2 -2
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +112 -0
- package/build-module/hooks/use-bindings-attributes.js.map +1 -0
- package/build-module/hooks/use-shadow-props.js +39 -0
- package/build-module/hooks/use-shadow-props.js.map +1 -0
- package/build-module/hooks/utils.js +13 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +10 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +2 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +35 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +53 -8
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +43 -3
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/resolvers.js +20 -0
- package/build-module/store/resolvers.js.map +1 -0
- package/build-module/store/selectors.js +89 -52
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -23
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/index.js +0 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/math.js +12 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/object.js +16 -0
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +36 -27
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +33 -16
- package/build-style/content.css +33 -16
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +169 -114
- package/build-style/style.css +169 -114
- package/package.json +31 -31
- package/src/components/block-canvas/style.scss +8 -1
- package/src/components/block-draggable/index.js +16 -5
- package/src/components/block-edit/context.js +1 -0
- package/src/components/block-edit/index.js +4 -0
- package/src/components/block-editing-mode/index.js +12 -7
- package/src/components/block-inspector/index.js +5 -2
- package/src/components/block-list/block.js +5 -4
- package/src/components/block-list/block.native.js +13 -3
- package/src/components/block-list/content.scss +34 -5
- package/src/components/block-list/index.js +52 -16
- package/src/components/block-list/private-block-context.js +1 -1
- package/src/components/block-list/use-in-between-inserter.js +1 -2
- package/src/components/block-lock/toolbar.js +10 -2
- package/src/components/block-popover/inbetween.js +22 -2
- package/src/components/block-preview/auto.js +3 -3
- package/src/components/block-removal-warning-modal/index.js +3 -2
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -7
- package/src/components/block-switcher/block-transformations-menu.js +18 -1
- package/src/components/block-switcher/index.js +133 -111
- package/src/components/block-switcher/style.scss +6 -4
- package/src/components/block-switcher/test/index.js +113 -230
- package/src/components/block-toolbar/style.scss +22 -18
- package/src/components/block-tools/insertion-point.js +15 -2
- package/src/components/block-tools/style.scss +8 -7
- package/src/components/font-sizes/fluid-utils.js +8 -2
- package/src/components/font-sizes/test/fluid-utils.js +9 -0
- package/src/components/global-styles/border-panel.js +7 -17
- package/src/components/global-styles/effects-panel.js +16 -1
- package/src/components/global-styles/hooks.js +2 -0
- package/src/components/global-styles/typography-panel.js +45 -13
- package/src/components/iframe/get-compatibility-styles.js +120 -0
- package/src/components/iframe/index.js +2 -3
- package/src/components/index.js +4 -2
- package/src/components/index.native.js +4 -2
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -0
- package/src/components/link-control/link-preview.js +31 -55
- package/src/components/link-control/search-input.js +1 -9
- package/src/components/link-control/style.scss +31 -85
- package/src/components/link-control/test/index.js +2 -1
- package/src/components/list-view/block-contents.js +5 -1
- package/src/components/list-view/block.js +9 -0
- package/src/components/list-view/branch.js +30 -10
- package/src/components/list-view/drop-indicator.js +139 -46
- package/src/components/list-view/index.js +74 -3
- package/src/components/list-view/leaf.js +2 -2
- package/src/components/list-view/style.scss +102 -13
- package/src/components/list-view/test/use-list-view-drop-zone.js +4 -0
- package/src/components/list-view/test/utils.js +218 -1
- package/src/components/list-view/use-list-view-block-indexes.js +29 -0
- package/src/components/list-view/use-list-view-drop-zone.js +78 -6
- package/src/components/list-view/utils.js +116 -0
- package/src/components/provider/index.js +3 -1
- package/src/components/recursion-provider/README.md +2 -2
- package/src/components/recursion-provider/index.js +17 -0
- package/src/components/rich-text/index.js +48 -10
- package/src/components/rich-text/native/index.native.js +10 -10
- package/src/components/use-block-drop-zone/index.js +60 -19
- package/src/components/use-block-drop-zone/test/index.js +32 -61
- package/src/components/use-on-block-drop/index.js +92 -11
- package/src/hooks/block-hooks.js +5 -17
- package/src/hooks/content-lock-ui.js +15 -55
- package/src/hooks/effects.js +57 -0
- package/src/hooks/index.js +2 -2
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/style.js +8 -0
- package/src/hooks/supports.js +2 -0
- package/src/hooks/test/effects.js +39 -0
- package/src/hooks/typography.native.js +2 -2
- package/src/hooks/use-bindings-attributes.js +148 -0
- package/src/hooks/use-shadow-props.js +37 -0
- package/src/hooks/utils.js +26 -10
- package/src/index.js +2 -0
- package/src/store/actions.js +9 -4
- package/src/store/index.js +2 -0
- package/src/store/private-actions.js +32 -0
- package/src/store/private-selectors.js +78 -21
- package/src/store/reducer.js +49 -2
- package/src/store/resolvers.js +17 -0
- package/src/store/selectors.js +169 -161
- package/src/store/test/registry-selectors.js +431 -0
- package/src/store/test/selectors.js +14 -400
- package/src/store/utils.js +10 -33
- package/src/style.scss +0 -1
- package/src/utils/index.js +0 -1
- package/src/utils/math.js +12 -0
- package/src/utils/object.js +16 -0
- package/src/utils/transform-styles/index.js +52 -37
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/iframe/use-compatibility-styles.js +0 -100
- package/build/components/iframe/use-compatibility-styles.js.map +0 -1
- package/build/hooks/custom-fields.js +0 -106
- package/build/hooks/custom-fields.js.map +0 -1
- package/build/utils/block-variation-transforms.js +0 -42
- package/build/utils/block-variation-transforms.js.map +0 -1
- package/build-module/components/iframe/use-compatibility-styles.js +0 -94
- package/build-module/components/iframe/use-compatibility-styles.js.map +0 -1
- package/build-module/hooks/custom-fields.js +0 -99
- package/build-module/hooks/custom-fields.js.map +0 -1
- package/build-module/utils/block-variation-transforms.js +0 -35
- package/build-module/utils/block-variation-transforms.js.map +0 -1
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +0 -116
- package/src/components/contrast-checker/style.scss +0 -3
- package/src/components/iframe/use-compatibility-styles.js +0 -122
- package/src/hooks/custom-fields.js +0 -115
- package/src/utils/block-variation-transforms.js +0 -38
- package/src/utils/test/block-variation-transforms.js +0 -94
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
useBlockEditContext,
|
|
14
14
|
mayDisplayControlsKey,
|
|
15
15
|
mayDisplayParentControlsKey,
|
|
16
|
+
blockEditingModeKey,
|
|
16
17
|
} from './context';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -28,6 +29,7 @@ export { useBlockEditContext };
|
|
|
28
29
|
export default function BlockEdit( {
|
|
29
30
|
mayDisplayControls,
|
|
30
31
|
mayDisplayParentControls,
|
|
32
|
+
blockEditingMode,
|
|
31
33
|
// The remaining props are passed through the BlockEdit filters and are thus
|
|
32
34
|
// public API!
|
|
33
35
|
...props
|
|
@@ -59,6 +61,7 @@ export default function BlockEdit( {
|
|
|
59
61
|
// usage outside of the package (this context is exposed).
|
|
60
62
|
[ mayDisplayControlsKey ]: mayDisplayControls,
|
|
61
63
|
[ mayDisplayParentControlsKey ]: mayDisplayParentControls,
|
|
64
|
+
[ blockEditingModeKey ]: blockEditingMode,
|
|
62
65
|
} ),
|
|
63
66
|
[
|
|
64
67
|
name,
|
|
@@ -69,6 +72,7 @@ export default function BlockEdit( {
|
|
|
69
72
|
__unstableLayoutClassNames,
|
|
70
73
|
mayDisplayControls,
|
|
71
74
|
mayDisplayParentControls,
|
|
75
|
+
blockEditingMode,
|
|
72
76
|
]
|
|
73
77
|
) }
|
|
74
78
|
>
|
|
@@ -8,7 +8,10 @@ import { useEffect } from '@wordpress/element';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { store as blockEditorStore } from '../../store';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useBlockEditContext,
|
|
13
|
+
blockEditingModeKey,
|
|
14
|
+
} from '../block-edit/context';
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* @typedef {'disabled'|'contentOnly'|'default'} BlockEditingMode
|
|
@@ -45,14 +48,16 @@ import { useBlockEditContext } from '../block-edit/context';
|
|
|
45
48
|
* @return {BlockEditingMode} The current editing mode.
|
|
46
49
|
*/
|
|
47
50
|
export function useBlockEditingMode( mode ) {
|
|
48
|
-
const
|
|
49
|
-
const
|
|
51
|
+
const context = useBlockEditContext();
|
|
52
|
+
const { clientId = '' } = context;
|
|
53
|
+
const { setBlockEditingMode, unsetBlockEditingMode } =
|
|
54
|
+
useDispatch( blockEditorStore );
|
|
55
|
+
const globalBlockEditingMode = useSelect(
|
|
50
56
|
( select ) =>
|
|
51
|
-
|
|
57
|
+
// Avoid adding the subscription if not needed!
|
|
58
|
+
clientId ? null : select( blockEditorStore ).getBlockEditingMode(),
|
|
52
59
|
[ clientId ]
|
|
53
60
|
);
|
|
54
|
-
const { setBlockEditingMode, unsetBlockEditingMode } =
|
|
55
|
-
useDispatch( blockEditorStore );
|
|
56
61
|
useEffect( () => {
|
|
57
62
|
if ( mode ) {
|
|
58
63
|
setBlockEditingMode( clientId, mode );
|
|
@@ -63,5 +68,5 @@ export function useBlockEditingMode( mode ) {
|
|
|
63
68
|
}
|
|
64
69
|
};
|
|
65
70
|
}, [ clientId, mode, setBlockEditingMode, unsetBlockEditingMode ] );
|
|
66
|
-
return
|
|
71
|
+
return clientId ? context[ blockEditingModeKey ] : globalBlockEditingMode;
|
|
67
72
|
}
|
|
@@ -93,8 +93,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
|
|
|
93
93
|
topLevelLockedBlock:
|
|
94
94
|
__unstableGetContentLockingParent( _selectedBlockClientId ) ||
|
|
95
95
|
( getTemplateLock( _selectedBlockClientId ) === 'contentOnly' ||
|
|
96
|
-
|
|
97
|
-
window.__experimentalPatternPartialSyncing )
|
|
96
|
+
_selectedBlockName === 'core/block'
|
|
98
97
|
? _selectedBlockClientId
|
|
99
98
|
: undefined ),
|
|
100
99
|
};
|
|
@@ -307,6 +306,10 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
|
|
|
307
306
|
label={ __( 'Background' ) }
|
|
308
307
|
/>
|
|
309
308
|
<PositionControls />
|
|
309
|
+
<InspectorControls.Slot
|
|
310
|
+
group="effects"
|
|
311
|
+
label={ __( 'Effects' ) }
|
|
312
|
+
/>
|
|
310
313
|
<div>
|
|
311
314
|
<AdvancedControls />
|
|
312
315
|
</div>
|
|
@@ -6,7 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { useCallback, RawHTML, useContext } from '@wordpress/element';
|
|
9
|
+
import { memo, useCallback, RawHTML, useContext } from '@wordpress/element';
|
|
10
10
|
import {
|
|
11
11
|
getBlockType,
|
|
12
12
|
getSaveContent,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from '@wordpress/blocks';
|
|
22
22
|
import { withFilters } from '@wordpress/components';
|
|
23
23
|
import { withDispatch, useDispatch, useSelect } from '@wordpress/data';
|
|
24
|
-
import { compose
|
|
24
|
+
import { compose } from '@wordpress/compose';
|
|
25
25
|
import { safeHTML } from '@wordpress/dom';
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -133,6 +133,7 @@ function BlockListBlock( {
|
|
|
133
133
|
}
|
|
134
134
|
mayDisplayControls={ mayDisplayControls }
|
|
135
135
|
mayDisplayParentControls={ mayDisplayParentControls }
|
|
136
|
+
blockEditingMode={ context.blockEditingMode }
|
|
136
137
|
/>
|
|
137
138
|
);
|
|
138
139
|
|
|
@@ -482,7 +483,7 @@ BlockListBlock = compose(
|
|
|
482
483
|
)( BlockListBlock );
|
|
483
484
|
|
|
484
485
|
// This component provides all the information we need through a single store
|
|
485
|
-
// subscription (useSelect mapping). Only the
|
|
486
|
+
// subscription (useSelect mapping). Only the necessary props are passed down
|
|
486
487
|
// to the BlockListBlock component, which is a filtered component, so these
|
|
487
488
|
// props are public API. To avoid adding to the public API, we use a private
|
|
488
489
|
// context to pass the rest of the information to the filtered BlockListBlock
|
|
@@ -738,4 +739,4 @@ function BlockListBlockProvider( props ) {
|
|
|
738
739
|
);
|
|
739
740
|
}
|
|
740
741
|
|
|
741
|
-
export default
|
|
742
|
+
export default memo( BlockListBlockProvider );
|
|
@@ -7,7 +7,13 @@ import classnames from 'classnames';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
useCallback,
|
|
12
|
+
useMemo,
|
|
13
|
+
useState,
|
|
14
|
+
useRef,
|
|
15
|
+
memo,
|
|
16
|
+
} from '@wordpress/element';
|
|
11
17
|
import {
|
|
12
18
|
GlobalStylesContext,
|
|
13
19
|
getMergedGlobalStyles,
|
|
@@ -29,7 +35,7 @@ import {
|
|
|
29
35
|
withDispatch,
|
|
30
36
|
withSelect,
|
|
31
37
|
} from '@wordpress/data';
|
|
32
|
-
import { compose, ifCondition
|
|
38
|
+
import { compose, ifCondition } from '@wordpress/compose';
|
|
33
39
|
|
|
34
40
|
/**
|
|
35
41
|
* Internal dependencies
|
|
@@ -183,6 +189,7 @@ function BlockListBlock( {
|
|
|
183
189
|
isParentSelected,
|
|
184
190
|
order,
|
|
185
191
|
mayDisplayControls,
|
|
192
|
+
blockEditingMode,
|
|
186
193
|
} = useSelect(
|
|
187
194
|
( select ) => {
|
|
188
195
|
const {
|
|
@@ -196,6 +203,7 @@ function BlockListBlock( {
|
|
|
196
203
|
getBlockName,
|
|
197
204
|
isFirstMultiSelectedBlock,
|
|
198
205
|
getMultiSelectedBlockClientIds,
|
|
206
|
+
getBlockEditingMode,
|
|
199
207
|
} = select( blockEditorStore );
|
|
200
208
|
const currentBlockType = getBlockType( name || 'core/missing' );
|
|
201
209
|
const currentBlockCategory = currentBlockType?.category;
|
|
@@ -249,6 +257,7 @@ function BlockListBlock( {
|
|
|
249
257
|
getMultiSelectedBlockClientIds().every(
|
|
250
258
|
( id ) => getBlockName( id ) === name
|
|
251
259
|
) ),
|
|
260
|
+
blockEditingMode: getBlockEditingMode( clientId ),
|
|
252
261
|
};
|
|
253
262
|
},
|
|
254
263
|
[ clientId, isSelected, name, rootClientId ]
|
|
@@ -393,6 +402,7 @@ function BlockListBlock( {
|
|
|
393
402
|
}
|
|
394
403
|
wrapperProps={ wrapperProps }
|
|
395
404
|
mayDisplayControls={ mayDisplayControls }
|
|
405
|
+
blockEditingMode={ blockEditingMode }
|
|
396
406
|
/>
|
|
397
407
|
<View onLayout={ onLayout } />
|
|
398
408
|
</GlobalStylesContext.Provider>
|
|
@@ -678,7 +688,7 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
678
688
|
} );
|
|
679
689
|
|
|
680
690
|
export default compose(
|
|
681
|
-
|
|
691
|
+
memo,
|
|
682
692
|
applyWithSelect,
|
|
683
693
|
applyWithDispatch,
|
|
684
694
|
// Block is sometimes not mounted at the right time, causing it be undefined
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
/* stylelint-disable */
|
|
27
27
|
_::-webkit-full-page-media, _:future, :root .block-editor-block-list__layout::selection,
|
|
28
28
|
_::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-block-list__layout::selection {
|
|
29
|
-
background-color: transparent;
|
|
29
|
+
background-color: transparent;
|
|
30
30
|
}
|
|
31
31
|
/* stylelint-enable */
|
|
32
32
|
|
|
@@ -89,7 +89,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
|
|
|
89
89
|
.block-editor-block-list__block.is-highlighted,
|
|
90
90
|
.block-editor-block-list__block.is-highlighted ~ .is-multi-selected,
|
|
91
91
|
&.is-navigate-mode .block-editor-block-list__block.is-selected,
|
|
92
|
-
.block-editor-block-list__block:not([contenteditable]):focus {
|
|
92
|
+
.block-editor-block-list__block:not([contenteditable="true"]):focus {
|
|
93
93
|
outline: none;
|
|
94
94
|
|
|
95
95
|
// We're using a pseudo element to overflow placeholder borders
|
|
@@ -199,9 +199,6 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
|
|
|
199
199
|
width: 100%;
|
|
200
200
|
|
|
201
201
|
.components-notice {
|
|
202
|
-
margin-left: 0;
|
|
203
|
-
margin-right: 0;
|
|
204
|
-
|
|
205
202
|
.components-notice__content {
|
|
206
203
|
font-size: $default-font-size;
|
|
207
204
|
}
|
|
@@ -303,6 +300,38 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
|
|
|
303
300
|
}
|
|
304
301
|
}
|
|
305
302
|
|
|
303
|
+
// Indicate which blocks are editable within a locked context.
|
|
304
|
+
// 1. User must be hovering an editor with renderingMode = 'template-lock'; or...
|
|
305
|
+
.is-template-locked:hover,
|
|
306
|
+
// ...a container block.
|
|
307
|
+
.block-editor-block-list__block:hover {
|
|
308
|
+
// 2. Look for locked blocks; or...
|
|
309
|
+
.block-editor-block-list__block.is-editing-disabled,
|
|
310
|
+
// ...container blocks that have locked children.
|
|
311
|
+
&:has(> .block-editor-block-list__block.is-editing-disabled) {
|
|
312
|
+
// 3. Highlight any unlocked children of that locked block.
|
|
313
|
+
& > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected) {
|
|
314
|
+
&::after {
|
|
315
|
+
content: "";
|
|
316
|
+
border-style: dotted;
|
|
317
|
+
position: absolute;
|
|
318
|
+
pointer-events: none;
|
|
319
|
+
top: $border-width;
|
|
320
|
+
left: $border-width;
|
|
321
|
+
right: $border-width;
|
|
322
|
+
bottom: $border-width;
|
|
323
|
+
border: 1px dotted var(--wp-admin-theme-color);
|
|
324
|
+
border-radius: $radius-block-ui - $border-width;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
&.is-hovered::after {
|
|
328
|
+
background: rgba(var(--wp-admin-theme-color--rgb), 0.1);
|
|
329
|
+
border: none;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
306
335
|
// Spotlight mode. Fade out blocks unless they contain a selected block.
|
|
307
336
|
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
|
|
308
337
|
opacity: 0.2;
|
|
@@ -17,7 +17,12 @@ import {
|
|
|
17
17
|
useMergeRefs,
|
|
18
18
|
useDebounce,
|
|
19
19
|
} from '@wordpress/compose';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
createContext,
|
|
22
|
+
useMemo,
|
|
23
|
+
useCallback,
|
|
24
|
+
useEffect,
|
|
25
|
+
} from '@wordpress/element';
|
|
21
26
|
|
|
22
27
|
/**
|
|
23
28
|
* Internal dependencies
|
|
@@ -34,6 +39,7 @@ import {
|
|
|
34
39
|
DEFAULT_BLOCK_EDIT_CONTEXT,
|
|
35
40
|
} from '../block-edit/context';
|
|
36
41
|
import { useTypingObserver } from '../observe-typing';
|
|
42
|
+
import { unlock } from '../../lock-unlock';
|
|
37
43
|
|
|
38
44
|
export const IntersectionObserver = createContext();
|
|
39
45
|
const pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();
|
|
@@ -113,6 +119,27 @@ function Root( { className, ...settings } ) {
|
|
|
113
119
|
);
|
|
114
120
|
}
|
|
115
121
|
|
|
122
|
+
function StopEditingAsBlocksOnOutsideSelect( { clientId } ) {
|
|
123
|
+
const { stopEditingAsBlocks } = unlock( useDispatch( blockEditorStore ) );
|
|
124
|
+
const isBlockOrDescendantSelected = useSelect(
|
|
125
|
+
( select ) => {
|
|
126
|
+
const { isBlockSelected, hasSelectedInnerBlock } =
|
|
127
|
+
select( blockEditorStore );
|
|
128
|
+
return (
|
|
129
|
+
isBlockSelected( clientId ) ||
|
|
130
|
+
hasSelectedInnerBlock( clientId, true )
|
|
131
|
+
);
|
|
132
|
+
},
|
|
133
|
+
[ clientId ]
|
|
134
|
+
);
|
|
135
|
+
useEffect( () => {
|
|
136
|
+
if ( ! isBlockOrDescendantSelected ) {
|
|
137
|
+
stopEditingAsBlocks( clientId );
|
|
138
|
+
}
|
|
139
|
+
}, [ isBlockOrDescendantSelected, clientId, stopEditingAsBlocks ] );
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
|
|
116
143
|
export default function BlockList( settings ) {
|
|
117
144
|
return (
|
|
118
145
|
<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>
|
|
@@ -128,21 +155,25 @@ function Items( {
|
|
|
128
155
|
__experimentalAppenderTagName,
|
|
129
156
|
layout = defaultLayout,
|
|
130
157
|
} ) {
|
|
131
|
-
const { order, selectedBlocks, visibleBlocks } =
|
|
132
|
-
(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
158
|
+
const { order, selectedBlocks, visibleBlocks, temporarilyEditingAsBlocks } =
|
|
159
|
+
useSelect(
|
|
160
|
+
( select ) => {
|
|
161
|
+
const {
|
|
162
|
+
getBlockOrder,
|
|
163
|
+
getSelectedBlockClientIds,
|
|
164
|
+
__unstableGetVisibleBlocks,
|
|
165
|
+
__unstableGetTemporarilyEditingAsBlocks,
|
|
166
|
+
} = select( blockEditorStore );
|
|
167
|
+
return {
|
|
168
|
+
order: getBlockOrder( rootClientId ),
|
|
169
|
+
selectedBlocks: getSelectedBlockClientIds(),
|
|
170
|
+
visibleBlocks: __unstableGetVisibleBlocks(),
|
|
171
|
+
temporarilyEditingAsBlocks:
|
|
172
|
+
__unstableGetTemporarilyEditingAsBlocks(),
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
[ rootClientId ]
|
|
176
|
+
);
|
|
146
177
|
|
|
147
178
|
return (
|
|
148
179
|
<LayoutProvider value={ layout }>
|
|
@@ -163,6 +194,11 @@ function Items( {
|
|
|
163
194
|
</AsyncModeProvider>
|
|
164
195
|
) ) }
|
|
165
196
|
{ order.length < 1 && placeholder }
|
|
197
|
+
{ !! temporarilyEditingAsBlocks && (
|
|
198
|
+
<StopEditingAsBlocksOnOutsideSelect
|
|
199
|
+
clientId={ temporarilyEditingAsBlocks }
|
|
200
|
+
/>
|
|
201
|
+
) }
|
|
166
202
|
<BlockListAppender
|
|
167
203
|
tagName={ __experimentalAppenderTagName }
|
|
168
204
|
rootClientId={ rootClientId }
|
|
@@ -77,8 +77,7 @@ export function useInBetweenInserter() {
|
|
|
77
77
|
if (
|
|
78
78
|
getTemplateLock( rootClientId ) ||
|
|
79
79
|
getBlockEditingMode( rootClientId ) === 'disabled' ||
|
|
80
|
-
|
|
81
|
-
window.__experimentalPatternPartialSyncing )
|
|
80
|
+
getBlockName( rootClientId ) === 'core/block'
|
|
82
81
|
) {
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
@@ -33,16 +33,24 @@ export default function BlockLockToolbar( { clientId } ) {
|
|
|
33
33
|
}
|
|
34
34
|
}, [ isLocked ] );
|
|
35
35
|
|
|
36
|
-
if ( !
|
|
36
|
+
if ( ! isLocked && ! hasLockButtonShown.current ) {
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
let label = isLocked ? __( 'Unlock' ) : __( 'Lock' );
|
|
41
|
+
|
|
42
|
+
if ( ! canLock && isLocked ) {
|
|
43
|
+
label = __( 'Locked' );
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
return (
|
|
41
47
|
<>
|
|
42
48
|
<ToolbarGroup className="block-editor-block-lock-toolbar">
|
|
43
49
|
<ToolbarButton
|
|
50
|
+
accessibleWhenDisabled
|
|
51
|
+
disabled={ ! canLock }
|
|
44
52
|
icon={ isLocked ? lock : unlock }
|
|
45
|
-
label={
|
|
53
|
+
label={ label }
|
|
46
54
|
onClick={ toggleModal }
|
|
47
55
|
aria-expanded={ isModalOpen }
|
|
48
56
|
aria-haspopup="dialog"
|
|
@@ -33,6 +33,8 @@ function BlockPopoverInbetween( {
|
|
|
33
33
|
children,
|
|
34
34
|
__unstablePopoverSlot,
|
|
35
35
|
__unstableContentRef,
|
|
36
|
+
operation = 'insert',
|
|
37
|
+
nearestSide = 'right',
|
|
36
38
|
...props
|
|
37
39
|
} ) {
|
|
38
40
|
// This is a temporary hack to get the inbetween inserter to recompute properly.
|
|
@@ -81,7 +83,10 @@ function BlockPopoverInbetween( {
|
|
|
81
83
|
return undefined;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
|
-
const contextElement =
|
|
86
|
+
const contextElement =
|
|
87
|
+
operation === 'group'
|
|
88
|
+
? nextElement || previousElement
|
|
89
|
+
: previousElement || nextElement;
|
|
85
90
|
|
|
86
91
|
return {
|
|
87
92
|
contextElement,
|
|
@@ -98,7 +103,20 @@ function BlockPopoverInbetween( {
|
|
|
98
103
|
let width = 0;
|
|
99
104
|
let height = 0;
|
|
100
105
|
|
|
101
|
-
if (
|
|
106
|
+
if ( operation === 'group' ) {
|
|
107
|
+
const targetRect = nextRect || previousRect;
|
|
108
|
+
top = targetRect.top;
|
|
109
|
+
// No spacing is likely around blocks in this operation.
|
|
110
|
+
// So width of the inserter containing rect is set to 0.
|
|
111
|
+
width = 0;
|
|
112
|
+
height = targetRect.bottom - targetRect.top;
|
|
113
|
+
// Popover calculates its distance from mid-block so some
|
|
114
|
+
// adjustments are needed to make it appear in the right place.
|
|
115
|
+
left =
|
|
116
|
+
nearestSide === 'left'
|
|
117
|
+
? targetRect.left - 2
|
|
118
|
+
: targetRect.right - 2;
|
|
119
|
+
} else if ( isVertical ) {
|
|
102
120
|
// vertical
|
|
103
121
|
top = previousRect ? previousRect.bottom : nextRect.top;
|
|
104
122
|
width = previousRect ? previousRect.width : nextRect.width;
|
|
@@ -141,6 +159,8 @@ function BlockPopoverInbetween( {
|
|
|
141
159
|
popoverRecomputeCounter,
|
|
142
160
|
isVertical,
|
|
143
161
|
isVisible,
|
|
162
|
+
operation,
|
|
163
|
+
nearestSide,
|
|
144
164
|
] );
|
|
145
165
|
|
|
146
166
|
const popoverScrollRef = usePopoverScroll( __unstableContentRef );
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useResizeObserver,
|
|
4
|
+
import { useResizeObserver, useRefEffect } from '@wordpress/compose';
|
|
5
5
|
import { useSelect } from '@wordpress/data';
|
|
6
|
-
import { useMemo } from '@wordpress/element';
|
|
6
|
+
import { memo, useMemo } from '@wordpress/element';
|
|
7
7
|
import { Disabled } from '@wordpress/components';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -55,7 +55,7 @@ function ScaledBlockPreview( {
|
|
|
55
55
|
}, [ styles, additionalStyles ] );
|
|
56
56
|
|
|
57
57
|
// Initialize on render instead of module top level, to avoid circular dependency issues.
|
|
58
|
-
MemoizedBlockList = MemoizedBlockList ||
|
|
58
|
+
MemoizedBlockList = MemoizedBlockList || memo( BlockList );
|
|
59
59
|
|
|
60
60
|
const scale = containerWidth / viewportWidth;
|
|
61
61
|
const aspectRatio = contentHeight
|
|
@@ -50,11 +50,12 @@ export function BlockRemovalWarningModal( { rules } ) {
|
|
|
50
50
|
<Modal
|
|
51
51
|
title={ __( 'Be careful!' ) }
|
|
52
52
|
onRequestClose={ clearBlockRemovalPrompt }
|
|
53
|
+
size="medium"
|
|
53
54
|
>
|
|
54
55
|
<p>
|
|
55
56
|
{ _n(
|
|
56
|
-
'
|
|
57
|
-
'
|
|
57
|
+
'Deleting this block will stop your post or page content from displaying on this template. It is not recommended.',
|
|
58
|
+
'Deleting these blocks will stop your post or page content from displaying on this template. It is not recommended.',
|
|
58
59
|
blockNamesForPrompt.length
|
|
59
60
|
) }
|
|
60
61
|
</p>
|
|
@@ -41,9 +41,7 @@ const POPOVER_PROPS = {
|
|
|
41
41
|
|
|
42
42
|
function CopyMenuItem( { blocks, onCopy, label } ) {
|
|
43
43
|
const ref = useCopyToClipboard( () => serialize( blocks ), onCopy );
|
|
44
|
-
const
|
|
45
|
-
blocks.length > 1 ? __( 'Copy blocks' ) : __( 'Copy' );
|
|
46
|
-
const copyMenuItemLabel = label ? label : copyMenuItemBlocksLabel;
|
|
44
|
+
const copyMenuItemLabel = label ? label : __( 'Copy' );
|
|
47
45
|
return <MenuItem ref={ ref }>{ copyMenuItemLabel }</MenuItem>;
|
|
48
46
|
}
|
|
49
47
|
|
|
@@ -202,9 +200,6 @@ export function BlockSettingsDropdown( {
|
|
|
202
200
|
getSelectedBlockClientIds,
|
|
203
201
|
] );
|
|
204
202
|
|
|
205
|
-
const removeBlockLabel =
|
|
206
|
-
count === 1 ? __( 'Delete' ) : __( 'Delete blocks' );
|
|
207
|
-
|
|
208
203
|
// This can occur when the selected block (the parent)
|
|
209
204
|
// displays child blocks within a List View.
|
|
210
205
|
const parentBlockIsSelected =
|
|
@@ -411,7 +406,7 @@ export function BlockSettingsDropdown( {
|
|
|
411
406
|
) }
|
|
412
407
|
shortcut={ shortcuts.remove }
|
|
413
408
|
>
|
|
414
|
-
{
|
|
409
|
+
{ __( 'Delete' ) }
|
|
415
410
|
</MenuItem>
|
|
416
411
|
</MenuGroup>
|
|
417
412
|
) }
|
|
@@ -37,7 +37,7 @@ function useGroupedTransforms( possibleBlockTransformations ) {
|
|
|
37
37
|
const priorityTextTranformsNames = Object.keys(
|
|
38
38
|
priorityContentTranformationBlocks
|
|
39
39
|
);
|
|
40
|
-
|
|
40
|
+
const groupedPossibleTransforms = possibleBlockTransformations.reduce(
|
|
41
41
|
( accumulator, item ) => {
|
|
42
42
|
const { name } = item;
|
|
43
43
|
if ( priorityTextTranformsNames.includes( name ) ) {
|
|
@@ -49,6 +49,23 @@ function useGroupedTransforms( possibleBlockTransformations ) {
|
|
|
49
49
|
},
|
|
50
50
|
{ priorityTextTransformations: [], restTransformations: [] }
|
|
51
51
|
);
|
|
52
|
+
/**
|
|
53
|
+
* If there is only one priority text transformation and it's a Quote,
|
|
54
|
+
* is should move to the rest transformations. This is because Quote can
|
|
55
|
+
* be a container for any block type, so in multi-block selection it will
|
|
56
|
+
* always be suggested, even for non-text blocks.
|
|
57
|
+
*/
|
|
58
|
+
if (
|
|
59
|
+
groupedPossibleTransforms.priorityTextTransformations.length ===
|
|
60
|
+
1 &&
|
|
61
|
+
groupedPossibleTransforms.priorityTextTransformations[ 0 ].name ===
|
|
62
|
+
'core/quote'
|
|
63
|
+
) {
|
|
64
|
+
const singleQuote =
|
|
65
|
+
groupedPossibleTransforms.priorityTextTransformations.pop();
|
|
66
|
+
groupedPossibleTransforms.restTransformations.push( singleQuote );
|
|
67
|
+
}
|
|
68
|
+
return groupedPossibleTransforms;
|
|
52
69
|
}, [ possibleBlockTransformations ] );
|
|
53
70
|
|
|
54
71
|
// Order the priority text transformations.
|