@wordpress/block-editor 12.17.0 → 12.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +32 -0
- package/build/components/block-draggable/index.js +11 -3
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-edit/context.js +3 -1
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/index.js +4 -2
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-editing-mode/index.js +6 -3
- package/build/components/block-editing-mode/index.js.map +1 -1
- package/build/components/block-inspector/index.js +5 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +4 -3
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +9 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +30 -4
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/private-block-context.js +1 -1
- package/build/components/block-list/private-block-context.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/toolbar.js +8 -2
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-popover/inbetween.js +15 -3
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-preview/auto.js +1 -1
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-removal-warning-modal/index.js +3 -2
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +2 -4
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +12 -1
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/index.js +119 -90
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +10 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +7 -1
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +5 -14
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +7 -1
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +3 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +31 -14
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +99 -0
- package/build/components/iframe/get-compatibility-styles.js.map +1 -0
- package/build/components/iframe/index.js +2 -3
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.js +16 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +16 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +2 -0
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +3 -0
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/link-control/link-preview.js +30 -26
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -9
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block-contents.js +3 -1
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block.js +10 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +29 -8
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +100 -32
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +52 -4
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +2 -2
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-list-view-block-indexes.js +30 -0
- package/build/components/list-view/use-list-view-block-indexes.js.map +1 -0
- package/build/components/list-view/use-list-view-drop-zone.js +56 -5
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +92 -0
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +21 -0
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/rich-text/index.js +30 -6
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +9 -9
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +30 -7
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +50 -8
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/hooks/block-hooks.js +5 -14
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/content-lock-ui.js +17 -42
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/effects.js +66 -0
- package/build/hooks/effects.js.map +1 -0
- package/build/hooks/index.js +15 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +13 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/style.js +6 -2
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +2 -1
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.native.js +2 -2
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +115 -0
- package/build/hooks/use-bindings-attributes.js.map +1 -0
- package/build/hooks/use-shadow-props.js +46 -0
- package/build/hooks/use-shadow-props.js.map +1 -0
- package/build/hooks/utils.js +11 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +14 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +10 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +2 -0
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +37 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +60 -9
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +44 -3
- package/build/store/reducer.js.map +1 -1
- package/build/store/resolvers.js +27 -0
- package/build/store/resolvers.js.map +1 -0
- package/build/store/selectors.js +94 -56
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -26
- package/build/store/utils.js.map +1 -1
- package/build/utils/index.js +0 -16
- package/build/utils/index.js.map +1 -1
- package/build/utils/math.js +13 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +17 -0
- package/build/utils/object.js.map +1 -1
- package/build/utils/transform-styles/index.js +37 -27
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +11 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-edit/context.js +1 -0
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/index.js +5 -3
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-editing-mode/index.js +7 -4
- package/build-module/components/block-editing-mode/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +5 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +6 -5
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +11 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +31 -5
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/private-block-context.js +1 -1
- package/build-module/components/block-list/private-block-context.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +8 -2
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +15 -3
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-preview/auto.js +3 -3
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-removal-warning-modal/index.js +3 -2
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -4
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +12 -1
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/index.js +116 -86
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +10 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +7 -1
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +5 -14
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +7 -1
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +3 -2
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +32 -15
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +93 -0
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -0
- package/build-module/components/iframe/index.js +2 -3
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +2 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +3 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +32 -28
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -8
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +3 -1
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block.js +10 -1
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +30 -9
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +99 -32
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +54 -6
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -2
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-list-view-block-indexes.js +23 -0
- package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -0
- package/build-module/components/list-view/use-list-view-drop-zone.js +58 -7
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +91 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +17 -0
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +30 -6
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +9 -9
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +31 -8
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +51 -9
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/hooks/block-hooks.js +5 -14
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +19 -43
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/effects.js +51 -0
- package/build-module/hooks/effects.js.map +1 -0
- package/build-module/hooks/index.js +3 -2
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/style.js +6 -2
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +2 -1
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.native.js +2 -2
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +112 -0
- package/build-module/hooks/use-bindings-attributes.js.map +1 -0
- package/build-module/hooks/use-shadow-props.js +39 -0
- package/build-module/hooks/use-shadow-props.js.map +1 -0
- package/build-module/hooks/utils.js +13 -9
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +10 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +2 -0
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +35 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +53 -8
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +43 -3
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/resolvers.js +20 -0
- package/build-module/store/resolvers.js.map +1 -0
- package/build-module/store/selectors.js +89 -52
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -23
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/index.js +0 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/math.js +12 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/object.js +16 -0
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +36 -27
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +33 -16
- package/build-style/content.css +33 -16
- package/build-style/default-editor-styles-rtl.css +1 -1
- package/build-style/default-editor-styles.css +1 -1
- package/build-style/style-rtl.css +169 -114
- package/build-style/style.css +169 -114
- package/package.json +31 -31
- package/src/components/block-canvas/style.scss +8 -1
- package/src/components/block-draggable/index.js +16 -5
- package/src/components/block-edit/context.js +1 -0
- package/src/components/block-edit/index.js +4 -0
- package/src/components/block-editing-mode/index.js +12 -7
- package/src/components/block-inspector/index.js +5 -2
- package/src/components/block-list/block.js +5 -4
- package/src/components/block-list/block.native.js +13 -3
- package/src/components/block-list/content.scss +34 -5
- package/src/components/block-list/index.js +52 -16
- package/src/components/block-list/private-block-context.js +1 -1
- package/src/components/block-list/use-in-between-inserter.js +1 -2
- package/src/components/block-lock/toolbar.js +10 -2
- package/src/components/block-popover/inbetween.js +22 -2
- package/src/components/block-preview/auto.js +3 -3
- package/src/components/block-removal-warning-modal/index.js +3 -2
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -7
- package/src/components/block-switcher/block-transformations-menu.js +18 -1
- package/src/components/block-switcher/index.js +133 -111
- package/src/components/block-switcher/style.scss +6 -4
- package/src/components/block-switcher/test/index.js +113 -230
- package/src/components/block-toolbar/style.scss +22 -18
- package/src/components/block-tools/insertion-point.js +15 -2
- package/src/components/block-tools/style.scss +8 -7
- package/src/components/font-sizes/fluid-utils.js +8 -2
- package/src/components/font-sizes/test/fluid-utils.js +9 -0
- package/src/components/global-styles/border-panel.js +7 -17
- package/src/components/global-styles/effects-panel.js +16 -1
- package/src/components/global-styles/hooks.js +2 -0
- package/src/components/global-styles/typography-panel.js +45 -13
- package/src/components/iframe/get-compatibility-styles.js +120 -0
- package/src/components/iframe/index.js +2 -3
- package/src/components/index.js +4 -2
- package/src/components/index.native.js +4 -2
- package/src/components/inspector-controls/groups.js +2 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -0
- package/src/components/link-control/link-preview.js +31 -55
- package/src/components/link-control/search-input.js +1 -9
- package/src/components/link-control/style.scss +31 -85
- package/src/components/link-control/test/index.js +2 -1
- package/src/components/list-view/block-contents.js +5 -1
- package/src/components/list-view/block.js +9 -0
- package/src/components/list-view/branch.js +30 -10
- package/src/components/list-view/drop-indicator.js +139 -46
- package/src/components/list-view/index.js +74 -3
- package/src/components/list-view/leaf.js +2 -2
- package/src/components/list-view/style.scss +102 -13
- package/src/components/list-view/test/use-list-view-drop-zone.js +4 -0
- package/src/components/list-view/test/utils.js +218 -1
- package/src/components/list-view/use-list-view-block-indexes.js +29 -0
- package/src/components/list-view/use-list-view-drop-zone.js +78 -6
- package/src/components/list-view/utils.js +116 -0
- package/src/components/provider/index.js +3 -1
- package/src/components/recursion-provider/README.md +2 -2
- package/src/components/recursion-provider/index.js +17 -0
- package/src/components/rich-text/index.js +48 -10
- package/src/components/rich-text/native/index.native.js +10 -10
- package/src/components/use-block-drop-zone/index.js +60 -19
- package/src/components/use-block-drop-zone/test/index.js +32 -61
- package/src/components/use-on-block-drop/index.js +92 -11
- package/src/hooks/block-hooks.js +5 -17
- package/src/hooks/content-lock-ui.js +15 -55
- package/src/hooks/effects.js +57 -0
- package/src/hooks/index.js +2 -2
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/style.js +8 -0
- package/src/hooks/supports.js +2 -0
- package/src/hooks/test/effects.js +39 -0
- package/src/hooks/typography.native.js +2 -2
- package/src/hooks/use-bindings-attributes.js +148 -0
- package/src/hooks/use-shadow-props.js +37 -0
- package/src/hooks/utils.js +26 -10
- package/src/index.js +2 -0
- package/src/store/actions.js +9 -4
- package/src/store/index.js +2 -0
- package/src/store/private-actions.js +32 -0
- package/src/store/private-selectors.js +78 -21
- package/src/store/reducer.js +49 -2
- package/src/store/resolvers.js +17 -0
- package/src/store/selectors.js +169 -161
- package/src/store/test/registry-selectors.js +431 -0
- package/src/store/test/selectors.js +14 -400
- package/src/store/utils.js +10 -33
- package/src/style.scss +0 -1
- package/src/utils/index.js +0 -1
- package/src/utils/math.js +12 -0
- package/src/utils/object.js +16 -0
- package/src/utils/transform-styles/index.js +52 -37
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/iframe/use-compatibility-styles.js +0 -100
- package/build/components/iframe/use-compatibility-styles.js.map +0 -1
- package/build/hooks/custom-fields.js +0 -106
- package/build/hooks/custom-fields.js.map +0 -1
- package/build/utils/block-variation-transforms.js +0 -42
- package/build/utils/block-variation-transforms.js.map +0 -1
- package/build-module/components/iframe/use-compatibility-styles.js +0 -94
- package/build-module/components/iframe/use-compatibility-styles.js.map +0 -1
- package/build-module/hooks/custom-fields.js +0 -99
- package/build-module/hooks/custom-fields.js.map +0 -1
- package/build-module/utils/block-variation-transforms.js +0 -35
- package/build-module/utils/block-variation-transforms.js.map +0 -1
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +0 -116
- package/src/components/contrast-checker/style.scss +0 -3
- package/src/components/iframe/use-compatibility-styles.js +0 -122
- package/src/hooks/custom-fields.js +0 -115
- package/src/utils/block-variation-transforms.js +0 -38
- package/src/utils/test/block-variation-transforms.js +0 -94
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Pressable","View","classnames","useCallback","useMemo","useState","useRef","GlobalStylesContext","getMergedGlobalStyles","useMobileGlobalStylesColors","useGlobalStyles","withFilters","__experimentalGetAccessibleBlockLabel","getAccessibleBlockLabel","getBlockType","getDefaultBlockName","isUnmodifiedBlock","isUnmodifiedDefaultBlock","switchToBlockType","useDispatch","useSelect","withDispatch","withSelect","compose","ifCondition","pure","BlockEdit","BlockDraggable","BlockInvalidWarning","BlockOutline","store","blockEditorStore","useLayout","useScrollUponInsertion","useSettings","EMPTY_ARRAY","mergeWrapperProps","propsA","propsB","newProps","hasOwnProperty","className","style","BlockWrapper","accessibilityLabel","blockCategory","children","clientId","draggingClientId","draggingEnabled","hasInnerBlocks","isDescendentBlockSelected","isRootList","isSelected","isTouchable","marginHorizontal","marginVertical","name","onFocus","blockWrapperStyles","flex","blockWrapperStyle","accessible","ref","isLayoutCalculated","setIsLayoutCalculated","elementRef","onLayout","createElement","accessibilityRole","disabled","onPress","enabled","testID","BlockListBlock","attributes","blockWidth","blockWrapperWidth","canRemove","contentStyle","isLocked","isSelectionEnabled","isStackedHorizontally","isValid","onDeleteBlock","onInsertBlocksAfter","onMerge","onReplace","parentBlockAlignment","parentWidth","rootClientId","setAttributes","toggleSelection","wrapperProps","baseGlobalStyles","blockType","isDescendantOfParentSelected","isParentSelected","order","mayDisplayControls","select","getBlockCount","getBlockHierarchyRootClientId","getBlockIndex","getBlockParents","getSelectedBlockClientId","getSettings","hasSelectedInnerBlock","getBlockName","isFirstMultiSelectedBlock","getMultiSelectedBlockClientIds","currentBlockType","currentBlockCategory","category","blockOrder","descendentBlockSelected","selectedBlockClientId","parents","parentSelected","selectedParents","descendantOfParentSelected","includes","blockHasInnerBlocks","isDraggingEnabled","currentDraggingClientId","globalStylesBaseStyles","__experimentalGlobalStylesBaseStyles","every","id","removeBlock","selectBlock","initialBlockWidth","setBlockWidth","parentLayout","defaultColors","globalStyle","fontSizes","onRemove","nativeEvent","layoutWidth","Math","floor","layout","width","getEditWrapperProps","mergedStyle","JSON","stringify","Object","fromEntries","entries","filter","key","BLOCK_STYLE_ATTRIBUTES","isFocused","Provider","value","insertBlocksAfter","undefined","mergeBlocks","__unstableParentLayout","keys","length","applyWithSelect","isBlockSelected","getBlockMode","getTemplateLock","__unstableGetBlockWithoutInnerBlocks","canRemoveBlock","canMoveBlock","block","templateLock","canMove","mode","applyWithDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","newAttributes","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockAttributes","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","firstClientId","batch","replacement","nextRootClientId","rootAttributes","previousRootAttributes","nextBlockClientId","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","selectionEnabled"],"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, View } from 'react-native';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState, useRef } from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\tuseGlobalStyles,\n\twithFilters,\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 BlockOutline from './block-outline';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport useScrollUponInsertion from './use-scroll-upon-insertion';\nimport { useSettings } from '../use-settings';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Merges wrapper props with special handling for classNames and styles.\n *\n * @param {Object} propsA\n * @param {Object} propsB\n *\n * @return {Object} Merged props.\n */\nfunction mergeWrapperProps( propsA, propsB ) {\n\tconst newProps = {\n\t\t...propsA,\n\t\t...propsB,\n\t};\n\n\t// May be set to undefined, so check if the property is set!\n\tif (\n\t\tpropsA?.hasOwnProperty( 'className' ) &&\n\t\tpropsB?.hasOwnProperty( 'className' )\n\t) {\n\t\tnewProps.className = classnames( propsA.className, propsB.className );\n\t}\n\n\tif (\n\t\tpropsA?.hasOwnProperty( 'style' ) &&\n\t\tpropsB?.hasOwnProperty( 'style' )\n\t) {\n\t\tnewProps.style = { ...propsA.style, ...propsB.style };\n\t}\n\n\treturn newProps;\n}\n\nfunction BlockWrapper( {\n\taccessibilityLabel,\n\tblockCategory,\n\tchildren,\n\tclientId,\n\tdraggingClientId,\n\tdraggingEnabled,\n\thasInnerBlocks,\n\tisDescendentBlockSelected,\n\tisRootList,\n\tisSelected,\n\tisTouchable,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonFocus,\n} ) {\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\tconst ref = useRef();\n\tconst [ isLayoutCalculated, setIsLayoutCalculated ] = useState();\n\tuseScrollUponInsertion( {\n\t\tclientId,\n\t\tisSelected,\n\t\tisLayoutCalculated,\n\t\telementRef: ref,\n\t} );\n\tconst onLayout = useCallback( () => {\n\t\tsetIsLayoutCalculated( true );\n\t}, [] );\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\tref={ ref }\n\t\t\tonLayout={ onLayout }\n\t\t>\n\t\t\t<BlockOutline\n\t\t\t\tblockCategory={ blockCategory }\n\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\tisRootList={ isRootList }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tname={ name }\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</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\twrapperProps,\n} ) {\n\tconst {\n\t\tbaseGlobalStyles,\n\t\tblockCategory,\n\t\tblockType,\n\t\tdraggingClientId,\n\t\tdraggingEnabled,\n\t\thasInnerBlocks,\n\t\tisDescendantOfParentSelected,\n\t\tisDescendentBlockSelected,\n\t\tisParentSelected,\n\t\torder,\n\t\tmayDisplayControls,\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\tgetBlockName,\n\t\t\t\tisFirstMultiSelectedBlock,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentBlockType = getBlockType( name || 'core/missing' );\n\t\t\tconst currentBlockCategory = currentBlockType?.category;\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 blockHasInnerBlocks = 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! blockHasInnerBlocks ||\n\t\t\t\tisSelected ||\n\t\t\t\t! 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\tblockCategory: currentBlockCategory,\n\t\t\t\tblockType: currentBlockType,\n\t\t\t\tdraggingClientId: currentDraggingClientId,\n\t\t\t\tdraggingEnabled: isDraggingEnabled,\n\t\t\t\thasInnerBlocks: blockHasInnerBlocks,\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\tmayDisplayControls:\n\t\t\t\t\tisSelected ||\n\t\t\t\t\t( isFirstMultiSelectedBlock( clientId ) &&\n\t\t\t\t\t\tgetMultiSelectedBlockClientIds().every(\n\t\t\t\t\t\t\t( id ) => getBlockName( id ) === name\n\t\t\t\t\t\t) ),\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 ] = useSettings( 'typography.fontSizes' );\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// Determine whether the block has props to apply to the wrapper.\n\tif ( blockType?.getEditWrapperProps ) {\n\t\twrapperProps = mergeWrapperProps(\n\t\t\twrapperProps,\n\t\t\tblockType.getEditWrapperProps( attributes )\n\t\t);\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 || EMPTY_ARRAY\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 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\tblockCategory={ blockCategory }\n\t\t\tclientId={ clientId }\n\t\t\tdraggingClientId={ draggingClientId }\n\t\t\tdraggingEnabled={ draggingEnabled }\n\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\tisDescendentBlockSelected={ isDescendentBlockSelected }\n\t\t\tisFocused={ isFocused }\n\t\t\tisRootList={ ! rootClientId }\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\tname={ name }\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\tonDeleteBlock={ onDeleteBlock }\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\tmayDisplayControls={ mayDisplayControls }\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} else {\n\t\t\t\t\tremoveBlock( clientId );\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\twithFilters( 'editor.BlockListBlock' )\n)( BlockListBlock );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,OAAOC,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AAC3E,SACCC,mBAAmB,EACnBC,qBAAqB,EACrBC,2BAA2B,EAC3BC,eAAe,EACfC,WAAW,QACL,uBAAuB;AAC9B,SACCC,qCAAqC,IAAIC,uBAAuB,EAChEC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,EACjBC,wBAAwB,EACxBC,iBAAiB,QACX,mBAAmB;AAC1B,SACCC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,UAAU,QACJ,iBAAiB;AACxB,SAASC,OAAO,EAAEC,WAAW,EAAEC,IAAI,QAAQ,oBAAoB;;AAE/D;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OA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,cAAe,CAAC,CAAC9E,KAAK,CAChCyB,GAAG,IACJqD,cAAc,CAAErD,GAAG,CAAE,KACrBsD,sBAAsB,CAAEtD,GAAG,CAC7B,CAAC,EACA;cACDyB,QAAQ,CAACyB,KAAK,CAAE,MAAM;gBACrBpB,oBAAoB,CACnBY,aAAa,CAAExG,YAAa,CAAC,EAC7BA,YAAY,EACZuH,oBACD,CAAC;gBACDhF,WAAW,CAAEvC,YAAY,EAAE,KAAM,CAAC;cACnC,CAAE,CAAC;cACH;YACD;UACD;UAEA2G,eAAe,CAAE3G,YAAa,CAAC;QAChC,CAAC,MAAM;UACNuC,WAAW,CAAElF,QAAS,CAAC;QACxB;MACD;IACD,CAAC;IACDwC,SAASA,CAAEoG,MAAM,EAAEuB,aAAa,EAAEC,eAAe,EAAG;MACnD,IACCxB,MAAM,CAACzB,MAAM,IACb,CAAEjJ,wBAAwB,CAAE0K,MAAM,CAAEA,MAAM,CAACzB,MAAM,GAAG,CAAC,CAAG,CAAC,EACxD;QACDmB,oCAAoC,CAAC,CAAC;MACvC;MACAD,aAAa,CACZ,CAAEJ,QAAQ,CAACjI,QAAQ,CAAE,EACrB4I,MAAM,EACNuB,aAAa,EACbC,eACD,CAAC;IACF,CAAC;IACDvH,eAAeA,CAAEwH,gBAAgB,EAAG;MACnCxH,eAAe,CAAEwH,gBAAiB,CAAC;IACpC;EACD,CAAC;AACF,CAAE,CAAC;AAEH,eAAe7L,OAAO,CACrBE,IAAI,EACJ0I,eAAe,EACfW,iBAAiB;AACjB;AACA;AACA;AACAtJ,WAAW,CAAE,CAAE;EAAEkJ;AAAM,CAAC,KAAM,CAAC,CAAEA,KAAM,CAAC,EACxC/J,WAAW,CAAE,uBAAwB,CACtC,CAAC,CAAE+D,cAAe,CAAC"}
|
|
1
|
+
{"version":3,"names":["Pressable","View","classnames","useCallback","useMemo","useState","useRef","memo","GlobalStylesContext","getMergedGlobalStyles","useMobileGlobalStylesColors","useGlobalStyles","withFilters","__experimentalGetAccessibleBlockLabel","getAccessibleBlockLabel","getBlockType","getDefaultBlockName","isUnmodifiedBlock","isUnmodifiedDefaultBlock","switchToBlockType","useDispatch","useSelect","withDispatch","withSelect","compose","ifCondition","BlockEdit","BlockDraggable","BlockInvalidWarning","BlockOutline","store","blockEditorStore","useLayout","useScrollUponInsertion","useSettings","EMPTY_ARRAY","mergeWrapperProps","propsA","propsB","newProps","hasOwnProperty","className","style","BlockWrapper","accessibilityLabel","blockCategory","children","clientId","draggingClientId","draggingEnabled","hasInnerBlocks","isDescendentBlockSelected","isRootList","isSelected","isTouchable","marginHorizontal","marginVertical","name","onFocus","blockWrapperStyles","flex","blockWrapperStyle","accessible","ref","isLayoutCalculated","setIsLayoutCalculated","elementRef","onLayout","createElement","accessibilityRole","disabled","onPress","enabled","testID","BlockListBlock","attributes","blockWidth","blockWrapperWidth","canRemove","contentStyle","isLocked","isSelectionEnabled","isStackedHorizontally","isValid","onDeleteBlock","onInsertBlocksAfter","onMerge","onReplace","parentBlockAlignment","parentWidth","rootClientId","setAttributes","toggleSelection","wrapperProps","baseGlobalStyles","blockType","isDescendantOfParentSelected","isParentSelected","order","mayDisplayControls","blockEditingMode","select","getBlockCount","getBlockHierarchyRootClientId","getBlockIndex","getBlockParents","getSelectedBlockClientId","getSettings","hasSelectedInnerBlock","getBlockName","isFirstMultiSelectedBlock","getMultiSelectedBlockClientIds","getBlockEditingMode","currentBlockType","currentBlockCategory","category","blockOrder","descendentBlockSelected","selectedBlockClientId","parents","parentSelected","selectedParents","descendantOfParentSelected","includes","blockHasInnerBlocks","isDraggingEnabled","currentDraggingClientId","globalStylesBaseStyles","__experimentalGlobalStylesBaseStyles","every","id","removeBlock","selectBlock","initialBlockWidth","setBlockWidth","parentLayout","defaultColors","globalStyle","fontSizes","onRemove","nativeEvent","layoutWidth","Math","floor","layout","width","getEditWrapperProps","mergedStyle","JSON","stringify","Object","fromEntries","entries","filter","key","BLOCK_STYLE_ATTRIBUTES","isFocused","Provider","value","insertBlocksAfter","undefined","mergeBlocks","__unstableParentLayout","keys","length","applyWithSelect","isBlockSelected","getBlockMode","getTemplateLock","__unstableGetBlockWithoutInnerBlocks","canRemoveBlock","canMoveBlock","block","templateLock","canMove","mode","applyWithDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","newAttributes","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockAttributes","getBlockOrder","getBlockRootClientId","canInsertBlockType","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","firstClientId","batch","replacement","nextRootClientId","rootAttributes","previousRootAttributes","nextBlockClientId","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","selectionEnabled"],"sources":["@wordpress/block-editor/src/components/block-list/block.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, View } from 'react-native';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tmemo,\n} from '@wordpress/element';\nimport {\n\tGlobalStylesContext,\n\tgetMergedGlobalStyles,\n\tuseMobileGlobalStylesColors,\n\tuseGlobalStyles,\n\twithFilters,\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 } 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 BlockOutline from './block-outline';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport useScrollUponInsertion from './use-scroll-upon-insertion';\nimport { useSettings } from '../use-settings';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Merges wrapper props with special handling for classNames and styles.\n *\n * @param {Object} propsA\n * @param {Object} propsB\n *\n * @return {Object} Merged props.\n */\nfunction mergeWrapperProps( propsA, propsB ) {\n\tconst newProps = {\n\t\t...propsA,\n\t\t...propsB,\n\t};\n\n\t// May be set to undefined, so check if the property is set!\n\tif (\n\t\tpropsA?.hasOwnProperty( 'className' ) &&\n\t\tpropsB?.hasOwnProperty( 'className' )\n\t) {\n\t\tnewProps.className = classnames( propsA.className, propsB.className );\n\t}\n\n\tif (\n\t\tpropsA?.hasOwnProperty( 'style' ) &&\n\t\tpropsB?.hasOwnProperty( 'style' )\n\t) {\n\t\tnewProps.style = { ...propsA.style, ...propsB.style };\n\t}\n\n\treturn newProps;\n}\n\nfunction BlockWrapper( {\n\taccessibilityLabel,\n\tblockCategory,\n\tchildren,\n\tclientId,\n\tdraggingClientId,\n\tdraggingEnabled,\n\thasInnerBlocks,\n\tisDescendentBlockSelected,\n\tisRootList,\n\tisSelected,\n\tisTouchable,\n\tmarginHorizontal,\n\tmarginVertical,\n\tname,\n\tonFocus,\n} ) {\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\tconst ref = useRef();\n\tconst [ isLayoutCalculated, setIsLayoutCalculated ] = useState();\n\tuseScrollUponInsertion( {\n\t\tclientId,\n\t\tisSelected,\n\t\tisLayoutCalculated,\n\t\telementRef: ref,\n\t} );\n\tconst onLayout = useCallback( () => {\n\t\tsetIsLayoutCalculated( true );\n\t}, [] );\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\tref={ ref }\n\t\t\tonLayout={ onLayout }\n\t\t>\n\t\t\t<BlockOutline\n\t\t\t\tblockCategory={ blockCategory }\n\t\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\t\tisRootList={ isRootList }\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tname={ name }\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</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\twrapperProps,\n} ) {\n\tconst {\n\t\tbaseGlobalStyles,\n\t\tblockCategory,\n\t\tblockType,\n\t\tdraggingClientId,\n\t\tdraggingEnabled,\n\t\thasInnerBlocks,\n\t\tisDescendantOfParentSelected,\n\t\tisDescendentBlockSelected,\n\t\tisParentSelected,\n\t\torder,\n\t\tmayDisplayControls,\n\t\tblockEditingMode,\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\tgetBlockName,\n\t\t\t\tisFirstMultiSelectedBlock,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentBlockType = getBlockType( name || 'core/missing' );\n\t\t\tconst currentBlockCategory = currentBlockType?.category;\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 blockHasInnerBlocks = 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! blockHasInnerBlocks ||\n\t\t\t\tisSelected ||\n\t\t\t\t! 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\tblockCategory: currentBlockCategory,\n\t\t\t\tblockType: currentBlockType,\n\t\t\t\tdraggingClientId: currentDraggingClientId,\n\t\t\t\tdraggingEnabled: isDraggingEnabled,\n\t\t\t\thasInnerBlocks: blockHasInnerBlocks,\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\tmayDisplayControls:\n\t\t\t\t\tisSelected ||\n\t\t\t\t\t( isFirstMultiSelectedBlock( clientId ) &&\n\t\t\t\t\t\tgetMultiSelectedBlockClientIds().every(\n\t\t\t\t\t\t\t( id ) => getBlockName( id ) === name\n\t\t\t\t\t\t) ),\n\t\t\t\tblockEditingMode: getBlockEditingMode( clientId ),\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 ] = useSettings( 'typography.fontSizes' );\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// Determine whether the block has props to apply to the wrapper.\n\tif ( blockType?.getEditWrapperProps ) {\n\t\twrapperProps = mergeWrapperProps(\n\t\t\twrapperProps,\n\t\t\tblockType.getEditWrapperProps( attributes )\n\t\t);\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 || EMPTY_ARRAY\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 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\tblockCategory={ blockCategory }\n\t\t\tclientId={ clientId }\n\t\t\tdraggingClientId={ draggingClientId }\n\t\t\tdraggingEnabled={ draggingEnabled }\n\t\t\thasInnerBlocks={ hasInnerBlocks }\n\t\t\tisDescendentBlockSelected={ isDescendentBlockSelected }\n\t\t\tisFocused={ isFocused }\n\t\t\tisRootList={ ! rootClientId }\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\tname={ name }\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\tonDeleteBlock={ onDeleteBlock }\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\tmayDisplayControls={ mayDisplayControls }\n\t\t\t\t\t\t\tblockEditingMode={ blockEditingMode }\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} else {\n\t\t\t\t\tremoveBlock( clientId );\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\tmemo,\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\twithFilters( 'editor.BlockListBlock' )\n)( BlockListBlock );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,OAAOC,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,WAAW,EACXC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,IAAI,QACE,oBAAoB;AAC3B,SACCC,mBAAmB,EACnBC,qBAAqB,EACrBC,2BAA2B,EAC3BC,eAAe,EACfC,WAAW,QACL,uBAAuB;AAC9B,SACCC,qCAAqC,IAAIC,uBAAuB,EAChEC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,EACjBC,wBAAwB,EACxBC,iBAAiB,QACX,mBAAmB;AAC1B,SACCC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,UAAU,QACJ,iBAAiB;AACxB,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;;AAEzD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,SAAS,QAAQ,UAAU;AACpC,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,MAAMC,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAAEC,MAAM,EAAEC,MAAM,EAAG;EAC5C,MAAMC,QAAQ,GAAG;IAChB,GAAGF,MAAM;IACT,GAAGC;EACJ,CAAC;;EAED;EACA,IACCD,MAAM,EAAEG,cAAc,CAAE,WAAY,CAAC,IACrCF,MAAM,EAAEE,cAAc,CAAE,WAAY,CAAC,EACpC;IACDD,QAAQ,CAACE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AEpF,QAAS,CAAC;QACxB;MACD;IACD,CAAC;IACDwC,SAASA,CAAEsG,MAAM,EAAEuB,aAAa,EAAEC,eAAe,EAAG;MACnD,IACCxB,MAAM,CAACzB,MAAM,IACb,CAAElJ,wBAAwB,CAAE2K,MAAM,CAAEA,MAAM,CAACzB,MAAM,GAAG,CAAC,CAAG,CAAC,EACxD;QACDmB,oCAAoC,CAAC,CAAC;MACvC;MACAD,aAAa,CACZ,CAAEJ,QAAQ,CAACnI,QAAQ,CAAE,EACrB8I,MAAM,EACNuB,aAAa,EACbC,eACD,CAAC;IACF,CAAC;IACDzH,eAAeA,CAAE0H,gBAAgB,EAAG;MACnC1H,eAAe,CAAE0H,gBAAiB,CAAC;IACpC;EACD,CAAC;AACF,CAAE,CAAC;AAEH,eAAe9L,OAAO,CACrBjB,IAAI,EACJ8J,eAAe,EACfW,iBAAiB;AACjB;AACA;AACA;AACAvJ,WAAW,CAAE,CAAE;EAAEmJ;AAAM,CAAC,KAAM,CAAC,CAAEA,KAAM,CAAC,EACxChK,WAAW,CAAE,uBAAwB,CACtC,CAAC,CAAE8D,cAAe,CAAC"}
|
|
@@ -9,7 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
*/
|
|
10
10
|
import { AsyncModeProvider, useSelect, useDispatch, useRegistry } from '@wordpress/data';
|
|
11
11
|
import { useViewportMatch, useMergeRefs, useDebounce } from '@wordpress/compose';
|
|
12
|
-
import { createContext, useMemo, useCallback } from '@wordpress/element';
|
|
12
|
+
import { createContext, useMemo, useCallback, useEffect } from '@wordpress/element';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
@@ -23,6 +23,7 @@ import { useBlockSelectionClearer } from '../block-selection-clearer';
|
|
|
23
23
|
import { useInnerBlocksProps } from '../inner-blocks';
|
|
24
24
|
import { BlockEditContextProvider, DEFAULT_BLOCK_EDIT_CONTEXT } from '../block-edit/context';
|
|
25
25
|
import { useTypingObserver } from '../observe-typing';
|
|
26
|
+
import { unlock } from '../../lock-unlock';
|
|
26
27
|
export const IntersectionObserver = createContext();
|
|
27
28
|
const pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();
|
|
28
29
|
function Root({
|
|
@@ -94,6 +95,26 @@ function Root({
|
|
|
94
95
|
...innerBlocksProps
|
|
95
96
|
}));
|
|
96
97
|
}
|
|
98
|
+
function StopEditingAsBlocksOnOutsideSelect({
|
|
99
|
+
clientId
|
|
100
|
+
}) {
|
|
101
|
+
const {
|
|
102
|
+
stopEditingAsBlocks
|
|
103
|
+
} = unlock(useDispatch(blockEditorStore));
|
|
104
|
+
const isBlockOrDescendantSelected = useSelect(select => {
|
|
105
|
+
const {
|
|
106
|
+
isBlockSelected,
|
|
107
|
+
hasSelectedInnerBlock
|
|
108
|
+
} = select(blockEditorStore);
|
|
109
|
+
return isBlockSelected(clientId) || hasSelectedInnerBlock(clientId, true);
|
|
110
|
+
}, [clientId]);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (!isBlockOrDescendantSelected) {
|
|
113
|
+
stopEditingAsBlocks(clientId);
|
|
114
|
+
}
|
|
115
|
+
}, [isBlockOrDescendantSelected, clientId, stopEditingAsBlocks]);
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
97
118
|
export default function BlockList(settings) {
|
|
98
119
|
return createElement(BlockEditContextProvider, {
|
|
99
120
|
value: DEFAULT_BLOCK_EDIT_CONTEXT
|
|
@@ -111,17 +132,20 @@ function Items({
|
|
|
111
132
|
const {
|
|
112
133
|
order,
|
|
113
134
|
selectedBlocks,
|
|
114
|
-
visibleBlocks
|
|
135
|
+
visibleBlocks,
|
|
136
|
+
temporarilyEditingAsBlocks
|
|
115
137
|
} = useSelect(select => {
|
|
116
138
|
const {
|
|
117
139
|
getBlockOrder,
|
|
118
140
|
getSelectedBlockClientIds,
|
|
119
|
-
__unstableGetVisibleBlocks
|
|
141
|
+
__unstableGetVisibleBlocks,
|
|
142
|
+
__unstableGetTemporarilyEditingAsBlocks
|
|
120
143
|
} = select(blockEditorStore);
|
|
121
144
|
return {
|
|
122
145
|
order: getBlockOrder(rootClientId),
|
|
123
146
|
selectedBlocks: getSelectedBlockClientIds(),
|
|
124
|
-
visibleBlocks: __unstableGetVisibleBlocks()
|
|
147
|
+
visibleBlocks: __unstableGetVisibleBlocks(),
|
|
148
|
+
temporarilyEditingAsBlocks: __unstableGetTemporarilyEditingAsBlocks()
|
|
125
149
|
};
|
|
126
150
|
}, [rootClientId]);
|
|
127
151
|
return createElement(LayoutProvider, {
|
|
@@ -135,7 +159,9 @@ function Items({
|
|
|
135
159
|
}, createElement(BlockListBlock, {
|
|
136
160
|
rootClientId: rootClientId,
|
|
137
161
|
clientId: clientId
|
|
138
|
-
}))), order.length < 1 && placeholder, createElement(
|
|
162
|
+
}))), order.length < 1 && placeholder, !!temporarilyEditingAsBlocks && createElement(StopEditingAsBlocksOnOutsideSelect, {
|
|
163
|
+
clientId: temporarilyEditingAsBlocks
|
|
164
|
+
}), createElement(BlockListAppender, {
|
|
139
165
|
tagName: __experimentalAppenderTagName,
|
|
140
166
|
rootClientId: rootClientId,
|
|
141
167
|
renderAppender: renderAppender
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","AsyncModeProvider","useSelect","useDispatch","useRegistry","useViewportMatch","useMergeRefs","useDebounce","createContext","useMemo","useCallback","BlockListBlock","BlockListAppender","useInBetweenInserter","store","blockEditorStore","LayoutProvider","defaultLayout","useBlockSelectionClearer","useInnerBlocksProps","BlockEditContextProvider","DEFAULT_BLOCK_EDIT_CONTEXT","useTypingObserver","IntersectionObserver","pendingBlockVisibilityUpdatesPerRegistry","WeakMap","Root","className","settings","isLargeViewport","isOutlineMode","isFocusMode","editorMode","select","getSettings","__unstableGetEditorMode","outlineMode","focusMode","registry","setBlockVisibility","delayedBlockVisibilityUpdates","updates","get","forEach","id","isIntersecting","trailing","intersectionObserver","Observer","window","entries","set","entry","clientId","target","getAttribute","push","innerBlocksProps","ref","createElement","Provider","value","BlockList","Items","placeholder","rootClientId","renderAppender","__experimentalAppenderTagName","layout","order","selectedBlocks","visibleBlocks","getBlockOrder","getSelectedBlockClientIds","__unstableGetVisibleBlocks","map","key","has","includes","length","tagName","BlockListItems","props"],"sources":["@wordpress/block-editor/src/components/block-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAsyncModeProvider,\n\tuseSelect,\n\tuseDispatch,\n\tuseRegistry,\n} from '@wordpress/data';\nimport {\n\tuseViewportMatch,\n\tuseMergeRefs,\n\tuseDebounce,\n} from '@wordpress/compose';\nimport { createContext, useMemo, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockListBlock from './block';\nimport BlockListAppender from '../block-list-appender';\nimport { useInBetweenInserter } from './use-in-between-inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { LayoutProvider, defaultLayout } from './layout';\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useInnerBlocksProps } from '../inner-blocks';\nimport {\n\tBlockEditContextProvider,\n\tDEFAULT_BLOCK_EDIT_CONTEXT,\n} from '../block-edit/context';\nimport { useTypingObserver } from '../observe-typing';\n\nexport const IntersectionObserver = createContext();\nconst pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();\n\nfunction Root( { className, ...settings } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { isOutlineMode, isFocusMode, editorMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, __unstableGetEditorMode } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { outlineMode, focusMode } = getSettings();\n\t\t\treturn {\n\t\t\t\tisOutlineMode: outlineMode,\n\t\t\t\tisFocusMode: focusMode,\n\t\t\t\teditorMode: __unstableGetEditorMode(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst registry = useRegistry();\n\tconst { setBlockVisibility } = useDispatch( blockEditorStore );\n\n\tconst delayedBlockVisibilityUpdates = useDebounce(\n\t\tuseCallback( () => {\n\t\t\tconst updates = {};\n\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t.get( registry )\n\t\t\t\t.forEach( ( [ id, isIntersecting ] ) => {\n\t\t\t\t\tupdates[ id ] = isIntersecting;\n\t\t\t\t} );\n\t\t\tsetBlockVisibility( updates );\n\t\t}, [ registry ] ),\n\t\t300,\n\t\t{\n\t\t\ttrailing: true,\n\t\t}\n\t);\n\tconst intersectionObserver = useMemo( () => {\n\t\tconst { IntersectionObserver: Observer } = window;\n\n\t\tif ( ! Observer ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Observer( ( entries ) => {\n\t\t\tif ( ! pendingBlockVisibilityUpdatesPerRegistry.get( registry ) ) {\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry.set( registry, [] );\n\t\t\t}\n\t\t\tfor ( const entry of entries ) {\n\t\t\t\tconst clientId = entry.target.getAttribute( 'data-block' );\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t\t.get( registry )\n\t\t\t\t\t.push( [ clientId, entry.isIntersecting ] );\n\t\t\t}\n\t\t\tdelayedBlockVisibilityUpdates();\n\t\t} );\n\t}, [] );\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tref: useMergeRefs( [\n\t\t\t\tuseBlockSelectionClearer(),\n\t\t\t\tuseInBetweenInserter(),\n\t\t\t\tuseTypingObserver(),\n\t\t\t] ),\n\t\t\tclassName: classnames( 'is-root-container', className, {\n\t\t\t\t'is-outline-mode': isOutlineMode,\n\t\t\t\t'is-focus-mode': isFocusMode && isLargeViewport,\n\t\t\t\t'is-navigate-mode': editorMode === 'navigation',\n\t\t\t} ),\n\t\t},\n\t\tsettings\n\t);\n\treturn (\n\t\t<IntersectionObserver.Provider value={ intersectionObserver }>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</IntersectionObserver.Provider>\n\t);\n}\n\nexport default function BlockList( settings ) {\n\treturn (\n\t\t<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>\n\t\t\t<Root { ...settings } />\n\t\t</BlockEditContextProvider>\n\t);\n}\n\nfunction Items( {\n\tplaceholder,\n\trootClientId,\n\trenderAppender,\n\t__experimentalAppenderTagName,\n\tlayout = defaultLayout,\n} ) {\n\tconst { order, selectedBlocks, visibleBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t__unstableGetVisibleBlocks,\n\t\t\t} = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\torder: getBlockOrder( rootClientId ),\n\t\t\t\tselectedBlocks: getSelectedBlockClientIds(),\n\t\t\t\tvisibleBlocks: __unstableGetVisibleBlocks(),\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t{ order.map( ( clientId ) => (\n\t\t\t\t<AsyncModeProvider\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t// Only provide data asynchronously if the block is\n\t\t\t\t\t\t// not visible and not selected.\n\t\t\t\t\t\t! visibleBlocks.has( clientId ) &&\n\t\t\t\t\t\t! selectedBlocks.includes( clientId )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<BlockListBlock\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</AsyncModeProvider>\n\t\t\t) ) }\n\t\t\t{ order.length < 1 && placeholder }\n\t\t\t<BlockListAppender\n\t\t\t\ttagName={ __experimentalAppenderTagName }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t/>\n\t\t</LayoutProvider>\n\t);\n}\n\nexport function BlockListItems( props ) {\n\t// This component needs to always be synchronous as it's the one changing\n\t// the async mode depending on the block selection.\n\treturn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AAY,CACf,CAAC;EAED,OACCN,aAAA,CAAC3C,cAAc;IAAC6C,KAAK,EAAGO;EAAQ,GAC7BC,KAAK,CAACM,GAAG,CAAItB,QAAQ,IACtBM,aAAA,CAAC1D,iBAAiB;IACjB2E,GAAG,EAAGvB,QAAU;IAChBQ,KAAK;IACJ;IACA;IACA,CAAEU,aAAa,CAACM,GAAG,CAAExB,QAAS,CAAC,IAC/B,CAAEiB,cAAc,CAACQ,QAAQ,CAAEzB,QAAS;EACpC,GAEDM,aAAA,CAAChD,cAAc;IACdsD,YAAY,EAAGA,YAAc;IAC7BZ,QAAQ,EAAGA;EAAU,CACrB,CACiB,CAClB,CAAC,EACDgB,KAAK,CAACU,MAAM,GAAG,CAAC,IAAIf,WAAW,EACjCL,aAAA,CAAC/C,iBAAiB;IACjBoE,OAAO,EAAGb,6BAA+B;IACzCF,YAAY,EAAGA,YAAc;IAC7BC,cAAc,EAAGA;EAAgB,CACjC,CACc,CAAC;AAEnB;AAEA,OAAO,SAASe,cAAcA,CAAEC,KAAK,EAAG;EACvC;EACA;EACA,OACCvB,aAAA,CAAC1D,iBAAiB;IAAC4D,KAAK,EAAG;EAAO,GACjCF,aAAA,CAACI,KAAK;IAAA,GAAMmB;EAAK,CAAI,CACH,CAAC;AAEtB"}
|
|
1
|
+
{"version":3,"names":["classnames","AsyncModeProvider","useSelect","useDispatch","useRegistry","useViewportMatch","useMergeRefs","useDebounce","createContext","useMemo","useCallback","useEffect","BlockListBlock","BlockListAppender","useInBetweenInserter","store","blockEditorStore","LayoutProvider","defaultLayout","useBlockSelectionClearer","useInnerBlocksProps","BlockEditContextProvider","DEFAULT_BLOCK_EDIT_CONTEXT","useTypingObserver","unlock","IntersectionObserver","pendingBlockVisibilityUpdatesPerRegistry","WeakMap","Root","className","settings","isLargeViewport","isOutlineMode","isFocusMode","editorMode","select","getSettings","__unstableGetEditorMode","outlineMode","focusMode","registry","setBlockVisibility","delayedBlockVisibilityUpdates","updates","get","forEach","id","isIntersecting","trailing","intersectionObserver","Observer","window","entries","set","entry","clientId","target","getAttribute","push","innerBlocksProps","ref","createElement","Provider","value","StopEditingAsBlocksOnOutsideSelect","stopEditingAsBlocks","isBlockOrDescendantSelected","isBlockSelected","hasSelectedInnerBlock","BlockList","Items","placeholder","rootClientId","renderAppender","__experimentalAppenderTagName","layout","order","selectedBlocks","visibleBlocks","temporarilyEditingAsBlocks","getBlockOrder","getSelectedBlockClientIds","__unstableGetVisibleBlocks","__unstableGetTemporarilyEditingAsBlocks","map","key","has","includes","length","tagName","BlockListItems","props"],"sources":["@wordpress/block-editor/src/components/block-list/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAsyncModeProvider,\n\tuseSelect,\n\tuseDispatch,\n\tuseRegistry,\n} from '@wordpress/data';\nimport {\n\tuseViewportMatch,\n\tuseMergeRefs,\n\tuseDebounce,\n} from '@wordpress/compose';\nimport {\n\tcreateContext,\n\tuseMemo,\n\tuseCallback,\n\tuseEffect,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockListBlock from './block';\nimport BlockListAppender from '../block-list-appender';\nimport { useInBetweenInserter } from './use-in-between-inserter';\nimport { store as blockEditorStore } from '../../store';\nimport { LayoutProvider, defaultLayout } from './layout';\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useInnerBlocksProps } from '../inner-blocks';\nimport {\n\tBlockEditContextProvider,\n\tDEFAULT_BLOCK_EDIT_CONTEXT,\n} from '../block-edit/context';\nimport { useTypingObserver } from '../observe-typing';\nimport { unlock } from '../../lock-unlock';\n\nexport const IntersectionObserver = createContext();\nconst pendingBlockVisibilityUpdatesPerRegistry = new WeakMap();\n\nfunction Root( { className, ...settings } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { isOutlineMode, isFocusMode, editorMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, __unstableGetEditorMode } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { outlineMode, focusMode } = getSettings();\n\t\t\treturn {\n\t\t\t\tisOutlineMode: outlineMode,\n\t\t\t\tisFocusMode: focusMode,\n\t\t\t\teditorMode: __unstableGetEditorMode(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst registry = useRegistry();\n\tconst { setBlockVisibility } = useDispatch( blockEditorStore );\n\n\tconst delayedBlockVisibilityUpdates = useDebounce(\n\t\tuseCallback( () => {\n\t\t\tconst updates = {};\n\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t.get( registry )\n\t\t\t\t.forEach( ( [ id, isIntersecting ] ) => {\n\t\t\t\t\tupdates[ id ] = isIntersecting;\n\t\t\t\t} );\n\t\t\tsetBlockVisibility( updates );\n\t\t}, [ registry ] ),\n\t\t300,\n\t\t{\n\t\t\ttrailing: true,\n\t\t}\n\t);\n\tconst intersectionObserver = useMemo( () => {\n\t\tconst { IntersectionObserver: Observer } = window;\n\n\t\tif ( ! Observer ) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Observer( ( entries ) => {\n\t\t\tif ( ! pendingBlockVisibilityUpdatesPerRegistry.get( registry ) ) {\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry.set( registry, [] );\n\t\t\t}\n\t\t\tfor ( const entry of entries ) {\n\t\t\t\tconst clientId = entry.target.getAttribute( 'data-block' );\n\t\t\t\tpendingBlockVisibilityUpdatesPerRegistry\n\t\t\t\t\t.get( registry )\n\t\t\t\t\t.push( [ clientId, entry.isIntersecting ] );\n\t\t\t}\n\t\t\tdelayedBlockVisibilityUpdates();\n\t\t} );\n\t}, [] );\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tref: useMergeRefs( [\n\t\t\t\tuseBlockSelectionClearer(),\n\t\t\t\tuseInBetweenInserter(),\n\t\t\t\tuseTypingObserver(),\n\t\t\t] ),\n\t\t\tclassName: classnames( 'is-root-container', className, {\n\t\t\t\t'is-outline-mode': isOutlineMode,\n\t\t\t\t'is-focus-mode': isFocusMode && isLargeViewport,\n\t\t\t\t'is-navigate-mode': editorMode === 'navigation',\n\t\t\t} ),\n\t\t},\n\t\tsettings\n\t);\n\treturn (\n\t\t<IntersectionObserver.Provider value={ intersectionObserver }>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</IntersectionObserver.Provider>\n\t);\n}\n\nfunction StopEditingAsBlocksOnOutsideSelect( { clientId } ) {\n\tconst { stopEditingAsBlocks } = unlock( useDispatch( blockEditorStore ) );\n\tconst isBlockOrDescendantSelected = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isBlockSelected, hasSelectedInnerBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\tisBlockSelected( clientId ) ||\n\t\t\t\thasSelectedInnerBlock( clientId, true )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tuseEffect( () => {\n\t\tif ( ! isBlockOrDescendantSelected ) {\n\t\t\tstopEditingAsBlocks( clientId );\n\t\t}\n\t}, [ isBlockOrDescendantSelected, clientId, stopEditingAsBlocks ] );\n\treturn null;\n}\n\nexport default function BlockList( settings ) {\n\treturn (\n\t\t<BlockEditContextProvider value={ DEFAULT_BLOCK_EDIT_CONTEXT }>\n\t\t\t<Root { ...settings } />\n\t\t</BlockEditContextProvider>\n\t);\n}\n\nfunction Items( {\n\tplaceholder,\n\trootClientId,\n\trenderAppender,\n\t__experimentalAppenderTagName,\n\tlayout = defaultLayout,\n} ) {\n\tconst { order, selectedBlocks, visibleBlocks, temporarilyEditingAsBlocks } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetBlockOrder,\n\t\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t\t__unstableGetVisibleBlocks,\n\t\t\t\t\t__unstableGetTemporarilyEditingAsBlocks,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\treturn {\n\t\t\t\t\torder: getBlockOrder( rootClientId ),\n\t\t\t\t\tselectedBlocks: getSelectedBlockClientIds(),\n\t\t\t\t\tvisibleBlocks: __unstableGetVisibleBlocks(),\n\t\t\t\t\ttemporarilyEditingAsBlocks:\n\t\t\t\t\t\t__unstableGetTemporarilyEditingAsBlocks(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ rootClientId ]\n\t\t);\n\n\treturn (\n\t\t<LayoutProvider value={ layout }>\n\t\t\t{ order.map( ( clientId ) => (\n\t\t\t\t<AsyncModeProvider\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\t// Only provide data asynchronously if the block is\n\t\t\t\t\t\t// not visible and not selected.\n\t\t\t\t\t\t! visibleBlocks.has( clientId ) &&\n\t\t\t\t\t\t! selectedBlocks.includes( clientId )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<BlockListBlock\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</AsyncModeProvider>\n\t\t\t) ) }\n\t\t\t{ order.length < 1 && placeholder }\n\t\t\t{ !! temporarilyEditingAsBlocks && (\n\t\t\t\t<StopEditingAsBlocksOnOutsideSelect\n\t\t\t\t\tclientId={ temporarilyEditingAsBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<BlockListAppender\n\t\t\t\ttagName={ __experimentalAppenderTagName }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t/>\n\t\t</LayoutProvider>\n\t);\n}\n\nexport function BlockListItems( props ) {\n\t// This component needs to always be synchronous as it's the one changing\n\t// the async mode depending on the block selection.\n\treturn (\n\t\t<AsyncModeProvider value={ false }>\n\t\t\t<Items { ...props } />\n\t\t</AsyncModeProvider>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,SAAS,EACTC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AAgB,CACjC,CACc,CAAC;AAEnB;AAEA,OAAO,SAASiB,cAAcA,CAAEC,KAAK,EAAG;EACvC;EACA;EACA,OACC9B,aAAA,CAAC5D,iBAAiB;IAAC8D,KAAK,EAAG;EAAO,GACjCF,aAAA,CAACS,KAAK;IAAA,GAAMqB;EAAK,CAAI,CACH,CAAC;AAEtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","PrivateBlockContext"],"sources":["@wordpress/block-editor/src/components/block-list/private-block-context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nexport const PrivateBlockContext = createContext(
|
|
1
|
+
{"version":3,"names":["createContext","PrivateBlockContext"],"sources":["@wordpress/block-editor/src/components/block-list/private-block-context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nexport const PrivateBlockContext = createContext( {} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAElD,OAAO,MAAMC,mBAAmB,GAAGD,aAAa,CAAE,CAAC,CAAE,CAAC"}
|
|
@@ -53,7 +53,7 @@ export function useInBetweenInserter() {
|
|
|
53
53
|
const blockElement = !!event.target.getAttribute('data-block') ? event.target : event.target.closest('[data-block]');
|
|
54
54
|
rootClientId = blockElement.getAttribute('data-block');
|
|
55
55
|
}
|
|
56
|
-
if (getTemplateLock(rootClientId) || getBlockEditingMode(rootClientId) === 'disabled' || getBlockName(rootClientId) === 'core/block'
|
|
56
|
+
if (getTemplateLock(rootClientId) || getBlockEditingMode(rootClientId) === 'disabled' || getBlockName(rootClientId) === 'core/block') {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
const orientation = getBlockListSettings(rootClientId)?.orientation || 'vertical';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRefEffect","useSelect","useDispatch","useContext","isRTL","store","blockEditorStore","InsertionPointOpenRef","useInBetweenInserter","openRef","isInBetweenInserterDisabled","select","getSettings","isDistractionFree","__unstableGetEditorMode","getBlockListSettings","getBlockIndex","isMultiSelecting","getSelectedBlockClientIds","getTemplateLock","__unstableIsWithinBlockOverlay","getBlockEditingMode","getBlockName","showInsertionPoint","hideInsertionPoint","node","onMouseMove","event","current","target","nodeType","TEXT_NODE","classList","contains","rootClientId","blockElement","getAttribute","closest","window","__experimentalPatternPartialSyncing","orientation","offsetTop","clientY","offsetLeft","clientX","children","Array","from","element","find","blockEl","blockElRect","getBoundingClientRect","top","right","left","id","firstElementChild","clientId","slice","length","includes","elementRect","bottom","index","__unstableWithInserter","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-in-between-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { InsertionPointOpenRef } from '../block-tools/insertion-point';\n\nexport function useInBetweenInserter() {\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst isInBetweenInserterDisabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree ||\n\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',\n\t\t[]\n\t);\n\tconst {\n\t\tgetBlockListSettings,\n\t\tgetBlockIndex,\n\t\tisMultiSelecting,\n\t\tgetSelectedBlockClientIds,\n\t\tgetTemplateLock,\n\t\t__unstableIsWithinBlockOverlay,\n\t\tgetBlockEditingMode,\n\t\tgetBlockName,\n\t} = useSelect( blockEditorStore );\n\tconst { showInsertionPoint, hideInsertionPoint } =\n\t\tuseDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isInBetweenInserterDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onMouseMove( event ) {\n\t\t\t\tif ( openRef.current ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ignore text nodes sometimes detected in FireFox.\n\t\t\t\tif ( event.target.nodeType === event.target.TEXT_NODE ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( isMultiSelecting() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains(\n\t\t\t\t\t\t'block-editor-block-list__layout'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet rootClientId;\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains( 'is-root-container' )\n\t\t\t\t) {\n\t\t\t\t\tconst blockElement = !! event.target.getAttribute(\n\t\t\t\t\t\t'data-block'\n\t\t\t\t\t)\n\t\t\t\t\t\t? event.target\n\t\t\t\t\t\t: event.target.closest( '[data-block]' );\n\t\t\t\t\trootClientId = blockElement.getAttribute( 'data-block' );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tgetTemplateLock( rootClientId ) ||\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled' ||\n\t\t\t\t\t( getBlockName( rootClientId ) === 'core/block' &&\n\t\t\t\t\t\twindow.__experimentalPatternPartialSyncing )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst orientation =\n\t\t\t\t\tgetBlockListSettings( rootClientId )?.orientation ||\n\t\t\t\t\t'vertical';\n\t\t\t\tconst offsetTop = event.clientY;\n\t\t\t\tconst offsetLeft = event.clientX;\n\n\t\t\t\tconst children = Array.from( event.target.children );\n\t\t\t\tlet element = children.find( ( blockEl ) => {\n\t\t\t\t\tconst blockElRect = blockEl.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'vertical' &&\n\t\t\t\t\t\t\tblockElRect.top > offsetTop ) ||\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'horizontal' &&\n\t\t\t\t\t\t\t( isRTL()\n\t\t\t\t\t\t\t\t? blockElRect.right < offsetLeft\n\t\t\t\t\t\t\t\t: blockElRect.left > offsetLeft ) )\n\t\t\t\t\t);\n\t\t\t\t} );\n\n\t\t\t\tif ( ! element ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// The block may be in an alignment wrapper, so check the first direct\n\t\t\t\t// child if the element has no ID.\n\t\t\t\tif ( ! element.id ) {\n\t\t\t\t\telement = element.firstElementChild;\n\n\t\t\t\t\tif ( ! element ) {\n\t\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Don't show the insertion point if a parent block has an \"overlay\"\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337\n\t\t\t\tconst clientId = element.id.slice( 'block-'.length );\n\t\t\t\tif (\n\t\t\t\t\t! clientId ||\n\t\t\t\t\t__unstableIsWithinBlockOverlay( clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Don't show the inserter when hovering above (conflicts with\n\t\t\t\t// block toolbar) or inside selected block(s).\n\t\t\t\tif ( getSelectedBlockClientIds().includes( clientId ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst elementRect = element.getBoundingClientRect();\n\n\t\t\t\tif (\n\t\t\t\t\t( orientation === 'horizontal' &&\n\t\t\t\t\t\t( event.clientY > elementRect.bottom ||\n\t\t\t\t\t\t\tevent.clientY < elementRect.top ) ) ||\n\t\t\t\t\t( orientation === 'vertical' &&\n\t\t\t\t\t\t( event.clientX > elementRect.right ||\n\t\t\t\t\t\t\tevent.clientX < elementRect.left ) )\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst index = getBlockIndex( clientId );\n\n\t\t\t\t// Don't show the in-between inserter before the first block in\n\t\t\t\t// the list (preserves the original behaviour).\n\t\t\t\tif ( index === 0 ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshowInsertionPoint( rootClientId, index, {\n\t\t\t\t\t__unstableWithInserter: true,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mousemove', onMouseMove );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousemove', onMouseMove );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\topenRef,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockIndex,\n\t\t\tisMultiSelecting,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisInBetweenInserterDisabled,\n\t\t]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,OAAO,SAASC,oBAAoBA,CAAA,EAAG;EACtC,MAAMC,OAAO,GAAGN,UAAU,CAAEI,qBAAsB,CAAC;EACnD,MAAMG,2BAA2B,GAAGT,SAAS,CAC1CU,MAAM,IACPA,MAAM,CAAEL,gBAAiB,CAAC,CAACM,WAAW,CAAC,CAAC,CAACC,iBAAiB,IAC1DF,MAAM,CAAEL,gBAAiB,CAAC,CAACQ,uBAAuB,CAAC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,CAAEH,QAAS,CAAC,EAAG;QACvD;MACD;MACA,MAAMI,WAAW,GAAGd,OAAO,CAACI,qBAAqB,CAAC,CAAC;MAEnD,IACGZ,WAAW,KAAK,YAAY,KAC3Bb,KAAK,CAACe,OAAO,GAAGoB,WAAW,CAACC,MAAM,IACnCpC,KAAK,CAACe,OAAO,GAAGoB,WAAW,CAACT,GAAG,CAAE,IACjCb,WAAW,KAAK,UAAU,KACzBb,KAAK,CAACiB,OAAO,GAAGkB,WAAW,CAACR,KAAK,IAClC3B,KAAK,CAACiB,OAAO,GAAGkB,WAAW,CAACP,IAAI,CAAI,EACrC;QACD/B,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEA,MAAMwC,KAAK,GAAGhD,aAAa,CAAE0C,QAAS,CAAC;;MAEvC;MACA;MACA,IAAKM,KAAK,KAAK,CAAC,EAAG;QAClBxC,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEAD,kBAAkB,CAAEW,YAAY,EAAE8B,KAAK,EAAE;QACxCC,sBAAsB,EAAE;MACzB,CAAE,CAAC;IACJ;IAEAxC,IAAI,CAACyC,gBAAgB,CAAE,WAAW,EAAExC,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZD,IAAI,CAAC0C,mBAAmB,CAAE,WAAW,EAAEzC,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACCjB,OAAO,EACPM,oBAAoB,EACpBC,aAAa,EACbC,gBAAgB,EAChBM,kBAAkB,EAClBC,kBAAkB,EAClBN,yBAAyB,EACzBR,2BAA2B,CAE7B,CAAC;AACF"}
|
|
1
|
+
{"version":3,"names":["useRefEffect","useSelect","useDispatch","useContext","isRTL","store","blockEditorStore","InsertionPointOpenRef","useInBetweenInserter","openRef","isInBetweenInserterDisabled","select","getSettings","isDistractionFree","__unstableGetEditorMode","getBlockListSettings","getBlockIndex","isMultiSelecting","getSelectedBlockClientIds","getTemplateLock","__unstableIsWithinBlockOverlay","getBlockEditingMode","getBlockName","showInsertionPoint","hideInsertionPoint","node","onMouseMove","event","current","target","nodeType","TEXT_NODE","classList","contains","rootClientId","blockElement","getAttribute","closest","orientation","offsetTop","clientY","offsetLeft","clientX","children","Array","from","element","find","blockEl","blockElRect","getBoundingClientRect","top","right","left","id","firstElementChild","clientId","slice","length","includes","elementRect","bottom","index","__unstableWithInserter","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-in-between-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { InsertionPointOpenRef } from '../block-tools/insertion-point';\n\nexport function useInBetweenInserter() {\n\tconst openRef = useContext( InsertionPointOpenRef );\n\tconst isInBetweenInserterDisabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree ||\n\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',\n\t\t[]\n\t);\n\tconst {\n\t\tgetBlockListSettings,\n\t\tgetBlockIndex,\n\t\tisMultiSelecting,\n\t\tgetSelectedBlockClientIds,\n\t\tgetTemplateLock,\n\t\t__unstableIsWithinBlockOverlay,\n\t\tgetBlockEditingMode,\n\t\tgetBlockName,\n\t} = useSelect( blockEditorStore );\n\tconst { showInsertionPoint, hideInsertionPoint } =\n\t\tuseDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( isInBetweenInserterDisabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onMouseMove( event ) {\n\t\t\t\tif ( openRef.current ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Ignore text nodes sometimes detected in FireFox.\n\t\t\t\tif ( event.target.nodeType === event.target.TEXT_NODE ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( isMultiSelecting() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains(\n\t\t\t\t\t\t'block-editor-block-list__layout'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet rootClientId;\n\t\t\t\tif (\n\t\t\t\t\t! event.target.classList.contains( 'is-root-container' )\n\t\t\t\t) {\n\t\t\t\t\tconst blockElement = !! event.target.getAttribute(\n\t\t\t\t\t\t'data-block'\n\t\t\t\t\t)\n\t\t\t\t\t\t? event.target\n\t\t\t\t\t\t: event.target.closest( '[data-block]' );\n\t\t\t\t\trootClientId = blockElement.getAttribute( 'data-block' );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tgetTemplateLock( rootClientId ) ||\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled' ||\n\t\t\t\t\tgetBlockName( rootClientId ) === 'core/block'\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst orientation =\n\t\t\t\t\tgetBlockListSettings( rootClientId )?.orientation ||\n\t\t\t\t\t'vertical';\n\t\t\t\tconst offsetTop = event.clientY;\n\t\t\t\tconst offsetLeft = event.clientX;\n\n\t\t\t\tconst children = Array.from( event.target.children );\n\t\t\t\tlet element = children.find( ( blockEl ) => {\n\t\t\t\t\tconst blockElRect = blockEl.getBoundingClientRect();\n\t\t\t\t\treturn (\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'vertical' &&\n\t\t\t\t\t\t\tblockElRect.top > offsetTop ) ||\n\t\t\t\t\t\t( blockEl.classList.contains( 'wp-block' ) &&\n\t\t\t\t\t\t\torientation === 'horizontal' &&\n\t\t\t\t\t\t\t( isRTL()\n\t\t\t\t\t\t\t\t? blockElRect.right < offsetLeft\n\t\t\t\t\t\t\t\t: blockElRect.left > offsetLeft ) )\n\t\t\t\t\t);\n\t\t\t\t} );\n\n\t\t\t\tif ( ! element ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// The block may be in an alignment wrapper, so check the first direct\n\t\t\t\t// child if the element has no ID.\n\t\t\t\tif ( ! element.id ) {\n\t\t\t\t\telement = element.firstElementChild;\n\n\t\t\t\t\tif ( ! element ) {\n\t\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Don't show the insertion point if a parent block has an \"overlay\"\n\t\t\t\t// See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337\n\t\t\t\tconst clientId = element.id.slice( 'block-'.length );\n\t\t\t\tif (\n\t\t\t\t\t! clientId ||\n\t\t\t\t\t__unstableIsWithinBlockOverlay( clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Don't show the inserter when hovering above (conflicts with\n\t\t\t\t// block toolbar) or inside selected block(s).\n\t\t\t\tif ( getSelectedBlockClientIds().includes( clientId ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst elementRect = element.getBoundingClientRect();\n\n\t\t\t\tif (\n\t\t\t\t\t( orientation === 'horizontal' &&\n\t\t\t\t\t\t( event.clientY > elementRect.bottom ||\n\t\t\t\t\t\t\tevent.clientY < elementRect.top ) ) ||\n\t\t\t\t\t( orientation === 'vertical' &&\n\t\t\t\t\t\t( event.clientX > elementRect.right ||\n\t\t\t\t\t\t\tevent.clientX < elementRect.left ) )\n\t\t\t\t) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst index = getBlockIndex( clientId );\n\n\t\t\t\t// Don't show the in-between inserter before the first block in\n\t\t\t\t// the list (preserves the original behaviour).\n\t\t\t\tif ( index === 0 ) {\n\t\t\t\t\thideInsertionPoint();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshowInsertionPoint( rootClientId, index, {\n\t\t\t\t\t__unstableWithInserter: true,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'mousemove', onMouseMove );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousemove', onMouseMove );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\topenRef,\n\t\t\tgetBlockListSettings,\n\t\t\tgetBlockIndex,\n\t\t\tisMultiSelecting,\n\t\t\tshowInsertionPoint,\n\t\t\thideInsertionPoint,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tisInBetweenInserterDisabled,\n\t\t]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,QAAQ,gCAAgC;AAEtE,OAAO,SAASC,oBAAoBA,CAAA,EAAG;EACtC,MAAMC,OAAO,GAAGN,UAAU,CAAEI,qBAAsB,CAAC;EACnD,MAAMG,2BAA2B,GAAGT,SAAS,CAC1CU,MAAM,IACPA,MAAM,CAAEL,gBAAiB,CAAC,CAACM,WAAW,CAAC,CAAC,CAACC,iBAAiB,IAC1DF,MAAM,CAAEL,gBAAiB,CAAC,CAACQ,uBAAuB,CAAC,CAAC,KAAK,UAAU,EACpE,EACD,CAAC;EACD,MAAM;IACLC,oBAAoB;IACpBC,aAAa;IACbC,gBAAgB;IAChBC,yBAAyB;IACzBC,eAAe;IACfC,8BAA8B;IAC9BC,mBAAmB;IACnBC;EACD,CAAC,GAAGrB,SAAS,CAAEK,gBAAiB,CAAC;EACjC,MAAM;IAAEi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K,UAAU,KACzBX,KAAK,CAACe,OAAO,GAAGkB,WAAW,CAACR,KAAK,IAClCzB,KAAK,CAACe,OAAO,GAAGkB,WAAW,CAACP,IAAI,CAAI,EACrC;QACD7B,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEA,MAAMsC,KAAK,GAAG9C,aAAa,CAAEwC,QAAS,CAAC;;MAEvC;MACA;MACA,IAAKM,KAAK,KAAK,CAAC,EAAG;QAClBtC,kBAAkB,CAAC,CAAC;QACpB;MACD;MAEAD,kBAAkB,CAAEW,YAAY,EAAE4B,KAAK,EAAE;QACxCC,sBAAsB,EAAE;MACzB,CAAE,CAAC;IACJ;IAEAtC,IAAI,CAACuC,gBAAgB,CAAE,WAAW,EAAEtC,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZD,IAAI,CAACwC,mBAAmB,CAAE,WAAW,EAAEvC,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACCjB,OAAO,EACPM,oBAAoB,EACpBC,aAAa,EACbC,gBAAgB,EAChBM,kBAAkB,EAClBC,kBAAkB,EAClBN,yBAAyB,EACzBR,2BAA2B,CAE7B,CAAC;AACF"}
|
|
@@ -32,14 +32,20 @@ export default function BlockLockToolbar({
|
|
|
32
32
|
hasLockButtonShown.current = true;
|
|
33
33
|
}
|
|
34
34
|
}, [isLocked]);
|
|
35
|
-
if (!
|
|
35
|
+
if (!isLocked && !hasLockButtonShown.current) {
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
|
+
let label = isLocked ? __('Unlock') : __('Lock');
|
|
39
|
+
if (!canLock && isLocked) {
|
|
40
|
+
label = __('Locked');
|
|
41
|
+
}
|
|
38
42
|
return createElement(Fragment, null, createElement(ToolbarGroup, {
|
|
39
43
|
className: "block-editor-block-lock-toolbar"
|
|
40
44
|
}, createElement(ToolbarButton, {
|
|
45
|
+
accessibleWhenDisabled: true,
|
|
46
|
+
disabled: !canLock,
|
|
41
47
|
icon: isLocked ? lock : unlock,
|
|
42
|
-
label:
|
|
48
|
+
label: label,
|
|
43
49
|
onClick: toggleModal,
|
|
44
50
|
"aria-expanded": isModalOpen,
|
|
45
51
|
"aria-haspopup": "dialog"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","ToolbarButton","ToolbarGroup","useReducer","useRef","useEffect","lock","unlock","BlockLockModal","useBlockLock","BlockLockToolbar","clientId","canLock","isLocked","isModalOpen","toggleModal","isActive","hasLockButtonShown","current","createElement","Fragment","className","
|
|
1
|
+
{"version":3,"names":["__","ToolbarButton","ToolbarGroup","useReducer","useRef","useEffect","lock","unlock","BlockLockModal","useBlockLock","BlockLockToolbar","clientId","canLock","isLocked","isModalOpen","toggleModal","isActive","hasLockButtonShown","current","label","createElement","Fragment","className","accessibleWhenDisabled","disabled","icon","onClick","onClose"],"sources":["@wordpress/block-editor/src/components/block-lock/toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useReducer, useRef, useEffect } from '@wordpress/element';\nimport { lock, unlock } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockLockModal from './modal';\nimport useBlockLock from './use-block-lock';\n\nexport default function BlockLockToolbar( { clientId } ) {\n\tconst { canLock, isLocked } = useBlockLock( clientId );\n\n\tconst [ isModalOpen, toggleModal ] = useReducer(\n\t\t( isActive ) => ! isActive,\n\t\tfalse\n\t);\n\n\tconst hasLockButtonShown = useRef( false );\n\n\t// If the block lock button has been shown, we don't want to remove it\n\t// from the toolbar until the toolbar is rendered again without it.\n\t// Removing it beforehand can cause focus loss issues, such as when\n\t// unlocking the block from the modal. It needs to return focus from\n\t// whence it came, and to do that, we need to leave the button in the toolbar.\n\tuseEffect( () => {\n\t\tif ( isLocked ) {\n\t\t\thasLockButtonShown.current = true;\n\t\t}\n\t}, [ isLocked ] );\n\n\tif ( ! isLocked && ! hasLockButtonShown.current ) {\n\t\treturn null;\n\t}\n\n\tlet label = isLocked ? __( 'Unlock' ) : __( 'Lock' );\n\n\tif ( ! canLock && isLocked ) {\n\t\tlabel = __( 'Locked' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarGroup className=\"block-editor-block-lock-toolbar\">\n\t\t\t\t<ToolbarButton\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ ! canLock }\n\t\t\t\t\ticon={ isLocked ? lock : unlock }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonClick={ toggleModal }\n\t\t\t\t\taria-expanded={ isModalOpen }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<BlockLockModal clientId={ clientId } onClose={ toggleModal } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,EAAEC,YAAY,QAAQ,uBAAuB;AACnE,SAASC,UAAU,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAClE,SAASC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,SAAS;AACpC,OAAOC,YAAY,MAAM,kBAAkB;AAE3C,eAAe,SAASC,gBAAgBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACxD,MAAM;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGJ,YAAY,CAAEE,QAAS,CAAC;EAEtD,MAAM,CAAEG,WAAW,EAAEC,WAAW,CAAE,GAAGZ,UAAU,CAC5Ca,QAAQ,IAAM,CAAEA,QAAQ,EAC1B,KACD,CAAC;EAED,MAAMC,kBAAkB,GAAGb,MAAM,CAAE,KAAM,CAAC;;EAE1C;EACA;EACA;EACA;EACA;EACAC,SAAS,CAAE,MAAM;IAChB,IAAKQ,QAAQ,EAAG;MACfI,kBAAkB,CAACC,OAAO,GAAG,IAAI;IAClC;EACD,CAAC,EAAE,CAAEL,QAAQ,CAAG,CAAC;EAEjB,IAAK,CAAEA,QAAQ,IAAI,CAAEI,kBAAkB,CAACC,OAAO,EAAG;IACjD,OAAO,IAAI;EACZ;EAEA,IAAIC,KAAK,GAAGN,QAAQ,GAAGb,EAAE,CAAE,QAAS,CAAC,GAAGA,EAAE,CAAE,MAAO,CAAC;EAEpD,IAAK,CAAEY,OAAO,IAAIC,QAAQ,EAAG;IAC5BM,KAAK,GAAGnB,EAAE,CAAE,QAAS,CAAC;EACvB;EAEA,OACCoB,aAAA,CAAAC,QAAA,QACCD,aAAA,CAAClB,YAAY;IAACoB,SAAS,EAAC;EAAiC,GACxDF,aAAA,CAACnB,aAAa;IACbsB,sBAAsB;IACtBC,QAAQ,EAAG,CAAEZ,OAAS;IACtBa,IAAI,EAAGZ,QAAQ,GAAGP,IAAI,GAAGC,MAAQ;IACjCY,KAAK,EAAGA,KAAO;IACfO,OAAO,EAAGX,WAAa;IACvB,iBAAgBD,WAAa;IAC7B,iBAAc;EAAQ,CACtB,CACY,CAAC,EACbA,WAAW,IACZM,aAAA,CAACZ,cAAc;IAACG,QAAQ,EAAGA,QAAU;IAACgB,OAAO,EAAGZ;EAAa,CAAE,CAE/D,CAAC;AAEL"}
|
|
@@ -26,6 +26,8 @@ function BlockPopoverInbetween({
|
|
|
26
26
|
children,
|
|
27
27
|
__unstablePopoverSlot,
|
|
28
28
|
__unstableContentRef,
|
|
29
|
+
operation = 'insert',
|
|
30
|
+
nearestSide = 'right',
|
|
29
31
|
...props
|
|
30
32
|
}) {
|
|
31
33
|
// This is a temporary hack to get the inbetween inserter to recompute properly.
|
|
@@ -60,7 +62,7 @@ function BlockPopoverInbetween({
|
|
|
60
62
|
popoverRecomputeCounter < 0 || !previousElement && !nextElement || !isVisible) {
|
|
61
63
|
return undefined;
|
|
62
64
|
}
|
|
63
|
-
const contextElement = previousElement || nextElement;
|
|
65
|
+
const contextElement = operation === 'group' ? nextElement || previousElement : previousElement || nextElement;
|
|
64
66
|
return {
|
|
65
67
|
contextElement,
|
|
66
68
|
getBoundingClientRect() {
|
|
@@ -70,7 +72,17 @@ function BlockPopoverInbetween({
|
|
|
70
72
|
let top = 0;
|
|
71
73
|
let width = 0;
|
|
72
74
|
let height = 0;
|
|
73
|
-
if (
|
|
75
|
+
if (operation === 'group') {
|
|
76
|
+
const targetRect = nextRect || previousRect;
|
|
77
|
+
top = targetRect.top;
|
|
78
|
+
// No spacing is likely around blocks in this operation.
|
|
79
|
+
// So width of the inserter containing rect is set to 0.
|
|
80
|
+
width = 0;
|
|
81
|
+
height = targetRect.bottom - targetRect.top;
|
|
82
|
+
// Popover calculates its distance from mid-block so some
|
|
83
|
+
// adjustments are needed to make it appear in the right place.
|
|
84
|
+
left = nearestSide === 'left' ? targetRect.left - 2 : targetRect.right - 2;
|
|
85
|
+
} else if (isVertical) {
|
|
74
86
|
// vertical
|
|
75
87
|
top = previousRect ? previousRect.bottom : nextRect.top;
|
|
76
88
|
width = previousRect ? previousRect.width : nextRect.width;
|
|
@@ -92,7 +104,7 @@ function BlockPopoverInbetween({
|
|
|
92
104
|
return new window.DOMRect(left, top, width, height);
|
|
93
105
|
}
|
|
94
106
|
};
|
|
95
|
-
}, [previousElement, nextElement, popoverRecomputeCounter, isVertical, isVisible]);
|
|
107
|
+
}, [previousElement, nextElement, popoverRecomputeCounter, isVertical, isVisible, operation, nearestSide]);
|
|
96
108
|
const popoverScrollRef = usePopoverScroll(__unstableContentRef);
|
|
97
109
|
|
|
98
110
|
// This is only needed for a smooth transition when moving blocks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","useSelect","useMemo","createContext","useReducer","useLayoutEffect","Popover","isRTL","store","blockEditorStore","__unstableUseBlockElement","useBlockElement","usePopoverScroll","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","InsertionPointOpenRef","BlockPopoverInbetween","previousClientId","nextClientId","children","__unstablePopoverSlot","__unstableContentRef","props","popoverRecomputeCounter","forcePopoverRecompute","s","orientation","rootClientId","isVisible","select","getBlockListSettings","getBlockRootClientId","isBlockVisible","_rootClientId","previousElement","nextElement","isVertical","popoverAnchor","undefined","contextElement","getBoundingClientRect","previousRect","nextRect","left","top","width","height","bottom","right","window","DOMRect","popoverScrollRef","observer","MutationObserver","observe","attributes","disconnect","ownerDocument","defaultView","addEventListener","removeEventListener","createElement","ref","animate","anchor","focusOnMount","__unstableSlotName","inline","key","className","resize","flip","placement","variant"],"sources":["@wordpress/block-editor/src/components/block-popover/inbetween.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseMemo,\n\tcreateContext,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { Popover } from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction BlockPopoverInbetween( {\n\tpreviousClientId,\n\tnextClientId,\n\tchildren,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\t...props\n} ) {\n\t// This is a temporary hack to get the inbetween inserter to recompute properly.\n\tconst [ popoverRecomputeCounter, forcePopoverRecompute ] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\tconst { orientation, rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tisBlockVisible,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId(\n\t\t\t\tpreviousClientId ?? nextClientId\n\t\t\t);\n\t\t\treturn {\n\t\t\t\torientation:\n\t\t\t\t\tgetBlockListSettings( _rootClientId )?.orientation ||\n\t\t\t\t\t'vertical',\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible:\n\t\t\t\t\tisBlockVisible( previousClientId ) &&\n\t\t\t\t\tisBlockVisible( nextClientId ),\n\t\t\t};\n\t\t},\n\t\t[ previousClientId, nextClientId ]\n\t);\n\tconst previousElement = useBlockElement( previousClientId );\n\tconst nextElement = useBlockElement( nextClientId );\n\tconst isVertical = orientation === 'vertical';\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverRecomputeCounter is by definition always equal or greater than 0.\n\t\t\t// This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverRecomputeCounter < 0 ||\n\t\t\t( ! previousElement && ! nextElement ) ||\n\t\t\t! isVisible\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst contextElement = previousElement || nextElement;\n\n\t\treturn {\n\t\t\tcontextElement,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst previousRect = previousElement\n\t\t\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\t\t\t\tconst nextRect = nextElement\n\t\t\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\n\t\t\t\tlet left = 0;\n\t\t\t\tlet top = 0;\n\t\t\t\tlet width = 0;\n\t\t\t\tlet height = 0;\n\n\t\t\t\tif ( isVertical ) {\n\t\t\t\t\t// vertical\n\t\t\t\t\ttop = previousRect ? previousRect.bottom : nextRect.top;\n\t\t\t\t\twidth = previousRect ? previousRect.width : nextRect.width;\n\t\t\t\t\theight =\n\t\t\t\t\t\tnextRect && previousRect\n\t\t\t\t\t\t\t? nextRect.top - previousRect.bottom\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tleft = previousRect ? previousRect.left : nextRect.left;\n\t\t\t\t} else {\n\t\t\t\t\ttop = previousRect ? previousRect.top : nextRect.top;\n\t\t\t\t\theight = previousRect\n\t\t\t\t\t\t? previousRect.height\n\t\t\t\t\t\t: nextRect.height;\n\n\t\t\t\t\tif ( isRTL() ) {\n\t\t\t\t\t\t// non vertical, rtl\n\t\t\t\t\t\tleft = nextRect ? nextRect.right : previousRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? previousRect.left - nextRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// non vertical, ltr\n\t\t\t\t\t\tleft = previousRect\n\t\t\t\t\t\t\t? previousRect.right\n\t\t\t\t\t\t\t: nextRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? nextRect.left - previousRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [\n\t\tpreviousElement,\n\t\tnextElement,\n\t\tpopoverRecomputeCounter,\n\t\tisVertical,\n\t\tisVisible,\n\t] );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\t// This is only needed for a smooth transition when moving blocks.\n\t// When blocks are moved up/down, their position can be set by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( previousElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ previousElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! nextElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( nextElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ nextElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tpreviousElement.ownerDocument.defaultView.addEventListener(\n\t\t\t'resize',\n\t\t\tforcePopoverRecompute\n\t\t);\n\t\treturn () => {\n\t\t\tpreviousElement.ownerDocument.defaultView?.removeEventListener(\n\t\t\t\t'resize',\n\t\t\t\tforcePopoverRecompute\n\t\t\t);\n\t\t};\n\t}, [ previousElement ] );\n\n\t// If there's either a previous or a next element, show the inbetween popover.\n\t// Note that drag and drop uses the inbetween popover to show the drop indicator\n\t// before the first block and after the last block.\n\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n\t// While ideally it would be enough to capture the\n\t// bubbling focus event from the Inserter, due to the\n\t// characteristics of click focusing of `button`s in\n\t// Firefox and Safari, it is not reliable.\n\t//\n\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\t// Forces a remount of the popover when its position changes\n\t\t\t// This makes sure the popover doesn't animate from its previous position.\n\t\t\tkey={ nextClientId + '--' + rootClientId }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\t'block-editor-block-popover__inbetween',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tplacement=\"overlay\"\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"block-editor-block-popover__inbetween-container\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</Popover>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n}\n\nexport default BlockPopoverInbetween;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,OAAO,EACPC,aAAa,EACbC,UAAU,EACVC,eAAe,QACT,oBAAoB;AAC3B,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,8CAA8C;AAC3G,OAAOC,gBAAgB,MAAM,sBAAsB;AAEnD,MAAMC,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,OAAO,MAAMC,qBAAqB,GAAGb,aAAa,CAAC,CAAC;AAEpD,SAASc,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,YAAY;EACZC,QAAQ;EACRC,qBAAqB;EACrBC,oBAAoB;EACpB,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAM,CAAEC,uBAAuB,EAAEC,qBAAqB,CAAE,GAAGrB,UAAU;EACpE;EACEsB,CAAC,IAAM,CAAEA,CAAC,GAAG,CAAC,IAAKb,6BAA6B,EAClD,CACD,CAAC;EAED,MAAM;IAAEc,WAAW;IAAE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AAA,CAACxD,OAAO;IACPyD,GAAG,EAAGX,gBAAkB;IACxBY,OAAO,EAAG,KAAO;IACjBC,MAAM,EAAG3B,aAAe;IACxB4B,YAAY,EAAG;IACf;IACA;IAAA;IACAC,kBAAkB,EAAG9C,qBAAuB;IAC5C+C,MAAM,EAAG,CAAE/C;IACX;IACA;IAAA;IACAgD,GAAG,EAAGlD,YAAY,GAAG,IAAI,GAAGS,YAAc;IAAA,GACrCL,KAAK;IACV+C,SAAS,EAAGtE,UAAU,CACrB,4BAA4B,EAC5B,uCAAuC,EACvCuB,KAAK,CAAC+C,SACP,CAAG;IACHC,MAAM,EAAG,KAAO;IAChBC,IAAI,EAAG,KAAO;IACdC,SAAS,EAAC,SAAS;IACnBC,OAAO,EAAC;EAAU,GAElBZ,aAAA;IAAKQ,SAAS,EAAC;EAAiD,GAC7DlD,QACE,CACG,CAAC;EAEX;AACD;;AAEA,eAAeH,qBAAqB"}
|
|
1
|
+
{"version":3,"names":["classnames","useSelect","useMemo","createContext","useReducer","useLayoutEffect","Popover","isRTL","store","blockEditorStore","__unstableUseBlockElement","useBlockElement","usePopoverScroll","MAX_POPOVER_RECOMPUTE_COUNTER","Number","MAX_SAFE_INTEGER","InsertionPointOpenRef","BlockPopoverInbetween","previousClientId","nextClientId","children","__unstablePopoverSlot","__unstableContentRef","operation","nearestSide","props","popoverRecomputeCounter","forcePopoverRecompute","s","orientation","rootClientId","isVisible","select","getBlockListSettings","getBlockRootClientId","isBlockVisible","_rootClientId","previousElement","nextElement","isVertical","popoverAnchor","undefined","contextElement","getBoundingClientRect","previousRect","nextRect","left","top","width","height","targetRect","bottom","right","window","DOMRect","popoverScrollRef","observer","MutationObserver","observe","attributes","disconnect","ownerDocument","defaultView","addEventListener","removeEventListener","createElement","ref","animate","anchor","focusOnMount","__unstableSlotName","inline","key","className","resize","flip","placement","variant"],"sources":["@wordpress/block-editor/src/components/block-popover/inbetween.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseMemo,\n\tcreateContext,\n\tuseReducer,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { Popover } from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport usePopoverScroll from './use-popover-scroll';\n\nconst MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;\n\nexport const InsertionPointOpenRef = createContext();\n\nfunction BlockPopoverInbetween( {\n\tpreviousClientId,\n\tnextClientId,\n\tchildren,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n\toperation = 'insert',\n\tnearestSide = 'right',\n\t...props\n} ) {\n\t// This is a temporary hack to get the inbetween inserter to recompute properly.\n\tconst [ popoverRecomputeCounter, forcePopoverRecompute ] = useReducer(\n\t\t// Module is there to make sure that the counter doesn't overflow.\n\t\t( s ) => ( s + 1 ) % MAX_POPOVER_RECOMPUTE_COUNTER,\n\t\t0\n\t);\n\n\tconst { orientation, rootClientId, isVisible } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tisBlockVisible,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst _rootClientId = getBlockRootClientId(\n\t\t\t\tpreviousClientId ?? nextClientId\n\t\t\t);\n\t\t\treturn {\n\t\t\t\torientation:\n\t\t\t\t\tgetBlockListSettings( _rootClientId )?.orientation ||\n\t\t\t\t\t'vertical',\n\t\t\t\trootClientId: _rootClientId,\n\t\t\t\tisVisible:\n\t\t\t\t\tisBlockVisible( previousClientId ) &&\n\t\t\t\t\tisBlockVisible( nextClientId ),\n\t\t\t};\n\t\t},\n\t\t[ previousClientId, nextClientId ]\n\t);\n\tconst previousElement = useBlockElement( previousClientId );\n\tconst nextElement = useBlockElement( nextClientId );\n\tconst isVertical = orientation === 'vertical';\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tif (\n\t\t\t// popoverRecomputeCounter is by definition always equal or greater than 0.\n\t\t\t// This check is only there to satisfy the correctness of the\n\t\t\t// exhaustive-deps rule for the `useMemo` hook.\n\t\t\tpopoverRecomputeCounter < 0 ||\n\t\t\t( ! previousElement && ! nextElement ) ||\n\t\t\t! isVisible\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst contextElement =\n\t\t\toperation === 'group'\n\t\t\t\t? nextElement || previousElement\n\t\t\t\t: previousElement || nextElement;\n\n\t\treturn {\n\t\t\tcontextElement,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst previousRect = previousElement\n\t\t\t\t\t? previousElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\t\t\t\tconst nextRect = nextElement\n\t\t\t\t\t? nextElement.getBoundingClientRect()\n\t\t\t\t\t: null;\n\n\t\t\t\tlet left = 0;\n\t\t\t\tlet top = 0;\n\t\t\t\tlet width = 0;\n\t\t\t\tlet height = 0;\n\n\t\t\t\tif ( operation === 'group' ) {\n\t\t\t\t\tconst targetRect = nextRect || previousRect;\n\t\t\t\t\ttop = targetRect.top;\n\t\t\t\t\t// No spacing is likely around blocks in this operation.\n\t\t\t\t\t// So width of the inserter containing rect is set to 0.\n\t\t\t\t\twidth = 0;\n\t\t\t\t\theight = targetRect.bottom - targetRect.top;\n\t\t\t\t\t// Popover calculates its distance from mid-block so some\n\t\t\t\t\t// adjustments are needed to make it appear in the right place.\n\t\t\t\t\tleft =\n\t\t\t\t\t\tnearestSide === 'left'\n\t\t\t\t\t\t\t? targetRect.left - 2\n\t\t\t\t\t\t\t: targetRect.right - 2;\n\t\t\t\t} else if ( isVertical ) {\n\t\t\t\t\t// vertical\n\t\t\t\t\ttop = previousRect ? previousRect.bottom : nextRect.top;\n\t\t\t\t\twidth = previousRect ? previousRect.width : nextRect.width;\n\t\t\t\t\theight =\n\t\t\t\t\t\tnextRect && previousRect\n\t\t\t\t\t\t\t? nextRect.top - previousRect.bottom\n\t\t\t\t\t\t\t: 0;\n\t\t\t\t\tleft = previousRect ? previousRect.left : nextRect.left;\n\t\t\t\t} else {\n\t\t\t\t\ttop = previousRect ? previousRect.top : nextRect.top;\n\t\t\t\t\theight = previousRect\n\t\t\t\t\t\t? previousRect.height\n\t\t\t\t\t\t: nextRect.height;\n\n\t\t\t\t\tif ( isRTL() ) {\n\t\t\t\t\t\t// non vertical, rtl\n\t\t\t\t\t\tleft = nextRect ? nextRect.right : previousRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? previousRect.left - nextRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// non vertical, ltr\n\t\t\t\t\t\tleft = previousRect\n\t\t\t\t\t\t\t? previousRect.right\n\t\t\t\t\t\t\t: nextRect.left;\n\t\t\t\t\t\twidth =\n\t\t\t\t\t\t\tpreviousRect && nextRect\n\t\t\t\t\t\t\t\t? nextRect.left - previousRect.right\n\t\t\t\t\t\t\t\t: 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [\n\t\tpreviousElement,\n\t\tnextElement,\n\t\tpopoverRecomputeCounter,\n\t\tisVertical,\n\t\tisVisible,\n\t\toperation,\n\t\tnearestSide,\n\t] );\n\n\tconst popoverScrollRef = usePopoverScroll( __unstableContentRef );\n\n\t// This is only needed for a smooth transition when moving blocks.\n\t// When blocks are moved up/down, their position can be set by\n\t// updating the `transform` property manually (i.e. without using CSS\n\t// transitions or animations). The animation, which can also scroll the block\n\t// editor, can sometimes cause the position of the Popover to get out of sync.\n\t// A MutationObserver is therefore used to make sure that changes to the\n\t// selectedElement's attribute (i.e. `transform`) can be tracked and used to\n\t// trigger the Popover to rerender.\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( previousElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ previousElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! nextElement ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new window.MutationObserver( forcePopoverRecompute );\n\t\tobserver.observe( nextElement, { attributes: true } );\n\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [ nextElement ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( ! previousElement ) {\n\t\t\treturn;\n\t\t}\n\t\tpreviousElement.ownerDocument.defaultView.addEventListener(\n\t\t\t'resize',\n\t\t\tforcePopoverRecompute\n\t\t);\n\t\treturn () => {\n\t\t\tpreviousElement.ownerDocument.defaultView?.removeEventListener(\n\t\t\t\t'resize',\n\t\t\t\tforcePopoverRecompute\n\t\t\t);\n\t\t};\n\t}, [ previousElement ] );\n\n\t// If there's either a previous or a next element, show the inbetween popover.\n\t// Note that drag and drop uses the inbetween popover to show the drop indicator\n\t// before the first block and after the last block.\n\tif ( ( ! previousElement && ! nextElement ) || ! isVisible ) {\n\t\treturn null;\n\t}\n\n\t/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n\t// While ideally it would be enough to capture the\n\t// bubbling focus event from the Inserter, due to the\n\t// characteristics of click focusing of `button`s in\n\t// Firefox and Safari, it is not reliable.\n\t//\n\t// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus\n\treturn (\n\t\t<Popover\n\t\t\tref={ popoverScrollRef }\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\t// Render in the old slot if needed for backward compatibility,\n\t\t\t// otherwise render in place (not in the default popover slot).\n\t\t\t__unstableSlotName={ __unstablePopoverSlot }\n\t\t\tinline={ ! __unstablePopoverSlot }\n\t\t\t// Forces a remount of the popover when its position changes\n\t\t\t// This makes sure the popover doesn't animate from its previous position.\n\t\t\tkey={ nextClientId + '--' + rootClientId }\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-block-popover',\n\t\t\t\t'block-editor-block-popover__inbetween',\n\t\t\t\tprops.className\n\t\t\t) }\n\t\t\tresize={ false }\n\t\t\tflip={ false }\n\t\t\tplacement=\"overlay\"\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"block-editor-block-popover__inbetween-container\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</Popover>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */\n}\n\nexport default BlockPopoverInbetween;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,OAAO,EACPC,aAAa,EACbC,UAAU,EACVC,eAAe,QACT,oBAAoB;AAC3B,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,yBAAyB,IAAIC,eAAe,QAAQ,8CAA8C;AAC3G,OAAOC,gBAAgB,MAAM,sBAAsB;AAEnD,MAAMC,6BAA6B,GAAGC,MAAM,CAACC,gBAAgB;AAE7D,OAAO,MAAMC,qBAAqB,GAAGb,aAAa,CAAC,CAAC;AAEpD,SAASc,qBAAqBA,CAAE;EAC/BC,gBAAgB;EAChBC,YAAY;EACZC,QAAQ;EACRC,qBAAqB;EACrBC,oBAAoB;EACpBC,SAAS,GAAG,QAAQ;EACpBC,WAAW,GAAG,OAAO;EACrB,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAM,CA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
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { useResizeObserver,
|
|
5
|
+
import { useResizeObserver, useRefEffect } from '@wordpress/compose';
|
|
6
6
|
import { useSelect } from '@wordpress/data';
|
|
7
|
-
import { useMemo } from '@wordpress/element';
|
|
7
|
+
import { memo, useMemo } from '@wordpress/element';
|
|
8
8
|
import { Disabled } from '@wordpress/components';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -51,7 +51,7 @@ function ScaledBlockPreview({
|
|
|
51
51
|
}, [styles, additionalStyles]);
|
|
52
52
|
|
|
53
53
|
// Initialize on render instead of module top level, to avoid circular dependency issues.
|
|
54
|
-
MemoizedBlockList = MemoizedBlockList ||
|
|
54
|
+
MemoizedBlockList = MemoizedBlockList || memo(BlockList);
|
|
55
55
|
const scale = containerWidth / viewportWidth;
|
|
56
56
|
const aspectRatio = contentHeight ? containerWidth / (contentHeight * scale) : 0;
|
|
57
57
|
return createElement(Disabled, {
|