@wordpress/block-editor 12.24.0 → 12.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/build/components/alignment-control/ui.js +3 -1
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +0 -9
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/index.js +4 -3
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +1 -9
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +6 -6
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +17 -46
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +10 -14
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-mover/index.native.js +3 -1
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +0 -25
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +3 -1
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +6 -2
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-switcher/utils.js +15 -5
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-toolbar/use-has-block-toolbar.js +14 -9
- package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build/components/block-tools/index.js +3 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +2 -5
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +5 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-variation-picker/index.js +3 -2
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +3 -1
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/floating-toolbar/index.native.js +9 -5
- package/build/components/floating-toolbar/index.native.js.map +1 -1
- package/build/components/global-styles/background-panel.js +1 -1
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +3 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +16 -0
- package/build/components/global-styles/dimensions-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 +23 -23
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +149 -132
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +45 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/inner-blocks/index.js +16 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +12 -31
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +4 -0
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +56 -0
- package/build/components/inserter/category-tabs/index.js.map +1 -0
- package/build/components/inserter/media-tab/index.js +2 -2
- package/build/components/inserter/media-tab/index.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +0 -25
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +13 -3
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +15 -29
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/menu.js +59 -69
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/tabs.js +6 -6
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/line-height-control/index.js +6 -2
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/search-item.js +9 -3
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/list-view/block-select-button.js +5 -170
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +166 -14
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/index.js +1 -1
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +3 -1
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +3 -3
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +3 -1
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/provider/block-refs-provider.js +3 -4
- package/build/components/provider/block-refs-provider.js.map +1 -1
- package/build/components/provider/use-block-sync.js +3 -12
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/event-listeners/before-input-rules.js +93 -0
- package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
- package/build/components/rich-text/event-listeners/delete.js +58 -0
- package/build/components/rich-text/event-listeners/delete.js.map +1 -0
- package/build/components/rich-text/event-listeners/enter.js +98 -0
- package/build/components/rich-text/event-listeners/enter.js.map +1 -0
- package/build/components/rich-text/event-listeners/firefox-compat.js +36 -0
- package/build/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
- package/build/components/rich-text/event-listeners/index.js +44 -0
- package/build/components/rich-text/event-listeners/index.js.map +1 -0
- package/build/components/rich-text/event-listeners/input-events.js +22 -0
- package/build/components/rich-text/event-listeners/input-events.js.map +1 -0
- package/build/components/rich-text/event-listeners/input-rules.js +135 -0
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -0
- package/build/components/rich-text/event-listeners/insert-replacement-text.js +33 -0
- package/build/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
- package/build/components/rich-text/event-listeners/paste-handler.js +146 -0
- package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -0
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js +27 -0
- package/build/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
- package/build/components/rich-text/event-listeners/shortcuts.js +22 -0
- package/build/components/rich-text/event-listeners/shortcuts.js.map +1 -0
- package/build/components/rich-text/event-listeners/undo-automatic-change.js +51 -0
- package/build/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
- package/build/components/rich-text/index.js +11 -31
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +13 -3
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/multiline.js +6 -2
- package/build/components/rich-text/multiline.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +12 -0
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +8 -4
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/segmented-text-control/index.js +62 -0
- package/build/components/segmented-text-control/index.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/text-alignment-control/index.js +76 -0
- package/build/components/text-alignment-control/index.js.map +1 -0
- package/build/components/text-decoration-control/index.js +21 -25
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +18 -22
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/use-block-display-information/index.js +9 -3
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +3 -1
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +3 -1
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +3 -1
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/components/writing-mode-control/index.js +16 -20
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/duotone.js +3 -1
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/utils.js +11 -6
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +4 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +32 -8
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js +27 -6
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +11 -8
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +21 -7
- package/build/store/selectors.js.map +1 -1
- package/build/utils/object.js +17 -0
- package/build/utils/object.js.map +1 -1
- package/build/utils/order-inserter-block-items.js +6 -2
- package/build/utils/order-inserter-block-items.js.map +1 -1
- package/build/utils/pasting.js +6 -2
- package/build/utils/pasting.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +3 -1
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +0 -9
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/index.js +4 -3
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +1 -9
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +6 -6
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-refs.js +19 -48
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +10 -14
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +3 -1
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -26
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +6 -2
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +15 -5
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-toolbar/use-has-block-toolbar.js +14 -9
- package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build-module/components/block-tools/index.js +3 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +2 -5
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +3 -2
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +3 -1
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/floating-toolbar/index.native.js +9 -5
- package/build-module/components/floating-toolbar/index.native.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +1 -1
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +3 -1
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +17 -1
- package/build-module/components/global-styles/dimensions-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 +24 -24
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +149 -132
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +44 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +16 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +13 -32
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +4 -0
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +49 -0
- package/build-module/components/inserter/category-tabs/index.js.map +1 -0
- package/build-module/components/inserter/media-tab/index.js +1 -1
- package/build-module/components/inserter/media-tab/index.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +0 -24
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +13 -3
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +17 -31
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/menu.js +61 -71
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/tabs.js +6 -6
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/line-height-control/index.js +6 -2
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/search-item.js +9 -3
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +7 -172
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +167 -15
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/index.js +1 -1
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +3 -1
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +3 -3
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +3 -1
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/provider/block-refs-provider.js +3 -4
- package/build-module/components/provider/block-refs-provider.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +4 -13
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/before-input-rules.js +86 -0
- package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/delete.js +51 -0
- package/build-module/components/rich-text/event-listeners/delete.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/enter.js +92 -0
- package/build-module/components/rich-text/event-listeners/enter.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/firefox-compat.js +29 -0
- package/build-module/components/rich-text/event-listeners/firefox-compat.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/index.js +36 -0
- package/build-module/components/rich-text/event-listeners/index.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/input-events.js +15 -0
- package/build-module/components/rich-text/event-listeners/input-events.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/input-rules.js +127 -0
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.js +27 -0
- package/build-module/components/rich-text/event-listeners/insert-replacement-text.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/paste-handler.js +142 -0
- package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js +21 -0
- package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/shortcuts.js +15 -0
- package/build-module/components/rich-text/event-listeners/shortcuts.js.map +1 -0
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.js.map +1 -0
- package/build-module/components/rich-text/index.js +12 -32
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +13 -3
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/multiline.js +6 -2
- package/build-module/components/rich-text/multiline.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +12 -0
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +8 -4
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/segmented-text-control/index.js +55 -0
- package/build-module/components/segmented-text-control/index.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -2
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/text-alignment-control/index.js +68 -0
- package/build-module/components/text-alignment-control/index.js.map +1 -0
- package/build-module/components/text-decoration-control/index.js +21 -25
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +18 -22
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +9 -3
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +3 -1
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +3 -1
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +3 -1
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +16 -20
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/duotone.js +3 -1
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/utils.js +11 -6
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +4 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +32 -8
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js +27 -5
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +11 -8
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +21 -7
- package/build-module/store/selectors.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/order-inserter-block-items.js +6 -2
- package/build-module/utils/order-inserter-block-items.js.map +1 -1
- package/build-module/utils/pasting.js +6 -2
- package/build-module/utils/pasting.js.map +1 -1
- package/build-style/content-rtl.css +41 -68
- package/build-style/content.css +41 -68
- package/build-style/style-rtl.css +100 -199
- package/build-style/style.css +100 -199
- package/package.json +31 -31
- package/src/components/alignment-control/ui.js +3 -1
- package/src/components/block-bindings-toolbar-indicator/style.scss +1 -4
- package/src/components/block-canvas/style.scss +1 -3
- package/src/components/block-draggable/test/helpers.native.js +8 -8
- package/src/components/block-inspector/index.js +1 -2
- package/src/components/block-list/block.js +2 -13
- package/src/components/block-list/content.scss +9 -1
- package/src/components/block-list/index.js +4 -4
- package/src/components/block-list/index.native.js +1 -6
- package/src/components/block-list/use-block-props/index.js +12 -4
- package/src/components/block-list/use-block-props/use-block-refs.js +17 -57
- package/src/components/block-list/use-block-props/use-is-hovered.js +11 -16
- package/src/components/block-mover/index.native.js +3 -1
- package/src/components/block-patterns-list/style.scss +1 -3
- package/src/components/block-preview/style.scss +13 -15
- package/src/components/block-settings-menu/block-settings-dropdown.js +1 -51
- package/src/components/block-switcher/pattern-transformations-menu.js +3 -1
- package/src/components/block-switcher/use-transformed-patterns.js +6 -2
- package/src/components/block-switcher/utils.js +14 -5
- package/src/components/block-toolbar/style.scss +8 -11
- package/src/components/block-toolbar/use-has-block-toolbar.js +21 -16
- package/src/components/block-tools/index.js +3 -1
- package/src/components/block-tools/use-show-block-tools.js +36 -48
- package/src/components/block-tools/zoom-out-mode-inserters.js +5 -1
- package/src/components/block-variation-picker/content.scss +22 -72
- package/src/components/block-variation-picker/index.js +3 -2
- package/src/components/block-variation-transforms/index.js +3 -1
- package/src/components/floating-toolbar/index.native.js +5 -2
- package/src/components/global-styles/background-panel.js +1 -3
- package/src/components/global-styles/color-panel.js +3 -1
- package/src/components/global-styles/dimensions-panel.js +18 -1
- package/src/components/global-styles/hooks.js +2 -0
- package/src/components/global-styles/test/utils.js +21 -0
- package/src/components/global-styles/typography-panel.js +27 -23
- package/src/components/global-styles/use-global-styles-output.js +211 -187
- package/src/components/global-styles/utils.js +55 -0
- package/src/components/inner-blocks/index.js +14 -1
- package/src/components/inserter/block-patterns-tab/index.js +15 -65
- package/src/components/inserter/block-types-tab.js +5 -0
- package/src/components/inserter/category-tabs/index.js +74 -0
- package/src/components/inserter/media-tab/index.js +1 -1
- package/src/components/inserter/media-tab/media-panel.js +0 -22
- package/src/components/inserter/media-tab/media-preview.js +15 -7
- package/src/components/inserter/media-tab/media-tab.js +44 -83
- package/src/components/inserter/menu.js +139 -117
- package/src/components/inserter/style.scss +90 -170
- package/src/components/inserter/tabs.js +5 -13
- package/src/components/line-height-control/index.js +6 -2
- package/src/components/link-control/search-item.js +9 -3
- package/src/components/list-view/block-select-button.js +73 -266
- package/src/components/list-view/block.js +218 -28
- package/src/components/list-view/index.js +1 -1
- package/src/components/list-view/style.scss +20 -28
- package/src/components/list-view/use-list-view-drop-zone.js +1 -1
- package/src/components/list-view/utils.js +3 -1
- package/src/components/media-placeholder/content.scss +0 -11
- package/src/components/media-placeholder/index.js +3 -3
- package/src/components/navigable-toolbar/index.js +3 -1
- package/src/components/provider/block-refs-provider.js +3 -8
- package/src/components/provider/test/use-block-sync.js +7 -0
- package/src/components/provider/use-block-sync.js +3 -20
- package/src/components/rich-text/event-listeners/before-input-rules.js +92 -0
- package/src/components/rich-text/event-listeners/delete.js +53 -0
- package/src/components/rich-text/event-listeners/enter.js +104 -0
- package/src/components/rich-text/event-listeners/firefox-compat.js +31 -0
- package/src/components/rich-text/event-listeners/index.js +56 -0
- package/src/components/rich-text/event-listeners/input-events.js +13 -0
- package/src/components/rich-text/event-listeners/input-rules.js +146 -0
- package/src/components/rich-text/event-listeners/insert-replacement-text.js +28 -0
- package/src/components/rich-text/event-listeners/paste-handler.js +169 -0
- package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +24 -0
- package/src/components/rich-text/event-listeners/shortcuts.js +13 -0
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +45 -0
- package/src/components/rich-text/index.js +7 -34
- package/src/components/rich-text/index.native.js +11 -0
- package/src/components/rich-text/multiline.js +6 -2
- package/src/components/rich-text/native/index.native.js +11 -0
- package/src/components/rich-text/use-format-types.js +6 -2
- package/src/components/segmented-text-control/index.js +63 -0
- package/src/components/{writing-mode-control → segmented-text-control}/style.scss +2 -5
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +16 -1
- package/src/components/text-alignment-control/index.js +91 -0
- package/src/components/text-alignment-control/stories/index.story.js +39 -0
- package/src/components/text-decoration-control/index.js +20 -33
- package/src/components/text-transform-control/index.js +17 -30
- package/src/components/use-block-display-information/index.js +9 -3
- package/src/components/use-on-block-drop/index.js +3 -1
- package/src/components/writing-flow/use-drag-selection.js +3 -1
- package/src/components/writing-flow/use-tab-nav.js +3 -1
- package/src/components/writing-mode-control/index.js +15 -28
- package/src/hooks/duotone.js +3 -1
- package/src/hooks/utils.js +16 -2
- package/src/private-apis.js +4 -2
- package/src/store/actions.js +36 -12
- package/src/store/private-selectors.js +28 -4
- package/src/store/reducer.js +13 -23
- package/src/store/selectors.js +20 -7
- package/src/style.scss +1 -2
- package/src/utils/object.js +16 -0
- package/src/utils/order-inserter-block-items.js +6 -2
- package/src/utils/pasting.js +6 -2
- package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -54
- package/build/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
- package/build/components/rich-text/use-before-input-rules.js +0 -98
- package/build/components/rich-text/use-before-input-rules.js.map +0 -1
- package/build/components/rich-text/use-delete.js +0 -64
- package/build/components/rich-text/use-delete.js.map +0 -1
- package/build/components/rich-text/use-enter.js +0 -109
- package/build/components/rich-text/use-enter.js.map +0 -1
- package/build/components/rich-text/use-firefox-compat.js +0 -44
- package/build/components/rich-text/use-firefox-compat.js.map +0 -1
- package/build/components/rich-text/use-input-events.js +0 -25
- package/build/components/rich-text/use-input-events.js.map +0 -1
- package/build/components/rich-text/use-input-rules.js +0 -139
- package/build/components/rich-text/use-input-rules.js.map +0 -1
- package/build/components/rich-text/use-insert-replacement-text.js +0 -38
- package/build/components/rich-text/use-insert-replacement-text.js.map +0 -1
- package/build/components/rich-text/use-paste-handler.js +0 -158
- package/build/components/rich-text/use-paste-handler.js.map +0 -1
- package/build/components/rich-text/use-remove-browser-shortcuts.js +0 -32
- package/build/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
- package/build/components/rich-text/use-shortcuts.js +0 -25
- package/build/components/rich-text/use-shortcuts.js.map +0 -1
- package/build/components/rich-text/use-undo-automatic-change.js +0 -53
- package/build/components/rich-text/use-undo-automatic-change.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -47
- package/build-module/components/block-list/use-block-props/use-block-moving-mode-class-names.js.map +0 -1
- package/build-module/components/rich-text/use-before-input-rules.js +0 -92
- package/build-module/components/rich-text/use-before-input-rules.js.map +0 -1
- package/build-module/components/rich-text/use-delete.js +0 -57
- package/build-module/components/rich-text/use-delete.js.map +0 -1
- package/build-module/components/rich-text/use-enter.js +0 -102
- package/build-module/components/rich-text/use-enter.js.map +0 -1
- package/build-module/components/rich-text/use-firefox-compat.js +0 -37
- package/build-module/components/rich-text/use-firefox-compat.js.map +0 -1
- package/build-module/components/rich-text/use-input-events.js +0 -18
- package/build-module/components/rich-text/use-input-events.js.map +0 -1
- package/build-module/components/rich-text/use-input-rules.js +0 -132
- package/build-module/components/rich-text/use-input-rules.js.map +0 -1
- package/build-module/components/rich-text/use-insert-replacement-text.js +0 -32
- package/build-module/components/rich-text/use-insert-replacement-text.js.map +0 -1
- package/build-module/components/rich-text/use-paste-handler.js +0 -152
- package/build-module/components/rich-text/use-paste-handler.js.map +0 -1
- package/build-module/components/rich-text/use-remove-browser-shortcuts.js +0 -26
- package/build-module/components/rich-text/use-remove-browser-shortcuts.js.map +0 -1
- package/build-module/components/rich-text/use-shortcuts.js +0 -18
- package/build-module/components/rich-text/use-shortcuts.js.map +0 -1
- package/build-module/components/rich-text/use-undo-automatic-change.js +0 -46
- package/build-module/components/rich-text/use-undo-automatic-change.js.map +0 -1
- package/src/components/block-list/use-block-props/use-block-moving-mode-class-names.js +0 -55
- package/src/components/rich-text/use-before-input-rules.js +0 -99
- package/src/components/rich-text/use-delete.js +0 -59
- package/src/components/rich-text/use-enter.js +0 -110
- package/src/components/rich-text/use-firefox-compat.js +0 -39
- package/src/components/rich-text/use-input-events.js +0 -19
- package/src/components/rich-text/use-input-rules.js +0 -150
- package/src/components/rich-text/use-insert-replacement-text.js +0 -31
- package/src/components/rich-text/use-paste-handler.js +0 -180
- package/src/components/rich-text/use-remove-browser-shortcuts.js +0 -29
- package/src/components/rich-text/use-shortcuts.js +0 -19
- package/src/components/rich-text/use-undo-automatic-change.js +0 -46
- package/src/components/text-decoration-control/style.scss +0 -18
- package/src/components/text-transform-control/style.scss +0 -18
|
@@ -183,7 +183,6 @@ function BlockList({
|
|
|
183
183
|
};
|
|
184
184
|
const {
|
|
185
185
|
blockToolbar,
|
|
186
|
-
headerToolbar,
|
|
187
186
|
floatingToolbar
|
|
188
187
|
} = _style.default;
|
|
189
188
|
const containerStyle = {
|
|
@@ -197,7 +196,7 @@ function BlockList({
|
|
|
197
196
|
const {
|
|
198
197
|
isWider
|
|
199
198
|
} = _components.alignmentHelpers;
|
|
200
|
-
const extraScrollHeight =
|
|
199
|
+
const extraScrollHeight = blockToolbar.height + (isFloatingToolbarVisible ? floatingToolbar.height : 0);
|
|
201
200
|
return (0, _react.createElement)(_reactNative.View, {
|
|
202
201
|
style: containerStyle,
|
|
203
202
|
onAccessibilityEscape: clearSelectedBlock,
|
|
@@ -213,17 +212,10 @@ function BlockList({
|
|
|
213
212
|
}, ({
|
|
214
213
|
onScroll
|
|
215
214
|
}) => (0, _react.createElement)(_components.KeyboardAwareFlatList, {
|
|
216
|
-
...(_reactNative.Platform.OS === 'android' ? {
|
|
217
|
-
removeClippedSubviews: false
|
|
218
|
-
} : {}),
|
|
219
|
-
// Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541
|
|
220
215
|
accessibilityLabel: "block-list",
|
|
221
216
|
ref: scrollRef,
|
|
222
217
|
extraScrollHeight: extraScrollHeight,
|
|
223
218
|
keyboardShouldPersistTaps: "always",
|
|
224
|
-
scrollViewStyle: {
|
|
225
|
-
flex: 1
|
|
226
|
-
},
|
|
227
219
|
extraData: getExtraData(),
|
|
228
220
|
scrollEnabled: isRootList,
|
|
229
221
|
contentContainerStyle: [horizontal && _style.default.horizontalContentContainer, isWider(blockWidth, 'medium') && (isContentStretch && isMultiBlocks ? _style.default.horizontalContentContainerStretch : _style.default.horizontalContentContainerCenter)],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_element","_data","_blocks","_components","_i18n","_style","_interopRequireDefault","_blockListAppender","_blockListItem","_blockListItemCell","_blockListContext","_blockDraggable","_useEditorWrapperStyles","_store","identity","x","stylesMemo","getStyles","isStackedHorizontally","horizontalAlignment","styleName","computedStyles","styles","horizontal","overflowVisible","BlockList","blockWidth","initialBlockWidth","contentResizeMode","contentStyle","filterInnerBlocks","gridProperties","header","marginHorizontal","defaultBlock","marginLeft","marginVertical","marginTop","onAddBlock","onDeleteBlock","orientation","parentWidth","renderAppender","renderFooterAppender","rootClientId","withFooter","blockClientIds","blockCount","blockInsertionPointIsVisible","isReadOnly","isRootList","isFloatingToolbarVisible","maxWidth","isRTL","useSelect","select","getBlockCount","getBlockHierarchyRootClientId","getBlockOrder","getSelectedBlockClientId","isBlockInsertionPointVisible","getSettings","blockEditorStore","selectedBlockClientId","rootBlockId","blockOrder","isRTLSetting","maxWidthSetting","readOnly","Platform","OS","undefined","insertBlock","clearSelectedBlock","useDispatch","extraData","useRef","setBlockWidth","useState","addBlockToEndOfPost","newBlock","scrollRef","shouldFlatListPreventAutomaticScroll","shouldShowInnerBlockAppender","length","getExtraData","current","onLayout","nativeEvent","layout","layoutWidth","Math","floor","width","min","renderItem","item","clientId","index","isGridItem","gridItemProps","numOfColumns","numColumns","tileCount","tileIndex","indexOf","_react","createElement","default","blockToolbar","headerToolbar","floatingToolbar","containerStyle","flex","isContentStretch","isMultiBlocks","isWider","alignmentHelpers","extraScrollHeight","height","View","style","onAccessibilityEscape","testID","BlockListProvider","value","DEFAULT_BLOCK_LIST_CONTEXT","BlockDraggableWrapper","onScroll","KeyboardAwareFlatList","removeClippedSubviews","accessibilityLabel","ref","keyboardShouldPersistTaps","scrollViewStyle","scrollEnabled","contentContainerStyle","horizontalContentContainer","horizontalContentContainerStretch","horizontalContentContainerCenter","data","keyExtractor","CellRendererComponent","BlockListItemCell","shouldPreventAutomaticScroll","ListHeaderComponent","ListEmptyComponent","EmptyList","ListFooterComponent","Footer","Fragment","map","currentClientId","key","innerAppender","showSeparator","onAddParagraphBlock","useCallback","paragraphBlock","createBlock","Pressable","__","onPress","blockListFooter","shouldShowInsertionPoint","getBlockInsertionPoint","insertionPoint","align","WIDE_ALIGNMENTS","alignments","full","wrapperStyles","useEditorWrapperStyles","containerStyles","defaultAppender"],"sources":["@wordpress/block-editor/src/components/block-list/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Platform, Pressable } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useState, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tKeyboardAwareFlatList,\n\tWIDE_ALIGNMENTS,\n\talignmentHelpers,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport BlockListAppender from '../block-list-appender';\nimport BlockListItem from './block-list-item';\nimport BlockListItemCell from './block-list-item-cell';\nimport {\n\tBlockListProvider,\n\tDEFAULT_BLOCK_LIST_CONTEXT,\n} from './block-list-context';\nimport { BlockDraggableWrapper } from '../block-draggable';\nimport { useEditorWrapperStyles } from '../../hooks/use-editor-wrapper-styles';\nimport { store as blockEditorStore } from '../../store';\n\nconst identity = ( x ) => x;\n\nconst stylesMemo = {};\nconst getStyles = ( isStackedHorizontally, horizontalAlignment ) => {\n\tconst styleName = `${ isStackedHorizontally }-${ horizontalAlignment }`;\n\tif ( stylesMemo[ styleName ] ) {\n\t\treturn stylesMemo[ styleName ];\n\t}\n\tconst computedStyles = [\n\t\tisStackedHorizontally && styles.horizontal,\n\t\thorizontalAlignment && styles[ `is-aligned-${ horizontalAlignment }` ],\n\t\tstyles.overflowVisible,\n\t];\n\tstylesMemo[ styleName ] = computedStyles;\n\treturn computedStyles;\n};\n\nexport default function BlockList( {\n\tblockWidth: initialBlockWidth,\n\tcontentResizeMode,\n\tcontentStyle,\n\tfilterInnerBlocks,\n\tgridProperties,\n\theader,\n\thorizontal,\n\thorizontalAlignment,\n\tmarginHorizontal = styles.defaultBlock.marginLeft,\n\tmarginVertical = styles.defaultBlock.marginTop,\n\tonAddBlock,\n\tonDeleteBlock,\n\torientation,\n\tparentWidth,\n\trenderAppender,\n\trenderFooterAppender,\n\trootClientId,\n\twithFooter = true,\n} ) {\n\tconst {\n\t\tblockClientIds,\n\t\tblockCount,\n\t\tblockInsertionPointIsVisible,\n\t\tisReadOnly,\n\t\tisRootList,\n\t\tisFloatingToolbarVisible,\n\t\tisStackedHorizontally,\n\t\tmaxWidth,\n\t\tisRTL,\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\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tconst rootBlockId = getBlockHierarchyRootClientId(\n\t\t\t\tselectedBlockClientId\n\t\t\t);\n\n\t\t\tlet blockOrder = getBlockOrder( rootClientId );\n\t\t\t// Display only block which fulfill the condition in passed `filterInnerBlocks` function.\n\t\t\tif ( filterInnerBlocks ) {\n\t\t\t\tblockOrder = filterInnerBlocks( blockOrder );\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tisRTL: isRTLSetting,\n\t\t\t\tmaxWidth: maxWidthSetting,\n\t\t\t\treadOnly,\n\t\t\t} = getSettings();\n\n\t\t\treturn {\n\t\t\t\tblockClientIds: blockOrder,\n\t\t\t\tblockCount: getBlockCount(),\n\t\t\t\tblockInsertionPointIsVisible:\n\t\t\t\t\tPlatform.OS === 'ios' && isBlockInsertionPointVisible(),\n\t\t\t\tisReadOnly: readOnly,\n\t\t\t\tisRootList: rootClientId === undefined,\n\t\t\t\tisFloatingToolbarVisible:\n\t\t\t\t\t!! selectedBlockClientId && !! getBlockCount( rootBlockId ),\n\t\t\t\tisStackedHorizontally: orientation === 'horizontal',\n\t\t\t\tmaxWidth: maxWidthSetting,\n\t\t\t\tisRTL: isRTLSetting,\n\t\t\t};\n\t\t},\n\t\t[ filterInnerBlocks, orientation, rootClientId ]\n\t);\n\n\tconst { insertBlock, clearSelectedBlock } = useDispatch( blockEditorStore );\n\n\tconst extraData = useRef( {\n\t\tparentWidth,\n\t\trenderFooterAppender,\n\t\trenderAppender,\n\t\tonDeleteBlock,\n\t\tcontentStyle,\n\t} );\n\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth || 0 );\n\n\tconst addBlockToEndOfPost = ( newBlock ) => {\n\t\tinsertBlock( newBlock, blockCount );\n\t};\n\n\tconst scrollRef = useRef( null );\n\n\tconst shouldFlatListPreventAutomaticScroll = () =>\n\t\tblockInsertionPointIsVisible;\n\n\tconst shouldShowInnerBlockAppender = () =>\n\t\trenderAppender && blockClientIds.length > 0;\n\n\tconst getExtraData = () => {\n\t\tif (\n\t\t\textraData.current.parentWidth !== parentWidth ||\n\t\t\textraData.current.renderFooterAppender !== renderFooterAppender ||\n\t\t\textraData.current.onDeleteBlock !== onDeleteBlock ||\n\t\t\textraData.current.contentStyle !== contentStyle ||\n\t\t\textraData.current.renderAppender !== renderAppender ||\n\t\t\textraData.current.blockWidth !== blockWidth ||\n\t\t\textraData.current.gridProperties !== gridProperties\n\t\t) {\n\t\t\textraData.current = {\n\t\t\t\tparentWidth,\n\t\t\t\trenderFooterAppender,\n\t\t\t\tonDeleteBlock,\n\t\t\t\tcontentStyle,\n\t\t\t\trenderAppender,\n\t\t\t\tblockWidth,\n\t\t\t\tgridProperties,\n\t\t\t};\n\t\t}\n\t\treturn extraData.current;\n\t};\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tconst { layout } = nativeEvent;\n\n\t\tconst layoutWidth = Math.floor( layout.width );\n\t\tif ( isRootList && blockWidth !== layoutWidth ) {\n\t\t\tsetBlockWidth( Math.min( layoutWidth, maxWidth ) );\n\t\t} else if ( ! isRootList && ! blockWidth ) {\n\t\t\tsetBlockWidth( Math.min( layoutWidth, maxWidth ) );\n\t\t}\n\t};\n\n\tconst renderItem = ( { item: clientId, index } ) => {\n\t\t// Extracting the grid item properties here to avoid\n\t\t// re-renders in the blockListItem component.\n\t\tconst isGridItem = !! gridProperties;\n\t\tconst gridItemProps = gridProperties && {\n\t\t\tnumOfColumns: gridProperties.numColumns,\n\t\t\ttileCount: blockClientIds.length,\n\t\t\ttileIndex: blockClientIds.indexOf( clientId ),\n\t\t};\n\t\treturn (\n\t\t\t<BlockListItem\n\t\t\t\tindex={ index }\n\t\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\tcontentResizeMode={ contentResizeMode }\n\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\tonAddBlock={ onAddBlock }\n\t\t\t\tmarginVertical={ marginVertical }\n\t\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\tshouldShowInnerBlockAppender={ shouldShowInnerBlockAppender }\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\tisGridItem={ isGridItem }\n\t\t\t\t{ ...gridItemProps }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst { blockToolbar, headerToolbar, floatingToolbar } = styles;\n\n\tconst containerStyle = {\n\t\tflex: isRootList ? 1 : 0,\n\t\t// We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.\n\t\tmarginVertical: isRootList ? 0 : -marginVertical,\n\t\tmarginHorizontal: isRootList ? 0 : -marginHorizontal,\n\t};\n\n\tconst isContentStretch = contentResizeMode === 'stretch';\n\tconst isMultiBlocks = blockClientIds.length > 1;\n\tconst { isWider } = alignmentHelpers;\n\tconst extraScrollHeight =\n\t\theaderToolbar.height +\n\t\tblockToolbar.height +\n\t\t( isFloatingToolbarVisible ? floatingToolbar.height : 0 );\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ containerStyle }\n\t\t\tonAccessibilityEscape={ clearSelectedBlock }\n\t\t\tonLayout={ onLayout }\n\t\t\ttestID=\"block-list-wrapper\"\n\t\t>\n\t\t\t{ isRootList ? (\n\t\t\t\t<BlockListProvider\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t...DEFAULT_BLOCK_LIST_CONTEXT,\n\t\t\t\t\t\tscrollRef: scrollRef.current,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<BlockDraggableWrapper isRTL={ isRTL }>\n\t\t\t\t\t\t{ ( { onScroll } ) => (\n\t\t\t\t\t\t\t<KeyboardAwareFlatList\n\t\t\t\t\t\t\t\t{ ...( Platform.OS === 'android'\n\t\t\t\t\t\t\t\t\t? { removeClippedSubviews: false }\n\t\t\t\t\t\t\t\t\t: {} ) } // Disable clipping on Android to fix focus losing. See https://github.com/wordpress-mobile/gutenberg-mobile/pull/741#issuecomment-472746541\n\t\t\t\t\t\t\t\taccessibilityLabel=\"block-list\"\n\t\t\t\t\t\t\t\tref={ scrollRef }\n\t\t\t\t\t\t\t\textraScrollHeight={ extraScrollHeight }\n\t\t\t\t\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\t\t\t\t\tscrollViewStyle={ { flex: 1 } }\n\t\t\t\t\t\t\t\textraData={ getExtraData() }\n\t\t\t\t\t\t\t\tscrollEnabled={ isRootList }\n\t\t\t\t\t\t\t\tcontentContainerStyle={ [\n\t\t\t\t\t\t\t\t\thorizontal &&\n\t\t\t\t\t\t\t\t\t\tstyles.horizontalContentContainer,\n\t\t\t\t\t\t\t\t\tisWider( blockWidth, 'medium' ) &&\n\t\t\t\t\t\t\t\t\t\t( isContentStretch && isMultiBlocks\n\t\t\t\t\t\t\t\t\t\t\t? styles.horizontalContentContainerStretch\n\t\t\t\t\t\t\t\t\t\t\t: styles.horizontalContentContainerCenter ),\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\tdata={ blockClientIds }\n\t\t\t\t\t\t\t\tkeyExtractor={ identity }\n\t\t\t\t\t\t\t\trenderItem={ renderItem }\n\t\t\t\t\t\t\t\tCellRendererComponent={ BlockListItemCell }\n\t\t\t\t\t\t\t\tshouldPreventAutomaticScroll={\n\t\t\t\t\t\t\t\t\tshouldFlatListPreventAutomaticScroll\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tListHeaderComponent={ header }\n\t\t\t\t\t\t\t\tListEmptyComponent={\n\t\t\t\t\t\t\t\t\t! isReadOnly && (\n\t\t\t\t\t\t\t\t\t\t<EmptyList\n\t\t\t\t\t\t\t\t\t\t\torientation={ orientation }\n\t\t\t\t\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tListFooterComponent={\n\t\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\t\taddBlockToEndOfPost={\n\t\t\t\t\t\t\t\t\t\t\taddBlockToEndOfPost\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisReadOnly={ isReadOnly }\n\t\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\twithFooter={ withFooter }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonScroll={ onScroll }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</BlockDraggableWrapper>\n\t\t\t\t</BlockListProvider>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{ blockClientIds.length > 0 ? (\n\t\t\t\t\t\t<View style={ [ { flex: 0 }, styles.overflowVisible ] }>\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t...getStyles(\n\t\t\t\t\t\t\t\t\t\tisStackedHorizontally,\n\t\t\t\t\t\t\t\t\t\thorizontalAlignment\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\thorizontal &&\n\t\t\t\t\t\t\t\t\t\tstyles.horizontalContentContainer,\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\t{ blockClientIds.map(\n\t\t\t\t\t\t\t\t\t( currentClientId, index ) => {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<View key={ currentClientId }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ renderItem( {\n\t\t\t\t\t\t\t\t\t\t\t\t\titem: currentClientId,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\taddBlockToEndOfPost={ addBlockToEndOfPost }\n\t\t\t\t\t\t\t\t\tisReadOnly={ isReadOnly }\n\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twithFooter={ withFooter }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EmptyList\n\t\t\t\t\t\t\torientation={ orientation }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\t\trenderFooterAppender={ renderFooterAppender }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ shouldShowInnerBlockAppender() && (\n\t\t\t\t<View\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tmarginHorizontal:\n\t\t\t\t\t\t\tmarginHorizontal - styles.innerAppender.marginLeft,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<BlockListAppender\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\tshowSeparator\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nfunction Footer( {\n\taddBlockToEndOfPost,\n\tisReadOnly,\n\trenderFooterAppender,\n\twithFooter,\n} ) {\n\tconst onAddParagraphBlock = useCallback( () => {\n\t\tconst paragraphBlock = createBlock( 'core/paragraph' );\n\t\taddBlockToEndOfPost( paragraphBlock );\n\t}, [ addBlockToEndOfPost ] );\n\n\tif ( ! isReadOnly && withFooter ) {\n\t\treturn (\n\t\t\t<Pressable\n\t\t\t\taccessibilityLabel={ __( 'Add paragraph block' ) }\n\t\t\t\ttestID={ __( 'Add paragraph block' ) }\n\t\t\t\tonPress={ onAddParagraphBlock }\n\t\t\t>\n\t\t\t\t<View style={ styles.blockListFooter } />\n\t\t\t</Pressable>\n\t\t);\n\t} else if ( renderFooterAppender ) {\n\t\treturn <View>{ renderFooterAppender() }</View>;\n\t}\n\n\treturn null;\n}\n\nfunction EmptyList( {\n\torientation,\n\trenderAppender,\n\trenderFooterAppender,\n\trootClientId,\n} ) {\n\tconst { shouldShowInsertionPoint } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tisBlockInsertionPointVisible,\n\t\t} = select( blockEditorStore );\n\n\t\tconst isStackedHorizontally = orientation === 'horizontal';\n\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\tconst blockInsertionPointIsVisible = isBlockInsertionPointVisible();\n\n\t\treturn {\n\t\t\tshouldShowInsertionPoint:\n\t\t\t\t! isStackedHorizontally &&\n\t\t\t\tblockInsertionPointIsVisible &&\n\t\t\t\tinsertionPoint.rootClientId === rootClientId &&\n\t\t\t\t// If list is empty, show the insertion point (via the default appender)\n\t\t\t\t( blockClientIds.length === 0 ||\n\t\t\t\t\t// Or if the insertion point is right before the denoted block.\n\t\t\t\t\t! blockClientIds[ insertionPoint.index ] ),\n\t\t};\n\t} );\n\tconst align = renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined;\n\tconst [ wrapperStyles ] = useEditorWrapperStyles( { align } );\n\n\tif ( renderFooterAppender || renderAppender === false ) {\n\t\treturn null;\n\t}\n\n\tconst containerStyles = [ styles.defaultAppender, wrapperStyles ];\n\n\treturn (\n\t\t<View style={ containerStyles }>\n\t\t\t<BlockListAppender\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\tshowSeparator={ shouldShowInsertionPoint }\n\t\t\t/>\n\t\t</View>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,cAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,kBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AAIA,IAAAY,eAAA,GAAAZ,OAAA;AACA,IAAAa,uBAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AA/BA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAaA,MAAMe,QAAQ,GAAKC,CAAC,IAAMA,CAAC;AAE3B,MAAMC,UAAU,GAAG,CAAC,CAAC;AACrB,MAAMC,SAAS,GAAGA,CAAEC,qBAAqB,EAAEC,mBAAmB,KAAM;EACnE,MAAMC,SAAS,GAAI,GAAGF,qBAAuB,IAAIC,mBAAqB,EAAC;EACvE,IAAKH,UAAU,CAAEI,SAAS,CAAE,EAAG;IAC9B,OAAOJ,UAAU,CAAEI,SAAS,CAAE;EAC/B;EACA,MAAMC,cAAc,GAAG,CACtBH,qBAAqB,IAAII,cAAM,CAACC,UAAU,EAC1CJ,mBAAmB,IAAIG,cAAM,CAAG,cAAcH,mBAAqB,EAAC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G,YAAA,CAAA0H,IAAI;IAACC,KAAK,EAAGoD;EAAiB,GAC9B,IAAAnE,MAAA,CAAAC,aAAA,EAACpG,kBAAA,CAAAqG,OAAiB;IACjBhE,YAAY,EAAGA,YAAc;IAC7BF,cAAc,EAAGA,cAAgB;IACjCiH,aAAa,EAAGS;EAA0B,CAC1C,CACI,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_element","_data","_blocks","_components","_i18n","_style","_interopRequireDefault","_blockListAppender","_blockListItem","_blockListItemCell","_blockListContext","_blockDraggable","_useEditorWrapperStyles","_store","identity","x","stylesMemo","getStyles","isStackedHorizontally","horizontalAlignment","styleName","computedStyles","styles","horizontal","overflowVisible","BlockList","blockWidth","initialBlockWidth","contentResizeMode","contentStyle","filterInnerBlocks","gridProperties","header","marginHorizontal","defaultBlock","marginLeft","marginVertical","marginTop","onAddBlock","onDeleteBlock","orientation","parentWidth","renderAppender","renderFooterAppender","rootClientId","withFooter","blockClientIds","blockCount","blockInsertionPointIsVisible","isReadOnly","isRootList","isFloatingToolbarVisible","maxWidth","isRTL","useSelect","select","getBlockCount","getBlockHierarchyRootClientId","getBlockOrder","getSelectedBlockClientId","isBlockInsertionPointVisible","getSettings","blockEditorStore","selectedBlockClientId","rootBlockId","blockOrder","isRTLSetting","maxWidthSetting","readOnly","Platform","OS","undefined","insertBlock","clearSelectedBlock","useDispatch","extraData","useRef","setBlockWidth","useState","addBlockToEndOfPost","newBlock","scrollRef","shouldFlatListPreventAutomaticScroll","shouldShowInnerBlockAppender","length","getExtraData","current","onLayout","nativeEvent","layout","layoutWidth","Math","floor","width","min","renderItem","item","clientId","index","isGridItem","gridItemProps","numOfColumns","numColumns","tileCount","tileIndex","indexOf","_react","createElement","default","blockToolbar","floatingToolbar","containerStyle","flex","isContentStretch","isMultiBlocks","isWider","alignmentHelpers","extraScrollHeight","height","View","style","onAccessibilityEscape","testID","BlockListProvider","value","DEFAULT_BLOCK_LIST_CONTEXT","BlockDraggableWrapper","onScroll","KeyboardAwareFlatList","accessibilityLabel","ref","keyboardShouldPersistTaps","scrollEnabled","contentContainerStyle","horizontalContentContainer","horizontalContentContainerStretch","horizontalContentContainerCenter","data","keyExtractor","CellRendererComponent","BlockListItemCell","shouldPreventAutomaticScroll","ListHeaderComponent","ListEmptyComponent","EmptyList","ListFooterComponent","Footer","Fragment","map","currentClientId","key","innerAppender","showSeparator","onAddParagraphBlock","useCallback","paragraphBlock","createBlock","Pressable","__","onPress","blockListFooter","shouldShowInsertionPoint","getBlockInsertionPoint","insertionPoint","align","WIDE_ALIGNMENTS","alignments","full","wrapperStyles","useEditorWrapperStyles","containerStyles","defaultAppender"],"sources":["@wordpress/block-editor/src/components/block-list/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Platform, Pressable } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useState, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tKeyboardAwareFlatList,\n\tWIDE_ALIGNMENTS,\n\talignmentHelpers,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport BlockListAppender from '../block-list-appender';\nimport BlockListItem from './block-list-item';\nimport BlockListItemCell from './block-list-item-cell';\nimport {\n\tBlockListProvider,\n\tDEFAULT_BLOCK_LIST_CONTEXT,\n} from './block-list-context';\nimport { BlockDraggableWrapper } from '../block-draggable';\nimport { useEditorWrapperStyles } from '../../hooks/use-editor-wrapper-styles';\nimport { store as blockEditorStore } from '../../store';\n\nconst identity = ( x ) => x;\n\nconst stylesMemo = {};\nconst getStyles = ( isStackedHorizontally, horizontalAlignment ) => {\n\tconst styleName = `${ isStackedHorizontally }-${ horizontalAlignment }`;\n\tif ( stylesMemo[ styleName ] ) {\n\t\treturn stylesMemo[ styleName ];\n\t}\n\tconst computedStyles = [\n\t\tisStackedHorizontally && styles.horizontal,\n\t\thorizontalAlignment && styles[ `is-aligned-${ horizontalAlignment }` ],\n\t\tstyles.overflowVisible,\n\t];\n\tstylesMemo[ styleName ] = computedStyles;\n\treturn computedStyles;\n};\n\nexport default function BlockList( {\n\tblockWidth: initialBlockWidth,\n\tcontentResizeMode,\n\tcontentStyle,\n\tfilterInnerBlocks,\n\tgridProperties,\n\theader,\n\thorizontal,\n\thorizontalAlignment,\n\tmarginHorizontal = styles.defaultBlock.marginLeft,\n\tmarginVertical = styles.defaultBlock.marginTop,\n\tonAddBlock,\n\tonDeleteBlock,\n\torientation,\n\tparentWidth,\n\trenderAppender,\n\trenderFooterAppender,\n\trootClientId,\n\twithFooter = true,\n} ) {\n\tconst {\n\t\tblockClientIds,\n\t\tblockCount,\n\t\tblockInsertionPointIsVisible,\n\t\tisReadOnly,\n\t\tisRootList,\n\t\tisFloatingToolbarVisible,\n\t\tisStackedHorizontally,\n\t\tmaxWidth,\n\t\tisRTL,\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\tgetBlockOrder,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetSettings,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tconst rootBlockId = getBlockHierarchyRootClientId(\n\t\t\t\tselectedBlockClientId\n\t\t\t);\n\n\t\t\tlet blockOrder = getBlockOrder( rootClientId );\n\t\t\t// Display only block which fulfill the condition in passed `filterInnerBlocks` function.\n\t\t\tif ( filterInnerBlocks ) {\n\t\t\t\tblockOrder = filterInnerBlocks( blockOrder );\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tisRTL: isRTLSetting,\n\t\t\t\tmaxWidth: maxWidthSetting,\n\t\t\t\treadOnly,\n\t\t\t} = getSettings();\n\n\t\t\treturn {\n\t\t\t\tblockClientIds: blockOrder,\n\t\t\t\tblockCount: getBlockCount(),\n\t\t\t\tblockInsertionPointIsVisible:\n\t\t\t\t\tPlatform.OS === 'ios' && isBlockInsertionPointVisible(),\n\t\t\t\tisReadOnly: readOnly,\n\t\t\t\tisRootList: rootClientId === undefined,\n\t\t\t\tisFloatingToolbarVisible:\n\t\t\t\t\t!! selectedBlockClientId && !! getBlockCount( rootBlockId ),\n\t\t\t\tisStackedHorizontally: orientation === 'horizontal',\n\t\t\t\tmaxWidth: maxWidthSetting,\n\t\t\t\tisRTL: isRTLSetting,\n\t\t\t};\n\t\t},\n\t\t[ filterInnerBlocks, orientation, rootClientId ]\n\t);\n\n\tconst { insertBlock, clearSelectedBlock } = useDispatch( blockEditorStore );\n\n\tconst extraData = useRef( {\n\t\tparentWidth,\n\t\trenderFooterAppender,\n\t\trenderAppender,\n\t\tonDeleteBlock,\n\t\tcontentStyle,\n\t} );\n\n\tconst [ blockWidth, setBlockWidth ] = useState( initialBlockWidth || 0 );\n\n\tconst addBlockToEndOfPost = ( newBlock ) => {\n\t\tinsertBlock( newBlock, blockCount );\n\t};\n\n\tconst scrollRef = useRef( null );\n\n\tconst shouldFlatListPreventAutomaticScroll = () =>\n\t\tblockInsertionPointIsVisible;\n\n\tconst shouldShowInnerBlockAppender = () =>\n\t\trenderAppender && blockClientIds.length > 0;\n\n\tconst getExtraData = () => {\n\t\tif (\n\t\t\textraData.current.parentWidth !== parentWidth ||\n\t\t\textraData.current.renderFooterAppender !== renderFooterAppender ||\n\t\t\textraData.current.onDeleteBlock !== onDeleteBlock ||\n\t\t\textraData.current.contentStyle !== contentStyle ||\n\t\t\textraData.current.renderAppender !== renderAppender ||\n\t\t\textraData.current.blockWidth !== blockWidth ||\n\t\t\textraData.current.gridProperties !== gridProperties\n\t\t) {\n\t\t\textraData.current = {\n\t\t\t\tparentWidth,\n\t\t\t\trenderFooterAppender,\n\t\t\t\tonDeleteBlock,\n\t\t\t\tcontentStyle,\n\t\t\t\trenderAppender,\n\t\t\t\tblockWidth,\n\t\t\t\tgridProperties,\n\t\t\t};\n\t\t}\n\t\treturn extraData.current;\n\t};\n\n\tconst onLayout = ( { nativeEvent } ) => {\n\t\tconst { layout } = nativeEvent;\n\n\t\tconst layoutWidth = Math.floor( layout.width );\n\t\tif ( isRootList && blockWidth !== layoutWidth ) {\n\t\t\tsetBlockWidth( Math.min( layoutWidth, maxWidth ) );\n\t\t} else if ( ! isRootList && ! blockWidth ) {\n\t\t\tsetBlockWidth( Math.min( layoutWidth, maxWidth ) );\n\t\t}\n\t};\n\n\tconst renderItem = ( { item: clientId, index } ) => {\n\t\t// Extracting the grid item properties here to avoid\n\t\t// re-renders in the blockListItem component.\n\t\tconst isGridItem = !! gridProperties;\n\t\tconst gridItemProps = gridProperties && {\n\t\t\tnumOfColumns: gridProperties.numColumns,\n\t\t\ttileCount: blockClientIds.length,\n\t\t\ttileIndex: blockClientIds.indexOf( clientId ),\n\t\t};\n\t\treturn (\n\t\t\t<BlockListItem\n\t\t\t\tindex={ index }\n\t\t\t\tisStackedHorizontally={ isStackedHorizontally }\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tparentWidth={ parentWidth }\n\t\t\t\tcontentResizeMode={ contentResizeMode }\n\t\t\t\tcontentStyle={ contentStyle }\n\t\t\t\tonAddBlock={ onAddBlock }\n\t\t\t\tmarginVertical={ marginVertical }\n\t\t\t\tmarginHorizontal={ marginHorizontal }\n\t\t\t\tonDeleteBlock={ onDeleteBlock }\n\t\t\t\tshouldShowInnerBlockAppender={ shouldShowInnerBlockAppender }\n\t\t\t\tblockWidth={ blockWidth }\n\t\t\t\tisGridItem={ isGridItem }\n\t\t\t\t{ ...gridItemProps }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst { blockToolbar, floatingToolbar } = styles;\n\n\tconst containerStyle = {\n\t\tflex: isRootList ? 1 : 0,\n\t\t// We set negative margin in the parent to remove the edge spacing between parent block and child block in ineer blocks.\n\t\tmarginVertical: isRootList ? 0 : -marginVertical,\n\t\tmarginHorizontal: isRootList ? 0 : -marginHorizontal,\n\t};\n\n\tconst isContentStretch = contentResizeMode === 'stretch';\n\tconst isMultiBlocks = blockClientIds.length > 1;\n\tconst { isWider } = alignmentHelpers;\n\tconst extraScrollHeight =\n\t\tblockToolbar.height +\n\t\t( isFloatingToolbarVisible ? floatingToolbar.height : 0 );\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ containerStyle }\n\t\t\tonAccessibilityEscape={ clearSelectedBlock }\n\t\t\tonLayout={ onLayout }\n\t\t\ttestID=\"block-list-wrapper\"\n\t\t>\n\t\t\t{ isRootList ? (\n\t\t\t\t<BlockListProvider\n\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t...DEFAULT_BLOCK_LIST_CONTEXT,\n\t\t\t\t\t\tscrollRef: scrollRef.current,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<BlockDraggableWrapper isRTL={ isRTL }>\n\t\t\t\t\t\t{ ( { onScroll } ) => (\n\t\t\t\t\t\t\t<KeyboardAwareFlatList\n\t\t\t\t\t\t\t\taccessibilityLabel=\"block-list\"\n\t\t\t\t\t\t\t\tref={ scrollRef }\n\t\t\t\t\t\t\t\textraScrollHeight={ extraScrollHeight }\n\t\t\t\t\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\t\t\t\t\textraData={ getExtraData() }\n\t\t\t\t\t\t\t\tscrollEnabled={ isRootList }\n\t\t\t\t\t\t\t\tcontentContainerStyle={ [\n\t\t\t\t\t\t\t\t\thorizontal &&\n\t\t\t\t\t\t\t\t\t\tstyles.horizontalContentContainer,\n\t\t\t\t\t\t\t\t\tisWider( blockWidth, 'medium' ) &&\n\t\t\t\t\t\t\t\t\t\t( isContentStretch && isMultiBlocks\n\t\t\t\t\t\t\t\t\t\t\t? styles.horizontalContentContainerStretch\n\t\t\t\t\t\t\t\t\t\t\t: styles.horizontalContentContainerCenter ),\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\tdata={ blockClientIds }\n\t\t\t\t\t\t\t\tkeyExtractor={ identity }\n\t\t\t\t\t\t\t\trenderItem={ renderItem }\n\t\t\t\t\t\t\t\tCellRendererComponent={ BlockListItemCell }\n\t\t\t\t\t\t\t\tshouldPreventAutomaticScroll={\n\t\t\t\t\t\t\t\t\tshouldFlatListPreventAutomaticScroll\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tListHeaderComponent={ header }\n\t\t\t\t\t\t\t\tListEmptyComponent={\n\t\t\t\t\t\t\t\t\t! isReadOnly && (\n\t\t\t\t\t\t\t\t\t\t<EmptyList\n\t\t\t\t\t\t\t\t\t\t\torientation={ orientation }\n\t\t\t\t\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tListFooterComponent={\n\t\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\t\taddBlockToEndOfPost={\n\t\t\t\t\t\t\t\t\t\t\taddBlockToEndOfPost\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisReadOnly={ isReadOnly }\n\t\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\twithFooter={ withFooter }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonScroll={ onScroll }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</BlockDraggableWrapper>\n\t\t\t\t</BlockListProvider>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{ blockClientIds.length > 0 ? (\n\t\t\t\t\t\t<View style={ [ { flex: 0 }, styles.overflowVisible ] }>\n\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\tstyle={ [\n\t\t\t\t\t\t\t\t\t...getStyles(\n\t\t\t\t\t\t\t\t\t\tisStackedHorizontally,\n\t\t\t\t\t\t\t\t\t\thorizontalAlignment\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\thorizontal &&\n\t\t\t\t\t\t\t\t\t\tstyles.horizontalContentContainer,\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\t{ blockClientIds.map(\n\t\t\t\t\t\t\t\t\t( currentClientId, index ) => {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<View key={ currentClientId }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ renderItem( {\n\t\t\t\t\t\t\t\t\t\t\t\t\titem: currentClientId,\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\taddBlockToEndOfPost={ addBlockToEndOfPost }\n\t\t\t\t\t\t\t\t\tisReadOnly={ isReadOnly }\n\t\t\t\t\t\t\t\t\trenderFooterAppender={\n\t\t\t\t\t\t\t\t\t\trenderFooterAppender\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twithFooter={ withFooter }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EmptyList\n\t\t\t\t\t\t\torientation={ orientation }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\t\trenderFooterAppender={ renderFooterAppender }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ shouldShowInnerBlockAppender() && (\n\t\t\t\t<View\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tmarginHorizontal:\n\t\t\t\t\t\t\tmarginHorizontal - styles.innerAppender.marginLeft,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<BlockListAppender\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t\tshowSeparator\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nfunction Footer( {\n\taddBlockToEndOfPost,\n\tisReadOnly,\n\trenderFooterAppender,\n\twithFooter,\n} ) {\n\tconst onAddParagraphBlock = useCallback( () => {\n\t\tconst paragraphBlock = createBlock( 'core/paragraph' );\n\t\taddBlockToEndOfPost( paragraphBlock );\n\t}, [ addBlockToEndOfPost ] );\n\n\tif ( ! isReadOnly && withFooter ) {\n\t\treturn (\n\t\t\t<Pressable\n\t\t\t\taccessibilityLabel={ __( 'Add paragraph block' ) }\n\t\t\t\ttestID={ __( 'Add paragraph block' ) }\n\t\t\t\tonPress={ onAddParagraphBlock }\n\t\t\t>\n\t\t\t\t<View style={ styles.blockListFooter } />\n\t\t\t</Pressable>\n\t\t);\n\t} else if ( renderFooterAppender ) {\n\t\treturn <View>{ renderFooterAppender() }</View>;\n\t}\n\n\treturn null;\n}\n\nfunction EmptyList( {\n\torientation,\n\trenderAppender,\n\trenderFooterAppender,\n\trootClientId,\n} ) {\n\tconst { shouldShowInsertionPoint } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockInsertionPoint,\n\t\t\tisBlockInsertionPointVisible,\n\t\t} = select( blockEditorStore );\n\n\t\tconst isStackedHorizontally = orientation === 'horizontal';\n\t\tconst blockClientIds = getBlockOrder( rootClientId );\n\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\tconst blockInsertionPointIsVisible = isBlockInsertionPointVisible();\n\n\t\treturn {\n\t\t\tshouldShowInsertionPoint:\n\t\t\t\t! isStackedHorizontally &&\n\t\t\t\tblockInsertionPointIsVisible &&\n\t\t\t\tinsertionPoint.rootClientId === rootClientId &&\n\t\t\t\t// If list is empty, show the insertion point (via the default appender)\n\t\t\t\t( blockClientIds.length === 0 ||\n\t\t\t\t\t// Or if the insertion point is right before the denoted block.\n\t\t\t\t\t! blockClientIds[ insertionPoint.index ] ),\n\t\t};\n\t} );\n\tconst align = renderAppender ? WIDE_ALIGNMENTS.alignments.full : undefined;\n\tconst [ wrapperStyles ] = useEditorWrapperStyles( { align } );\n\n\tif ( renderFooterAppender || renderAppender === false ) {\n\t\treturn null;\n\t}\n\n\tconst containerStyles = [ styles.defaultAppender, wrapperStyles ];\n\n\treturn (\n\t\t<View style={ containerStyles }>\n\t\t\t<BlockListAppender\n\t\t\t\trootClientId={ rootClientId }\n\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\tshowSeparator={ shouldShowInsertionPoint }\n\t\t\t/>\n\t\t</View>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,cAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,kBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAA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C;EACF,CAAE,CAAC;EACH,MAAMkE,KAAK,GAAG1H,cAAc,GAAG2H,2BAAe,CAACC,UAAU,CAACC,IAAI,GAAGhG,SAAS;EAC1E,MAAM,CAAEiG,aAAa,CAAE,GAAG,IAAAC,8CAAsB,EAAE;IAAEL;EAAM,CAAE,CAAC;EAE7D,IAAKzH,oBAAoB,IAAID,cAAc,KAAK,KAAK,EAAG;IACvD,OAAO,IAAI;EACZ;EAEA,MAAMgI,eAAe,GAAG,CAAEpJ,cAAM,CAACqJ,eAAe,EAAEH,aAAa,CAAE;EAEjE,OACC,IAAA9D,MAAA,CAAAC,aAAA,EAAC7G,YAAA,CAAAyH,IAAI;IAACC,KAAK,EAAGkD;EAAiB,GAC9B,IAAAhE,MAAA,CAAAC,aAAA,EAACpG,kBAAA,CAAAqG,OAAiB;IACjBhE,YAAY,EAAGA,YAAc;IAC7BF,cAAc,EAAGA,cAAgB;IACjC8G,aAAa,EAAGS;EAA0B,CAC1C,CACI,CAAC;AAET","ignoreList":[]}
|
|
@@ -92,7 +92,6 @@ function useBlockProps(props = {}, {
|
|
|
92
92
|
blockTitle,
|
|
93
93
|
isSelected,
|
|
94
94
|
isSubtreeDisabled,
|
|
95
|
-
isOutlineEnabled,
|
|
96
95
|
hasOverlay,
|
|
97
96
|
initialPosition,
|
|
98
97
|
blockEditingMode,
|
|
@@ -102,7 +101,6 @@ function useBlockProps(props = {}, {
|
|
|
102
101
|
isReusable,
|
|
103
102
|
isDragging,
|
|
104
103
|
hasChildSelected,
|
|
105
|
-
removeOutline,
|
|
106
104
|
isBlockMovingMode,
|
|
107
105
|
canInsertMovingBlock,
|
|
108
106
|
isEditingDisabled,
|
|
@@ -121,9 +119,7 @@ function useBlockProps(props = {}, {
|
|
|
121
119
|
}), (0, _useBlockRefs.useBlockRefProvider)(clientId), (0, _useFocusHandler.useFocusHandler)(clientId), (0, _useSelectedBlockEventHandlers.useEventHandlers)({
|
|
122
120
|
clientId,
|
|
123
121
|
isSelected
|
|
124
|
-
}), (0, _useNavModeExit.useNavModeExit)(clientId), (0, _useIsHovered.useIsHovered)({
|
|
125
|
-
isEnabled: isOutlineEnabled
|
|
126
|
-
}), (0, _useIntersectionObserver.useIntersectionObserver)(), (0, _useMovingAnimation.default)({
|
|
122
|
+
}), (0, _useNavModeExit.useNavModeExit)(clientId), (0, _useIsHovered.useIsHovered)(), (0, _useIntersectionObserver.useIntersectionObserver)(), (0, _useMovingAnimation.default)({
|
|
127
123
|
triggerAnimationOnChange: index,
|
|
128
124
|
clientId
|
|
129
125
|
}), (0, _compose.useDisabled)({
|
|
@@ -143,6 +139,10 @@ function useBlockProps(props = {}, {
|
|
|
143
139
|
if (blockApiVersion < 2 && clientId === blockEditContext.clientId) {
|
|
144
140
|
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? (0, _warning.default)(`Block type "${name}" must support API version 2 or higher to work correctly with "useBlockProps" method.`) : void 0;
|
|
145
141
|
}
|
|
142
|
+
let hasNegativeMargin = false;
|
|
143
|
+
if (wrapperProps?.style?.marginTop?.charAt(0) === '-' || wrapperProps?.style?.marginBottom?.charAt(0) === '-' || wrapperProps?.style?.marginLeft?.charAt(0) === '-' || wrapperProps?.style?.marginRight?.charAt(0) === '-') {
|
|
144
|
+
hasNegativeMargin = true;
|
|
145
|
+
}
|
|
146
146
|
return {
|
|
147
147
|
tabIndex: blockEditingMode === 'disabled' ? -1 : 0,
|
|
148
148
|
...wrapperProps,
|
|
@@ -166,11 +166,11 @@ function useBlockProps(props = {}, {
|
|
|
166
166
|
'is-reusable': isReusable,
|
|
167
167
|
'is-dragging': isDragging,
|
|
168
168
|
'has-child-selected': hasChildSelected,
|
|
169
|
-
'remove-outline': removeOutline,
|
|
170
169
|
'is-block-moving-mode': isBlockMovingMode,
|
|
171
170
|
'can-insert-moving-block': canInsertMovingBlock,
|
|
172
171
|
'is-editing-disabled': isEditingDisabled,
|
|
173
172
|
'has-editable-outline': hasEditableOutline,
|
|
173
|
+
'has-negative-margin': hasNegativeMargin,
|
|
174
174
|
'is-content-locked-temporarily-editing-as-blocks': isTemporarilyEditingAsBlocks
|
|
175
175
|
}, className, props.className, wrapperProps.className, defaultClassName),
|
|
176
176
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useNavModeExit","_useBlockRefs","_useIntersectionObserver","_useFlashEditableBlocks","_useBindingsAttributes","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","isOutlineEnabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","removeOutline","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useNavModeExit","useIsHovered","isEnabled","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","useFlashEditableBlocks","blockEditContext","useBlockEditContext","hasBlockBindings","blockBindingsKey","bindingsStyle","canBindBlock","SCRIPT_DEBUG","warning","tabIndex","id","role","inert","undefined","classnames","style","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps(\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\tisOutlineEnabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tremoveOutline,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseIsHovered( { isEnabled: isOutlineEnabled } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: classnames(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'remove-outline': removeOutline,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,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C,YAAY,CAACD,SAAS,EACtB0B,gBACD,CAAC;IACDsC,KAAK,EAAE;MAAE,GAAG/D,YAAY,CAAC+D,KAAK;MAAE,GAAGnE,KAAK,CAACmE,KAAK;MAAE,GAAGV;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA1D,aAAa,CAACqE,IAAI,GAAGC,+BAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useNavModeExit","_useBlockRefs","_useIntersectionObserver","_useFlashEditableBlocks","_useBindingsAttributes","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useNavModeExit","useIsHovered","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","useFlashEditableBlocks","isEnabled","blockEditContext","useBlockEditContext","hasBlockBindings","blockBindingsKey","bindingsStyle","canBindBlock","SCRIPT_DEBUG","warning","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","id","role","inert","undefined","classnames","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps(\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseIsHovered(),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: classnames(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAIA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,8BAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,wBAAA,GAAAf,OAAA;AACA,IAAAgB,uBAAA,GAAAhB,OAAA;AACA,IAAAiB,sBAAA,GAAAjB,OAAA;AA/BA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASkB,aAAaA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAE;EAAEC;AAAiB,CAAC,GAAG,CAAC,CAAC,EAAG;EACtE,MAAM;IACLC,QAAQ;IACR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QAAQ;IACtB,WAAW,EAAEM,IAAI;IACjB,YAAY,EAAEE,UAAU;IACxB2D,KAAK,EAAEzD,iBAAiB,GAAG,MAAM,GAAG0D,SAAS;IAC7CnE,SAAS,EAAE,IAAAoE,mBAAU,EACpB,gCAAgC,EAChC;MACC;MACA,UAAU,EAAE,CAAElE,SAAS;MACvB,mBAAmB,EAAEQ,UAAU;MAC/B,aAAa,EAAEF,UAAU;MACzB,gBAAgB,EAAEK,aAAa;MAC/B,mBAAmB,EAAEC,eAAe;MACpC,uBAAuB,EAAEC,mBAAmB;MAC5C,aAAa,EAAEC,UAAU;MACzB,aAAa,EAAEC,UAAU;MACzB,oBAAoB,EAAEC,gBAAgB;MACtC,sBAAsB,EAAEC,iBAAiB;MACzC,yBAAyB,EAAEC,oBAAoB;MAC/C,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,qBAAqB,EAAEkC,iBAAiB;MACxC,iDAAiD,EAChDjC;IACF,CAAC,EACDvB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtBwB,gBACD,CAAC;IACDiC,KAAK,EAAE;MAAE,GAAGxD,YAAY,CAACwD,KAAK;MAAE,GAAG5D,KAAK,CAAC4D,KAAK;MAAE,GAAGL;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACAxD,aAAa,CAACyE,IAAI,GAAGC,+BAAa","ignoreList":[]}
|
|
@@ -29,31 +29,19 @@ var _blockRefsProvider = require("../../provider/block-refs-provider");
|
|
|
29
29
|
*/
|
|
30
30
|
function useBlockRefProvider(clientId) {
|
|
31
31
|
const {
|
|
32
|
-
|
|
33
|
-
callbacks
|
|
32
|
+
refsMap
|
|
34
33
|
} = (0, _element.useContext)(_blockRefsProvider.BlockRefs);
|
|
35
|
-
const ref = (0, _element.useRef)();
|
|
36
|
-
(0, _element.useLayoutEffect)(() => {
|
|
37
|
-
refs.set(ref, clientId);
|
|
38
|
-
return () => {
|
|
39
|
-
refs.delete(ref);
|
|
40
|
-
};
|
|
41
|
-
}, [clientId]);
|
|
42
34
|
return (0, _compose.useRefEffect)(element => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// Call any update functions.
|
|
46
|
-
callbacks.forEach((id, setElement) => {
|
|
47
|
-
if (clientId === id) {
|
|
48
|
-
setElement(element);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
35
|
+
refsMap.set(clientId, element);
|
|
36
|
+
return () => refsMap.delete(clientId);
|
|
51
37
|
}, [clientId]);
|
|
52
38
|
}
|
|
53
39
|
|
|
54
40
|
/**
|
|
55
|
-
* Gets a ref pointing to the current block element. Continues to return
|
|
56
|
-
* stable ref even if the
|
|
41
|
+
* Gets a ref pointing to the current block element. Continues to return the same
|
|
42
|
+
* stable ref object even if the `clientId` argument changes. This hook is not
|
|
43
|
+
* reactive, i.e., it won't trigger a rerender of the calling component if the
|
|
44
|
+
* ref value changes. For reactive use cases there is the `useBlockElement` hook.
|
|
57
45
|
*
|
|
58
46
|
* @param {string} clientId The client ID to get a ref for.
|
|
59
47
|
*
|
|
@@ -61,26 +49,19 @@ function useBlockRefProvider(clientId) {
|
|
|
61
49
|
*/
|
|
62
50
|
function useBlockRef(clientId) {
|
|
63
51
|
const {
|
|
64
|
-
|
|
52
|
+
refsMap
|
|
65
53
|
} = (0, _element.useContext)(_blockRefsProvider.BlockRefs);
|
|
66
|
-
const
|
|
67
|
-
|
|
54
|
+
const latestClientId = (0, _element.useRef)();
|
|
55
|
+
latestClientId.current = clientId;
|
|
56
|
+
|
|
68
57
|
// Always return an object, even if no ref exists for a given client ID, so
|
|
69
58
|
// that `current` works at a later point.
|
|
70
59
|
return (0, _element.useMemo)(() => ({
|
|
71
60
|
get current() {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// Multiple refs may be created for a single block. Find the
|
|
75
|
-
// first that has an element set.
|
|
76
|
-
for (const [ref, id] of refs.entries()) {
|
|
77
|
-
if (id === freshClientId.current && ref.current) {
|
|
78
|
-
element = ref.current;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return element;
|
|
61
|
+
var _refsMap$get;
|
|
62
|
+
return (_refsMap$get = refsMap.get(latestClientId.current)) !== null && _refsMap$get !== void 0 ? _refsMap$get : null;
|
|
82
63
|
}
|
|
83
|
-
}), []);
|
|
64
|
+
}), [refsMap]);
|
|
84
65
|
}
|
|
85
66
|
|
|
86
67
|
/**
|
|
@@ -92,20 +73,10 @@ function useBlockRef(clientId) {
|
|
|
92
73
|
* @return {Element|null} The block's wrapper element.
|
|
93
74
|
*/
|
|
94
75
|
function useBlockElement(clientId) {
|
|
76
|
+
var _useObservableValue;
|
|
95
77
|
const {
|
|
96
|
-
|
|
78
|
+
refsMap
|
|
97
79
|
} = (0, _element.useContext)(_blockRefsProvider.BlockRefs);
|
|
98
|
-
|
|
99
|
-
const [element, setElement] = (0, _element.useState)(null);
|
|
100
|
-
(0, _element.useLayoutEffect)(() => {
|
|
101
|
-
if (!clientId) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
callbacks.set(setElement, clientId);
|
|
105
|
-
return () => {
|
|
106
|
-
callbacks.delete(setElement);
|
|
107
|
-
};
|
|
108
|
-
}, [clientId]);
|
|
109
|
-
return ref.current || element;
|
|
80
|
+
return (_useObservableValue = (0, _compose.useObservableValue)(refsMap, clientId)) !== null && _useObservableValue !== void 0 ? _useObservableValue : null;
|
|
110
81
|
}
|
|
111
82
|
//# sourceMappingURL=use-block-refs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_compose","_blockRefsProvider","useBlockRefProvider","clientId","
|
|
1
|
+
{"version":3,"names":["_element","require","_compose","_blockRefsProvider","useBlockRefProvider","clientId","refsMap","useContext","BlockRefs","useRefEffect","element","set","delete","useBlockRef","latestClientId","useRef","current","useMemo","_refsMap$get","get","useBlockElement","_useObservableValue","useObservableValue"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-block-refs.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext, useMemo, useRef } from '@wordpress/element';\nimport { useRefEffect, useObservableValue } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { BlockRefs } from '../../provider/block-refs-provider';\n\n/** @typedef {import('@wordpress/element').RefCallback} RefCallback */\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * Provides a ref to the BlockRefs context.\n *\n * @param {string} clientId The client ID of the element ref.\n *\n * @return {RefCallback} Ref callback.\n */\nexport function useBlockRefProvider( clientId ) {\n\tconst { refsMap } = useContext( BlockRefs );\n\treturn useRefEffect(\n\t\t( element ) => {\n\t\t\trefsMap.set( clientId, element );\n\t\t\treturn () => refsMap.delete( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n\n/**\n * Gets a ref pointing to the current block element. Continues to return the same\n * stable ref object even if the `clientId` argument changes. This hook is not\n * reactive, i.e., it won't trigger a rerender of the calling component if the\n * ref value changes. For reactive use cases there is the `useBlockElement` hook.\n *\n * @param {string} clientId The client ID to get a ref for.\n *\n * @return {RefObject} A ref containing the element.\n */\nfunction useBlockRef( clientId ) {\n\tconst { refsMap } = useContext( BlockRefs );\n\tconst latestClientId = useRef();\n\tlatestClientId.current = clientId;\n\n\t// Always return an object, even if no ref exists for a given client ID, so\n\t// that `current` works at a later point.\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tget current() {\n\t\t\t\treturn refsMap.get( latestClientId.current ) ?? null;\n\t\t\t},\n\t\t} ),\n\t\t[ refsMap ]\n\t);\n}\n\n/**\n * Return the element for a given client ID. Updates whenever the element\n * changes, becomes available, or disappears.\n *\n * @param {string} clientId The client ID to an element for.\n *\n * @return {Element|null} The block's wrapper element.\n */\nfunction useBlockElement( clientId ) {\n\tconst { refsMap } = useContext( BlockRefs );\n\treturn useObservableValue( refsMap, clientId ) ?? null;\n}\n\nexport { useBlockRef as __unstableUseBlockRef };\nexport { useBlockElement as __unstableUseBlockElement };\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,QAAAa,mBAAA,GAAO,IAAAC,2BAAkB,EAAEhB,OAAO,EAAED,QAAS,CAAC,cAAAgB,mBAAA,cAAAA,mBAAA,GAAI,IAAI;AACvD","ignoreList":[]}
|
|
@@ -22,21 +22,17 @@ function listener(event) {
|
|
|
22
22
|
* Adds `is-hovered` class when the block is hovered and in navigation or
|
|
23
23
|
* outline mode.
|
|
24
24
|
*/
|
|
25
|
-
function useIsHovered({
|
|
26
|
-
isEnabled
|
|
27
|
-
}) {
|
|
25
|
+
function useIsHovered() {
|
|
28
26
|
return (0, _compose.useRefEffect)(node => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
node.removeEventListener('mouseover', listener);
|
|
27
|
+
node.addEventListener('mouseout', listener);
|
|
28
|
+
node.addEventListener('mouseover', listener);
|
|
29
|
+
return () => {
|
|
30
|
+
node.removeEventListener('mouseout', listener);
|
|
31
|
+
node.removeEventListener('mouseover', listener);
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, [isEnabled]);
|
|
33
|
+
// Remove class in case it lingers.
|
|
34
|
+
node.classList.remove('is-hovered');
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
41
37
|
}
|
|
42
38
|
//# sourceMappingURL=use-is-hovered.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","listener","event","defaultPrevented","action","type","preventDefault","currentTarget","classList","useIsHovered","
|
|
1
|
+
{"version":3,"names":["_compose","require","listener","event","defaultPrevented","action","type","preventDefault","currentTarget","classList","useIsHovered","useRefEffect","node","addEventListener","removeEventListener","remove"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-is-hovered.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\nfunction listener( event ) {\n\tif ( event.defaultPrevented ) {\n\t\treturn;\n\t}\n\n\tconst action = event.type === 'mouseover' ? 'add' : 'remove';\n\n\tevent.preventDefault();\n\tevent.currentTarget.classList[ action ]( 'is-hovered' );\n}\n\n/*\n * Adds `is-hovered` class when the block is hovered and in navigation or\n * outline mode.\n */\nexport function useIsHovered() {\n\treturn useRefEffect( ( node ) => {\n\t\tnode.addEventListener( 'mouseout', listener );\n\t\tnode.addEventListener( 'mouseover', listener );\n\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mouseout', listener );\n\t\t\tnode.removeEventListener( 'mouseover', listener );\n\n\t\t\t// Remove class in case it lingers.\n\t\t\tnode.classList.remove( 'is-hovered' );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,SAASC,QAAQA,CAAEC,KAAK,EAAG;EAC1B,IAAKA,KAAK,CAACC,gBAAgB,EAAG;IAC7B;EACD;EAEA,MAAMC,MAAM,GAAGF,KAAK,CAACG,IAAI,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ;EAE5DH,KAAK,CAACI,cAAc,CAAC,CAAC;EACtBJ,KAAK,CAACK,aAAa,CAACC,SAAS,CAAEJ,MAAM,CAAE,CAAE,YAAa,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACO,SAASK,YAAYA,CAAA,EAAG;EAC9B,OAAO,IAAAC,qBAAY,EAAIC,IAAI,IAAM;IAChCA,IAAI,CAACC,gBAAgB,CAAE,UAAU,EAAEX,QAAS,CAAC;IAC7CU,IAAI,CAACC,gBAAgB,CAAE,WAAW,EAAEX,QAAS,CAAC;IAE9C,OAAO,MAAM;MACZU,IAAI,CAACE,mBAAmB,CAAE,UAAU,EAAEZ,QAAS,CAAC;MAChDU,IAAI,CAACE,mBAAmB,CAAE,WAAW,EAAEZ,QAAS,CAAC;;MAEjD;MACAU,IAAI,CAACH,SAAS,CAACM,MAAM,CAAE,YAAa,CAAC;IACtC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
|
|
@@ -93,7 +93,9 @@ const BlockMover = ({
|
|
|
93
93
|
}].filter(el => el.value === blockPageMoverState);
|
|
94
94
|
const onPickerSelect = value => {
|
|
95
95
|
const option = blockPageMoverOptions.find(el => el.value === value);
|
|
96
|
-
if (option && option.onSelect)
|
|
96
|
+
if (option && option.onSelect) {
|
|
97
|
+
option.onSelect();
|
|
98
|
+
}
|
|
97
99
|
};
|
|
98
100
|
const onLongPressMoveUp = (0, _element.useCallback)(showBlockPageMover(BLOCK_MOVER_DIRECTION_TOP), []);
|
|
99
101
|
const onLongPressMoveDown = (0, _element.useCallback)(showBlockPageMover(BLOCK_MOVER_DIRECTION_BOTTOM), []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_i18n","_components","_compose","_data","_element","_moverDescription","_store","BLOCK_MOVER_DIRECTION_TOP","exports","BLOCK_MOVER_DIRECTION_BOTTOM","BlockMover","isFirst","isLast","canMove","onMoveDown","onMoveUp","onLongMove","firstIndex","numberOfBlocks","rootClientId","isStackedHorizontally","pickerRef","useRef","shouldPresentPicker","setShouldPresentPicker","useState","blockPageMoverState","setBlockPageMoverState","undefined","showBlockPageMover","direction","current","useEffect","presentPicker","description","backwardButtonHint","forwardButtonHint","firstBlockTitle","lastBlockTitle","icon","backward","backwardButtonIcon","forward","forwardButtonIcon","title","backwardButtonTitle","forwardButtonTitle","getMoversSetup","blockPageMoverOptions","label","__","value","onSelect","filter","el","onPickerSelect","option","find","onLongPressMoveUp","useCallback","onLongPressMoveDown","_react","createElement","ToolbarGroup","ToolbarButton","isDisabled","onClick","onLongPress","extraProps","hint","Picker","ref","options","onChange","leftAlign","hideCancelButton","Platform","OS","_default","default","compose","withSelect","select","clientIds","getBlockIndex","canMoveBlocks","getBlockRootClientId","getBlockOrder","blockEditorStore","normalizedClientIds","Array","isArray","firstClientId","blockOrder","lastIndex","length","withDispatch","dispatch","moveBlocksDown","moveBlocksUp","moveBlocksToPosition","args","targetIndex","withInstanceId"],"sources":["@wordpress/block-editor/src/components/block-mover/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Picker, ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getMoversSetup } from './mover-description';\nimport { store as blockEditorStore } from '../../store';\n\nexport const BLOCK_MOVER_DIRECTION_TOP = 'blockPageMoverOptions-moveToTop';\nexport const BLOCK_MOVER_DIRECTION_BOTTOM =\n\t'blockPageMoverOptions-moveToBottom';\n\nexport const BlockMover = ( {\n\tisFirst,\n\tisLast,\n\tcanMove,\n\tonMoveDown,\n\tonMoveUp,\n\tonLongMove,\n\tfirstIndex,\n\tnumberOfBlocks,\n\trootClientId,\n\tisStackedHorizontally,\n} ) => {\n\tconst pickerRef = useRef();\n\tconst [ shouldPresentPicker, setShouldPresentPicker ] = useState( false );\n\tconst [ blockPageMoverState, setBlockPageMoverState ] =\n\t\tuseState( undefined );\n\tconst showBlockPageMover = ( direction ) => () => {\n\t\tif ( ! pickerRef.current ) {\n\t\t\tsetBlockPageMoverState( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\tsetBlockPageMoverState( direction );\n\t\tsetShouldPresentPicker( true );\n\t};\n\n\t// Ensure that the picker is only presented after state updates.\n\tuseEffect( () => {\n\t\tif ( shouldPresentPicker ) {\n\t\t\tpickerRef.current?.presentPicker();\n\t\t\tsetShouldPresentPicker( false );\n\t\t}\n\t}, [ shouldPresentPicker ] );\n\n\tconst {\n\t\tdescription: {\n\t\t\tbackwardButtonHint,\n\t\t\tforwardButtonHint,\n\t\t\tfirstBlockTitle,\n\t\t\tlastBlockTitle,\n\t\t},\n\t\ticon: { backward: backwardButtonIcon, forward: forwardButtonIcon },\n\t\ttitle: { backward: backwardButtonTitle, forward: forwardButtonTitle },\n\t} = getMoversSetup( isStackedHorizontally, { firstIndex } );\n\n\tconst blockPageMoverOptions = [\n\t\t{\n\t\t\ticon: backwardButtonIcon,\n\t\t\tlabel: __( 'Move to top' ),\n\t\t\tvalue: BLOCK_MOVER_DIRECTION_TOP,\n\t\t\tonSelect: () => {\n\t\t\t\tonLongMove()( 0 );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ticon: forwardButtonIcon,\n\t\t\tlabel: __( 'Move to bottom' ),\n\t\t\tvalue: BLOCK_MOVER_DIRECTION_BOTTOM,\n\t\t\tonSelect: () => {\n\t\t\t\tonLongMove()( numberOfBlocks );\n\t\t\t},\n\t\t},\n\t].filter( ( el ) => el.value === blockPageMoverState );\n\n\tconst onPickerSelect = ( value ) => {\n\t\tconst option = blockPageMoverOptions.find(\n\t\t\t( el ) => el.value === value\n\t\t);\n\t\tif ( option && option.onSelect ) option.onSelect();\n\t};\n\n\tconst onLongPressMoveUp = useCallback(\n\t\tshowBlockPageMover( BLOCK_MOVER_DIRECTION_TOP ),\n\t\t[]\n\t);\n\tconst onLongPressMoveDown = useCallback(\n\t\tshowBlockPageMover( BLOCK_MOVER_DIRECTION_BOTTOM ),\n\t\t[]\n\t);\n\n\tif ( ! canMove || ( isFirst && isLast && ! rootClientId ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\ttitle={ ! isFirst ? backwardButtonTitle : firstBlockTitle }\n\t\t\t\tisDisabled={ isFirst }\n\t\t\t\tonClick={ onMoveUp }\n\t\t\t\tonLongPress={ onLongPressMoveUp }\n\t\t\t\ticon={ backwardButtonIcon }\n\t\t\t\textraProps={ { hint: backwardButtonHint } }\n\t\t\t/>\n\n\t\t\t<ToolbarButton\n\t\t\t\ttitle={ ! isLast ? forwardButtonTitle : lastBlockTitle }\n\t\t\t\tisDisabled={ isLast }\n\t\t\t\tonClick={ onMoveDown }\n\t\t\t\tonLongPress={ onLongPressMoveDown }\n\t\t\t\ticon={ forwardButtonIcon }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: forwardButtonHint,\n\t\t\t\t} }\n\t\t\t/>\n\n\t\t\t<Picker\n\t\t\t\tref={ pickerRef }\n\t\t\t\toptions={ blockPageMoverOptions }\n\t\t\t\tonChange={ onPickerSelect }\n\t\t\t\ttitle={ __( 'Change block position' ) }\n\t\t\t\tleftAlign\n\t\t\t\thideCancelButton={ Platform.OS !== 'ios' }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n};\n\nexport default compose(\n\twithSelect( ( select, { clientIds } ) => {\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tcanMoveBlocks,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockOrder,\n\t\t} = select( blockEditorStore );\n\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t? clientIds\n\t\t\t: [ clientIds ];\n\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\tconst rootClientId = getBlockRootClientId( firstClientId );\n\t\tconst blockOrder = getBlockOrder( rootClientId );\n\t\tconst firstIndex = getBlockIndex( firstClientId );\n\t\tconst lastIndex = getBlockIndex(\n\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t);\n\n\t\treturn {\n\t\t\tfirstIndex,\n\t\t\tnumberOfBlocks: blockOrder.length - 1,\n\t\t\tisFirst: firstIndex === 0,\n\t\t\tisLast: lastIndex === blockOrder.length - 1,\n\t\t\tcanMove: canMoveBlocks( clientIds, rootClientId ),\n\t\t\trootClientId,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { clientIds, rootClientId } ) => {\n\t\tconst { moveBlocksDown, moveBlocksUp, moveBlocksToPosition } =\n\t\t\tdispatch( blockEditorStore );\n\t\treturn {\n\t\t\tonMoveDown: ( ...args ) =>\n\t\t\t\tmoveBlocksDown( clientIds, rootClientId, ...args ),\n\t\t\tonMoveUp: ( ...args ) =>\n\t\t\t\tmoveBlocksUp( clientIds, rootClientId, ...args ),\n\t\t\tonLongMove:\n\t\t\t\t( targetIndex ) =>\n\t\t\t\t( ...args ) =>\n\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\ttargetIndex,\n\t\t\t\t\t\t...args\n\t\t\t\t\t),\n\t\t};\n\t} ),\n\twithInstanceId\n)( BlockMover );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAIO,MAAMQ,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG,iCAAiC;AACnE,MAAME,4BAA4B,GAAAD,OAAA,CAAAC,4BAAA,GACxC,oCAAoC;AAE9B,MAAMC,UAAU,GAAGA,CAAE;EAC3BC,OAAO;EACPC,MAAM;EACNC,OAAO;EACPC,UAAU;EACVC,QAAQ;EACRC,UAAU;EACVC,UAAU;EACVC,cAAc;EACdC,YAAY;EACZC;AACD,CAAC,KAAM;EACN,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC1B,MAAM,CAAEC,mBAAmB,EAAEC,sBAAsB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzE,MAAM,CAAEC,mBAAmB,EAAEC,sBAAsB,CAAE,GACpD,IAAAF,iBAAQ,EAAEG,SAAU,CAAC;EACtB,MAAMC,kBAAkB,GAAKC,SAAS,IAAM,MAAM;IACjD,IAAK,CAAET,SAAS,CAACU,OAAO,EAAG;MAC1BJ,s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AACF,CAAE,CAAC,EACH,IAAA6E,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAEd,SAAS;EAAEhE;AAAa,CAAC,KAAM;EAC1D,MAAM;IAAE+E,cAAc;IAAEC,YAAY;IAAEC;EAAqB,CAAC,GAC3DH,QAAQ,CAAET,YAAiB,CAAC;EAC7B,OAAO;IACN1E,UAAU,EAAEA,CAAE,GAAGuF,IAAI,KACpBH,cAAc,CAAEf,SAAS,EAAEhE,YAAY,EAAE,GAAGkF,IAAK,CAAC;IACnDtF,QAAQ,EAAEA,CAAE,GAAGsF,IAAI,KAClBF,YAAY,CAAEhB,SAAS,EAAEhE,YAAY,EAAE,GAAGkF,IAAK,CAAC;IACjDrF,UAAU,EACPsF,WAAW,IACb,CAAE,GAAGD,IAAI,KACRD,oBAAoB,CACnBjB,SAAS,EACThE,YAAY,EACZmF,WAAW,EACX,GAAGD,IACJ;EACH,CAAC;AACF,CAAE,CAAC,EACHE,uBACD,CAAC,CAAE7F,UAAW,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_i18n","_components","_compose","_data","_element","_moverDescription","_store","BLOCK_MOVER_DIRECTION_TOP","exports","BLOCK_MOVER_DIRECTION_BOTTOM","BlockMover","isFirst","isLast","canMove","onMoveDown","onMoveUp","onLongMove","firstIndex","numberOfBlocks","rootClientId","isStackedHorizontally","pickerRef","useRef","shouldPresentPicker","setShouldPresentPicker","useState","blockPageMoverState","setBlockPageMoverState","undefined","showBlockPageMover","direction","current","useEffect","presentPicker","description","backwardButtonHint","forwardButtonHint","firstBlockTitle","lastBlockTitle","icon","backward","backwardButtonIcon","forward","forwardButtonIcon","title","backwardButtonTitle","forwardButtonTitle","getMoversSetup","blockPageMoverOptions","label","__","value","onSelect","filter","el","onPickerSelect","option","find","onLongPressMoveUp","useCallback","onLongPressMoveDown","_react","createElement","ToolbarGroup","ToolbarButton","isDisabled","onClick","onLongPress","extraProps","hint","Picker","ref","options","onChange","leftAlign","hideCancelButton","Platform","OS","_default","default","compose","withSelect","select","clientIds","getBlockIndex","canMoveBlocks","getBlockRootClientId","getBlockOrder","blockEditorStore","normalizedClientIds","Array","isArray","firstClientId","blockOrder","lastIndex","length","withDispatch","dispatch","moveBlocksDown","moveBlocksUp","moveBlocksToPosition","args","targetIndex","withInstanceId"],"sources":["@wordpress/block-editor/src/components/block-mover/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Picker, ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { getMoversSetup } from './mover-description';\nimport { store as blockEditorStore } from '../../store';\n\nexport const BLOCK_MOVER_DIRECTION_TOP = 'blockPageMoverOptions-moveToTop';\nexport const BLOCK_MOVER_DIRECTION_BOTTOM =\n\t'blockPageMoverOptions-moveToBottom';\n\nexport const BlockMover = ( {\n\tisFirst,\n\tisLast,\n\tcanMove,\n\tonMoveDown,\n\tonMoveUp,\n\tonLongMove,\n\tfirstIndex,\n\tnumberOfBlocks,\n\trootClientId,\n\tisStackedHorizontally,\n} ) => {\n\tconst pickerRef = useRef();\n\tconst [ shouldPresentPicker, setShouldPresentPicker ] = useState( false );\n\tconst [ blockPageMoverState, setBlockPageMoverState ] =\n\t\tuseState( undefined );\n\tconst showBlockPageMover = ( direction ) => () => {\n\t\tif ( ! pickerRef.current ) {\n\t\t\tsetBlockPageMoverState( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\tsetBlockPageMoverState( direction );\n\t\tsetShouldPresentPicker( true );\n\t};\n\n\t// Ensure that the picker is only presented after state updates.\n\tuseEffect( () => {\n\t\tif ( shouldPresentPicker ) {\n\t\t\tpickerRef.current?.presentPicker();\n\t\t\tsetShouldPresentPicker( false );\n\t\t}\n\t}, [ shouldPresentPicker ] );\n\n\tconst {\n\t\tdescription: {\n\t\t\tbackwardButtonHint,\n\t\t\tforwardButtonHint,\n\t\t\tfirstBlockTitle,\n\t\t\tlastBlockTitle,\n\t\t},\n\t\ticon: { backward: backwardButtonIcon, forward: forwardButtonIcon },\n\t\ttitle: { backward: backwardButtonTitle, forward: forwardButtonTitle },\n\t} = getMoversSetup( isStackedHorizontally, { firstIndex } );\n\n\tconst blockPageMoverOptions = [\n\t\t{\n\t\t\ticon: backwardButtonIcon,\n\t\t\tlabel: __( 'Move to top' ),\n\t\t\tvalue: BLOCK_MOVER_DIRECTION_TOP,\n\t\t\tonSelect: () => {\n\t\t\t\tonLongMove()( 0 );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ticon: forwardButtonIcon,\n\t\t\tlabel: __( 'Move to bottom' ),\n\t\t\tvalue: BLOCK_MOVER_DIRECTION_BOTTOM,\n\t\t\tonSelect: () => {\n\t\t\t\tonLongMove()( numberOfBlocks );\n\t\t\t},\n\t\t},\n\t].filter( ( el ) => el.value === blockPageMoverState );\n\n\tconst onPickerSelect = ( value ) => {\n\t\tconst option = blockPageMoverOptions.find(\n\t\t\t( el ) => el.value === value\n\t\t);\n\t\tif ( option && option.onSelect ) {\n\t\t\toption.onSelect();\n\t\t}\n\t};\n\n\tconst onLongPressMoveUp = useCallback(\n\t\tshowBlockPageMover( BLOCK_MOVER_DIRECTION_TOP ),\n\t\t[]\n\t);\n\tconst onLongPressMoveDown = useCallback(\n\t\tshowBlockPageMover( BLOCK_MOVER_DIRECTION_BOTTOM ),\n\t\t[]\n\t);\n\n\tif ( ! canMove || ( isFirst && isLast && ! rootClientId ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\ttitle={ ! isFirst ? backwardButtonTitle : firstBlockTitle }\n\t\t\t\tisDisabled={ isFirst }\n\t\t\t\tonClick={ onMoveUp }\n\t\t\t\tonLongPress={ onLongPressMoveUp }\n\t\t\t\ticon={ backwardButtonIcon }\n\t\t\t\textraProps={ { hint: backwardButtonHint } }\n\t\t\t/>\n\n\t\t\t<ToolbarButton\n\t\t\t\ttitle={ ! isLast ? forwardButtonTitle : lastBlockTitle }\n\t\t\t\tisDisabled={ isLast }\n\t\t\t\tonClick={ onMoveDown }\n\t\t\t\tonLongPress={ onLongPressMoveDown }\n\t\t\t\ticon={ forwardButtonIcon }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: forwardButtonHint,\n\t\t\t\t} }\n\t\t\t/>\n\n\t\t\t<Picker\n\t\t\t\tref={ pickerRef }\n\t\t\t\toptions={ blockPageMoverOptions }\n\t\t\t\tonChange={ onPickerSelect }\n\t\t\t\ttitle={ __( 'Change block position' ) }\n\t\t\t\tleftAlign\n\t\t\t\thideCancelButton={ Platform.OS !== 'ios' }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n};\n\nexport default compose(\n\twithSelect( ( select, { clientIds } ) => {\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tcanMoveBlocks,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockOrder,\n\t\t} = select( blockEditorStore );\n\t\tconst normalizedClientIds = Array.isArray( clientIds )\n\t\t\t? clientIds\n\t\t\t: [ clientIds ];\n\t\tconst firstClientId = normalizedClientIds[ 0 ];\n\t\tconst rootClientId = getBlockRootClientId( firstClientId );\n\t\tconst blockOrder = getBlockOrder( rootClientId );\n\t\tconst firstIndex = getBlockIndex( firstClientId );\n\t\tconst lastIndex = getBlockIndex(\n\t\t\tnormalizedClientIds[ normalizedClientIds.length - 1 ]\n\t\t);\n\n\t\treturn {\n\t\t\tfirstIndex,\n\t\t\tnumberOfBlocks: blockOrder.length - 1,\n\t\t\tisFirst: firstIndex === 0,\n\t\t\tisLast: lastIndex === blockOrder.length - 1,\n\t\t\tcanMove: canMoveBlocks( clientIds, rootClientId ),\n\t\t\trootClientId,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { clientIds, rootClientId } ) => {\n\t\tconst { moveBlocksDown, moveBlocksUp, moveBlocksToPosition } =\n\t\t\tdispatch( blockEditorStore );\n\t\treturn {\n\t\t\tonMoveDown: ( ...args ) =>\n\t\t\t\tmoveBlocksDown( clientIds, rootClientId, ...args ),\n\t\t\tonMoveUp: ( ...args ) =>\n\t\t\t\tmoveBlocksUp( clientIds, rootClientId, ...args ),\n\t\t\tonLongMove:\n\t\t\t\t( targetIndex ) =>\n\t\t\t\t( ...args ) =>\n\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\tclientIds,\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\ttargetIndex,\n\t\t\t\t\t\t...args\n\t\t\t\t\t),\n\t\t};\n\t} ),\n\twithInstanceId\n)( BlockMover );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAIO,MAAMQ,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GAAG,iCAAiC;AACnE,MAAME,4BAA4B,GAAAD,OAAA,CAAAC,4BAAA,GACxC,oCAAoC;AAE9B,MAAMC,UAAU,GAAGA,CAAE;EAC3BC,OAAO;EACPC,MAAM;EACNC,OAAO;EACPC,UAAU;EACVC,QAAQ;EACRC,UAAU;EACVC,UAAU;EACVC,cAAc;EACdC,YAAY;EACZC;AACD,CAAC,KAAM;EACN,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC1B,MAAM,CAAEC,mBAAmB,EAAEC,sBAAsB,CAAE,GAAG,IAAAC,iB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EAAE2E,UAAU,CAACE,MAAM,GAAG,CAAC;IACrCpF,OAAO,EAAEM,UAAU,KAAK,CAAC;IACzBL,MAAM,EAAEkF,SAAS,KAAKD,UAAU,CAACE,MAAM,GAAG,CAAC;IAC3ClF,OAAO,EAAEwE,aAAa,CAAEF,SAAS,EAAEhE,YAAa,CAAC;IACjDA;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAA6E,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAEd,SAAS;EAAEhE;AAAa,CAAC,KAAM;EAC1D,MAAM;IAAE+E,cAAc;IAAEC,YAAY;IAAEC;EAAqB,CAAC,GAC3DH,QAAQ,CAAET,YAAiB,CAAC;EAC7B,OAAO;IACN1E,UAAU,EAAEA,CAAE,GAAGuF,IAAI,KACpBH,cAAc,CAAEf,SAAS,EAAEhE,YAAY,EAAE,GAAGkF,IAAK,CAAC;IACnDtF,QAAQ,EAAEA,CAAE,GAAGsF,IAAI,KAClBF,YAAY,CAAEhB,SAAS,EAAEhE,YAAY,EAAE,GAAGkF,IAAK,CAAC;IACjDrF,UAAU,EACPsF,WAAW,IACb,CAAE,GAAGD,IAAI,KACRD,oBAAoB,CACnBjB,SAAS,EACThE,YAAY,EACZmF,WAAW,EACX,GAAGD,IACJ;EACH,CAAC;AACF,CAAE,CAAC,EACHE,uBACD,CAAC,CAAE7F,UAAW,CAAC","ignoreList":[]}
|
|
@@ -111,7 +111,6 @@ function BlockSettingsDropdown({
|
|
|
111
111
|
insertBefore: getShortcutRepresentation('core/block-editor/insert-before')
|
|
112
112
|
};
|
|
113
113
|
}, []);
|
|
114
|
-
const isMatch = (0, _keyboardShortcuts.__unstableUseShortcutEventMatch)();
|
|
115
114
|
const hasSelectedBlocks = selectedBlockClientIds.length > 0;
|
|
116
115
|
async function updateSelectionAfterDuplicate(clientIdsPromise) {
|
|
117
116
|
if (!__experimentalSelectBlock) {
|
|
@@ -181,30 +180,6 @@ function BlockSettingsDropdown({
|
|
|
181
180
|
open: open,
|
|
182
181
|
onToggle: onToggle,
|
|
183
182
|
noIcons: true,
|
|
184
|
-
menuProps: {
|
|
185
|
-
/**
|
|
186
|
-
* @param {KeyboardEvent} event
|
|
187
|
-
*/
|
|
188
|
-
onKeyDown(event) {
|
|
189
|
-
if (event.defaultPrevented) return;
|
|
190
|
-
if (isMatch('core/block-editor/remove', event) && canRemove) {
|
|
191
|
-
event.preventDefault();
|
|
192
|
-
onRemove();
|
|
193
|
-
updateSelectionAfterRemove();
|
|
194
|
-
} else if (isMatch('core/block-editor/duplicate', event) && canDuplicate) {
|
|
195
|
-
event.preventDefault();
|
|
196
|
-
updateSelectionAfterDuplicate(onDuplicate());
|
|
197
|
-
} else if (isMatch('core/block-editor/insert-after', event) && canInsertBlock) {
|
|
198
|
-
event.preventDefault();
|
|
199
|
-
setOpenedBlockSettingsMenu(undefined);
|
|
200
|
-
onInsertAfter();
|
|
201
|
-
} else if (isMatch('core/block-editor/insert-before', event) && canInsertBlock) {
|
|
202
|
-
event.preventDefault();
|
|
203
|
-
setOpenedBlockSettingsMenu(undefined);
|
|
204
|
-
onInsertBefore();
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
183
|
...props
|
|
209
184
|
}, ({
|
|
210
185
|
onClose
|