@wordpress/block-editor 12.1.0 → 12.2.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/autocompleters/block.js +13 -5
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +6 -3
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +84 -0
- package/build/components/block-editing-mode/index.js.map +1 -0
- package/build/components/block-list/block-list-block-context.js +15 -0
- package/build/components/block-list/block-list-block-context.js.map +1 -0
- package/build/components/block-list/block.js +29 -37
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +14 -22
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +107 -108
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +2 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +7 -5
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list-appender/index.js +15 -1
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +19 -4
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-styles/preview-panel.js +1 -2
- package/build/components/block-styles/preview-panel.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +8 -0
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +125 -0
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -0
- package/build/components/block-switcher/index.js +34 -12
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +3 -3
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-toolbar/index.js +9 -7
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +5 -3
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +11 -5
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +7 -2
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.native.js +87 -3
- package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +23 -37
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +3 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/iframe/index.js +14 -7
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +7 -7
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +13 -5
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/index.js +3 -7
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -4
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-results.js +19 -6
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/list-view/appender.js +6 -1
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/block-contents.js +4 -2
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block.js +21 -25
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +1 -3
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +14 -7
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +27 -3
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +0 -2
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/url-input/index.js +3 -0
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +25 -15
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +8 -1
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +13 -7
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/hooks/align.js +3 -7
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/behaviors.js +115 -0
- package/build/hooks/behaviors.js.map +1 -0
- package/build/hooks/dimensions.js +0 -30
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +4 -8
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +8 -9
- package/build/hooks/layout.js.map +1 -1
- package/build/private-apis.js +4 -7
- package/build/private-apis.js.map +1 -1
- package/build/store/private-actions.js +46 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +88 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +36 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +28 -18
- package/build/store/selectors.js.map +1 -1
- package/build/utils/order-inserter-block-items.js +41 -0
- package/build/utils/order-inserter-block-items.js.map +1 -0
- package/build-module/autocompleters/block.js +12 -5
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +5 -3
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +72 -0
- package/build-module/components/block-editing-mode/index.js.map +1 -0
- package/build-module/components/block-list/block-list-block-context.js +6 -0
- package/build-module/components/block-list/block-list-block-context.js.map +1 -0
- package/build-module/components/block-list/block.js +26 -34
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +14 -22
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +108 -110
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +6 -5
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +15 -1
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +18 -4
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-styles/preview-panel.js +1 -2
- package/build-module/components/block-styles/preview-panel.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +7 -0
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +108 -0
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -0
- package/build-module/components/block-switcher/index.js +33 -12
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -3
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +8 -7
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +4 -3
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +11 -5
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +7 -2
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.native.js +76 -1
- package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +22 -36
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +3 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/iframe/index.js +15 -8
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +7 -6
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +13 -5
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/index.js +3 -7
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -4
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-results.js +16 -6
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/list-view/appender.js +6 -2
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +4 -2
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block.js +20 -25
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +1 -3
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +15 -8
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +26 -3
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +0 -2
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/url-input/index.js +3 -0
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +25 -16
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +8 -1
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.js +13 -7
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/hooks/align.js +3 -6
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/behaviors.js +97 -0
- package/build-module/hooks/behaviors.js.map +1 -0
- package/build-module/hooks/dimensions.js +0 -28
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +3 -6
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +7 -9
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/private-apis.js +3 -5
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-actions.js +42 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +79 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +34 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +26 -17
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/order-inserter-block-items.js +32 -0
- package/build-module/utils/order-inserter-block-items.js.map +1 -0
- package/build-style/content-rtl.css +32 -13
- package/build-style/content.css +32 -13
- 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 +19 -64
- package/build-style/style.css +20 -64
- package/package.json +32 -31
- package/src/autocompleters/block.js +15 -7
- package/src/components/block-breadcrumb/index.js +11 -3
- package/src/components/block-editing-mode/index.js +71 -0
- package/src/components/block-list/block-list-block-context.js +6 -0
- package/src/components/block-list/block.js +38 -56
- package/src/components/block-list/block.native.js +30 -41
- package/src/components/block-list/content.scss +5 -5
- package/src/components/block-list/index.native.js +164 -153
- package/src/components/block-list/test/index.native.js +2 -2
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-in-between-inserter.js +7 -3
- package/src/components/block-list-appender/index.js +22 -4
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +23 -0
- package/src/components/block-mover/style.scss +1 -0
- package/src/components/block-styles/preview-panel.js +1 -3
- package/src/components/block-switcher/block-transformations-menu.js +12 -0
- package/src/components/block-switcher/block-variation-transformations.js +115 -0
- package/src/components/block-switcher/index.js +38 -5
- package/src/components/block-switcher/pattern-transformations-menu.js +5 -5
- package/src/components/block-switcher/style.scss +6 -5
- package/src/components/block-toolbar/index.js +10 -11
- package/src/components/block-tools/block-contextual-toolbar.js +4 -5
- package/src/components/block-tools/insertion-point.js +23 -9
- package/src/components/button-block-appender/content.scss +22 -0
- package/src/components/convert-to-group-buttons/index.js +9 -2
- package/src/components/convert-to-group-buttons/index.native.js +79 -1
- package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +32 -38
- package/src/components/global-styles/dimensions-panel.js +3 -2
- package/src/components/global-styles/style.scss +3 -0
- package/src/components/iframe/index.js +22 -12
- package/src/components/inner-blocks/README.md +5 -0
- package/src/components/inner-blocks/index.js +2 -0
- package/src/components/inner-blocks/index.native.js +16 -6
- package/src/components/inner-blocks/use-nested-settings-update.js +20 -3
- package/src/components/inserter/index.js +1 -9
- package/src/components/inserter/quick-inserter.js +0 -2
- package/src/components/inserter/search-results.js +32 -6
- package/src/components/list-view/appender.js +3 -2
- package/src/components/list-view/block-contents.js +8 -2
- package/src/components/list-view/block.js +29 -35
- package/src/components/list-view/branch.js +1 -7
- package/src/components/list-view/index.js +17 -4
- package/src/components/list-view/style.scss +2 -5
- package/src/components/list-view/use-list-view-client-ids.js +21 -4
- package/src/components/publish-date-time-picker/index.js +0 -2
- package/src/components/url-input/README.md +6 -0
- package/src/components/url-input/index.js +1 -0
- package/src/components/use-block-drop-zone/index.js +31 -17
- package/src/components/use-resize-canvas/index.js +9 -1
- package/src/components/writing-flow/test/index.js +15 -0
- package/src/components/writing-flow/use-arrow-nav.js +17 -4
- package/src/hooks/align.js +3 -11
- package/src/hooks/behaviors.js +104 -0
- package/src/hooks/dimensions.js +0 -40
- package/src/hooks/duotone.js +3 -11
- package/src/hooks/index.js +1 -0
- package/src/hooks/layout.js +10 -18
- package/src/private-apis.js +2 -4
- package/src/store/private-actions.js +39 -0
- package/src/store/private-selectors.js +95 -0
- package/src/store/reducer.js +27 -0
- package/src/store/selectors.js +25 -15
- package/src/store/test/private-actions.js +32 -1
- package/src/store/test/private-selectors.js +158 -0
- package/src/store/test/reducer.js +48 -0
- package/src/style.scss +0 -3
- package/src/utils/order-inserter-block-items.js +26 -0
- package/build/components/block-list/block-list-compact.native.js +0 -75
- package/build/components/block-list/block-list-compact.native.js.map +0 -1
- package/build/components/off-canvas-editor/appender.js +0 -125
- package/build/components/off-canvas-editor/appender.js.map +0 -1
- package/build/components/off-canvas-editor/block-contents.js +0 -141
- package/build/components/off-canvas-editor/block-contents.js.map +0 -1
- package/build/components/off-canvas-editor/block-select-button.js +0 -126
- package/build/components/off-canvas-editor/block-select-button.js.map +0 -1
- package/build/components/off-canvas-editor/block.js +0 -297
- package/build/components/off-canvas-editor/block.js.map +0 -1
- package/build/components/off-canvas-editor/branch.js +0 -197
- package/build/components/off-canvas-editor/branch.js.map +0 -1
- package/build/components/off-canvas-editor/context.js +0 -19
- package/build/components/off-canvas-editor/context.js.map +0 -1
- package/build/components/off-canvas-editor/drop-indicator.js +0 -118
- package/build/components/off-canvas-editor/drop-indicator.js.map +0 -1
- package/build/components/off-canvas-editor/expander.js +0 -41
- package/build/components/off-canvas-editor/expander.js.map +0 -1
- package/build/components/off-canvas-editor/index.js +0 -236
- package/build/components/off-canvas-editor/index.js.map +0 -1
- package/build/components/off-canvas-editor/leaf-more-menu.js +0 -148
- package/build/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
- package/build/components/off-canvas-editor/leaf.js +0 -60
- package/build/components/off-canvas-editor/leaf.js.map +0 -1
- package/build/components/off-canvas-editor/link-ui.js +0 -186
- package/build/components/off-canvas-editor/link-ui.js.map +0 -1
- package/build/components/off-canvas-editor/update-attributes.js +0 -108
- package/build/components/off-canvas-editor/update-attributes.js.map +0 -1
- package/build/components/off-canvas-editor/use-block-selection.js +0 -139
- package/build/components/off-canvas-editor/use-block-selection.js.map +0 -1
- package/build/components/off-canvas-editor/use-inserted-block.js +0 -58
- package/build/components/off-canvas-editor/use-inserted-block.js.map +0 -1
- package/build/components/off-canvas-editor/use-list-view-client-ids.js +0 -33
- package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js +0 -235
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -60
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
- package/build/components/off-canvas-editor/utils.js +0 -60
- package/build/components/off-canvas-editor/utils.js.map +0 -1
- package/build-module/components/block-list/block-list-compact.native.js +0 -60
- package/build-module/components/block-list/block-list-compact.native.js.map +0 -1
- package/build-module/components/off-canvas-editor/appender.js +0 -108
- package/build-module/components/off-canvas-editor/appender.js.map +0 -1
- package/build-module/components/off-canvas-editor/block-contents.js +0 -121
- package/build-module/components/off-canvas-editor/block-contents.js.map +0 -1
- package/build-module/components/off-canvas-editor/block-select-button.js +0 -107
- package/build-module/components/off-canvas-editor/block-select-button.js.map +0 -1
- package/build-module/components/off-canvas-editor/block.js +0 -273
- package/build-module/components/off-canvas-editor/block.js.map +0 -1
- package/build-module/components/off-canvas-editor/branch.js +0 -179
- package/build-module/components/off-canvas-editor/branch.js.map +0 -1
- package/build-module/components/off-canvas-editor/context.js +0 -7
- package/build-module/components/off-canvas-editor/context.js.map +0 -1
- package/build-module/components/off-canvas-editor/drop-indicator.js +0 -111
- package/build-module/components/off-canvas-editor/drop-indicator.js.map +0 -1
- package/build-module/components/off-canvas-editor/expander.js +0 -32
- package/build-module/components/off-canvas-editor/expander.js.map +0 -1
- package/build-module/components/off-canvas-editor/index.js +0 -213
- package/build-module/components/off-canvas-editor/index.js.map +0 -1
- package/build-module/components/off-canvas-editor/leaf-more-menu.js +0 -130
- package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
- package/build-module/components/off-canvas-editor/leaf.js +0 -45
- package/build-module/components/off-canvas-editor/leaf.js.map +0 -1
- package/build-module/components/off-canvas-editor/link-ui.js +0 -166
- package/build-module/components/off-canvas-editor/link-ui.js.map +0 -1
- package/build-module/components/off-canvas-editor/update-attributes.js +0 -97
- package/build-module/components/off-canvas-editor/update-attributes.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-block-selection.js +0 -124
- package/build-module/components/off-canvas-editor/use-block-selection.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-inserted-block.js +0 -47
- package/build-module/components/off-canvas-editor/use-inserted-block.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +0 -24
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +0 -220
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -50
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
- package/build-module/components/off-canvas-editor/utils.js +0 -44
- package/build-module/components/off-canvas-editor/utils.js.map +0 -1
- package/src/components/block-list/block-list-compact.native.js +0 -63
- package/src/components/off-canvas-editor/README.md +0 -5
- package/src/components/off-canvas-editor/appender.js +0 -124
- package/src/components/off-canvas-editor/block-contents.js +0 -156
- package/src/components/off-canvas-editor/block-select-button.js +0 -128
- package/src/components/off-canvas-editor/block.js +0 -347
- package/src/components/off-canvas-editor/branch.js +0 -238
- package/src/components/off-canvas-editor/context.js +0 -8
- package/src/components/off-canvas-editor/drop-indicator.js +0 -126
- package/src/components/off-canvas-editor/expander.js +0 -26
- package/src/components/off-canvas-editor/index.js +0 -271
- package/src/components/off-canvas-editor/leaf-more-menu.js +0 -158
- package/src/components/off-canvas-editor/leaf.js +0 -52
- package/src/components/off-canvas-editor/link-ui.js +0 -167
- package/src/components/off-canvas-editor/style.scss +0 -34
- package/src/components/off-canvas-editor/test/use-inserted-block.js +0 -108
- package/src/components/off-canvas-editor/test/utils.js +0 -50
- package/src/components/off-canvas-editor/update-attributes.js +0 -99
- package/src/components/off-canvas-editor/use-block-selection.js +0 -169
- package/src/components/off-canvas-editor/use-inserted-block.js +0 -47
- package/src/components/off-canvas-editor/use-list-view-client-ids.js +0 -29
- package/src/components/off-canvas-editor/use-list-view-drop-zone.js +0 -260
- package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -58
- package/src/components/off-canvas-editor/utils.js +0 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.2.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,38 +33,39 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
35
|
"@react-spring/web": "^9.4.5",
|
|
36
|
-
"@wordpress/a11y": "^3.
|
|
37
|
-
"@wordpress/api-fetch": "^6.
|
|
38
|
-
"@wordpress/blob": "^3.
|
|
39
|
-
"@wordpress/blocks": "^12.
|
|
40
|
-
"@wordpress/components": "^
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/data": "^9.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^5.
|
|
47
|
-
"@wordpress/escape-html": "^2.
|
|
48
|
-
"@wordpress/hooks": "^3.
|
|
49
|
-
"@wordpress/html-entities": "^3.
|
|
50
|
-
"@wordpress/i18n": "^4.
|
|
51
|
-
"@wordpress/icons": "^9.
|
|
52
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
53
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
54
|
-
"@wordpress/keycodes": "^3.
|
|
55
|
-
"@wordpress/notices": "^4.
|
|
56
|
-
"@wordpress/preferences": "^3.
|
|
57
|
-
"@wordpress/private-apis": "^0.
|
|
58
|
-
"@wordpress/rich-text": "^6.
|
|
59
|
-
"@wordpress/shortcode": "^3.
|
|
60
|
-
"@wordpress/style-engine": "^1.
|
|
61
|
-
"@wordpress/token-list": "^2.
|
|
62
|
-
"@wordpress/url": "^3.
|
|
63
|
-
"@wordpress/warning": "^2.
|
|
64
|
-
"@wordpress/wordcount": "^3.
|
|
36
|
+
"@wordpress/a11y": "^3.34.0",
|
|
37
|
+
"@wordpress/api-fetch": "^6.31.0",
|
|
38
|
+
"@wordpress/blob": "^3.34.0",
|
|
39
|
+
"@wordpress/blocks": "^12.11.0",
|
|
40
|
+
"@wordpress/components": "^25.0.0",
|
|
41
|
+
"@wordpress/compose": "^6.11.0",
|
|
42
|
+
"@wordpress/data": "^9.4.0",
|
|
43
|
+
"@wordpress/date": "^4.34.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.34.0",
|
|
45
|
+
"@wordpress/dom": "^3.34.0",
|
|
46
|
+
"@wordpress/element": "^5.11.0",
|
|
47
|
+
"@wordpress/escape-html": "^2.34.0",
|
|
48
|
+
"@wordpress/hooks": "^3.34.0",
|
|
49
|
+
"@wordpress/html-entities": "^3.34.0",
|
|
50
|
+
"@wordpress/i18n": "^4.34.0",
|
|
51
|
+
"@wordpress/icons": "^9.25.0",
|
|
52
|
+
"@wordpress/is-shallow-equal": "^4.34.0",
|
|
53
|
+
"@wordpress/keyboard-shortcuts": "^4.11.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.34.0",
|
|
55
|
+
"@wordpress/notices": "^4.2.0",
|
|
56
|
+
"@wordpress/preferences": "^3.11.0",
|
|
57
|
+
"@wordpress/private-apis": "^0.16.0",
|
|
58
|
+
"@wordpress/rich-text": "^6.11.0",
|
|
59
|
+
"@wordpress/shortcode": "^3.34.0",
|
|
60
|
+
"@wordpress/style-engine": "^1.17.0",
|
|
61
|
+
"@wordpress/token-list": "^2.34.0",
|
|
62
|
+
"@wordpress/url": "^3.35.0",
|
|
63
|
+
"@wordpress/warning": "^2.34.0",
|
|
64
|
+
"@wordpress/wordcount": "^3.34.0",
|
|
65
65
|
"change-case": "^4.1.2",
|
|
66
66
|
"classnames": "^2.3.1",
|
|
67
67
|
"colord": "^2.7.0",
|
|
68
|
+
"deepmerge": "^4.3.0",
|
|
68
69
|
"diff": "^4.0.2",
|
|
69
70
|
"dom-scroll-into-view": "^1.2.1",
|
|
70
71
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -83,5 +84,5 @@
|
|
|
83
84
|
"publishConfig": {
|
|
84
85
|
"access": "public"
|
|
85
86
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "c7c79cb11b677adcbf06cf5f8cfb6c5ec1699f19"
|
|
87
88
|
}
|
|
@@ -16,6 +16,7 @@ import useBlockTypesState from '../components/inserter/hooks/use-block-types-sta
|
|
|
16
16
|
import BlockIcon from '../components/block-icon';
|
|
17
17
|
import { store as blockEditorStore } from '../store';
|
|
18
18
|
import { orderBy } from '../utils/sorting';
|
|
19
|
+
import { orderInserterBlockItems } from '../utils/order-inserter-block-items';
|
|
19
20
|
|
|
20
21
|
const noop = () => {};
|
|
21
22
|
const SHOWN_BLOCK_TYPES = 9;
|
|
@@ -34,23 +35,26 @@ function createBlockCompleter() {
|
|
|
34
35
|
triggerPrefix: '/',
|
|
35
36
|
|
|
36
37
|
useItems( filterValue ) {
|
|
37
|
-
const { rootClientId, selectedBlockName } =
|
|
38
|
-
( select ) => {
|
|
38
|
+
const { rootClientId, selectedBlockName, prioritizedBlocks } =
|
|
39
|
+
useSelect( ( select ) => {
|
|
39
40
|
const {
|
|
40
41
|
getSelectedBlockClientId,
|
|
41
42
|
getBlockName,
|
|
42
43
|
getBlockInsertionPoint,
|
|
44
|
+
getBlockListSettings,
|
|
43
45
|
} = select( blockEditorStore );
|
|
44
46
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
47
|
+
const _rootClientId = getBlockInsertionPoint().rootClientId;
|
|
45
48
|
return {
|
|
46
49
|
selectedBlockName: selectedBlockClientId
|
|
47
50
|
? getBlockName( selectedBlockClientId )
|
|
48
51
|
: null,
|
|
49
|
-
rootClientId:
|
|
52
|
+
rootClientId: _rootClientId,
|
|
53
|
+
prioritizedBlocks:
|
|
54
|
+
getBlockListSettings( _rootClientId )
|
|
55
|
+
?.prioritizedInserterBlocks,
|
|
50
56
|
};
|
|
51
|
-
},
|
|
52
|
-
[]
|
|
53
|
-
);
|
|
57
|
+
}, [] );
|
|
54
58
|
const [ items, categories, collections ] = useBlockTypesState(
|
|
55
59
|
rootClientId,
|
|
56
60
|
noop
|
|
@@ -64,7 +68,10 @@ function createBlockCompleter() {
|
|
|
64
68
|
collections,
|
|
65
69
|
filterValue
|
|
66
70
|
)
|
|
67
|
-
:
|
|
71
|
+
: orderInserterBlockItems(
|
|
72
|
+
orderBy( items, 'frecency', 'desc' ),
|
|
73
|
+
prioritizedBlocks
|
|
74
|
+
);
|
|
68
75
|
|
|
69
76
|
return initialFilteredItems
|
|
70
77
|
.filter( ( item ) => item.name !== selectedBlockName )
|
|
@@ -75,6 +82,7 @@ function createBlockCompleter() {
|
|
|
75
82
|
items,
|
|
76
83
|
categories,
|
|
77
84
|
collections,
|
|
85
|
+
prioritizedBlocks,
|
|
78
86
|
] );
|
|
79
87
|
|
|
80
88
|
const options = useMemo(
|
|
@@ -11,6 +11,7 @@ import { chevronRightSmall, Icon } from '@wordpress/icons';
|
|
|
11
11
|
*/
|
|
12
12
|
import BlockTitle from '../block-title';
|
|
13
13
|
import { store as blockEditorStore } from '../../store';
|
|
14
|
+
import { unlock } from '../../lock-unlock';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb.
|
|
@@ -22,11 +23,18 @@ import { store as blockEditorStore } from '../../store';
|
|
|
22
23
|
function BlockBreadcrumb( { rootLabelText } ) {
|
|
23
24
|
const { selectBlock, clearSelectedBlock } = useDispatch( blockEditorStore );
|
|
24
25
|
const { clientId, parents, hasSelection } = useSelect( ( select ) => {
|
|
25
|
-
const {
|
|
26
|
-
|
|
26
|
+
const {
|
|
27
|
+
getSelectionStart,
|
|
28
|
+
getSelectedBlockClientId,
|
|
29
|
+
getBlockParents,
|
|
30
|
+
getBlockEditingMode,
|
|
31
|
+
} = unlock( select( blockEditorStore ) );
|
|
27
32
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
28
33
|
return {
|
|
29
|
-
parents: getBlockParents( selectedBlockClientId )
|
|
34
|
+
parents: getBlockParents( selectedBlockClientId ).filter(
|
|
35
|
+
( parentClientId ) =>
|
|
36
|
+
getBlockEditingMode( parentClientId ) !== 'disabled'
|
|
37
|
+
),
|
|
30
38
|
clientId: selectedBlockClientId,
|
|
31
39
|
hasSelection: !! getSelectionStart().clientId,
|
|
32
40
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { useContext, useEffect } from '@wordpress/element';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { store as blockEditorStore } from '../../store';
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
12
|
+
import { BlockListBlockContext } from '../block-list/block-list-block-context';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {'disabled'|'contentOnly'|'default'} BlockEditingMode
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Allows a block to restrict the user interface that is displayed for editing
|
|
20
|
+
* that block and its inner blocks.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```js
|
|
24
|
+
* function MyBlock( { attributes, setAttributes } ) {
|
|
25
|
+
* useBlockEditingMode( 'disabled' );
|
|
26
|
+
* return <div { ...useBlockProps() }></div>;
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* `mode` can be one of three options:
|
|
31
|
+
*
|
|
32
|
+
* - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be
|
|
33
|
+
* selected.
|
|
34
|
+
* - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the
|
|
35
|
+
* toolbar, the block movers, block settings.
|
|
36
|
+
* - `'default'`: Allows editing the block as normal.
|
|
37
|
+
*
|
|
38
|
+
* The mode is inherited by all of the block's inner blocks, unless they have
|
|
39
|
+
* their own mode.
|
|
40
|
+
*
|
|
41
|
+
* If called outside of a block context, the mode is applied to all blocks.
|
|
42
|
+
*
|
|
43
|
+
* @param {?BlockEditingMode} mode The editing mode to apply. If undefined, the
|
|
44
|
+
* current editing mode is not changed.
|
|
45
|
+
*
|
|
46
|
+
* @return {BlockEditingMode} The current editing mode.
|
|
47
|
+
*/
|
|
48
|
+
export function useBlockEditingMode( mode ) {
|
|
49
|
+
const { clientId = '' } = useContext( BlockListBlockContext ) ?? {};
|
|
50
|
+
const blockEditingMode = useSelect(
|
|
51
|
+
( select ) =>
|
|
52
|
+
unlock( select( blockEditorStore ) ).getBlockEditingMode(
|
|
53
|
+
clientId
|
|
54
|
+
),
|
|
55
|
+
[ clientId ]
|
|
56
|
+
);
|
|
57
|
+
const { setBlockEditingMode, unsetBlockEditingMode } = unlock(
|
|
58
|
+
useDispatch( blockEditorStore )
|
|
59
|
+
);
|
|
60
|
+
useEffect( () => {
|
|
61
|
+
if ( mode ) {
|
|
62
|
+
setBlockEditingMode( clientId, mode );
|
|
63
|
+
}
|
|
64
|
+
return () => {
|
|
65
|
+
if ( mode ) {
|
|
66
|
+
unsetBlockEditingMode( clientId );
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}, [ clientId, mode ] );
|
|
70
|
+
return blockEditingMode;
|
|
71
|
+
}
|
|
@@ -6,19 +6,13 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
createContext,
|
|
11
|
-
useMemo,
|
|
12
|
-
useCallback,
|
|
13
|
-
RawHTML,
|
|
14
|
-
} from '@wordpress/element';
|
|
9
|
+
import { useMemo, useCallback, RawHTML } from '@wordpress/element';
|
|
15
10
|
import {
|
|
16
11
|
getBlockType,
|
|
17
12
|
getSaveContent,
|
|
18
13
|
isUnmodifiedDefaultBlock,
|
|
19
14
|
serializeRawBlock,
|
|
20
15
|
switchToBlockType,
|
|
21
|
-
store as blocksStore,
|
|
22
16
|
getDefaultBlockName,
|
|
23
17
|
isUnmodifiedBlock,
|
|
24
18
|
} from '@wordpress/blocks';
|
|
@@ -43,7 +37,8 @@ import BlockHtml from './block-html';
|
|
|
43
37
|
import { useBlockProps } from './use-block-props';
|
|
44
38
|
import { store as blockEditorStore } from '../../store';
|
|
45
39
|
import { useLayout } from './layout';
|
|
46
|
-
|
|
40
|
+
import { unlock } from '../../lock-unlock';
|
|
41
|
+
import { BlockListBlockContext } from './block-list-block-context';
|
|
47
42
|
|
|
48
43
|
/**
|
|
49
44
|
* Merges wrapper props with special handling for classNames and styles.
|
|
@@ -99,35 +94,23 @@ function BlockListBlock( {
|
|
|
99
94
|
} ) {
|
|
100
95
|
const {
|
|
101
96
|
themeSupportsLayout,
|
|
102
|
-
hasContentLockedParent,
|
|
103
|
-
isContentBlock,
|
|
104
|
-
isContentLocking,
|
|
105
97
|
isTemporarilyEditingAsBlocks,
|
|
98
|
+
blockEditingMode,
|
|
106
99
|
} = useSelect(
|
|
107
100
|
( select ) => {
|
|
108
101
|
const {
|
|
109
102
|
getSettings,
|
|
110
|
-
__unstableGetContentLockingParent,
|
|
111
|
-
getTemplateLock,
|
|
112
103
|
__unstableGetTemporarilyEditingAsBlocks,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
!! __unstableGetContentLockingParent( clientId );
|
|
104
|
+
getBlockEditingMode,
|
|
105
|
+
} = unlock( select( blockEditorStore ) );
|
|
116
106
|
return {
|
|
117
107
|
themeSupportsLayout: getSettings().supportsLayout,
|
|
118
|
-
isContentBlock:
|
|
119
|
-
select( blocksStore ).__experimentalHasContentRoleAttribute(
|
|
120
|
-
name
|
|
121
|
-
),
|
|
122
|
-
hasContentLockedParent: _hasContentLockedParent,
|
|
123
|
-
isContentLocking:
|
|
124
|
-
getTemplateLock( clientId ) === 'contentOnly' &&
|
|
125
|
-
! _hasContentLockedParent,
|
|
126
108
|
isTemporarilyEditingAsBlocks:
|
|
127
109
|
__unstableGetTemporarilyEditingAsBlocks() === clientId,
|
|
110
|
+
blockEditingMode: getBlockEditingMode( clientId ),
|
|
128
111
|
};
|
|
129
112
|
},
|
|
130
|
-
[
|
|
113
|
+
[ clientId ]
|
|
131
114
|
);
|
|
132
115
|
const { removeBlock } = useDispatch( blockEditorStore );
|
|
133
116
|
const onRemove = useCallback( () => removeBlock( clientId ), [ clientId ] );
|
|
@@ -160,7 +143,7 @@ function BlockListBlock( {
|
|
|
160
143
|
|
|
161
144
|
const blockType = getBlockType( name );
|
|
162
145
|
|
|
163
|
-
if (
|
|
146
|
+
if ( blockEditingMode === 'disabled' ) {
|
|
164
147
|
wrapperProps = {
|
|
165
148
|
...wrapperProps,
|
|
166
149
|
tabIndex: -1,
|
|
@@ -234,10 +217,9 @@ function BlockListBlock( {
|
|
|
234
217
|
clientId,
|
|
235
218
|
className: classnames(
|
|
236
219
|
{
|
|
237
|
-
'is-
|
|
220
|
+
'is-editing-disabled': blockEditingMode === 'disabled',
|
|
238
221
|
'is-content-locked-temporarily-editing-as-blocks':
|
|
239
222
|
isTemporarilyEditingAsBlocks,
|
|
240
|
-
'is-content-block': hasContentLockedParent && isContentBlock,
|
|
241
223
|
},
|
|
242
224
|
dataAlign && themeSupportsLayout && `align${ dataAlign }`,
|
|
243
225
|
className
|
|
@@ -376,26 +358,26 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
376
358
|
) {
|
|
377
359
|
removeBlock( _clientId );
|
|
378
360
|
} else {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
361
|
+
registry.batch( () => {
|
|
362
|
+
if (
|
|
363
|
+
canInsertBlockType(
|
|
364
|
+
getBlockName( firstClientId ),
|
|
365
|
+
targetRootClientId
|
|
366
|
+
)
|
|
367
|
+
) {
|
|
368
|
+
moveBlocksToPosition(
|
|
369
|
+
[ firstClientId ],
|
|
370
|
+
_clientId,
|
|
371
|
+
targetRootClientId,
|
|
372
|
+
getBlockIndex( _clientId )
|
|
373
|
+
);
|
|
374
|
+
} else {
|
|
375
|
+
const replacement = switchToBlockType(
|
|
376
|
+
getBlock( firstClientId ),
|
|
377
|
+
getDefaultBlockName()
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
if ( replacement && replacement.length ) {
|
|
399
381
|
insertBlocks(
|
|
400
382
|
replacement,
|
|
401
383
|
getBlockIndex( _clientId ),
|
|
@@ -403,16 +385,16 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
403
385
|
changeSelection
|
|
404
386
|
);
|
|
405
387
|
removeBlock( firstClientId, false );
|
|
406
|
-
}
|
|
388
|
+
}
|
|
407
389
|
}
|
|
408
|
-
}
|
|
409
390
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
391
|
+
if (
|
|
392
|
+
! getBlockOrder( _clientId ).length &&
|
|
393
|
+
isUnmodifiedBlock( getBlock( _clientId ) )
|
|
394
|
+
) {
|
|
395
|
+
removeBlock( _clientId, false );
|
|
396
|
+
}
|
|
397
|
+
} );
|
|
416
398
|
}
|
|
417
399
|
}
|
|
418
400
|
|
|
@@ -162,7 +162,6 @@ function BlockListBlock( {
|
|
|
162
162
|
blockType,
|
|
163
163
|
draggingClientId,
|
|
164
164
|
draggingEnabled,
|
|
165
|
-
firstToSelectId,
|
|
166
165
|
isDescendantOfParentSelected,
|
|
167
166
|
isDescendentBlockSelected,
|
|
168
167
|
isParentSelected,
|
|
@@ -174,7 +173,6 @@ function BlockListBlock( {
|
|
|
174
173
|
getBlockHierarchyRootClientId,
|
|
175
174
|
getBlockIndex,
|
|
176
175
|
getBlockParents,
|
|
177
|
-
getLowestCommonAncestorWithSelectedBlock,
|
|
178
176
|
getSelectedBlockClientId,
|
|
179
177
|
getSettings,
|
|
180
178
|
hasSelectedInnerBlock,
|
|
@@ -198,13 +196,6 @@ function BlockListBlock( {
|
|
|
198
196
|
selectedParents.includes( rootClientId );
|
|
199
197
|
const hasInnerBlocks = getBlockCount( clientId ) > 0;
|
|
200
198
|
|
|
201
|
-
const commonAncestor =
|
|
202
|
-
getLowestCommonAncestorWithSelectedBlock( clientId );
|
|
203
|
-
const commonAncestorIndex = parents.indexOf( commonAncestor ) - 1;
|
|
204
|
-
const firstBlockToSelectId = commonAncestor
|
|
205
|
-
? parents[ commonAncestorIndex ]
|
|
206
|
-
: parents[ parents.length - 1 ];
|
|
207
|
-
|
|
208
199
|
// For blocks with inner blocks, we only enable the dragging in the nested
|
|
209
200
|
// blocks if any of them are selected. This way we prevent the long-press
|
|
210
201
|
// gesture from being disabled for elements within the block UI.
|
|
@@ -223,7 +214,6 @@ function BlockListBlock( {
|
|
|
223
214
|
blockType: currentBlockType,
|
|
224
215
|
draggingClientId: currentDraggingClientId,
|
|
225
216
|
draggingEnabled: isDraggingEnabled,
|
|
226
|
-
firstToSelectId: firstBlockToSelectId,
|
|
227
217
|
isDescendantOfParentSelected: descendantOfParentSelected,
|
|
228
218
|
isDescendentBlockSelected: descendentBlockSelected,
|
|
229
219
|
isParentSelected: parentSelected,
|
|
@@ -245,11 +235,10 @@ function BlockListBlock( {
|
|
|
245
235
|
[ clientId, removeBlock ]
|
|
246
236
|
);
|
|
247
237
|
const onFocus = useCallback( () => {
|
|
248
|
-
const blockId = firstToSelectId ?? clientId;
|
|
249
238
|
if ( ! isSelected ) {
|
|
250
|
-
selectBlock(
|
|
239
|
+
selectBlock( clientId );
|
|
251
240
|
}
|
|
252
|
-
}, [ selectBlock, clientId,
|
|
241
|
+
}, [ selectBlock, clientId, isSelected ] );
|
|
253
242
|
|
|
254
243
|
const onLayout = useCallback(
|
|
255
244
|
( { nativeEvent } ) => {
|
|
@@ -492,26 +481,26 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
492
481
|
) {
|
|
493
482
|
removeBlock( _clientId );
|
|
494
483
|
} else {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
484
|
+
registry.batch( () => {
|
|
485
|
+
if (
|
|
486
|
+
canInsertBlockType(
|
|
487
|
+
getBlockName( firstClientId ),
|
|
488
|
+
targetRootClientId
|
|
489
|
+
)
|
|
490
|
+
) {
|
|
491
|
+
moveBlocksToPosition(
|
|
492
|
+
[ firstClientId ],
|
|
493
|
+
_clientId,
|
|
494
|
+
targetRootClientId,
|
|
495
|
+
getBlockIndex( _clientId )
|
|
496
|
+
);
|
|
497
|
+
} else {
|
|
498
|
+
const replacement = switchToBlockType(
|
|
499
|
+
getBlock( firstClientId ),
|
|
500
|
+
getDefaultBlockName()
|
|
501
|
+
);
|
|
502
|
+
|
|
503
|
+
if ( replacement && replacement.length ) {
|
|
515
504
|
insertBlocks(
|
|
516
505
|
replacement,
|
|
517
506
|
getBlockIndex( _clientId ),
|
|
@@ -519,16 +508,16 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
519
508
|
changeSelection
|
|
520
509
|
);
|
|
521
510
|
removeBlock( firstClientId, false );
|
|
522
|
-
}
|
|
511
|
+
}
|
|
523
512
|
}
|
|
524
|
-
}
|
|
525
513
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
514
|
+
if (
|
|
515
|
+
! getBlockOrder( _clientId ).length &&
|
|
516
|
+
isUnmodifiedBlock( getBlock( _clientId ) )
|
|
517
|
+
) {
|
|
518
|
+
removeBlock( _clientId, false );
|
|
519
|
+
}
|
|
520
|
+
} );
|
|
532
521
|
}
|
|
533
522
|
}
|
|
534
523
|
|
|
@@ -161,13 +161,13 @@
|
|
|
161
161
|
padding: 0;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
.
|
|
165
|
-
|
|
164
|
+
.block-editor-block-list__layout,
|
|
165
|
+
.block-editor-block-list__block {
|
|
166
|
+
pointer-events: initial;
|
|
167
|
+
|
|
168
|
+
&.is-editing-disabled {
|
|
166
169
|
pointer-events: none;
|
|
167
170
|
}
|
|
168
|
-
.is-content-block {
|
|
169
|
-
pointer-events: initial;
|
|
170
|
-
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
.block-editor-block-list__layout .block-editor-block-list__block {
|