@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/src/hooks/padding.js
CHANGED
|
@@ -29,10 +29,7 @@ import {
|
|
|
29
29
|
import { cleanEmptyObject } from './utils';
|
|
30
30
|
import BlockPopover from '../components/block-popover';
|
|
31
31
|
import SpacingSizesControl from '../components/spacing-sizes-control';
|
|
32
|
-
import {
|
|
33
|
-
getSpacingPresetCssVar,
|
|
34
|
-
isValueSpacingPreset,
|
|
35
|
-
} from '../components/spacing-sizes-control/utils';
|
|
32
|
+
import { getSpacingPresetCssVar } from '../components/spacing-sizes-control/utils';
|
|
36
33
|
/**
|
|
37
34
|
* Determines if there is padding support.
|
|
38
35
|
*
|
|
@@ -103,6 +100,8 @@ export function PaddingEdit( props ) {
|
|
|
103
100
|
name: blockName,
|
|
104
101
|
attributes: { style },
|
|
105
102
|
setAttributes,
|
|
103
|
+
onMouseOver,
|
|
104
|
+
onMouseOut,
|
|
106
105
|
} = props;
|
|
107
106
|
|
|
108
107
|
const spacingSizes = useSetting( 'spacing.spacingSizes' );
|
|
@@ -150,6 +149,8 @@ export function PaddingEdit( props ) {
|
|
|
150
149
|
units={ units }
|
|
151
150
|
allowReset={ false }
|
|
152
151
|
splitOnAxis={ splitOnAxis }
|
|
152
|
+
onMouseOver={ onMouseOver }
|
|
153
|
+
onMouseOut={ onMouseOut }
|
|
153
154
|
/>
|
|
154
155
|
) }
|
|
155
156
|
{ spacingSizes?.length > 0 && (
|
|
@@ -161,6 +162,8 @@ export function PaddingEdit( props ) {
|
|
|
161
162
|
units={ units }
|
|
162
163
|
allowReset={ false }
|
|
163
164
|
splitOnAxis={ splitOnAxis }
|
|
165
|
+
onMouseOver={ onMouseOver }
|
|
166
|
+
onMouseOut={ onMouseOut }
|
|
164
167
|
/>
|
|
165
168
|
) }
|
|
166
169
|
</>
|
|
@@ -169,22 +172,22 @@ export function PaddingEdit( props ) {
|
|
|
169
172
|
} );
|
|
170
173
|
}
|
|
171
174
|
|
|
172
|
-
export function PaddingVisualizer( { clientId, attributes } ) {
|
|
175
|
+
export function PaddingVisualizer( { clientId, attributes, forceShow } ) {
|
|
173
176
|
const padding = attributes?.style?.spacing?.padding;
|
|
174
177
|
const style = useMemo( () => {
|
|
175
178
|
return {
|
|
176
|
-
borderTopWidth:
|
|
179
|
+
borderTopWidth: padding?.top
|
|
177
180
|
? getSpacingPresetCssVar( padding?.top )
|
|
178
|
-
:
|
|
179
|
-
borderRightWidth:
|
|
181
|
+
: 0,
|
|
182
|
+
borderRightWidth: padding?.right
|
|
180
183
|
? getSpacingPresetCssVar( padding?.right )
|
|
181
|
-
:
|
|
182
|
-
borderBottomWidth:
|
|
184
|
+
: 0,
|
|
185
|
+
borderBottomWidth: padding?.bottom
|
|
183
186
|
? getSpacingPresetCssVar( padding?.bottom )
|
|
184
|
-
:
|
|
185
|
-
borderLeftWidth:
|
|
187
|
+
: 0,
|
|
188
|
+
borderLeftWidth: padding?.left
|
|
186
189
|
? getSpacingPresetCssVar( padding?.left )
|
|
187
|
-
:
|
|
190
|
+
: 0,
|
|
188
191
|
};
|
|
189
192
|
}, [ padding ] );
|
|
190
193
|
|
|
@@ -199,21 +202,22 @@ export function PaddingVisualizer( { clientId, attributes } ) {
|
|
|
199
202
|
};
|
|
200
203
|
|
|
201
204
|
useEffect( () => {
|
|
202
|
-
if ( ! isShallowEqual( padding, valueRef.current ) ) {
|
|
205
|
+
if ( ! isShallowEqual( padding, valueRef.current ) && ! forceShow ) {
|
|
203
206
|
setIsActive( true );
|
|
204
207
|
valueRef.current = padding;
|
|
205
208
|
|
|
206
|
-
clearTimer();
|
|
207
|
-
|
|
208
209
|
timeoutRef.current = setTimeout( () => {
|
|
209
210
|
setIsActive( false );
|
|
210
211
|
}, 400 );
|
|
211
212
|
}
|
|
212
213
|
|
|
213
|
-
return () =>
|
|
214
|
-
|
|
214
|
+
return () => {
|
|
215
|
+
setIsActive( false );
|
|
216
|
+
clearTimer();
|
|
217
|
+
};
|
|
218
|
+
}, [ padding, forceShow ] );
|
|
215
219
|
|
|
216
|
-
if ( ! isActive ) {
|
|
220
|
+
if ( ! isActive && ! forceShow ) {
|
|
217
221
|
return null;
|
|
218
222
|
}
|
|
219
223
|
|
package/src/hooks/style.js
CHANGED
|
@@ -27,7 +27,11 @@ import {
|
|
|
27
27
|
TYPOGRAPHY_SUPPORT_KEY,
|
|
28
28
|
TYPOGRAPHY_SUPPORT_KEYS,
|
|
29
29
|
} from './typography';
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
DIMENSIONS_SUPPORT_KEY,
|
|
32
|
+
SPACING_SUPPORT_KEY,
|
|
33
|
+
DimensionsPanel,
|
|
34
|
+
} from './dimensions';
|
|
31
35
|
import useDisplayBlockControls from '../components/use-display-block-controls';
|
|
32
36
|
import { shouldSkipSerialization } from './utils';
|
|
33
37
|
|
|
@@ -35,6 +39,7 @@ const styleSupportKeys = [
|
|
|
35
39
|
...TYPOGRAPHY_SUPPORT_KEYS,
|
|
36
40
|
BORDER_SUPPORT_KEY,
|
|
37
41
|
COLOR_SUPPORT_KEY,
|
|
42
|
+
DIMENSIONS_SUPPORT_KEY,
|
|
38
43
|
SPACING_SUPPORT_KEY,
|
|
39
44
|
];
|
|
40
45
|
|
|
@@ -98,8 +103,11 @@ const skipSerializationPathsEdit = {
|
|
|
98
103
|
[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
99
104
|
TYPOGRAPHY_SUPPORT_KEY,
|
|
100
105
|
],
|
|
106
|
+
[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
107
|
+
DIMENSIONS_SUPPORT_KEY,
|
|
108
|
+
],
|
|
101
109
|
[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
|
|
102
|
-
|
|
110
|
+
SPACING_SUPPORT_KEY,
|
|
103
111
|
],
|
|
104
112
|
};
|
|
105
113
|
|
package/src/hooks/test/align.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -12,10 +12,13 @@ import {
|
|
|
12
12
|
registerBlockType,
|
|
13
13
|
unregisterBlockType,
|
|
14
14
|
} from '@wordpress/blocks';
|
|
15
|
+
import { SlotFillProvider } from '@wordpress/components';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Internal dependencies
|
|
18
19
|
*/
|
|
20
|
+
import BlockControls from '../../components/block-controls';
|
|
21
|
+
import BlockEdit from '../../components/block-edit';
|
|
19
22
|
import BlockEditorProvider from '../../components/provider';
|
|
20
23
|
import {
|
|
21
24
|
getValidAlignments,
|
|
@@ -31,6 +34,7 @@ describe( 'align', () => {
|
|
|
31
34
|
save: noop,
|
|
32
35
|
category: 'text',
|
|
33
36
|
title: 'block title',
|
|
37
|
+
edit: ( { children } ) => <>{ children }</>,
|
|
34
38
|
};
|
|
35
39
|
|
|
36
40
|
afterEach( () => {
|
|
@@ -154,6 +158,12 @@ describe( 'align', () => {
|
|
|
154
158
|
} );
|
|
155
159
|
|
|
156
160
|
describe( 'withToolbarControls', () => {
|
|
161
|
+
const componentProps = {
|
|
162
|
+
name: 'core/foo',
|
|
163
|
+
attributes: {},
|
|
164
|
+
isSelected: true,
|
|
165
|
+
};
|
|
166
|
+
|
|
157
167
|
it( 'should do nothing if no valid alignments', () => {
|
|
158
168
|
registerBlockType( 'core/foo', blockSettings );
|
|
159
169
|
|
|
@@ -161,15 +171,21 @@ describe( 'align', () => {
|
|
|
161
171
|
( { wrapperProps } ) => <div { ...wrapperProps } />
|
|
162
172
|
);
|
|
163
173
|
|
|
164
|
-
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
174
|
+
render(
|
|
175
|
+
<SlotFillProvider>
|
|
176
|
+
<BlockEdit { ...componentProps }>
|
|
177
|
+
<EnhancedComponent { ...componentProps } />
|
|
178
|
+
</BlockEdit>
|
|
179
|
+
<BlockControls.Slot group="block" />
|
|
180
|
+
</SlotFillProvider>
|
|
170
181
|
);
|
|
171
|
-
|
|
172
|
-
expect(
|
|
182
|
+
|
|
183
|
+
expect(
|
|
184
|
+
screen.queryByRole( 'button', {
|
|
185
|
+
name: 'Align',
|
|
186
|
+
expanded: false,
|
|
187
|
+
} )
|
|
188
|
+
).not.toBeInTheDocument();
|
|
173
189
|
} );
|
|
174
190
|
|
|
175
191
|
it( 'should render toolbar controls if valid alignments', () => {
|
|
@@ -185,14 +201,21 @@ describe( 'align', () => {
|
|
|
185
201
|
( { wrapperProps } ) => <div { ...wrapperProps } />
|
|
186
202
|
);
|
|
187
203
|
|
|
188
|
-
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
render(
|
|
205
|
+
<SlotFillProvider>
|
|
206
|
+
<BlockEdit { ...componentProps }>
|
|
207
|
+
<EnhancedComponent { ...componentProps } />
|
|
208
|
+
</BlockEdit>
|
|
209
|
+
<BlockControls.Slot group="block" />
|
|
210
|
+
</SlotFillProvider>
|
|
194
211
|
);
|
|
195
|
-
|
|
212
|
+
|
|
213
|
+
expect(
|
|
214
|
+
screen.getAllByRole( 'button', {
|
|
215
|
+
name: 'Align',
|
|
216
|
+
expanded: false,
|
|
217
|
+
} )
|
|
218
|
+
).toHaveLength( 2 );
|
|
196
219
|
} );
|
|
197
220
|
} );
|
|
198
221
|
|
|
@@ -207,28 +230,27 @@ describe( 'align', () => {
|
|
|
207
230
|
} );
|
|
208
231
|
|
|
209
232
|
const EnhancedComponent = withDataAlign( ( { wrapperProps } ) => (
|
|
210
|
-
<
|
|
233
|
+
<button { ...wrapperProps } />
|
|
211
234
|
) );
|
|
212
235
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
} );
|
|
236
|
+
render(
|
|
237
|
+
<BlockEditorProvider
|
|
238
|
+
settings={ { alignWide: true, supportsLayout: false } }
|
|
239
|
+
value={ [] }
|
|
240
|
+
>
|
|
241
|
+
<EnhancedComponent
|
|
242
|
+
attributes={ {
|
|
243
|
+
align: 'wide',
|
|
244
|
+
} }
|
|
245
|
+
name="core/foo"
|
|
246
|
+
/>
|
|
247
|
+
</BlockEditorProvider>
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
expect( screen.getByRole( 'button' ) ).toHaveAttribute(
|
|
251
|
+
'data-align',
|
|
252
|
+
'wide'
|
|
253
|
+
);
|
|
232
254
|
} );
|
|
233
255
|
|
|
234
256
|
it( 'should not render wide/full wrapper props if wide controls are not enabled', () => {
|
|
@@ -241,26 +263,27 @@ describe( 'align', () => {
|
|
|
241
263
|
} );
|
|
242
264
|
|
|
243
265
|
const EnhancedComponent = withDataAlign( ( { wrapperProps } ) => (
|
|
244
|
-
<
|
|
266
|
+
<button { ...wrapperProps } />
|
|
245
267
|
) );
|
|
246
268
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
269
|
+
render(
|
|
270
|
+
<BlockEditorProvider
|
|
271
|
+
settings={ { alignWide: false } }
|
|
272
|
+
value={ [] }
|
|
273
|
+
>
|
|
274
|
+
<EnhancedComponent
|
|
275
|
+
name="core/foo"
|
|
276
|
+
attributes={ {
|
|
277
|
+
align: 'wide',
|
|
278
|
+
} }
|
|
279
|
+
/>
|
|
280
|
+
</BlockEditorProvider>
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
expect( screen.getByRole( 'button' ) ).not.toHaveAttribute(
|
|
284
|
+
'data-align',
|
|
285
|
+
'wide'
|
|
286
|
+
);
|
|
264
287
|
} );
|
|
265
288
|
|
|
266
289
|
it( 'should not render invalid align', () => {
|
|
@@ -273,26 +296,27 @@ describe( 'align', () => {
|
|
|
273
296
|
} );
|
|
274
297
|
|
|
275
298
|
const EnhancedComponent = withDataAlign( ( { wrapperProps } ) => (
|
|
276
|
-
<
|
|
299
|
+
<button { ...wrapperProps } />
|
|
277
300
|
) );
|
|
278
301
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
302
|
+
render(
|
|
303
|
+
<BlockEditorProvider
|
|
304
|
+
settings={ { alignWide: true } }
|
|
305
|
+
value={ [] }
|
|
306
|
+
>
|
|
307
|
+
<EnhancedComponent
|
|
308
|
+
name="core/foo"
|
|
309
|
+
attributes={ {
|
|
310
|
+
align: 'wide',
|
|
311
|
+
} }
|
|
312
|
+
/>
|
|
313
|
+
</BlockEditorProvider>
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
expect( screen.getByRole( 'button' ) ).not.toHaveAttribute(
|
|
317
|
+
'data-align',
|
|
318
|
+
'wide'
|
|
319
|
+
);
|
|
296
320
|
} );
|
|
297
321
|
} );
|
|
298
322
|
|
package/src/hooks/test/style.js
CHANGED
|
@@ -28,6 +28,9 @@ describe( 'getInlineStyles', () => {
|
|
|
28
28
|
style: 'dotted',
|
|
29
29
|
color: '#21759b',
|
|
30
30
|
},
|
|
31
|
+
dimensions: {
|
|
32
|
+
minHeight: '50vh',
|
|
33
|
+
},
|
|
31
34
|
spacing: {
|
|
32
35
|
blockGap: '1em',
|
|
33
36
|
padding: { top: '10px' },
|
|
@@ -44,6 +47,7 @@ describe( 'getInlineStyles', () => {
|
|
|
44
47
|
lineHeight: 1.5,
|
|
45
48
|
fontSize: 10,
|
|
46
49
|
marginBottom: '15px',
|
|
50
|
+
minHeight: '50vh',
|
|
47
51
|
paddingTop: '10px',
|
|
48
52
|
} );
|
|
49
53
|
} );
|
|
@@ -42,7 +42,7 @@ describe( 'getTypographyClassesAndStyles', () => {
|
|
|
42
42
|
style: {
|
|
43
43
|
letterSpacing: '22px',
|
|
44
44
|
fontSize:
|
|
45
|
-
'clamp(1.5rem, 1.5rem + ((1vw - 0.48rem) *
|
|
45
|
+
'clamp(1.5rem, 1.5rem + ((1vw - 0.48rem) * 0.962), 2rem)',
|
|
46
46
|
textTransform: 'uppercase',
|
|
47
47
|
},
|
|
48
48
|
} );
|
package/src/hooks/utils.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { isEmpty, mapValues, get, setWith, clone } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
10
10
|
|
|
11
|
-
const identity = ( x ) => x;
|
|
12
|
-
|
|
13
11
|
/**
|
|
14
12
|
* Removed falsy values from nested object.
|
|
15
13
|
*
|
|
@@ -24,9 +22,10 @@ export const cleanEmptyObject = ( object ) => {
|
|
|
24
22
|
) {
|
|
25
23
|
return object;
|
|
26
24
|
}
|
|
27
|
-
const cleanedNestedObjects =
|
|
28
|
-
mapValues( object, cleanEmptyObject )
|
|
29
|
-
|
|
25
|
+
const cleanedNestedObjects = Object.fromEntries(
|
|
26
|
+
Object.entries( mapValues( object, cleanEmptyObject ) ).filter(
|
|
27
|
+
( [ , value ] ) => Boolean( value )
|
|
28
|
+
)
|
|
30
29
|
);
|
|
31
30
|
return isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;
|
|
32
31
|
};
|
package/src/layouts/flex.js
CHANGED
|
@@ -10,7 +10,14 @@ import {
|
|
|
10
10
|
arrowRight,
|
|
11
11
|
arrowDown,
|
|
12
12
|
} from '@wordpress/icons';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
Button,
|
|
15
|
+
ToggleControl,
|
|
16
|
+
Flex,
|
|
17
|
+
FlexItem,
|
|
18
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
19
|
+
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
20
|
+
} from '@wordpress/components';
|
|
14
21
|
|
|
15
22
|
/**
|
|
16
23
|
* Internal dependencies
|
|
@@ -257,7 +264,7 @@ function FlexLayoutJustifyContentControl( {
|
|
|
257
264
|
onChange={ onJustificationChange }
|
|
258
265
|
popoverProps={ {
|
|
259
266
|
position: 'bottom right',
|
|
260
|
-
|
|
267
|
+
variant: 'toolbar',
|
|
261
268
|
} }
|
|
262
269
|
/>
|
|
263
270
|
);
|
|
@@ -289,22 +296,23 @@ function FlexLayoutJustifyContentControl( {
|
|
|
289
296
|
}
|
|
290
297
|
|
|
291
298
|
return (
|
|
292
|
-
<
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
299
|
+
<ToggleGroupControl
|
|
300
|
+
label={ __( 'Justification' ) }
|
|
301
|
+
value={ justifyContent }
|
|
302
|
+
onChange={ onJustificationChange }
|
|
303
|
+
className="block-editor-hooks__flex-layout-justification-controls"
|
|
304
|
+
>
|
|
305
|
+
{ justificationOptions.map( ( { value, icon, label } ) => {
|
|
306
|
+
return (
|
|
307
|
+
<ToggleGroupControlOptionIcon
|
|
308
|
+
key={ value }
|
|
309
|
+
value={ value }
|
|
310
|
+
icon={ icon }
|
|
311
|
+
label={ label }
|
|
312
|
+
/>
|
|
313
|
+
);
|
|
314
|
+
} ) }
|
|
315
|
+
</ToggleGroupControl>
|
|
308
316
|
);
|
|
309
317
|
}
|
|
310
318
|
|
|
@@ -327,30 +335,27 @@ function FlexWrapControl( { layout, onChange } ) {
|
|
|
327
335
|
function OrientationControl( { layout, onChange } ) {
|
|
328
336
|
const { orientation = 'horizontal' } = layout;
|
|
329
337
|
return (
|
|
330
|
-
<
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
338
|
+
<ToggleGroupControl
|
|
339
|
+
className="block-editor-hooks__flex-layout-orientation-controls"
|
|
340
|
+
label={ __( 'Orientation' ) }
|
|
341
|
+
value={ orientation }
|
|
342
|
+
onChange={ ( value ) =>
|
|
343
|
+
onChange( {
|
|
344
|
+
...layout,
|
|
345
|
+
orientation: value,
|
|
346
|
+
} )
|
|
347
|
+
}
|
|
348
|
+
>
|
|
349
|
+
<ToggleGroupControlOptionIcon
|
|
334
350
|
icon={ arrowRight }
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
onChange( {
|
|
338
|
-
...layout,
|
|
339
|
-
orientation: 'horizontal',
|
|
340
|
-
} )
|
|
341
|
-
}
|
|
351
|
+
value={ 'horizontal' }
|
|
352
|
+
label={ __( 'Horizontal' ) }
|
|
342
353
|
/>
|
|
343
|
-
<
|
|
344
|
-
label={ __( 'Vertical' ) }
|
|
354
|
+
<ToggleGroupControlOptionIcon
|
|
345
355
|
icon={ arrowDown }
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
onChange( {
|
|
349
|
-
...layout,
|
|
350
|
-
orientation: 'vertical',
|
|
351
|
-
} )
|
|
352
|
-
}
|
|
356
|
+
value={ 'vertical' }
|
|
357
|
+
label={ __( 'Vertical' ) }
|
|
353
358
|
/>
|
|
354
|
-
</
|
|
359
|
+
</ToggleGroupControl>
|
|
355
360
|
);
|
|
356
361
|
}
|
package/src/store/actions.js
CHANGED
|
@@ -1263,6 +1263,28 @@ export function toggleBlockMode( clientId ) {
|
|
|
1263
1263
|
};
|
|
1264
1264
|
}
|
|
1265
1265
|
|
|
1266
|
+
/**
|
|
1267
|
+
* Returns an action object used in signalling that the block interface, eg. toolbar, outline, etc. should be hidden.
|
|
1268
|
+
*
|
|
1269
|
+
* @return {Object} Action object.
|
|
1270
|
+
*/
|
|
1271
|
+
export function __experimentalHideBlockInterface() {
|
|
1272
|
+
return {
|
|
1273
|
+
type: 'HIDE_BLOCK_INTERFACE',
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* Returns an action object used in signalling that the block interface, eg. toolbar, outline, etc. should be shown.
|
|
1279
|
+
*
|
|
1280
|
+
* @return {Object} Action object.
|
|
1281
|
+
*/
|
|
1282
|
+
export function __experimentalShowBlockInterface() {
|
|
1283
|
+
return {
|
|
1284
|
+
type: 'SHOW_BLOCK_INTERFACE',
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1266
1288
|
/**
|
|
1267
1289
|
* Returns an action object used in signalling that the user has begun to type.
|
|
1268
1290
|
*
|
|
@@ -1712,6 +1734,10 @@ export function setBlockVisibility( updates ) {
|
|
|
1712
1734
|
/**
|
|
1713
1735
|
* Action that sets whether a block is being temporaritly edited as blocks.
|
|
1714
1736
|
*
|
|
1737
|
+
* DO-NOT-USE in production.
|
|
1738
|
+
* This action is created for internal/experimental only usage and may be
|
|
1739
|
+
* removed anytime without any warning, causing breakage on any plugin or theme invoking it.
|
|
1740
|
+
*
|
|
1715
1741
|
* @param {?string} temporarilyEditingAsBlocks The block's clientId being temporaritly edited as blocks.
|
|
1716
1742
|
*/
|
|
1717
1743
|
export function __unstableSetTemporarilyEditingAsBlocks(
|
package/src/store/array.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { castArray } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Insert one or multiple elements into a given position of an array.
|
|
8
3
|
*
|
|
@@ -15,7 +10,7 @@ import { castArray } from 'lodash';
|
|
|
15
10
|
export function insertAt( array, elements, index ) {
|
|
16
11
|
return [
|
|
17
12
|
...array.slice( 0, index ),
|
|
18
|
-
...
|
|
13
|
+
...( Array.isArray( elements ) ? elements : [ elements ] ),
|
|
19
14
|
...array.slice( index ),
|
|
20
15
|
];
|
|
21
16
|
}
|