@wordpress/block-editor 10.2.0 → 10.4.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 +18 -0
- package/README.md +41 -0
- package/build/components/alignment-control/ui.js +1 -1
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/constants.js +1 -1
- package/build/components/block-alignment-control/constants.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +1 -1
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-compare/index.js +1 -3
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +4 -2
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-edit/index.js +4 -2
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-inspector/index.js +4 -4
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-list-compact.native.js +1 -0
- package/build/components/block-list/block-list-compact.native.js.map +1 -1
- package/build/components/block-list/block.js +75 -15
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +79 -12
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +7 -23
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +9 -6
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-parent-selector/index.js +3 -3
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-patterns-list/index.js +5 -4
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/drop-zone.js +85 -0
- package/build/components/block-popover/drop-zone.js.map +1 -0
- package/build/components/block-popover/inbetween.js +2 -1
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +4 -2
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/auto.js +2 -2
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +8 -13
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-preview/live.js +3 -7
- package/build/components/block-preview/live.js.map +1 -1
- package/build/components/block-selection-clearer/index.js +9 -1
- package/build/components/block-selection-clearer/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +19 -19
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.js +18 -42
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-switcher/index.js +2 -8
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +1 -1
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-toolbar/index.js +4 -4
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -1
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +56 -16
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +15 -3
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +1 -1
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/all-input-control.js +2 -1
- package/build/components/border-radius-control/all-input-control.js.map +1 -1
- package/build/components/border-radius-control/index.js +2 -1
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +2 -1
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/colors-gradients/control.js +1 -1
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -1
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +256 -0
- package/build/components/font-sizes/fluid-utils.js.map +1 -0
- package/build/components/font-sizes/index.js +8 -0
- package/build/components/font-sizes/index.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +1 -1
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/constants.js +1 -1
- package/build/components/image-editor/constants.js.map +1 -1
- package/build/components/index.js +0 -9
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +6 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +151 -78
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +2 -7
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/menu.js +14 -3
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/search-items.js +23 -2
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +4 -2
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/line-height-control/index.js +2 -1
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +2 -1
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +1 -14
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/media-replace-flow/index.js +1 -1
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/preview-options/index.js +2 -3
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +1 -1
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +1 -1
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +1 -1
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/spacing-sizes-control/all-input-control.js +6 -2
- package/build/components/spacing-sizes-control/all-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/axial-input-controls.js +6 -2
- package/build/components/spacing-sizes-control/axial-input-controls.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +6 -2
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls.js +6 -2
- package/build/components/spacing-sizes-control/input-controls.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +45 -8
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +1 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +98 -57
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +12 -12
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/types.js +6 -0
- package/build/components/use-on-block-drop/types.js.map +1 -0
- package/build/hooks/align.js +1 -3
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +1 -7
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/border.js +1 -0
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/dimensions.js +32 -4
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-size.js +61 -0
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/layout.js +4 -3
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/margin.js +24 -17
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +20 -12
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +126 -4
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/use-typography-props.js +17 -3
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +8 -7
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +0 -1
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +1 -1
- package/build/layouts/flex.js.map +1 -1
- package/build/store/actions.js +63 -45
- package/build/store/actions.js.map +1 -1
- package/build/store/array.js +1 -7
- package/build/store/array.js.map +1 -1
- package/build/store/defaults.js +3 -0
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +31 -15
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +46 -29
- package/build/store/selectors.js.map +1 -1
- package/build/utils/math.js +14 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/pre-parse-patterns.js +19 -2
- package/build/utils/pre-parse-patterns.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +1 -1
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/constants.js +1 -1
- package/build-module/components/block-alignment-control/constants.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-compare/index.js +2 -3
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +7 -3
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-edit/index.js +4 -2
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +4 -4
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-list-compact.native.js +1 -0
- package/build-module/components/block-list/block-list-compact.native.js.map +1 -1
- package/build-module/components/block-list/block.js +75 -15
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +80 -13
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +8 -24
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +10 -8
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +3 -3
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +5 -4
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/drop-zone.js +70 -0
- package/build-module/components/block-popover/drop-zone.js.map +1 -0
- package/build-module/components/block-popover/inbetween.js +2 -1
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +4 -2
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +1 -1
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +8 -12
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-preview/live.js +3 -6
- package/build-module/components/block-preview/live.js.map +1 -1
- package/build-module/components/block-selection-clearer/index.js +9 -1
- package/build-module/components/block-selection-clearer/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +20 -19
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.js +19 -44
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +2 -7
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +4 -4
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +2 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +54 -16
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +15 -3
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/all-input-control.js +2 -1
- package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +2 -1
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +2 -1
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +2 -2
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +3 -3
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -1
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +245 -0
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -0
- package/build-module/components/font-sizes/index.js +1 -0
- package/build-module/components/font-sizes/index.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +2 -2
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/constants.js +1 -1
- package/build-module/components/image-editor/constants.js.map +1 -1
- package/build-module/components/index.js +0 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +6 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +148 -81
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +2 -6
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/menu.js +10 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/search-items.js +23 -3
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +4 -2
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +2 -1
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +2 -1
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +1 -14
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +1 -1
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +2 -3
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +1 -1
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/spacing-sizes-control/all-input-control.js +6 -2
- package/build-module/components/spacing-sizes-control/all-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/axial-input-controls.js +6 -2
- package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +6 -2
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls.js +6 -2
- package/build-module/components/spacing-sizes-control/input-controls.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +44 -8
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +98 -58
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +12 -12
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/types.js +2 -0
- package/build-module/components/use-on-block-drop/types.js.map +1 -0
- package/build-module/hooks/align.js +1 -2
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -6
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/border.js +1 -0
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/dimensions.js +32 -4
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-size.js +60 -1
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/layout.js +5 -4
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/margin.js +25 -18
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +21 -13
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +124 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +17 -4
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +8 -8
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +0 -1
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +1 -1
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/store/actions.js +59 -42
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/array.js +1 -6
- package/build-module/store/array.js.map +1 -1
- package/build-module/store/defaults.js +3 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +32 -16
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +47 -30
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/math.js +12 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/pre-parse-patterns.js +19 -2
- package/build-module/utils/pre-parse-patterns.js.map +1 -1
- package/build-style/style-rtl.css +292 -206
- package/build-style/style.css +288 -202
- package/package.json +29 -28
- package/src/components/alignment-control/ui.js +1 -1
- package/src/components/block-alignment-control/constants.js +1 -1
- package/src/components/block-alignment-matrix-control/index.js +1 -1
- package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +13 -11
- package/src/components/block-breadcrumb/test/index.js +2 -2
- package/src/components/block-compare/index.js +3 -2
- package/src/components/block-draggable/draggable-chip.js +4 -2
- package/src/components/block-edit/index.js +2 -1
- package/src/components/block-inspector/index.js +8 -7
- package/src/components/block-list/block-list-compact.native.js +1 -0
- package/src/components/block-list/block.js +113 -7
- package/src/components/block-list/block.native.js +123 -9
- package/src/components/block-list/style.scss +93 -126
- package/src/components/block-list/use-in-between-inserter.js +8 -19
- package/src/components/block-lock/modal.js +12 -7
- package/src/components/block-mover/stories/index.js +1 -1
- package/src/components/block-mover/style.scss +35 -1
- package/src/components/block-parent-selector/index.js +3 -3
- package/src/components/block-patterns-list/index.js +9 -5
- package/src/components/block-patterns-list/style.scss +7 -3
- package/src/components/block-popover/README.md +8 -0
- package/src/components/block-popover/drop-zone.js +63 -0
- package/src/components/block-popover/inbetween.js +1 -0
- package/src/components/block-popover/index.js +3 -1
- package/src/components/block-popover/style.scss +17 -5
- package/src/components/block-preview/auto.js +1 -1
- package/src/components/block-preview/index.js +15 -11
- package/src/components/block-preview/live.js +2 -7
- package/src/components/block-preview/test/index.js +1 -7
- package/src/components/block-selection-clearer/index.js +7 -2
- package/src/components/block-selection-clearer/test/index.js +118 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +29 -18
- package/src/components/block-settings-menu/test/block-mode-toggle.js +17 -17
- package/src/components/block-styles/index.js +26 -49
- package/src/components/block-switcher/index.js +2 -7
- package/src/components/block-switcher/preview-block-popover.js +1 -1
- package/src/components/block-switcher/test/index.js +2 -2
- package/src/components/block-toolbar/index.js +4 -6
- package/src/components/block-toolbar/style.scss +38 -14
- package/src/components/block-tools/back-compat.js +1 -0
- package/src/components/block-tools/insertion-point.js +49 -15
- package/src/components/block-tools/selected-block-popover.js +14 -1
- package/src/components/block-variation-picker/README.md +1 -1
- package/src/components/block-vertical-alignment-control/ui.js +1 -1
- package/src/components/border-radius-control/all-input-control.js +1 -0
- package/src/components/border-radius-control/index.js +1 -0
- package/src/components/border-radius-control/input-controls.js +1 -0
- package/src/components/border-radius-control/style.scss +15 -24
- package/src/components/button-block-appender/style.scss +4 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +86 -104
- package/src/components/color-palette/test/control.js +11 -15
- package/src/components/colors-gradients/control.js +2 -2
- package/src/components/colors-gradients/panel-color-gradient-settings.js +3 -4
- package/src/components/colors-gradients/test/control.js +49 -77
- package/src/components/duotone-control/index.js +1 -1
- package/src/components/font-sizes/fluid-utils.js +296 -0
- package/src/components/font-sizes/index.js +1 -0
- package/src/components/font-sizes/test/fluid-utils.js +168 -0
- package/src/components/font-sizes/with-font-sizes.js +2 -3
- package/src/components/iframe/index.js +1 -1
- package/src/components/image-editor/constants.js +1 -1
- package/src/components/image-size-control/test/index.js +47 -60
- package/src/components/index.js +0 -1
- package/src/components/inner-blocks/index.js +5 -1
- package/src/components/inner-blocks/test/index.js +4 -0
- package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -2
- package/src/components/inserter/block-patterns-tab.js +232 -98
- package/src/components/inserter/hooks/use-insertion-point.js +3 -11
- package/src/components/inserter/menu.js +15 -2
- package/src/components/inserter/search-items.js +23 -3
- package/src/components/inserter/style.scss +94 -9
- package/src/components/inserter/test/reusable-blocks-tab.js +6 -6
- package/src/components/inserter/test/search-items.js +6 -0
- package/src/components/inserter-draggable-blocks/index.js +12 -2
- package/src/components/inserter-list-item/style.scss +22 -1
- package/src/components/letter-spacing-control/README.md +55 -0
- package/src/components/line-height-control/index.js +1 -0
- package/src/components/link-control/README.md +3 -3
- package/src/components/link-control/test/index.js +1 -1
- package/src/components/list-view/drop-indicator.js +1 -0
- package/src/components/list-view/style.scss +1 -36
- package/src/components/list-view/use-list-view-drop-zone.js +4 -18
- package/src/components/media-replace-flow/index.js +1 -1
- package/src/components/media-replace-flow/test/index.js +69 -51
- package/src/components/panel-color-settings/test/index.js +4 -4
- package/src/components/preview-options/index.js +2 -2
- package/src/components/preview-options/style.scss +1 -1
- package/src/components/provider/test/use-block-sync.js +131 -165
- package/src/components/responsive-block-control/test/index.js +4 -4
- package/src/components/rich-text/format-toolbar/index.js +1 -1
- package/src/components/rich-text/format-toolbar-container.js +1 -1
- package/src/components/rich-text/use-paste-handler.js +1 -1
- package/src/components/spacing-sizes-control/all-input-control.js +4 -0
- package/src/components/spacing-sizes-control/axial-input-controls.js +4 -0
- package/src/components/spacing-sizes-control/index.js +4 -0
- package/src/components/spacing-sizes-control/input-controls.js +4 -0
- package/src/components/spacing-sizes-control/spacing-input-control.js +26 -3
- package/src/components/spacing-sizes-control/style.scss +27 -19
- package/src/components/url-input/index.js +1 -1
- package/src/components/use-block-drop-zone/index.js +136 -79
- package/src/components/use-block-drop-zone/test/index.js +333 -81
- package/src/components/use-on-block-drop/index.js +11 -12
- package/src/components/use-on-block-drop/types.ts +1 -0
- package/src/hooks/align.js +3 -2
- package/src/hooks/align.native.js +5 -8
- package/src/hooks/border.js +1 -0
- package/src/hooks/dimensions.js +32 -5
- package/src/hooks/font-size.js +76 -0
- package/src/hooks/layout.js +7 -9
- package/src/hooks/margin.js +20 -14
- package/src/hooks/padding.js +20 -16
- package/src/hooks/style.js +122 -3
- package/src/hooks/test/align.js +96 -72
- package/src/hooks/test/style.js +206 -1
- package/src/hooks/test/use-typography-props.js +22 -0
- package/src/hooks/use-typography-props.js +18 -3
- package/src/hooks/utils.js +10 -7
- package/src/layouts/constrained.js +0 -1
- package/src/layouts/flex.js +1 -1
- package/src/store/actions.js +24 -12
- package/src/store/array.js +1 -6
- package/src/store/defaults.js +3 -0
- package/src/store/reducer.js +31 -24
- package/src/store/selectors.js +28 -21
- package/src/store/test/actions.js +0 -9
- package/src/store/test/selectors.js +1 -1
- package/src/utils/math.js +17 -0
- package/src/utils/pre-parse-patterns.js +12 -7
- package/build/components/inserter/pattern-panel.js +0 -87
- package/build/components/inserter/pattern-panel.js.map +0 -1
- package/build-module/components/inserter/pattern-panel.js +0 -74
- package/build-module/components/inserter/pattern-panel.js.map +0 -1
- package/src/components/inserter/pattern-panel.js +0 -93
|
@@ -24,7 +24,9 @@ import { useSelect } from '@wordpress/data';
|
|
|
24
24
|
import Tips from './tips';
|
|
25
25
|
import InserterPreviewPanel from './preview-panel';
|
|
26
26
|
import BlockTypesTab from './block-types-tab';
|
|
27
|
-
import BlockPatternsTabs
|
|
27
|
+
import BlockPatternsTabs, {
|
|
28
|
+
BlockPatternsCategoryDialog,
|
|
29
|
+
} from './block-patterns-tab';
|
|
28
30
|
import ReusableBlocksTab from './reusable-blocks-tab';
|
|
29
31
|
import InserterSearchResults from './search-results';
|
|
30
32
|
import useInsertionPoint from './hooks/use-insertion-point';
|
|
@@ -52,6 +54,7 @@ function InserterMenu(
|
|
|
52
54
|
const [ hoveredItem, setHoveredItem ] = useState( null );
|
|
53
55
|
const [ selectedPatternCategory, setSelectedPatternCategory ] =
|
|
54
56
|
useState( null );
|
|
57
|
+
const [ selectedTab, setSelectedTab ] = useState( null );
|
|
55
58
|
|
|
56
59
|
const [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ] =
|
|
57
60
|
useInsertionPoint( {
|
|
@@ -144,7 +147,7 @@ function InserterMenu(
|
|
|
144
147
|
<BlockPatternsTabs
|
|
145
148
|
rootClientId={ destinationRootClientId }
|
|
146
149
|
onInsert={ onInsertPattern }
|
|
147
|
-
|
|
150
|
+
onSelectCategory={ onClickPatternCategory }
|
|
148
151
|
selectedCategory={ selectedPatternCategory }
|
|
149
152
|
/>
|
|
150
153
|
),
|
|
@@ -186,6 +189,8 @@ function InserterMenu(
|
|
|
186
189
|
},
|
|
187
190
|
} ) );
|
|
188
191
|
|
|
192
|
+
const showPatternPanel =
|
|
193
|
+
selectedTab === 'patterns' && ! filterValue && selectedPatternCategory;
|
|
189
194
|
const showAsTabs = ! filterValue && ( showPatterns || hasReusableBlocks );
|
|
190
195
|
|
|
191
196
|
return (
|
|
@@ -228,6 +233,7 @@ function InserterMenu(
|
|
|
228
233
|
showPatterns={ showPatterns }
|
|
229
234
|
showReusableBlocks={ hasReusableBlocks }
|
|
230
235
|
prioritizePatterns={ prioritizePatterns }
|
|
236
|
+
onSelect={ setSelectedTab }
|
|
231
237
|
>
|
|
232
238
|
{ getCurrentTab }
|
|
233
239
|
</InserterTabs>
|
|
@@ -241,6 +247,13 @@ function InserterMenu(
|
|
|
241
247
|
{ showInserterHelpPanel && hoveredItem && (
|
|
242
248
|
<InserterPreviewPanel item={ hoveredItem } />
|
|
243
249
|
) }
|
|
250
|
+
{ showPatternPanel && (
|
|
251
|
+
<BlockPatternsCategoryDialog
|
|
252
|
+
rootClientId={ destinationRootClientId }
|
|
253
|
+
onInsert={ onInsertPattern }
|
|
254
|
+
category={ selectedPatternCategory }
|
|
255
|
+
/>
|
|
256
|
+
) }
|
|
244
257
|
</div>
|
|
245
258
|
);
|
|
246
259
|
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import removeAccents from 'remove-accents';
|
|
5
|
-
import { find
|
|
5
|
+
import { find } from 'lodash';
|
|
6
|
+
import { noCase } from 'change-case';
|
|
6
7
|
|
|
7
8
|
// Default search helpers.
|
|
8
9
|
const defaultGetName = ( item ) => item.name || '';
|
|
@@ -12,6 +13,25 @@ const defaultGetKeywords = ( item ) => item.keywords || [];
|
|
|
12
13
|
const defaultGetCategory = ( item ) => item.category;
|
|
13
14
|
const defaultGetCollection = () => null;
|
|
14
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Extracts words from an input string.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} input The input string.
|
|
20
|
+
*
|
|
21
|
+
* @return {Array} Words, extracted from the input string.
|
|
22
|
+
*/
|
|
23
|
+
function extractWords( input = '' ) {
|
|
24
|
+
return noCase( input, {
|
|
25
|
+
splitRegexp: [
|
|
26
|
+
/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu, // One lowercase or digit, followed by one uppercase.
|
|
27
|
+
/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu, // One uppercase followed by one uppercase and one lowercase.
|
|
28
|
+
],
|
|
29
|
+
stripRegexp: /(\p{C}|\p{P}|\p{S})+/giu, // Anything that's not a punctuation, symbol or control/format character.
|
|
30
|
+
} )
|
|
31
|
+
.split( ' ' )
|
|
32
|
+
.filter( Boolean );
|
|
33
|
+
}
|
|
34
|
+
|
|
15
35
|
/**
|
|
16
36
|
* Sanitizes the search input string.
|
|
17
37
|
*
|
|
@@ -43,7 +63,7 @@ function normalizeSearchInput( input = '' ) {
|
|
|
43
63
|
* @return {string[]} The normalized list of search terms.
|
|
44
64
|
*/
|
|
45
65
|
export const getNormalizedSearchTerms = ( input = '' ) => {
|
|
46
|
-
return
|
|
66
|
+
return extractWords( normalizeSearchInput( input ) );
|
|
47
67
|
};
|
|
48
68
|
|
|
49
69
|
const removeMatchingTerms = ( unmatchedTerms, unprocessedTerms ) => {
|
|
@@ -150,7 +170,7 @@ export function getItemSearchRank( item, searchTerm, config = {} ) {
|
|
|
150
170
|
category,
|
|
151
171
|
collection,
|
|
152
172
|
].join( ' ' );
|
|
153
|
-
const normalizedSearchTerms =
|
|
173
|
+
const normalizedSearchTerms = extractWords( normalizedSearchInput );
|
|
154
174
|
const unmatchedTerms = removeMatchingTerms(
|
|
155
175
|
normalizedSearchTerms,
|
|
156
176
|
terms
|
|
@@ -22,14 +22,13 @@ $block-inserter-tabs-height: 44px;
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
height: 100%;
|
|
24
24
|
gap: $grid-unit-20;
|
|
25
|
-
width: auto;
|
|
26
|
-
@include break-medium {
|
|
27
|
-
width: $block-inserter-width;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
25
|
&.show-as-tabs {
|
|
31
26
|
gap: 0;
|
|
32
27
|
}
|
|
28
|
+
|
|
29
|
+
@include break-medium {
|
|
30
|
+
width: $block-inserter-width;
|
|
31
|
+
}
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
.block-editor-inserter__popover.is-quick {
|
|
@@ -148,10 +147,6 @@ $block-inserter-tabs-height: 44px;
|
|
|
148
147
|
padding: $grid-unit-20 $grid-unit-20 0;
|
|
149
148
|
}
|
|
150
149
|
|
|
151
|
-
.block-editor-inserter__panel-header-patterns {
|
|
152
|
-
padding: $grid-unit-20 $grid-unit-20 0;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
150
|
.block-editor-inserter__panel-content {
|
|
156
151
|
padding: $grid-unit-20;
|
|
157
152
|
}
|
|
@@ -235,6 +230,92 @@ $block-inserter-tabs-height: 44px;
|
|
|
235
230
|
}
|
|
236
231
|
}
|
|
237
232
|
|
|
233
|
+
.block-editor-inserter__patterns-explore-button.components-button {
|
|
234
|
+
padding: $grid-unit-20;
|
|
235
|
+
justify-content: center;
|
|
236
|
+
margin-top: $grid-unit-20;
|
|
237
|
+
width: 100%;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.block-editor-inserter__patterns-selected-category.block-editor-inserter__patterns-selected-category {
|
|
241
|
+
color: var(--wp-admin-theme-color);
|
|
242
|
+
position: relative;
|
|
243
|
+
|
|
244
|
+
.components-flex-item {
|
|
245
|
+
filter: brightness(0.95);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
svg {
|
|
249
|
+
fill: var(--wp-admin-theme-color);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&::after {
|
|
253
|
+
content: "";
|
|
254
|
+
position: absolute;
|
|
255
|
+
top: 0;
|
|
256
|
+
bottom: 0;
|
|
257
|
+
left: 0;
|
|
258
|
+
right: 0;
|
|
259
|
+
border-radius: $radius-block-ui;
|
|
260
|
+
opacity: 0.04;
|
|
261
|
+
background: var(--wp-admin-theme-color);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.block-editor-inserter__block-patterns-tabs-container {
|
|
266
|
+
height: 100%;
|
|
267
|
+
nav {
|
|
268
|
+
height: 100%;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.block-editor-inserter__block-patterns-tabs {
|
|
273
|
+
display: flex;
|
|
274
|
+
flex-direction: column;
|
|
275
|
+
padding: $grid-unit-20;
|
|
276
|
+
overflow-y: auto;
|
|
277
|
+
height: 100%;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.block-editor-inserter__patterns-fill-space {
|
|
281
|
+
flex-grow: 1;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.block-editor-inserter__patterns-category-panel {
|
|
285
|
+
background: $gray-100;
|
|
286
|
+
border-left: $border-width solid $gray-200;
|
|
287
|
+
border-right: $border-width solid $gray-200;
|
|
288
|
+
position: absolute;
|
|
289
|
+
padding: $grid-unit-40 $grid-unit-30;
|
|
290
|
+
top: 0;
|
|
291
|
+
left: 0;
|
|
292
|
+
height: 100%;
|
|
293
|
+
width: 100%;
|
|
294
|
+
overflow-y: auto;
|
|
295
|
+
scrollbar-gutter: stable both-edges;
|
|
296
|
+
|
|
297
|
+
@include break-medium {
|
|
298
|
+
left: 100%;
|
|
299
|
+
display: block;
|
|
300
|
+
width: 300px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.block-editor-block-patterns-list {
|
|
304
|
+
margin-top: $grid-unit-30;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.block-editor-block-preview__container {
|
|
308
|
+
box-shadow: 0 15px 25px rgb(0 0 0 / 7%);
|
|
309
|
+
&:hover {
|
|
310
|
+
box-shadow: 0 0 0 2px $gray-900, 0 15px 25px rgb(0 0 0 / 7%);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.block-editor-block-patterns-list__item-title {
|
|
315
|
+
display: none;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
238
319
|
.block-editor-inserter__preview-content {
|
|
239
320
|
min-height: $grid-unit-60 * 3;
|
|
240
321
|
background: $gray-100;
|
|
@@ -388,3 +469,7 @@ $block-inserter-tabs-height: 44px;
|
|
|
388
469
|
}
|
|
389
470
|
}
|
|
390
471
|
}
|
|
472
|
+
|
|
473
|
+
.block-editor-inserter__patterns-category-panel-title {
|
|
474
|
+
font-size: calc(1.25 * 13px);
|
|
475
|
+
}
|
|
@@ -41,14 +41,14 @@ function InserterBlockList( props ) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const initializeAllClosedMenuState = ( propOverrides ) => {
|
|
44
|
-
const
|
|
45
|
-
const activeTabs =
|
|
44
|
+
const { container } = render( <InserterBlockList { ...propOverrides } /> );
|
|
45
|
+
const activeTabs = container.querySelectorAll(
|
|
46
46
|
'.components-panel__body.is-opened button.components-panel__body-toggle'
|
|
47
47
|
);
|
|
48
48
|
activeTabs.forEach( ( tab ) => {
|
|
49
49
|
fireEvent.click( tab );
|
|
50
50
|
} );
|
|
51
|
-
return
|
|
51
|
+
return container;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
describe( 'InserterMenu', () => {
|
|
@@ -92,13 +92,13 @@ describe( 'InserterMenu', () => {
|
|
|
92
92
|
} );
|
|
93
93
|
|
|
94
94
|
it( 'should list reusable blocks', () => {
|
|
95
|
-
const
|
|
95
|
+
const container = initializeAllClosedMenuState();
|
|
96
96
|
const blocks = container.querySelectorAll(
|
|
97
97
|
'.block-editor-block-types-list__item-title'
|
|
98
98
|
);
|
|
99
99
|
|
|
100
100
|
expect( blocks ).toHaveLength( 1 );
|
|
101
|
-
expect( blocks[ 0 ]
|
|
101
|
+
expect( blocks[ 0 ] ).toHaveTextContent( 'My reusable block' );
|
|
102
102
|
} );
|
|
103
103
|
|
|
104
104
|
it( 'should trim whitespace of search terms', () => {
|
|
@@ -111,6 +111,6 @@ describe( 'InserterMenu', () => {
|
|
|
111
111
|
);
|
|
112
112
|
|
|
113
113
|
expect( blocks ).toHaveLength( 1 );
|
|
114
|
-
expect( blocks[ 0 ]
|
|
114
|
+
expect( blocks[ 0 ] ).toHaveTextContent( 'My reusable block' );
|
|
115
115
|
} );
|
|
116
116
|
} );
|
|
@@ -45,6 +45,12 @@ describe( 'getNormalizedSearchTerms', () => {
|
|
|
45
45
|
|
|
46
46
|
it( 'should support non-latin letters', () => {
|
|
47
47
|
expect( getNormalizedSearchTerms( 'მედია' ) ).toEqual( [ 'მედია' ] );
|
|
48
|
+
expect(
|
|
49
|
+
getNormalizedSearchTerms( '师父领进门,修行在个人。' )
|
|
50
|
+
).toEqual( [ '师父领进门', '修行在个人' ] );
|
|
51
|
+
expect(
|
|
52
|
+
getNormalizedSearchTerms( 'Бързата работа – срам за майстора.' )
|
|
53
|
+
).toEqual( [ 'бързата', 'работа', 'срам', 'за', 'майстора' ] );
|
|
48
54
|
} );
|
|
49
55
|
} );
|
|
50
56
|
|
|
@@ -7,7 +7,13 @@ import { Draggable } from '@wordpress/components';
|
|
|
7
7
|
*/
|
|
8
8
|
import BlockDraggableChip from '../block-draggable/draggable-chip';
|
|
9
9
|
|
|
10
|
-
const InserterDraggableBlocks = ( {
|
|
10
|
+
const InserterDraggableBlocks = ( {
|
|
11
|
+
isEnabled,
|
|
12
|
+
blocks,
|
|
13
|
+
icon,
|
|
14
|
+
children,
|
|
15
|
+
isPattern,
|
|
16
|
+
} ) => {
|
|
11
17
|
const transferData = {
|
|
12
18
|
type: 'inserter',
|
|
13
19
|
blocks,
|
|
@@ -18,7 +24,11 @@ const InserterDraggableBlocks = ( { isEnabled, blocks, icon, children } ) => {
|
|
|
18
24
|
__experimentalTransferDataType="wp-blocks"
|
|
19
25
|
transferData={ transferData }
|
|
20
26
|
__experimentalDragComponent={
|
|
21
|
-
<BlockDraggableChip
|
|
27
|
+
<BlockDraggableChip
|
|
28
|
+
count={ blocks.length }
|
|
29
|
+
icon={ icon }
|
|
30
|
+
isPattern={ isPattern }
|
|
31
|
+
/>
|
|
22
32
|
}
|
|
23
33
|
>
|
|
24
34
|
{ ( { onDraggableStart, onDraggableEnd } ) => {
|
|
@@ -30,7 +30,28 @@
|
|
|
30
30
|
|
|
31
31
|
&:not(:disabled) {
|
|
32
32
|
&:hover {
|
|
33
|
-
|
|
33
|
+
.block-editor-block-types-list__item-title {
|
|
34
|
+
color: var(--wp-admin-theme-color) !important;
|
|
35
|
+
filter: brightness(0.95);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
svg {
|
|
39
|
+
color: var(--wp-admin-theme-color) !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&::after {
|
|
43
|
+
content: "";
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 0;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
left: 0;
|
|
48
|
+
right: 0;
|
|
49
|
+
border-radius: $radius-block-ui;
|
|
50
|
+
opacity: 0.04;
|
|
51
|
+
background: var(--wp-admin-theme-color);
|
|
52
|
+
// This fixes drag-and-drop in Firefox.
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
}
|
|
34
55
|
}
|
|
35
56
|
|
|
36
57
|
&:focus {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Letter spacing control
|
|
2
|
+
|
|
3
|
+
The `LetterSpacingControl` component renders a [`UnitControl`](https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/components/unit-control/README.md) that lets the user enter a numeric value and select a unit, for example px or rem.
|
|
4
|
+
|
|
5
|
+
This component is used for blocks that display text, commonly inside a
|
|
6
|
+
[`ToolsPanelItem`](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/tools-panel/tools-panel-item/README.md).
|
|
7
|
+
|
|
8
|
+
## Table of contents
|
|
9
|
+
|
|
10
|
+
1. [Development guidelines](#development-guidelines)
|
|
11
|
+
2. [Related components](#related-components)
|
|
12
|
+
|
|
13
|
+
## Development guidelines
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
Renders a letter spacing control.
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
import { LetterSpacingControl } from '@wordpress/block-editor';
|
|
21
|
+
|
|
22
|
+
const MyLetterSpacingControl = () => (
|
|
23
|
+
<LetterSpacingControl
|
|
24
|
+
value={ value }
|
|
25
|
+
onChange={ onChange }
|
|
26
|
+
__unstableInputWidth="auto"
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Props
|
|
32
|
+
|
|
33
|
+
### `value`
|
|
34
|
+
|
|
35
|
+
- **Type:** `String`
|
|
36
|
+
- **Default:** `undefined`
|
|
37
|
+
|
|
38
|
+
The current value of the letter spacing setting.
|
|
39
|
+
|
|
40
|
+
### `onChange`
|
|
41
|
+
|
|
42
|
+
- **Type:** `Function`
|
|
43
|
+
|
|
44
|
+
A callback function invoked when the value is changed.
|
|
45
|
+
|
|
46
|
+
### `_unstableInputWidth`
|
|
47
|
+
|
|
48
|
+
- **Type:** `string|number|undefined`
|
|
49
|
+
- **Default:** `undefined`
|
|
50
|
+
|
|
51
|
+
Input width to pass through to inner UnitControl. Should be a valid CSS value.
|
|
52
|
+
|
|
53
|
+
## Related components
|
|
54
|
+
|
|
55
|
+
Block Editor components are components that can be used to compose the UI of your block editor. Thus, they can only be used under a [`BlockEditorProvider`](https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/provider/README.md) in the components tree.
|
|
@@ -192,7 +192,7 @@ A `suggestion` should have the following shape:
|
|
|
192
192
|
)}
|
|
193
193
|
/>
|
|
194
194
|
```
|
|
195
|
-
### renderControlBottom
|
|
195
|
+
### renderControlBottom
|
|
196
196
|
|
|
197
197
|
- Type: `Function`
|
|
198
198
|
- Required: No
|
|
@@ -338,7 +338,7 @@ See the [createSuggestion](#createSuggestion) section of this file to learn more
|
|
|
338
338
|
<LinkControlSearchInput
|
|
339
339
|
renderSuggestions={( { suggestions } ) => {
|
|
340
340
|
return (
|
|
341
|
-
<Popover focusOnMount={ false }
|
|
341
|
+
<Popover focusOnMount={ false } placement="bottom">
|
|
342
342
|
<ul>
|
|
343
343
|
{ suggestions.map( () => ( <li key={ `${ suggestion.id }-${ suggestion.type }` }>{ suggestion.title }</li> ) ) }
|
|
344
344
|
</ul>
|
|
@@ -352,7 +352,7 @@ See the [createSuggestion](#createSuggestion) section of this file to learn more
|
|
|
352
352
|
<LinkControlSearchInput
|
|
353
353
|
renderSuggestions={( suggestionsProps ) => {
|
|
354
354
|
return (
|
|
355
|
-
<Popover focusOnMount={ false }
|
|
355
|
+
<Popover focusOnMount={ false } placement="bottom">
|
|
356
356
|
<LinkControlSearchResults { ...suggestionsProps } />
|
|
357
357
|
</Popover>
|
|
358
358
|
);
|
|
@@ -392,7 +392,7 @@ describe( 'Searching for a link', () => {
|
|
|
392
392
|
fauxEntitySuggestions.length
|
|
393
393
|
);
|
|
394
394
|
|
|
395
|
-
expect( searchInput.
|
|
395
|
+
expect( searchInput ).toHaveAttribute( 'aria-expanded', 'true' );
|
|
396
396
|
|
|
397
397
|
// Sanity check that a search suggestion shows up corresponding to the data.
|
|
398
398
|
expect( searchResultElements[ 0 ] ).toHaveTextContent(
|
|
@@ -249,39 +249,12 @@
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
//
|
|
253
|
-
&:focus:enabled {
|
|
254
|
-
box-shadow: none;
|
|
255
|
-
outline: none;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// Focus style.
|
|
259
|
-
&:focus {
|
|
260
|
-
box-shadow: none;
|
|
261
|
-
outline: none;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
&:focus::before {
|
|
265
|
-
@include block-toolbar-button-style__focus();
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Focus and toggle pseudo elements.
|
|
252
|
+
// Tweak size and position of focus ring.
|
|
269
253
|
&::before {
|
|
270
|
-
content: "";
|
|
271
|
-
position: absolute;
|
|
272
|
-
display: block;
|
|
273
|
-
border-radius: $radius-block-ui;
|
|
274
254
|
height: 16px;
|
|
275
255
|
min-width: 100%;
|
|
276
|
-
|
|
277
|
-
// Position the focus rectangle.
|
|
278
256
|
left: 0;
|
|
279
257
|
right: 0;
|
|
280
|
-
|
|
281
|
-
// Animate in.
|
|
282
|
-
animation: components-button__appear-animation 0.1s ease;
|
|
283
|
-
animation-fill-mode: forwards;
|
|
284
|
-
@include reduce-motion("animation");
|
|
285
258
|
}
|
|
286
259
|
}
|
|
287
260
|
|
|
@@ -416,14 +389,6 @@ $block-navigation-max-indent: 8;
|
|
|
416
389
|
}
|
|
417
390
|
}
|
|
418
391
|
|
|
419
|
-
// Reset some popover defaults for the drop indicator.
|
|
420
|
-
.block-editor-list-view-drop-indicator > .components-popover__content {
|
|
421
|
-
margin-left: 0;
|
|
422
|
-
border: none;
|
|
423
|
-
box-shadow: none;
|
|
424
|
-
outline: none;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
392
|
.block-editor-list-view-placeholder {
|
|
428
393
|
padding: 0;
|
|
429
394
|
margin: 0;
|
|
@@ -11,7 +11,10 @@ import {
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
getDistanceToNearestEdge,
|
|
16
|
+
isPointContainedByRect,
|
|
17
|
+
} from '../../utils/math';
|
|
15
18
|
import useOnBlockDrop from '../use-on-block-drop';
|
|
16
19
|
import { store as blockEditorStore } from '../../store';
|
|
17
20
|
|
|
@@ -48,23 +51,6 @@ import { store as blockEditorStore } from '../../store';
|
|
|
48
51
|
* 'inside' refers to nesting as an inner block.
|
|
49
52
|
*/
|
|
50
53
|
|
|
51
|
-
/**
|
|
52
|
-
* Is the point contained by the rectangle.
|
|
53
|
-
*
|
|
54
|
-
* @param {WPPoint} point The point.
|
|
55
|
-
* @param {DOMRect} rect The rectangle.
|
|
56
|
-
*
|
|
57
|
-
* @return {boolean} True if the point is contained by the rectangle, false otherwise.
|
|
58
|
-
*/
|
|
59
|
-
function isPointContainedByRect( point, rect ) {
|
|
60
|
-
return (
|
|
61
|
-
rect.left <= point.x &&
|
|
62
|
-
rect.right >= point.x &&
|
|
63
|
-
rect.top <= point.y &&
|
|
64
|
-
rect.bottom >= point.y
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
54
|
/**
|
|
69
55
|
* Determines whether the user positioning the dragged block to nest as an
|
|
70
56
|
* inner block.
|