@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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useState } from '@wordpress/element';
|
|
6
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
6
|
+
import { useInstanceId, useViewportMatch } from '@wordpress/compose';
|
|
7
7
|
import { chevronRight } from '@wordpress/icons';
|
|
8
8
|
|
|
9
9
|
import {
|
|
@@ -34,6 +34,7 @@ function PatternTransformationsMenu( {
|
|
|
34
34
|
} ) {
|
|
35
35
|
const [ showTransforms, setShowTransforms ] = useState( false );
|
|
36
36
|
const patterns = useTransformedPatterns( statePatterns, blocks );
|
|
37
|
+
|
|
37
38
|
if ( ! patterns.length ) {
|
|
38
39
|
return null;
|
|
39
40
|
}
|
|
@@ -60,21 +61,22 @@ function PatternTransformationsMenu( {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
function PreviewPatternsPopover( { patterns, onSelect } ) {
|
|
64
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
65
|
+
|
|
63
66
|
return (
|
|
64
|
-
<div className="block-editor-block-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</div>
|
|
67
|
+
<div className="block-editor-block-switcher__popover-preview-container">
|
|
68
|
+
<Popover
|
|
69
|
+
className="block-editor-block-switcher__popover-preview"
|
|
70
|
+
placement={ isMobile ? 'bottom' : 'right-start' }
|
|
71
|
+
offset={ 16 }
|
|
72
|
+
>
|
|
73
|
+
<div className="block-editor-block-switcher__preview is-pattern-list-preview">
|
|
74
|
+
<BlockPatternsList
|
|
75
|
+
patterns={ patterns }
|
|
76
|
+
onSelect={ onSelect }
|
|
77
|
+
/>
|
|
78
|
+
</div>
|
|
79
|
+
</Popover>
|
|
78
80
|
</div>
|
|
79
81
|
);
|
|
80
82
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { Popover } from '@wordpress/components';
|
|
6
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -10,22 +11,27 @@ import { Popover } from '@wordpress/components';
|
|
|
10
11
|
import BlockPreview from '../block-preview';
|
|
11
12
|
|
|
12
13
|
export default function PreviewBlockPopover( { blocks } ) {
|
|
14
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
15
|
+
|
|
16
|
+
if ( isMobile ) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
return (
|
|
14
|
-
<div className="block-editor-block-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</div>
|
|
25
|
-
<BlockPreview viewportWidth={ 500 } blocks={ blocks } />
|
|
21
|
+
<div className="block-editor-block-switcher__popover-preview-container">
|
|
22
|
+
<Popover
|
|
23
|
+
className="block-editor-block-switcher__popover-preview"
|
|
24
|
+
placement="right-start"
|
|
25
|
+
focusOnMount={ false }
|
|
26
|
+
offset={ 16 }
|
|
27
|
+
>
|
|
28
|
+
<div className="block-editor-block-switcher__preview">
|
|
29
|
+
<div className="block-editor-block-switcher__preview-title">
|
|
30
|
+
{ __( 'Preview' ) }
|
|
26
31
|
</div>
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
<BlockPreview viewportWidth={ 500 } blocks={ blocks } />
|
|
33
|
+
</div>
|
|
34
|
+
</Popover>
|
|
29
35
|
</div>
|
|
30
36
|
);
|
|
31
37
|
}
|
|
@@ -84,27 +84,18 @@
|
|
|
84
84
|
min-width: 300px;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
.block-editor-block-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
.block-editor-block-switcher__popover-preview-container {
|
|
88
|
+
left: 0;
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: -$border-width;
|
|
91
|
+
width: 100%;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
pointer-events: none;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
.block-editor-block-
|
|
96
|
-
display: none;
|
|
96
|
+
.block-editor-block-switcher__popover-preview {
|
|
97
97
|
overflow: hidden;
|
|
98
98
|
|
|
99
|
-
// Position correctly. Needs specificity.
|
|
100
|
-
&.components-popover {
|
|
101
|
-
margin-top: $grid-unit-15 - $border-width;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@include break-medium() {
|
|
105
|
-
display: block;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
99
|
.components-popover__content {
|
|
109
100
|
width: 300px;
|
|
110
101
|
border: $border-width solid $gray-900;
|
|
@@ -54,10 +54,16 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
54
54
|
return EMPTY_ARRAY;
|
|
55
55
|
}
|
|
56
56
|
return patterns.filter( ( pattern ) => {
|
|
57
|
+
const isCorePattern =
|
|
58
|
+
pattern.source === 'core' ||
|
|
59
|
+
( pattern.source?.startsWith( 'pattern-directory' ) &&
|
|
60
|
+
pattern.source !== 'pattern-directory/theme' );
|
|
57
61
|
return (
|
|
58
62
|
// Check if the pattern has only one top level block,
|
|
59
63
|
// otherwise we may shuffle to pattern that will not allow to continue shuffling.
|
|
60
64
|
pattern.blocks.length === 1 &&
|
|
65
|
+
// We exclude the core patterns and pattern directory patterns that are not theme patterns.
|
|
66
|
+
! isCorePattern &&
|
|
61
67
|
pattern.categories?.some( ( category ) => {
|
|
62
68
|
return categories.includes( category );
|
|
63
69
|
} ) &&
|
|
@@ -66,7 +72,8 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
66
72
|
);
|
|
67
73
|
} );
|
|
68
74
|
}, [ categories, patterns ] );
|
|
69
|
-
|
|
75
|
+
|
|
76
|
+
if ( sameCategoryPatternsWithSingleWrapper.length < 2 ) {
|
|
70
77
|
return null;
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -37,7 +37,7 @@ import BlockTitle from '../block-title';
|
|
|
37
37
|
import BlockIcon from '../block-icon';
|
|
38
38
|
import { store as blockEditorStore } from '../../store';
|
|
39
39
|
import BlockDraggable from '../block-draggable';
|
|
40
|
-
import {
|
|
40
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Block selection button component, displaying the label of the block. If the block
|
|
@@ -259,7 +259,6 @@ function BlockSelectionButton( { clientId, rootClientId }, ref ) {
|
|
|
259
259
|
<Button
|
|
260
260
|
icon={ dragHandle }
|
|
261
261
|
className="block-selection-button_drag-handle"
|
|
262
|
-
aria-hidden="true"
|
|
263
262
|
label={ dragHandleLabel }
|
|
264
263
|
// Should not be able to tab to drag handle as this
|
|
265
264
|
// button can only be used with a pointer device.
|
|
@@ -251,12 +251,11 @@ export default function BlockTools( {
|
|
|
251
251
|
name="__unstable-block-tools-after"
|
|
252
252
|
ref={ blockToolbarAfterRef }
|
|
253
253
|
/>
|
|
254
|
-
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
) }
|
|
254
|
+
{ isZoomOutMode && (
|
|
255
|
+
<ZoomOutModeInserters
|
|
256
|
+
__unstableContentRef={ __unstableContentRef }
|
|
257
|
+
/>
|
|
258
|
+
) }
|
|
260
259
|
</InsertionPointOpenRef.Provider>
|
|
261
260
|
</div>
|
|
262
261
|
);
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
import { store as blockEditorStore } from '../../store';
|
|
18
|
-
import {
|
|
18
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
19
19
|
import { hasStickyOrFixedPositionValue } from '../../hooks/position';
|
|
20
20
|
|
|
21
21
|
const COMMON_PROPS = {
|
|
@@ -29,10 +29,11 @@ export function useShowBlockTools() {
|
|
|
29
29
|
const clientId =
|
|
30
30
|
getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
|
|
31
31
|
|
|
32
|
-
const block = getBlock( clientId )
|
|
32
|
+
const block = getBlock( clientId );
|
|
33
33
|
const editorMode = __unstableGetEditorMode();
|
|
34
|
-
const hasSelectedBlock = clientId && block
|
|
35
|
-
const isEmptyDefaultBlock =
|
|
34
|
+
const hasSelectedBlock = !! clientId && !! block;
|
|
35
|
+
const isEmptyDefaultBlock =
|
|
36
|
+
hasSelectedBlock && isUnmodifiedDefaultBlock( block );
|
|
36
37
|
const _showEmptyBlockSideInserter =
|
|
37
38
|
clientId &&
|
|
38
39
|
! isTyping() &&
|
|
@@ -43,8 +44,14 @@ export function useShowBlockTools() {
|
|
|
43
44
|
! hasMultiSelection() &&
|
|
44
45
|
editorMode === 'navigation';
|
|
45
46
|
|
|
47
|
+
const isZoomOut = editorMode === 'zoom-out';
|
|
48
|
+
const _showZoomOutToolbar =
|
|
49
|
+
isZoomOut &&
|
|
50
|
+
block?.attributes?.align === 'full' &&
|
|
51
|
+
! _showEmptyBlockSideInserter &&
|
|
52
|
+
! maybeShowBreadcrumb;
|
|
46
53
|
const _showBlockToolbarPopover =
|
|
47
|
-
|
|
54
|
+
! _showZoomOutToolbar &&
|
|
48
55
|
! getSettings().hasFixedToolbar &&
|
|
49
56
|
! _showEmptyBlockSideInserter &&
|
|
50
57
|
hasSelectedBlock &&
|
|
@@ -56,11 +63,7 @@ export function useShowBlockTools() {
|
|
|
56
63
|
showBreadcrumb:
|
|
57
64
|
! _showEmptyBlockSideInserter && maybeShowBreadcrumb,
|
|
58
65
|
showBlockToolbarPopover: _showBlockToolbarPopover,
|
|
59
|
-
showZoomOutToolbar:
|
|
60
|
-
editorMode === 'zoom-out' &&
|
|
61
|
-
! _showEmptyBlockSideInserter &&
|
|
62
|
-
! maybeShowBreadcrumb &&
|
|
63
|
-
! _showBlockToolbarPopover,
|
|
66
|
+
showZoomOutToolbar: _showZoomOutToolbar,
|
|
64
67
|
};
|
|
65
68
|
}, [] );
|
|
66
69
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useState } from '@wordpress/element';
|
|
10
|
+
import { Button } from '@wordpress/components';
|
|
11
|
+
import { plus } from '@wordpress/icons';
|
|
12
|
+
import { _x } from '@wordpress/i18n';
|
|
13
|
+
|
|
14
|
+
function ZoomOutModeInserterButton( { isVisible, onClick } ) {
|
|
15
|
+
const [
|
|
16
|
+
zoomOutModeInserterButtonHovered,
|
|
17
|
+
setZoomOutModeInserterButtonHovered,
|
|
18
|
+
] = useState( false );
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Button
|
|
22
|
+
variant="primary"
|
|
23
|
+
icon={ plus }
|
|
24
|
+
size="compact"
|
|
25
|
+
className={ clsx(
|
|
26
|
+
'block-editor-button-pattern-inserter__button',
|
|
27
|
+
'block-editor-block-tools__zoom-out-mode-inserter-button',
|
|
28
|
+
{
|
|
29
|
+
'is-visible': isVisible || zoomOutModeInserterButtonHovered,
|
|
30
|
+
}
|
|
31
|
+
) }
|
|
32
|
+
onClick={ onClick }
|
|
33
|
+
onMouseOver={ () => {
|
|
34
|
+
setZoomOutModeInserterButtonHovered( true );
|
|
35
|
+
} }
|
|
36
|
+
onMouseOut={ () => {
|
|
37
|
+
setZoomOutModeInserterButtonHovered( false );
|
|
38
|
+
} }
|
|
39
|
+
label={ _x(
|
|
40
|
+
'Add pattern',
|
|
41
|
+
'Generic label for pattern inserter button'
|
|
42
|
+
) }
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default ZoomOutModeInserterButton;
|
|
@@ -1,58 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { useEffect,
|
|
6
|
-
import { Button } from '@wordpress/components';
|
|
7
|
-
import { plus } from '@wordpress/icons';
|
|
8
|
-
import { _x } from '@wordpress/i18n';
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { useEffect, useState } from '@wordpress/element';
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* Internal dependencies
|
|
12
9
|
*/
|
|
13
10
|
import BlockPopoverInbetween from '../block-popover/inbetween';
|
|
11
|
+
import ZoomOutModeInserterButton from './zoom-out-mode-inserter-button';
|
|
14
12
|
import { store as blockEditorStore } from '../../store';
|
|
15
13
|
import { unlock } from '../../lock-unlock';
|
|
16
14
|
|
|
17
15
|
function ZoomOutModeInserters() {
|
|
18
16
|
const [ isReady, setIsReady ] = useState( false );
|
|
19
17
|
const {
|
|
18
|
+
hasSelection,
|
|
19
|
+
blockInsertionPoint,
|
|
20
20
|
blockOrder,
|
|
21
|
-
|
|
22
|
-
insertionPoint,
|
|
21
|
+
blockInsertionPointVisible,
|
|
23
22
|
setInserterIsOpened,
|
|
24
|
-
|
|
23
|
+
sectionRootClientId,
|
|
24
|
+
selectedBlockClientId,
|
|
25
|
+
hoveredBlockClientId,
|
|
25
26
|
} = useSelect( ( select ) => {
|
|
26
|
-
const {
|
|
27
|
-
|
|
27
|
+
const {
|
|
28
|
+
getSettings,
|
|
29
|
+
getBlockInsertionPoint,
|
|
30
|
+
getBlockOrder,
|
|
31
|
+
getSelectionStart,
|
|
32
|
+
getSelectedBlockClientId,
|
|
33
|
+
getHoveredBlockClientId,
|
|
34
|
+
isBlockInsertionPointVisible,
|
|
35
|
+
} = select( blockEditorStore );
|
|
28
36
|
const { sectionRootClientId: root } = unlock( getSettings() );
|
|
29
|
-
// To do: move ZoomOutModeInserters to core/editor.
|
|
30
|
-
// Or we perhaps we should move the insertion point state to the
|
|
31
|
-
// block-editor store. I'm not sure what it was ever moved to the editor
|
|
32
|
-
// store, because all the inserter components all live in the
|
|
33
|
-
// block-editor package.
|
|
34
|
-
// eslint-disable-next-line @wordpress/data-no-store-string-literals
|
|
35
|
-
const editor = select( 'core/editor' );
|
|
36
37
|
return {
|
|
37
38
|
hasSelection: !! getSelectionStart().clientId,
|
|
39
|
+
blockInsertionPoint: getBlockInsertionPoint(),
|
|
38
40
|
blockOrder: getBlockOrder( root ),
|
|
39
|
-
|
|
41
|
+
blockInsertionPointVisible: isBlockInsertionPointVisible(),
|
|
40
42
|
sectionRootClientId: root,
|
|
41
43
|
setInserterIsOpened:
|
|
42
44
|
getSettings().__experimentalSetIsInserterOpened,
|
|
45
|
+
selectedBlockClientId: getSelectedBlockClientId(),
|
|
46
|
+
hoveredBlockClientId: getHoveredBlockClientId(),
|
|
43
47
|
};
|
|
44
48
|
}, [] );
|
|
45
49
|
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
useEffect( () => {
|
|
49
|
-
if ( ! isMounted.current ) {
|
|
50
|
-
isMounted.current = true;
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
// reset insertion point when the block order changes
|
|
54
|
-
setInserterIsOpened( true );
|
|
55
|
-
}, [ blockOrder, setInserterIsOpened ] );
|
|
50
|
+
const { showInsertionPoint } = useDispatch( blockEditorStore );
|
|
56
51
|
|
|
57
52
|
// Defer the initial rendering to avoid the jumps due to the animation.
|
|
58
53
|
useEffect( () => {
|
|
@@ -64,18 +59,33 @@ function ZoomOutModeInserters() {
|
|
|
64
59
|
};
|
|
65
60
|
}, [] );
|
|
66
61
|
|
|
67
|
-
if ( ! isReady
|
|
62
|
+
if ( ! isReady ) {
|
|
68
63
|
return null;
|
|
69
64
|
}
|
|
70
65
|
|
|
71
66
|
return [ undefined, ...blockOrder ].map( ( clientId, index ) => {
|
|
67
|
+
const shouldRenderInsertionPoint =
|
|
68
|
+
blockInsertionPointVisible && blockInsertionPoint.index === index;
|
|
69
|
+
|
|
70
|
+
const previousClientId = clientId;
|
|
71
|
+
const nextClientId = blockOrder[ index ];
|
|
72
|
+
|
|
73
|
+
const isSelected =
|
|
74
|
+
hasSelection &&
|
|
75
|
+
( selectedBlockClientId === previousClientId ||
|
|
76
|
+
selectedBlockClientId === nextClientId );
|
|
77
|
+
|
|
78
|
+
const isHovered =
|
|
79
|
+
hoveredBlockClientId === previousClientId ||
|
|
80
|
+
hoveredBlockClientId === nextClientId;
|
|
81
|
+
|
|
72
82
|
return (
|
|
73
83
|
<BlockPopoverInbetween
|
|
74
84
|
key={ index }
|
|
75
|
-
previousClientId={
|
|
76
|
-
nextClientId={
|
|
85
|
+
previousClientId={ previousClientId }
|
|
86
|
+
nextClientId={ nextClientId }
|
|
77
87
|
>
|
|
78
|
-
{
|
|
88
|
+
{ shouldRenderInsertionPoint && (
|
|
79
89
|
<div
|
|
80
90
|
style={ {
|
|
81
91
|
borderRadius: '0',
|
|
@@ -87,12 +97,9 @@ function ZoomOutModeInserters() {
|
|
|
87
97
|
className="block-editor-block-list__insertion-point-indicator"
|
|
88
98
|
/>
|
|
89
99
|
) }
|
|
90
|
-
{
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
icon={ plus }
|
|
94
|
-
size="compact"
|
|
95
|
-
className="block-editor-button-pattern-inserter__button"
|
|
100
|
+
{ ! shouldRenderInsertionPoint && (
|
|
101
|
+
<ZoomOutModeInserterButton
|
|
102
|
+
isVisible={ isSelected || isHovered }
|
|
96
103
|
onClick={ () => {
|
|
97
104
|
setInserterIsOpened( {
|
|
98
105
|
rootClientId: sectionRootClientId,
|
|
@@ -100,11 +107,10 @@ function ZoomOutModeInserters() {
|
|
|
100
107
|
tab: 'patterns',
|
|
101
108
|
category: 'all',
|
|
102
109
|
} );
|
|
110
|
+
showInsertionPoint( sectionRootClientId, index, {
|
|
111
|
+
operation: 'insert',
|
|
112
|
+
} );
|
|
103
113
|
} }
|
|
104
|
-
label={ _x(
|
|
105
|
-
'Add pattern',
|
|
106
|
-
'Generic label for pattern inserter button'
|
|
107
|
-
) }
|
|
108
114
|
/>
|
|
109
115
|
) }
|
|
110
116
|
</BlockPopoverInbetween>
|
|
@@ -100,7 +100,6 @@ export default function ZoomOutToolbar( { clientId, rootClientId } ) {
|
|
|
100
100
|
<Button
|
|
101
101
|
icon={ dragHandle }
|
|
102
102
|
className="block-selection-button_drag-handle zoom-out-toolbar-button"
|
|
103
|
-
aria-hidden="true"
|
|
104
103
|
label={ __( 'Drag' ) }
|
|
105
104
|
iconSize={ 24 }
|
|
106
105
|
size="compact"
|
|
@@ -129,7 +128,7 @@ export default function ZoomOutToolbar( { clientId, rootClientId } ) {
|
|
|
129
128
|
<ToolbarButton
|
|
130
129
|
className="zoom-out-toolbar-button"
|
|
131
130
|
icon={ trash }
|
|
132
|
-
label=
|
|
131
|
+
label={ __( 'Delete' ) }
|
|
133
132
|
onClick={ () => {
|
|
134
133
|
removeBlock( clientId );
|
|
135
134
|
} }
|
|
@@ -45,7 +45,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
45
45
|
font-weight: 500;
|
|
46
46
|
line-height: 1.4;
|
|
47
47
|
text-transform: uppercase;
|
|
48
|
-
display:
|
|
48
|
+
display: block;
|
|
49
49
|
margin-bottom: calc(4px * 2);
|
|
50
50
|
padding: 0;
|
|
51
51
|
}
|
|
@@ -220,7 +220,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
220
220
|
aria-label="Color: red"
|
|
221
221
|
aria-selected="true"
|
|
222
222
|
class="components-button components-circular-option-picker__option"
|
|
223
|
-
data-active-item=""
|
|
223
|
+
data-active-item="true"
|
|
224
224
|
id="components-circular-option-picker-0-0"
|
|
225
225
|
role="option"
|
|
226
226
|
style="background-color: rgb(255, 0, 0); color: rgb(255, 0, 0);"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { screen } from '@testing-library/react';
|
|
5
|
+
import { render } from '@ariakit/test/react';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -12,7 +13,7 @@ const noop = () => {};
|
|
|
12
13
|
|
|
13
14
|
describe( 'ColorPaletteControl', () => {
|
|
14
15
|
it( 'renders tabs if it is possible to select a color and a gradient rendering a color picker at the start', async () => {
|
|
15
|
-
render(
|
|
16
|
+
await render(
|
|
16
17
|
<ColorGradientControl
|
|
17
18
|
label="Test Color Gradient"
|
|
18
19
|
colorValue="#f00"
|
|
@@ -10,18 +10,9 @@ import {
|
|
|
10
10
|
VisuallyHidden,
|
|
11
11
|
ToggleControl,
|
|
12
12
|
__experimentalVStack as VStack,
|
|
13
|
-
|
|
13
|
+
CustomSelectControl,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
import { unlock } from '../../lock-unlock';
|
|
20
|
-
|
|
21
|
-
const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
|
|
22
|
-
componentsPrivateApis
|
|
23
|
-
);
|
|
24
|
-
|
|
25
16
|
// So that we illustrate the different formats in the dropdown properly, show a date that is
|
|
26
17
|
// somwhat recent, has a day greater than 12, and a month with more than three letters.
|
|
27
18
|
const exampleDate = new Date();
|
|
@@ -126,7 +117,7 @@ function NonDefaultControls( { format, onChange } ) {
|
|
|
126
117
|
name: __( 'Custom' ),
|
|
127
118
|
className:
|
|
128
119
|
'block-editor-date-format-picker__custom-format-select-control__custom-option',
|
|
129
|
-
|
|
120
|
+
hint: __( 'Enter your own date format' ),
|
|
130
121
|
};
|
|
131
122
|
|
|
132
123
|
const [ isCustom, setIsCustom ] = useState(
|
|
@@ -24,10 +24,14 @@ import { store as blockEditorStore } from '../../store';
|
|
|
24
24
|
export const ZWNBSP = '\ufeff';
|
|
25
25
|
|
|
26
26
|
export default function DefaultBlockAppender( { rootClientId } ) {
|
|
27
|
-
const { showPrompt, isLocked, placeholder } = useSelect(
|
|
27
|
+
const { showPrompt, isLocked, placeholder, isManualGrid } = useSelect(
|
|
28
28
|
( select ) => {
|
|
29
|
-
const {
|
|
30
|
-
|
|
29
|
+
const {
|
|
30
|
+
getBlockCount,
|
|
31
|
+
getSettings,
|
|
32
|
+
getTemplateLock,
|
|
33
|
+
getBlockAttributes,
|
|
34
|
+
} = select( blockEditorStore );
|
|
31
35
|
|
|
32
36
|
const isEmpty = ! getBlockCount( rootClientId );
|
|
33
37
|
const { bodyPlaceholder } = getSettings();
|
|
@@ -36,6 +40,9 @@ export default function DefaultBlockAppender( { rootClientId } ) {
|
|
|
36
40
|
showPrompt: isEmpty,
|
|
37
41
|
isLocked: !! getTemplateLock( rootClientId ),
|
|
38
42
|
placeholder: bodyPlaceholder,
|
|
43
|
+
isManualGrid:
|
|
44
|
+
getBlockAttributes( rootClientId )?.layout
|
|
45
|
+
?.isManualPlacement,
|
|
39
46
|
};
|
|
40
47
|
},
|
|
41
48
|
[ rootClientId ]
|
|
@@ -43,7 +50,7 @@ export default function DefaultBlockAppender( { rootClientId } ) {
|
|
|
43
50
|
|
|
44
51
|
const { insertDefaultBlock, startTyping } = useDispatch( blockEditorStore );
|
|
45
52
|
|
|
46
|
-
if ( isLocked ) {
|
|
53
|
+
if ( isLocked || isManualGrid ) {
|
|
47
54
|
return null;
|
|
48
55
|
}
|
|
49
56
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { CustomSelectControl } from '@wordpress/components';
|
|
5
5
|
import { useMemo } from '@wordpress/element';
|
|
6
6
|
import { __, sprintf } from '@wordpress/i18n';
|
|
7
7
|
|
|
@@ -9,11 +9,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
import { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';
|
|
12
|
-
import { unlock } from '../../lock-unlock';
|
|
13
12
|
|
|
14
|
-
const { CustomSelectControlV2Legacy: CustomSelectControl } = unlock(
|
|
15
|
-
componentsPrivateApis
|
|
16
|
-
);
|
|
17
13
|
/**
|
|
18
14
|
* Adjusts font appearance field label in case either font styles or weights
|
|
19
15
|
* are disabled.
|
|
@@ -24,6 +24,7 @@ const MyFontFamilyControl = () => {
|
|
|
24
24
|
onChange={ ( newFontFamily ) => {
|
|
25
25
|
setFontFamily( newFontFamily );
|
|
26
26
|
} }
|
|
27
|
+
__nextHasNoMarginBottom
|
|
27
28
|
/>
|
|
28
29
|
);
|
|
29
30
|
};
|
|
@@ -69,3 +70,10 @@ The current font family value.
|
|
|
69
70
|
- Default: ''
|
|
70
71
|
|
|
71
72
|
The rest of the props are passed down to the underlying `<SelectControl />` instance.
|
|
73
|
+
|
|
74
|
+
#### `__nextHasNoMarginBottom`
|
|
75
|
+
|
|
76
|
+
- **Type:** `boolean`
|
|
77
|
+
- **Default:** `false`
|
|
78
|
+
|
|
79
|
+
Start opting into the new margin-free styles that will become the default in a future version.
|