@wordpress/block-editor 13.3.0 → 14.0.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 +11 -5
- package/build/components/alignment-control/ui.js +2 -2
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +1 -1
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +1 -1
- package/build/components/block-alignment-control/ui.native.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-inspector/index.js +6 -3
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +3 -1
- 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 +26 -27
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +25 -9
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -2
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +2 -0
- package/build/components/block-lock/modal.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-removal-warning-modal/index.js +2 -0
- package/build/components/block-removal-warning-modal/index.js.map +1 -1
- package/build/components/block-switcher/index.js +1 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +11 -12
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +20 -17
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +5 -2
- package/build/components/block-toolbar/shuffle.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/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 +7 -8
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserter-button.js +45 -0
- package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
- package/build/components/block-tools/zoom-out-mode-inserters.js +35 -36
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-popover.js +2 -1
- package/build/components/block-tools/zoom-out-popover.js.map +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js +1 -2
- package/build/components/block-tools/zoom-out-toolbar.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/date-format-picker/index.js +2 -11
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +7 -4
- package/build/components/default-block-appender/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 +2 -7
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +12 -0
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +63 -52
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +5 -1
- 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/theme-file-uri-utils.js +0 -59
- package/build/components/global-styles/theme-file-uri-utils.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +26 -44
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +78 -7
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +82 -44
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +96 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +93 -44
- 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 +2 -2
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +93 -45
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/iframe/index.js +4 -8
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.js +1 -9
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +1 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +20 -23
- package/build/components/inserter/block-patterns-tab/patterns-filter.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/media-tab/media-panel.js +1 -0
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +3 -3
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +20 -3
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +10 -3
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/line-height-control/index.js +0 -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/list-view/block-select-button.js +2 -6
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +2 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/utils.js +3 -1
- package/build/components/list-view/utils.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/resolution-tool/index.js +1 -0
- package/build/components/resolution-tool/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/index.js +1 -1
- package/build/components/rich-text/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/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 +3 -3
- 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 +30 -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/hooks/block-bindings.js +248 -36
- 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/grid-visualizer.js +5 -8
- package/build/hooks/grid-visualizer.js.map +1 -1
- package/build/hooks/index.js +7 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +9 -2
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/line-height.js +0 -1
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/position.js +3 -7
- package/build/hooks/position.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 +85 -50
- 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 +6 -2
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/grid.js +2 -0
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +0 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +27 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +19 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +17 -5
- package/build/store/selectors.js.map +1 -1
- 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/components/alignment-control/ui.js +2 -2
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +1 -1
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +1 -1
- package/build-module/components/block-alignment-control/ui.native.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-inspector/index.js +6 -3
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +3 -1
- 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 +27 -30
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +26 -9
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +3 -2
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +2 -0
- package/build-module/components/block-lock/modal.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-removal-warning-modal/index.js +2 -0
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +1 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +12 -13
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +20 -17
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +5 -2
- package/build-module/components/block-toolbar/shuffle.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/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 +7 -8
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +37 -0
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +37 -38
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-popover.js +2 -1
- package/build-module/components/block-tools/zoom-out-popover.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +1 -2
- package/build-module/components/block-tools/zoom-out-toolbar.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/date-format-picker/index.js +4 -12
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +7 -4
- package/build-module/components/default-block-appender/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 -6
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +11 -0
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +63 -52
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +5 -1
- 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/theme-file-uri-utils.js +0 -58
- package/build-module/components/global-styles/theme-file-uri-utils.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +27 -45
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +76 -7
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +81 -43
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +92 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +96 -46
- 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 +2 -2
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +94 -46
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/iframe/index.js +4 -8
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.js +0 -5
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +1 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +20 -23
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.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/media-tab/media-panel.js +1 -0
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +3 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +20 -3
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +10 -3
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -2
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build-module/components/line-height-control/index.js +0 -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/list-view/block-select-button.js +3 -7
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +2 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/utils.js +3 -1
- package/build-module/components/list-view/utils.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/resolution-tool/index.js +1 -0
- package/build-module/components/resolution-tool/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/index.js +1 -1
- package/build-module/components/rich-text/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/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 +3 -3
- 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 +30 -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/hooks/block-bindings.js +253 -40
- 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/grid-visualizer.js +5 -8
- package/build-module/hooks/grid-visualizer.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/layout-child.js +9 -2
- package/build-module/hooks/layout-child.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/position.js +3 -7
- package/build-module/hooks/position.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 +84 -51
- 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 +6 -2
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/grid.js +2 -0
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +1 -5
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +24 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +18 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +14 -4
- package/build-module/store/selectors.js.map +1 -1
- 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 +11 -18
- package/build-style/content.css +11 -18
- package/build-style/default-editor-styles-rtl.css +3 -0
- package/build-style/default-editor-styles.css +3 -0
- package/build-style/style-rtl.css +242 -136
- package/build-style/style.css +242 -136
- package/build-types/components/block-context/index.d.ts +2 -2
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +31 -31
- package/src/autocompleters/style.scss +4 -0
- package/src/components/alignment-control/ui.js +2 -2
- package/src/components/block-alignment-control/ui.js +1 -1
- package/src/components/block-alignment-control/ui.native.js +1 -1
- package/src/components/block-breadcrumb/index.js +4 -2
- package/src/components/block-canvas/style.scss +1 -0
- package/src/components/block-context/README.md +4 -4
- package/src/components/block-draggable/index.js +3 -3
- package/src/components/block-inspector/index.js +8 -4
- package/src/components/block-list/content.scss +2 -16
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-block-props/use-block-refs.js +30 -30
- package/src/components/block-list/use-block-props/use-is-hovered.js +26 -11
- package/src/components/block-list/use-in-between-inserter.js +5 -1
- package/src/components/block-lock/modal.js +10 -2
- package/src/components/block-lock/style.scss +4 -8
- package/src/components/block-mover/index.js +5 -2
- package/src/components/block-patterns-paging/style.scss +0 -23
- 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-removal-warning-modal/index.js +10 -2
- package/src/components/block-switcher/index.js +1 -1
- package/src/components/block-switcher/pattern-transformations-menu.js +17 -15
- package/src/components/block-switcher/preview-block-popover.js +20 -14
- package/src/components/block-switcher/style.scss +8 -17
- package/src/components/block-toolbar/shuffle.js +8 -1
- 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/style.scss +8 -0
- package/src/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/src/components/block-tools/use-show-block-tools.js +12 -9
- package/src/components/block-tools/zoom-out-mode-inserter-button.js +47 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +48 -42
- package/src/components/block-tools/zoom-out-popover.js +1 -0
- package/src/components/block-tools/zoom-out-toolbar.js +1 -2
- 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/date-format-picker/index.js +2 -11
- package/src/components/default-block-appender/index.js +11 -4
- package/src/components/dimensions-tool/scale-tool.js +1 -0
- package/src/components/font-appearance-control/index.js +1 -5
- package/src/components/font-family/README.md +8 -0
- package/src/components/font-family/index.js +16 -0
- package/src/components/font-family/stories/index.story.js +54 -0
- package/src/components/global-styles/background-panel.js +90 -62
- package/src/components/global-styles/hooks.js +5 -1
- package/src/components/global-styles/image-settings-panel.js +1 -0
- package/src/components/global-styles/style.scss +11 -9
- package/src/components/global-styles/test/theme-file-uri-utils.js +1 -26
- package/src/components/global-styles/test/typography-utils.js +325 -0
- package/src/components/global-styles/test/use-global-styles-output.js +52 -5
- package/src/components/global-styles/test/utils.js +120 -0
- package/src/components/global-styles/theme-file-uri-utils.js +0 -59
- package/src/components/global-styles/typography-panel.js +36 -45
- package/src/components/global-styles/typography-utils.js +103 -7
- package/src/components/global-styles/use-global-styles-output.js +89 -50
- package/src/components/global-styles/utils.js +112 -0
- package/src/components/grid/grid-item-movers.js +141 -69
- package/src/components/grid/grid-item-resizer.js +11 -17
- package/src/components/grid/grid-visualizer.js +2 -2
- package/src/components/grid/style.scss +164 -0
- package/src/components/grid/use-grid-layout-sync.js +133 -40
- package/src/components/iframe/content.scss +3 -3
- package/src/components/iframe/index.js +3 -7
- package/src/components/index.js +0 -5
- package/src/components/inner-blocks/index.js +4 -1
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +40 -44
- package/src/components/inserter/category-tabs/index.js +35 -2
- package/src/components/inserter/media-tab/media-panel.js +1 -0
- package/src/components/inserter/menu.js +3 -3
- package/src/components/inserter/preview-panel.js +27 -4
- package/src/components/inserter/style.scss +66 -47
- package/src/components/inserter-draggable-blocks/index.js +11 -3
- package/src/components/inspector-controls/README.md +5 -0
- package/src/components/inspector-controls-tabs/settings-tab.js +0 -2
- package/src/components/inspector-controls-tabs/style.scss +0 -21
- package/src/components/line-height-control/README.md +0 -8
- package/src/components/line-height-control/index.js +1 -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/list-view/block-select-button.js +3 -13
- package/src/components/list-view/block.js +10 -3
- package/src/components/list-view/style.scss +2 -1
- package/src/components/list-view/utils.js +13 -2
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +3 -1
- package/src/components/resolution-tool/index.js +1 -0
- package/src/components/responsive-block-control/test/index.js +5 -1
- package/src/components/rich-text/format-toolbar/index.js +1 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/skip-to-selected-block/index.js +5 -3
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -7
- package/src/components/tabbed-sidebar/style.scss +1 -19
- 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-popover/image-url-input-ui.js +3 -3
- package/src/components/url-popover/link-editor.js +0 -1
- package/src/components/url-popover/style.scss +1 -0
- package/src/components/use-block-drop-zone/index.js +66 -14
- 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/hooks/block-bindings.js +303 -52
- 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/grid-visualizer.js +5 -7
- package/src/hooks/index.js +2 -1
- package/src/hooks/layout-child.js +12 -3
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/position.js +3 -13
- package/src/hooks/spacing-visualizer.js +1 -1
- package/src/hooks/use-bindings-attributes.js +93 -59
- 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 +10 -2
- package/src/layouts/grid.js +2 -0
- package/src/private-apis.js +1 -8
- package/src/store/actions.js +28 -5
- package/src/store/reducer.js +18 -0
- package/src/store/selectors.js +14 -4
- package/src/style.scss +1 -1
- package/src/utils/get-editor-region.js +1 -1
- package/src/utils/get-px-from-css-unit.js +1 -1
- package/tsconfig.tsbuildinfo +1 -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/inserter/reusable-block-rename-hint.js +0 -71
- package/build/components/inserter/reusable-block-rename-hint.js.map +0 -1
- package/build/components/inspector-controls-tabs/settings-tab-hint.js +0 -53
- package/build/components/inspector-controls-tabs/settings-tab-hint.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/inserter/reusable-block-rename-hint.js +0 -64
- package/build-module/components/inserter/reusable-block-rename-hint.js.map +0 -1
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +0 -47
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -25
- package/src/components/inserter/reusable-block-rename-hint.js +0 -69
- package/src/components/inspector-controls-tabs/settings-tab-hint.js +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -36,35 +36,35 @@
|
|
|
36
36
|
"@emotion/react": "^11.7.1",
|
|
37
37
|
"@emotion/styled": "^11.6.0",
|
|
38
38
|
"@react-spring/web": "^9.4.5",
|
|
39
|
-
"@wordpress/a11y": "^4.
|
|
40
|
-
"@wordpress/api-fetch": "^7.
|
|
41
|
-
"@wordpress/blob": "^4.
|
|
42
|
-
"@wordpress/blocks": "^13.
|
|
43
|
-
"@wordpress/commands": "^1.
|
|
44
|
-
"@wordpress/components": "^28.
|
|
45
|
-
"@wordpress/compose": "^7.
|
|
46
|
-
"@wordpress/data": "^10.
|
|
47
|
-
"@wordpress/date": "^5.
|
|
48
|
-
"@wordpress/deprecated": "^4.
|
|
49
|
-
"@wordpress/dom": "^4.
|
|
50
|
-
"@wordpress/element": "^6.
|
|
51
|
-
"@wordpress/escape-html": "^3.
|
|
52
|
-
"@wordpress/hooks": "^4.
|
|
53
|
-
"@wordpress/html-entities": "^4.
|
|
54
|
-
"@wordpress/i18n": "^5.
|
|
55
|
-
"@wordpress/icons": "^10.
|
|
56
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
58
|
-
"@wordpress/keycodes": "^4.
|
|
59
|
-
"@wordpress/notices": "^5.
|
|
60
|
-
"@wordpress/preferences": "^4.
|
|
61
|
-
"@wordpress/private-apis": "^1.
|
|
62
|
-
"@wordpress/rich-text": "^7.
|
|
63
|
-
"@wordpress/style-engine": "^2.
|
|
64
|
-
"@wordpress/token-list": "^3.
|
|
65
|
-
"@wordpress/url": "^4.
|
|
66
|
-
"@wordpress/warning": "^3.
|
|
67
|
-
"@wordpress/wordcount": "^4.
|
|
39
|
+
"@wordpress/a11y": "^4.5.0",
|
|
40
|
+
"@wordpress/api-fetch": "^7.5.0",
|
|
41
|
+
"@wordpress/blob": "^4.5.0",
|
|
42
|
+
"@wordpress/blocks": "^13.5.0",
|
|
43
|
+
"@wordpress/commands": "^1.5.0",
|
|
44
|
+
"@wordpress/components": "^28.5.0",
|
|
45
|
+
"@wordpress/compose": "^7.5.0",
|
|
46
|
+
"@wordpress/data": "^10.5.0",
|
|
47
|
+
"@wordpress/date": "^5.5.0",
|
|
48
|
+
"@wordpress/deprecated": "^4.5.0",
|
|
49
|
+
"@wordpress/dom": "^4.5.0",
|
|
50
|
+
"@wordpress/element": "^6.5.0",
|
|
51
|
+
"@wordpress/escape-html": "^3.5.0",
|
|
52
|
+
"@wordpress/hooks": "^4.5.0",
|
|
53
|
+
"@wordpress/html-entities": "^4.5.0",
|
|
54
|
+
"@wordpress/i18n": "^5.5.0",
|
|
55
|
+
"@wordpress/icons": "^10.5.0",
|
|
56
|
+
"@wordpress/is-shallow-equal": "^5.5.0",
|
|
57
|
+
"@wordpress/keyboard-shortcuts": "^5.5.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.5.0",
|
|
59
|
+
"@wordpress/notices": "^5.5.0",
|
|
60
|
+
"@wordpress/preferences": "^4.5.0",
|
|
61
|
+
"@wordpress/private-apis": "^1.5.0",
|
|
62
|
+
"@wordpress/rich-text": "^7.5.0",
|
|
63
|
+
"@wordpress/style-engine": "^2.5.0",
|
|
64
|
+
"@wordpress/token-list": "^3.5.0",
|
|
65
|
+
"@wordpress/url": "^4.5.0",
|
|
66
|
+
"@wordpress/warning": "^3.5.0",
|
|
67
|
+
"@wordpress/wordcount": "^4.5.0",
|
|
68
68
|
"change-case": "^4.1.2",
|
|
69
69
|
"clsx": "^2.1.1",
|
|
70
70
|
"colord": "^2.7.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "c3101ab024e2bfc85d525c6d247e0d57cafc9fd9"
|
|
90
90
|
}
|
|
@@ -32,7 +32,7 @@ function AlignmentUI( {
|
|
|
32
32
|
onChange,
|
|
33
33
|
alignmentControls = DEFAULT_ALIGNMENT_CONTROLS,
|
|
34
34
|
label = __( 'Align text' ),
|
|
35
|
-
|
|
35
|
+
description = __( 'Change text alignment' ),
|
|
36
36
|
isCollapsed = true,
|
|
37
37
|
isToolbar,
|
|
38
38
|
} ) {
|
|
@@ -56,7 +56,7 @@ function AlignmentUI( {
|
|
|
56
56
|
? { isCollapsed }
|
|
57
57
|
: {
|
|
58
58
|
toggleProps: {
|
|
59
|
-
|
|
59
|
+
description,
|
|
60
60
|
},
|
|
61
61
|
popoverProps: POPOVER_PROPS,
|
|
62
62
|
};
|
|
@@ -77,7 +77,7 @@ function BlockAlignmentUI( {
|
|
|
77
77
|
};
|
|
78
78
|
} ),
|
|
79
79
|
popoverProps: POPOVER_PROPS,
|
|
80
|
-
toggleProps: {
|
|
80
|
+
toggleProps: { description: __( 'Change alignment' ) },
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
return <UIComponent { ...commonProps } { ...extraProps } />;
|
|
@@ -5,6 +5,7 @@ import { Button } from '@wordpress/components';
|
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { chevronRightSmall, Icon } from '@wordpress/icons';
|
|
8
|
+
import { useRef } from '@wordpress/element';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
@@ -12,7 +13,7 @@ import { chevronRightSmall, Icon } from '@wordpress/icons';
|
|
|
12
13
|
import BlockTitle from '../block-title';
|
|
13
14
|
import { store as blockEditorStore } from '../../store';
|
|
14
15
|
import { unlock } from '../../lock-unlock';
|
|
15
|
-
import {
|
|
16
|
+
import { useBlockElementRef } from '../block-list/use-block-props/use-block-refs';
|
|
16
17
|
import getEditorRegion from '../../utils/get-editor-region';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -41,7 +42,8 @@ function BlockBreadcrumb( { rootLabelText } ) {
|
|
|
41
42
|
|
|
42
43
|
// We don't care about this specific ref, but this is a way
|
|
43
44
|
// to get a ref within the editor canvas so we can focus it later.
|
|
44
|
-
const blockRef =
|
|
45
|
+
const blockRef = useRef();
|
|
46
|
+
useBlockElementRef( clientId, blockRef );
|
|
45
47
|
|
|
46
48
|
/*
|
|
47
49
|
* Disable reason: The `list` ARIA role is redundant but
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Block Context
|
|
2
2
|
|
|
3
|
-
Block Context is a React implementation of WordPress's block context. Block context, much like [React's context](https://
|
|
3
|
+
Block Context is a React implementation of WordPress's block context. Block context, much like [React's context](https://react.dev/learn/passing-data-deeply-with-context), is a method for passing and inheriting values deeply through a hierarchy of blocks. Because of the similarities with React's context, the client-side implementation here is quite minimal. It is complemented by equivalent behaviors in the server-side rendering of a block.
|
|
4
4
|
|
|
5
5
|
Note that the implementation of Block Context is distinct from [the `BlockEdit` context](../block-edit). While it is true that both provide context relevant for the editing of a block, Block Context is implemented separately so as to prioritize it as most identifiable amongst the machinery of block context, and not amongst other client-side editing context of a block.
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
Currently, only the [Provider component](https://
|
|
9
|
+
Currently, only the [Provider component](https://react.dev/reference/react/createContext#provider) is made available on the public interface of the `@wordpress/block-editor` module. This can be used to add or override context which can then be consumed by blocks rendered within that context in the block editor.
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
import { BlockContextProvider } from '@wordpress/block-editor';
|
|
@@ -20,7 +20,7 @@ function MyCustomPostEditor() {
|
|
|
20
20
|
}
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Internal to the `@wordpress/block-editor` module, a component can access the [full Context object](https://
|
|
23
|
+
Internal to the `@wordpress/block-editor` module, a component can access the [full Context object](https://react.dev/reference/react/createContext), typically for use in combination with [`useContext`](https://react.dev/reference/react/useContext).
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
26
|
import { useContext } from 'react';
|
|
@@ -39,7 +39,7 @@ The reason `BlockContext` is only internally available within the `@wordpress/bl
|
|
|
39
39
|
|
|
40
40
|
## Props
|
|
41
41
|
|
|
42
|
-
`BlockContextProvider` behaves like a standard [`Context.Provider` component](https://
|
|
42
|
+
`BlockContextProvider` behaves like a standard [`Context.Provider` component](https://react.dev/reference/react/createContext#provider). It receives `value` and `children` props. The `value` is merged with the current block context value.
|
|
43
43
|
|
|
44
44
|
### `value`
|
|
45
45
|
|
|
@@ -13,7 +13,7 @@ import { throttle } from '@wordpress/compose';
|
|
|
13
13
|
import BlockDraggableChip from './draggable-chip';
|
|
14
14
|
import useScrollWhenDragging from './use-scroll-when-dragging';
|
|
15
15
|
import { store as blockEditorStore } from '../../store';
|
|
16
|
-
import {
|
|
16
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
17
17
|
import { isDropTargetValid } from '../use-block-drop-zone';
|
|
18
18
|
|
|
19
19
|
const BlockDraggable = ( {
|
|
@@ -82,8 +82,8 @@ const BlockDraggable = ( {
|
|
|
82
82
|
}, [] );
|
|
83
83
|
|
|
84
84
|
// Find the root of the editor iframe.
|
|
85
|
-
const
|
|
86
|
-
const editorRoot =
|
|
85
|
+
const blockEl = useBlockElement( clientIds[ 0 ] );
|
|
86
|
+
const editorRoot = blockEl?.closest( 'body' );
|
|
87
87
|
|
|
88
88
|
/*
|
|
89
89
|
* Add a dragover event listener to the editor root to track the blocks being dragged over.
|
|
@@ -132,6 +132,10 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
|
|
|
132
132
|
label={ __( 'Color' ) }
|
|
133
133
|
className="color-block-support-panel__inner-wrapper"
|
|
134
134
|
/>
|
|
135
|
+
<InspectorControls.Slot
|
|
136
|
+
group="background"
|
|
137
|
+
label={ __( 'Background image' ) }
|
|
138
|
+
/>
|
|
135
139
|
<InspectorControls.Slot
|
|
136
140
|
group="typography"
|
|
137
141
|
label={ __( 'Typography' ) }
|
|
@@ -285,6 +289,10 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
|
|
|
285
289
|
label={ __( 'Color' ) }
|
|
286
290
|
className="color-block-support-panel__inner-wrapper"
|
|
287
291
|
/>
|
|
292
|
+
<InspectorControls.Slot
|
|
293
|
+
group="background"
|
|
294
|
+
label={ __( 'Background image' ) }
|
|
295
|
+
/>
|
|
288
296
|
<InspectorControls.Slot
|
|
289
297
|
group="typography"
|
|
290
298
|
label={ __( 'Typography' ) }
|
|
@@ -298,10 +306,6 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
|
|
|
298
306
|
label={ borderPanelLabel }
|
|
299
307
|
/>
|
|
300
308
|
<InspectorControls.Slot group="styles" />
|
|
301
|
-
<InspectorControls.Slot
|
|
302
|
-
group="background"
|
|
303
|
-
label={ __( 'Background image' ) }
|
|
304
|
-
/>
|
|
305
309
|
<PositionControls />
|
|
306
310
|
<div>
|
|
307
311
|
<AdvancedControls />
|
|
@@ -17,20 +17,6 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
@mixin selectedOutline() {
|
|
21
|
-
content: "";
|
|
22
|
-
position: absolute;
|
|
23
|
-
pointer-events: none;
|
|
24
|
-
top: 0;
|
|
25
|
-
right: 0;
|
|
26
|
-
bottom: 0;
|
|
27
|
-
left: 0;
|
|
28
|
-
outline-color: var(--wp-admin-theme-color);
|
|
29
|
-
outline-style: solid;
|
|
30
|
-
outline-width: calc(var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
31
|
-
outline-offset: calc((-1 * var(--wp-admin-border-width-focus)) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
20
|
// Hide selections on this element, otherwise Safari will include it stacked
|
|
35
21
|
// under your actual selection.
|
|
36
22
|
// This uses a CSS hack to show the rules to Safari only. Failing here is okay,
|
|
@@ -101,7 +87,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
|
|
|
101
87
|
// We're using a pseudo element to overflow placeholder borders
|
|
102
88
|
// and any border inside the block itself.
|
|
103
89
|
&::after {
|
|
104
|
-
@include
|
|
90
|
+
@include selected-block-focus();
|
|
105
91
|
z-index: 1;
|
|
106
92
|
|
|
107
93
|
// Show a light color for dark themes.
|
|
@@ -281,7 +267,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
|
|
|
281
267
|
&:not(.rich-text):not([contenteditable="true"]).is-selected {
|
|
282
268
|
|
|
283
269
|
&::after {
|
|
284
|
-
@include
|
|
270
|
+
@include selected-block-focus();
|
|
285
271
|
}
|
|
286
272
|
}
|
|
287
273
|
}
|
|
@@ -115,7 +115,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
115
115
|
useFocusHandler( clientId ),
|
|
116
116
|
useEventHandlers( { clientId, isSelected } ),
|
|
117
117
|
useNavModeExit( clientId ),
|
|
118
|
-
useIsHovered(),
|
|
118
|
+
useIsHovered( { clientId } ),
|
|
119
119
|
useIntersectionObserver(),
|
|
120
120
|
useMovingAnimation( { triggerAnimationOnChange: index, clientId } ),
|
|
121
121
|
useDisabled( { isDisabled: ! hasOverlay } ),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useContext,
|
|
5
|
-
import { useRefEffect
|
|
4
|
+
import { useContext, useState, useLayoutEffect } from '@wordpress/element';
|
|
5
|
+
import { useRefEffect } from '@wordpress/compose';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -10,7 +10,7 @@ import { useRefEffect, useObservableValue } from '@wordpress/compose';
|
|
|
10
10
|
import { BlockRefs } from '../../provider/block-refs-provider';
|
|
11
11
|
|
|
12
12
|
/** @typedef {import('@wordpress/element').RefCallback} RefCallback */
|
|
13
|
-
/** @typedef {import('@wordpress/element').
|
|
13
|
+
/** @typedef {import('@wordpress/element').Ref} Ref */
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Provides a ref to the BlockRefs context.
|
|
@@ -30,31 +30,33 @@ export function useBlockRefProvider( clientId ) {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
function assignRef( ref, value ) {
|
|
34
|
+
if ( typeof ref === 'function' ) {
|
|
35
|
+
ref( value );
|
|
36
|
+
} else if ( ref ) {
|
|
37
|
+
ref.current = value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* reactive, i.e., it won't trigger a rerender of the calling component if the
|
|
37
|
-
* ref value changes. For reactive use cases there is the `useBlockElement` hook.
|
|
42
|
+
* Tracks the DOM element for the block identified by `clientId` and assigns it to the `ref`
|
|
43
|
+
* whenever it changes.
|
|
38
44
|
*
|
|
39
|
-
* @param {string} clientId The client ID to
|
|
40
|
-
*
|
|
41
|
-
* @return {RefObject} A ref containing the element.
|
|
45
|
+
* @param {string} clientId The client ID to track.
|
|
46
|
+
* @param {Ref} ref The ref object/callback to assign to.
|
|
42
47
|
*/
|
|
43
|
-
function
|
|
48
|
+
export function useBlockElementRef( clientId, ref ) {
|
|
44
49
|
const { refsMap } = useContext( BlockRefs );
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} ),
|
|
56
|
-
[ refsMap ]
|
|
57
|
-
);
|
|
50
|
+
useLayoutEffect( () => {
|
|
51
|
+
assignRef( ref, refsMap.get( clientId ) );
|
|
52
|
+
const unsubscribe = refsMap.subscribe( clientId, () =>
|
|
53
|
+
assignRef( ref, refsMap.get( clientId ) )
|
|
54
|
+
);
|
|
55
|
+
return () => {
|
|
56
|
+
unsubscribe();
|
|
57
|
+
assignRef( ref, null );
|
|
58
|
+
};
|
|
59
|
+
}, [ refsMap, clientId, ref ] );
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
/**
|
|
@@ -65,10 +67,8 @@ function useBlockRef( clientId ) {
|
|
|
65
67
|
*
|
|
66
68
|
* @return {Element|null} The block's wrapper element.
|
|
67
69
|
*/
|
|
68
|
-
function useBlockElement( clientId ) {
|
|
69
|
-
const
|
|
70
|
-
|
|
70
|
+
export function useBlockElement( clientId ) {
|
|
71
|
+
const [ blockElement, setBlockElement ] = useState( null );
|
|
72
|
+
useBlockElementRef( clientId, setBlockElement );
|
|
73
|
+
return blockElement;
|
|
71
74
|
}
|
|
72
|
-
|
|
73
|
-
export { useBlockRef as __unstableUseBlockRef };
|
|
74
|
-
export { useBlockElement as __unstableUseBlockElement };
|
|
@@ -2,23 +2,37 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useRefEffect } from '@wordpress/compose';
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const action = event.type === 'mouseover' ? 'add' : 'remove';
|
|
12
|
-
|
|
13
|
-
event.preventDefault();
|
|
14
|
-
event.currentTarget.classList[ action ]( 'is-hovered' );
|
|
15
|
-
}
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { store as blockEditorStore } from '../../../store';
|
|
16
11
|
|
|
17
12
|
/*
|
|
18
13
|
* Adds `is-hovered` class when the block is hovered and in navigation or
|
|
19
14
|
* outline mode.
|
|
20
15
|
*/
|
|
21
|
-
export function useIsHovered() {
|
|
16
|
+
export function useIsHovered( { clientId } ) {
|
|
17
|
+
const { hoverBlock } = useDispatch( blockEditorStore );
|
|
18
|
+
|
|
19
|
+
function listener( event ) {
|
|
20
|
+
if ( event.defaultPrevented ) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const action = event.type === 'mouseover' ? 'add' : 'remove';
|
|
25
|
+
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
event.currentTarget.classList[ action ]( 'is-hovered' );
|
|
28
|
+
|
|
29
|
+
if ( action === 'add' ) {
|
|
30
|
+
hoverBlock( clientId );
|
|
31
|
+
} else {
|
|
32
|
+
hoverBlock( null );
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
22
36
|
return useRefEffect( ( node ) => {
|
|
23
37
|
node.addEventListener( 'mouseout', listener );
|
|
24
38
|
node.addEventListener( 'mouseover', listener );
|
|
@@ -29,6 +43,7 @@ export function useIsHovered() {
|
|
|
29
43
|
|
|
30
44
|
// Remove class in case it lingers.
|
|
31
45
|
node.classList.remove( 'is-hovered' );
|
|
46
|
+
hoverBlock( null );
|
|
32
47
|
};
|
|
33
48
|
}, [] );
|
|
34
49
|
}
|
|
@@ -29,6 +29,7 @@ export function useInBetweenInserter() {
|
|
|
29
29
|
__unstableIsWithinBlockOverlay,
|
|
30
30
|
getBlockEditingMode,
|
|
31
31
|
getBlockName,
|
|
32
|
+
getBlockAttributes,
|
|
32
33
|
} = useSelect( blockEditorStore );
|
|
33
34
|
const { showInsertionPoint, hideInsertionPoint } =
|
|
34
35
|
useDispatch( blockEditorStore );
|
|
@@ -79,7 +80,10 @@ export function useInBetweenInserter() {
|
|
|
79
80
|
if (
|
|
80
81
|
getTemplateLock( rootClientId ) ||
|
|
81
82
|
getBlockEditingMode( rootClientId ) === 'disabled' ||
|
|
82
|
-
getBlockName( rootClientId ) === 'core/block'
|
|
83
|
+
getBlockName( rootClientId ) === 'core/block' ||
|
|
84
|
+
( rootClientId &&
|
|
85
|
+
getBlockAttributes( rootClientId ).layout
|
|
86
|
+
?.isManualPlacement )
|
|
83
87
|
) {
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
@@ -217,12 +217,20 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
217
217
|
expanded={ false }
|
|
218
218
|
>
|
|
219
219
|
<FlexItem>
|
|
220
|
-
<Button
|
|
220
|
+
<Button
|
|
221
|
+
variant="tertiary"
|
|
222
|
+
onClick={ onClose }
|
|
223
|
+
__next40pxDefaultSize
|
|
224
|
+
>
|
|
221
225
|
{ __( 'Cancel' ) }
|
|
222
226
|
</Button>
|
|
223
227
|
</FlexItem>
|
|
224
228
|
<FlexItem>
|
|
225
|
-
<Button
|
|
229
|
+
<Button
|
|
230
|
+
variant="primary"
|
|
231
|
+
type="submit"
|
|
232
|
+
__next40pxDefaultSize
|
|
233
|
+
>
|
|
226
234
|
{ __( 'Apply' ) }
|
|
227
235
|
</Button>
|
|
228
236
|
</FlexItem>
|
|
@@ -8,13 +8,9 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.block-editor-block-lock-modal__options {
|
|
12
|
-
margin-
|
|
13
|
-
|
|
14
|
-
legend {
|
|
15
|
-
margin-bottom: $grid-unit-20;
|
|
16
|
-
padding: 0;
|
|
17
|
-
}
|
|
11
|
+
.block-editor-block-lock-modal__options legend {
|
|
12
|
+
margin-bottom: $grid-unit-20;
|
|
13
|
+
padding: 0;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
16
|
.block-editor-block-lock-modal__checklist {
|
|
@@ -52,7 +48,7 @@
|
|
|
52
48
|
.block-editor-block-lock-modal__template-lock {
|
|
53
49
|
border-top: $border-width solid $gray-300;
|
|
54
50
|
margin-top: $grid-unit-20;
|
|
55
|
-
padding: $grid-unit-
|
|
51
|
+
padding-top: $grid-unit-20;
|
|
56
52
|
}
|
|
57
53
|
|
|
58
54
|
.block-editor-block-lock-modal__actions {
|
|
@@ -69,7 +69,11 @@ function BlockMover( {
|
|
|
69
69
|
[ clientIds ]
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
-
if (
|
|
72
|
+
if (
|
|
73
|
+
! canMove ||
|
|
74
|
+
( isFirst && isLast && ! rootClientId ) ||
|
|
75
|
+
( hideDragHandle && isManualGrid )
|
|
76
|
+
) {
|
|
73
77
|
return null;
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -85,7 +89,6 @@ function BlockMover( {
|
|
|
85
89
|
<Button
|
|
86
90
|
icon={ dragHandle }
|
|
87
91
|
className="block-editor-block-mover__drag-handle"
|
|
88
|
-
aria-hidden="true"
|
|
89
92
|
label={ __( 'Drag' ) }
|
|
90
93
|
// Should not be able to tab to drag handle as this
|
|
91
94
|
// button can only be used with a pointer device.
|
|
@@ -24,11 +24,6 @@
|
|
|
24
24
|
|
|
25
25
|
.show-icon-labels {
|
|
26
26
|
.block-editor-patterns__grid-pagination {
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
.block-editor-patterns__grid-pagination-previous,
|
|
29
|
-
.block-editor-patterns__grid-pagination-next {
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
}
|
|
32
27
|
.components-button {
|
|
33
28
|
width: auto;
|
|
34
29
|
// Hide the button icons when labels are set to display...
|
|
@@ -42,22 +37,4 @@
|
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
}
|
|
45
|
-
|
|
46
|
-
@media screen and (min-width: $break-large) {
|
|
47
|
-
.block-editor-patterns__grid-pagination {
|
|
48
|
-
flex-direction: row;
|
|
49
|
-
.block-editor-patterns__grid-pagination-previous,
|
|
50
|
-
.block-editor-patterns__grid-pagination-next {
|
|
51
|
-
flex-direction: row;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.block-editor-block-patterns-list .block-editor-patterns__grid-pagination {
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
.block-editor-patterns__grid-pagination-previous,
|
|
60
|
-
.block-editor-patterns__grid-pagination-next {
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
}
|
|
63
40
|
}
|
|
@@ -6,7 +6,7 @@ import { useEffect, useState, useMemo, forwardRef } from '@wordpress/element';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
10
10
|
import { PrivateBlockPopover } from '.';
|
|
11
11
|
|
|
12
12
|
function BlockPopoverCover(
|
|
@@ -20,7 +20,7 @@ import { isRTL } from '@wordpress/i18n';
|
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
22
|
import { store as blockEditorStore } from '../../store';
|
|
23
|
-
import {
|
|
23
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
24
24
|
import usePopoverScroll from './use-popover-scroll';
|
|
25
25
|
|
|
26
26
|
const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
/**
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
|
-
import {
|
|
21
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
22
22
|
import usePopoverScroll from './use-popover-scroll';
|
|
23
23
|
|
|
24
24
|
const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
|
|
@@ -53,10 +53,18 @@ export function BlockRemovalWarningModal( { rules } ) {
|
|
|
53
53
|
>
|
|
54
54
|
<p>{ message }</p>
|
|
55
55
|
<HStack justify="right">
|
|
56
|
-
<Button
|
|
56
|
+
<Button
|
|
57
|
+
variant="tertiary"
|
|
58
|
+
onClick={ clearBlockRemovalPrompt }
|
|
59
|
+
__next40pxDefaultSize
|
|
60
|
+
>
|
|
57
61
|
{ __( 'Cancel' ) }
|
|
58
62
|
</Button>
|
|
59
|
-
<Button
|
|
63
|
+
<Button
|
|
64
|
+
variant="primary"
|
|
65
|
+
onClick={ onConfirmRemoval }
|
|
66
|
+
__next40pxDefaultSize
|
|
67
|
+
>
|
|
60
68
|
{ __( 'Delete' ) }
|
|
61
69
|
</Button>
|
|
62
70
|
</HStack>
|
|
@@ -306,7 +306,7 @@ export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => {
|
|
|
306
306
|
</>
|
|
307
307
|
}
|
|
308
308
|
toggleProps={ {
|
|
309
|
-
|
|
309
|
+
description: blockSwitcherDescription,
|
|
310
310
|
...toggleProps,
|
|
311
311
|
} }
|
|
312
312
|
menuProps={ { orientation: 'both' } }
|