@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
|
@@ -165,7 +165,6 @@ function BlockListBlock(_ref2) {
|
|
|
165
165
|
blockType,
|
|
166
166
|
draggingClientId,
|
|
167
167
|
draggingEnabled,
|
|
168
|
-
firstToSelectId,
|
|
169
168
|
isDescendantOfParentSelected,
|
|
170
169
|
isDescendentBlockSelected,
|
|
171
170
|
isParentSelected,
|
|
@@ -178,7 +177,6 @@ function BlockListBlock(_ref2) {
|
|
|
178
177
|
getBlockHierarchyRootClientId,
|
|
179
178
|
getBlockIndex,
|
|
180
179
|
getBlockParents,
|
|
181
|
-
getLowestCommonAncestorWithSelectedBlock,
|
|
182
180
|
getSelectedBlockClientId,
|
|
183
181
|
getSettings,
|
|
184
182
|
hasSelectedInnerBlock
|
|
@@ -192,10 +190,7 @@ function BlockListBlock(_ref2) {
|
|
|
192
190
|
(selectedBlockClientId || false) && selectedBlockClientId === rootClientId;
|
|
193
191
|
const selectedParents = clientId ? parents : [];
|
|
194
192
|
const descendantOfParentSelected = selectedParents.includes(rootClientId);
|
|
195
|
-
const hasInnerBlocks = getBlockCount(clientId) > 0;
|
|
196
|
-
const commonAncestor = getLowestCommonAncestorWithSelectedBlock(clientId);
|
|
197
|
-
const commonAncestorIndex = parents.indexOf(commonAncestor) - 1;
|
|
198
|
-
const firstBlockToSelectId = commonAncestor ? parents[commonAncestorIndex] : parents[parents.length - 1]; // For blocks with inner blocks, we only enable the dragging in the nested
|
|
193
|
+
const hasInnerBlocks = getBlockCount(clientId) > 0; // For blocks with inner blocks, we only enable the dragging in the nested
|
|
199
194
|
// blocks if any of them are selected. This way we prevent the long-press
|
|
200
195
|
// gesture from being disabled for elements within the block UI.
|
|
201
196
|
|
|
@@ -209,7 +204,6 @@ function BlockListBlock(_ref2) {
|
|
|
209
204
|
blockType: currentBlockType,
|
|
210
205
|
draggingClientId: currentDraggingClientId,
|
|
211
206
|
draggingEnabled: isDraggingEnabled,
|
|
212
|
-
firstToSelectId: firstBlockToSelectId,
|
|
213
207
|
isDescendantOfParentSelected: descendantOfParentSelected,
|
|
214
208
|
isDescendentBlockSelected: descendentBlockSelected,
|
|
215
209
|
isParentSelected: parentSelected,
|
|
@@ -228,12 +222,10 @@ function BlockListBlock(_ref2) {
|
|
|
228
222
|
const fontSizes = (0, _useSetting.default)('typography.fontSizes') || emptyArray;
|
|
229
223
|
const onRemove = (0, _element.useCallback)(() => removeBlock(clientId), [clientId, removeBlock]);
|
|
230
224
|
const onFocus = (0, _element.useCallback)(() => {
|
|
231
|
-
const blockId = firstToSelectId !== null && firstToSelectId !== void 0 ? firstToSelectId : clientId;
|
|
232
|
-
|
|
233
225
|
if (!isSelected) {
|
|
234
|
-
selectBlock(
|
|
226
|
+
selectBlock(clientId);
|
|
235
227
|
}
|
|
236
|
-
}, [selectBlock, clientId,
|
|
228
|
+
}, [selectBlock, clientId, isSelected]);
|
|
237
229
|
const onLayout = (0, _element.useCallback)(_ref3 => {
|
|
238
230
|
let {
|
|
239
231
|
nativeEvent
|
|
@@ -448,22 +440,22 @@ const applyWithDispatch = (0, _data.withDispatch)((dispatch, ownProps, registry)
|
|
|
448
440
|
if (blockOrder.length === 1 && (0, _blocks.isUnmodifiedBlock)(getBlock(firstClientId))) {
|
|
449
441
|
removeBlock(_clientId);
|
|
450
442
|
} else {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
443
|
+
registry.batch(() => {
|
|
444
|
+
if (canInsertBlockType(getBlockName(firstClientId), targetRootClientId)) {
|
|
445
|
+
moveBlocksToPosition([firstClientId], _clientId, targetRootClientId, getBlockIndex(_clientId));
|
|
446
|
+
} else {
|
|
447
|
+
const replacement = (0, _blocks.switchToBlockType)(getBlock(firstClientId), (0, _blocks.getDefaultBlockName)());
|
|
455
448
|
|
|
456
|
-
|
|
457
|
-
registry.batch(() => {
|
|
449
|
+
if (replacement && replacement.length) {
|
|
458
450
|
insertBlocks(replacement, getBlockIndex(_clientId), targetRootClientId, changeSelection);
|
|
459
451
|
removeBlock(firstClientId, false);
|
|
460
|
-
}
|
|
452
|
+
}
|
|
461
453
|
}
|
|
462
|
-
}
|
|
463
454
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
455
|
+
if (!getBlockOrder(_clientId).length && (0, _blocks.isUnmodifiedBlock)(getBlock(_clientId))) {
|
|
456
|
+
removeBlock(_clientId, false);
|
|
457
|
+
}
|
|
458
|
+
});
|
|
467
459
|
}
|
|
468
460
|
} // For `Delete` or forward merge, we should do the exact same thing
|
|
469
461
|
// as `Backspace`, but from the other block.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"names":["emptyArray","wrapperPropsCache","WeakMap","emptyObj","getWrapperProps","value","getWrapperPropsFunction","cachedValue","get","wrapperProps","set","BlockWrapper","accessibilityLabel","align","blockWidth","children","clientId","draggingClientId","draggingEnabled","isDescendentBlockSelected","isParentSelected","isSelected","isStackedHorizontally","isTouchable","marginHorizontal","marginVertical","onDeleteBlock","onFocus","width","screenWidth","anchorNodeRef","isFullWidth","alignmentHelpers","isScreenWidthEqual","isFullWidthToolbar","blockWrapperStyles","flex","blockWrapperStyle","accessible","styles","neutralToolbar","current","BlockListBlock","attributes","blockWrapperWidth","canRemove","contentStyle","isLocked","isSelectionEnabled","isValid","name","onInsertBlocksAfter","onMerge","onReplace","parentBlockAlignment","parentWidth","rootClientId","setAttributes","toggleSelection","baseGlobalStyles","blockType","firstToSelectId","isDescendantOfParentSelected","order","select","getBlockCount","getBlockHierarchyRootClientId","getBlockIndex","getBlockParents","getLowestCommonAncestorWithSelectedBlock","getSelectedBlockClientId","getSettings","hasSelectedInnerBlock","blockEditorStore","currentBlockType","blockOrder","descendentBlockSelected","selectedBlockClientId","parents","parentSelected","selectedParents","descendantOfParentSelected","includes","hasInnerBlocks","commonAncestor","commonAncestorIndex","indexOf","firstBlockToSelectId","length","isDraggingEnabled","currentDraggingClientId","globalStylesBaseStyles","__experimentalGlobalStylesBaseStyles","removeBlock","selectBlock","initialBlockWidth","setBlockWidth","parentLayout","defaultColors","globalStyle","fontSizes","onRemove","blockId","onLayout","nativeEvent","layoutWidth","Math","floor","layout","getEditWrapperProps","mergedStyle","style","JSON","stringify","Object","fromEntries","entries","filter","key","GlobalStylesContext","BLOCK_STYLE_ATTRIBUTES","isFocused","undefined","keys","applyWithSelect","isBlockSelected","getBlockMode","getTemplateLock","__unstableGetBlockWithoutInnerBlocks","canRemoveBlock","canMoveBlock","block","templateLock","canMove","mode","applyWithDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","mergeBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","newAttributes","getMultiSelectedBlockClientIds","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockAttributes","getBlockName","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","firstClientId","replacement","batch","nextRootClientId","rootAttributes","previousRootAttributes","every","nextBlockClientId","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","selectionEnabled","pure"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AAOA;;AAQA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA3CA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;AAWA,MAAMA,UAAU,GAAG,EAAnB,C,CAEA;;AACA,MAAMC,iBAAiB,GAAG,IAAIC,OAAJ,EAA1B;AACA,MAAMC,QAAQ,GAAG,EA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C;AACnD,UACC1B,MAAM,CAAC9D,MAAP,IACA,CAAE,sCAA0B8D,MAAM,CAAEA,MAAM,CAAC9D,MAAP,GAAgB,CAAlB,CAAhC,CAFH,EAGE;AACDuD,QAAAA,oCAAoC;AACpC;;AACDD,MAAAA,aAAa,CACZ,CAAEL,QAAQ,CAACzH,QAAX,CADY,EAEZsI,MAFY,EAGZyB,aAHY,EAIZC,eAJY,CAAb;AAMA,KAlNK;;AAmNNtH,IAAAA,eAAe,CAAEuH,gBAAF,EAAqB;AACnCvH,MAAAA,eAAe,CAAEuH,gBAAF,CAAf;AACA;;AArNK,GAAP;AAuNA,CArOyB,CAA1B;;eAuOe,sBACdC,aADc,EAEdtD,eAFc,EAGdW,iBAHc,EAId;AACA;AACA;AACA,0BAAa;AAAA,MAAE;AAAEJ,IAAAA;AAAF,GAAF;AAAA,SAAiB,CAAC,CAAEA,KAApB;AAAA,CAAb,CAPc,EAQZzF,cARY,C","sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, useWindowDimensions, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useRef, useState } from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\talignmentHelpers,\n\tuseGlobalStyles,\n} from '@wordpress/components';\nimport {\n\t__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,\n\tgetBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n\tisUnmodifiedDefaultBlock,\n\tswitchToBlockType,\n} from '@wordpress/blocks';\nimport {\n\tuseDispatch,\n\tuseSelect,\n\twithDispatch,\n\twithSelect,\n} from '@wordpress/data';\nimport { compose, ifCondition, pure } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockEdit from '../block-edit';\nimport BlockDraggable from '../block-draggable';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockMobileToolbar from '../block-mobile-toolbar';\nimport BlockOutline from './block-outline';\nimport styles from './block.scss';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport useSetting from '../use-setting';\n\nconst emptyArray = [];\n\n// Helper function to memoize the wrapperProps since getEditWrapperProps always returns a new reference.\nconst wrapperPropsCache = new WeakMap();\nconst emptyObj = {};\nfunction getWrapperProps( value, getWrapperPropsFunction ) {\n\tif ( ! getWrapperPropsFunction ) {\n\t\treturn emptyObj;\n\t}\n\tconst cachedValue = wrapperPropsCache.get( value );\n\tif ( ! cachedValue ) {\n\t\tconst wrapperProps = getWrapperPropsFunction( value );\n\t\twrapperPropsCache.set( value, wrapperProps );\n\t\treturn wrapperProps;\n\t}\n\treturn cachedValue;\n}\n\nfunction BlockWrapper( {\n\taccessibilityLabel,\n\talign,\n\tblockWidth,\n\tchildren,\n\tclientId,\n\tdraggingClientId,\n\tdraggingEnabled,\n\tisDescendentBlockSelected,\n\tisParentSelected,\n\tisSelected,\n\tisStackedHorizontally,\n\tisTouchable,\n\tmarginHorizontal,\n\tmarginVertical,\n\tonDeleteBlock,\n\tonFocus,\n} ) {\n\tconst { width: screenWidth } = useWindowDimensions();\n\tconst anchorNodeRef = useRef();\n\tconst { isFullWidth } = alignmentHelpers;\n\tconst isScreenWidthEqual = blockWidth === screenWidth;\n\tconst isFullWidthToolbar = isFullWidth( align ) || isScreenWidthEqual;\n\tconst blockWrapperStyles = { flex: 1 };\n\tconst blockWrapperStyle = [\n\t\tblockWrapperStyles,\n\t\t{\n\t\t\tmarginVertical,\n\t\t\tmarginHorizontal,\n\t\t},\n\t];\n\tconst accessible = ! ( isSelected || isDescendentBlockSelected );\n\n\treturn (\n\t\t<Pressable\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessible={ accessible }\n\t\t\tdisabled={ ! isTouchable }\n\t\t\tonPress={ onFocus }\n\t\t\tstyle={ blockWrapperStyle }\n\t\t>\n\t\t\t<BlockOutline\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tisParentSelected={ isParentSelected }\n\t\t\t\tscreenWidth={ screenWidth }\n\t\t\t/>\n\t\t\t<BlockDraggable\n\t\t\t\tclientId={ clientId }\n\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\tenabled={ draggingEnabled }\n\t\t\t\ttestID=\"draggable-trigger-content\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</BlockDraggable>\n\t\t\t<View style={ styles.neutralToolbar } ref={ anchorNodeRef }>\n\t\t\t\t{ isSelected && (\n\t\t\t\t\t<BlockMobileToolbar\n\t\t\t\t\t\tanchorNodeRef={ anchorNodeRef.current }\n\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\t\t\tisFullWidth={ isFullWidthToolbar }\n\t\t\t\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\t\t\t\tonDelete={ onDeleteBlock }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t</Pressable>\n\t);\n}\n\nfunction BlockListBlock( {\n\tattributes,\n\tblockWidth: blockWrapperWidth,\n\tcanRemove,\n\tclientId,\n\tcontentStyle,\n\tisLocked,\n\tisSelected,\n\tisSelectionEnabled,\n\tisStackedHorizontally,\n\tisValid,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonDeleteBlock,\n\tonInsertBlocksAfter,\n\tonMerge,\n\tonReplace,\n\tparentBlockAlignment,\n\tparentWidth,\n\trootClientId,\n\tsetAttributes,\n\ttoggleSelection,\n} ) {\n\tconst {\n\t\tbaseGlobalStyles,\n\t\tblockType,\n\t\tdraggingClientId,\n\t\tdraggingEnabled,\n\t\tfirstToSelectId,\n\t\tisDescendantOfParentSelected,\n\t\tisDescendentBlockSelected,\n\t\tisParentSelected,\n\t\torder,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockHierarchyRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetLowestCommonAncestorWithSelectedBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSettings,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentBlockType = getBlockType( name || 'core/missing' );\n\t\t\tconst blockOrder = getBlockIndex( clientId );\n\t\t\tconst descendentBlockSelected = hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\tconst parents = getBlockParents( clientId, true );\n\t\t\tconst parentSelected =\n\t\t\t\t// Set false as a default value to prevent re-render when it's changed from null to false.\n\t\t\t\t( selectedBlockClientId || false ) &&\n\t\t\t\tselectedBlockClientId === rootClientId;\n\n\t\t\tconst selectedParents = clientId ? parents : [];\n\t\t\tconst descendantOfParentSelected =\n\t\t\t\tselectedParents.includes( rootClientId );\n\t\t\tconst hasInnerBlocks = getBlockCount( clientId ) > 0;\n\n\t\t\tconst commonAncestor =\n\t\t\t\tgetLowestCommonAncestorWithSelectedBlock( clientId );\n\t\t\tconst commonAncestorIndex = parents.indexOf( commonAncestor ) - 1;\n\t\t\tconst firstBlockToSelectId = commonAncestor\n\t\t\t\t? parents[ commonAncestorIndex ]\n\t\t\t\t: parents[ parents.length - 1 ];\n\n\t\t\t// For blocks with inner blocks, we only enable the dragging in the nested\n\t\t\t// blocks if any of them are selected. This way we prevent the long-press\n\t\t\t// gesture from being disabled for elements within the block UI.\n\t\t\tconst isDraggingEnabled =\n\t\t\t\t! hasInnerBlocks || isSelected || ! descendentBlockSelected;\n\t\t\t// Dragging nested blocks is not supported yet. For this reason, the block to be dragged\n\t\t\t// will be the top in the hierarchy.\n\t\t\tconst currentDraggingClientId =\n\t\t\t\tgetBlockHierarchyRootClientId( clientId );\n\n\t\t\tconst globalStylesBaseStyles =\n\t\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles;\n\n\t\t\treturn {\n\t\t\t\tbaseGlobalStyles: globalStylesBaseStyles,\n\t\t\t\tblockType: currentBlockType,\n\t\t\t\tdraggingClientId: currentDraggingClientId,\n\t\t\t\tdraggingEnabled: isDraggingEnabled,\n\t\t\t\tfirstToSelectId: firstBlockToSelectId,\n\t\t\t\tisDescendantOfParentSelected: descendantOfParentSelected,\n\t\t\t\tisDescendentBlockSelected: descendentBlockSelected,\n\t\t\t\tisParentSelected: parentSelected,\n\t\t\t\torder: blockOrder,\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSelected, name, rootClientId ]\n\t);\n\tconst { removeBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst initialBlockWidth = blockWrapperWidth - 2 * marginHorizontal;\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth );\n\tconst parentLayout = useLayout() || {};\n\tconst defaultColors = useMobileGlobalStylesColors();\n\tconst globalStyle = useGlobalStyles();\n\tconst fontSizes = useSetting( 'typography.fontSizes' ) || emptyArray;\n\n\tconst onRemove = useCallback(\n\t\t() => removeBlock( clientId ),\n\t\t[ clientId, removeBlock ]\n\t);\n\tconst onFocus = useCallback( () => {\n\t\tconst blockId = firstToSelectId ?? clientId;\n\t\tif ( ! isSelected ) {\n\t\t\tselectBlock( blockId );\n\t\t}\n\t}, [ selectBlock, clientId, firstToSelectId, isSelected ] );\n\n\tconst onLayout = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tconst layoutWidth = Math.floor( nativeEvent.layout.width );\n\n\t\t\tif ( ! blockWidth || ! layoutWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( blockWidth !== layoutWidth ) {\n\t\t\t\tsetBlockWidth( layoutWidth );\n\t\t\t}\n\t\t},\n\t\t[ blockWidth, setBlockWidth ]\n\t);\n\n\t// Block level styles.\n\tconst wrapperProps = getWrapperProps(\n\t\tattributes,\n\t\tblockType.getEditWrapperProps\n\t);\n\n\t// Inherited styles merged with block level styles.\n\tconst mergedStyle = useMemo( () => {\n\t\treturn getMergedGlobalStyles(\n\t\t\tbaseGlobalStyles,\n\t\t\tglobalStyle,\n\t\t\twrapperProps.style,\n\t\t\tattributes,\n\t\t\tdefaultColors,\n\t\t\tname,\n\t\t\tfontSizes\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\t// It is crucial to keep the dependencies array minimal to prevent unnecessary calls that could negatively impact performance.\n\t\t// JSON.stringify is used for the following purposes:\n\t\t// 1. To create a single, comparable value from the globalStyle, wrapperProps.style, and attributes objects. This allows useMemo to\n\t\t// efficiently determine if a change has occurred in any of these objects.\n\t\t// 2. To filter the attributes object, ensuring that only the relevant attributes (included in\n\t\t// GlobalStylesContext.BLOCK_STYLE_ATTRIBUTES) are considered as dependencies. This reduces the likelihood of\n\t\t// unnecessary useMemo calls when other, unrelated attributes change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( globalStyle ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( wrapperProps.style ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries( attributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\t\t\tGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t] );\n\n\tconst { align } = attributes;\n\tconst isFocused = isSelected || isDescendentBlockSelected;\n\tconst isTouchable =\n\t\tisSelected ||\n\t\tisDescendantOfParentSelected ||\n\t\tisParentSelected ||\n\t\t! rootClientId;\n\n\tconst accessibilityLabel = getAccessibleBlockLabel(\n\t\tblockType,\n\t\tattributes,\n\t\torder + 1\n\t);\n\n\treturn (\n\t\t<BlockWrapper\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\talign={ align }\n\t\t\tblockWidth={ blockWidth }\n\t\t\tclientId={ clientId }\n\t\t\tdraggingClientId={ draggingClientId }\n\t\t\tdraggingEnabled={ draggingEnabled }\n\t\t\tisFocused={ isFocused }\n\t\t\tisDescendentBlockSelected={ isDescendentBlockSelected }\n\t\t\tisParentSelected={ isParentSelected }\n\t\t\tisSelected={ isSelected }\n\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\tisTouchable={ isTouchable }\n\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\tmarginVertical={ marginVertical }\n\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\tonFocus={ onFocus }\n\t\t>\n\t\t\t{ () =>\n\t\t\t\t! isValid ? (\n\t\t\t\t\t<BlockInvalidWarning clientId={ clientId } />\n\t\t\t\t) : (\n\t\t\t\t\t<GlobalStylesContext.Provider value={ mergedStyle }>\n\t\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\t\t\tinsertBlocksAfter={\n\t\t\t\t\t\t\t\tisLocked ? undefined : onInsertBlocksAfter\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tisSelectionEnabled={ isSelectionEnabled }\n\t\t\t\t\t\t\tmergeBlocks={ canRemove ? onMerge : undefined }\n\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tonRemove={ canRemove ? onRemove : undefined }\n\t\t\t\t\t\t\tonReplace={ canRemove ? onReplace : undefined }\n\t\t\t\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tstyle={ mergedStyle }\n\t\t\t\t\t\t\ttoggleSelection={ toggleSelection }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tObject.keys( parentLayout ).length\n\t\t\t\t\t\t\t\t\t? parentLayout\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View onLayout={ onLayout } />\n\t\t\t\t\t</GlobalStylesContext.Provider>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockWrapper>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => {\n\tconst {\n\t\tisBlockSelected,\n\t\tgetBlockMode,\n\t\tisSelectionEnabled,\n\t\tgetTemplateLock,\n\t\t__unstableGetBlockWithoutInnerBlocks,\n\t\tcanRemoveBlock,\n\t\tcanMoveBlock,\n\t} = select( blockEditorStore );\n\tconst block = __unstableGetBlockWithoutInnerBlocks( clientId );\n\tconst isSelected = isBlockSelected( clientId );\n\tconst templateLock = getTemplateLock( rootClientId );\n\tconst canRemove = canRemoveBlock( clientId, rootClientId );\n\tconst canMove = canMoveBlock( clientId, rootClientId );\n\n\t// The fallback to `{}` is a temporary fix.\n\t// This function should never be called when a block is not present in\n\t// the state. It happens now because the order in withSelect rendering\n\t// is not correct.\n\tconst { name, attributes, isValid } = block || {};\n\n\t// Do not add new properties here, use `useSelect` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tmode: getBlockMode( clientId ),\n\t\tisSelectionEnabled: isSelectionEnabled(),\n\t\tisLocked: !! templateLock,\n\t\tcanRemove,\n\t\tcanMove,\n\t\t// Users of the editor.BlockListBlock filter used to be able to\n\t\t// access the block prop.\n\t\t// Ideally these blocks would rely on the clientId prop only.\n\t\t// This is kept for backward compatibility reasons.\n\t\tblock,\n\t\tname,\n\t\tattributes,\n\t\tisValid,\n\t\tisSelected,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tinsertBlocks,\n\t\tmergeBlocks,\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t} = dispatch( blockEditorStore );\n\n\t// Do not add new properties here, use `useDispatch` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tsetAttributes( newAttributes ) {\n\t\t\tconst { getMultiSelectedBlockClientIds } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst multiSelectedBlockClientIds =\n\t\t\t\tgetMultiSelectedBlockClientIds();\n\t\t\tconst { clientId } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes );\n\t\t},\n\t\tonInsertBlocks( blocks, index ) {\n\t\t\tconst { rootClientId } = ownProps;\n\t\t\tinsertBlocks( blocks, index, rootClientId );\n\t\t},\n\t\tonInsertBlocksAfter( blocks ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst { getBlockIndex } = registry.select( blockEditorStore );\n\t\t\tconst index = getBlockIndex( clientId );\n\t\t\tinsertBlocks( blocks, index + 1, rootClientId );\n\t\t},\n\t\tonMerge( forward ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst {\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\t/**\n\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t * convert to the default block type.\n\t\t\t *\n\t\t\t * @param {string} _clientId The block to move.\n\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t * to the moved block.\n\t\t\t */\n\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\tconst targetRootClientId = getBlockRootClientId( _clientId );\n\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\tif (\n\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t) {\n\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t} else {\n\t\t\t\t\tif (\n\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\tgetBlockName( firstClientId ),\n\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t[ firstClientId ],\n\t\t\t\t\t\t\t_clientId,\n\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\tgetBlockIndex( _clientId )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\t\tgetBlock( firstClientId ),\n\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( replacement && replacement.length ) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! getBlockOrder( _clientId ).length &&\n\t\t\t\t\t\tisUnmodifiedBlock( getBlock( _clientId ) )\n\t\t\t\t\t) {\n\t\t\t\t\t\tremoveBlock( _clientId, false );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t// as `Backspace`, but from the other block.\n\t\t\tif ( forward ) {\n\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( nextRootClientId );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\tgetBlockOrder( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t} else {\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonReplace( blocks, indexToSelect, initialPosition ) {\n\t\t\tif (\n\t\t\t\tblocks.length &&\n\t\t\t\t! isUnmodifiedDefaultBlock( blocks[ blocks.length - 1 ] )\n\t\t\t) {\n\t\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t\treplaceBlocks(\n\t\t\t\t[ ownProps.clientId ],\n\t\t\t\tblocks,\n\t\t\t\tindexToSelect,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t},\n\t\ttoggleSelection( selectionEnabled ) {\n\t\t\ttoggleSelection( selectionEnabled );\n\t\t},\n\t};\n} );\n\nexport default compose(\n\tpure,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\t// Block is sometimes not mounted at the right time, causing it be undefined\n\t// see issue for more info\n\t// https://github.com/WordPress/gutenberg/issues/17013\n\tifCondition( ( { block } ) => !! block )\n)( BlockListBlock );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"names":["emptyArray","wrapperPropsCache","WeakMap","emptyObj","getWrapperProps","value","getWrapperPropsFunction","cachedValue","get","wrapperProps","set","BlockWrapper","accessibilityLabel","align","blockWidth","children","clientId","draggingClientId","draggingEnabled","isDescendentBlockSelected","isParentSelected","isSelected","isStackedHorizontally","isTouchable","marginHorizontal","marginVertical","onDeleteBlock","onFocus","width","screenWidth","anchorNodeRef","isFullWidth","alignmentHelpers","isScreenWidthEqual","isFullWidthToolbar","blockWrapperStyles","flex","blockWrapperStyle","accessible","styles","neutralToolbar","current","BlockListBlock","attributes","blockWrapperWidth","canRemove","contentStyle","isLocked","isSelectionEnabled","isValid","name","onInsertBlocksAfter","onMerge","onReplace","parentBlockAlignment","parentWidth","rootClientId","setAttributes","toggleSelection","baseGlobalStyles","blockType","isDescendantOfParentSelected","order","select","getBlockCount","getBlockHierarchyRootClientId","getBlockIndex","getBlockParents","getSelectedBlockClientId","getSettings","hasSelectedInnerBlock","blockEditorStore","currentBlockType","blockOrder","descendentBlockSelected","selectedBlockClientId","parents","parentSelected","selectedParents","descendantOfParentSelected","includes","hasInnerBlocks","isDraggingEnabled","currentDraggingClientId","globalStylesBaseStyles","__experimentalGlobalStylesBaseStyles","removeBlock","selectBlock","initialBlockWidth","setBlockWidth","parentLayout","defaultColors","globalStyle","fontSizes","onRemove","onLayout","nativeEvent","layoutWidth","Math","floor","layout","getEditWrapperProps","mergedStyle","style","JSON","stringify","Object","fromEntries","entries","filter","key","GlobalStylesContext","BLOCK_STYLE_ATTRIBUTES","isFocused","undefined","keys","length","applyWithSelect","isBlockSelected","getBlockMode","getTemplateLock","__unstableGetBlockWithoutInnerBlocks","canRemoveBlock","canMoveBlock","block","templateLock","canMove","mode","applyWithDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","mergeBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","newAttributes","getMultiSelectedBlockClientIds","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockAttributes","getBlockName","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","firstClientId","batch","replacement","nextRootClientId","rootAttributes","previousRootAttributes","every","nextBlockClientId","previousBlockClientId","previousRootClientId","index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AAlB,CAAhC,CAFH,EAGE;AACDoB,QAAAA,oCAAoC;AACpC;;AACDD,MAAAA,aAAa,CACZ,CAAEL,QAAQ,CAAClH,QAAX,CADY,EAEZ+H,MAFY,EAGZyB,aAHY,EAIZC,eAJY,CAAb;AAMA,KAlNK;;AAmNN/G,IAAAA,eAAe,CAAEgH,gBAAF,EAAqB;AACnChH,MAAAA,eAAe,CAAEgH,gBAAF,CAAf;AACA;;AArNK,GAAP;AAuNA,CArOyB,CAA1B;;eAuOe,sBACdC,aADc,EAEdtD,eAFc,EAGdW,iBAHc,EAId;AACA;AACA;AACA,0BAAa;AAAA,MAAE;AAAEJ,IAAAA;AAAF,GAAF;AAAA,SAAiB,CAAC,CAAEA,KAApB;AAAA,CAAb,CAPc,EAQZlF,cARY,C","sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, useWindowDimensions, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useRef, useState } from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\talignmentHelpers,\n\tuseGlobalStyles,\n} from '@wordpress/components';\nimport {\n\t__experimentalGetAccessibleBlockLabel as getAccessibleBlockLabel,\n\tgetBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n\tisUnmodifiedDefaultBlock,\n\tswitchToBlockType,\n} from '@wordpress/blocks';\nimport {\n\tuseDispatch,\n\tuseSelect,\n\twithDispatch,\n\twithSelect,\n} from '@wordpress/data';\nimport { compose, ifCondition, pure } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockEdit from '../block-edit';\nimport BlockDraggable from '../block-draggable';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockMobileToolbar from '../block-mobile-toolbar';\nimport BlockOutline from './block-outline';\nimport styles from './block.scss';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport useSetting from '../use-setting';\n\nconst emptyArray = [];\n\n// Helper function to memoize the wrapperProps since getEditWrapperProps always returns a new reference.\nconst wrapperPropsCache = new WeakMap();\nconst emptyObj = {};\nfunction getWrapperProps( value, getWrapperPropsFunction ) {\n\tif ( ! getWrapperPropsFunction ) {\n\t\treturn emptyObj;\n\t}\n\tconst cachedValue = wrapperPropsCache.get( value );\n\tif ( ! cachedValue ) {\n\t\tconst wrapperProps = getWrapperPropsFunction( value );\n\t\twrapperPropsCache.set( value, wrapperProps );\n\t\treturn wrapperProps;\n\t}\n\treturn cachedValue;\n}\n\nfunction BlockWrapper( {\n\taccessibilityLabel,\n\talign,\n\tblockWidth,\n\tchildren,\n\tclientId,\n\tdraggingClientId,\n\tdraggingEnabled,\n\tisDescendentBlockSelected,\n\tisParentSelected,\n\tisSelected,\n\tisStackedHorizontally,\n\tisTouchable,\n\tmarginHorizontal,\n\tmarginVertical,\n\tonDeleteBlock,\n\tonFocus,\n} ) {\n\tconst { width: screenWidth } = useWindowDimensions();\n\tconst anchorNodeRef = useRef();\n\tconst { isFullWidth } = alignmentHelpers;\n\tconst isScreenWidthEqual = blockWidth === screenWidth;\n\tconst isFullWidthToolbar = isFullWidth( align ) || isScreenWidthEqual;\n\tconst blockWrapperStyles = { flex: 1 };\n\tconst blockWrapperStyle = [\n\t\tblockWrapperStyles,\n\t\t{\n\t\t\tmarginVertical,\n\t\t\tmarginHorizontal,\n\t\t},\n\t];\n\tconst accessible = ! ( isSelected || isDescendentBlockSelected );\n\n\treturn (\n\t\t<Pressable\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessible={ accessible }\n\t\t\tdisabled={ ! isTouchable }\n\t\t\tonPress={ onFocus }\n\t\t\tstyle={ blockWrapperStyle }\n\t\t>\n\t\t\t<BlockOutline\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tisParentSelected={ isParentSelected }\n\t\t\t\tscreenWidth={ screenWidth }\n\t\t\t/>\n\t\t\t<BlockDraggable\n\t\t\t\tclientId={ clientId }\n\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\tenabled={ draggingEnabled }\n\t\t\t\ttestID=\"draggable-trigger-content\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</BlockDraggable>\n\t\t\t<View style={ styles.neutralToolbar } ref={ anchorNodeRef }>\n\t\t\t\t{ isSelected && (\n\t\t\t\t\t<BlockMobileToolbar\n\t\t\t\t\t\tanchorNodeRef={ anchorNodeRef.current }\n\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tdraggingClientId={ draggingClientId }\n\t\t\t\t\t\tisFullWidth={ isFullWidthToolbar }\n\t\t\t\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\t\t\t\tonDelete={ onDeleteBlock }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t</Pressable>\n\t);\n}\n\nfunction BlockListBlock( {\n\tattributes,\n\tblockWidth: blockWrapperWidth,\n\tcanRemove,\n\tclientId,\n\tcontentStyle,\n\tisLocked,\n\tisSelected,\n\tisSelectionEnabled,\n\tisStackedHorizontally,\n\tisValid,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonDeleteBlock,\n\tonInsertBlocksAfter,\n\tonMerge,\n\tonReplace,\n\tparentBlockAlignment,\n\tparentWidth,\n\trootClientId,\n\tsetAttributes,\n\ttoggleSelection,\n} ) {\n\tconst {\n\t\tbaseGlobalStyles,\n\t\tblockType,\n\t\tdraggingClientId,\n\t\tdraggingEnabled,\n\t\tisDescendantOfParentSelected,\n\t\tisDescendentBlockSelected,\n\t\tisParentSelected,\n\t\torder,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockHierarchyRootClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParents,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetSettings,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentBlockType = getBlockType( name || 'core/missing' );\n\t\t\tconst blockOrder = getBlockIndex( clientId );\n\t\t\tconst descendentBlockSelected = hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\ttrue\n\t\t\t);\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\n\t\t\tconst parents = getBlockParents( clientId, true );\n\t\t\tconst parentSelected =\n\t\t\t\t// Set false as a default value to prevent re-render when it's changed from null to false.\n\t\t\t\t( selectedBlockClientId || false ) &&\n\t\t\t\tselectedBlockClientId === rootClientId;\n\n\t\t\tconst selectedParents = clientId ? parents : [];\n\t\t\tconst descendantOfParentSelected =\n\t\t\t\tselectedParents.includes( rootClientId );\n\t\t\tconst hasInnerBlocks = getBlockCount( clientId ) > 0;\n\n\t\t\t// For blocks with inner blocks, we only enable the dragging in the nested\n\t\t\t// blocks if any of them are selected. This way we prevent the long-press\n\t\t\t// gesture from being disabled for elements within the block UI.\n\t\t\tconst isDraggingEnabled =\n\t\t\t\t! hasInnerBlocks || isSelected || ! descendentBlockSelected;\n\t\t\t// Dragging nested blocks is not supported yet. For this reason, the block to be dragged\n\t\t\t// will be the top in the hierarchy.\n\t\t\tconst currentDraggingClientId =\n\t\t\t\tgetBlockHierarchyRootClientId( clientId );\n\n\t\t\tconst globalStylesBaseStyles =\n\t\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles;\n\n\t\t\treturn {\n\t\t\t\tbaseGlobalStyles: globalStylesBaseStyles,\n\t\t\t\tblockType: currentBlockType,\n\t\t\t\tdraggingClientId: currentDraggingClientId,\n\t\t\t\tdraggingEnabled: isDraggingEnabled,\n\t\t\t\tisDescendantOfParentSelected: descendantOfParentSelected,\n\t\t\t\tisDescendentBlockSelected: descendentBlockSelected,\n\t\t\t\tisParentSelected: parentSelected,\n\t\t\t\torder: blockOrder,\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSelected, name, rootClientId ]\n\t);\n\tconst { removeBlock, selectBlock } = useDispatch( blockEditorStore );\n\tconst initialBlockWidth = blockWrapperWidth - 2 * marginHorizontal;\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth );\n\tconst parentLayout = useLayout() || {};\n\tconst defaultColors = useMobileGlobalStylesColors();\n\tconst globalStyle = useGlobalStyles();\n\tconst fontSizes = useSetting( 'typography.fontSizes' ) || emptyArray;\n\n\tconst onRemove = useCallback(\n\t\t() => removeBlock( clientId ),\n\t\t[ clientId, removeBlock ]\n\t);\n\tconst onFocus = useCallback( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tselectBlock( clientId );\n\t\t}\n\t}, [ selectBlock, clientId, isSelected ] );\n\n\tconst onLayout = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tconst layoutWidth = Math.floor( nativeEvent.layout.width );\n\n\t\t\tif ( ! blockWidth || ! layoutWidth ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( blockWidth !== layoutWidth ) {\n\t\t\t\tsetBlockWidth( layoutWidth );\n\t\t\t}\n\t\t},\n\t\t[ blockWidth, setBlockWidth ]\n\t);\n\n\t// Block level styles.\n\tconst wrapperProps = getWrapperProps(\n\t\tattributes,\n\t\tblockType.getEditWrapperProps\n\t);\n\n\t// Inherited styles merged with block level styles.\n\tconst mergedStyle = useMemo( () => {\n\t\treturn getMergedGlobalStyles(\n\t\t\tbaseGlobalStyles,\n\t\t\tglobalStyle,\n\t\t\twrapperProps.style,\n\t\t\tattributes,\n\t\t\tdefaultColors,\n\t\t\tname,\n\t\t\tfontSizes\n\t\t);\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [\n\t\t// It is crucial to keep the dependencies array minimal to prevent unnecessary calls that could negatively impact performance.\n\t\t// JSON.stringify is used for the following purposes:\n\t\t// 1. To create a single, comparable value from the globalStyle, wrapperProps.style, and attributes objects. This allows useMemo to\n\t\t// efficiently determine if a change has occurred in any of these objects.\n\t\t// 2. To filter the attributes object, ensuring that only the relevant attributes (included in\n\t\t// GlobalStylesContext.BLOCK_STYLE_ATTRIBUTES) are considered as dependencies. This reduces the likelihood of\n\t\t// unnecessary useMemo calls when other, unrelated attributes change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( globalStyle ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify( wrapperProps.style ),\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\tJSON.stringify(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries( attributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\t\t\tGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t\t\t)\n\t\t\t)\n\t\t),\n\t] );\n\n\tconst { align } = attributes;\n\tconst isFocused = isSelected || isDescendentBlockSelected;\n\tconst isTouchable =\n\t\tisSelected ||\n\t\tisDescendantOfParentSelected ||\n\t\tisParentSelected ||\n\t\t! rootClientId;\n\n\tconst accessibilityLabel = getAccessibleBlockLabel(\n\t\tblockType,\n\t\tattributes,\n\t\torder + 1\n\t);\n\n\treturn (\n\t\t<BlockWrapper\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\talign={ align }\n\t\t\tblockWidth={ blockWidth }\n\t\t\tclientId={ clientId }\n\t\t\tdraggingClientId={ draggingClientId }\n\t\t\tdraggingEnabled={ draggingEnabled }\n\t\t\tisFocused={ isFocused }\n\t\t\tisDescendentBlockSelected={ isDescendentBlockSelected }\n\t\t\tisParentSelected={ isParentSelected }\n\t\t\tisSelected={ isSelected }\n\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\tisTouchable={ isTouchable }\n\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\tmarginVertical={ marginVertical }\n\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\tonFocus={ onFocus }\n\t\t>\n\t\t\t{ () =>\n\t\t\t\t! isValid ? (\n\t\t\t\t\t<BlockInvalidWarning clientId={ clientId } />\n\t\t\t\t) : (\n\t\t\t\t\t<GlobalStylesContext.Provider value={ mergedStyle }>\n\t\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\t\t\t\tinsertBlocksAfter={\n\t\t\t\t\t\t\t\tisLocked ? undefined : onInsertBlocksAfter\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tisSelectionEnabled={ isSelectionEnabled }\n\t\t\t\t\t\t\tmergeBlocks={ canRemove ? onMerge : undefined }\n\t\t\t\t\t\t\tname={ name }\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tonRemove={ canRemove ? onRemove : undefined }\n\t\t\t\t\t\t\tonReplace={ canRemove ? onReplace : undefined }\n\t\t\t\t\t\t\tparentBlockAlignment={ parentBlockAlignment }\n\t\t\t\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\tstyle={ mergedStyle }\n\t\t\t\t\t\t\ttoggleSelection={ toggleSelection }\n\t\t\t\t\t\t\t__unstableParentLayout={\n\t\t\t\t\t\t\t\tObject.keys( parentLayout ).length\n\t\t\t\t\t\t\t\t\t? parentLayout\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<View onLayout={ onLayout } />\n\t\t\t\t\t</GlobalStylesContext.Provider>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockWrapper>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select, { clientId, rootClientId } ) => {\n\tconst {\n\t\tisBlockSelected,\n\t\tgetBlockMode,\n\t\tisSelectionEnabled,\n\t\tgetTemplateLock,\n\t\t__unstableGetBlockWithoutInnerBlocks,\n\t\tcanRemoveBlock,\n\t\tcanMoveBlock,\n\t} = select( blockEditorStore );\n\tconst block = __unstableGetBlockWithoutInnerBlocks( clientId );\n\tconst isSelected = isBlockSelected( clientId );\n\tconst templateLock = getTemplateLock( rootClientId );\n\tconst canRemove = canRemoveBlock( clientId, rootClientId );\n\tconst canMove = canMoveBlock( clientId, rootClientId );\n\n\t// The fallback to `{}` is a temporary fix.\n\t// This function should never be called when a block is not present in\n\t// the state. It happens now because the order in withSelect rendering\n\t// is not correct.\n\tconst { name, attributes, isValid } = block || {};\n\n\t// Do not add new properties here, use `useSelect` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tmode: getBlockMode( clientId ),\n\t\tisSelectionEnabled: isSelectionEnabled(),\n\t\tisLocked: !! templateLock,\n\t\tcanRemove,\n\t\tcanMove,\n\t\t// Users of the editor.BlockListBlock filter used to be able to\n\t\t// access the block prop.\n\t\t// Ideally these blocks would rely on the clientId prop only.\n\t\t// This is kept for backward compatibility reasons.\n\t\tblock,\n\t\tname,\n\t\tattributes,\n\t\tisValid,\n\t\tisSelected,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tinsertBlocks,\n\t\tmergeBlocks,\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t} = dispatch( blockEditorStore );\n\n\t// Do not add new properties here, use `useDispatch` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tsetAttributes( newAttributes ) {\n\t\t\tconst { getMultiSelectedBlockClientIds } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst multiSelectedBlockClientIds =\n\t\t\t\tgetMultiSelectedBlockClientIds();\n\t\t\tconst { clientId } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes );\n\t\t},\n\t\tonInsertBlocks( blocks, index ) {\n\t\t\tconst { rootClientId } = ownProps;\n\t\t\tinsertBlocks( blocks, index, rootClientId );\n\t\t},\n\t\tonInsertBlocksAfter( blocks ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst { getBlockIndex } = registry.select( blockEditorStore );\n\t\t\tconst index = getBlockIndex( clientId );\n\t\t\tinsertBlocks( blocks, index + 1, rootClientId );\n\t\t},\n\t\tonMerge( forward ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst {\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\t/**\n\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t * convert to the default block type.\n\t\t\t *\n\t\t\t * @param {string} _clientId The block to move.\n\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t * to the moved block.\n\t\t\t */\n\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\tconst targetRootClientId = getBlockRootClientId( _clientId );\n\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\tif (\n\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t) {\n\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t} else {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tgetBlockName( firstClientId ),\n\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ firstClientId ],\n\t\t\t\t\t\t\t\t_clientId,\n\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\tgetBlockIndex( _clientId )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\t\t\tgetBlock( firstClientId ),\n\t\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( replacement && replacement.length ) {\n\t\t\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! getBlockOrder( _clientId ).length &&\n\t\t\t\t\t\t\tisUnmodifiedBlock( getBlock( _clientId ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveBlock( _clientId, false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t// as `Backspace`, but from the other block.\n\t\t\tif ( forward ) {\n\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( nextRootClientId );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\tgetBlockOrder( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t} else {\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonReplace( blocks, indexToSelect, initialPosition ) {\n\t\t\tif (\n\t\t\t\tblocks.length &&\n\t\t\t\t! isUnmodifiedDefaultBlock( blocks[ blocks.length - 1 ] )\n\t\t\t) {\n\t\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t\treplaceBlocks(\n\t\t\t\t[ ownProps.clientId ],\n\t\t\t\tblocks,\n\t\t\t\tindexToSelect,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t},\n\t\ttoggleSelection( selectionEnabled ) {\n\t\t\ttoggleSelection( selectionEnabled );\n\t\t},\n\t};\n} );\n\nexport default compose(\n\tpure,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\t// Block is sometimes not mounted at the right time, causing it be undefined\n\t// see issue for more info\n\t// https://github.com/WordPress/gutenberg/issues/17013\n\tifCondition( ( { block } ) => !! block )\n)( BlockListBlock );\n"]}
|
|
@@ -33,6 +33,8 @@ var _blockListContext = require("./block-list-context");
|
|
|
33
33
|
|
|
34
34
|
var _blockDraggable = require("../block-draggable");
|
|
35
35
|
|
|
36
|
+
var _useEditorWrapperStyles = require("../../hooks/use-editor-wrapper-styles");
|
|
37
|
+
|
|
36
38
|
var _store = require("../../store");
|
|
37
39
|
|
|
38
40
|
/**
|
|
@@ -50,11 +52,7 @@ const identity = x => x;
|
|
|
50
52
|
|
|
51
53
|
const stylesMemo = {};
|
|
52
54
|
|
|
53
|
-
const getStyles = (
|
|
54
|
-
if (isRootList) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
55
|
+
const getStyles = (isStackedHorizontally, horizontalAlignment) => {
|
|
58
56
|
const styleName = `${isStackedHorizontally}-${horizontalAlignment}`;
|
|
59
57
|
|
|
60
58
|
if (stylesMemo[styleName]) {
|
|
@@ -85,7 +83,6 @@ function BlockList(_ref) {
|
|
|
85
83
|
renderAppender,
|
|
86
84
|
renderFooterAppender,
|
|
87
85
|
rootClientId,
|
|
88
|
-
title,
|
|
89
86
|
withFooter = true
|
|
90
87
|
} = _ref;
|
|
91
88
|
const {
|
|
@@ -187,84 +184,6 @@ function BlockList(_ref) {
|
|
|
187
184
|
}
|
|
188
185
|
};
|
|
189
186
|
|
|
190
|
-
const renderList = function () {
|
|
191
|
-
let extraProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
192
|
-
const {
|
|
193
|
-
parentScrollRef,
|
|
194
|
-
onScroll
|
|
195
|
-
} = extraProps;
|
|
196
|
-
const {
|
|
197
|
-
blockToolbar,
|
|
198
|
-
headerToolbar,
|
|
199
|
-
floatingToolbar
|
|
200
|
-
} = _style.default;
|
|
201
|
-
const containerStyle = {
|
|
202
|
-
flex: isRootList ? 1 : 0,
|
|
203
|
-
// We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.
|
|
204
|
-
marginVertical: isRootList ? 0 : -marginVertical,
|
|
205
|
-
marginHorizontal: isRootList ? 0 : -marginHorizontal
|
|
206
|
-
};
|
|
207
|
-
const isContentStretch = contentResizeMode === 'stretch';
|
|
208
|
-
const isMultiBlocks = blockClientIds.length > 1;
|
|
209
|
-
const {
|
|
210
|
-
isWider
|
|
211
|
-
} = _components.alignmentHelpers;
|
|
212
|
-
const extraScrollHeight = headerToolbar.height + blockToolbar.height + (isFloatingToolbarVisible ? floatingToolbar.height : 0);
|
|
213
|
-
const scrollViewStyle = [{
|
|
214
|
-
flex: isRootList ? 1 : 0
|
|
215
|
-
}, !isRootList && _style.default.overflowVisible];
|
|
216
|
-
return (0, _element.createElement)(_reactNative.View, {
|
|
217
|
-
style: containerStyle,
|
|
218
|
-
onAccessibilityEscape: clearSelectedBlock,
|
|
219
|
-
onLayout: onLayout,
|
|
220
|
-
testID: "block-list-wrapper"
|
|
221
|
-
}, (0, _element.createElement)(_components.KeyboardAwareFlatList, (0, _extends2.default)({}, _reactNative.Platform.OS === 'android' ? {
|
|
222
|
-
removeClippedSubviews: false
|
|
223
|
-
} : {}, {
|
|
224
|
-
// Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541
|
|
225
|
-
accessibilityLabel: "block-list",
|
|
226
|
-
innerRef: ref => {
|
|
227
|
-
scrollViewRef.current = parentScrollRef || ref;
|
|
228
|
-
},
|
|
229
|
-
extraScrollHeight: extraScrollHeight,
|
|
230
|
-
keyboardShouldPersistTaps: "always",
|
|
231
|
-
scrollViewStyle: scrollViewStyle,
|
|
232
|
-
extraData: getExtraData(),
|
|
233
|
-
scrollEnabled: isRootList,
|
|
234
|
-
contentContainerStyle: [horizontal && _style.default.horizontalContentContainer, isWider(blockWidth, 'medium') && (isContentStretch && isMultiBlocks ? _style.default.horizontalContentContainerStretch : _style.default.horizontalContentContainerCenter)],
|
|
235
|
-
style: getStyles(isRootList, isStackedHorizontally, horizontalAlignment),
|
|
236
|
-
data: blockClientIds,
|
|
237
|
-
keyExtractor: identity,
|
|
238
|
-
listKey: rootClientId ? `list-${rootClientId}` : 'list-root',
|
|
239
|
-
renderItem: renderItem,
|
|
240
|
-
CellRendererComponent: _blockListItemCell.default,
|
|
241
|
-
shouldPreventAutomaticScroll: shouldFlatListPreventAutomaticScroll,
|
|
242
|
-
title: title,
|
|
243
|
-
ListHeaderComponent: header,
|
|
244
|
-
ListEmptyComponent: !isReadOnly && (0, _element.createElement)(EmptyList, {
|
|
245
|
-
orientation: orientation,
|
|
246
|
-
rootClientId: rootClientId,
|
|
247
|
-
renderAppender: renderAppender,
|
|
248
|
-
renderFooterAppender: renderFooterAppender
|
|
249
|
-
}),
|
|
250
|
-
ListFooterComponent: (0, _element.createElement)(Footer, {
|
|
251
|
-
addBlockToEndOfPost: addBlockToEndOfPost,
|
|
252
|
-
isReadOnly: isReadOnly,
|
|
253
|
-
renderFooterAppender: renderFooterAppender,
|
|
254
|
-
withFooter: withFooter
|
|
255
|
-
}),
|
|
256
|
-
onScroll: onScroll
|
|
257
|
-
})), shouldShowInnerBlockAppender() && (0, _element.createElement)(_reactNative.View, {
|
|
258
|
-
style: {
|
|
259
|
-
marginHorizontal: marginHorizontal - _style.default.innerAppender.marginLeft
|
|
260
|
-
}
|
|
261
|
-
}, (0, _element.createElement)(_blockListAppender.default, {
|
|
262
|
-
rootClientId: rootClientId,
|
|
263
|
-
renderAppender: renderAppender,
|
|
264
|
-
showSeparator: true
|
|
265
|
-
})));
|
|
266
|
-
};
|
|
267
|
-
|
|
268
187
|
const renderItem = _ref3 => {
|
|
269
188
|
let {
|
|
270
189
|
item: clientId,
|
|
@@ -294,10 +213,31 @@ function BlockList(_ref) {
|
|
|
294
213
|
blockWidth: blockWidth,
|
|
295
214
|
isGridItem: isGridItem
|
|
296
215
|
}, gridItemProps));
|
|
297
|
-
};
|
|
298
|
-
|
|
216
|
+
};
|
|
299
217
|
|
|
300
|
-
const
|
|
218
|
+
const {
|
|
219
|
+
blockToolbar,
|
|
220
|
+
headerToolbar,
|
|
221
|
+
floatingToolbar
|
|
222
|
+
} = _style.default;
|
|
223
|
+
const containerStyle = {
|
|
224
|
+
flex: isRootList ? 1 : 0,
|
|
225
|
+
// We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.
|
|
226
|
+
marginVertical: isRootList ? 0 : -marginVertical,
|
|
227
|
+
marginHorizontal: isRootList ? 0 : -marginHorizontal
|
|
228
|
+
};
|
|
229
|
+
const isContentStretch = contentResizeMode === 'stretch';
|
|
230
|
+
const isMultiBlocks = blockClientIds.length > 1;
|
|
231
|
+
const {
|
|
232
|
+
isWider
|
|
233
|
+
} = _components.alignmentHelpers;
|
|
234
|
+
const extraScrollHeight = headerToolbar.height + blockToolbar.height + (isFloatingToolbarVisible ? floatingToolbar.height : 0);
|
|
235
|
+
return (0, _element.createElement)(_reactNative.View, {
|
|
236
|
+
style: containerStyle,
|
|
237
|
+
onAccessibilityEscape: clearSelectedBlock,
|
|
238
|
+
onLayout: onLayout,
|
|
239
|
+
testID: "block-list-wrapper"
|
|
240
|
+
}, isRootList ? (0, _element.createElement)(_blockListContext.BlockListProvider, {
|
|
301
241
|
value: { ..._blockListContext.DEFAULT_BLOCK_LIST_CONTEXT,
|
|
302
242
|
scrollRef: scrollViewRef.current
|
|
303
243
|
}
|
|
@@ -307,27 +247,83 @@ function BlockList(_ref) {
|
|
|
307
247
|
let {
|
|
308
248
|
onScroll
|
|
309
249
|
} = _ref4;
|
|
310
|
-
return
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
250
|
+
return (0, _element.createElement)(_components.KeyboardAwareFlatList, (0, _extends2.default)({}, _reactNative.Platform.OS === 'android' ? {
|
|
251
|
+
removeClippedSubviews: false
|
|
252
|
+
} : {}, {
|
|
253
|
+
// Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541
|
|
254
|
+
accessibilityLabel: "block-list",
|
|
255
|
+
innerRef: ref => {
|
|
256
|
+
scrollViewRef.current = ref;
|
|
257
|
+
},
|
|
258
|
+
extraScrollHeight: extraScrollHeight,
|
|
259
|
+
keyboardShouldPersistTaps: "always",
|
|
260
|
+
scrollViewStyle: {
|
|
261
|
+
flex: 1
|
|
262
|
+
},
|
|
263
|
+
extraData: getExtraData(),
|
|
264
|
+
scrollEnabled: isRootList,
|
|
265
|
+
contentContainerStyle: [horizontal && _style.default.horizontalContentContainer, isWider(blockWidth, 'medium') && (isContentStretch && isMultiBlocks ? _style.default.horizontalContentContainerStretch : _style.default.horizontalContentContainerCenter)],
|
|
266
|
+
data: blockClientIds,
|
|
267
|
+
keyExtractor: identity,
|
|
268
|
+
renderItem: renderItem,
|
|
269
|
+
CellRendererComponent: _blockListItemCell.default,
|
|
270
|
+
shouldPreventAutomaticScroll: shouldFlatListPreventAutomaticScroll,
|
|
271
|
+
ListHeaderComponent: header,
|
|
272
|
+
ListEmptyComponent: !isReadOnly && (0, _element.createElement)(EmptyList, {
|
|
273
|
+
orientation: orientation,
|
|
274
|
+
rootClientId: rootClientId,
|
|
275
|
+
renderAppender: renderAppender,
|
|
276
|
+
renderFooterAppender: renderFooterAppender
|
|
277
|
+
}),
|
|
278
|
+
ListFooterComponent: (0, _element.createElement)(Footer, {
|
|
279
|
+
addBlockToEndOfPost: addBlockToEndOfPost,
|
|
280
|
+
isReadOnly: isReadOnly,
|
|
281
|
+
renderFooterAppender: renderFooterAppender,
|
|
282
|
+
withFooter: withFooter
|
|
283
|
+
}),
|
|
284
|
+
onScroll: onScroll
|
|
285
|
+
}));
|
|
286
|
+
})) : (0, _element.createElement)(_element.Fragment, null, blockClientIds.length > 0 ? (0, _element.createElement)(_reactNative.View, {
|
|
287
|
+
style: [{
|
|
288
|
+
flex: 0
|
|
289
|
+
}, _style.default.overflowVisible]
|
|
290
|
+
}, (0, _element.createElement)(_reactNative.View, {
|
|
291
|
+
style: [...getStyles(isStackedHorizontally, horizontalAlignment), horizontal && _style.default.horizontalContentContainer]
|
|
292
|
+
}, blockClientIds.map((currentClientId, index) => {
|
|
293
|
+
return (0, _element.createElement)(_reactNative.View, {
|
|
294
|
+
key: currentClientId
|
|
295
|
+
}, renderItem({
|
|
296
|
+
item: currentClientId,
|
|
297
|
+
index
|
|
298
|
+
}));
|
|
299
|
+
}), (0, _element.createElement)(Footer, {
|
|
300
|
+
addBlockToEndOfPost: addBlockToEndOfPost,
|
|
301
|
+
isReadOnly: isReadOnly,
|
|
302
|
+
renderFooterAppender: renderFooterAppender,
|
|
303
|
+
withFooter: withFooter
|
|
304
|
+
}))) : (0, _element.createElement)(EmptyList, {
|
|
305
|
+
orientation: orientation,
|
|
306
|
+
rootClientId: rootClientId,
|
|
307
|
+
renderAppender: renderAppender,
|
|
308
|
+
renderFooterAppender: renderFooterAppender
|
|
309
|
+
})), shouldShowInnerBlockAppender() && (0, _element.createElement)(_reactNative.View, {
|
|
310
|
+
style: {
|
|
311
|
+
marginHorizontal: marginHorizontal - _style.default.innerAppender.marginLeft
|
|
312
|
+
}
|
|
313
|
+
}, (0, _element.createElement)(_blockListAppender.default, {
|
|
314
|
+
rootClientId: rootClientId,
|
|
315
|
+
renderAppender: renderAppender,
|
|
316
|
+
showSeparator: true
|
|
317
|
+
})));
|
|
322
318
|
}
|
|
323
319
|
|
|
324
|
-
function Footer(
|
|
320
|
+
function Footer(_ref5) {
|
|
325
321
|
let {
|
|
326
322
|
addBlockToEndOfPost,
|
|
327
323
|
isReadOnly,
|
|
328
324
|
renderFooterAppender,
|
|
329
325
|
withFooter
|
|
330
|
-
} =
|
|
326
|
+
} = _ref5;
|
|
331
327
|
|
|
332
328
|
if (!isReadOnly && withFooter) {
|
|
333
329
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_reactNative.TouchableWithoutFeedback, {
|
|
@@ -341,19 +337,19 @@ function Footer(_ref6) {
|
|
|
341
337
|
style: _style.default.blockListFooter
|
|
342
338
|
})));
|
|
343
339
|
} else if (renderFooterAppender) {
|
|
344
|
-
return renderFooterAppender();
|
|
340
|
+
return (0, _element.createElement)(_reactNative.View, null, renderFooterAppender());
|
|
345
341
|
}
|
|
346
342
|
|
|
347
343
|
return null;
|
|
348
344
|
}
|
|
349
345
|
|
|
350
|
-
function EmptyList(
|
|
346
|
+
function EmptyList(_ref6) {
|
|
351
347
|
let {
|
|
352
348
|
orientation,
|
|
353
349
|
renderAppender,
|
|
354
350
|
renderFooterAppender,
|
|
355
351
|
rootClientId
|
|
356
|
-
} =
|
|
352
|
+
} = _ref6;
|
|
357
353
|
const {
|
|
358
354
|
shouldShowInsertionPoint
|
|
359
355
|
} = (0, _data.useSelect)(select => {
|
|
@@ -372,19 +368,22 @@ function EmptyList(_ref7) {
|
|
|
372
368
|
!blockClientIds[insertionPoint.index])
|
|
373
369
|
};
|
|
374
370
|
});
|
|
371
|
+
const align = renderAppender ? _components.WIDE_ALIGNMENTS.alignments.full : undefined;
|
|
372
|
+
const [wrapperStyles] = (0, _useEditorWrapperStyles.useEditorWrapperStyles)({
|
|
373
|
+
align
|
|
374
|
+
});
|
|
375
375
|
|
|
376
376
|
if (renderFooterAppender || renderAppender === false) {
|
|
377
377
|
return null;
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
const containerStyles = [_style.default.defaultAppender, wrapperStyles];
|
|
380
381
|
return (0, _element.createElement)(_reactNative.View, {
|
|
381
|
-
style:
|
|
382
|
-
}, (0, _element.createElement)(_components.ReadableContentView, {
|
|
383
|
-
align: renderAppender ? _components.WIDE_ALIGNMENTS.alignments.full : undefined
|
|
382
|
+
style: containerStyles
|
|
384
383
|
}, (0, _element.createElement)(_blockListAppender.default, {
|
|
385
384
|
rootClientId: rootClientId,
|
|
386
385
|
renderAppender: renderAppender,
|
|
387
386
|
showSeparator: shouldShowInsertionPoint
|
|
388
|
-
}))
|
|
387
|
+
}));
|
|
389
388
|
}
|
|
390
389
|
//# sourceMappingURL=index.native.js.map
|