@wordpress/block-editor 13.4.0 → 14.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +20 -15
- package/build/autocompleters/block.js +1 -1
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +3 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-draggable/index.js +2 -2
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +2 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +24 -32
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +11 -4
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-mover/index.js +1 -2
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-popover/cover.js +1 -1
- package/build/components/block-popover/cover.js.map +1 -1
- package/build/components/block-popover/inbetween.js +2 -2
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +2 -2
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +28 -34
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +1 -2
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +1 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +14 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +2 -1
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +22 -19
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js +0 -1
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build/components/border-radius-control/index.js +1 -0
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +3 -1
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +1 -1
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +2 -0
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +1 -0
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/font-appearance-control/index.js +3 -0
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +15 -0
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +153 -77
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +3 -1
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/hooks.js +0 -7
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +1 -0
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/index.js +0 -6
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +0 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +59 -40
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +80 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +30 -26
- package/build/components/grid/grid-item-movers.js.map +1 -1
- package/build/components/grid/grid-item-resizer.js +14 -15
- package/build/components/grid/grid-item-resizer.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +21 -6
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +56 -20
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/height-control/index.js +1 -0
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/iframe/index.js +2 -4
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +11 -7
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +8 -8
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +7 -25
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +9 -11
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +29 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/library.js +4 -2
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +32 -14
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +4 -0
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/line-height-control/index.js +3 -15
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +0 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/media-placeholder/index.js +9 -4
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +3 -1
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +4 -1
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +12 -12
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/resolution-tool/index.js +1 -0
- package/build/components/resolution-tool/index.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +4 -2
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +8 -8
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/text-alignment-control/index.js +13 -8
- package/build/components/text-alignment-control/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +13 -8
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +13 -8
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/url-input/button.js +0 -1
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +1 -11
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -0
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/link-editor.js +0 -1
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +42 -4
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +3 -6
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +1 -3
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +2 -1
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-mode-control/index.js +13 -8
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/background.js +19 -23
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-bindings.js +209 -39
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/block-hooks.js +1 -0
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +2 -2
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/contrast-checker.js +6 -6
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/duotone.js +3 -3
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +7 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/line-height.js +0 -1
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/spacing-visualizer.js +1 -1
- package/build/hooks/spacing-visualizer.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +4 -0
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/use-zoom-out.js +1 -1
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +20 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/layouts/constrained.js +1 -0
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +2 -0
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/grid.js +3 -0
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +3 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +9 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/private-selectors.js +30 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +10 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +4 -4
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-bindings.js +112 -0
- package/build/utils/block-bindings.js.map +1 -0
- package/build/utils/get-editor-region.js +1 -1
- package/build/utils/get-editor-region.js.map +1 -1
- package/build/utils/get-px-from-css-unit.js +1 -1
- package/build/utils/get-px-from-css-unit.js.map +1 -1
- package/build-module/autocompleters/block.js +1 -1
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +4 -2
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +3 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +2 -2
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-refs.js +24 -34
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +11 -4
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-mover/index.js +1 -2
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-popover/cover.js +1 -1
- package/build-module/components/block-popover/cover.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +1 -1
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +1 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.js +29 -34
- package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +1 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +1 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +14 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +2 -1
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +23 -20
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +0 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +1 -0
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +3 -1
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +1 -1
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +2 -0
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +1 -0
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +3 -0
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +14 -0
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +156 -80
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +3 -1
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +0 -6
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +1 -0
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +0 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +61 -42
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +77 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +30 -26
- package/build-module/components/grid/grid-item-movers.js.map +1 -1
- package/build-module/components/grid/grid-item-resizer.js +14 -15
- package/build-module/components/grid/grid-item-resizer.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +21 -6
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +56 -20
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/height-control/index.js +1 -0
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +2 -4
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +12 -8
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +7 -6
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +6 -23
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +9 -11
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +30 -3
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/library.js +4 -2
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +32 -14
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +5 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/line-height-control/index.js +3 -14
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +0 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +9 -4
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +3 -1
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +4 -1
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +12 -12
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/resolution-tool/index.js +1 -0
- package/build-module/components/resolution-tool/index.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +5 -3
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +8 -8
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/text-alignment-control/index.js +13 -8
- package/build-module/components/text-alignment-control/index.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +13 -8
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +13 -8
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/url-input/button.js +0 -1
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -11
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +2 -0
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +0 -1
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +42 -4
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +3 -6
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +1 -3
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +2 -1
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +13 -8
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/background.js +19 -23
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-bindings.js +214 -43
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/block-hooks.js +1 -0
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +3 -3
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/contrast-checker.js +7 -7
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/duotone.js +4 -4
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +2 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/line-height.js +0 -1
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/spacing-visualizer.js +1 -1
- package/build-module/hooks/spacing-visualizer.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +3 -0
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +1 -1
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +19 -0
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/constrained.js +1 -0
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +2 -0
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/grid.js +3 -0
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +4 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +9 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-selectors.js +27 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +9 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +4 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-bindings.js +105 -0
- package/build-module/utils/block-bindings.js.map +1 -0
- package/build-module/utils/get-editor-region.js +1 -1
- package/build-module/utils/get-editor-region.js.map +1 -1
- package/build-module/utils/get-px-from-css-unit.js +1 -1
- package/build-module/utils/get-px-from-css-unit.js.map +1 -1
- package/build-style/content-rtl.css +12 -26
- package/build-style/content.css +12 -26
- package/build-style/default-editor-styles-rtl.css +5 -2
- package/build-style/default-editor-styles.css +5 -2
- package/build-style/style-rtl.css +123 -83
- package/build-style/style.css +123 -83
- package/package.json +32 -32
- package/src/autocompleters/block.js +2 -1
- package/src/autocompleters/style.scss +4 -0
- package/src/components/block-breadcrumb/index.js +4 -2
- package/src/components/block-canvas/style.scss +1 -0
- package/src/components/block-draggable/index.js +3 -3
- package/src/components/block-list/content.scss +5 -13
- package/src/components/block-list/use-block-props/index.js +2 -2
- package/src/components/block-list/use-block-props/use-block-refs.js +27 -43
- package/src/components/block-list/use-in-between-inserter.js +17 -5
- package/src/components/block-mover/index.js +5 -2
- package/src/components/block-popover/cover.js +1 -1
- package/src/components/block-popover/inbetween.js +1 -1
- package/src/components/block-popover/index.js +1 -1
- package/src/components/block-settings-menu/block-mode-toggle.js +28 -31
- package/src/components/block-settings-menu/test/block-mode-toggle.js +26 -23
- package/src/components/block-tools/block-selection-button.js +1 -2
- package/src/components/block-tools/index.js +5 -6
- package/src/components/block-tools/insertion-point.js +11 -0
- package/src/components/block-tools/style.scss +1 -1
- package/src/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/src/components/block-tools/use-show-block-tools.js +4 -1
- package/src/components/block-tools/zoom-out-mode-inserters.js +21 -19
- package/src/components/block-tools/zoom-out-toolbar.js +0 -1
- package/src/components/block-variation-transforms/style.scss +1 -1
- package/src/components/border-radius-control/index.js +1 -0
- package/src/components/border-radius-control/style.scss +0 -10
- package/src/components/button-block-appender/content.scss +1 -1
- package/src/components/child-layout-control/index.js +2 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
- package/src/components/colors-gradients/test/control.js +3 -2
- package/src/components/convert-to-group-buttons/index.js +1 -1
- package/src/components/date-format-picker/index.js +2 -0
- package/src/components/dimensions-tool/scale-tool.js +1 -0
- package/src/components/font-appearance-control/index.js +3 -0
- package/src/components/font-family/README.md +17 -0
- package/src/components/font-family/index.js +19 -0
- package/src/components/font-family/stories/index.story.js +54 -0
- package/src/components/global-styles/background-panel.js +180 -93
- package/src/components/global-styles/get-global-styles-changes.js +4 -1
- package/src/components/global-styles/hooks.js +0 -5
- package/src/components/global-styles/image-settings-panel.js +1 -0
- package/src/components/global-styles/index.js +0 -1
- package/src/components/global-styles/style.scss +13 -12
- package/src/components/global-styles/test/use-global-styles-output.js +68 -7
- package/src/components/global-styles/test/utils.js +120 -0
- package/src/components/global-styles/typography-panel.js +0 -1
- package/src/components/global-styles/use-global-styles-output.js +71 -53
- package/src/components/global-styles/utils.js +90 -0
- package/src/components/grid/grid-item-movers.js +46 -44
- package/src/components/grid/grid-item-resizer.js +11 -17
- package/src/components/grid/grid-visualizer.js +23 -8
- package/src/components/grid/style.scss +60 -10
- package/src/components/grid/use-grid-layout-sync.js +68 -14
- package/src/components/height-control/index.js +1 -0
- package/src/components/iframe/content.scss +2 -2
- package/src/components/iframe/index.js +1 -3
- package/src/components/image-editor/zoom-dropdown.js +17 -9
- package/src/components/inner-blocks/button-block-appender.js +5 -7
- package/src/components/inner-blocks/default-block-appender.js +4 -23
- package/src/components/inner-blocks/index.js +10 -9
- package/src/components/inserter/category-tabs/index.js +35 -2
- package/src/components/inserter/library.js +2 -0
- package/src/components/inserter/menu.js +34 -29
- package/src/components/inserter/quick-inserter.js +4 -1
- package/src/components/inserter/style.scss +17 -12
- package/src/components/inserter-list-item/style.scss +1 -0
- package/src/components/inspector-controls/README.md +5 -0
- package/src/components/line-height-control/README.md +4 -5
- package/src/components/line-height-control/index.js +4 -21
- package/src/components/line-height-control/stories/index.story.js +0 -1
- package/src/components/line-height-control/test/index.js +1 -7
- package/src/components/link-control/search-input.js +0 -1
- package/src/components/link-control/style.scss +1 -1
- package/src/components/media-placeholder/index.js +12 -7
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +3 -1
- package/src/components/media-upload/README.md +2 -0
- package/src/components/media-upload/index.native.js +2 -0
- package/src/components/multi-selection-inspector/index.js +8 -9
- package/src/components/resolution-tool/index.js +1 -0
- package/src/components/responsive-block-control/README.md +1 -0
- package/src/components/responsive-block-control/test/index.js +6 -1
- package/src/components/skip-to-selected-block/index.js +5 -3
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +11 -10
- package/src/components/spacing-sizes-control/style.scss +16 -16
- package/src/components/tabbed-sidebar/style.scss +1 -19
- package/src/components/text-alignment-control/index.js +20 -8
- package/src/components/text-decoration-control/index.js +20 -8
- package/src/components/text-decoration-control/stories/index.story.js +0 -4
- package/src/components/text-transform-control/index.js +20 -8
- package/src/components/text-transform-control/stories/index.story.js +0 -4
- package/src/components/url-input/README.md +0 -5
- package/src/components/url-input/button.js +0 -1
- package/src/components/url-input/index.js +1 -15
- package/src/components/url-input/style.scss +2 -2
- package/src/components/url-popover/image-url-input-ui.js +2 -0
- package/src/components/url-popover/link-editor.js +0 -1
- package/src/components/use-block-drop-zone/index.js +86 -16
- package/src/components/use-on-block-drop/index.js +1 -9
- package/src/components/use-resize-canvas/index.js +1 -3
- package/src/components/use-settings/index.js +2 -1
- package/src/components/writing-mode-control/index.js +20 -8
- package/src/hooks/background.js +21 -27
- package/src/hooks/block-bindings.js +248 -54
- package/src/hooks/block-bindings.scss +13 -2
- package/src/hooks/block-hooks.js +1 -0
- package/src/hooks/block-hooks.scss +1 -0
- package/src/hooks/block-style-variation.js +3 -3
- package/src/hooks/contrast-checker.js +7 -7
- package/src/hooks/duotone.js +4 -4
- package/src/hooks/index.js +2 -1
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/spacing-visualizer.js +1 -1
- package/src/hooks/test/background.js +60 -0
- package/src/hooks/use-bindings-attributes.js +4 -0
- package/src/hooks/use-editor-wrapper-styles.native.scss +1 -0
- package/src/hooks/use-zoom-out.js +1 -1
- package/src/hooks/utils.js +14 -1
- package/src/index.js +1 -0
- package/src/layouts/constrained.js +1 -0
- package/src/layouts/flex.js +2 -0
- package/src/layouts/grid.js +3 -0
- package/src/private-apis.js +3 -2
- package/src/store/actions.js +13 -5
- package/src/store/private-selectors.js +36 -0
- package/src/store/reducer.js +7 -0
- package/src/store/selectors.js +4 -4
- package/src/store/test/private-selectors.js +89 -0
- package/src/style.scss +1 -2
- package/src/utils/block-bindings.js +98 -0
- package/src/utils/get-editor-region.js +1 -1
- package/src/utils/get-px-from-css-unit.js +1 -1
- package/src/utils/test/transform-styles.js +49 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/global-styles/theme-file-uri-utils.js +0 -80
- package/build/components/global-styles/theme-file-uri-utils.js.map +0 -1
- package/build/components/inner-blocks/with-client-id.js +0 -28
- package/build/components/inner-blocks/with-client-id.js.map +0 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -30
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +0 -1
- package/build/components/segmented-text-control/index.js +0 -63
- package/build/components/segmented-text-control/index.js.map +0 -1
- package/build-module/components/global-styles/theme-file-uri-utils.js +0 -73
- package/build-module/components/global-styles/theme-file-uri-utils.js.map +0 -1
- package/build-module/components/inner-blocks/with-client-id.js +0 -21
- package/build-module/components/inner-blocks/with-client-id.js.map +0 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -23
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +0 -1
- package/build-module/components/segmented-text-control/index.js +0 -58
- package/build-module/components/segmented-text-control/index.js.map +0 -1
- package/src/components/global-styles/test/theme-file-uri-utils.js +0 -66
- package/src/components/global-styles/theme-file-uri-utils.js +0 -77
- package/src/components/inner-blocks/with-client-id.js +0 -19
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -25
- package/src/components/segmented-text-control/index.js +0 -63
- package/src/components/segmented-text-control/style.scss +0 -15
|
@@ -7,6 +7,7 @@ import fastDeepEqual from 'fast-deep-equal/es6';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useViewportMatch } from '@wordpress/compose';
|
|
10
|
+
import { getCSSValueFromRawStyle } from '@wordpress/style-engine';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
@@ -525,3 +526,92 @@ export function getBlockStyleVariationSelector( variation, blockSelector ) {
|
|
|
525
526
|
|
|
526
527
|
return result.join( ',' );
|
|
527
528
|
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Looks up a theme file URI based on a relative path.
|
|
532
|
+
*
|
|
533
|
+
* @param {string} file A relative path.
|
|
534
|
+
* @param {Array<Object>} themeFileURIs A collection of absolute theme file URIs and their corresponding file paths.
|
|
535
|
+
* @return {string} A resolved theme file URI, if one is found in the themeFileURIs collection.
|
|
536
|
+
*/
|
|
537
|
+
export function getResolvedThemeFilePath( file, themeFileURIs ) {
|
|
538
|
+
if ( ! file || ! themeFileURIs || ! Array.isArray( themeFileURIs ) ) {
|
|
539
|
+
return file;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const uri = themeFileURIs.find(
|
|
543
|
+
( themeFileUri ) => themeFileUri?.name === file
|
|
544
|
+
);
|
|
545
|
+
|
|
546
|
+
if ( ! uri?.href ) {
|
|
547
|
+
return file;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
return uri?.href;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Resolves ref values in theme JSON.
|
|
555
|
+
*
|
|
556
|
+
* @param {Object|string} ruleValue A block style value that may contain a reference to a theme.json value.
|
|
557
|
+
* @param {Object} tree A theme.json object.
|
|
558
|
+
* @return {*} The resolved value or incoming ruleValue.
|
|
559
|
+
*/
|
|
560
|
+
export function getResolvedRefValue( ruleValue, tree ) {
|
|
561
|
+
if ( ! ruleValue || ! tree ) {
|
|
562
|
+
return ruleValue;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/*
|
|
566
|
+
* Where the rule value is an object with a 'ref' property pointing
|
|
567
|
+
* to a path, this converts that path into the value at that path.
|
|
568
|
+
* For example: { "ref": "style.color.background" } => "#fff".
|
|
569
|
+
*/
|
|
570
|
+
if ( typeof ruleValue !== 'string' && ruleValue?.ref ) {
|
|
571
|
+
const refPath = ruleValue.ref.split( '.' );
|
|
572
|
+
const resolvedRuleValue = getCSSValueFromRawStyle(
|
|
573
|
+
getValueFromObjectPath( tree, refPath )
|
|
574
|
+
);
|
|
575
|
+
|
|
576
|
+
/*
|
|
577
|
+
* Presence of another ref indicates a reference to another dynamic value.
|
|
578
|
+
* Pointing to another dynamic value is not supported.
|
|
579
|
+
*/
|
|
580
|
+
if ( resolvedRuleValue?.ref ) {
|
|
581
|
+
return undefined;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
if ( ! resolvedRuleValue ) {
|
|
585
|
+
return ruleValue;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return resolvedRuleValue;
|
|
589
|
+
}
|
|
590
|
+
return ruleValue;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Resolves ref and relative path values in theme JSON.
|
|
595
|
+
*
|
|
596
|
+
* @param {Object|string} ruleValue A block style value that may contain a reference to a theme.json value.
|
|
597
|
+
* @param {Object} tree A theme.json object.
|
|
598
|
+
* @return {*} The resolved value or incoming ruleValue.
|
|
599
|
+
*/
|
|
600
|
+
export function getResolvedValue( ruleValue, tree ) {
|
|
601
|
+
if ( ! ruleValue || ! tree ) {
|
|
602
|
+
return ruleValue;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
// Resolve ref values.
|
|
606
|
+
const resolvedValue = getResolvedRefValue( ruleValue, tree );
|
|
607
|
+
|
|
608
|
+
// Resolve relative paths.
|
|
609
|
+
if ( resolvedValue?.url ) {
|
|
610
|
+
resolvedValue.url = getResolvedThemeFilePath(
|
|
611
|
+
resolvedValue.url,
|
|
612
|
+
tree?._links?.[ 'wp:theme-file' ]
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
return resolvedValue;
|
|
617
|
+
}
|
|
@@ -55,28 +55,29 @@ export function GridItemMovers( {
|
|
|
55
55
|
return (
|
|
56
56
|
<BlockControls group="parent">
|
|
57
57
|
<ToolbarGroup className="block-editor-grid-item-mover__move-button-container">
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
58
|
+
<div className="block-editor-grid-item-mover__move-horizontal-button-container is-left">
|
|
59
|
+
<GridItemMover
|
|
60
|
+
icon={ chevronLeft }
|
|
61
|
+
label={ __( 'Move left' ) }
|
|
62
|
+
description={ __( 'Move left' ) }
|
|
63
|
+
isDisabled={ columnStart <= 1 }
|
|
64
|
+
onClick={ () => {
|
|
65
|
+
onChange( {
|
|
66
|
+
columnStart: columnStart - 1,
|
|
67
|
+
} );
|
|
68
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
69
|
+
moveBlocksToPosition(
|
|
70
|
+
[ blockClientId ],
|
|
71
|
+
gridClientId,
|
|
72
|
+
gridClientId,
|
|
73
|
+
getNumberOfBlocksBeforeCell(
|
|
74
|
+
columnStart - 1,
|
|
75
|
+
rowStart
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
} }
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
80
81
|
<div className="block-editor-grid-item-mover__move-vertical-button-container">
|
|
81
82
|
<GridItemMover
|
|
82
83
|
className="is-up-button"
|
|
@@ -123,28 +124,29 @@ export function GridItemMovers( {
|
|
|
123
124
|
} }
|
|
124
125
|
/>
|
|
125
126
|
</div>
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
127
|
+
<div className="block-editor-grid-item-mover__move-horizontal-button-container is-right">
|
|
128
|
+
<GridItemMover
|
|
129
|
+
icon={ chevronRight }
|
|
130
|
+
label={ __( 'Move right' ) }
|
|
131
|
+
description={ __( 'Move right' ) }
|
|
132
|
+
isDisabled={ columnCount && columnEnd >= columnCount }
|
|
133
|
+
onClick={ () => {
|
|
134
|
+
onChange( {
|
|
135
|
+
columnStart: columnStart + 1,
|
|
136
|
+
} );
|
|
137
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
138
|
+
moveBlocksToPosition(
|
|
139
|
+
[ blockClientId ],
|
|
140
|
+
gridClientId,
|
|
141
|
+
gridClientId,
|
|
142
|
+
getNumberOfBlocksBeforeCell(
|
|
143
|
+
columnStart + 1,
|
|
144
|
+
rowStart
|
|
145
|
+
)
|
|
146
|
+
);
|
|
147
|
+
} }
|
|
148
|
+
/>
|
|
149
|
+
</div>
|
|
148
150
|
</ToolbarGroup>
|
|
149
151
|
</BlockControls>
|
|
150
152
|
);
|
|
@@ -7,7 +7,7 @@ import { useState, useEffect } from '@wordpress/element';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
11
11
|
import BlockPopoverCover from '../block-popover/cover';
|
|
12
12
|
import { getComputedCSS, getGridTracks, getClosestTrack } from './utils';
|
|
13
13
|
|
|
@@ -98,7 +98,7 @@ function GridItemResizerInner( {
|
|
|
98
98
|
<BlockPopoverCover
|
|
99
99
|
className="block-editor-grid-item-resizer"
|
|
100
100
|
clientId={ clientId }
|
|
101
|
-
__unstablePopoverSlot="block-
|
|
101
|
+
__unstablePopoverSlot="__unstable-block-tools-after"
|
|
102
102
|
additionalStyles={ styles }
|
|
103
103
|
>
|
|
104
104
|
<ResizableBox
|
|
@@ -119,6 +119,15 @@ function GridItemResizerInner( {
|
|
|
119
119
|
} }
|
|
120
120
|
bounds={ bounds }
|
|
121
121
|
boundsByDirection
|
|
122
|
+
onPointerDown={ ( { target, pointerId } ) => {
|
|
123
|
+
/*
|
|
124
|
+
* Captures the pointer to avoid hiccups while dragging over objects
|
|
125
|
+
* like iframes and ensures that the event to end the drag is
|
|
126
|
+
* captured by the target (resize handle) whether or not it’s under
|
|
127
|
+
* the pointer.
|
|
128
|
+
*/
|
|
129
|
+
target.setPointerCapture( pointerId );
|
|
130
|
+
} }
|
|
122
131
|
onResizeStart={ ( event, direction ) => {
|
|
123
132
|
/*
|
|
124
133
|
* The container justification and alignment need to be set
|
|
@@ -126,21 +135,6 @@ function GridItemResizerInner( {
|
|
|
126
135
|
* so that it resizes in the right direction.
|
|
127
136
|
*/
|
|
128
137
|
setResizeDirection( direction );
|
|
129
|
-
|
|
130
|
-
/*
|
|
131
|
-
* The mouseup event on the resize handle doesn't trigger if the mouse
|
|
132
|
-
* isn't directly above the handle, so we try to detect if it happens
|
|
133
|
-
* outside the grid and dispatch a mouseup event on the handle.
|
|
134
|
-
*/
|
|
135
|
-
blockElement.ownerDocument.addEventListener(
|
|
136
|
-
'mouseup',
|
|
137
|
-
() => {
|
|
138
|
-
event.target.dispatchEvent(
|
|
139
|
-
new Event( 'mouseup', { bubbles: true } )
|
|
140
|
-
);
|
|
141
|
-
},
|
|
142
|
-
{ once: true }
|
|
143
|
-
);
|
|
144
138
|
} }
|
|
145
139
|
onResizeStop={ ( event, direction, boxElement ) => {
|
|
146
140
|
const columnGap = parseFloat(
|
|
@@ -13,12 +13,13 @@ import { __experimentalUseDropZone as useDropZone } from '@wordpress/compose';
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
17
17
|
import BlockPopoverCover from '../block-popover/cover';
|
|
18
18
|
import { range, GridRect, getGridInfo } from './utils';
|
|
19
19
|
import { store as blockEditorStore } from '../../store';
|
|
20
20
|
import { useGetNumberOfBlocksBeforeCell } from './use-get-number-of-blocks-before-cell';
|
|
21
21
|
import ButtonBlockAppender from '../button-block-appender';
|
|
22
|
+
import { unlock } from '../../lock-unlock';
|
|
22
23
|
|
|
23
24
|
export function GridVisualizer( { clientId, contentRef, parentLayout } ) {
|
|
24
25
|
const isDistractionFree = useSelect(
|
|
@@ -118,19 +119,25 @@ const GridVisualizerGrid = forwardRef(
|
|
|
118
119
|
function ManualGridVisualizer( { gridClientId, gridInfo } ) {
|
|
119
120
|
const [ highlightedRect, setHighlightedRect ] = useState( null );
|
|
120
121
|
|
|
121
|
-
const
|
|
122
|
-
( select ) =>
|
|
122
|
+
const gridItemStyles = useSelect(
|
|
123
|
+
( select ) => {
|
|
124
|
+
const { getBlockOrder, getBlockStyles } = unlock(
|
|
125
|
+
select( blockEditorStore )
|
|
126
|
+
);
|
|
127
|
+
const blockOrder = getBlockOrder( gridClientId );
|
|
128
|
+
return getBlockStyles( blockOrder );
|
|
129
|
+
},
|
|
123
130
|
[ gridClientId ]
|
|
124
131
|
);
|
|
125
132
|
const occupiedRects = useMemo( () => {
|
|
126
133
|
const rects = [];
|
|
127
|
-
for ( const
|
|
134
|
+
for ( const style of Object.values( gridItemStyles ) ) {
|
|
128
135
|
const {
|
|
129
136
|
columnStart,
|
|
130
137
|
rowStart,
|
|
131
138
|
columnSpan = 1,
|
|
132
139
|
rowSpan = 1,
|
|
133
|
-
} =
|
|
140
|
+
} = style?.layout ?? {};
|
|
134
141
|
if ( ! columnStart || ! rowStart ) {
|
|
135
142
|
continue;
|
|
136
143
|
}
|
|
@@ -144,7 +151,7 @@ function ManualGridVisualizer( { gridClientId, gridInfo } ) {
|
|
|
144
151
|
);
|
|
145
152
|
}
|
|
146
153
|
return rects;
|
|
147
|
-
}, [
|
|
154
|
+
}, [ gridItemStyles ] );
|
|
148
155
|
|
|
149
156
|
return range( 1, gridInfo.numRows ).map( ( row ) =>
|
|
150
157
|
range( 1, gridInfo.numColumns ).map( ( column ) => {
|
|
@@ -206,8 +213,12 @@ function useGridVisualizerDropZone(
|
|
|
206
213
|
gridInfo,
|
|
207
214
|
setHighlightedRect
|
|
208
215
|
) {
|
|
209
|
-
const {
|
|
210
|
-
|
|
216
|
+
const {
|
|
217
|
+
getBlockAttributes,
|
|
218
|
+
getBlockRootClientId,
|
|
219
|
+
canInsertBlockType,
|
|
220
|
+
getBlockName,
|
|
221
|
+
} = useSelect( blockEditorStore );
|
|
211
222
|
const {
|
|
212
223
|
updateBlockAttributes,
|
|
213
224
|
moveBlocksToPosition,
|
|
@@ -221,6 +232,10 @@ function useGridVisualizerDropZone(
|
|
|
221
232
|
|
|
222
233
|
return useDropZoneWithValidation( {
|
|
223
234
|
validateDrag( srcClientId ) {
|
|
235
|
+
const blockName = getBlockName( srcClientId );
|
|
236
|
+
if ( ! canInsertBlockType( blockName, gridClientId ) ) {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
224
239
|
const attributes = getBlockAttributes( srcClientId );
|
|
225
240
|
const rect = new GridRect( {
|
|
226
241
|
columnStart: column,
|
|
@@ -105,7 +105,6 @@
|
|
|
105
105
|
.block-editor-grid-item-mover-button {
|
|
106
106
|
width: $block-toolbar-height * 0.5;
|
|
107
107
|
min-width: 0 !important; // overrides default button width.
|
|
108
|
-
overflow: hidden;
|
|
109
108
|
padding-left: 0;
|
|
110
109
|
padding-right: 0;
|
|
111
110
|
|
|
@@ -155,7 +154,7 @@
|
|
|
155
154
|
justify-content: space-around;
|
|
156
155
|
|
|
157
156
|
> .block-editor-grid-item-mover-button.block-editor-grid-item-mover-button {
|
|
158
|
-
height: $block-toolbar-height * 0.5 - $grid-unit-05;
|
|
157
|
+
height: $block-toolbar-height * 0.5 - $grid-unit-05 !important; // overrides toolbar button height.
|
|
159
158
|
width: 100%;
|
|
160
159
|
min-width: 0 !important; // overrides default button width.
|
|
161
160
|
|
|
@@ -173,18 +172,53 @@
|
|
|
173
172
|
}
|
|
174
173
|
}
|
|
175
174
|
|
|
175
|
+
.editor-collapsible-block-toolbar {
|
|
176
|
+
.block-editor-grid-item-mover__move-vertical-button-container {
|
|
177
|
+
// Move up a little to prevent the toolbar shift when focus is on the vertical movers.
|
|
178
|
+
@include break-small() {
|
|
179
|
+
height: $grid-unit-50;
|
|
180
|
+
position: relative;
|
|
181
|
+
top: -5px; // Should be -4px, but that causes scrolling when focus lands on the movers, in a 60px header.
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
176
186
|
.show-icon-labels {
|
|
177
187
|
|
|
178
|
-
.block-editor-grid-item-
|
|
179
|
-
|
|
180
|
-
padding-right: 12px;
|
|
181
|
-
}
|
|
188
|
+
.block-editor-grid-item-mover__move-horizontal-button-container {
|
|
189
|
+
position: relative;
|
|
182
190
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
191
|
+
&::before {
|
|
192
|
+
@include break-small() {
|
|
193
|
+
content: "";
|
|
194
|
+
height: 100%;
|
|
195
|
+
width: $border-width;
|
|
196
|
+
background: $gray-200;
|
|
197
|
+
position: absolute;
|
|
198
|
+
top: 0;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@include break-medium() {
|
|
202
|
+
background: $gray-900;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&.is-left {
|
|
207
|
+
padding-right: 6px;
|
|
187
208
|
|
|
209
|
+
&::before {
|
|
210
|
+
right: 0;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
&.is-right {
|
|
215
|
+
padding-left: 6px;
|
|
216
|
+
|
|
217
|
+
&::before {
|
|
218
|
+
left: 0;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
188
222
|
|
|
189
223
|
.block-editor-grid-item-mover__move-vertical-button-container {
|
|
190
224
|
&::before {
|
|
@@ -208,5 +242,21 @@
|
|
|
208
242
|
}
|
|
209
243
|
}
|
|
210
244
|
|
|
245
|
+
.block-editor-grid-item-mover-button {
|
|
246
|
+
white-space: nowrap;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.editor-collapsible-block-toolbar {
|
|
250
|
+
.block-editor-grid-item-mover__move-horizontal-button-container::before {
|
|
251
|
+
height: $grid-unit-30;
|
|
252
|
+
background: $gray-300;
|
|
253
|
+
top: $grid-unit-05;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.block-editor-grid-item-mover__move-vertical-button-container::before {
|
|
257
|
+
background: $gray-300;
|
|
258
|
+
width: calc(100% - #{$grid-unit-30});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
211
261
|
}
|
|
212
262
|
|
|
@@ -10,6 +10,7 @@ import { usePrevious } from '@wordpress/compose';
|
|
|
10
10
|
*/
|
|
11
11
|
import { store as blockEditorStore } from '../../store';
|
|
12
12
|
import { GridRect } from './utils';
|
|
13
|
+
import { setImmutably } from '../../utils/object';
|
|
13
14
|
|
|
14
15
|
export function useGridLayoutSync( { clientId: gridClientId } ) {
|
|
15
16
|
const { gridLayout, blockOrder, selectedBlockLayout } = useSelect(
|
|
@@ -26,7 +27,8 @@ export function useGridLayoutSync( { clientId: gridClientId } ) {
|
|
|
26
27
|
[ gridClientId ]
|
|
27
28
|
);
|
|
28
29
|
|
|
29
|
-
const { getBlockAttributes } =
|
|
30
|
+
const { getBlockAttributes, getBlockRootClientId } =
|
|
31
|
+
useSelect( blockEditorStore );
|
|
30
32
|
const { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } =
|
|
31
33
|
useDispatch( blockEditorStore );
|
|
32
34
|
|
|
@@ -37,6 +39,10 @@ export function useGridLayoutSync( { clientId: gridClientId } ) {
|
|
|
37
39
|
);
|
|
38
40
|
|
|
39
41
|
const previouslySelectedBlockRect = usePrevious( selectedBlockRect );
|
|
42
|
+
const previousIsManualPlacement = usePrevious(
|
|
43
|
+
gridLayout.isManualPlacement
|
|
44
|
+
);
|
|
45
|
+
const previousBlockOrder = usePrevious( blockOrder );
|
|
40
46
|
|
|
41
47
|
useEffect( () => {
|
|
42
48
|
const updates = {};
|
|
@@ -120,20 +126,65 @@ export function useGridLayoutSync( { clientId: gridClientId } ) {
|
|
|
120
126
|
},
|
|
121
127
|
};
|
|
122
128
|
}
|
|
129
|
+
|
|
130
|
+
// Unset grid layout attributes for blocks removed from the grid.
|
|
131
|
+
for ( const clientId of previousBlockOrder ?? [] ) {
|
|
132
|
+
if ( ! blockOrder.includes( clientId ) ) {
|
|
133
|
+
const rootClientId = getBlockRootClientId( clientId );
|
|
134
|
+
|
|
135
|
+
// Block was removed from the editor, so nothing to do.
|
|
136
|
+
if ( rootClientId === null ) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Check if the block is being moved to another grid.
|
|
141
|
+
// If so, do nothing and let the new grid parent handle
|
|
142
|
+
// the attributes.
|
|
143
|
+
const rootAttributes = getBlockAttributes( rootClientId );
|
|
144
|
+
if ( rootAttributes?.layout?.type === 'grid' ) {
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const attributes = getBlockAttributes( clientId );
|
|
149
|
+
const {
|
|
150
|
+
columnStart,
|
|
151
|
+
rowStart,
|
|
152
|
+
columnSpan,
|
|
153
|
+
rowSpan,
|
|
154
|
+
...layout
|
|
155
|
+
} = attributes.style?.layout ?? {};
|
|
156
|
+
|
|
157
|
+
if ( columnStart || rowStart || columnSpan || rowSpan ) {
|
|
158
|
+
const hasEmptyLayoutAttribute =
|
|
159
|
+
Object.keys( layout ).length === 0;
|
|
160
|
+
|
|
161
|
+
updates[ clientId ] = setImmutably(
|
|
162
|
+
attributes,
|
|
163
|
+
[ 'style', 'layout' ],
|
|
164
|
+
hasEmptyLayoutAttribute ? undefined : layout
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
123
169
|
} else {
|
|
124
|
-
//
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
attributes
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
layout
|
|
135
|
-
|
|
136
|
-
|
|
170
|
+
// Remove all of the columnStart and rowStart values
|
|
171
|
+
// when switching from manual to auto mode,
|
|
172
|
+
if ( previousIsManualPlacement === true ) {
|
|
173
|
+
for ( const clientId of blockOrder ) {
|
|
174
|
+
const attributes = getBlockAttributes( clientId );
|
|
175
|
+
const { columnStart, rowStart, ...layout } =
|
|
176
|
+
attributes.style?.layout ?? {};
|
|
177
|
+
// Only update attributes if columnStart or rowStart are set.
|
|
178
|
+
if ( columnStart || rowStart ) {
|
|
179
|
+
const hasEmptyLayoutAttribute =
|
|
180
|
+
Object.keys( layout ).length === 0;
|
|
181
|
+
|
|
182
|
+
updates[ clientId ] = setImmutably(
|
|
183
|
+
attributes,
|
|
184
|
+
[ 'style', 'layout' ],
|
|
185
|
+
hasEmptyLayoutAttribute ? undefined : layout
|
|
186
|
+
);
|
|
187
|
+
}
|
|
137
188
|
}
|
|
138
189
|
}
|
|
139
190
|
|
|
@@ -160,11 +211,14 @@ export function useGridLayoutSync( { clientId: gridClientId } ) {
|
|
|
160
211
|
// Actual deps to sync:
|
|
161
212
|
gridClientId,
|
|
162
213
|
gridLayout,
|
|
214
|
+
previousBlockOrder,
|
|
163
215
|
blockOrder,
|
|
164
216
|
previouslySelectedBlockRect,
|
|
217
|
+
previousIsManualPlacement,
|
|
165
218
|
// These won't change, but the linter thinks they might:
|
|
166
219
|
__unstableMarkNextChangeAsNotPersistent,
|
|
167
220
|
getBlockAttributes,
|
|
221
|
+
getBlockRootClientId,
|
|
168
222
|
updateBlockAttributes,
|
|
169
223
|
] );
|
|
170
224
|
}
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.block-editor-iframe__html {
|
|
25
|
+
border: 0 solid $gray-300;
|
|
25
26
|
transform-origin: top center;
|
|
26
|
-
|
|
27
|
-
@include reduce-motion("transition");
|
|
27
|
+
@include editor-canvas-resize-animation;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.block-editor-iframe__html.is-zoomed-out {
|
|
@@ -305,7 +305,7 @@ function Iframe( {
|
|
|
305
305
|
|
|
306
306
|
iframeDocument.documentElement.classList.add( 'is-zoomed-out' );
|
|
307
307
|
|
|
308
|
-
const maxWidth =
|
|
308
|
+
const maxWidth = 750;
|
|
309
309
|
iframeDocument.documentElement.style.setProperty(
|
|
310
310
|
'--wp-block-editor-iframe-zoom-out-scale',
|
|
311
311
|
scale === 'default'
|
|
@@ -378,10 +378,8 @@ function Iframe( {
|
|
|
378
378
|
<iframe
|
|
379
379
|
{ ...props }
|
|
380
380
|
style={ {
|
|
381
|
-
border: 0,
|
|
382
381
|
...props.style,
|
|
383
382
|
height: props.style?.height,
|
|
384
|
-
transition: 'all .3s',
|
|
385
383
|
} }
|
|
386
384
|
ref={ useMergeRefs( [ ref, setRef ] ) }
|
|
387
385
|
tabIndex={ tabIndex }
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ToolbarButton,
|
|
6
|
+
RangeControl,
|
|
7
|
+
Dropdown,
|
|
8
|
+
__experimentalDropdownContentWrapper as DropdownContentWrapper,
|
|
9
|
+
} from '@wordpress/components';
|
|
5
10
|
import { __ } from '@wordpress/i18n';
|
|
6
11
|
import { search } from '@wordpress/icons';
|
|
7
12
|
|
|
@@ -27,14 +32,17 @@ export default function ZoomDropdown() {
|
|
|
27
32
|
/>
|
|
28
33
|
) }
|
|
29
34
|
renderContent={ () => (
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
<DropdownContentWrapper paddingSize="medium">
|
|
36
|
+
<RangeControl
|
|
37
|
+
__next40pxDefaultSize
|
|
38
|
+
__nextHasNoMarginBottom
|
|
39
|
+
label={ __( 'Zoom' ) }
|
|
40
|
+
min={ MIN_ZOOM }
|
|
41
|
+
max={ MAX_ZOOM }
|
|
42
|
+
value={ Math.round( zoom ) }
|
|
43
|
+
onChange={ setZoom }
|
|
44
|
+
/>
|
|
45
|
+
</DropdownContentWrapper>
|
|
38
46
|
) }
|
|
39
47
|
/>
|
|
40
48
|
);
|
|
@@ -7,15 +7,15 @@ import clsx from 'clsx';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import BaseButtonBlockAppender from '../button-block-appender';
|
|
10
|
-
import
|
|
10
|
+
import { useBlockEditContext } from '../block-edit/context';
|
|
11
11
|
|
|
12
|
-
export
|
|
13
|
-
clientId,
|
|
12
|
+
export default function ButtonBlockAppender( {
|
|
14
13
|
showSeparator,
|
|
15
14
|
isFloating,
|
|
16
15
|
onAddBlock,
|
|
17
16
|
isToggle,
|
|
18
|
-
} )
|
|
17
|
+
} ) {
|
|
18
|
+
const { clientId } = useBlockEditContext();
|
|
19
19
|
return (
|
|
20
20
|
<BaseButtonBlockAppender
|
|
21
21
|
className={ clsx( {
|
|
@@ -27,6 +27,4 @@ export const ButtonBlockAppender = ( {
|
|
|
27
27
|
onAddBlock={ onAddBlock }
|
|
28
28
|
/>
|
|
29
29
|
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default withClientId( ButtonBlockAppender );
|
|
30
|
+
}
|