@wordpress/block-editor 8.6.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +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 +4 -82
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.native.js +65 -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 +488 -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 +27 -5
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +34 -32
- package/build/components/block-list/index.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-mobile-toolbar/index.native.js +10 -3
- package/build/components/block-mobile-toolbar/index.native.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 +19 -8
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +20 -16
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/index.js +1 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +1 -0
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +1 -29
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +16 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- 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 +122 -41
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +35 -60
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +22 -5
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/iframe/index.js +51 -50
- package/build/components/iframe/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 +14 -23
- package/build/components/index.js.map +1 -1
- package/build/components/inserter/index.js +21 -7
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +2 -2
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +4 -5
- package/build/components/inserter/quick-inserter.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/media-placeholder/index.js +0 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +0 -2
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +10 -4
- package/build/components/media-upload/index.native.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/plain-text/index.native.js +62 -7
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +55 -0
- package/build/components/publish-date-time-picker/index.js.map +1 -0
- 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 +2 -2
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +5 -1
- 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-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/components/warning/index.js +6 -1
- package/build/components/warning/index.js.map +1 -1
- package/build/components/writing-flow/use-click-selection.js +1 -3
- package/build/components/writing-flow/use-click-selection.js.map +1 -1
- package/build/components/writing-flow/use-input.js +15 -0
- package/build/components/writing-flow/use-input.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +49 -8
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/elements/index.js +9 -0
- package/build/elements/index.js.map +1 -0
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border.js +2 -7
- 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/color.js +8 -88
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +16 -6
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/index.js +2 -0
- 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/index.js +14 -0
- package/build/index.js.map +1 -1
- package/build/layouts/flex.js +5 -2
- package/build/layouts/flex.js.map +1 -1
- package/build/store/actions.js +14 -0
- 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 +17 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +43 -13
- 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 +3 -78
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.native.js +51 -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 +453 -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 +26 -5
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +35 -33
- package/build-module/components/block-list/index.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-mobile-toolbar/index.native.js +9 -3
- package/build-module/components/block-mobile-toolbar/index.native.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 +19 -8
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +21 -15
- package/build-module/components/block-popover/index.js.map +1 -1
- 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-tools/block-selection-button.js +1 -0
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +2 -29
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +13 -2
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- 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 +124 -43
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +36 -64
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +23 -6
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/iframe/index.js +52 -51
- package/build-module/components/iframe/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 +2 -3
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inserter/index.js +21 -7
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +2 -2
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +4 -5
- package/build-module/components/inserter/quick-inserter.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/media-placeholder/index.js +0 -2
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +0 -2
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +8 -3
- package/build-module/components/media-upload/index.native.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/plain-text/index.native.js +63 -8
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +42 -0
- package/build-module/components/publish-date-time-picker/index.js.map +1 -0
- 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 +2 -2
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +5 -1
- 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-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/components/warning/index.js +6 -1
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/writing-flow/use-click-selection.js +1 -3
- package/build-module/components/writing-flow/use-click-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-input.js +15 -0
- package/build-module/components/writing-flow/use-input.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +49 -8
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/elements/index.js +2 -0
- package/build-module/elements/index.js.map +1 -0
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border.js +2 -7
- 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/color.js +8 -88
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +19 -9
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/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/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/flex.js +4 -2
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/store/actions.js +12 -0
- 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 +17 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +37 -12
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +100 -225
- package/build-style/style.css +100 -225
- package/package.json +30 -30
- 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 +8 -95
- package/src/components/block-content-overlay/style.scss +2 -12
- 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 +462 -0
- package/src/components/block-draggable/style.native.scss +19 -0
- package/src/components/block-draggable/test/__snapshots__/index.native.js.snap +73 -0
- package/src/components/block-draggable/test/helpers.native.js +183 -0
- package/src/components/block-draggable/test/index.native.js +496 -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 +37 -8
- package/src/components/block-list/index.js +44 -44
- 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-mobile-toolbar/index.native.js +9 -1
- package/src/components/block-mover/index.native.js +22 -6
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +10 -0
- package/src/components/block-navigation/dropdown.js +12 -8
- package/src/components/block-popover/inbetween.js +21 -8
- package/src/components/block-popover/index.js +18 -15
- package/src/components/block-popover/style.scss +4 -0
- package/src/components/block-preview/index.js +1 -4
- package/src/components/block-switcher/style.scss +2 -39
- package/src/components/block-tools/block-selection-button.js +1 -0
- package/src/components/block-tools/selected-block-popover.js +1 -36
- package/src/components/block-tools/style.scss +1 -12
- package/src/components/block-variation-transforms/index.js +6 -2
- package/src/components/border-radius-control/input-controls.js +16 -8
- package/src/components/border-radius-control/style.scss +3 -2
- 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 +130 -62
- package/src/components/colors-gradients/panel-color-gradient-settings.js +30 -76
- package/src/components/colors-gradients/style.scss +52 -50
- package/src/components/convert-to-group-buttons/toolbar.js +30 -13
- package/src/components/duotone-control/style.scss +1 -7
- package/src/components/iframe/index.js +62 -54
- 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 +2 -3
- package/src/components/inserter/index.js +20 -0
- package/src/components/inserter/index.native.js +2 -2
- package/src/components/inserter/quick-inserter.js +3 -11
- package/src/components/inserter/style.native.scss +1 -0
- 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/media-placeholder/index.js +0 -2
- package/src/components/media-replace-flow/index.js +0 -2
- package/src/components/media-upload/index.native.js +6 -2
- package/src/components/media-upload/test/index.native.js +31 -6
- package/src/components/navigable-toolbar/index.js +12 -2
- package/src/components/plain-text/index.native.js +64 -8
- package/src/components/preview-options/style.scss +0 -4
- package/src/components/publish-date-time-picker/README.md +52 -0
- package/src/components/publish-date-time-picker/index.js +50 -0
- package/src/components/publish-date-time-picker/style.scss +20 -0
- package/src/components/rich-text/format-toolbar-container.js +0 -1
- package/src/components/rich-text/index.js +3 -1
- package/src/components/rich-text/index.native.js +4 -0
- package/src/components/rich-text/style.scss +2 -8
- package/src/components/url-input/index.js +9 -4
- 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/components/warning/index.js +47 -42
- package/src/components/warning/test/__snapshots__/index.js.snap +15 -6
- package/src/components/warning/test/index.js +1 -1
- package/src/components/writing-flow/use-click-selection.js +1 -4
- package/src/components/writing-flow/use-input.js +12 -0
- package/src/components/writing-flow/use-selection-observer.js +55 -10
- package/src/elements/index.js +1 -0
- package/src/hooks/anchor.js +1 -1
- package/src/hooks/border.js +2 -11
- package/src/hooks/border.scss +0 -48
- package/src/hooks/color-panel.js +13 -9
- package/src/hooks/color.js +5 -74
- package/src/hooks/color.scss +5 -58
- package/src/hooks/dimensions.js +55 -41
- package/src/hooks/index.js +1 -0
- 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/index.js +1 -0
- package/src/layouts/flex.js +11 -3
- package/src/store/actions.js +12 -0
- package/src/store/defaults.js +0 -1
- package/src/store/reducer.js +14 -1
- package/src/store/selectors.js +42 -12
- package/src/store/test/reducer.js +5 -0
- package/src/store/test/selectors.js +17 -0
- package/src/style.scss +2 -2
- package/tsconfig.tsbuildinfo +1 -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/color-panel.js +0 -82
- package/build/components/colors/color-panel.js.map +0 -1
- package/build/components/colors/color-panel.native.js +0 -11
- package/build/components/colors/color-panel.native.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-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/color-panel.js +0 -70
- package/build-module/components/colors/color-panel.js.map +0 -1
- package/build-module/components/colors/color-panel.native.js +0 -4
- package/build-module/components/colors/color-panel.native.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/src/components/block-alignment-matrix-control/style.scss +0 -10
- package/src/components/border-style-control/index.js +0 -47
- package/src/components/border-style-control/style.scss +0 -18
- package/src/components/colors/color-panel.js +0 -91
- package/src/components/colors/color-panel.native.js +0 -3
- package/src/components/colors-gradients/tools-panel-color-dropdown.js +0 -85
|
@@ -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,
|
|
@@ -34,6 +34,11 @@ Array [
|
|
|
34
34
|
}
|
|
35
35
|
>
|
|
36
36
|
<View
|
|
37
|
+
collapsable={false}
|
|
38
|
+
handlerTag={3}
|
|
39
|
+
handlerType="LongPressGestureHandler"
|
|
40
|
+
onGestureHandlerEvent={[Function]}
|
|
41
|
+
onGestureHandlerStateChange={[Function]}
|
|
37
42
|
style={
|
|
38
43
|
Object {
|
|
39
44
|
"alignItems": "center",
|
|
@@ -89,6 +94,11 @@ Array [
|
|
|
89
94
|
}
|
|
90
95
|
>
|
|
91
96
|
<View
|
|
97
|
+
collapsable={false}
|
|
98
|
+
handlerTag={4}
|
|
99
|
+
handlerType="LongPressGestureHandler"
|
|
100
|
+
onGestureHandlerEvent={[Function]}
|
|
101
|
+
onGestureHandlerStateChange={[Function]}
|
|
92
102
|
style={
|
|
93
103
|
Object {
|
|
94
104
|
"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
|
/>
|
|
@@ -28,11 +28,13 @@ function BlockPopoverInbetween( {
|
|
|
28
28
|
__unstableContentRef,
|
|
29
29
|
...props
|
|
30
30
|
} ) {
|
|
31
|
-
const { orientation, rootClientId } = useSelect(
|
|
31
|
+
const { orientation, rootClientId, isVisible } = useSelect(
|
|
32
32
|
( select ) => {
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const {
|
|
34
|
+
getBlockListSettings,
|
|
35
|
+
getBlockRootClientId,
|
|
36
|
+
isBlockVisible,
|
|
37
|
+
} = select( blockEditorStore );
|
|
36
38
|
|
|
37
39
|
const _rootClientId = getBlockRootClientId( previousClientId );
|
|
38
40
|
return {
|
|
@@ -40,6 +42,9 @@ function BlockPopoverInbetween( {
|
|
|
40
42
|
getBlockListSettings( _rootClientId )?.orientation ||
|
|
41
43
|
'vertical',
|
|
42
44
|
rootClientId: _rootClientId,
|
|
45
|
+
isVisible:
|
|
46
|
+
isBlockVisible( previousClientId ) &&
|
|
47
|
+
isBlockVisible( nextClientId ),
|
|
43
48
|
};
|
|
44
49
|
},
|
|
45
50
|
[ previousClientId ]
|
|
@@ -48,7 +53,7 @@ function BlockPopoverInbetween( {
|
|
|
48
53
|
const nextElement = useBlockElement( nextClientId );
|
|
49
54
|
const isVertical = orientation === 'vertical';
|
|
50
55
|
const style = useMemo( () => {
|
|
51
|
-
if ( ! previousElement && ! nextElement ) {
|
|
56
|
+
if ( ( ! previousElement && ! nextElement ) || ! isVisible ) {
|
|
52
57
|
return {};
|
|
53
58
|
}
|
|
54
59
|
|
|
@@ -87,7 +92,7 @@ function BlockPopoverInbetween( {
|
|
|
87
92
|
}, [ previousElement, nextElement, isVertical ] );
|
|
88
93
|
|
|
89
94
|
const getAnchorRect = useCallback( () => {
|
|
90
|
-
if ( ! previousElement && ! nextElement ) {
|
|
95
|
+
if ( ( ! previousElement && ! nextElement ) || ! isVisible ) {
|
|
91
96
|
return {};
|
|
92
97
|
}
|
|
93
98
|
|
|
@@ -107,6 +112,8 @@ function BlockPopoverInbetween( {
|
|
|
107
112
|
left: previousRect ? previousRect.right : nextRect.right,
|
|
108
113
|
right: previousRect ? previousRect.left : nextRect.left,
|
|
109
114
|
bottom: nextRect ? nextRect.top : previousRect.bottom,
|
|
115
|
+
height: 0,
|
|
116
|
+
width: 0,
|
|
110
117
|
ownerDocument,
|
|
111
118
|
};
|
|
112
119
|
}
|
|
@@ -116,6 +123,8 @@ function BlockPopoverInbetween( {
|
|
|
116
123
|
left: previousRect ? previousRect.left : nextRect.left,
|
|
117
124
|
right: previousRect ? previousRect.right : nextRect.right,
|
|
118
125
|
bottom: nextRect ? nextRect.top : previousRect.bottom,
|
|
126
|
+
height: 0,
|
|
127
|
+
width: 0,
|
|
119
128
|
ownerDocument,
|
|
120
129
|
};
|
|
121
130
|
}
|
|
@@ -126,6 +135,8 @@ function BlockPopoverInbetween( {
|
|
|
126
135
|
left: previousRect ? previousRect.left : nextRect.right,
|
|
127
136
|
right: nextRect ? nextRect.right : previousRect.left,
|
|
128
137
|
bottom: previousRect ? previousRect.bottom : nextRect.bottom,
|
|
138
|
+
height: 0,
|
|
139
|
+
width: 0,
|
|
129
140
|
ownerDocument,
|
|
130
141
|
};
|
|
131
142
|
}
|
|
@@ -135,13 +146,15 @@ function BlockPopoverInbetween( {
|
|
|
135
146
|
left: previousRect ? previousRect.right : nextRect.left,
|
|
136
147
|
right: nextRect ? nextRect.left : previousRect.right,
|
|
137
148
|
bottom: previousRect ? previousRect.bottom : nextRect.bottom,
|
|
149
|
+
height: 0,
|
|
150
|
+
width: 0,
|
|
138
151
|
ownerDocument,
|
|
139
152
|
};
|
|
140
153
|
}, [ previousElement, nextElement ] );
|
|
141
154
|
|
|
142
155
|
const popoverScrollRef = usePopoverScroll( __unstableContentRef );
|
|
143
156
|
|
|
144
|
-
if ( ! previousElement || ! nextElement ) {
|
|
157
|
+
if ( ! previousElement || ! nextElement || ! isVisible ) {
|
|
145
158
|
return null;
|
|
146
159
|
}
|
|
147
160
|
|
|
@@ -155,7 +168,6 @@ function BlockPopoverInbetween( {
|
|
|
155
168
|
return (
|
|
156
169
|
<Popover
|
|
157
170
|
ref={ popoverScrollRef }
|
|
158
|
-
noArrow
|
|
159
171
|
animate={ false }
|
|
160
172
|
getAnchorRect={ getAnchorRect }
|
|
161
173
|
focusOnMount={ false }
|
|
@@ -170,6 +182,7 @@ function BlockPopoverInbetween( {
|
|
|
170
182
|
'block-editor-block-popover',
|
|
171
183
|
props.className
|
|
172
184
|
) }
|
|
185
|
+
__unstableForcePosition
|
|
173
186
|
>
|
|
174
187
|
<div style={ style }>{ children }</div>
|
|
175
188
|
</Popover>
|
|
@@ -7,7 +7,7 @@ import classnames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { Popover } from '@wordpress/components';
|
|
10
|
-
import {
|
|
10
|
+
import { useMemo } from '@wordpress/element';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
@@ -19,6 +19,8 @@ export default function BlockPopover( {
|
|
|
19
19
|
clientId,
|
|
20
20
|
bottomClientId,
|
|
21
21
|
children,
|
|
22
|
+
__unstableRefreshSize,
|
|
23
|
+
__unstableCoverTarget = false,
|
|
22
24
|
__unstablePopoverSlot,
|
|
23
25
|
__unstableContentRef,
|
|
24
26
|
...props
|
|
@@ -26,6 +28,17 @@ export default function BlockPopover( {
|
|
|
26
28
|
const selectedElement = useBlockElement( clientId );
|
|
27
29
|
const lastSelectedElement = useBlockElement( bottomClientId ?? clientId );
|
|
28
30
|
const popoverScrollRef = usePopoverScroll( __unstableContentRef );
|
|
31
|
+
const style = useMemo( () => {
|
|
32
|
+
if ( ! selectedElement || lastSelectedElement !== selectedElement ) {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
width: selectedElement.offsetWidth,
|
|
39
|
+
height: selectedElement.offsetHeight,
|
|
40
|
+
};
|
|
41
|
+
}, [ selectedElement, lastSelectedElement, __unstableRefreshSize ] );
|
|
29
42
|
|
|
30
43
|
if ( ! selectedElement || ( bottomClientId && ! lastSelectedElement ) ) {
|
|
31
44
|
return null;
|
|
@@ -36,38 +49,28 @@ export default function BlockPopover( {
|
|
|
36
49
|
bottom: lastSelectedElement,
|
|
37
50
|
};
|
|
38
51
|
|
|
39
|
-
const { ownerDocument } = selectedElement;
|
|
40
|
-
const stickyBoundaryElement =
|
|
41
|
-
ownerDocument.defaultView.frameElement ||
|
|
42
|
-
getScrollContainer( selectedElement ) ||
|
|
43
|
-
ownerDocument.body;
|
|
44
|
-
|
|
45
52
|
return (
|
|
46
53
|
<Popover
|
|
47
54
|
ref={ popoverScrollRef }
|
|
48
|
-
noArrow
|
|
49
55
|
animate={ false }
|
|
50
56
|
position="top right left"
|
|
51
57
|
focusOnMount={ false }
|
|
52
58
|
anchorRef={ anchorRef }
|
|
53
|
-
__unstableStickyBoundaryElement={ stickyBoundaryElement }
|
|
54
59
|
// Render in the old slot if needed for backward compatibility,
|
|
55
60
|
// otherwise render in place (not in the the default popover slot).
|
|
56
61
|
__unstableSlotName={ __unstablePopoverSlot || null }
|
|
57
|
-
__unstableBoundaryParent
|
|
58
62
|
// Observe movement for block animations (especially horizontal).
|
|
59
63
|
__unstableObserveElement={ selectedElement }
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// obscure specific sections of a block.
|
|
63
|
-
__unstableEditorCanvasWrapper={ __unstableContentRef?.current }
|
|
64
|
+
__unstableForcePosition
|
|
65
|
+
__unstableShift
|
|
64
66
|
{ ...props }
|
|
65
67
|
className={ classnames(
|
|
66
68
|
'block-editor-block-popover',
|
|
67
69
|
props.className
|
|
68
70
|
) }
|
|
69
71
|
>
|
|
70
|
-
{ children }
|
|
72
|
+
{ __unstableCoverTarget && <div style={ style }>{ children }</div> }
|
|
73
|
+
{ ! __unstableCoverTarget && children }
|
|
71
74
|
</Popover>
|
|
72
75
|
);
|
|
73
76
|
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
.components-popover.block-editor-block-popover {
|
|
3
3
|
z-index: z-index(".block-editor-block-popover");
|
|
4
4
|
position: absolute;
|
|
5
|
+
// Shouldn't be needed but it looks
|
|
6
|
+
// like the popover is impacted by the block gap margin.
|
|
7
|
+
margin: 0 !important;
|
|
5
8
|
|
|
6
9
|
.components-popover__content {
|
|
7
10
|
margin: 0 !important;
|
|
@@ -9,6 +12,7 @@
|
|
|
9
12
|
width: max-content;
|
|
10
13
|
background: none;
|
|
11
14
|
border: none;
|
|
15
|
+
outline: none;
|
|
12
16
|
box-shadow: none;
|
|
13
17
|
overflow-y: visible;
|
|
14
18
|
|
|
@@ -7,10 +7,7 @@ import classnames from 'classnames';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
11
|
-
__experimentalUseDisabled as useDisabled,
|
|
12
|
-
useMergeRefs,
|
|
13
|
-
} from '@wordpress/compose';
|
|
10
|
+
import { useDisabled, useMergeRefs } from '@wordpress/compose';
|
|
14
11
|
import { useSelect } from '@wordpress/data';
|
|
15
12
|
import { memo, useMemo } from '@wordpress/element';
|
|
16
13
|
|
|
@@ -39,11 +39,6 @@
|
|
|
39
39
|
font-size: 14px;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// Indent the popover to match the button position.
|
|
43
|
-
.block-editor-block-switcher__popover {
|
|
44
|
-
margin-left: 6px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
42
|
.components-button.block-editor-block-switcher__no-switcher-icon {
|
|
48
43
|
display: flex;
|
|
49
44
|
|
|
@@ -93,43 +88,11 @@
|
|
|
93
88
|
min-width: 300px;
|
|
94
89
|
}
|
|
95
90
|
|
|
96
|
-
// We keep the min width the same for the border to work.
|
|
97
|
-
.components-popover.block-editor-block-switcher__popover .components-popover__content > div {
|
|
98
|
-
min-width: auto;
|
|
99
|
-
display: flex;
|
|
100
|
-
background: $white;
|
|
101
|
-
padding: 0;
|
|
102
|
-
|
|
103
|
-
.components-menu-group {
|
|
104
|
-
margin: 0;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.block-editor-block-switcher__popover .components-popover__content {
|
|
109
|
-
|
|
110
|
-
.block-editor-block-styles {
|
|
111
|
-
margin: 0 -3px; // Remove the panel body padding while keeping it for the title.
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Hide the bottom border on the last panel so it stacks with the popover.
|
|
115
|
-
.components-panel__body {
|
|
116
|
-
border: 0;
|
|
117
|
-
|
|
118
|
-
// Elevate this so the hover style is visible.
|
|
119
|
-
position: relative;
|
|
120
|
-
z-index: 1;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.components-panel__body + .components-panel__body {
|
|
124
|
-
border-top: $border-width solid $gray-200;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
91
|
.block-editor-block-switcher__popover__preview__parent {
|
|
129
92
|
.block-editor-block-switcher__popover__preview__container {
|
|
130
93
|
position: absolute;
|
|
131
94
|
top: -$grid-unit-15;
|
|
132
|
-
left: calc(100% + #{$grid-unit-
|
|
95
|
+
left: calc(100% + #{$grid-unit-20});
|
|
133
96
|
}
|
|
134
97
|
}
|
|
135
98
|
|
|
@@ -138,7 +101,6 @@
|
|
|
138
101
|
|
|
139
102
|
// Position correctly. Needs specificity.
|
|
140
103
|
&.components-popover {
|
|
141
|
-
margin-left: $grid-unit-05;
|
|
142
104
|
margin-top: $grid-unit-15 - $border-width;
|
|
143
105
|
}
|
|
144
106
|
|
|
@@ -151,6 +113,7 @@
|
|
|
151
113
|
border: $border-width solid $gray-900;
|
|
152
114
|
background: $white;
|
|
153
115
|
border-radius: $radius-block-ui;
|
|
116
|
+
outline: none;
|
|
154
117
|
}
|
|
155
118
|
|
|
156
119
|
.block-editor-block-switcher__preview {
|
|
@@ -262,6 +262,7 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
|
|
|
262
262
|
onClick={ () => setNavigationMode( false ) }
|
|
263
263
|
onKeyDown={ onKeyDown }
|
|
264
264
|
label={ label }
|
|
265
|
+
showTooltip={ false }
|
|
265
266
|
className="block-selection-button_select-button"
|
|
266
267
|
>
|
|
267
268
|
<BlockTitle
|
|
@@ -7,7 +7,7 @@ import classnames from 'classnames';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { useRef, useEffect } from '@wordpress/element';
|
|
11
11
|
import { isUnmodifiedDefaultBlock } from '@wordpress/blocks';
|
|
12
12
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
13
13
|
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
@@ -18,7 +18,6 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
18
18
|
*/
|
|
19
19
|
import BlockSelectionButton from './block-selection-button';
|
|
20
20
|
import BlockContextualToolbar from './block-contextual-toolbar';
|
|
21
|
-
import Inserter from '../inserter';
|
|
22
21
|
import { store as blockEditorStore } from '../../store';
|
|
23
22
|
import BlockPopover from '../block-popover';
|
|
24
23
|
|
|
@@ -77,7 +76,6 @@ function SelectedBlockPopover( {
|
|
|
77
76
|
);
|
|
78
77
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
79
78
|
const isToolbarForced = useRef( false );
|
|
80
|
-
const [ isInserterShown, setIsInserterShown ] = useState( false );
|
|
81
79
|
const { stopTyping } = useDispatch( blockEditorStore );
|
|
82
80
|
|
|
83
81
|
const showEmptyBlockSideInserter =
|
|
@@ -119,14 +117,6 @@ function SelectedBlockPopover( {
|
|
|
119
117
|
return null;
|
|
120
118
|
}
|
|
121
119
|
|
|
122
|
-
function onFocus() {
|
|
123
|
-
setIsInserterShown( true );
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function onBlur() {
|
|
127
|
-
setIsInserterShown( false );
|
|
128
|
-
}
|
|
129
|
-
|
|
130
120
|
return (
|
|
131
121
|
<BlockPopover
|
|
132
122
|
clientId={ capturingClientId || clientId }
|
|
@@ -137,31 +127,6 @@ function SelectedBlockPopover( {
|
|
|
137
127
|
__unstablePopoverSlot={ __unstablePopoverSlot }
|
|
138
128
|
__unstableContentRef={ __unstableContentRef }
|
|
139
129
|
>
|
|
140
|
-
{ shouldShowContextualToolbar && (
|
|
141
|
-
<div
|
|
142
|
-
onFocus={ onFocus }
|
|
143
|
-
onBlur={ onBlur }
|
|
144
|
-
// While ideally it would be enough to capture the
|
|
145
|
-
// bubbling focus event from the Inserter, due to the
|
|
146
|
-
// characteristics of click focusing of `button`s in
|
|
147
|
-
// Firefox and Safari, it is not reliable.
|
|
148
|
-
//
|
|
149
|
-
// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
|
150
|
-
tabIndex={ -1 }
|
|
151
|
-
className={ classnames(
|
|
152
|
-
'block-editor-block-list__block-popover-inserter',
|
|
153
|
-
{
|
|
154
|
-
'is-visible': isInserterShown,
|
|
155
|
-
}
|
|
156
|
-
) }
|
|
157
|
-
>
|
|
158
|
-
<Inserter
|
|
159
|
-
clientId={ clientId }
|
|
160
|
-
rootClientId={ rootClientId }
|
|
161
|
-
__experimentalIsQuick
|
|
162
|
-
/>
|
|
163
|
-
</div>
|
|
164
|
-
) }
|
|
165
130
|
{ shouldShowContextualToolbar && (
|
|
166
131
|
<BlockContextualToolbar
|
|
167
132
|
// If the toolbar is being shown because of being forced
|
|
@@ -42,20 +42,9 @@
|
|
|
42
42
|
left: calc(50% - #{$button-size-small * 0.5});
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.block-editor-block-list__block-popover-inserter {
|
|
46
|
-
position: absolute;
|
|
47
|
-
top: -9999em;
|
|
48
|
-
margin-bottom: $block-padding;
|
|
49
|
-
|
|
50
|
-
&.is-visible {
|
|
51
|
-
position: static;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
45
|
// Sibling inserter / "inbetweenserter".
|
|
56
46
|
.block-editor-default-block-appender,
|
|
57
|
-
.block-editor-block-list__insertion-point-inserter
|
|
58
|
-
.block-editor-block-list__block-popover-inserter {
|
|
47
|
+
.block-editor-block-list__insertion-point-inserter {
|
|
59
48
|
.block-editor-inserter__toggle.components-button.has-icon {
|
|
60
49
|
// Basic look
|
|
61
50
|
background: $gray-900;
|
|
@@ -17,6 +17,7 @@ import { chevronDown } from '@wordpress/icons';
|
|
|
17
17
|
/**
|
|
18
18
|
* Internal dependencies
|
|
19
19
|
*/
|
|
20
|
+
import BlockIcon from '../block-icon';
|
|
20
21
|
import { store as blockEditorStore } from '../../store';
|
|
21
22
|
|
|
22
23
|
function VariationsButtons( {
|
|
@@ -33,7 +34,7 @@ function VariationsButtons( {
|
|
|
33
34
|
{ variations.map( ( variation ) => (
|
|
34
35
|
<Button
|
|
35
36
|
key={ variation.name }
|
|
36
|
-
icon={ variation.icon }
|
|
37
|
+
icon={ <BlockIcon icon={ variation.icon } showColors /> }
|
|
37
38
|
isPressed={ selectedValue === variation.name }
|
|
38
39
|
label={
|
|
39
40
|
selectedValue === variation.name
|
|
@@ -121,9 +122,12 @@ function __experimentalBlockVariationTransforms( { blockClientId } ) {
|
|
|
121
122
|
// Check if each variation has a unique icon.
|
|
122
123
|
const hasUniqueIcons = useMemo( () => {
|
|
123
124
|
const variationIcons = new Set();
|
|
125
|
+
if ( ! variations ) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
124
128
|
variations.forEach( ( variation ) => {
|
|
125
129
|
if ( variation.icon ) {
|
|
126
|
-
variationIcons.add( variation.icon );
|
|
130
|
+
variationIcons.add( variation.icon?.src || variation.icon );
|
|
127
131
|
}
|
|
128
132
|
} );
|
|
129
133
|
return variationIcons.size === variations.length;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
__experimentalUnitControl as UnitControl,
|
|
6
|
+
Tooltip,
|
|
7
|
+
} from '@wordpress/components';
|
|
5
8
|
import { __ } from '@wordpress/i18n';
|
|
6
9
|
|
|
7
10
|
const CORNERS = {
|
|
@@ -39,16 +42,21 @@ export default function BoxInputControls( {
|
|
|
39
42
|
};
|
|
40
43
|
|
|
41
44
|
// Controls are wrapped in tooltips as visible labels aren't desired here.
|
|
45
|
+
// Tooltip rendering also requires the UnitControl to be wrapped. See:
|
|
46
|
+
// https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026
|
|
42
47
|
return (
|
|
43
48
|
<div className="components-border-radius-control__input-controls-wrapper">
|
|
44
49
|
{ Object.entries( CORNERS ).map( ( [ key, label ] ) => (
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
<Tooltip text={ label } position="top" key={ key }>
|
|
51
|
+
<div className="components-border-radius-control__tooltip-wrapper">
|
|
52
|
+
<UnitControl
|
|
53
|
+
{ ...props }
|
|
54
|
+
aria-label={ label }
|
|
55
|
+
value={ values[ key ] }
|
|
56
|
+
onChange={ createHandleOnChange( key ) }
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
</Tooltip>
|
|
52
60
|
) ) }
|
|
53
61
|
</div>
|
|
54
62
|
);
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
> .components-unit-control-wrapper {
|
|
14
14
|
width: 110px;
|
|
15
15
|
margin-bottom: 0;
|
|
16
|
-
margin-right: #{ $grid-unit-
|
|
16
|
+
margin-right: #{ $grid-unit-15 };
|
|
17
17
|
flex-shrink: 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
width: 70%;
|
|
42
42
|
flex-wrap: wrap;
|
|
43
43
|
|
|
44
|
-
.components-
|
|
44
|
+
.components-border-radius-control__tooltip-wrapper {
|
|
45
45
|
width: calc(50% - #{ $grid-unit-10 });
|
|
46
46
|
margin-bottom: $grid-unit-10;
|
|
47
47
|
margin-right: $grid-unit-10;
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
display: flex;
|
|
53
53
|
justify-content: center;
|
|
54
54
|
margin-left: 2px;
|
|
55
|
+
margin-top: 3px;
|
|
55
56
|
|
|
56
57
|
svg {
|
|
57
58
|
margin-right: 0;
|
|
@@ -231,7 +231,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
231
231
|
>
|
|
232
232
|
<button
|
|
233
233
|
aria-describedby={null}
|
|
234
|
-
className="components-button components-circular-option-picker__clear is-
|
|
234
|
+
className="components-button components-circular-option-picker__clear is-tertiary"
|
|
235
235
|
onClick={[Function]}
|
|
236
236
|
type="button"
|
|
237
237
|
>
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from '@wordpress/components';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { DOWN } from '@wordpress/keycodes';
|
|
13
|
+
import deprecated from '@wordpress/deprecated';
|
|
13
14
|
|
|
14
15
|
const ColorSelectorSVGIcon = () => (
|
|
15
16
|
<SVG xmlns="https://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
|
@@ -78,14 +79,22 @@ const renderToggleComponent = ( { TextColor, BackgroundColor } ) => ( {
|
|
|
78
79
|
);
|
|
79
80
|
};
|
|
80
81
|
|
|
81
|
-
const BlockColorsStyleSelector = ( { children, ...other } ) =>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
const BlockColorsStyleSelector = ( { children, ...other } ) => {
|
|
83
|
+
deprecated( `wp.blockEditor.BlockColorsStyleSelector`, {
|
|
84
|
+
alternative: 'block supports API',
|
|
85
|
+
since: '6.1',
|
|
86
|
+
version: '6.3',
|
|
87
|
+
} );
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<Dropdown
|
|
91
|
+
position="bottom right"
|
|
92
|
+
className="block-library-colors-selector"
|
|
93
|
+
contentClassName="block-library-colors-selector__popover"
|
|
94
|
+
renderToggle={ renderToggleComponent( other ) }
|
|
95
|
+
renderContent={ () => children }
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
90
99
|
|
|
91
100
|
export default BlockColorsStyleSelector;
|