@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
|
@@ -9,7 +9,7 @@ $popover-padding: $grid-unit-20;
|
|
|
9
9
|
$swatch-columns: math.floor(math.div($popover-width + $swatch-gap - 2 * $popover-padding, $swatch-size + $swatch-gap));
|
|
10
10
|
|
|
11
11
|
.block-editor-duotone-control__popover {
|
|
12
|
-
> .components-popover__content
|
|
12
|
+
> .components-popover__content {
|
|
13
13
|
padding: $popover-padding;
|
|
14
14
|
width: $popover-width;
|
|
15
15
|
}
|
|
@@ -34,9 +34,3 @@ $swatch-columns: math.floor(math.div($popover-width + $swatch-gap - 2 * $popover
|
|
|
34
34
|
margin: $grid-unit-20 0;
|
|
35
35
|
font-size: $helptext-font-size;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
// Better align the popover under the swatch.
|
|
39
|
-
// @todo: when the positioning for popovers gets refactored, this can presumably be removed.
|
|
40
|
-
.block-editor-duotone-control__popover:not([data-y-axis="middle"][data-x-axis="right"]) > .components-popover__content {
|
|
41
|
-
margin-left: -14px;
|
|
42
|
-
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Gradients
|
|
2
|
+
|
|
3
|
+
The `Gradients` component exposes tools for working with gradients
|
|
4
|
+
|
|
5
|
+
<a name="getGradientSlugByValue" href="#getGradientSlugByValue">#</a> **getGradientSlugByValue**
|
|
6
|
+
|
|
7
|
+
Retrieves the gradient slug per slug.
|
|
8
|
+
|
|
9
|
+
_Parameters_
|
|
10
|
+
|
|
11
|
+
- _gradients_ `Array`: Gradient Palette
|
|
12
|
+
- _value_ `string`: Gradient value
|
|
13
|
+
|
|
14
|
+
_Returns_
|
|
15
|
+
|
|
16
|
+
- `string`: Gradient slug.
|
|
17
|
+
|
|
18
|
+
<a name="getGradientValueBySlug" href="#getGradientValueBySlug">#</a> **getGradientValueBySlug**
|
|
19
|
+
|
|
20
|
+
Retrieves the gradient value per slug.
|
|
21
|
+
|
|
22
|
+
_Parameters_
|
|
23
|
+
|
|
24
|
+
- _gradients_ `Array`: Gradient Palette
|
|
25
|
+
- _slug_ `string`: Gradient slug
|
|
26
|
+
|
|
27
|
+
_Returns_
|
|
28
|
+
|
|
29
|
+
- `string`: Gradient value.
|
|
@@ -6,6 +6,7 @@ import { useDispatch } from '@wordpress/data';
|
|
|
6
6
|
import { useCallback, useMemo, useState } from '@wordpress/element';
|
|
7
7
|
import { __, sprintf } from '@wordpress/i18n';
|
|
8
8
|
import { store as noticesStore } from '@wordpress/notices';
|
|
9
|
+
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
|
|
9
10
|
|
|
10
11
|
export default function useSaveImage( {
|
|
11
12
|
crop,
|
|
@@ -60,7 +61,7 @@ export default function useSaveImage( {
|
|
|
60
61
|
sprintf(
|
|
61
62
|
/* translators: 1. Error message */
|
|
62
63
|
__( 'Could not edit image. %s' ),
|
|
63
|
-
error.message
|
|
64
|
+
stripHTML( error.message )
|
|
64
65
|
),
|
|
65
66
|
{
|
|
66
67
|
id: 'image-editing-error',
|
package/src/components/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export {
|
|
|
14
14
|
export { default as __experimentalBlockFullHeightAligmentControl } from './block-full-height-alignment-control';
|
|
15
15
|
export { default as __experimentalBlockAlignmentMatrixControl } from './block-alignment-matrix-control';
|
|
16
16
|
export { default as BlockBreadcrumb } from './block-breadcrumb';
|
|
17
|
-
export { default as
|
|
17
|
+
export { default as __experimentalUseBlockOverlayActive } from './block-content-overlay';
|
|
18
18
|
export { BlockContextProvider } from './block-context';
|
|
19
19
|
export {
|
|
20
20
|
default as BlockControls,
|
|
@@ -33,7 +33,6 @@ export {
|
|
|
33
33
|
BlockVerticalAlignmentControl,
|
|
34
34
|
} from './block-vertical-alignment-control';
|
|
35
35
|
export { default as __experimentalBorderRadiusControl } from './border-radius-control';
|
|
36
|
-
export { default as __experimentalBorderStyleControl } from './border-style-control';
|
|
37
36
|
export {
|
|
38
37
|
// This is a typo, but kept here for back-compat.
|
|
39
38
|
ButtonBlockerAppender,
|
|
@@ -52,7 +51,6 @@ export { default as __experimentalTextTransformControl } from './text-transform-
|
|
|
52
51
|
export { default as __experimentalColorGradientControl } from './colors-gradients/control';
|
|
53
52
|
export { default as __experimentalColorGradientSettingsDropdown } from './colors-gradients/dropdown';
|
|
54
53
|
export { default as __experimentalPanelColorGradientSettings } from './colors-gradients/panel-color-gradient-settings';
|
|
55
|
-
export { default as __experimentalToolsPanelColorDropdown } from './colors-gradients/tools-panel-color-dropdown';
|
|
56
54
|
export {
|
|
57
55
|
default as __experimentalImageEditor,
|
|
58
56
|
ImageEditingProvider as __experimentalImageEditingProvider,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { AccessibilityInfo, Platform } from 'react-native';
|
|
4
|
+
import { AccessibilityInfo, Platform, Text } from 'react-native';
|
|
5
5
|
import { delay } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -15,6 +15,7 @@ import { compose, withPreferredColorScheme } from '@wordpress/compose';
|
|
|
15
15
|
import { isUnmodifiedDefaultBlock } from '@wordpress/blocks';
|
|
16
16
|
import {
|
|
17
17
|
Icon,
|
|
18
|
+
plus,
|
|
18
19
|
plusCircle,
|
|
19
20
|
plusCircleFilled,
|
|
20
21
|
insertAfter,
|
|
@@ -32,27 +33,51 @@ import { store as blockEditorStore } from '../../store';
|
|
|
32
33
|
|
|
33
34
|
const VOICE_OVER_ANNOUNCEMENT_DELAY = 1000;
|
|
34
35
|
|
|
35
|
-
const defaultRenderToggle = ( {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
const defaultRenderToggle = ( {
|
|
37
|
+
onToggle,
|
|
38
|
+
disabled,
|
|
39
|
+
style,
|
|
40
|
+
containerStyle,
|
|
41
|
+
onLongPress,
|
|
42
|
+
useExpandedMode,
|
|
43
|
+
} ) => {
|
|
44
|
+
// The "expanded mode" refers to the editor's appearance when no blocks
|
|
45
|
+
// are currently selected. The "add block" button has a separate style
|
|
46
|
+
// for the "expanded mode", which are added via the below "expandedModeViewProps"
|
|
47
|
+
// and "expandedModeViewText" variables.
|
|
48
|
+
const expandedModeViewProps = useExpandedMode && {
|
|
49
|
+
icon: <Icon icon={ plus } style={ style } />,
|
|
50
|
+
customContainerStyles: containerStyle,
|
|
51
|
+
fixedRatio: false,
|
|
52
|
+
};
|
|
53
|
+
const expandedModeViewText = (
|
|
54
|
+
<Text style={ styles[ 'inserter-menu__add-block-button-text' ] }>
|
|
55
|
+
{ __( 'Add blocks' ) }
|
|
56
|
+
</Text>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<ToolbarButton
|
|
61
|
+
title={ _x(
|
|
62
|
+
'Add block',
|
|
63
|
+
'Generic label for block inserter button'
|
|
64
|
+
) }
|
|
65
|
+
icon={ <Icon icon={ plusCircleFilled } style={ style } /> }
|
|
66
|
+
onClick={ onToggle }
|
|
67
|
+
extraProps={ {
|
|
68
|
+
hint: __( 'Double tap to add a block' ),
|
|
69
|
+
// testID is present to disambiguate this element for native UI tests. It's not
|
|
70
|
+
// usually required for components. See: https://github.com/WordPress/gutenberg/pull/18832#issuecomment-561411389.
|
|
71
|
+
testID: 'add-block-button',
|
|
72
|
+
onLongPress,
|
|
73
|
+
} }
|
|
74
|
+
isDisabled={ disabled }
|
|
75
|
+
{ ...expandedModeViewProps }
|
|
76
|
+
>
|
|
77
|
+
{ useExpandedMode && expandedModeViewText }
|
|
78
|
+
</ToolbarButton>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
56
81
|
|
|
57
82
|
export class Inserter extends Component {
|
|
58
83
|
constructor() {
|
|
@@ -219,13 +244,21 @@ export class Inserter extends Component {
|
|
|
219
244
|
renderToggle = defaultRenderToggle,
|
|
220
245
|
getStylesFromColorScheme,
|
|
221
246
|
showSeparator,
|
|
247
|
+
useExpandedMode,
|
|
222
248
|
} = this.props;
|
|
223
249
|
if ( showSeparator && isOpen ) {
|
|
224
250
|
return <BlockInsertionPoint />;
|
|
225
251
|
}
|
|
226
|
-
const style =
|
|
227
|
-
styles
|
|
228
|
-
|
|
252
|
+
const style = useExpandedMode
|
|
253
|
+
? styles[ 'inserter-menu__add-block-button-icon--expanded' ]
|
|
254
|
+
: getStylesFromColorScheme(
|
|
255
|
+
styles[ 'inserter-menu__add-block-button-icon' ],
|
|
256
|
+
styles[ 'inserter-menu__add-block-button-icon--dark' ]
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
const containerStyle = getStylesFromColorScheme(
|
|
260
|
+
styles[ 'inserter-menu__add-block-button' ],
|
|
261
|
+
styles[ 'inserter-menu__add-block-button--dark' ]
|
|
229
262
|
);
|
|
230
263
|
|
|
231
264
|
const onPress = () => {
|
|
@@ -265,7 +298,9 @@ export class Inserter extends Component {
|
|
|
265
298
|
isOpen,
|
|
266
299
|
disabled,
|
|
267
300
|
style,
|
|
301
|
+
containerStyle,
|
|
268
302
|
onLongPress,
|
|
303
|
+
useExpandedMode,
|
|
269
304
|
} ) }
|
|
270
305
|
<Picker
|
|
271
306
|
ref={ ( instance ) => ( this.picker = instance ) }
|
|
@@ -1,13 +1,35 @@
|
|
|
1
1
|
/** @format */
|
|
2
2
|
|
|
3
|
-
.
|
|
4
|
-
color: $blue-
|
|
3
|
+
.inserter-menu__add-block-button-icon {
|
|
4
|
+
color: $blue-50;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.
|
|
7
|
+
.inserter-menu__add-block-button-icon--dark {
|
|
8
8
|
color: $blue-30;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.inserter-menu__add-block-button-icon--expanded {
|
|
12
|
+
color: $white;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.inserter-menu__add-block-button {
|
|
16
|
+
border-radius: 22px;
|
|
17
|
+
background-color: $blue-50;
|
|
18
|
+
margin: 8px;
|
|
19
|
+
padding: 6px 16px 6px 12px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.inserter-menu__add-block-button--dark {
|
|
23
|
+
background-color: $blue-30;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.inserter-menu__add-block-button-text {
|
|
27
|
+
color: $white;
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
align-self: center;
|
|
30
|
+
text-transform: capitalize;
|
|
31
|
+
}
|
|
32
|
+
|
|
11
33
|
.inserter-menu__list-wrapper {
|
|
12
34
|
flex: 1;
|
|
13
35
|
}
|
|
@@ -23,6 +23,7 @@ $block-inserter-tabs-height: 44px;
|
|
|
23
23
|
.block-editor-inserter__popover.is-quick {
|
|
24
24
|
.components-popover__content {
|
|
25
25
|
border: none;
|
|
26
|
+
outline: none;
|
|
26
27
|
|
|
27
28
|
.block-editor-inserter__quick-inserter > * {
|
|
28
29
|
border-left: $border-width solid $gray-400;
|
|
@@ -310,7 +311,7 @@ $block-inserter-tabs-height: 44px;
|
|
|
310
311
|
border-top: $border-width solid $gray-300;
|
|
311
312
|
}
|
|
312
313
|
|
|
313
|
-
.block-editor-inserter__popover.is-quick > .components-popover__content
|
|
314
|
+
.block-editor-inserter__popover.is-quick > .components-popover__content {
|
|
314
315
|
padding: 0;
|
|
315
316
|
}
|
|
316
317
|
|
|
@@ -7,6 +7,17 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
7
|
// Used to help distinguish the "Create" suggestion within the search results in
|
|
8
8
|
// order to handle it as a unique case.
|
|
9
9
|
export const CREATE_TYPE = '__CREATE__';
|
|
10
|
+
export const TEL_TYPE = 'tel';
|
|
11
|
+
export const URL_TYPE = 'URL';
|
|
12
|
+
export const MAILTO_TYPE = 'mailto';
|
|
13
|
+
export const INTERNAL_TYPE = 'internal';
|
|
14
|
+
|
|
15
|
+
export const LINK_ENTRY_TYPES = [
|
|
16
|
+
URL_TYPE,
|
|
17
|
+
MAILTO_TYPE,
|
|
18
|
+
TEL_TYPE,
|
|
19
|
+
INTERNAL_TYPE,
|
|
20
|
+
];
|
|
10
21
|
|
|
11
22
|
export const DEFAULT_LINK_SETTINGS = [
|
|
12
23
|
{
|
|
@@ -15,7 +15,7 @@ import { createElement, Fragment } from '@wordpress/element';
|
|
|
15
15
|
*/
|
|
16
16
|
import LinkControlSearchCreate from './search-create-button';
|
|
17
17
|
import LinkControlSearchItem from './search-item';
|
|
18
|
-
import { CREATE_TYPE } from './constants';
|
|
18
|
+
import { CREATE_TYPE, LINK_ENTRY_TYPES } from './constants';
|
|
19
19
|
|
|
20
20
|
export default function LinkControlSearchResults( {
|
|
21
21
|
instanceId,
|
|
@@ -38,10 +38,9 @@ export default function LinkControlSearchResults( {
|
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
|
|
41
|
-
const directLinkEntryTypes = [ 'url', 'mailto', 'tel', 'internal' ];
|
|
42
41
|
const isSingleDirectEntryResult =
|
|
43
42
|
suggestions.length === 1 &&
|
|
44
|
-
|
|
43
|
+
LINK_ENTRY_TYPES.includes( suggestions[ 0 ].type );
|
|
45
44
|
const shouldShowCreateSuggestion =
|
|
46
45
|
withCreateSuggestion &&
|
|
47
46
|
! isSingleDirectEntryResult &&
|
|
@@ -127,8 +126,8 @@ export default function LinkControlSearchResults( {
|
|
|
127
126
|
handleSuggestionClick( suggestion );
|
|
128
127
|
} }
|
|
129
128
|
isSelected={ index === selectedSuggestion }
|
|
130
|
-
isURL={
|
|
131
|
-
suggestion.type
|
|
129
|
+
isURL={ LINK_ENTRY_TYPES.includes(
|
|
130
|
+
suggestion.type
|
|
132
131
|
) }
|
|
133
132
|
searchTerm={ currentInputValue }
|
|
134
133
|
shouldShowType={ shouldShowSuggestionsTypes }
|
|
@@ -14,26 +14,32 @@ import { startsWith } from 'lodash';
|
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
16
|
import isURLLike from './is-url-like';
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
CREATE_TYPE,
|
|
19
|
+
TEL_TYPE,
|
|
20
|
+
MAILTO_TYPE,
|
|
21
|
+
INTERNAL_TYPE,
|
|
22
|
+
URL_TYPE,
|
|
23
|
+
} from './constants';
|
|
18
24
|
import { store as blockEditorStore } from '../../store';
|
|
19
25
|
|
|
20
26
|
export const handleNoop = () => Promise.resolve( [] );
|
|
21
27
|
|
|
22
28
|
export const handleDirectEntry = ( val ) => {
|
|
23
|
-
let type =
|
|
29
|
+
let type = URL_TYPE;
|
|
24
30
|
|
|
25
31
|
const protocol = getProtocol( val ) || '';
|
|
26
32
|
|
|
27
33
|
if ( protocol.includes( 'mailto' ) ) {
|
|
28
|
-
type =
|
|
34
|
+
type = MAILTO_TYPE;
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
if ( protocol.includes( 'tel' ) ) {
|
|
32
|
-
type =
|
|
38
|
+
type = TEL_TYPE;
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
if ( startsWith( val, '#' ) ) {
|
|
36
|
-
type =
|
|
42
|
+
type = INTERNAL_TYPE;
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
return Promise.resolve( [
|
|
@@ -6,6 +6,7 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
+
import { hasBlockSupport } from '@wordpress/blocks';
|
|
9
10
|
import {
|
|
10
11
|
__experimentalTreeGridCell as TreeGridCell,
|
|
11
12
|
__experimentalTreeGridItem as TreeGridItem,
|
|
@@ -19,7 +20,7 @@ import {
|
|
|
19
20
|
useCallback,
|
|
20
21
|
memo,
|
|
21
22
|
} from '@wordpress/element';
|
|
22
|
-
import { useDispatch } from '@wordpress/data';
|
|
23
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
23
24
|
import { sprintf, __ } from '@wordpress/i18n';
|
|
24
25
|
|
|
25
26
|
/**
|
|
@@ -66,6 +67,19 @@ function ListViewBlock( {
|
|
|
66
67
|
const { toggleBlockHighlight } = useDispatch( blockEditorStore );
|
|
67
68
|
|
|
68
69
|
const blockInformation = useBlockDisplayInformation( clientId );
|
|
70
|
+
const blockName = useSelect(
|
|
71
|
+
( select ) => select( blockEditorStore ).getBlockName( clientId ),
|
|
72
|
+
[ clientId ]
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// When a block hides its toolbar it also hides the block settings menu,
|
|
76
|
+
// since that menu is part of the toolbar in the editor canvas.
|
|
77
|
+
// List View respects this by also hiding the block settings menu.
|
|
78
|
+
const showBlockActions = hasBlockSupport(
|
|
79
|
+
blockName,
|
|
80
|
+
'__experimentalToolbar',
|
|
81
|
+
true
|
|
82
|
+
);
|
|
69
83
|
const { isLocked } = useBlockLock( clientId );
|
|
70
84
|
const instanceId = useInstanceId( ListViewBlock );
|
|
71
85
|
const descriptionId = `list-view-block-select-button__${ instanceId }`;
|
|
@@ -98,14 +112,7 @@ function ListViewBlock( {
|
|
|
98
112
|
)
|
|
99
113
|
: __( 'Options' );
|
|
100
114
|
|
|
101
|
-
const {
|
|
102
|
-
__experimentalFeatures: withExperimentalFeatures,
|
|
103
|
-
__experimentalPersistentListViewFeatures: withExperimentalPersistentListViewFeatures,
|
|
104
|
-
__experimentalHideContainerBlockActions: hideContainerBlockActions,
|
|
105
|
-
isTreeGridMounted,
|
|
106
|
-
expand,
|
|
107
|
-
collapse,
|
|
108
|
-
} = useListViewContext();
|
|
115
|
+
const { isTreeGridMounted, expand, collapse } = useListViewContext();
|
|
109
116
|
|
|
110
117
|
const hasSiblings = siblingBlockCount > 0;
|
|
111
118
|
const hasRenderedMovers = showBlockMovers && hasSiblings;
|
|
@@ -123,27 +130,19 @@ function ListViewBlock( {
|
|
|
123
130
|
// only focus the selected list item on mount; otherwise the list would always
|
|
124
131
|
// try to steal the focus from the editor canvas.
|
|
125
132
|
useEffect( () => {
|
|
126
|
-
if (
|
|
127
|
-
withExperimentalPersistentListViewFeatures &&
|
|
128
|
-
! isTreeGridMounted &&
|
|
129
|
-
isSelected
|
|
130
|
-
) {
|
|
133
|
+
if ( ! isTreeGridMounted && isSelected ) {
|
|
131
134
|
cellRef.current.focus();
|
|
132
135
|
}
|
|
133
136
|
}, [] );
|
|
134
137
|
|
|
135
|
-
const highlightBlock = withExperimentalPersistentListViewFeatures
|
|
136
|
-
? toggleBlockHighlight
|
|
137
|
-
: () => {};
|
|
138
|
-
|
|
139
138
|
const onMouseEnter = useCallback( () => {
|
|
140
139
|
setIsHovered( true );
|
|
141
|
-
|
|
142
|
-
}, [ clientId, setIsHovered,
|
|
140
|
+
toggleBlockHighlight( clientId, true );
|
|
141
|
+
}, [ clientId, setIsHovered, toggleBlockHighlight ] );
|
|
143
142
|
const onMouseLeave = useCallback( () => {
|
|
144
143
|
setIsHovered( false );
|
|
145
|
-
|
|
146
|
-
}, [ clientId, setIsHovered,
|
|
144
|
+
toggleBlockHighlight( clientId, false );
|
|
145
|
+
}, [ clientId, setIsHovered, toggleBlockHighlight ] );
|
|
147
146
|
|
|
148
147
|
const selectEditorBlock = useCallback(
|
|
149
148
|
( event ) => {
|
|
@@ -174,18 +173,10 @@ function ListViewBlock( {
|
|
|
174
173
|
[ clientId, expand, collapse, isExpanded ]
|
|
175
174
|
);
|
|
176
175
|
|
|
177
|
-
const showBlockActions =
|
|
178
|
-
withExperimentalFeatures &&
|
|
179
|
-
// hide actions for blocks like core/widget-areas
|
|
180
|
-
( ! hideContainerBlockActions ||
|
|
181
|
-
( hideContainerBlockActions && level > 1 ) );
|
|
182
|
-
|
|
183
|
-
const hideBlockActions = withExperimentalFeatures && ! showBlockActions;
|
|
184
|
-
|
|
185
176
|
let colSpan;
|
|
186
177
|
if ( hasRenderedMovers ) {
|
|
187
178
|
colSpan = 2;
|
|
188
|
-
} else if (
|
|
179
|
+
} else if ( ! showBlockActions ) {
|
|
189
180
|
colSpan = 3;
|
|
190
181
|
}
|
|
191
182
|
|
|
@@ -193,10 +184,9 @@ function ListViewBlock( {
|
|
|
193
184
|
'is-selected': isSelected,
|
|
194
185
|
'is-first-selected': isFirstSelectedBlock,
|
|
195
186
|
'is-last-selected': isLastSelectedBlock,
|
|
196
|
-
'is-branch-selected':
|
|
197
|
-
withExperimentalPersistentListViewFeatures && isBranchSelected,
|
|
187
|
+
'is-branch-selected': isBranchSelected,
|
|
198
188
|
'is-dragging': isDragged,
|
|
199
|
-
'has-single-cell':
|
|
189
|
+
'has-single-cell': ! showBlockActions,
|
|
200
190
|
} );
|
|
201
191
|
|
|
202
192
|
// Only include all selected blocks if the currently clicked on block
|
|
@@ -85,21 +85,16 @@ function ListViewBranch( props ) {
|
|
|
85
85
|
blocks,
|
|
86
86
|
selectBlock,
|
|
87
87
|
showBlockMovers,
|
|
88
|
-
showNestedBlocks,
|
|
89
88
|
selectedClientIds,
|
|
90
89
|
level = 1,
|
|
91
90
|
path = '',
|
|
92
91
|
isBranchSelected = false,
|
|
93
92
|
listPosition = 0,
|
|
94
93
|
fixedListWindow,
|
|
95
|
-
|
|
94
|
+
isExpanded,
|
|
96
95
|
} = props;
|
|
97
96
|
|
|
98
|
-
const {
|
|
99
|
-
expandedState,
|
|
100
|
-
draggedClientIds,
|
|
101
|
-
__experimentalPersistentListViewFeatures,
|
|
102
|
-
} = useListViewContext();
|
|
97
|
+
const { expandedState, draggedClientIds } = useListViewContext();
|
|
103
98
|
|
|
104
99
|
const filteredBlocks = compact( blocks );
|
|
105
100
|
const blockCount = filteredBlocks.length;
|
|
@@ -115,26 +110,22 @@ function ListViewBranch( props ) {
|
|
|
115
110
|
filteredBlocks[ index - 1 ],
|
|
116
111
|
expandedState,
|
|
117
112
|
draggedClientIds,
|
|
118
|
-
|
|
113
|
+
isExpanded
|
|
119
114
|
);
|
|
120
115
|
}
|
|
121
116
|
|
|
122
|
-
const usesWindowing = __experimentalPersistentListViewFeatures;
|
|
123
|
-
|
|
124
117
|
const { itemInView } = fixedListWindow;
|
|
125
|
-
const blockInView =
|
|
126
|
-
! usesWindowing || itemInView( nextPosition );
|
|
118
|
+
const blockInView = itemInView( nextPosition );
|
|
127
119
|
|
|
128
120
|
const position = index + 1;
|
|
129
121
|
const updatedPath =
|
|
130
122
|
path.length > 0
|
|
131
123
|
? `${ path }_${ position }`
|
|
132
124
|
: `${ position }`;
|
|
133
|
-
const hasNestedBlocks =
|
|
134
|
-
showNestedBlocks && !! innerBlocks && !! innerBlocks.length;
|
|
125
|
+
const hasNestedBlocks = !! innerBlocks?.length;
|
|
135
126
|
|
|
136
|
-
const
|
|
137
|
-
? expandedState[ clientId ] ??
|
|
127
|
+
const shouldExpand = hasNestedBlocks
|
|
128
|
+
? expandedState[ clientId ] ?? isExpanded
|
|
138
129
|
: undefined;
|
|
139
130
|
|
|
140
131
|
const isDragged = !! draggedClientIds?.includes( clientId );
|
|
@@ -164,7 +155,7 @@ function ListViewBranch( props ) {
|
|
|
164
155
|
siblingBlockCount={ blockCount }
|
|
165
156
|
showBlockMovers={ showBlockMovers }
|
|
166
157
|
path={ updatedPath }
|
|
167
|
-
isExpanded={
|
|
158
|
+
isExpanded={ shouldExpand }
|
|
168
159
|
listPosition={ nextPosition }
|
|
169
160
|
selectedClientIds={ selectedClientIds }
|
|
170
161
|
/>
|
|
@@ -174,19 +165,18 @@ function ListViewBranch( props ) {
|
|
|
174
165
|
<td className="block-editor-list-view-placeholder" />
|
|
175
166
|
</tr>
|
|
176
167
|
) }
|
|
177
|
-
{ hasNestedBlocks &&
|
|
168
|
+
{ hasNestedBlocks && shouldExpand && ! isDragged && (
|
|
178
169
|
<ListViewBranch
|
|
179
170
|
blocks={ innerBlocks }
|
|
180
171
|
selectBlock={ selectBlock }
|
|
181
172
|
showBlockMovers={ showBlockMovers }
|
|
182
|
-
showNestedBlocks={ showNestedBlocks }
|
|
183
173
|
level={ level + 1 }
|
|
184
174
|
path={ updatedPath }
|
|
185
175
|
listPosition={ nextPosition + 1 }
|
|
186
176
|
fixedListWindow={ fixedListWindow }
|
|
187
177
|
isBranchSelected={ isSelectedBranch }
|
|
188
178
|
selectedClientIds={ selectedClientIds }
|
|
189
|
-
|
|
179
|
+
isExpanded={ isExpanded }
|
|
190
180
|
/>
|
|
191
181
|
) }
|
|
192
182
|
</AsyncModeProvider>
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createContext, useContext } from '@wordpress/element';
|
|
5
5
|
|
|
6
|
-
export const ListViewContext = createContext( {
|
|
7
|
-
__experimentalFeatures: false,
|
|
8
|
-
__experimentalPersistentListViewFeatures: false,
|
|
9
|
-
} );
|
|
6
|
+
export const ListViewContext = createContext( {} );
|
|
10
7
|
|
|
11
8
|
export const useListViewContext = () => useContext( ListViewContext );
|