@wordpress/block-editor 13.4.0 → 14.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 +13 -0
- package/README.md +20 -15
- package/build/autocompleters/block.js +1 -1
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +3 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-draggable/index.js +2 -2
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +2 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +24 -32
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +11 -4
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-mover/index.js +1 -2
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-popover/cover.js +1 -1
- package/build/components/block-popover/cover.js.map +1 -1
- package/build/components/block-popover/inbetween.js +2 -2
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +2 -2
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +28 -34
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +1 -2
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +1 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +14 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +2 -1
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +22 -19
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js +0 -1
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build/components/border-radius-control/index.js +1 -0
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +3 -1
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +1 -1
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +2 -0
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +1 -0
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/font-appearance-control/index.js +3 -0
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +15 -0
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +153 -77
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +3 -1
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/hooks.js +0 -7
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +1 -0
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/index.js +0 -6
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +0 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +59 -40
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +80 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +30 -26
- package/build/components/grid/grid-item-movers.js.map +1 -1
- package/build/components/grid/grid-item-resizer.js +14 -15
- package/build/components/grid/grid-item-resizer.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +21 -6
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +56 -20
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/height-control/index.js +1 -0
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/iframe/index.js +2 -4
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +11 -7
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +8 -8
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +7 -25
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +9 -11
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +29 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/library.js +4 -2
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +32 -14
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +4 -0
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/line-height-control/index.js +3 -15
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +0 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/media-placeholder/index.js +9 -4
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +3 -1
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +4 -1
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +12 -12
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/resolution-tool/index.js +1 -0
- package/build/components/resolution-tool/index.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +4 -2
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +8 -8
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/text-alignment-control/index.js +13 -8
- package/build/components/text-alignment-control/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +13 -8
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +13 -8
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/url-input/button.js +0 -1
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +1 -11
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -0
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/link-editor.js +0 -1
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +42 -4
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +3 -6
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +1 -3
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +2 -1
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-mode-control/index.js +13 -8
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/background.js +19 -23
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-bindings.js +209 -39
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/block-hooks.js +1 -0
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +2 -2
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/contrast-checker.js +6 -6
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/duotone.js +3 -3
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +7 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/line-height.js +0 -1
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/spacing-visualizer.js +1 -1
- package/build/hooks/spacing-visualizer.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +4 -0
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/use-zoom-out.js +1 -1
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +20 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/layouts/constrained.js +1 -0
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +2 -0
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/grid.js +3 -0
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +3 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +9 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js +30 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +10 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +4 -4
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-bindings.js +112 -0
- package/build/utils/block-bindings.js.map +1 -0
- package/build/utils/get-editor-region.js +1 -1
- package/build/utils/get-editor-region.js.map +1 -1
- package/build/utils/get-px-from-css-unit.js +1 -1
- package/build/utils/get-px-from-css-unit.js.map +1 -1
- package/build-module/autocompleters/block.js +1 -1
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +4 -2
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +3 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +2 -2
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-refs.js +24 -34
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +11 -4
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-mover/index.js +1 -2
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-popover/cover.js +1 -1
- package/build-module/components/block-popover/cover.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +1 -1
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +1 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.js +29 -34
- package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +1 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +1 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +14 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +2 -1
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +23 -20
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +0 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +1 -0
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +3 -1
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +1 -1
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +2 -0
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +1 -0
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +3 -0
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +14 -0
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +156 -80
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +3 -1
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +0 -6
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +1 -0
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +0 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +61 -42
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +77 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +30 -26
- package/build-module/components/grid/grid-item-movers.js.map +1 -1
- package/build-module/components/grid/grid-item-resizer.js +14 -15
- package/build-module/components/grid/grid-item-resizer.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +21 -6
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +56 -20
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/height-control/index.js +1 -0
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +2 -4
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +12 -8
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +7 -6
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +6 -23
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +9 -11
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +30 -3
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/library.js +4 -2
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +32 -14
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +5 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/line-height-control/index.js +3 -14
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +0 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +9 -4
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +3 -1
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +4 -1
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +12 -12
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/resolution-tool/index.js +1 -0
- package/build-module/components/resolution-tool/index.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +5 -3
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +8 -8
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/text-alignment-control/index.js +13 -8
- package/build-module/components/text-alignment-control/index.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +13 -8
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +13 -8
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/url-input/button.js +0 -1
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -11
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +2 -0
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +0 -1
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +42 -4
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +3 -6
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +1 -3
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +2 -1
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +13 -8
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/background.js +19 -23
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-bindings.js +214 -43
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/block-hooks.js +1 -0
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +3 -3
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/contrast-checker.js +7 -7
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/duotone.js +4 -4
- package/build-module/hooks/duotone.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/line-height.js +0 -1
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/spacing-visualizer.js +1 -1
- package/build-module/hooks/spacing-visualizer.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +3 -0
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +1 -1
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +19 -0
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/constrained.js +1 -0
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +2 -0
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/grid.js +3 -0
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +4 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +9 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js +27 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +9 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +4 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-bindings.js +105 -0
- package/build-module/utils/block-bindings.js.map +1 -0
- package/build-module/utils/get-editor-region.js +1 -1
- package/build-module/utils/get-editor-region.js.map +1 -1
- package/build-module/utils/get-px-from-css-unit.js +1 -1
- package/build-module/utils/get-px-from-css-unit.js.map +1 -1
- package/build-style/content-rtl.css +12 -26
- package/build-style/content.css +12 -26
- package/build-style/default-editor-styles-rtl.css +5 -2
- package/build-style/default-editor-styles.css +5 -2
- package/build-style/style-rtl.css +123 -83
- package/build-style/style.css +123 -83
- package/package.json +32 -32
- package/src/autocompleters/block.js +2 -1
- package/src/autocompleters/style.scss +4 -0
- package/src/components/block-breadcrumb/index.js +4 -2
- package/src/components/block-canvas/style.scss +1 -0
- package/src/components/block-draggable/index.js +3 -3
- package/src/components/block-list/content.scss +5 -13
- package/src/components/block-list/use-block-props/index.js +2 -2
- package/src/components/block-list/use-block-props/use-block-refs.js +27 -43
- package/src/components/block-list/use-in-between-inserter.js +17 -5
- package/src/components/block-mover/index.js +5 -2
- package/src/components/block-popover/cover.js +1 -1
- package/src/components/block-popover/inbetween.js +1 -1
- package/src/components/block-popover/index.js +1 -1
- package/src/components/block-settings-menu/block-mode-toggle.js +28 -31
- package/src/components/block-settings-menu/test/block-mode-toggle.js +26 -23
- package/src/components/block-tools/block-selection-button.js +1 -2
- package/src/components/block-tools/index.js +5 -6
- package/src/components/block-tools/insertion-point.js +11 -0
- package/src/components/block-tools/style.scss +1 -1
- package/src/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/src/components/block-tools/use-show-block-tools.js +4 -1
- package/src/components/block-tools/zoom-out-mode-inserters.js +21 -19
- package/src/components/block-tools/zoom-out-toolbar.js +0 -1
- package/src/components/block-variation-transforms/style.scss +1 -1
- package/src/components/border-radius-control/index.js +1 -0
- package/src/components/border-radius-control/style.scss +0 -10
- package/src/components/button-block-appender/content.scss +1 -1
- package/src/components/child-layout-control/index.js +2 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
- package/src/components/colors-gradients/test/control.js +3 -2
- package/src/components/convert-to-group-buttons/index.js +1 -1
- package/src/components/date-format-picker/index.js +2 -0
- package/src/components/dimensions-tool/scale-tool.js +1 -0
- package/src/components/font-appearance-control/index.js +3 -0
- package/src/components/font-family/README.md +17 -0
- package/src/components/font-family/index.js +19 -0
- package/src/components/font-family/stories/index.story.js +54 -0
- package/src/components/global-styles/background-panel.js +180 -93
- package/src/components/global-styles/get-global-styles-changes.js +4 -1
- package/src/components/global-styles/hooks.js +0 -5
- package/src/components/global-styles/image-settings-panel.js +1 -0
- package/src/components/global-styles/index.js +0 -1
- package/src/components/global-styles/style.scss +13 -12
- package/src/components/global-styles/test/use-global-styles-output.js +68 -7
- package/src/components/global-styles/test/utils.js +120 -0
- package/src/components/global-styles/typography-panel.js +0 -1
- package/src/components/global-styles/use-global-styles-output.js +71 -53
- package/src/components/global-styles/utils.js +90 -0
- package/src/components/grid/grid-item-movers.js +46 -44
- package/src/components/grid/grid-item-resizer.js +11 -17
- package/src/components/grid/grid-visualizer.js +23 -8
- package/src/components/grid/style.scss +60 -10
- package/src/components/grid/use-grid-layout-sync.js +68 -14
- package/src/components/height-control/index.js +1 -0
- package/src/components/iframe/content.scss +2 -2
- package/src/components/iframe/index.js +1 -3
- package/src/components/image-editor/zoom-dropdown.js +17 -9
- package/src/components/inner-blocks/button-block-appender.js +5 -7
- package/src/components/inner-blocks/default-block-appender.js +4 -23
- package/src/components/inner-blocks/index.js +10 -9
- package/src/components/inserter/category-tabs/index.js +35 -2
- package/src/components/inserter/library.js +2 -0
- package/src/components/inserter/menu.js +34 -29
- package/src/components/inserter/quick-inserter.js +4 -1
- package/src/components/inserter/style.scss +17 -12
- package/src/components/inserter-list-item/style.scss +1 -0
- package/src/components/inspector-controls/README.md +5 -0
- package/src/components/line-height-control/README.md +4 -5
- package/src/components/line-height-control/index.js +4 -21
- package/src/components/line-height-control/stories/index.story.js +0 -1
- package/src/components/line-height-control/test/index.js +1 -7
- package/src/components/link-control/search-input.js +0 -1
- package/src/components/link-control/style.scss +1 -1
- package/src/components/media-placeholder/index.js +12 -7
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +3 -1
- package/src/components/media-upload/README.md +2 -0
- package/src/components/media-upload/index.native.js +2 -0
- package/src/components/multi-selection-inspector/index.js +8 -9
- package/src/components/resolution-tool/index.js +1 -0
- package/src/components/responsive-block-control/README.md +1 -0
- package/src/components/responsive-block-control/test/index.js +6 -1
- package/src/components/skip-to-selected-block/index.js +5 -3
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +11 -10
- package/src/components/spacing-sizes-control/style.scss +16 -16
- package/src/components/tabbed-sidebar/style.scss +1 -19
- package/src/components/text-alignment-control/index.js +20 -8
- package/src/components/text-decoration-control/index.js +20 -8
- package/src/components/text-decoration-control/stories/index.story.js +0 -4
- package/src/components/text-transform-control/index.js +20 -8
- package/src/components/text-transform-control/stories/index.story.js +0 -4
- package/src/components/url-input/README.md +0 -5
- package/src/components/url-input/button.js +0 -1
- package/src/components/url-input/index.js +1 -15
- package/src/components/url-input/style.scss +2 -2
- package/src/components/url-popover/image-url-input-ui.js +2 -0
- package/src/components/url-popover/link-editor.js +0 -1
- package/src/components/use-block-drop-zone/index.js +86 -16
- package/src/components/use-on-block-drop/index.js +1 -9
- package/src/components/use-resize-canvas/index.js +1 -3
- package/src/components/use-settings/index.js +2 -1
- package/src/components/writing-mode-control/index.js +20 -8
- package/src/hooks/background.js +21 -27
- package/src/hooks/block-bindings.js +248 -54
- package/src/hooks/block-bindings.scss +13 -2
- package/src/hooks/block-hooks.js +1 -0
- package/src/hooks/block-hooks.scss +1 -0
- package/src/hooks/block-style-variation.js +3 -3
- package/src/hooks/contrast-checker.js +7 -7
- package/src/hooks/duotone.js +4 -4
- package/src/hooks/index.js +2 -1
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/spacing-visualizer.js +1 -1
- package/src/hooks/test/background.js +60 -0
- package/src/hooks/use-bindings-attributes.js +4 -0
- package/src/hooks/use-editor-wrapper-styles.native.scss +1 -0
- package/src/hooks/use-zoom-out.js +1 -1
- package/src/hooks/utils.js +14 -1
- package/src/index.js +1 -0
- package/src/layouts/constrained.js +1 -0
- package/src/layouts/flex.js +2 -0
- package/src/layouts/grid.js +3 -0
- package/src/private-apis.js +3 -2
- package/src/store/actions.js +13 -5
- package/src/store/private-selectors.js +36 -0
- package/src/store/reducer.js +7 -0
- package/src/store/selectors.js +4 -4
- package/src/store/test/private-selectors.js +89 -0
- package/src/style.scss +1 -2
- package/src/utils/block-bindings.js +98 -0
- package/src/utils/get-editor-region.js +1 -1
- package/src/utils/get-px-from-css-unit.js +1 -1
- package/src/utils/test/transform-styles.js +49 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/global-styles/theme-file-uri-utils.js +0 -80
- package/build/components/global-styles/theme-file-uri-utils.js.map +0 -1
- package/build/components/inner-blocks/with-client-id.js +0 -28
- package/build/components/inner-blocks/with-client-id.js.map +0 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -30
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +0 -1
- package/build/components/segmented-text-control/index.js +0 -63
- package/build/components/segmented-text-control/index.js.map +0 -1
- package/build-module/components/global-styles/theme-file-uri-utils.js +0 -73
- package/build-module/components/global-styles/theme-file-uri-utils.js.map +0 -1
- package/build-module/components/inner-blocks/with-client-id.js +0 -21
- package/build-module/components/inner-blocks/with-client-id.js.map +0 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -23
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +0 -1
- package/build-module/components/segmented-text-control/index.js +0 -58
- package/build-module/components/segmented-text-control/index.js.map +0 -1
- package/src/components/global-styles/test/theme-file-uri-utils.js +0 -66
- package/src/components/global-styles/theme-file-uri-utils.js +0 -77
- package/src/components/inner-blocks/with-client-id.js +0 -19
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -25
- package/src/components/segmented-text-control/index.js +0 -63
- package/src/components/segmented-text-control/style.scss +0 -15
|
@@ -64,6 +64,7 @@ registerBlockType( 'my-plugin/my-block', {
|
|
|
64
64
|
const paddingControl = ( labelComponent, viewport ) => {
|
|
65
65
|
return (
|
|
66
66
|
<DimensionControl
|
|
67
|
+
__nextHasNoMarginBottom
|
|
67
68
|
label={ viewport.label }
|
|
68
69
|
onChange={ // handle update to padding value here }
|
|
69
70
|
value={ paddingSize }
|
|
@@ -39,7 +39,12 @@ const sizeOptions = [
|
|
|
39
39
|
const renderTestDefaultControlComponent = ( labelComponent, device ) => {
|
|
40
40
|
return (
|
|
41
41
|
<>
|
|
42
|
-
<SelectControl
|
|
42
|
+
<SelectControl
|
|
43
|
+
__next40pxDefaultSize
|
|
44
|
+
label={ labelComponent }
|
|
45
|
+
options={ sizeOptions }
|
|
46
|
+
__nextHasNoMarginBottom
|
|
47
|
+
/>
|
|
43
48
|
<p id={ device.id }>
|
|
44
49
|
{ device.label } is used here for testing purposes to ensure we
|
|
45
50
|
have access to details about the device.
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
import { Button } from '@wordpress/components';
|
|
7
|
+
import { useRef } from '@wordpress/element';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Internal dependencies
|
|
10
11
|
*/
|
|
11
12
|
import { store as blockEditorStore } from '../../store';
|
|
12
|
-
import {
|
|
13
|
+
import { useBlockElementRef } from '../block-list/use-block-props/use-block-refs';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/skip-to-selected-block/README.md
|
|
@@ -19,9 +20,10 @@ export default function SkipToSelectedBlock() {
|
|
|
19
20
|
( select ) => select( blockEditorStore ).getBlockSelectionStart(),
|
|
20
21
|
[]
|
|
21
22
|
);
|
|
22
|
-
const ref =
|
|
23
|
+
const ref = useRef();
|
|
24
|
+
useBlockElementRef( selectedBlockClientId, ref );
|
|
23
25
|
const onClick = () => {
|
|
24
|
-
ref.current
|
|
26
|
+
ref.current?.focus();
|
|
25
27
|
};
|
|
26
28
|
|
|
27
29
|
return selectedBlockClientId ? (
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
__experimentalUnitControl as UnitControl,
|
|
10
10
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
11
11
|
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
|
|
12
|
-
|
|
12
|
+
CustomSelectControl,
|
|
13
13
|
} from '@wordpress/components';
|
|
14
14
|
import { useSelect } from '@wordpress/data';
|
|
15
15
|
import { useState, useMemo } from '@wordpress/element';
|
|
@@ -31,11 +31,6 @@ import {
|
|
|
31
31
|
getPresetValueFromCustomValue,
|
|
32
32
|
isValueSpacingPreset,
|
|
33
33
|
} from '../utils';
|
|
34
|
-
import { unlock } from '../../../lock-unlock';
|
|
35
|
-
|
|
36
|
-
const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
|
|
37
|
-
componentsPrivateApis
|
|
38
|
-
);
|
|
39
34
|
|
|
40
35
|
const CUSTOM_VALUE_SETTINGS = {
|
|
41
36
|
px: { max: 300, steps: 1 },
|
|
@@ -193,10 +188,12 @@ export default function SpacingInputControl( {
|
|
|
193
188
|
name: size.name,
|
|
194
189
|
} ) );
|
|
195
190
|
|
|
196
|
-
const marks = spacingSizes
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
191
|
+
const marks = spacingSizes
|
|
192
|
+
.slice( 1, spacingSizes.length - 1 )
|
|
193
|
+
.map( ( _newValue, index ) => ( {
|
|
194
|
+
value: index + 1,
|
|
195
|
+
label: undefined,
|
|
196
|
+
} ) );
|
|
200
197
|
|
|
201
198
|
const sideLabel =
|
|
202
199
|
ALL_SIDES.includes( side ) && showSideInLabel ? LABELS[ side ] : '';
|
|
@@ -252,6 +249,7 @@ export default function SpacingInputControl( {
|
|
|
252
249
|
} }
|
|
253
250
|
/>
|
|
254
251
|
<RangeControl
|
|
252
|
+
__next40pxDefaultSize
|
|
255
253
|
onMouseOver={ onMouseOver }
|
|
256
254
|
onMouseOut={ onMouseOut }
|
|
257
255
|
onFocus={ onMouseOver }
|
|
@@ -266,11 +264,14 @@ export default function SpacingInputControl( {
|
|
|
266
264
|
onChange={ handleCustomValueSliderChange }
|
|
267
265
|
className="spacing-sizes-control__custom-value-range"
|
|
268
266
|
__nextHasNoMarginBottom
|
|
267
|
+
label={ ariaLabel }
|
|
268
|
+
hideLabelFromVision
|
|
269
269
|
/>
|
|
270
270
|
</>
|
|
271
271
|
) }
|
|
272
272
|
{ showRangeControl && ! showCustomValueControl && (
|
|
273
273
|
<RangeControl
|
|
274
|
+
__next40pxDefaultSize
|
|
274
275
|
onMouseOver={ onMouseOver }
|
|
275
276
|
onMouseOut={ onMouseOut }
|
|
276
277
|
className="spacing-sizes-control__range-control"
|
|
@@ -4,34 +4,34 @@
|
|
|
4
4
|
margin-bottom: 0;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
.is-marked {
|
|
8
|
+
.components-range-control__track {
|
|
9
|
+
transition: width ease 0.1s;
|
|
10
|
+
@include reduce-motion("transition");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.components-range-control__thumb-wrapper {
|
|
14
|
+
transition: left ease 0.1s;
|
|
15
|
+
@include reduce-motion("transition");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
7
19
|
.spacing-sizes-control__range-control,
|
|
8
20
|
.spacing-sizes-control__custom-value-range {
|
|
9
|
-
height: 40px;
|
|
10
|
-
/* Vertically center the RangeControl until it has true 40px height. */
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
margin-bottom: 0;
|
|
14
21
|
flex: 1;
|
|
15
|
-
|
|
16
|
-
> .components-base-control__field {
|
|
17
|
-
/* Fixes RangeControl contents when the outer wrapper is flex */
|
|
18
|
-
flex: 1;
|
|
19
|
-
}
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
.components-range-control__mark {
|
|
25
|
+
transform: translateX(-50%);
|
|
23
26
|
height: $grid-unit-05;
|
|
24
|
-
width:
|
|
25
|
-
background-color:
|
|
27
|
+
width: math.div($grid-unit-05, 2);
|
|
28
|
+
background-color: $white;
|
|
26
29
|
z-index: 1;
|
|
30
|
+
top: -#{$grid-unit-05};
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
.components-range-control__marks {
|
|
30
34
|
margin-top: 17px;
|
|
31
|
-
|
|
32
|
-
:first-child {
|
|
33
|
-
display: none;
|
|
34
|
-
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.components-range-control__thumb-wrapper {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
.block-editor-tabbed-sidebar {
|
|
2
|
+
background-color: $white;
|
|
2
3
|
height: 100%;
|
|
3
4
|
display: flex;
|
|
4
5
|
flex-direction: column;
|
|
5
6
|
flex-grow: 1;
|
|
6
7
|
overflow: hidden;
|
|
7
|
-
|
|
8
|
-
@include break-medium() {
|
|
9
|
-
width: 350px;
|
|
10
|
-
}
|
|
11
8
|
}
|
|
12
9
|
|
|
13
10
|
.block-editor-tabbed-sidebar__tablist-and-close-button {
|
|
@@ -26,22 +23,7 @@
|
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
.block-editor-tabbed-sidebar__tablist {
|
|
29
|
-
box-sizing: border-box;
|
|
30
|
-
flex-grow: 1;
|
|
31
26
|
margin-bottom: -$border-width;
|
|
32
|
-
width: 100%;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.block-editor-tabbed-sidebar__tab {
|
|
36
|
-
flex-grow: 1;
|
|
37
|
-
margin-bottom: -$border-width;
|
|
38
|
-
|
|
39
|
-
&[id$="reusable"] {
|
|
40
|
-
flex-grow: inherit;
|
|
41
|
-
// These are to align the `reusable` icon with the search icon.
|
|
42
|
-
padding-left: $grid-unit-20;
|
|
43
|
-
padding-right: $grid-unit-20;
|
|
44
|
-
}
|
|
45
27
|
}
|
|
46
28
|
|
|
47
29
|
.block-editor-tabbed-sidebar__tabpanel {
|
|
@@ -14,11 +14,10 @@ import {
|
|
|
14
14
|
alignJustify,
|
|
15
15
|
} from '@wordpress/icons';
|
|
16
16
|
import { useMemo } from '@wordpress/element';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import SegmentedTextControl from '../segmented-text-control';
|
|
17
|
+
import {
|
|
18
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
19
|
+
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
20
|
+
} from '@wordpress/components';
|
|
22
21
|
|
|
23
22
|
const TEXT_ALIGNMENT_OPTIONS = [
|
|
24
23
|
{
|
|
@@ -75,9 +74,11 @@ export default function TextAlignmentControl( {
|
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
return (
|
|
78
|
-
<
|
|
77
|
+
<ToggleGroupControl
|
|
78
|
+
isDeselectable
|
|
79
|
+
__nextHasNoMarginBottom
|
|
80
|
+
__next40pxDefaultSize
|
|
79
81
|
label={ __( 'Text alignment' ) }
|
|
80
|
-
options={ validOptions }
|
|
81
82
|
className={ clsx(
|
|
82
83
|
'block-editor-text-alignment-control',
|
|
83
84
|
className
|
|
@@ -86,6 +87,17 @@ export default function TextAlignmentControl( {
|
|
|
86
87
|
onChange={ ( newValue ) => {
|
|
87
88
|
onChange( newValue === value ? undefined : newValue );
|
|
88
89
|
} }
|
|
89
|
-
|
|
90
|
+
>
|
|
91
|
+
{ validOptions.map( ( option ) => {
|
|
92
|
+
return (
|
|
93
|
+
<ToggleGroupControlOptionIcon
|
|
94
|
+
key={ option.value }
|
|
95
|
+
value={ option.value }
|
|
96
|
+
icon={ option.icon }
|
|
97
|
+
label={ option.label }
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
} ) }
|
|
101
|
+
</ToggleGroupControl>
|
|
90
102
|
);
|
|
91
103
|
}
|
|
@@ -8,11 +8,10 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { reset, formatStrikethrough, formatUnderline } from '@wordpress/icons';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import SegmentedTextControl from '../segmented-text-control';
|
|
11
|
+
import {
|
|
12
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
13
|
+
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
14
|
+
} from '@wordpress/components';
|
|
16
15
|
|
|
17
16
|
const TEXT_DECORATIONS = [
|
|
18
17
|
{
|
|
@@ -48,9 +47,11 @@ export default function TextDecorationControl( {
|
|
|
48
47
|
className,
|
|
49
48
|
} ) {
|
|
50
49
|
return (
|
|
51
|
-
<
|
|
50
|
+
<ToggleGroupControl
|
|
51
|
+
isDeselectable
|
|
52
|
+
__nextHasNoMarginBottom
|
|
53
|
+
__next40pxDefaultSize
|
|
52
54
|
label={ __( 'Decoration' ) }
|
|
53
|
-
options={ TEXT_DECORATIONS }
|
|
54
55
|
className={ clsx(
|
|
55
56
|
'block-editor-text-decoration-control',
|
|
56
57
|
className
|
|
@@ -59,6 +60,17 @@ export default function TextDecorationControl( {
|
|
|
59
60
|
onChange={ ( newValue ) => {
|
|
60
61
|
onChange( newValue === value ? undefined : newValue );
|
|
61
62
|
} }
|
|
62
|
-
|
|
63
|
+
>
|
|
64
|
+
{ TEXT_DECORATIONS.map( ( option ) => {
|
|
65
|
+
return (
|
|
66
|
+
<ToggleGroupControlOptionIcon
|
|
67
|
+
key={ option.value }
|
|
68
|
+
value={ option.value }
|
|
69
|
+
icon={ option.icon }
|
|
70
|
+
label={ option.label }
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
} ) }
|
|
74
|
+
</ToggleGroupControl>
|
|
63
75
|
);
|
|
64
76
|
}
|
|
@@ -13,11 +13,10 @@ import {
|
|
|
13
13
|
formatLowercase,
|
|
14
14
|
formatUppercase,
|
|
15
15
|
} from '@wordpress/icons';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import SegmentedTextControl from '../segmented-text-control';
|
|
16
|
+
import {
|
|
17
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
18
|
+
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
19
|
+
} from '@wordpress/components';
|
|
21
20
|
|
|
22
21
|
const TEXT_TRANSFORMS = [
|
|
23
22
|
{
|
|
@@ -54,9 +53,11 @@ const TEXT_TRANSFORMS = [
|
|
|
54
53
|
*/
|
|
55
54
|
export default function TextTransformControl( { className, value, onChange } ) {
|
|
56
55
|
return (
|
|
57
|
-
<
|
|
56
|
+
<ToggleGroupControl
|
|
57
|
+
isDeselectable
|
|
58
|
+
__nextHasNoMarginBottom
|
|
59
|
+
__next40pxDefaultSize
|
|
58
60
|
label={ __( 'Letter case' ) }
|
|
59
|
-
options={ TEXT_TRANSFORMS }
|
|
60
61
|
className={ clsx(
|
|
61
62
|
'block-editor-text-transform-control',
|
|
62
63
|
className
|
|
@@ -65,6 +66,17 @@ export default function TextTransformControl( { className, value, onChange } ) {
|
|
|
65
66
|
onChange={ ( newValue ) => {
|
|
66
67
|
onChange( newValue === value ? undefined : newValue );
|
|
67
68
|
} }
|
|
68
|
-
|
|
69
|
+
>
|
|
70
|
+
{ TEXT_TRANSFORMS.map( ( option ) => {
|
|
71
|
+
return (
|
|
72
|
+
<ToggleGroupControlOptionIcon
|
|
73
|
+
key={ option.value }
|
|
74
|
+
value={ option.value }
|
|
75
|
+
icon={ option.icon }
|
|
76
|
+
label={ option.label }
|
|
77
|
+
/>
|
|
78
|
+
);
|
|
79
|
+
} ) }
|
|
80
|
+
</ToggleGroupControl>
|
|
69
81
|
);
|
|
70
82
|
}
|
|
@@ -130,10 +130,6 @@ When hiding the URLInput using CSS (as is sometimes done for accessibility purpo
|
|
|
130
130
|
|
|
131
131
|
This prop allows the suggestions list to be programmatically not rendered by passing a boolean—it can be `true` to make sure suggestions aren't rendered, or `false`/`undefined` to fall back to the default behaviour of showing suggestions when matching autocompletion items are found.
|
|
132
132
|
|
|
133
|
-
### `__nextHasNoMarginBottom: Boolean`
|
|
134
|
-
|
|
135
|
-
Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 6.4. (The prop can be safely removed once this happens.)
|
|
136
|
-
|
|
137
133
|
## Example
|
|
138
134
|
|
|
139
135
|
|
|
@@ -156,7 +152,6 @@ registerBlockType( /* ... */, {
|
|
|
156
152
|
edit( { className, attributes, setAttributes } ) {
|
|
157
153
|
return (
|
|
158
154
|
<URLInput
|
|
159
|
-
__nextHasNoMarginBottom
|
|
160
155
|
className={ className }
|
|
161
156
|
value={ attributes.url }
|
|
162
157
|
onChange={ ( url, post ) => setAttributes( { url, text: (post && post.title) || 'Click here' } ) }
|
|
@@ -6,7 +6,6 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import deprecated from '@wordpress/deprecated';
|
|
10
9
|
import { __, sprintf, _n } from '@wordpress/i18n';
|
|
11
10
|
import { Component, createRef } from '@wordpress/element';
|
|
12
11
|
import { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';
|
|
@@ -416,8 +415,6 @@ class URLInput extends Component {
|
|
|
416
415
|
|
|
417
416
|
renderControl() {
|
|
418
417
|
const {
|
|
419
|
-
/** Start opting into the new margin-free styles that will become the default in a future version. */
|
|
420
|
-
__nextHasNoMarginBottom = false,
|
|
421
418
|
label = null,
|
|
422
419
|
className,
|
|
423
420
|
isFullWidth,
|
|
@@ -473,19 +470,8 @@ class URLInput extends Component {
|
|
|
473
470
|
return renderControl( controlProps, inputProps, loading );
|
|
474
471
|
}
|
|
475
472
|
|
|
476
|
-
if ( ! __nextHasNoMarginBottom ) {
|
|
477
|
-
deprecated( 'Bottom margin styles for wp.blockEditor.URLInput', {
|
|
478
|
-
since: '6.2',
|
|
479
|
-
version: '6.5',
|
|
480
|
-
hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version',
|
|
481
|
-
} );
|
|
482
|
-
}
|
|
483
|
-
|
|
484
473
|
return (
|
|
485
|
-
<BaseControl
|
|
486
|
-
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
487
|
-
{ ...controlProps }
|
|
488
|
-
>
|
|
474
|
+
<BaseControl __nextHasNoMarginBottom { ...controlProps }>
|
|
489
475
|
<input { ...inputProps } />
|
|
490
476
|
{ loading && <Spinner /> }
|
|
491
477
|
</BaseControl>
|
|
@@ -120,8 +120,8 @@ $input-size: 300px;
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
.block-editor-url-input__button-modal {
|
|
123
|
-
box-shadow: $
|
|
124
|
-
border:
|
|
123
|
+
box-shadow: $elevation-x-small;
|
|
124
|
+
border: $border-width solid $gray-300;
|
|
125
125
|
background: $white;
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -227,12 +227,14 @@ const ImageURLInputUI = ( {
|
|
|
227
227
|
checked={ linkTarget === '_blank' }
|
|
228
228
|
/>
|
|
229
229
|
<TextControl
|
|
230
|
+
__next40pxDefaultSize
|
|
230
231
|
__nextHasNoMarginBottom
|
|
231
232
|
label={ __( 'Link rel' ) }
|
|
232
233
|
value={ rel ?? '' }
|
|
233
234
|
onChange={ onSetLinkRel }
|
|
234
235
|
/>
|
|
235
236
|
<TextControl
|
|
237
|
+
__next40pxDefaultSize
|
|
236
238
|
__nextHasNoMarginBottom
|
|
237
239
|
label={ __( 'Link CSS class' ) }
|
|
238
240
|
value={ linkClass || '' }
|
|
@@ -301,8 +301,10 @@ export default function useBlockDropZone( {
|
|
|
301
301
|
operation: 'insert',
|
|
302
302
|
} );
|
|
303
303
|
|
|
304
|
-
const { getBlockType } =
|
|
304
|
+
const { getBlockType, getBlockVariations, getGroupingBlockName } =
|
|
305
|
+
useSelect( blocksStore );
|
|
305
306
|
const {
|
|
307
|
+
canInsertBlockType,
|
|
306
308
|
getBlockListSettings,
|
|
307
309
|
getBlocks,
|
|
308
310
|
getBlockIndex,
|
|
@@ -310,6 +312,9 @@ export default function useBlockDropZone( {
|
|
|
310
312
|
getBlockNamesByClientId,
|
|
311
313
|
getAllowedBlocks,
|
|
312
314
|
isDragging,
|
|
315
|
+
isGroupable,
|
|
316
|
+
getSettings,
|
|
317
|
+
isZoomOutMode,
|
|
313
318
|
} = unlock( useSelect( blockEditorStore ) );
|
|
314
319
|
const {
|
|
315
320
|
showInsertionPoint,
|
|
@@ -340,6 +345,7 @@ export default function useBlockDropZone( {
|
|
|
340
345
|
const targetBlockName = getBlockNamesByClientId( [
|
|
341
346
|
targetRootClientId,
|
|
342
347
|
] )[ 0 ];
|
|
348
|
+
|
|
343
349
|
const draggedBlockNames = getBlockNamesByClientId(
|
|
344
350
|
getDraggedBlockClientIds()
|
|
345
351
|
);
|
|
@@ -349,10 +355,23 @@ export default function useBlockDropZone( {
|
|
|
349
355
|
draggedBlockNames,
|
|
350
356
|
targetBlockName
|
|
351
357
|
);
|
|
358
|
+
|
|
352
359
|
if ( ! isBlockDroppingAllowed ) {
|
|
353
360
|
return;
|
|
354
361
|
}
|
|
355
362
|
|
|
363
|
+
const { sectionRootClientId } = unlock( getSettings() );
|
|
364
|
+
|
|
365
|
+
// In Zoom Out mode, if the target is not the section root provided by settings then
|
|
366
|
+
// do not allow dropping as the drop target is not within the root (that which is
|
|
367
|
+
// treated as "the content" by Zoom Out Mode).
|
|
368
|
+
if (
|
|
369
|
+
isZoomOutMode() &&
|
|
370
|
+
sectionRootClientId !== targetRootClientId
|
|
371
|
+
) {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
|
|
356
375
|
const blocks = getBlocks( targetRootClientId );
|
|
357
376
|
|
|
358
377
|
// The block list is empty, don't show the insertion point but still allow dropping.
|
|
@@ -385,21 +404,66 @@ export default function useBlockDropZone( {
|
|
|
385
404
|
};
|
|
386
405
|
} );
|
|
387
406
|
|
|
407
|
+
const dropTargetPosition = getDropTargetPosition(
|
|
408
|
+
blocksData,
|
|
409
|
+
{ x: event.clientX, y: event.clientY },
|
|
410
|
+
getBlockListSettings( targetRootClientId )?.orientation,
|
|
411
|
+
{
|
|
412
|
+
dropZoneElement,
|
|
413
|
+
parentBlockClientId,
|
|
414
|
+
parentBlockOrientation: parentBlockClientId
|
|
415
|
+
? getBlockListSettings( parentBlockClientId )
|
|
416
|
+
?.orientation
|
|
417
|
+
: undefined,
|
|
418
|
+
rootBlockIndex: getBlockIndex( targetRootClientId ),
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
|
|
388
422
|
const [ targetIndex, operation, nearestSide ] =
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
423
|
+
dropTargetPosition;
|
|
424
|
+
|
|
425
|
+
if ( operation === 'group' ) {
|
|
426
|
+
const targetBlock = blocks[ targetIndex ];
|
|
427
|
+
const areAllImages = [
|
|
428
|
+
targetBlock.name,
|
|
429
|
+
...draggedBlockNames,
|
|
430
|
+
].every( ( name ) => name === 'core/image' );
|
|
431
|
+
const canInsertGalleryBlock = canInsertBlockType(
|
|
432
|
+
'core/gallery',
|
|
433
|
+
targetRootClientId
|
|
434
|
+
);
|
|
435
|
+
const areGroupableBlocks = isGroupable( [
|
|
436
|
+
targetBlock.clientId,
|
|
437
|
+
getDraggedBlockClientIds(),
|
|
438
|
+
] );
|
|
439
|
+
const groupBlockVariations = getBlockVariations(
|
|
440
|
+
getGroupingBlockName(),
|
|
441
|
+
'block'
|
|
402
442
|
);
|
|
443
|
+
const canInsertRow =
|
|
444
|
+
groupBlockVariations &&
|
|
445
|
+
groupBlockVariations.find(
|
|
446
|
+
( { name } ) => name === 'group-row'
|
|
447
|
+
);
|
|
448
|
+
|
|
449
|
+
// If the dragged blocks and the target block are all images,
|
|
450
|
+
// check if it is creatable either a Row variation or a Gallery block.
|
|
451
|
+
if (
|
|
452
|
+
areAllImages &&
|
|
453
|
+
! canInsertGalleryBlock &&
|
|
454
|
+
( ! areGroupableBlocks || ! canInsertRow )
|
|
455
|
+
) {
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
// If the dragged blocks and the target block are not all images,
|
|
459
|
+
// check if it is creatable a Row variation.
|
|
460
|
+
if (
|
|
461
|
+
! areAllImages &&
|
|
462
|
+
( ! areGroupableBlocks || ! canInsertRow )
|
|
463
|
+
) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
403
467
|
|
|
404
468
|
registry.batch( () => {
|
|
405
469
|
setDropTarget( {
|
|
@@ -422,6 +486,7 @@ export default function useBlockDropZone( {
|
|
|
422
486
|
} );
|
|
423
487
|
},
|
|
424
488
|
[
|
|
489
|
+
isDragging,
|
|
425
490
|
getAllowedBlocks,
|
|
426
491
|
targetRootClientId,
|
|
427
492
|
getBlockNamesByClientId,
|
|
@@ -433,9 +498,14 @@ export default function useBlockDropZone( {
|
|
|
433
498
|
parentBlockClientId,
|
|
434
499
|
getBlockIndex,
|
|
435
500
|
registry,
|
|
436
|
-
showInsertionPoint,
|
|
437
|
-
isDragging,
|
|
438
501
|
startDragging,
|
|
502
|
+
showInsertionPoint,
|
|
503
|
+
canInsertBlockType,
|
|
504
|
+
isGroupable,
|
|
505
|
+
getBlockVariations,
|
|
506
|
+
getGroupingBlockName,
|
|
507
|
+
getSettings,
|
|
508
|
+
isZoomOutMode,
|
|
439
509
|
]
|
|
440
510
|
),
|
|
441
511
|
200
|
|
@@ -232,7 +232,6 @@ export default function useOnBlockDrop(
|
|
|
232
232
|
getBlocksByClientId,
|
|
233
233
|
getSettings,
|
|
234
234
|
getBlock,
|
|
235
|
-
isGroupable,
|
|
236
235
|
} = useSelect( blockEditorStore );
|
|
237
236
|
const { getGroupingBlockName } = useSelect( blocksStore );
|
|
238
237
|
const {
|
|
@@ -255,17 +254,11 @@ export default function useOnBlockDrop(
|
|
|
255
254
|
if ( ! Array.isArray( blocks ) ) {
|
|
256
255
|
blocks = [ blocks ];
|
|
257
256
|
}
|
|
258
|
-
|
|
259
257
|
const clientIds = getBlockOrder( targetRootClientId );
|
|
260
258
|
const clientId = clientIds[ targetBlockIndex ];
|
|
261
|
-
const blocksClientIds = blocks.map( ( block ) => block.clientId );
|
|
262
|
-
const areGroupableBlocks = isGroupable( [
|
|
263
|
-
...blocksClientIds,
|
|
264
|
-
clientId,
|
|
265
|
-
] );
|
|
266
259
|
if ( operation === 'replace' ) {
|
|
267
260
|
replaceBlocks( clientId, blocks, undefined, initialPosition );
|
|
268
|
-
} else if ( operation === 'group'
|
|
261
|
+
} else if ( operation === 'group' ) {
|
|
269
262
|
const targetBlock = getBlock( clientId );
|
|
270
263
|
if ( nearestSide === 'left' ) {
|
|
271
264
|
blocks.push( targetBlock );
|
|
@@ -325,7 +318,6 @@ export default function useOnBlockDrop(
|
|
|
325
318
|
getBlockOrder,
|
|
326
319
|
targetRootClientId,
|
|
327
320
|
targetBlockIndex,
|
|
328
|
-
isGroupable,
|
|
329
321
|
operation,
|
|
330
322
|
replaceBlocks,
|
|
331
323
|
getBlock,
|