@wordpress/block-editor 8.5.7 → 9.1.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 +11 -0
- package/README.md +5 -2
- package/build/components/block-alignment-control/constants.js +48 -0
- package/build/components/block-alignment-control/constants.js.map +1 -0
- package/build/components/block-alignment-control/ui.js +9 -40
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +92 -0
- package/build/components/block-alignment-control/ui.native.js.map +1 -0
- package/build/components/block-alignment-matrix-control/index.js +1 -6
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-content-overlay/index.js +5 -74
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.native.js +64 -0
- package/build/components/block-draggable/draggable-chip.native.js.map +1 -0
- package/build/components/block-draggable/dropping-insertion-point.native.js +157 -0
- package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -0
- package/build/components/block-draggable/index.native.js +484 -0
- package/build/components/block-draggable/index.native.js.map +1 -0
- package/build/components/block-draggable/use-scroll-when-dragging.native.js +130 -0
- package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -0
- package/build/components/block-list/block-list-context.native.js +195 -0
- package/build/components/block-list/block-list-context.native.js.map +1 -0
- package/build/components/block-list/block-list-item-cell.native.js +67 -0
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -0
- package/build/components/block-list/block-list-item.native.js +12 -9
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block.native.js +29 -6
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +75 -23
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +8 -4
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +1 -7
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +34 -4
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +2 -1
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-lock/use-block-lock.js +4 -1
- package/build/components/block-lock/use-block-lock.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.native.js +9 -3
- package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build/components/block-mover/button.js +4 -4
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +39 -65
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +17 -4
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +11 -5
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-popover/inbetween.js +191 -0
- package/build/components/block-popover/inbetween.js.map +1 -0
- package/build/components/block-popover/index.js +85 -0
- package/build/components/block-popover/index.js.map +1 -0
- package/build/components/{block-tools → block-popover}/use-popover-scroll.js +4 -1
- package/build/components/block-popover/use-popover-scroll.js.map +1 -0
- package/build/components/block-preview/index.js +1 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-styles/index.js +1 -10
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -2
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +4 -2
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +5 -5
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +14 -121
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +216 -0
- package/build/components/block-tools/selected-block-popover.js.map +1 -0
- package/build/components/border-radius-control/input-controls.js +10 -3
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/color-style-selector/index.js +9 -0
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +149 -44
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/duotone-control/index.js +5 -1
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +3 -1
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/index.js +5 -23
- package/build/components/index.js.map +1 -1
- package/build/components/inserter/index.native.js +31 -9
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/link-control/constants.js +11 -1
- package/build/components/link-control/constants.js.map +1 -1
- package/build/components/link-control/search-results.js +4 -3
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +4 -4
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block.js +15 -15
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +9 -13
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/context.js +1 -4
- package/build/components/list-view/context.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +0 -1
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/index.js +15 -32
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +12 -2
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +0 -1
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/index.js +1 -6
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +0 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/url-input/index.js +11 -4
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-display-information/index.js +3 -1
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +167 -0
- package/build/components/use-block-drop-zone/index.native.js.map +1 -0
- package/build/components/use-on-block-drop/index.native.js +95 -0
- package/build/components/use-on-block-drop/index.native.js.map +1 -0
- package/build/components/use-setting/index.js +42 -18
- package/build/components/use-setting/index.js.map +1 -1
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border.js +463 -44
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color-panel.js +14 -7
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/index.js +3 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/margin.js +64 -12
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +60 -12
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/settings.js +32 -0
- package/build/hooks/settings.js.map +1 -0
- package/build/hooks/style.js +14 -13
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/typography.js +6 -2
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-border-props.js +22 -32
- package/build/hooks/use-border-props.js.map +1 -1
- package/build/store/actions.js +14 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +0 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +0 -26
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +47 -15
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-alignment-control/constants.js +36 -0
- package/build-module/components/block-alignment-control/constants.js.map +1 -0
- package/build-module/components/block-alignment-control/ui.js +4 -35
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +78 -0
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -0
- package/build-module/components/block-alignment-matrix-control/index.js +1 -6
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +4 -70
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.native.js +50 -0
- package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -0
- package/build-module/components/block-draggable/dropping-insertion-point.native.js +137 -0
- package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -0
- package/build-module/components/block-draggable/index.native.js +449 -0
- package/build-module/components/block-draggable/index.native.js.map +1 -0
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +120 -0
- package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -0
- package/build-module/components/block-list/block-list-context.native.js +179 -0
- package/build-module/components/block-list/block-list-context.native.js.map +1 -0
- package/build-module/components/block-list/block-list-item-cell.native.js +59 -0
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -0
- package/build-module/components/block-list/block-list-item.native.js +12 -9
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block.native.js +28 -6
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +72 -23
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +9 -5
- 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-class-names.js +1 -7
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +34 -5
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +2 -1
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-lock/use-block-lock.js +4 -1
- package/build-module/components/block-lock/use-block-lock.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +8 -3
- package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-mover/button.js +5 -5
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +38 -63
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +18 -5
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +10 -5
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +173 -0
- package/build-module/components/block-popover/inbetween.js.map +1 -0
- package/build-module/components/block-popover/index.js +72 -0
- package/build-module/components/block-popover/index.js.map +1 -0
- package/build-module/components/{block-tools → block-popover}/use-popover-scroll.js +3 -1
- package/build-module/components/block-popover/use-popover-scroll.js.map +1 -0
- package/build-module/components/block-preview/index.js +1 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -9
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +1 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +3 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +3 -3
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +16 -121
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +199 -0
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -0
- package/build-module/components/border-radius-control/input-controls.js +11 -4
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/color-style-selector/index.js +6 -0
- package/build-module/components/color-style-selector/index.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +151 -46
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/duotone-control/index.js +4 -1
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +2 -1
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/index.js +1 -3
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +32 -11
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/link-control/constants.js +5 -0
- package/build-module/components/link-control/constants.js.map +1 -1
- package/build-module/components/link-control/search-results.js +3 -4
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +5 -5
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block.js +15 -16
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +9 -13
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/context.js +1 -4
- package/build-module/components/list-view/context.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +0 -1
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/index.js +15 -31
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +12 -2
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +0 -1
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -5
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +0 -4
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/url-input/index.js +11 -4
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +3 -1
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +148 -0
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -0
- package/build-module/components/use-on-block-drop/index.native.js +83 -0
- package/build-module/components/use-on-block-drop/index.native.js.map +1 -0
- package/build-module/components/use-setting/index.js +43 -19
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border.js +453 -44
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color-panel.js +11 -6
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/dimensions.js +5 -5
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/index.js +2 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/margin.js +61 -13
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +57 -13
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/settings.js +29 -0
- package/build-module/hooks/settings.js.map +1 -0
- package/build-module/hooks/style.js +15 -14
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/typography.js +6 -2
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-border-props.js +21 -30
- package/build-module/hooks/use-border-props.js.map +1 -1
- package/build-module/store/actions.js +14 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +0 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +0 -24
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +44 -15
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +148 -410
- package/build-style/style.css +148 -410
- package/package.json +28 -28
- package/src/components/block-alignment-control/constants.js +45 -0
- package/src/components/block-alignment-control/ui.js +69 -109
- package/src/components/block-alignment-control/ui.native.js +86 -0
- package/src/components/block-alignment-matrix-control/index.js +1 -5
- package/src/components/block-content-overlay/index.js +9 -79
- package/src/components/block-content-overlay/style.scss +2 -11
- package/src/components/block-draggable/draggable-chip.native.js +49 -0
- package/src/components/block-draggable/dropping-insertion-point.native.js +181 -0
- package/src/components/block-draggable/dropping-insertion-point.native.scss +8 -0
- package/src/components/block-draggable/index.native.js +458 -0
- package/src/components/block-draggable/style.native.scss +19 -0
- package/src/components/block-draggable/use-scroll-when-dragging.native.js +135 -0
- package/src/components/block-list/block-list-context.native.js +175 -0
- package/src/components/block-list/block-list-item-cell.native.js +49 -0
- package/src/components/block-list/block-list-item.native.js +7 -11
- package/src/components/block-list/block.native.js +38 -8
- package/src/components/block-list/index.native.js +54 -13
- package/src/components/block-list/style.scss +7 -18
- package/src/components/block-list/test/block-list-context.native.js +253 -0
- package/src/components/block-list/test/fixtures/block-list-context.native.js +79 -0
- package/src/components/block-list/use-block-props/index.js +10 -5
- package/src/components/block-list/use-block-props/use-block-class-names.js +1 -11
- package/src/components/block-list/use-in-between-inserter.js +1 -1
- package/src/components/block-lock/modal.js +42 -3
- package/src/components/block-lock/toolbar.js +2 -2
- package/src/components/block-lock/use-block-lock.js +4 -1
- package/src/components/block-mobile-toolbar/index.native.js +8 -1
- package/src/components/block-mover/button.js +5 -7
- package/src/components/block-mover/index.js +37 -60
- package/src/components/block-mover/index.native.js +22 -6
- package/src/components/block-mover/stories/index.js +110 -0
- package/src/components/block-mover/style.scss +48 -138
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +6 -0
- package/src/components/block-navigation/dropdown.js +12 -8
- package/src/components/block-popover/README.md +41 -0
- package/src/components/block-popover/inbetween.js +188 -0
- package/src/components/block-popover/index.js +75 -0
- package/src/components/block-popover/style.scss +28 -0
- package/src/components/{block-tools → block-popover}/use-popover-scroll.js +3 -1
- package/src/components/block-preview/index.js +1 -4
- package/src/components/block-styles/index.js +1 -12
- package/src/components/block-switcher/style.scss +2 -43
- package/src/components/block-toolbar/style.scss +0 -12
- package/src/components/block-tools/back-compat.js +1 -1
- package/src/components/block-tools/block-selection-button.js +3 -1
- package/src/components/block-tools/index.js +6 -4
- package/src/components/block-tools/insertion-point.js +19 -152
- package/src/components/block-tools/{block-popover.js → selected-block-popover.js} +24 -151
- package/src/components/block-tools/style.scss +12 -135
- package/src/components/border-radius-control/input-controls.js +16 -8
- package/src/components/border-radius-control/style.scss +7 -3
- package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
- package/src/components/color-style-selector/index.js +18 -9
- package/src/components/colors-gradients/dropdown.js +156 -62
- package/src/components/colors-gradients/style.scss +51 -23
- package/src/components/default-block-appender/style.scss +1 -2
- package/src/components/duotone-control/index.js +8 -1
- package/src/components/duotone-control/style.scss +1 -7
- package/src/components/gradients/README.md +29 -0
- package/src/components/image-editor/use-save-image.js +2 -1
- package/src/components/image-size-control/README.md +1 -1
- package/src/components/index.js +1 -3
- package/src/components/inserter/index.native.js +60 -25
- package/src/components/inserter/style.native.scss +25 -3
- package/src/components/inserter/style.scss +2 -1
- package/src/components/link-control/constants.js +11 -0
- package/src/components/link-control/search-results.js +4 -5
- package/src/components/link-control/use-search-handler.js +11 -5
- package/src/components/list-view/block.js +24 -34
- package/src/components/list-view/branch.js +10 -20
- package/src/components/list-view/context.js +1 -4
- package/src/components/list-view/drop-indicator.js +0 -1
- package/src/components/list-view/index.js +11 -41
- package/src/components/list-view/style.scss +2 -1
- package/src/components/navigable-toolbar/README.md +16 -0
- package/src/components/navigable-toolbar/index.js +12 -2
- package/src/components/preview-options/style.scss +0 -4
- package/src/components/rich-text/format-toolbar-container.js +0 -1
- package/src/components/rich-text/index.js +1 -3
- package/src/components/rich-text/index.native.js +0 -4
- package/src/components/rich-text/style.scss +2 -8
- package/src/components/url-input/index.js +9 -4
- package/src/components/use-block-display-information/index.js +2 -0
- package/src/components/use-block-drop-zone/index.native.js +173 -0
- package/src/components/use-on-block-drop/index.native.js +119 -0
- package/src/components/use-setting/index.js +57 -21
- package/src/hooks/anchor.js +1 -1
- package/src/hooks/border.js +429 -72
- package/src/hooks/color-panel.js +13 -9
- package/src/hooks/color.scss +0 -62
- package/src/hooks/dimensions.js +44 -38
- package/src/hooks/index.js +2 -1
- package/src/hooks/margin.js +64 -15
- package/src/hooks/padding.js +60 -15
- package/src/hooks/padding.scss +12 -0
- package/src/hooks/settings.js +32 -0
- package/src/hooks/style.js +25 -39
- package/src/hooks/test/settings.js +48 -0
- package/src/hooks/typography.js +2 -0
- package/src/hooks/use-border-props.js +15 -32
- package/src/store/actions.js +14 -2
- package/src/store/defaults.js +0 -1
- package/src/store/reducer.js +0 -21
- package/src/store/selectors.js +46 -15
- package/src/store/test/actions.js +0 -18
- package/src/store/test/reducer.js +0 -19
- package/src/store/test/selectors.js +17 -19
- package/src/style.scss +2 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-mobile-toolbar/index.js +0 -42
- package/build/components/block-mobile-toolbar/index.js.map +0 -1
- package/build/components/block-tools/block-popover.js +0 -327
- package/build/components/block-tools/block-popover.js.map +0 -1
- package/build/components/block-tools/use-popover-scroll.js.map +0 -1
- package/build/components/border-style-control/index.js +0 -60
- package/build/components/border-style-control/index.js.map +0 -1
- package/build/components/colors-gradients/tools-panel-color-dropdown.js +0 -89
- package/build/components/colors-gradients/tools-panel-color-dropdown.js.map +0 -1
- package/build/components/list-view/appender.js +0 -93
- package/build/components/list-view/appender.js.map +0 -1
- package/build/components/list-view/list-item.js +0 -62
- package/build/components/list-view/list-item.js.map +0 -1
- package/build/components/rich-text/use-caret-in-format.js +0 -43
- package/build/components/rich-text/use-caret-in-format.js.map +0 -1
- package/build/hooks/border-color.js +0 -302
- package/build/hooks/border-color.js.map +0 -1
- package/build/hooks/border-style.js +0 -96
- package/build/hooks/border-style.js.map +0 -1
- package/build/hooks/border-width.js +0 -162
- package/build/hooks/border-width.js.map +0 -1
- package/build-module/components/block-mobile-toolbar/index.js +0 -31
- package/build-module/components/block-mobile-toolbar/index.js.map +0 -1
- package/build-module/components/block-tools/block-popover.js +0 -306
- package/build-module/components/block-tools/block-popover.js.map +0 -1
- package/build-module/components/block-tools/use-popover-scroll.js.map +0 -1
- package/build-module/components/border-style-control/index.js +0 -50
- package/build-module/components/border-style-control/index.js.map +0 -1
- package/build-module/components/colors-gradients/tools-panel-color-dropdown.js +0 -75
- package/build-module/components/colors-gradients/tools-panel-color-dropdown.js.map +0 -1
- package/build-module/components/list-view/appender.js +0 -76
- package/build-module/components/list-view/appender.js.map +0 -1
- package/build-module/components/list-view/list-item.js +0 -47
- package/build-module/components/list-view/list-item.js.map +0 -1
- package/build-module/components/rich-text/use-caret-in-format.js +0 -33
- package/build-module/components/rich-text/use-caret-in-format.js.map +0 -1
- package/build-module/hooks/border-color.js +0 -276
- package/build-module/hooks/border-color.js.map +0 -1
- package/build-module/hooks/border-style.js +0 -78
- package/build-module/hooks/border-style.js.map +0 -1
- package/build-module/hooks/border-width.js +0 -143
- package/build-module/hooks/border-width.js.map +0 -1
- package/src/components/block-alignment-matrix-control/style.scss +0 -10
- package/src/components/block-mobile-toolbar/index.js +0 -24
- package/src/components/block-mobile-toolbar/style.scss +0 -29
- package/src/components/border-style-control/index.js +0 -47
- package/src/components/border-style-control/style.scss +0 -18
- package/src/components/colors-gradients/tools-panel-color-dropdown.js +0 -85
- package/src/components/list-view/appender.js +0 -82
- package/src/components/list-view/list-item.js +0 -59
- package/src/components/rich-text/use-caret-in-format.js +0 -28
- package/src/hooks/border-color.js +0 -315
- package/src/hooks/border-style.js +0 -64
- package/src/hooks/border-width.js +0 -139
|
@@ -10,9 +10,7 @@ import classnames from 'classnames';
|
|
|
10
10
|
|
|
11
11
|
import { dragHandle } from '@wordpress/icons';
|
|
12
12
|
import { ToolbarGroup, ToolbarItem, Button } from '@wordpress/components';
|
|
13
|
-
import {
|
|
14
|
-
import { useState } from '@wordpress/element';
|
|
15
|
-
import { withSelect } from '@wordpress/data';
|
|
13
|
+
import { useSelect } from '@wordpress/data';
|
|
16
14
|
import { __ } from '@wordpress/i18n';
|
|
17
15
|
|
|
18
16
|
/**
|
|
@@ -22,20 +20,35 @@ import BlockDraggable from '../block-draggable';
|
|
|
22
20
|
import { BlockMoverUpButton, BlockMoverDownButton } from './button';
|
|
23
21
|
import { store as blockEditorStore } from '../../store';
|
|
24
22
|
|
|
25
|
-
function BlockMover( {
|
|
26
|
-
isFirst,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} )
|
|
35
|
-
|
|
23
|
+
function BlockMover( { clientIds, hideDragHandle } ) {
|
|
24
|
+
const { canMove, rootClientId, isFirst, isLast, orientation } = useSelect(
|
|
25
|
+
( select ) => {
|
|
26
|
+
const {
|
|
27
|
+
getBlockIndex,
|
|
28
|
+
getBlockListSettings,
|
|
29
|
+
canMoveBlocks,
|
|
30
|
+
getBlockOrder,
|
|
31
|
+
getBlockRootClientId,
|
|
32
|
+
} = select( blockEditorStore );
|
|
33
|
+
const normalizedClientIds = castArray( clientIds );
|
|
34
|
+
const firstClientId = first( normalizedClientIds );
|
|
35
|
+
const _rootClientId = getBlockRootClientId(
|
|
36
|
+
first( normalizedClientIds )
|
|
37
|
+
);
|
|
38
|
+
const firstIndex = getBlockIndex( firstClientId );
|
|
39
|
+
const lastIndex = getBlockIndex( last( normalizedClientIds ) );
|
|
40
|
+
const blockOrder = getBlockOrder( _rootClientId );
|
|
36
41
|
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
return {
|
|
43
|
+
canMove: canMoveBlocks( clientIds, _rootClientId ),
|
|
44
|
+
rootClientId: _rootClientId,
|
|
45
|
+
isFirst: firstIndex === 0,
|
|
46
|
+
isLast: lastIndex === blockOrder.length - 1,
|
|
47
|
+
orientation: getBlockListSettings( _rootClientId )?.orientation,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
[ clientIds ]
|
|
51
|
+
);
|
|
39
52
|
|
|
40
53
|
if ( ! canMove || ( isFirst && isLast && ! rootClientId ) ) {
|
|
41
54
|
return null;
|
|
@@ -43,22 +56,14 @@ function BlockMover( {
|
|
|
43
56
|
|
|
44
57
|
const dragHandleLabel = __( 'Drag' );
|
|
45
58
|
|
|
46
|
-
// We emulate a disabled state because forcefully applying the `disabled`
|
|
47
|
-
// attribute on the buttons while it has focus causes the screen to change
|
|
48
|
-
// to an unfocused state (body as active element) without firing blur on,
|
|
49
|
-
// the rendering parent, leaving it unable to react to focus out.
|
|
50
59
|
return (
|
|
51
|
-
<
|
|
60
|
+
<ToolbarGroup
|
|
52
61
|
className={ classnames( 'block-editor-block-mover', {
|
|
53
|
-
'is-visible': isFocused || ! isHidden,
|
|
54
62
|
'is-horizontal': orientation === 'horizontal',
|
|
55
63
|
} ) }
|
|
56
64
|
>
|
|
57
65
|
{ ! hideDragHandle && (
|
|
58
|
-
<BlockDraggable
|
|
59
|
-
clientIds={ clientIds }
|
|
60
|
-
cloneClassname="block-editor-block-mover__drag-clone"
|
|
61
|
-
>
|
|
66
|
+
<BlockDraggable clientIds={ clientIds }>
|
|
62
67
|
{ ( draggableProps ) => (
|
|
63
68
|
<Button
|
|
64
69
|
icon={ dragHandle }
|
|
@@ -73,8 +78,8 @@ function BlockMover( {
|
|
|
73
78
|
) }
|
|
74
79
|
</BlockDraggable>
|
|
75
80
|
) }
|
|
76
|
-
<
|
|
77
|
-
<ToolbarItem
|
|
81
|
+
<div className="block-editor-block-mover__move-button-container">
|
|
82
|
+
<ToolbarItem>
|
|
78
83
|
{ ( itemProps ) => (
|
|
79
84
|
<BlockMoverUpButton
|
|
80
85
|
clientIds={ clientIds }
|
|
@@ -82,7 +87,7 @@ function BlockMover( {
|
|
|
82
87
|
/>
|
|
83
88
|
) }
|
|
84
89
|
</ToolbarItem>
|
|
85
|
-
<ToolbarItem
|
|
90
|
+
<ToolbarItem>
|
|
86
91
|
{ ( itemProps ) => (
|
|
87
92
|
<BlockMoverDownButton
|
|
88
93
|
clientIds={ clientIds }
|
|
@@ -90,40 +95,12 @@ function BlockMover( {
|
|
|
90
95
|
/>
|
|
91
96
|
) }
|
|
92
97
|
</ToolbarItem>
|
|
93
|
-
</
|
|
94
|
-
</
|
|
98
|
+
</div>
|
|
99
|
+
</ToolbarGroup>
|
|
95
100
|
);
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
/**
|
|
99
104
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-mover/README.md
|
|
100
105
|
*/
|
|
101
|
-
export default
|
|
102
|
-
const {
|
|
103
|
-
getBlock,
|
|
104
|
-
getBlockIndex,
|
|
105
|
-
getBlockListSettings,
|
|
106
|
-
canMoveBlocks,
|
|
107
|
-
getBlockOrder,
|
|
108
|
-
getBlockRootClientId,
|
|
109
|
-
} = select( blockEditorStore );
|
|
110
|
-
const normalizedClientIds = castArray( clientIds );
|
|
111
|
-
const firstClientId = first( normalizedClientIds );
|
|
112
|
-
const block = getBlock( firstClientId );
|
|
113
|
-
const rootClientId = getBlockRootClientId( first( normalizedClientIds ) );
|
|
114
|
-
const firstIndex = getBlockIndex( firstClientId );
|
|
115
|
-
const lastIndex = getBlockIndex( last( normalizedClientIds ) );
|
|
116
|
-
const blockOrder = getBlockOrder( rootClientId );
|
|
117
|
-
const isFirst = firstIndex === 0;
|
|
118
|
-
const isLast = lastIndex === blockOrder.length - 1;
|
|
119
|
-
|
|
120
|
-
return {
|
|
121
|
-
blockType: block ? getBlockType( block.name ) : null,
|
|
122
|
-
canMove: canMoveBlocks( clientIds, rootClientId ),
|
|
123
|
-
rootClientId,
|
|
124
|
-
firstIndex,
|
|
125
|
-
isFirst,
|
|
126
|
-
isLast,
|
|
127
|
-
orientation: getBlockListSettings( rootClientId )?.orientation,
|
|
128
|
-
};
|
|
129
|
-
} )( BlockMover );
|
|
106
|
+
export default BlockMover;
|
|
@@ -11,7 +11,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
11
11
|
import { Picker, ToolbarButton } from '@wordpress/components';
|
|
12
12
|
import { withInstanceId, compose } from '@wordpress/compose';
|
|
13
13
|
import { withSelect, withDispatch } from '@wordpress/data';
|
|
14
|
-
import { useRef, useState } from '@wordpress/element';
|
|
14
|
+
import { useCallback, useEffect, useRef, useState } from '@wordpress/element';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Internal dependencies
|
|
@@ -36,6 +36,7 @@ export const BlockMover = ( {
|
|
|
36
36
|
isStackedHorizontally,
|
|
37
37
|
} ) => {
|
|
38
38
|
const pickerRef = useRef();
|
|
39
|
+
const [ shouldPresentPicker, setShouldPresentPicker ] = useState( false );
|
|
39
40
|
const [ blockPageMoverState, setBlockPageMoverState ] = useState(
|
|
40
41
|
undefined
|
|
41
42
|
);
|
|
@@ -46,9 +47,17 @@ export const BlockMover = ( {
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
setBlockPageMoverState( direction );
|
|
49
|
-
|
|
50
|
+
setShouldPresentPicker( true );
|
|
50
51
|
};
|
|
51
52
|
|
|
53
|
+
// Ensure that the picker is only presented after state updates.
|
|
54
|
+
useEffect( () => {
|
|
55
|
+
if ( shouldPresentPicker ) {
|
|
56
|
+
pickerRef.current?.presentPicker();
|
|
57
|
+
setShouldPresentPicker( false );
|
|
58
|
+
}
|
|
59
|
+
}, [ shouldPresentPicker ] );
|
|
60
|
+
|
|
52
61
|
const {
|
|
53
62
|
description: {
|
|
54
63
|
backwardButtonHint,
|
|
@@ -86,6 +95,15 @@ export const BlockMover = ( {
|
|
|
86
95
|
if ( option && option.onSelect ) option.onSelect();
|
|
87
96
|
};
|
|
88
97
|
|
|
98
|
+
const onLongPressMoveUp = useCallback(
|
|
99
|
+
showBlockPageMover( BLOCK_MOVER_DIRECTION_TOP ),
|
|
100
|
+
[]
|
|
101
|
+
);
|
|
102
|
+
const onLongPressMoveDown = useCallback(
|
|
103
|
+
showBlockPageMover( BLOCK_MOVER_DIRECTION_BOTTOM ),
|
|
104
|
+
[]
|
|
105
|
+
);
|
|
106
|
+
|
|
89
107
|
if ( ! canMove || ( isFirst && isLast && ! rootClientId ) ) {
|
|
90
108
|
return null;
|
|
91
109
|
}
|
|
@@ -96,7 +114,7 @@ export const BlockMover = ( {
|
|
|
96
114
|
title={ ! isFirst ? backwardButtonTitle : firstBlockTitle }
|
|
97
115
|
isDisabled={ isFirst }
|
|
98
116
|
onClick={ onMoveUp }
|
|
99
|
-
onLongPress={
|
|
117
|
+
onLongPress={ onLongPressMoveUp }
|
|
100
118
|
icon={ backwardButtonIcon }
|
|
101
119
|
extraProps={ { hint: backwardButtonHint } }
|
|
102
120
|
/>
|
|
@@ -105,9 +123,7 @@ export const BlockMover = ( {
|
|
|
105
123
|
title={ ! isLast ? forwardButtonTitle : lastBlockTitle }
|
|
106
124
|
isDisabled={ isLast }
|
|
107
125
|
onClick={ onMoveDown }
|
|
108
|
-
onLongPress={
|
|
109
|
-
BLOCK_MOVER_DIRECTION_BOTTOM
|
|
110
|
-
) }
|
|
126
|
+
onLongPress={ onLongPressMoveDown }
|
|
111
127
|
icon={ forwardButtonIcon }
|
|
112
128
|
extraProps={ {
|
|
113
129
|
hint: forwardButtonHint,
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useEffect } from '@wordpress/element';
|
|
5
|
+
import { createBlock } from '@wordpress/blocks';
|
|
6
|
+
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
7
|
+
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
import { Toolbar } from '@wordpress/components';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import BlockMover from '../';
|
|
14
|
+
import BlockEditorProvider from '../../provider';
|
|
15
|
+
import { store as blockEditorStore } from '../../../store';
|
|
16
|
+
|
|
17
|
+
registerCoreBlocks();
|
|
18
|
+
const blocks = [
|
|
19
|
+
// vertical
|
|
20
|
+
createBlock( 'core/group', { layout: { type: 'flex' } }, [
|
|
21
|
+
createBlock( 'core/paragraph' ),
|
|
22
|
+
createBlock( 'core/paragraph' ),
|
|
23
|
+
createBlock( 'core/paragraph' ),
|
|
24
|
+
] ),
|
|
25
|
+
// horizontal
|
|
26
|
+
createBlock( 'core/buttons', {}, [
|
|
27
|
+
createBlock( 'core/button' ),
|
|
28
|
+
createBlock( 'core/button' ),
|
|
29
|
+
createBlock( 'core/button' ),
|
|
30
|
+
] ),
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
function Provider( { children } ) {
|
|
34
|
+
const wrapperStyle = { margin: '24px', position: 'relative' };
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div style={ wrapperStyle }>
|
|
38
|
+
<BlockEditorProvider value={ blocks }>
|
|
39
|
+
{ children }
|
|
40
|
+
</BlockEditorProvider>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function BlockMoverStory() {
|
|
46
|
+
const { updateBlockListSettings } = useDispatch( blockEditorStore );
|
|
47
|
+
|
|
48
|
+
useEffect( () => {
|
|
49
|
+
/**
|
|
50
|
+
* This shouldn't be needed but unfortunatley
|
|
51
|
+
* the layout orientation is not declarative, we need
|
|
52
|
+
* to render the blocks to update the block settings in the state.
|
|
53
|
+
*/
|
|
54
|
+
updateBlockListSettings( blocks[ 1 ].clientId, {
|
|
55
|
+
orientation: 'horizontal',
|
|
56
|
+
} );
|
|
57
|
+
}, [] );
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div>
|
|
61
|
+
<p>The mover by default is vertical</p>
|
|
62
|
+
<Toolbar label="Block Mover">
|
|
63
|
+
<BlockMover
|
|
64
|
+
clientIds={
|
|
65
|
+
blocks.length
|
|
66
|
+
? [ blocks[ 0 ].innerBlocks[ 1 ].clientId ]
|
|
67
|
+
: []
|
|
68
|
+
}
|
|
69
|
+
/>
|
|
70
|
+
</Toolbar>
|
|
71
|
+
|
|
72
|
+
<p style={ { marginTop: 36 } }>
|
|
73
|
+
But it can also accomodate horizontal blocks.
|
|
74
|
+
</p>
|
|
75
|
+
<Toolbar label="Block Mover">
|
|
76
|
+
<BlockMover
|
|
77
|
+
clientIds={
|
|
78
|
+
blocks.length
|
|
79
|
+
? [ blocks[ 1 ].innerBlocks[ 1 ].clientId ]
|
|
80
|
+
: []
|
|
81
|
+
}
|
|
82
|
+
/>
|
|
83
|
+
</Toolbar>
|
|
84
|
+
|
|
85
|
+
<p style={ { marginTop: 36 } }>We can also hide the drag handle.</p>
|
|
86
|
+
<Toolbar label="Block Mover">
|
|
87
|
+
<BlockMover
|
|
88
|
+
clientIds={
|
|
89
|
+
blocks.length
|
|
90
|
+
? [ blocks[ 1 ].innerBlocks[ 0 ].clientId ]
|
|
91
|
+
: []
|
|
92
|
+
}
|
|
93
|
+
hideDragHandle
|
|
94
|
+
/>
|
|
95
|
+
</Toolbar>
|
|
96
|
+
</div>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default {
|
|
101
|
+
title: 'BlockEditor/BlockMover',
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const _default = () => {
|
|
105
|
+
return (
|
|
106
|
+
<Provider>
|
|
107
|
+
<BlockMoverStory />
|
|
108
|
+
</Provider>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
@@ -1,159 +1,69 @@
|
|
|
1
|
-
.block-editor-block-
|
|
2
|
-
display:
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.block-editor-block-mover-button.has-icon {
|
|
1
|
+
.block-editor-block-mover__move-button-container {
|
|
2
|
+
display: flex;
|
|
6
3
|
padding: 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Show the mover in a single button under the contextual toolbar.
|
|
10
|
-
.block-editor-block-mover {
|
|
11
|
-
display: inline-flex;
|
|
12
|
-
flex-direction: row;
|
|
13
|
-
|
|
14
|
-
.block-editor-block-mover__move-button-container,
|
|
15
|
-
.components-toolbar {
|
|
16
|
-
flex: 1;
|
|
4
|
+
border: none;
|
|
17
5
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
border-right: none !important;
|
|
21
|
-
|
|
22
|
-
@include break-small() {
|
|
6
|
+
@include break-small() {
|
|
7
|
+
.block-editor-block-mover:not(.is-horizontal) & {
|
|
23
8
|
flex-direction: column;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.block-editor-block-mover-button {
|
|
37
|
-
&.block-editor-block-mover-button {
|
|
38
|
-
padding-right: 0;
|
|
39
|
-
padding-left: 0;
|
|
40
|
-
min-width: $button-size;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@include break-small() {
|
|
44
|
-
// The !important modifier should be removed when https://github.com/WordPress/gutenberg/issues/24898 refactors the spacing grid.
|
|
45
|
-
height: $block-toolbar-height*0.5;
|
|
46
|
-
width: $block-toolbar-height - $grid-unit-15 * 0.5;
|
|
47
|
-
padding-right: $grid-unit-15 - $border-width !important;
|
|
48
|
-
padding-left: $grid-unit-15 * 0.5 !important;
|
|
49
|
-
|
|
50
|
-
// Extra specificity to override standard toolbar button styles.
|
|
51
|
-
&.block-editor-block-mover-button {
|
|
52
|
-
min-width: $block-toolbar-height - $grid-unit-15 * 0.5;
|
|
9
|
+
width: $block-toolbar-height - $grid-unit-15;
|
|
10
|
+
|
|
11
|
+
> * {
|
|
12
|
+
height: $block-toolbar-height * 0.5;
|
|
13
|
+
width: 100%;
|
|
14
|
+
min-width: 0 !important; // overrides default button width.
|
|
15
|
+
|
|
16
|
+
// Focus style.
|
|
17
|
+
&::before {
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
53
21
|
}
|
|
54
|
-
}
|
|
55
22
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@include break-small() {
|
|
60
|
-
left: $grid-unit-10 !important;
|
|
61
|
-
right: $grid-unit-10 !important;
|
|
23
|
+
.block-editor-block-mover-button.is-up-button svg {
|
|
24
|
+
top: 5px;
|
|
25
|
+
flex-shrink: 0;
|
|
62
26
|
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
27
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// The !important modifier should be removed when https://github.com/WordPress/gutenberg/issues/24898 refactors the spacing grid.
|
|
71
|
-
min-width: $button-size-small !important;
|
|
72
|
-
padding: 0 !important;
|
|
73
|
-
|
|
74
|
-
&:focus::before {
|
|
75
|
-
left: 0 !important;
|
|
76
|
-
right: 0 !important;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Position the icons correctly.
|
|
81
|
-
@include break-small() {
|
|
82
|
-
.components-toolbar-group .block-editor-block-mover-button,
|
|
83
|
-
.components-toolbar .block-editor-block-mover-button {
|
|
84
|
-
margin: 0 auto 0 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Up button.
|
|
88
|
-
.components-toolbar-group .block-editor-block-mover-button.is-up-button,
|
|
89
|
-
.components-toolbar .block-editor-block-mover-button.is-up-button {
|
|
90
|
-
// Focus style.
|
|
91
|
-
&::before {
|
|
92
|
-
bottom: 0;
|
|
93
|
-
height: calc(100% - #{ $border-width });
|
|
28
|
+
.block-editor-block-mover-button.is-down-button svg {
|
|
29
|
+
bottom: 5px;
|
|
30
|
+
flex-shrink: 0;
|
|
94
31
|
}
|
|
95
32
|
}
|
|
96
33
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
.components-toolbar .block-editor-block-mover-button.is-down-button {
|
|
100
|
-
// Focus style.
|
|
101
|
-
&::before {
|
|
102
|
-
top: 0;
|
|
103
|
-
height: calc(100% - #{ $border-width });
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
34
|
+
.block-editor-block-mover.is-horizontal & {
|
|
35
|
+
width: $block-toolbar-height;
|
|
107
36
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
padding-left: 0;
|
|
115
|
-
padding-right: 0;
|
|
37
|
+
> * {
|
|
38
|
+
width: $block-toolbar-height * 0.5;
|
|
39
|
+
min-width: 0 !important; // overrides default button width.
|
|
40
|
+
padding-left: 0 !important;
|
|
41
|
+
padding-right: 0 !important;
|
|
42
|
+
overflow: hidden;
|
|
116
43
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
min-width: 0;
|
|
122
|
-
width: auto;
|
|
123
|
-
height: auto;
|
|
44
|
+
// Focus style.
|
|
45
|
+
&::before {
|
|
46
|
+
height: 100%;
|
|
47
|
+
}
|
|
124
48
|
}
|
|
125
|
-
}
|
|
126
49
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
svg {
|
|
130
|
-
margin-left: 0;
|
|
131
|
-
margin-right: -$grid-unit-10;
|
|
132
|
-
margin-bottom: 0;
|
|
50
|
+
.block-editor-block-mover-button.is-up-button svg {
|
|
51
|
+
left: 5px;
|
|
133
52
|
}
|
|
134
53
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
&::before {
|
|
138
|
-
left: 0 !important;
|
|
139
|
-
right: 0 !important;
|
|
54
|
+
.block-editor-block-mover-button.is-down-button svg {
|
|
55
|
+
right: 5px;
|
|
140
56
|
}
|
|
141
57
|
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
142
60
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
// Focus style.
|
|
151
|
-
// Overrides .components-toolbar-group styles
|
|
152
|
-
&::before {
|
|
153
|
-
left: 0 !important;
|
|
154
|
-
right: 0 !important;
|
|
155
|
-
width: calc(100% + #{ $border-width });
|
|
156
|
-
}
|
|
157
|
-
}
|
|
61
|
+
.block-editor-block-mover__drag-handle {
|
|
62
|
+
@include break-small() {
|
|
63
|
+
width: $block-toolbar-height * 0.5;
|
|
64
|
+
min-width: 0 !important; // overrides default button width.
|
|
65
|
+
padding-left: 0 !important;
|
|
66
|
+
padding-right: 0 !important;
|
|
67
|
+
overflow: hidden;
|
|
158
68
|
}
|
|
159
69
|
}
|
|
@@ -34,6 +34,9 @@ Array [
|
|
|
34
34
|
}
|
|
35
35
|
>
|
|
36
36
|
<View
|
|
37
|
+
collapsable={false}
|
|
38
|
+
onGestureHandlerEvent={[Function]}
|
|
39
|
+
onGestureHandlerStateChange={[Function]}
|
|
37
40
|
style={
|
|
38
41
|
Object {
|
|
39
42
|
"alignItems": "center",
|
|
@@ -89,6 +92,9 @@ Array [
|
|
|
89
92
|
}
|
|
90
93
|
>
|
|
91
94
|
<View
|
|
95
|
+
collapsable={false}
|
|
96
|
+
onGestureHandlerEvent={[Function]}
|
|
97
|
+
onGestureHandlerStateChange={[Function]}
|
|
92
98
|
style={
|
|
93
99
|
Object {
|
|
94
100
|
"alignItems": "center",
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import deprecated from '@wordpress/deprecated';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -36,10 +41,12 @@ function BlockNavigationDropdownToggle( {
|
|
|
36
41
|
);
|
|
37
42
|
}
|
|
38
43
|
|
|
39
|
-
function BlockNavigationDropdown(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
function BlockNavigationDropdown( { isDisabled, ...props }, ref ) {
|
|
45
|
+
deprecated( 'wp.blockEditor.BlockNavigationDropdown', {
|
|
46
|
+
since: '6.1',
|
|
47
|
+
alternative: 'wp.components.Dropdown and wp.blockEditor.ListView',
|
|
48
|
+
} );
|
|
49
|
+
|
|
43
50
|
const hasBlocks = useSelect(
|
|
44
51
|
( select ) => !! select( blockEditorStore ).getBlockCount(),
|
|
45
52
|
[]
|
|
@@ -65,10 +72,7 @@ function BlockNavigationDropdown(
|
|
|
65
72
|
{ __( 'List view' ) }
|
|
66
73
|
</p>
|
|
67
74
|
|
|
68
|
-
<ListView
|
|
69
|
-
showNestedBlocks
|
|
70
|
-
__experimentalFeatures={ __experimentalFeatures }
|
|
71
|
-
/>
|
|
75
|
+
<ListView />
|
|
72
76
|
</div>
|
|
73
77
|
) }
|
|
74
78
|
/>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# BlockPopover and BlockPopoverInbetween
|
|
2
|
+
|
|
3
|
+
These two components allow rendering editor UI by the block (in a popover) but outside the canvas. This is important to avoid messing with the style and layout of the block list.
|
|
4
|
+
|
|
5
|
+
For example, it's used to render the contextual block toolbar and the in-between block inserter.
|
|
6
|
+
|
|
7
|
+
## BlockPopover
|
|
8
|
+
|
|
9
|
+
### Props
|
|
10
|
+
|
|
11
|
+
#### clientId
|
|
12
|
+
|
|
13
|
+
The client ID of the block representing the top position of the popover.
|
|
14
|
+
|
|
15
|
+
- Type: `String`
|
|
16
|
+
- Required: Yes
|
|
17
|
+
|
|
18
|
+
#### bottomClientId
|
|
19
|
+
|
|
20
|
+
The client ID of the block representing the bottom position of the popover.
|
|
21
|
+
|
|
22
|
+
- Type: `String`
|
|
23
|
+
- Required: No
|
|
24
|
+
|
|
25
|
+
## BlockPopoverInbetween
|
|
26
|
+
|
|
27
|
+
### Props
|
|
28
|
+
|
|
29
|
+
#### previousClientId
|
|
30
|
+
|
|
31
|
+
The client ID of the block before the popover.
|
|
32
|
+
|
|
33
|
+
- Type: `String`
|
|
34
|
+
- Required: Yes
|
|
35
|
+
|
|
36
|
+
#### nextClientId
|
|
37
|
+
|
|
38
|
+
The client ID of the block after the popover.
|
|
39
|
+
|
|
40
|
+
- Type: `String`
|
|
41
|
+
- Required: Yes
|