@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
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
.block-editor-block-list__insertion-point {
|
|
6
6
|
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
right: 0;
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
.block-editor-block-list__insertion-point-indicator {
|
|
@@ -38,21 +42,9 @@
|
|
|
38
42
|
left: calc(50% - #{$button-size-small * 0.5});
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
.block-editor-block-list__block-popover-inserter {
|
|
42
|
-
position: absolute;
|
|
43
|
-
top: -9999em;
|
|
44
|
-
margin-bottom: $block-padding;
|
|
45
|
-
|
|
46
|
-
&.is-visible {
|
|
47
|
-
position: static;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
45
|
// Sibling inserter / "inbetweenserter".
|
|
52
|
-
.block-editor-block-list__empty-block-inserter,
|
|
53
46
|
.block-editor-default-block-appender,
|
|
54
|
-
.block-editor-block-list__insertion-point-inserter
|
|
55
|
-
.block-editor-block-list__block-popover-inserter {
|
|
47
|
+
.block-editor-block-list__insertion-point-inserter {
|
|
56
48
|
.block-editor-inserter__toggle.components-button.has-icon {
|
|
57
49
|
// Basic look
|
|
58
50
|
background: $gray-900;
|
|
@@ -98,7 +90,7 @@
|
|
|
98
90
|
position: sticky;
|
|
99
91
|
top: 0;
|
|
100
92
|
width: 100%;
|
|
101
|
-
z-index: z-index(".block-editor-block-
|
|
93
|
+
z-index: z-index(".block-editor-block-popover");
|
|
102
94
|
// Fill up when empty
|
|
103
95
|
min-height: $block-toolbar-height;
|
|
104
96
|
display: block;
|
|
@@ -112,42 +104,6 @@
|
|
|
112
104
|
border-right-color: $gray-200;
|
|
113
105
|
}
|
|
114
106
|
}
|
|
115
|
-
|
|
116
|
-
.block-editor-block-mover-button {
|
|
117
|
-
overflow: hidden;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Extra specificity to override standard toolbar button styles.
|
|
121
|
-
.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.block-editor-block-mover-button {
|
|
122
|
-
min-width: $block-toolbar-height*0.5;
|
|
123
|
-
width: $block-toolbar-height*0.5;
|
|
124
|
-
|
|
125
|
-
svg {
|
|
126
|
-
min-width: $block-toolbar-height*0.5;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Position mover arrows for both toolbars.
|
|
132
|
-
.block-editor-block-contextual-toolbar .block-editor-block-mover:not(.is-horizontal) {
|
|
133
|
-
// Position SVGs.
|
|
134
|
-
.block-editor-block-mover-button {
|
|
135
|
-
&:focus::before {
|
|
136
|
-
left: 0 !important;
|
|
137
|
-
min-width: 0;
|
|
138
|
-
width: 100%;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
@include break-small() {
|
|
143
|
-
.block-editor-block-mover-button.is-up-button svg {
|
|
144
|
-
top: 5px;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.block-editor-block-mover-button.is-down-button svg {
|
|
148
|
-
bottom: 5px;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
107
|
}
|
|
152
108
|
|
|
153
109
|
/**
|
|
@@ -217,37 +173,6 @@
|
|
|
217
173
|
}
|
|
218
174
|
}
|
|
219
175
|
|
|
220
|
-
/**
|
|
221
|
-
* Popovers.
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
.block-editor-block-list__insertion-point-popover.is-without-arrow {
|
|
225
|
-
z-index: z-index(".block-editor-block-list__insertion-point-popover");
|
|
226
|
-
position: absolute;
|
|
227
|
-
pointer-events: none;
|
|
228
|
-
|
|
229
|
-
* {
|
|
230
|
-
pointer-events: none;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.is-with-inserter {
|
|
234
|
-
pointer-events: all;
|
|
235
|
-
|
|
236
|
-
* {
|
|
237
|
-
pointer-events: all;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.components-popover__content.components-popover__content {
|
|
242
|
-
// Needs specificity.
|
|
243
|
-
background: none;
|
|
244
|
-
border: none;
|
|
245
|
-
box-shadow: none;
|
|
246
|
-
overflow-y: visible;
|
|
247
|
-
margin-left: 0;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
176
|
// Hide the popover block editor list while dragging.
|
|
252
177
|
// Using a hacky animation to delay hiding the element.
|
|
253
178
|
// It's needed because if we hide the element immediately upon dragging,
|
|
@@ -262,33 +187,12 @@
|
|
|
262
187
|
}
|
|
263
188
|
|
|
264
189
|
.components-popover.block-editor-block-list__block-popover {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
margin:
|
|
270
|
-
|
|
271
|
-
width: max-content;
|
|
272
|
-
background: none;
|
|
273
|
-
border: none;
|
|
274
|
-
box-shadow: none;
|
|
275
|
-
overflow-y: visible;
|
|
276
|
-
|
|
277
|
-
// Allow clicking through the toolbar holder.
|
|
278
|
-
pointer-events: none;
|
|
279
|
-
|
|
280
|
-
.block-editor-block-list__block-selection-button,
|
|
281
|
-
.block-editor-block-contextual-toolbar,
|
|
282
|
-
.block-editor-block-list__empty-block-inserter {
|
|
283
|
-
pointer-events: all;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
// Position the block toolbar.
|
|
287
|
-
.block-editor-block-list__block-selection-button,
|
|
288
|
-
.block-editor-block-contextual-toolbar {
|
|
289
|
-
margin-top: $grid-unit-15;
|
|
290
|
-
margin-bottom: $grid-unit-15;
|
|
291
|
-
}
|
|
190
|
+
// Position the block toolbar.
|
|
191
|
+
.block-editor-block-list__block-selection-button,
|
|
192
|
+
.block-editor-block-contextual-toolbar {
|
|
193
|
+
pointer-events: all;
|
|
194
|
+
margin-top: $grid-unit-15;
|
|
195
|
+
margin-bottom: $grid-unit-15;
|
|
292
196
|
}
|
|
293
197
|
|
|
294
198
|
// Hide the block toolbar if the insertion point is shown.
|
|
@@ -307,30 +211,3 @@
|
|
|
307
211
|
.is-dragging-components-draggable .components-tooltip {
|
|
308
212
|
display: none;
|
|
309
213
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
// Size multiple sequential buttons to be optically balanced.
|
|
313
|
-
// Icons are 36px, as set by a 24px icon and 12px padding.
|
|
314
|
-
.block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot, // When a plugin adds to a slot, the segment has a `components-toolbar` class.
|
|
315
|
-
.block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar, // The nesting order is sometimes reversed.
|
|
316
|
-
.block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown, // Targets unique markup for the "Replace" button.
|
|
317
|
-
.block-editor-block-toolbar .components-toolbar-group {
|
|
318
|
-
padding-left: $grid-unit-15 * 0.5; // 6px.
|
|
319
|
-
padding-right: $grid-unit-15 * 0.5;
|
|
320
|
-
|
|
321
|
-
.components-button,
|
|
322
|
-
.components-button.has-icon.has-icon {
|
|
323
|
-
min-width: $block-toolbar-height - $grid-unit-15;
|
|
324
|
-
padding-left: $grid-unit-15 * 0.5; // 6px.
|
|
325
|
-
padding-right: $grid-unit-15 * 0.5;
|
|
326
|
-
|
|
327
|
-
svg {
|
|
328
|
-
min-width: $button-size-small; // This is the optimal icon size, and we size the whole button after this.
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
&::before {
|
|
332
|
-
left: 2px;
|
|
333
|
-
right: 2px;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
@@ -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
|
);
|
|
@@ -11,12 +11,14 @@
|
|
|
11
11
|
align-items: flex-start;
|
|
12
12
|
|
|
13
13
|
> .components-unit-control-wrapper {
|
|
14
|
-
width:
|
|
14
|
+
width: 110px;
|
|
15
15
|
margin-bottom: 0;
|
|
16
|
+
margin-right: #{ $grid-unit-15 };
|
|
17
|
+
flex-shrink: 0;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
.components-range-control {
|
|
19
|
-
|
|
21
|
+
flex: 1;
|
|
20
22
|
margin-bottom: 0;
|
|
21
23
|
|
|
22
24
|
.components-base-control__field {
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
width: 70%;
|
|
40
42
|
flex-wrap: wrap;
|
|
41
43
|
|
|
42
|
-
.components-
|
|
44
|
+
.components-border-radius-control__tooltip-wrapper {
|
|
43
45
|
width: calc(50% - #{ $grid-unit-10 });
|
|
44
46
|
margin-bottom: $grid-unit-10;
|
|
45
47
|
margin-right: $grid-unit-10;
|
|
@@ -49,6 +51,8 @@
|
|
|
49
51
|
.component-border-radius-control__linked-button.has-icon {
|
|
50
52
|
display: flex;
|
|
51
53
|
justify-content: center;
|
|
54
|
+
margin-left: 2px;
|
|
55
|
+
margin-top: 3px;
|
|
52
56
|
|
|
53
57
|
svg {
|
|
54
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;
|
|
@@ -7,12 +7,14 @@ import classnames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
__experimentalItem as Item,
|
|
12
|
-
__experimentalHStack as HStack,
|
|
13
|
-
FlexItem,
|
|
10
|
+
Button,
|
|
14
11
|
ColorIndicator,
|
|
15
12
|
Dropdown,
|
|
13
|
+
FlexItem,
|
|
14
|
+
__experimentalHStack as HStack,
|
|
15
|
+
__experimentalItem as Item,
|
|
16
|
+
__experimentalItemGroup as ItemGroup,
|
|
17
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
16
18
|
} from '@wordpress/components';
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -20,77 +22,169 @@ import {
|
|
|
20
22
|
*/
|
|
21
23
|
import ColorGradientControl from './control';
|
|
22
24
|
|
|
25
|
+
// Conditionally wraps the `ColorGradientSettingsDropdown` color controls in an
|
|
26
|
+
// `ItemGroup` allowing for a standalone group of controls to be
|
|
27
|
+
// rendered semantically.
|
|
28
|
+
const WithItemGroup = ( { __experimentalIsItemGroup, children } ) => {
|
|
29
|
+
if ( ! __experimentalIsItemGroup ) {
|
|
30
|
+
return children;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<ItemGroup
|
|
35
|
+
isBordered
|
|
36
|
+
isSeparated
|
|
37
|
+
className="block-editor-panel-color-gradient-settings__item-group"
|
|
38
|
+
>
|
|
39
|
+
{ children }
|
|
40
|
+
</ItemGroup>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// When the `ColorGradientSettingsDropdown` controls are being rendered to a
|
|
45
|
+
// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.
|
|
46
|
+
const WithToolsPanelItem = ( {
|
|
47
|
+
__experimentalIsItemGroup,
|
|
48
|
+
settings,
|
|
49
|
+
children,
|
|
50
|
+
...props
|
|
51
|
+
} ) => {
|
|
52
|
+
if ( __experimentalIsItemGroup ) {
|
|
53
|
+
return children;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<ToolsPanelItem
|
|
58
|
+
hasValue={ settings.hasValue }
|
|
59
|
+
label={ settings.label }
|
|
60
|
+
onDeselect={ settings.onDeselect }
|
|
61
|
+
isShownByDefault={ settings.isShownByDefault }
|
|
62
|
+
resetAllFilter={ settings.resetAllFilter }
|
|
63
|
+
{ ...props }
|
|
64
|
+
className="block-editor-tools-panel-color-gradient-settings__item"
|
|
65
|
+
>
|
|
66
|
+
{ children }
|
|
67
|
+
</ToolsPanelItem>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const LabeledColorIndicator = ( { colorValue, label } ) => (
|
|
72
|
+
<HStack justify="flex-start">
|
|
73
|
+
<ColorIndicator
|
|
74
|
+
className="block-editor-panel-color-gradient-settings__color-indicator"
|
|
75
|
+
colorValue={ colorValue }
|
|
76
|
+
/>
|
|
77
|
+
<FlexItem>{ label }</FlexItem>
|
|
78
|
+
</HStack>
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
// Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`
|
|
82
|
+
// or as a `Button` if it isn't e.g. the controls are being rendered in
|
|
83
|
+
// a `ToolsPanel`.
|
|
84
|
+
const renderToggle = ( settings ) => ( { onToggle, isOpen } ) => {
|
|
85
|
+
const { __experimentalIsItemGroup, colorValue, label } = settings;
|
|
86
|
+
|
|
87
|
+
// Determine component, `Item` or `Button`, to wrap color indicator with.
|
|
88
|
+
const ToggleComponent = __experimentalIsItemGroup ? Item : Button;
|
|
89
|
+
const toggleClassName = __experimentalIsItemGroup
|
|
90
|
+
? 'block-editor-panel-color-gradient-settings__item'
|
|
91
|
+
: 'block-editor-panel-color-gradient-settings__dropdown';
|
|
92
|
+
const toggleProps = {
|
|
93
|
+
onClick: onToggle,
|
|
94
|
+
className: classnames( toggleClassName, { 'is-open': isOpen } ),
|
|
95
|
+
'aria-expanded': __experimentalIsItemGroup ? undefined : isOpen,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<ToggleComponent { ...toggleProps }>
|
|
100
|
+
<LabeledColorIndicator colorValue={ colorValue } label={ label } />
|
|
101
|
+
</ToggleComponent>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// Renders a collection of color controls as dropdowns. Depending upon the
|
|
106
|
+
// context in which these dropdowns are being rendered, they may be wrapped
|
|
107
|
+
// in an `ItemGroup` with each dropdown's toggle as an `Item`, or alternatively,
|
|
108
|
+
// the may be individually wrapped in a `ToolsPanelItem` with the toggle as
|
|
109
|
+
// a regular `Button`.
|
|
110
|
+
//
|
|
111
|
+
// For more context see: https://github.com/WordPress/gutenberg/pull/40084
|
|
23
112
|
export default function ColorGradientSettingsDropdown( {
|
|
24
113
|
colors,
|
|
25
|
-
gradients,
|
|
26
114
|
disableCustomColors,
|
|
27
115
|
disableCustomGradients,
|
|
28
|
-
__experimentalHasMultipleOrigins,
|
|
29
|
-
__experimentalIsRenderedInSidebar,
|
|
30
116
|
enableAlpha,
|
|
117
|
+
gradients,
|
|
118
|
+
__experimentalIsItemGroup = true,
|
|
31
119
|
settings,
|
|
120
|
+
__experimentalHasMultipleOrigins,
|
|
121
|
+
__experimentalIsRenderedInSidebar,
|
|
122
|
+
...props
|
|
32
123
|
} ) {
|
|
33
|
-
|
|
124
|
+
const dropdownClassName = __experimentalIsItemGroup
|
|
125
|
+
? 'block-editor-panel-color-gradient-settings__dropdown'
|
|
126
|
+
: 'block-editor-tools-panel-color-gradient-settings__dropdown';
|
|
127
|
+
let popoverProps;
|
|
34
128
|
if ( __experimentalIsRenderedInSidebar ) {
|
|
35
|
-
|
|
129
|
+
popoverProps = {
|
|
130
|
+
placement: 'left-start',
|
|
131
|
+
offset: 36,
|
|
132
|
+
};
|
|
36
133
|
}
|
|
37
134
|
|
|
38
135
|
return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
136
|
+
// Only wrap with `ItemGroup` if these controls are being rendered
|
|
137
|
+
// semantically.
|
|
138
|
+
<WithItemGroup __experimentalIsItemGroup={ __experimentalIsItemGroup }>
|
|
139
|
+
{ settings.map( ( setting, index ) => {
|
|
140
|
+
const controlProps = {
|
|
141
|
+
clearable: __experimentalIsItemGroup ? undefined : false,
|
|
142
|
+
colorValue: setting.colorValue,
|
|
143
|
+
colors,
|
|
144
|
+
disableCustomColors,
|
|
145
|
+
disableCustomGradients,
|
|
146
|
+
enableAlpha,
|
|
147
|
+
gradientValue: setting.gradientValue,
|
|
148
|
+
gradients,
|
|
149
|
+
label: setting.label,
|
|
150
|
+
onColorChange: setting.onColorChange,
|
|
151
|
+
onGradientChange: setting.onGradientChange,
|
|
152
|
+
showTitle: false,
|
|
153
|
+
__experimentalHasMultipleOrigins,
|
|
154
|
+
__experimentalIsRenderedInSidebar,
|
|
155
|
+
...setting,
|
|
156
|
+
};
|
|
157
|
+
const toggleSettings = {
|
|
158
|
+
colorValue: setting.gradientValue ?? setting.colorValue,
|
|
159
|
+
__experimentalIsItemGroup,
|
|
160
|
+
label: setting.label,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
return (
|
|
46
164
|
setting && (
|
|
47
|
-
|
|
165
|
+
// If not in an `ItemGroup` wrap the dropdown in a
|
|
166
|
+
// `ToolsPanelItem`
|
|
167
|
+
<WithToolsPanelItem
|
|
48
168
|
key={ index }
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
setting.gradientValue ??
|
|
66
|
-
setting.colorValue
|
|
67
|
-
}
|
|
68
|
-
/>
|
|
69
|
-
<FlexItem>
|
|
70
|
-
{ setting.label }
|
|
71
|
-
</FlexItem>
|
|
72
|
-
</HStack>
|
|
73
|
-
</Item>
|
|
74
|
-
);
|
|
75
|
-
} }
|
|
76
|
-
renderContent={ () => (
|
|
77
|
-
<ColorGradientControl
|
|
78
|
-
showTitle={ false }
|
|
79
|
-
{ ...{
|
|
80
|
-
colors,
|
|
81
|
-
gradients,
|
|
82
|
-
disableCustomColors,
|
|
83
|
-
disableCustomGradients,
|
|
84
|
-
__experimentalHasMultipleOrigins,
|
|
85
|
-
__experimentalIsRenderedInSidebar,
|
|
86
|
-
enableAlpha,
|
|
87
|
-
...setting,
|
|
88
|
-
} }
|
|
89
|
-
/>
|
|
90
|
-
) }
|
|
91
|
-
/>
|
|
169
|
+
__experimentalIsItemGroup={
|
|
170
|
+
__experimentalIsItemGroup
|
|
171
|
+
}
|
|
172
|
+
settings={ setting }
|
|
173
|
+
{ ...props }
|
|
174
|
+
>
|
|
175
|
+
<Dropdown
|
|
176
|
+
popoverProps={ popoverProps }
|
|
177
|
+
className={ dropdownClassName }
|
|
178
|
+
contentClassName="block-editor-panel-color-gradient-settings__dropdown-content"
|
|
179
|
+
renderToggle={ renderToggle( toggleSettings ) }
|
|
180
|
+
renderContent={ () => (
|
|
181
|
+
<ColorGradientControl { ...controlProps } />
|
|
182
|
+
) }
|
|
183
|
+
/>
|
|
184
|
+
</WithToolsPanelItem>
|
|
92
185
|
)
|
|
93
|
-
|
|
94
|
-
|
|
186
|
+
);
|
|
187
|
+
} ) }
|
|
188
|
+
</WithItemGroup>
|
|
95
189
|
);
|
|
96
190
|
}
|
|
@@ -59,25 +59,7 @@
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content {
|
|
62
|
-
|
|
63
|
-
width: $sidebar-width;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@include break-medium() {
|
|
68
|
-
.block-editor-panel-color-gradient-settings__dropdown-content {
|
|
69
|
-
.components-popover__content {
|
|
70
|
-
margin-right: #{ math.div($sidebar-width, 2) + $grid-unit-20 } !important;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&.is-from-top .components-popover__content {
|
|
74
|
-
margin-top: #{ -($grid-unit-60 + $grid-unit-15) } !important;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&.is-from-bottom .components-popover__content {
|
|
78
|
-
margin-bottom: #{ -($grid-unit-60 + $grid-unit-15) } !important;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
62
|
+
width: $sidebar-width;
|
|
81
63
|
}
|
|
82
64
|
|
|
83
65
|
.block-editor-panel-color-gradient-settings__dropdown:last-child > div {
|
|
@@ -87,10 +69,6 @@
|
|
|
87
69
|
.block-editor-panel-color-gradient-settings__item {
|
|
88
70
|
padding-top: $grid-unit-15 !important;
|
|
89
71
|
padding-bottom: $grid-unit-15 !important;
|
|
90
|
-
.block-editor-panel-color-gradient-settings__color-indicator {
|
|
91
|
-
// Show a diagonal line (crossed out) for empty swatches.
|
|
92
|
-
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
93
|
-
}
|
|
94
72
|
|
|
95
73
|
&.is-open {
|
|
96
74
|
background: $gray-100;
|
|
@@ -98,3 +76,53 @@
|
|
|
98
76
|
}
|
|
99
77
|
}
|
|
100
78
|
|
|
79
|
+
.block-editor-panel-color-gradient-settings__color-indicator {
|
|
80
|
+
// Show a diagonal line (crossed out) for empty swatches.
|
|
81
|
+
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The following styles replicate the separated border of the
|
|
86
|
+
* `ItemGroup` component but allows for hidden items. This is because
|
|
87
|
+
* to maintain the order of `ToolsPanel` controls, each `ToolsPanelItem`
|
|
88
|
+
* must at least render a placeholder which would otherwise interfere
|
|
89
|
+
* with the `:last-child` styles.
|
|
90
|
+
*/
|
|
91
|
+
.block-editor-tools-panel-color-gradient-settings__item {
|
|
92
|
+
padding: 0;
|
|
93
|
+
|
|
94
|
+
// Border styles.
|
|
95
|
+
border-left: 1px solid rgba(0, 0, 0, 0.1);
|
|
96
|
+
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
97
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
98
|
+
|
|
99
|
+
&.first {
|
|
100
|
+
border-top-left-radius: 2px;
|
|
101
|
+
border-top-right-radius: 2px;
|
|
102
|
+
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.last {
|
|
106
|
+
border-bottom-left-radius: 2px;
|
|
107
|
+
border-bottom-right-radius: 2px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
> div,
|
|
111
|
+
> div > button {
|
|
112
|
+
border-radius: inherit;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.block-editor-tools-panel-color-gradient-settings__dropdown {
|
|
117
|
+
display: block;
|
|
118
|
+
padding: 0;
|
|
119
|
+
|
|
120
|
+
> button {
|
|
121
|
+
height: 46px;
|
|
122
|
+
|
|
123
|
+
&.is-open {
|
|
124
|
+
background: $gray-100;
|
|
125
|
+
color: var(--wp-admin-theme-color);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -34,8 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
// The black plus that shows up on the right side of an empty paragraph block, or the initial appender
|
|
36
36
|
// that exists only on empty documents.
|
|
37
|
-
.block-editor-default-block-appender .block-editor-inserter
|
|
38
|
-
.block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter { // This needs specificity to override inherited popover styles.
|
|
37
|
+
.block-editor-default-block-appender .block-editor-inserter {
|
|
39
38
|
position: absolute;
|
|
40
39
|
top: 0;
|
|
41
40
|
right: 0;
|
|
@@ -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 { Icon, filter } from '@wordpress/icons';
|
|
13
14
|
|
|
14
15
|
function DuotoneControl( {
|
|
15
16
|
colorPalette,
|
|
@@ -41,7 +42,13 @@ function DuotoneControl( {
|
|
|
41
42
|
aria-expanded={ isOpen }
|
|
42
43
|
onKeyDown={ openOnArrowDown }
|
|
43
44
|
label={ __( 'Apply duotone filter' ) }
|
|
44
|
-
icon={
|
|
45
|
+
icon={
|
|
46
|
+
value ? (
|
|
47
|
+
<DuotoneSwatch values={ value } />
|
|
48
|
+
) : (
|
|
49
|
+
<Icon icon={ filter } />
|
|
50
|
+
)
|
|
51
|
+
}
|
|
45
52
|
/>
|
|
46
53
|
);
|
|
47
54
|
} }
|