@wordpress/block-editor 10.3.0 → 10.5.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 +0 -1
- package/build/components/alignment-control/ui.js +1 -1
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/constants.js +1 -1
- package/build/components/block-alignment-control/constants.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +1 -1
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-compare/index.js +1 -3
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-edit/index.js +4 -2
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-list/block.js +3 -1
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-lock/menu-item.js +1 -1
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +16 -9
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-popover/inbetween.js +2 -1
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +2 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/index.js +2 -4
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +2 -8
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/utils.js +3 -3
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/index.js +21 -12
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +1 -1
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +12 -2
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +27 -4
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +1 -1
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/all-input-control.js +2 -1
- package/build/components/border-radius-control/all-input-control.js.map +1 -1
- package/build/components/border-radius-control/index.js +2 -1
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +2 -1
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/colors/with-colors.js +4 -3
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/duotone-control/index.js +1 -1
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +24 -40
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +8 -6
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/constants.js +1 -1
- package/build/components/image-editor/constants.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +10 -4
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +2 -7
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +4 -1
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter/search-items.js +23 -2
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/line-height-control/index.js +2 -1
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/index.js +18 -34
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/use-internal-input-value.js +26 -0
- package/build/components/link-control/use-internal-input-value.js.map +1 -0
- package/build/components/list-view/block.js +5 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +9 -3
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +2 -1
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/media-replace-flow/index.js +1 -1
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/off-canvas-editor/block-contents.js +100 -0
- package/build/components/off-canvas-editor/block-contents.js.map +1 -0
- package/build/components/off-canvas-editor/block-select-button.js +119 -0
- package/build/components/off-canvas-editor/block-select-button.js.map +1 -0
- package/build/components/off-canvas-editor/block.js +292 -0
- package/build/components/off-canvas-editor/block.js.map +1 -0
- package/build/components/off-canvas-editor/branch.js +181 -0
- package/build/components/off-canvas-editor/branch.js.map +1 -0
- package/build/components/off-canvas-editor/context.js +19 -0
- package/build/components/off-canvas-editor/context.js.map +1 -0
- package/build/components/off-canvas-editor/drop-indicator.js +118 -0
- package/build/components/off-canvas-editor/drop-indicator.js.map +1 -0
- package/build/components/off-canvas-editor/expander.js +41 -0
- package/build/components/off-canvas-editor/expander.js.map +1 -0
- package/build/components/off-canvas-editor/index.js +204 -0
- package/build/components/off-canvas-editor/index.js.map +1 -0
- package/build/components/off-canvas-editor/leaf.js +60 -0
- package/build/components/off-canvas-editor/leaf.js.map +1 -0
- package/build/components/off-canvas-editor/use-block-selection.js +139 -0
- package/build/components/off-canvas-editor/use-block-selection.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-client-ids.js +33 -0
- package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js +235 -0
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +60 -0
- package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
- package/build/components/off-canvas-editor/utils.js +60 -0
- package/build/components/off-canvas-editor/utils.js.map +1 -0
- package/build/components/rich-text/format-toolbar/index.js +1 -1
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +1 -1
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +1 -1
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/spacing-sizes-control/all-input-control.js +6 -2
- package/build/components/spacing-sizes-control/all-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/axial-input-controls.js +6 -2
- package/build/components/spacing-sizes-control/axial-input-controls.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +6 -2
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls.js +6 -2
- package/build/components/spacing-sizes-control/input-controls.js.map +1 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js +12 -5
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build/components/url-input/index.js +1 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/index.js +31 -2
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/use-setting/index.js +1 -1
- package/build/components/use-setting/index.js.map +1 -1
- package/build/hooks/border.js +1 -0
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color-panel.js +17 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +13 -6
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/dimensions.js +72 -13
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/font-size.js +1 -0
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/layout.js +5 -4
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/margin.js +26 -18
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/min-height.js +145 -0
- package/build/hooks/min-height.js.map +1 -0
- package/build/hooks/padding.js +22 -13
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +3 -2
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/utils.js +7 -6
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +0 -1
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +23 -22
- package/build/layouts/flex.js.map +1 -1
- package/build/store/actions.js +30 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/array.js +1 -7
- package/build/store/array.js.map +1 -1
- package/build/store/reducer.js +46 -14
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +62 -31
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +1 -1
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/constants.js +1 -1
- package/build-module/components/block-alignment-control/constants.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-compare/index.js +2 -3
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-edit/index.js +4 -2
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-list/block.js +3 -1
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-lock/menu-item.js +2 -2
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +17 -10
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +2 -1
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +2 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/index.js +2 -3
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -7
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/utils.js +3 -3
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/index.js +21 -11
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +12 -2
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +27 -5
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/all-input-control.js +2 -1
- package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +2 -1
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +2 -1
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/colors/with-colors.js +5 -4
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/duotone-control/index.js +1 -1
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +24 -40
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +9 -7
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/constants.js +1 -1
- package/build-module/components/image-editor/constants.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +10 -4
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +2 -6
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +3 -1
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter/search-items.js +23 -3
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/line-height-control/index.js +2 -1
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/index.js +17 -34
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/use-internal-input-value.js +18 -0
- package/build-module/components/link-control/use-internal-input-value.js.map +1 -0
- package/build-module/components/list-view/block.js +5 -3
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +9 -3
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +2 -1
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +1 -1
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-contents.js +85 -0
- package/build-module/components/off-canvas-editor/block-contents.js.map +1 -0
- package/build-module/components/off-canvas-editor/block-select-button.js +101 -0
- package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -0
- package/build-module/components/off-canvas-editor/block.js +268 -0
- package/build-module/components/off-canvas-editor/block.js.map +1 -0
- package/build-module/components/off-canvas-editor/branch.js +165 -0
- package/build-module/components/off-canvas-editor/branch.js.map +1 -0
- package/build-module/components/off-canvas-editor/context.js +7 -0
- package/build-module/components/off-canvas-editor/context.js.map +1 -0
- package/build-module/components/off-canvas-editor/drop-indicator.js +111 -0
- package/build-module/components/off-canvas-editor/drop-indicator.js.map +1 -0
- package/build-module/components/off-canvas-editor/expander.js +32 -0
- package/build-module/components/off-canvas-editor/expander.js.map +1 -0
- package/build-module/components/off-canvas-editor/index.js +181 -0
- package/build-module/components/off-canvas-editor/index.js.map +1 -0
- package/build-module/components/off-canvas-editor/leaf.js +45 -0
- package/build-module/components/off-canvas-editor/leaf.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-block-selection.js +124 -0
- package/build-module/components/off-canvas-editor/use-block-selection.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +24 -0
- package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +220 -0
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +50 -0
- package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
- package/build-module/components/off-canvas-editor/utils.js +44 -0
- package/build-module/components/off-canvas-editor/utils.js.map +1 -0
- package/build-module/components/rich-text/format-toolbar/index.js +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +1 -1
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/spacing-sizes-control/all-input-control.js +6 -2
- package/build-module/components/spacing-sizes-control/all-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/axial-input-controls.js +6 -2
- package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +6 -2
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls.js +6 -2
- package/build-module/components/spacing-sizes-control/input-controls.js.map +1 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js +12 -5
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/index.js +30 -3
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/use-setting/index.js +1 -1
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/hooks/border.js +1 -0
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color-panel.js +17 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +15 -8
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/dimensions.js +67 -12
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/font-size.js +1 -0
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/layout.js +6 -5
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/margin.js +27 -19
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/min-height.js +122 -0
- package/build-module/hooks/min-height.js.map +1 -0
- package/build-module/hooks/padding.js +23 -14
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +4 -3
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/utils.js +7 -7
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +0 -1
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +24 -23
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/store/actions.js +26 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/array.js +1 -6
- package/build-module/store/array.js.map +1 -1
- package/build-module/store/reducer.js +44 -14
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +59 -31
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +88 -88
- package/build-style/style.css +84 -84
- package/package.json +29 -28
- package/src/components/alignment-control/README.md +1 -1
- package/src/components/alignment-control/ui.js +1 -1
- package/src/components/block-alignment-control/constants.js +1 -1
- package/src/components/block-alignment-control/test/index.native.js +4 -4
- package/src/components/block-alignment-matrix-control/index.js +1 -1
- package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +13 -11
- package/src/components/block-breadcrumb/test/index.js +1 -1
- package/src/components/block-compare/index.js +3 -2
- package/src/components/block-draggable/test/helpers.native.js +3 -3
- package/src/components/block-draggable/test/index.native.js +27 -27
- package/src/components/block-edit/index.js +2 -1
- package/src/components/block-list/block.js +2 -0
- package/src/components/block-list/style.scss +11 -6
- package/src/components/block-lock/menu-item.js +5 -2
- package/src/components/block-lock/modal.js +19 -36
- package/src/components/block-lock/style.scss +8 -17
- package/src/components/block-mover/stories/index.js +1 -1
- package/src/components/block-mover/style.scss +35 -1
- package/src/components/block-popover/inbetween.js +1 -0
- package/src/components/block-popover/index.js +1 -0
- package/src/components/block-popover/style.scss +1 -5
- package/src/components/block-preview/index.js +8 -3
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -7
- package/src/components/block-styles/utils.js +3 -3
- package/src/components/block-switcher/index.js +21 -11
- package/src/components/block-switcher/preview-block-popover.js +1 -1
- package/src/components/block-tools/insertion-point.js +10 -1
- package/src/components/block-tools/selected-block-popover.js +80 -34
- package/src/components/block-tools/style.scss +15 -0
- package/src/components/block-variation-picker/README.md +1 -1
- package/src/components/block-vertical-alignment-control/ui.js +1 -1
- package/src/components/border-radius-control/all-input-control.js +1 -0
- package/src/components/border-radius-control/index.js +1 -0
- package/src/components/border-radius-control/input-controls.js +1 -0
- package/src/components/border-radius-control/style.scss +15 -24
- package/src/components/color-palette/test/__snapshots__/control.js.snap +85 -83
- package/src/components/color-palette/test/control.js +1 -1
- package/src/components/colors/with-colors.js +13 -23
- package/src/components/default-block-appender/style.scss +1 -0
- package/src/components/duotone-control/index.js +1 -1
- package/src/components/font-sizes/fluid-utils.js +37 -64
- package/src/components/font-sizes/test/fluid-utils.js +5 -5
- package/src/components/font-sizes/with-font-sizes.js +15 -13
- package/src/components/iframe/index.js +1 -1
- package/src/components/image-editor/constants.js +1 -1
- package/src/components/index.js +1 -0
- package/src/components/inner-blocks/index.js +11 -4
- package/src/components/inner-blocks/test/index.js +4 -0
- package/src/components/inserter/hooks/use-insertion-point.js +3 -11
- package/src/components/inserter/reusable-blocks-tab.js +4 -2
- package/src/components/inserter/search-items.js +23 -3
- package/src/components/inserter/style.scss +8 -7
- package/src/components/inserter/test/reusable-blocks-tab.js +14 -57
- package/src/components/inserter/test/search-items.js +6 -0
- package/src/components/inserter-list-item/style.scss +2 -0
- package/src/components/letter-spacing-control/README.md +55 -0
- package/src/components/line-height-control/index.js +1 -0
- package/src/components/link-control/README.md +3 -3
- package/src/components/link-control/index.js +23 -39
- package/src/components/link-control/search-input.js +1 -1
- package/src/components/link-control/test/index.js +272 -241
- package/src/components/link-control/use-internal-input-value.js +22 -0
- package/src/components/list-view/block.js +4 -3
- package/src/components/list-view/branch.js +11 -6
- package/src/components/list-view/drop-indicator.js +1 -0
- package/src/components/list-view/style.scss +1 -36
- package/src/components/media-replace-flow/index.js +1 -1
- package/src/components/media-replace-flow/test/index.js +69 -51
- package/src/components/off-canvas-editor/README.md +5 -0
- package/src/components/off-canvas-editor/block-contents.js +89 -0
- package/src/components/off-canvas-editor/block-select-button.js +113 -0
- package/src/components/off-canvas-editor/block.js +335 -0
- package/src/components/off-canvas-editor/branch.js +210 -0
- package/src/components/off-canvas-editor/context.js +8 -0
- package/src/components/off-canvas-editor/drop-indicator.js +126 -0
- package/src/components/off-canvas-editor/expander.js +26 -0
- package/src/components/off-canvas-editor/index.js +216 -0
- package/src/components/off-canvas-editor/leaf.js +48 -0
- package/src/components/off-canvas-editor/style.scss +397 -0
- package/src/components/off-canvas-editor/test/utils.js +50 -0
- package/src/components/off-canvas-editor/use-block-selection.js +169 -0
- package/src/components/off-canvas-editor/use-list-view-client-ids.js +29 -0
- package/src/components/off-canvas-editor/use-list-view-drop-zone.js +260 -0
- package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +58 -0
- package/src/components/off-canvas-editor/utils.js +58 -0
- package/src/components/responsive-block-control/test/index.js +69 -92
- package/src/components/rich-text/format-toolbar/index.js +1 -1
- package/src/components/rich-text/format-toolbar-container.js +1 -1
- package/src/components/rich-text/use-paste-handler.js +1 -1
- package/src/components/spacing-sizes-control/all-input-control.js +4 -0
- package/src/components/spacing-sizes-control/axial-input-controls.js +4 -0
- package/src/components/spacing-sizes-control/index.js +4 -0
- package/src/components/spacing-sizes-control/input-controls.js +4 -0
- package/src/components/spacing-sizes-control/spacing-input-control.js +10 -1
- package/src/components/spacing-sizes-control/style.scss +1 -0
- package/src/components/url-input/index.js +1 -1
- package/src/components/url-popover/README.md +12 -3
- package/src/components/url-popover/index.js +33 -3
- package/src/components/use-setting/index.js +7 -1
- package/src/hooks/border.js +1 -0
- package/src/hooks/color-panel.js +13 -1
- package/src/hooks/color.js +2 -0
- package/src/hooks/content-lock-ui.js +46 -34
- package/src/hooks/dimensions.js +106 -19
- package/src/hooks/font-size.js +1 -0
- package/src/hooks/layout.js +8 -11
- package/src/hooks/margin.js +23 -17
- package/src/hooks/min-height.js +121 -0
- package/src/hooks/padding.js +23 -19
- package/src/hooks/style.js +10 -2
- package/src/hooks/test/align.js +96 -72
- package/src/hooks/test/style.js +4 -0
- package/src/hooks/test/use-typography-props.js +1 -1
- package/src/hooks/utils.js +5 -6
- package/src/layouts/constrained.js +0 -1
- package/src/layouts/flex.js +44 -39
- package/src/store/actions.js +26 -0
- package/src/store/array.js +1 -6
- package/src/store/reducer.js +50 -40
- package/src/store/selectors.js +43 -29
- package/src/store/test/actions.js +18 -0
- package/src/store/test/reducer.js +40 -0
- package/src/store/test/selectors.js +20 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.5.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,32 +33,33 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
35
|
"@react-spring/web": "^9.4.5",
|
|
36
|
-
"@wordpress/a11y": "^3.
|
|
37
|
-
"@wordpress/api-fetch": "^6.
|
|
38
|
-
"@wordpress/blob": "^3.
|
|
39
|
-
"@wordpress/blocks": "^11.
|
|
40
|
-
"@wordpress/components": "^
|
|
41
|
-
"@wordpress/compose": "^5.
|
|
42
|
-
"@wordpress/data": "^7.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^4.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^3.
|
|
53
|
-
"@wordpress/keycodes": "^3.
|
|
54
|
-
"@wordpress/notices": "^3.
|
|
55
|
-
"@wordpress/rich-text": "^5.
|
|
56
|
-
"@wordpress/shortcode": "^3.
|
|
57
|
-
"@wordpress/style-engine": "^1.
|
|
58
|
-
"@wordpress/token-list": "^2.
|
|
59
|
-
"@wordpress/url": "^3.
|
|
60
|
-
"@wordpress/warning": "^2.
|
|
61
|
-
"@wordpress/wordcount": "^3.
|
|
36
|
+
"@wordpress/a11y": "^3.22.0",
|
|
37
|
+
"@wordpress/api-fetch": "^6.19.0",
|
|
38
|
+
"@wordpress/blob": "^3.22.0",
|
|
39
|
+
"@wordpress/blocks": "^11.21.0",
|
|
40
|
+
"@wordpress/components": "^22.1.0",
|
|
41
|
+
"@wordpress/compose": "^5.20.0",
|
|
42
|
+
"@wordpress/data": "^7.6.0",
|
|
43
|
+
"@wordpress/date": "^4.22.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.22.0",
|
|
45
|
+
"@wordpress/dom": "^3.22.0",
|
|
46
|
+
"@wordpress/element": "^4.20.0",
|
|
47
|
+
"@wordpress/hooks": "^3.22.0",
|
|
48
|
+
"@wordpress/html-entities": "^3.22.0",
|
|
49
|
+
"@wordpress/i18n": "^4.22.0",
|
|
50
|
+
"@wordpress/icons": "^9.13.0",
|
|
51
|
+
"@wordpress/is-shallow-equal": "^4.22.0",
|
|
52
|
+
"@wordpress/keyboard-shortcuts": "^3.20.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.22.0",
|
|
54
|
+
"@wordpress/notices": "^3.22.0",
|
|
55
|
+
"@wordpress/rich-text": "^5.20.0",
|
|
56
|
+
"@wordpress/shortcode": "^3.22.0",
|
|
57
|
+
"@wordpress/style-engine": "^1.5.0",
|
|
58
|
+
"@wordpress/token-list": "^2.22.0",
|
|
59
|
+
"@wordpress/url": "^3.23.0",
|
|
60
|
+
"@wordpress/warning": "^2.22.0",
|
|
61
|
+
"@wordpress/wordcount": "^3.22.0",
|
|
62
|
+
"change-case": "^4.1.2",
|
|
62
63
|
"classnames": "^2.3.1",
|
|
63
64
|
"colord": "^2.7.0",
|
|
64
65
|
"diff": "^4.0.2",
|
|
@@ -78,5 +79,5 @@
|
|
|
78
79
|
"publishConfig": {
|
|
79
80
|
"access": "public"
|
|
80
81
|
},
|
|
81
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
|
|
82
83
|
}
|
|
@@ -40,7 +40,7 @@ _Note:_ In this example that we render `AlignmentControl` as a child of the `Blo
|
|
|
40
40
|
|
|
41
41
|
- **Type:** `String`
|
|
42
42
|
- **Default:** `undefined`
|
|
43
|
-
- **Options
|
|
43
|
+
- **Options:** `left`, `center`, `right`
|
|
44
44
|
|
|
45
45
|
The current value of the alignment setting. You may only choose from the `Options` listed above.
|
|
46
46
|
|
|
@@ -13,9 +13,9 @@ it( 'should call onChange with undefined when the control is already active', ()
|
|
|
13
13
|
const screen = render(
|
|
14
14
|
<BlockAlignmentUI value="right" onChange={ onChangeMock } />
|
|
15
15
|
);
|
|
16
|
-
const alignButton = screen.
|
|
16
|
+
const alignButton = screen.getByLabelText( 'Align' );
|
|
17
17
|
fireEvent.press( alignButton );
|
|
18
|
-
const rightAlignmentButton = screen.
|
|
18
|
+
const rightAlignmentButton = screen.getByLabelText( 'Align right' );
|
|
19
19
|
fireEvent.press( rightAlignmentButton );
|
|
20
20
|
|
|
21
21
|
expect( onChangeMock ).toHaveBeenCalledTimes( 1 );
|
|
@@ -27,9 +27,9 @@ it( 'should call onChange with alignment value when the control is inactive', ()
|
|
|
27
27
|
const screen = render(
|
|
28
28
|
<BlockAlignmentUI value="left" onChange={ onChangeMock } />
|
|
29
29
|
);
|
|
30
|
-
const alignButton = screen.
|
|
30
|
+
const alignButton = screen.getByLabelText( 'Align' );
|
|
31
31
|
fireEvent.press( alignButton );
|
|
32
|
-
const centerAlignmentButton = screen.
|
|
32
|
+
const centerAlignmentButton = screen.getByLabelText( 'Align center' );
|
|
33
33
|
fireEvent.press( centerAlignmentButton );
|
|
34
34
|
|
|
35
35
|
expect( onChangeMock ).toHaveBeenCalledTimes( 1 );
|
|
@@ -24,7 +24,7 @@ function BlockAlignmentMatrixControl( props ) {
|
|
|
24
24
|
return (
|
|
25
25
|
<Dropdown
|
|
26
26
|
position="bottom right"
|
|
27
|
-
popoverProps={ {
|
|
27
|
+
popoverProps={ { variant: 'toolbar' } }
|
|
28
28
|
renderToggle={ ( { onToggle, isOpen } ) => {
|
|
29
29
|
const openOnArrowDown = ( event ) => {
|
|
30
30
|
if ( ! isOpen && event.keyCode === DOWN ) {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`BlockBreadcrumb should render correctly 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<li
|
|
10
|
-
aria-current="true"
|
|
11
|
-
class="block-editor-block-breadcrumb__current"
|
|
4
|
+
<div>
|
|
5
|
+
<ul
|
|
6
|
+
aria-label="Block breadcrumb"
|
|
7
|
+
class="block-editor-block-breadcrumb"
|
|
8
|
+
role="list"
|
|
12
9
|
>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
<li
|
|
11
|
+
aria-current="true"
|
|
12
|
+
class="block-editor-block-breadcrumb__current"
|
|
13
|
+
>
|
|
14
|
+
Document
|
|
15
|
+
</li>
|
|
16
|
+
</ul>
|
|
17
|
+
</div>
|
|
16
18
|
`;
|
|
@@ -12,7 +12,7 @@ describe( 'BlockBreadcrumb', () => {
|
|
|
12
12
|
it( 'should render correctly', () => {
|
|
13
13
|
const { container } = render( <BlockBreadcrumb /> );
|
|
14
14
|
|
|
15
|
-
expect( container
|
|
15
|
+
expect( container ).toMatchSnapshot();
|
|
16
16
|
} );
|
|
17
17
|
|
|
18
18
|
describe( 'Root label text', () => {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { castArray } from 'lodash';
|
|
6
5
|
// diff doesn't tree-shake correctly, so we import from the individual
|
|
7
6
|
// module here, to avoid including too much of the library
|
|
8
7
|
import { diffChars } from 'diff/lib/diff/character';
|
|
@@ -44,7 +43,9 @@ function BlockCompare( {
|
|
|
44
43
|
|
|
45
44
|
function getConvertedContent( convertedBlock ) {
|
|
46
45
|
// The convertor may return an array of items or a single item.
|
|
47
|
-
const newBlocks =
|
|
46
|
+
const newBlocks = Array.isArray( convertedBlock )
|
|
47
|
+
? convertedBlock
|
|
48
|
+
: [ convertedBlock ];
|
|
48
49
|
|
|
49
50
|
// Get converted block details.
|
|
50
51
|
const newContent = newBlocks.map( ( item ) =>
|
|
@@ -53,14 +53,14 @@ export const initializeWithBlocksLayouts = async ( blocks ) => {
|
|
|
53
53
|
const initialHtml = blocks.map( ( block ) => block.html ).join( '\n' );
|
|
54
54
|
|
|
55
55
|
const screen = await initializeEditor( { initialHtml } );
|
|
56
|
-
const {
|
|
56
|
+
const { getByLabelText } = screen;
|
|
57
57
|
|
|
58
58
|
const waitPromises = [];
|
|
59
59
|
blocks.forEach( ( block, index ) => {
|
|
60
60
|
const a11yLabel = new RegExp(
|
|
61
61
|
`${ block.name } Block\\. Row ${ index + 1 }`
|
|
62
62
|
);
|
|
63
|
-
const element =
|
|
63
|
+
const element = getByLabelText( a11yLabel );
|
|
64
64
|
// "onLayout" event will populate the blocks layouts data.
|
|
65
65
|
fireEvent( element, 'layout', {
|
|
66
66
|
nativeEvent: { layout: block.layout },
|
|
@@ -92,7 +92,7 @@ export const initializeWithBlocksLayouts = async ( blocks ) => {
|
|
|
92
92
|
`${ nestedBlock.name } Block\\. Row ${ nestedIndex + 1 }`
|
|
93
93
|
);
|
|
94
94
|
fireEvent(
|
|
95
|
-
within( element ).
|
|
95
|
+
within( element ).getByLabelText( nestedA11yLabel ),
|
|
96
96
|
'layout',
|
|
97
97
|
{
|
|
98
98
|
nativeEvent: { layout: nestedBlock.layout },
|
|
@@ -93,11 +93,11 @@ describe( 'BlockDraggable', () => {
|
|
|
93
93
|
it( 'enables drag mode when unselected', async () =>
|
|
94
94
|
withReanimatedTimer( async () => {
|
|
95
95
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
96
|
-
const {
|
|
96
|
+
const { getByLabelText } = screen;
|
|
97
97
|
|
|
98
98
|
// Start dragging from block's content
|
|
99
99
|
fireLongPress(
|
|
100
|
-
|
|
100
|
+
getByLabelText( /Paragraph Block\. Row 1/ ),
|
|
101
101
|
'draggable-trigger-content'
|
|
102
102
|
);
|
|
103
103
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
@@ -112,12 +112,12 @@ describe( 'BlockDraggable', () => {
|
|
|
112
112
|
it( 'enables drag mode when selected', async () =>
|
|
113
113
|
withReanimatedTimer( async () => {
|
|
114
114
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
115
|
-
const {
|
|
115
|
+
const { getByLabelText } = screen;
|
|
116
116
|
const blockDraggableWrapper = getByGestureTestId(
|
|
117
117
|
'block-draggable-wrapper'
|
|
118
118
|
);
|
|
119
119
|
|
|
120
|
-
const paragraphBlock =
|
|
120
|
+
const paragraphBlock = getByLabelText(
|
|
121
121
|
/Paragraph Block\. Row 1/
|
|
122
122
|
);
|
|
123
123
|
fireEvent.press( paragraphBlock );
|
|
@@ -146,9 +146,9 @@ describe( 'BlockDraggable', () => {
|
|
|
146
146
|
it( 'does not enable drag mode when selected and editing text', async () =>
|
|
147
147
|
withReanimatedTimer( async () => {
|
|
148
148
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
149
|
-
const {
|
|
149
|
+
const { getByLabelText } = screen;
|
|
150
150
|
|
|
151
|
-
const paragraphBlock =
|
|
151
|
+
const paragraphBlock = getByLabelText(
|
|
152
152
|
/Paragraph Block\. Row 1/
|
|
153
153
|
);
|
|
154
154
|
|
|
@@ -178,13 +178,13 @@ describe( 'BlockDraggable', () => {
|
|
|
178
178
|
it( 'finishes editing text and enables drag mode when long-pressing over a different block', async () =>
|
|
179
179
|
withReanimatedTimer( async () => {
|
|
180
180
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
181
|
-
const {
|
|
181
|
+
const { getByLabelText } = screen;
|
|
182
182
|
|
|
183
|
-
const paragraphBlock =
|
|
183
|
+
const paragraphBlock = getByLabelText(
|
|
184
184
|
/Paragraph Block\. Row 1/
|
|
185
185
|
);
|
|
186
186
|
const spacerBlock =
|
|
187
|
-
|
|
187
|
+
getByLabelText( /Spacer Block\. Row 3/ );
|
|
188
188
|
|
|
189
189
|
// Select Paragraph block and start editing text
|
|
190
190
|
fireEvent.press( paragraphBlock );
|
|
@@ -208,12 +208,12 @@ describe( 'BlockDraggable', () => {
|
|
|
208
208
|
it( 'enables drag mode when unselected', async () =>
|
|
209
209
|
withReanimatedTimer( async () => {
|
|
210
210
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
211
|
-
const {
|
|
211
|
+
const { getAllByLabelText } = screen;
|
|
212
212
|
|
|
213
213
|
// We select the first Image block as the Gallery block
|
|
214
214
|
// also contains Image blocks.
|
|
215
215
|
const imageBlock =
|
|
216
|
-
|
|
216
|
+
getAllByLabelText( /Image Block\. Row 2/ )[ 0 ];
|
|
217
217
|
// Start dragging from block's content
|
|
218
218
|
fireLongPress( imageBlock, 'draggable-trigger-content' );
|
|
219
219
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
@@ -228,7 +228,7 @@ describe( 'BlockDraggable', () => {
|
|
|
228
228
|
it( 'enables drag mode when selected', async () =>
|
|
229
229
|
withReanimatedTimer( async () => {
|
|
230
230
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
231
|
-
const {
|
|
231
|
+
const { getAllByLabelText } = screen;
|
|
232
232
|
const blockDraggableWrapper = getByGestureTestId(
|
|
233
233
|
'block-draggable-wrapper'
|
|
234
234
|
);
|
|
@@ -236,7 +236,7 @@ describe( 'BlockDraggable', () => {
|
|
|
236
236
|
// We select the first Image block as the Gallery block
|
|
237
237
|
// also contains Image blocks.
|
|
238
238
|
const imageBlock =
|
|
239
|
-
|
|
239
|
+
getAllByLabelText( /Image Block\. Row 2/ )[ 0 ];
|
|
240
240
|
fireEvent.press( imageBlock );
|
|
241
241
|
|
|
242
242
|
// Start dragging from block's content
|
|
@@ -262,12 +262,12 @@ describe( 'BlockDraggable', () => {
|
|
|
262
262
|
it( 'enables drag mode when unselected', async () =>
|
|
263
263
|
withReanimatedTimer( async () => {
|
|
264
264
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
265
|
-
const {
|
|
265
|
+
const { getByLabelText } = screen;
|
|
266
266
|
|
|
267
267
|
// Start dragging from block's content, specifically the first
|
|
268
268
|
// trigger index, which corresponds to the Gallery block content.
|
|
269
269
|
fireLongPress(
|
|
270
|
-
|
|
270
|
+
getByLabelText( /Gallery Block\. Row 4/ ),
|
|
271
271
|
'draggable-trigger-content',
|
|
272
272
|
{ triggerIndex: 0 }
|
|
273
273
|
);
|
|
@@ -283,12 +283,12 @@ describe( 'BlockDraggable', () => {
|
|
|
283
283
|
it( 'enables drag mode when selected', async () =>
|
|
284
284
|
withReanimatedTimer( async () => {
|
|
285
285
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
286
|
-
const {
|
|
286
|
+
const { getByLabelText } = screen;
|
|
287
287
|
const blockDraggableWrapper = getByGestureTestId(
|
|
288
288
|
'block-draggable-wrapper'
|
|
289
289
|
);
|
|
290
290
|
|
|
291
|
-
const galleryBlock =
|
|
291
|
+
const galleryBlock = getByLabelText(
|
|
292
292
|
/Gallery Block\. Row 4/
|
|
293
293
|
);
|
|
294
294
|
await waitForStoreResolvers( () =>
|
|
@@ -319,16 +319,16 @@ describe( 'BlockDraggable', () => {
|
|
|
319
319
|
it( 'enables drag mode when nested block is selected', async () =>
|
|
320
320
|
withReanimatedTimer( async () => {
|
|
321
321
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
322
|
-
const {
|
|
322
|
+
const { getByLabelText } = screen;
|
|
323
323
|
const blockDraggableWrapper = getByGestureTestId(
|
|
324
324
|
'block-draggable-wrapper'
|
|
325
325
|
);
|
|
326
326
|
|
|
327
|
-
const galleryBlock =
|
|
327
|
+
const galleryBlock = getByLabelText(
|
|
328
328
|
/Gallery Block\. Row 4/
|
|
329
329
|
);
|
|
330
330
|
const galleryItem =
|
|
331
|
-
within( galleryBlock ).
|
|
331
|
+
within( galleryBlock ).getByLabelText(
|
|
332
332
|
/Image Block\. Row 2/
|
|
333
333
|
);
|
|
334
334
|
fireEvent.press( galleryBlock );
|
|
@@ -361,11 +361,11 @@ describe( 'BlockDraggable', () => {
|
|
|
361
361
|
it( 'enables drag mode when unselected', async () =>
|
|
362
362
|
withReanimatedTimer( async () => {
|
|
363
363
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
364
|
-
const {
|
|
364
|
+
const { getByLabelText } = screen;
|
|
365
365
|
|
|
366
366
|
// Start dragging from block's content
|
|
367
367
|
fireLongPress(
|
|
368
|
-
|
|
368
|
+
getByLabelText( /Spacer Block\. Row 3/ ),
|
|
369
369
|
'draggable-trigger-content'
|
|
370
370
|
);
|
|
371
371
|
expect( getDraggableChip( screen ) ).toBeVisible();
|
|
@@ -380,13 +380,13 @@ describe( 'BlockDraggable', () => {
|
|
|
380
380
|
it( 'enables drag mode when selected', async () =>
|
|
381
381
|
withReanimatedTimer( async () => {
|
|
382
382
|
const screen = await initializeWithBlocksLayouts( BLOCKS );
|
|
383
|
-
const {
|
|
383
|
+
const { getByLabelText } = screen;
|
|
384
384
|
const blockDraggableWrapper = getByGestureTestId(
|
|
385
385
|
'block-draggable-wrapper'
|
|
386
386
|
);
|
|
387
387
|
|
|
388
388
|
const spacerBlock =
|
|
389
|
-
|
|
389
|
+
getByLabelText( /Spacer Block\. Row 3/ );
|
|
390
390
|
await waitForStoreResolvers( () =>
|
|
391
391
|
fireEvent.press( spacerBlock )
|
|
392
392
|
);
|
|
@@ -413,7 +413,7 @@ describe( 'BlockDraggable', () => {
|
|
|
413
413
|
|
|
414
414
|
it( 'moves blocks', async () =>
|
|
415
415
|
withReanimatedTimer( async () => {
|
|
416
|
-
const {
|
|
416
|
+
const { getByLabelText } = await initializeWithBlocksLayouts(
|
|
417
417
|
BLOCKS
|
|
418
418
|
);
|
|
419
419
|
const blockDraggableWrapper = getByGestureTestId(
|
|
@@ -424,7 +424,7 @@ describe( 'BlockDraggable', () => {
|
|
|
424
424
|
|
|
425
425
|
// Move Paragraph block from first to second position
|
|
426
426
|
fireLongPress(
|
|
427
|
-
|
|
427
|
+
getByLabelText( /Paragraph Block\. Row 1/ ),
|
|
428
428
|
'draggable-trigger-content'
|
|
429
429
|
);
|
|
430
430
|
firePanGesture( blockDraggableWrapper, [
|
|
@@ -454,7 +454,7 @@ describe( 'BlockDraggable', () => {
|
|
|
454
454
|
|
|
455
455
|
// Move Spacer block from third to first position
|
|
456
456
|
fireLongPress(
|
|
457
|
-
|
|
457
|
+
getByLabelText( /Spacer Block\. Row 3/ ),
|
|
458
458
|
'draggable-trigger-content'
|
|
459
459
|
);
|
|
460
460
|
firePanGesture( blockDraggableWrapper, [
|
|
@@ -20,11 +20,12 @@ import { BlockEditContextProvider, useBlockEditContext } from './context';
|
|
|
20
20
|
export { useBlockEditContext };
|
|
21
21
|
|
|
22
22
|
export default function BlockEdit( props ) {
|
|
23
|
-
const { name, isSelected, clientId } = props;
|
|
23
|
+
const { name, isSelected, clientId, __unstableLayoutClassNames } = props;
|
|
24
24
|
const context = {
|
|
25
25
|
name,
|
|
26
26
|
isSelected,
|
|
27
27
|
clientId,
|
|
28
|
+
__unstableLayoutClassNames,
|
|
28
29
|
};
|
|
29
30
|
return (
|
|
30
31
|
<BlockEditContextProvider
|
|
@@ -84,6 +84,7 @@ function BlockListBlock( {
|
|
|
84
84
|
isSelected,
|
|
85
85
|
isSelectionEnabled,
|
|
86
86
|
className,
|
|
87
|
+
__unstableLayoutClassNames: layoutClassNames,
|
|
87
88
|
name,
|
|
88
89
|
isValid,
|
|
89
90
|
attributes,
|
|
@@ -146,6 +147,7 @@ function BlockListBlock( {
|
|
|
146
147
|
clientId={ clientId }
|
|
147
148
|
isSelectionEnabled={ isSelectionEnabled }
|
|
148
149
|
toggleSelection={ toggleSelection }
|
|
150
|
+
__unstableLayoutClassNames={ layoutClassNames }
|
|
149
151
|
/>
|
|
150
152
|
);
|
|
151
153
|
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
// With `position: static`, Safari marks a full-width selection rectangle, including margins.
|
|
175
175
|
// With `position: relative`, Safari marks an inline selection rectangle, similar to that of
|
|
176
176
|
// Blink based browsers, but it also does "crop" the marker, which can result in a small line
|
|
177
|
-
// from the
|
|
177
|
+
// from the preceding paragraph showing, which is effectively the above selection bleeding in.
|
|
178
178
|
// We choose relative, as that matches the multi-selection, which is limited to the block footprint.
|
|
179
179
|
position: relative;
|
|
180
180
|
|
|
@@ -290,11 +290,16 @@
|
|
|
290
290
|
cursor: unset;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
&::after {
|
|
294
|
+
content: "";
|
|
295
|
+
position: absolute;
|
|
296
|
+
pointer-events: none;
|
|
297
|
+
top: $border-width;
|
|
298
|
+
left: $border-width;
|
|
299
|
+
right: $border-width;
|
|
300
|
+
bottom: $border-width;
|
|
301
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
302
|
+
border-radius: $radius-block-ui;
|
|
298
303
|
}
|
|
299
304
|
}
|
|
300
305
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { useReducer } from '@wordpress/element';
|
|
6
6
|
import { MenuItem } from '@wordpress/components';
|
|
7
|
-
import {
|
|
7
|
+
import { lockOutline, unlock } from '@wordpress/icons';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
@@ -28,7 +28,10 @@ export default function BlockLockMenuItem( { clientId } ) {
|
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<>
|
|
31
|
-
<MenuItem
|
|
31
|
+
<MenuItem
|
|
32
|
+
icon={ isLocked ? unlock : lockOutline }
|
|
33
|
+
onClick={ toggleModal }
|
|
34
|
+
>
|
|
32
35
|
{ label }
|
|
33
36
|
</MenuItem>
|
|
34
37
|
{ isModalOpen && (
|
|
@@ -114,6 +114,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
114
114
|
className="block-editor-block-lock-modal__options"
|
|
115
115
|
>
|
|
116
116
|
<CheckboxControl
|
|
117
|
+
__nextHasNoMarginBottom
|
|
117
118
|
className="block-editor-block-lock-modal__options-title"
|
|
118
119
|
label={
|
|
119
120
|
<span id={ instanceId }>{ __( 'Lock all' ) }</span>
|
|
@@ -134,18 +135,8 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
134
135
|
{ allowsEditLocking && (
|
|
135
136
|
<li className="block-editor-block-lock-modal__checklist-item">
|
|
136
137
|
<CheckboxControl
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
{ __( 'Restrict editing' ) }
|
|
140
|
-
<Icon
|
|
141
|
-
icon={
|
|
142
|
-
lock.edit
|
|
143
|
-
? lockIcon
|
|
144
|
-
: unlockIcon
|
|
145
|
-
}
|
|
146
|
-
/>
|
|
147
|
-
</>
|
|
148
|
-
}
|
|
138
|
+
__nextHasNoMarginBottom
|
|
139
|
+
label={ __( 'Restrict editing' ) }
|
|
149
140
|
checked={ !! lock.edit }
|
|
150
141
|
onChange={ ( edit ) =>
|
|
151
142
|
setLock( ( prevLock ) => ( {
|
|
@@ -154,22 +145,16 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
154
145
|
} ) )
|
|
155
146
|
}
|
|
156
147
|
/>
|
|
148
|
+
<Icon
|
|
149
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
150
|
+
icon={ lock.edit ? lockIcon : unlockIcon }
|
|
151
|
+
/>
|
|
157
152
|
</li>
|
|
158
153
|
) }
|
|
159
154
|
<li className="block-editor-block-lock-modal__checklist-item">
|
|
160
155
|
<CheckboxControl
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
{ __( 'Disable movement' ) }
|
|
164
|
-
<Icon
|
|
165
|
-
icon={
|
|
166
|
-
lock.move
|
|
167
|
-
? lockIcon
|
|
168
|
-
: unlockIcon
|
|
169
|
-
}
|
|
170
|
-
/>
|
|
171
|
-
</>
|
|
172
|
-
}
|
|
156
|
+
__nextHasNoMarginBottom
|
|
157
|
+
label={ __( 'Disable movement' ) }
|
|
173
158
|
checked={ lock.move }
|
|
174
159
|
onChange={ ( move ) =>
|
|
175
160
|
setLock( ( prevLock ) => ( {
|
|
@@ -178,21 +163,15 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
178
163
|
} ) )
|
|
179
164
|
}
|
|
180
165
|
/>
|
|
166
|
+
<Icon
|
|
167
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
168
|
+
icon={ lock.move ? lockIcon : unlockIcon }
|
|
169
|
+
/>
|
|
181
170
|
</li>
|
|
182
171
|
<li className="block-editor-block-lock-modal__checklist-item">
|
|
183
172
|
<CheckboxControl
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
{ __( 'Prevent removal' ) }
|
|
187
|
-
<Icon
|
|
188
|
-
icon={
|
|
189
|
-
lock.remove
|
|
190
|
-
? lockIcon
|
|
191
|
-
: unlockIcon
|
|
192
|
-
}
|
|
193
|
-
/>
|
|
194
|
-
</>
|
|
195
|
-
}
|
|
173
|
+
__nextHasNoMarginBottom
|
|
174
|
+
label={ __( 'Prevent removal' ) }
|
|
196
175
|
checked={ lock.remove }
|
|
197
176
|
onChange={ ( remove ) =>
|
|
198
177
|
setLock( ( prevLock ) => ( {
|
|
@@ -201,6 +180,10 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
201
180
|
} ) )
|
|
202
181
|
}
|
|
203
182
|
/>
|
|
183
|
+
<Icon
|
|
184
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
185
|
+
icon={ lock.remove ? lockIcon : unlockIcon }
|
|
186
|
+
/>
|
|
204
187
|
</li>
|
|
205
188
|
</ul>
|
|
206
189
|
{ hasTemplateLock && (
|
|
@@ -22,29 +22,20 @@
|
|
|
22
22
|
.components-base-control__field {
|
|
23
23
|
align-items: center;
|
|
24
24
|
display: flex;
|
|
25
|
-
margin: 0;
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
.block-editor-block-lock-modal__checklist-item {
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: $grid-unit-15;
|
|
29
32
|
margin-bottom: 0;
|
|
30
33
|
padding: $grid-unit-15 0 $grid-unit-15 $grid-unit-40;
|
|
31
34
|
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.components-checkbox-control__label {
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
justify-content: space-between;
|
|
42
|
-
flex-grow: 1;
|
|
43
|
-
|
|
44
|
-
svg {
|
|
45
|
-
margin-right: $grid-unit-15;
|
|
46
|
-
fill: $gray-900;
|
|
47
|
-
}
|
|
35
|
+
.block-editor-block-lock-modal__lock-icon {
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
margin-right: $grid-unit-15;
|
|
38
|
+
fill: $gray-900;
|
|
48
39
|
}
|
|
49
40
|
|
|
50
41
|
&:hover {
|