@wordpress/block-editor 13.1.0 → 13.3.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 +21 -17
- package/README.md +1 -2
- package/build/components/block-breadcrumb/index.js +12 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-lock/modal.js +67 -67
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +0 -1
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mover/button.js +1 -1
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +12 -6
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +5 -7
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +20 -17
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-rename/modal.js +4 -12
- package/build/components/block-rename/modal.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +4 -1
- package/build/components/block-toolbar/shuffle.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +7 -58
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/block-toolbar-breadcrumb.js +9 -2
- package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
- package/build/components/block-tools/index.js +14 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +4 -2
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-popover.js +57 -0
- package/build/components/block-tools/zoom-out-popover.js.map +1 -0
- package/build/components/block-tools/zoom-out-toolbar.js +138 -0
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -0
- package/build/components/button-block-appender/index.js +3 -1
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +193 -127
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +10 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/index.js +6 -4
- package/build/components/dimensions-tool/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +26 -61
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +178 -116
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +2 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +2 -1
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -1
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +2 -1
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +8 -0
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -1
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +50 -12
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +50 -0
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +25 -9
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +17 -7
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +94 -0
- package/build/components/grid/grid-item-movers.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/grid-item-resizer.js +18 -56
- package/build/components/grid/grid-item-resizer.js.map +1 -0
- package/build/components/grid/grid-visualizer.js +305 -0
- package/build/components/grid/grid-visualizer.js.map +1 -0
- package/build/components/{grid-visualizer → grid}/index.js +14 -0
- package/build/components/grid/index.js.map +1 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js +40 -0
- package/build/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build/components/grid/use-grid-layout-sync.js +169 -0
- package/build/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build/components/grid/utils.js +145 -0
- package/build/components/grid/utils.js.map +1 -0
- package/build/components/image-editor/aspect-ratio-dropdown.js +0 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/inner-blocks/index.js +1 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
- package/build/components/inserter/menu.js +26 -4
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -1
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/link-control/link-preview.js +1 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/media-placeholder/index.js +19 -23
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +3 -1
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/index.native.js +10 -4
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +14 -0
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +66 -0
- package/build/components/tabbed-sidebar/index.js.map +1 -0
- package/build/components/url-popover/index.js +3 -0
- package/build/components/url-popover/index.js.map +1 -1
- package/build/hooks/background.js +26 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +11 -17
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +195 -11
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/duotone.js +16 -11
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/grid-visualizer.js +65 -0
- package/build/hooks/grid-visualizer.js.map +1 -0
- package/build/hooks/index.js +15 -2
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout-child.js +65 -40
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/position.js +2 -9
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +16 -6
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/utils.js +5 -2
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +44 -2
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/grid.js +92 -76
- package/build/layouts/grid.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +6 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +17 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +0 -2
- package/build/store/defaults.js.map +1 -1
- package/build/store/defaults.native.js +0 -3
- package/build/store/defaults.native.js.map +1 -1
- package/build/store/private-keys.js +2 -1
- package/build/store/private-keys.js.map +1 -1
- package/build/utils/format-font-style.js +45 -0
- package/build/utils/format-font-style.js.map +1 -0
- package/build/utils/format-font-weight.js +68 -0
- package/build/utils/format-font-weight.js.map +1 -0
- package/build/utils/get-editor-region.js +34 -0
- package/build/utils/get-editor-region.js.map +1 -0
- package/build/utils/get-font-styles-and-weights.js +167 -0
- package/build/utils/get-font-styles-and-weights.js.map +1 -0
- package/build/utils/pasting.js +5 -13
- package/build/utils/pasting.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +12 -1
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-lock/modal.js +67 -67
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +0 -1
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mover/button.js +1 -1
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +12 -6
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +5 -7
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +20 -17
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +5 -13
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +4 -1
- package/build-module/components/block-toolbar/shuffle.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +10 -61
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js +9 -2
- package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
- package/build-module/components/block-tools/index.js +14 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +4 -2
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +5 -4
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-popover.js +48 -0
- package/build-module/components/block-tools/zoom-out-popover.js.map +1 -0
- package/build-module/components/block-tools/zoom-out-toolbar.js +131 -0
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -0
- package/build-module/components/button-block-appender/index.js +3 -1
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +194 -128
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +11 -3
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/dimensions-tool/index.js +6 -4
- package/build-module/components/dimensions-tool/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +28 -63
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +181 -119
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +3 -2
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +3 -2
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +3 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +3 -2
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +8 -0
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +3 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +52 -14
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +48 -0
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +25 -9
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +15 -6
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +87 -0
- package/build-module/components/grid/grid-item-movers.js.map +1 -0
- package/build-module/components/{grid-visualizer → grid}/grid-item-resizer.js +13 -51
- package/build-module/components/grid/grid-item-resizer.js.map +1 -0
- package/build-module/components/grid/grid-visualizer.js +297 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -0
- package/build-module/components/grid/index.js +5 -0
- package/build-module/components/grid/index.js.map +1 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js +33 -0
- package/build-module/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
- package/build-module/components/grid/use-grid-layout-sync.js +162 -0
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -0
- package/build-module/components/grid/utils.js +131 -0
- package/build-module/components/grid/utils.js.map +1 -0
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +0 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +1 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -19
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +26 -4
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -2
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +1 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +19 -23
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +3 -1
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +11 -5
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +14 -0
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +5 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +60 -0
- package/build-module/components/tabbed-sidebar/index.js.map +1 -0
- package/build-module/components/url-popover/index.js +3 -0
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/hooks/background.js +26 -4
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +11 -17
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +193 -11
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/duotone.js +16 -11
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/grid-visualizer.js +64 -0
- package/build-module/hooks/grid-visualizer.js.map +1 -0
- package/build-module/hooks/index.js +3 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout-child.js +63 -38
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/position.js +2 -9
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +16 -6
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/utils.js +5 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +44 -2
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/grid.js +92 -76
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +8 -3
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +17 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +0 -2
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/defaults.native.js +0 -3
- package/build-module/store/defaults.native.js.map +1 -1
- package/build-module/store/private-keys.js +1 -0
- package/build-module/store/private-keys.js.map +1 -1
- package/build-module/utils/format-font-style.js +39 -0
- package/build-module/utils/format-font-style.js.map +1 -0
- package/build-module/utils/format-font-weight.js +62 -0
- package/build-module/utils/format-font-weight.js.map +1 -0
- package/build-module/utils/get-editor-region.js +28 -0
- package/build-module/utils/get-editor-region.js.map +1 -0
- package/build-module/utils/get-font-styles-and-weights.js +160 -0
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -0
- package/build-module/utils/pasting.js +5 -13
- package/build-module/utils/pasting.js.map +1 -1
- package/build-style/content-rtl.css +1 -0
- package/build-style/content.css +1 -0
- package/build-style/style-rtl.css +238 -106
- package/build-style/style.css +238 -106
- package/package.json +32 -32
- package/src/components/block-breadcrumb/index.js +16 -1
- package/src/components/block-lock/modal.js +95 -82
- package/src/components/block-lock/style.scss +11 -1
- package/src/components/block-lock/toolbar.js +0 -1
- package/src/components/block-mover/button.js +1 -1
- package/src/components/block-mover/index.js +37 -24
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -2
- package/src/components/block-patterns-paging/index.js +8 -11
- package/src/components/block-patterns-paging/style.scss +18 -0
- package/src/components/block-quick-navigation/index.js +21 -28
- package/src/components/block-rename/modal.js +2 -8
- package/src/components/block-switcher/test/index.js +6 -6
- package/src/components/block-toolbar/shuffle.js +4 -1
- package/src/components/block-toolbar/style.scss +1 -11
- package/src/components/block-tools/block-selection-button.js +11 -83
- package/src/components/block-tools/block-toolbar-breadcrumb.js +9 -4
- package/src/components/block-tools/index.js +21 -1
- package/src/components/block-tools/style.scss +15 -0
- package/src/components/block-tools/use-show-block-tools.js +14 -6
- package/src/components/block-tools/zoom-out-mode-inserters.js +5 -4
- package/src/components/block-tools/zoom-out-popover.js +49 -0
- package/src/components/block-tools/zoom-out-toolbar.js +140 -0
- package/src/components/button-block-appender/index.js +2 -1
- package/src/components/child-layout-control/index.js +243 -160
- package/src/components/date-format-picker/index.js +10 -1
- package/src/components/date-format-picker/style.scss +0 -9
- package/src/components/dimensions-tool/index.js +97 -89
- package/src/components/font-appearance-control/index.js +29 -83
- package/src/components/font-appearance-control/style.scss +3 -5
- package/src/components/global-styles/background-panel.js +249 -170
- package/src/components/global-styles/border-panel.js +3 -2
- package/src/components/global-styles/color-panel.js +3 -2
- package/src/components/global-styles/dimensions-panel.js +3 -2
- package/src/components/global-styles/filters-panel.js +3 -2
- package/src/components/global-styles/hooks.js +9 -0
- package/src/components/global-styles/image-settings-panel.js +3 -2
- package/src/components/global-styles/style.scss +105 -20
- package/src/components/global-styles/test/typography-utils.js +269 -0
- package/src/components/global-styles/test/use-global-styles-output.js +38 -3
- package/src/components/global-styles/typography-panel.js +49 -12
- package/src/components/global-styles/typography-utils.js +63 -0
- package/src/components/global-styles/use-global-styles-output.js +25 -9
- package/src/components/global-styles/utils.js +17 -6
- package/src/components/grid/grid-item-movers.js +112 -0
- package/src/components/{grid-visualizer → grid}/grid-item-resizer.js +15 -52
- package/src/components/grid/grid-visualizer.js +384 -0
- package/src/components/grid/index.js +4 -0
- package/src/components/grid/style.scss +98 -0
- package/src/components/grid/use-get-number-of-blocks-before-cell.js +30 -0
- package/src/components/grid/use-grid-layout-sync.js +170 -0
- package/src/components/grid/utils.js +178 -0
- package/src/components/iframe/content.scss +1 -0
- package/src/components/image-editor/aspect-ratio-dropdown.js +0 -1
- package/src/components/inner-blocks/index.js +4 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -16
- package/src/components/inserter/menu.js +47 -13
- package/src/components/inserter/quick-inserter.js +6 -1
- package/src/components/inserter/style.scss +1 -49
- package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
- package/src/components/link-control/link-preview.js +1 -1
- package/src/components/media-placeholder/index.js +22 -32
- package/src/components/navigable-toolbar/index.js +3 -1
- package/src/components/rich-text/event-listeners/input-rules.js +1 -1
- package/src/components/rich-text/index.native.js +10 -8
- package/src/components/rich-text/native/index.native.js +17 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +6 -1
- package/src/components/tabbed-sidebar/README.md +76 -0
- package/src/components/tabbed-sidebar/index.js +70 -0
- package/src/components/tabbed-sidebar/style.scss +53 -0
- package/src/components/url-popover/index.js +3 -0
- package/src/hooks/background.js +25 -10
- package/src/hooks/block-hooks.js +9 -16
- package/src/hooks/block-style-variation.js +226 -9
- package/src/hooks/duotone.js +16 -12
- package/src/hooks/grid-visualizer.js +64 -0
- package/src/hooks/index.js +3 -0
- package/src/hooks/layout-child.js +75 -39
- package/src/hooks/position.js +3 -10
- package/src/hooks/test/get-variation-styles-with-ref-values.js +91 -0
- package/src/hooks/use-bindings-attributes.js +18 -4
- package/src/hooks/utils.js +5 -1
- package/src/layouts/constrained.js +43 -2
- package/src/layouts/grid.js +175 -88
- package/src/lock-unlock.js +1 -1
- package/src/private-apis.js +12 -1
- package/src/store/actions.js +21 -1
- package/src/store/defaults.js +0 -2
- package/src/store/defaults.native.js +0 -3
- package/src/store/private-keys.js +1 -0
- package/src/style.scss +2 -2
- package/src/utils/format-font-style.js +40 -0
- package/src/utils/format-font-weight.js +63 -0
- package/src/utils/get-editor-region.js +31 -0
- package/src/utils/get-font-styles-and-weights.js +191 -0
- package/src/utils/pasting.js +5 -12
- package/src/utils/test/format-font-style.js +34 -0
- package/src/utils/test/format-font-weight.js +66 -0
- package/src/utils/test/get-font-styles-and-weights.js +513 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build/components/grid-visualizer/grid-visualizer.js +0 -92
- package/build/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build/components/grid-visualizer/index.js.map +0 -1
- package/build/components/grid-visualizer/utils.js +0 -10
- package/build/components/grid-visualizer/utils.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-item-resizer.js.map +0 -1
- package/build-module/components/grid-visualizer/grid-visualizer.js +0 -84
- package/build-module/components/grid-visualizer/grid-visualizer.js.map +0 -1
- package/build-module/components/grid-visualizer/index.js +0 -3
- package/build-module/components/grid-visualizer/index.js.map +0 -1
- package/build-module/components/grid-visualizer/utils.js +0 -4
- package/build-module/components/grid-visualizer/utils.js.map +0 -1
- package/src/components/grid-visualizer/grid-visualizer.js +0 -101
- package/src/components/grid-visualizer/index.js +0 -2
- package/src/components/grid-visualizer/style.scss +0 -34
- package/src/components/grid-visualizer/utils.js +0 -5
- package/src/hooks/position.scss +0 -18
- /package/src/components/font-sizes/{README.MD → README.md} +0 -0
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
ToggleControl,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
import { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';
|
|
16
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
17
16
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
18
17
|
import { getBlockType } from '@wordpress/blocks';
|
|
19
18
|
|
|
@@ -64,10 +63,6 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
64
63
|
);
|
|
65
64
|
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
66
65
|
const blockInformation = useBlockDisplayInformation( clientId );
|
|
67
|
-
const instanceId = useInstanceId(
|
|
68
|
-
BlockLockModal,
|
|
69
|
-
'block-editor-block-lock-modal__options-title'
|
|
70
|
-
);
|
|
71
66
|
|
|
72
67
|
useEffect( () => {
|
|
73
68
|
setLock( {
|
|
@@ -90,11 +85,6 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
90
85
|
overlayClassName="block-editor-block-lock-modal"
|
|
91
86
|
onRequestClose={ onClose }
|
|
92
87
|
>
|
|
93
|
-
<p>
|
|
94
|
-
{ __(
|
|
95
|
-
'Choose specific attributes to restrict or lock all available options.'
|
|
96
|
-
) }
|
|
97
|
-
</p>
|
|
98
88
|
<form
|
|
99
89
|
onSubmit={ ( event ) => {
|
|
100
90
|
event.preventDefault();
|
|
@@ -107,84 +97,107 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
107
97
|
onClose();
|
|
108
98
|
} }
|
|
109
99
|
>
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
>
|
|
115
|
-
<CheckboxControl
|
|
116
|
-
__nextHasNoMarginBottom
|
|
117
|
-
className="block-editor-block-lock-modal__options-title"
|
|
118
|
-
label={
|
|
119
|
-
<span id={ instanceId }>{ __( 'Lock all' ) }</span>
|
|
120
|
-
}
|
|
121
|
-
checked={ isAllChecked }
|
|
122
|
-
indeterminate={ isMixed }
|
|
123
|
-
onChange={ ( newValue ) =>
|
|
124
|
-
setLock( {
|
|
125
|
-
move: newValue,
|
|
126
|
-
remove: newValue,
|
|
127
|
-
...( allowsEditLocking
|
|
128
|
-
? { edit: newValue }
|
|
129
|
-
: {} ),
|
|
130
|
-
} )
|
|
131
|
-
}
|
|
132
|
-
/>
|
|
133
|
-
<ul className="block-editor-block-lock-modal__checklist">
|
|
134
|
-
{ allowsEditLocking && (
|
|
135
|
-
<li className="block-editor-block-lock-modal__checklist-item">
|
|
136
|
-
<CheckboxControl
|
|
137
|
-
__nextHasNoMarginBottom
|
|
138
|
-
label={ __( 'Restrict editing' ) }
|
|
139
|
-
checked={ !! lock.edit }
|
|
140
|
-
onChange={ ( edit ) =>
|
|
141
|
-
setLock( ( prevLock ) => ( {
|
|
142
|
-
...prevLock,
|
|
143
|
-
edit,
|
|
144
|
-
} ) )
|
|
145
|
-
}
|
|
146
|
-
/>
|
|
147
|
-
<Icon
|
|
148
|
-
className="block-editor-block-lock-modal__lock-icon"
|
|
149
|
-
icon={ lock.edit ? lockIcon : unlockIcon }
|
|
150
|
-
/>
|
|
151
|
-
</li>
|
|
100
|
+
<fieldset className="block-editor-block-lock-modal__options">
|
|
101
|
+
<legend>
|
|
102
|
+
{ __(
|
|
103
|
+
'Choose specific attributes to restrict or lock all available options.'
|
|
152
104
|
) }
|
|
153
|
-
|
|
105
|
+
</legend>
|
|
106
|
+
{ /*
|
|
107
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
108
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
109
|
+
*/
|
|
110
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */ }
|
|
111
|
+
<ul
|
|
112
|
+
role="list"
|
|
113
|
+
className="block-editor-block-lock-modal__checklist"
|
|
114
|
+
>
|
|
115
|
+
<li>
|
|
154
116
|
<CheckboxControl
|
|
155
117
|
__nextHasNoMarginBottom
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
118
|
+
className="block-editor-block-lock-modal__options-all"
|
|
119
|
+
label={ __( 'Lock all' ) }
|
|
120
|
+
checked={ isAllChecked }
|
|
121
|
+
indeterminate={ isMixed }
|
|
122
|
+
onChange={ ( newValue ) =>
|
|
123
|
+
setLock( {
|
|
124
|
+
move: newValue,
|
|
125
|
+
remove: newValue,
|
|
126
|
+
...( allowsEditLocking
|
|
127
|
+
? { edit: newValue }
|
|
128
|
+
: {} ),
|
|
129
|
+
} )
|
|
163
130
|
}
|
|
164
131
|
/>
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
132
|
+
<ul
|
|
133
|
+
role="list"
|
|
134
|
+
className="block-editor-block-lock-modal__checklist"
|
|
135
|
+
>
|
|
136
|
+
{ allowsEditLocking && (
|
|
137
|
+
<li className="block-editor-block-lock-modal__checklist-item">
|
|
138
|
+
<CheckboxControl
|
|
139
|
+
__nextHasNoMarginBottom
|
|
140
|
+
label={ __( 'Restrict editing' ) }
|
|
141
|
+
checked={ !! lock.edit }
|
|
142
|
+
onChange={ ( edit ) =>
|
|
143
|
+
setLock( ( prevLock ) => ( {
|
|
144
|
+
...prevLock,
|
|
145
|
+
edit,
|
|
146
|
+
} ) )
|
|
147
|
+
}
|
|
148
|
+
/>
|
|
149
|
+
<Icon
|
|
150
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
151
|
+
icon={
|
|
152
|
+
lock.edit
|
|
153
|
+
? lockIcon
|
|
154
|
+
: unlockIcon
|
|
155
|
+
}
|
|
156
|
+
/>
|
|
157
|
+
</li>
|
|
158
|
+
) }
|
|
159
|
+
<li className="block-editor-block-lock-modal__checklist-item">
|
|
160
|
+
<CheckboxControl
|
|
161
|
+
__nextHasNoMarginBottom
|
|
162
|
+
label={ __( 'Disable movement' ) }
|
|
163
|
+
checked={ lock.move }
|
|
164
|
+
onChange={ ( move ) =>
|
|
165
|
+
setLock( ( prevLock ) => ( {
|
|
166
|
+
...prevLock,
|
|
167
|
+
move,
|
|
168
|
+
} ) )
|
|
169
|
+
}
|
|
170
|
+
/>
|
|
171
|
+
<Icon
|
|
172
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
173
|
+
icon={
|
|
174
|
+
lock.move ? lockIcon : unlockIcon
|
|
175
|
+
}
|
|
176
|
+
/>
|
|
177
|
+
</li>
|
|
178
|
+
<li className="block-editor-block-lock-modal__checklist-item">
|
|
179
|
+
<CheckboxControl
|
|
180
|
+
__nextHasNoMarginBottom
|
|
181
|
+
label={ __( 'Prevent removal' ) }
|
|
182
|
+
checked={ lock.remove }
|
|
183
|
+
onChange={ ( remove ) =>
|
|
184
|
+
setLock( ( prevLock ) => ( {
|
|
185
|
+
...prevLock,
|
|
186
|
+
remove,
|
|
187
|
+
} ) )
|
|
188
|
+
}
|
|
189
|
+
/>
|
|
190
|
+
<Icon
|
|
191
|
+
className="block-editor-block-lock-modal__lock-icon"
|
|
192
|
+
icon={
|
|
193
|
+
lock.remove ? lockIcon : unlockIcon
|
|
194
|
+
}
|
|
195
|
+
/>
|
|
196
|
+
</li>
|
|
197
|
+
</ul>
|
|
186
198
|
</li>
|
|
187
199
|
</ul>
|
|
200
|
+
{ /* eslint-enable jsx-a11y/no-redundant-roles */ }
|
|
188
201
|
{ hasTemplateLock && (
|
|
189
202
|
<ToggleControl
|
|
190
203
|
__nextHasNoMarginBottom
|
|
@@ -197,7 +210,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
|
|
|
197
210
|
}
|
|
198
211
|
/>
|
|
199
212
|
) }
|
|
200
|
-
</
|
|
213
|
+
</fieldset>
|
|
201
214
|
<Flex
|
|
202
215
|
className="block-editor-block-lock-modal__actions"
|
|
203
216
|
justify="flex-end"
|
|
@@ -8,17 +8,27 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.block-editor-block-lock-modal__options {
|
|
12
|
+
margin-top: $grid-unit-20;
|
|
13
|
+
|
|
14
|
+
legend {
|
|
15
|
+
margin-bottom: $grid-unit-20;
|
|
16
|
+
padding: 0;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
11
20
|
.block-editor-block-lock-modal__checklist {
|
|
12
21
|
margin: 0;
|
|
13
22
|
}
|
|
14
23
|
|
|
15
|
-
.block-editor-block-lock-modal__options-
|
|
24
|
+
.block-editor-block-lock-modal__options-all {
|
|
16
25
|
padding: $grid-unit-15 0;
|
|
17
26
|
|
|
18
27
|
.components-checkbox-control__label {
|
|
19
28
|
font-weight: 600;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
31
|
+
|
|
22
32
|
.block-editor-block-lock-modal__checklist-item {
|
|
23
33
|
display: flex;
|
|
24
34
|
justify-content: space-between;
|
|
@@ -143,7 +143,7 @@ const BlockMoverButton = forwardRef(
|
|
|
143
143
|
{ ...props }
|
|
144
144
|
onClick={ isDisabled ? null : onClick }
|
|
145
145
|
disabled={ isDisabled }
|
|
146
|
-
|
|
146
|
+
accessibleWhenDisabled
|
|
147
147
|
/>
|
|
148
148
|
<VisuallyHidden id={ descriptionId }>
|
|
149
149
|
{ getBlockMoverDescription(
|
|
@@ -25,7 +25,14 @@ function BlockMover( {
|
|
|
25
25
|
isBlockMoverUpButtonDisabled,
|
|
26
26
|
isBlockMoverDownButtonDisabled,
|
|
27
27
|
} ) {
|
|
28
|
-
const {
|
|
28
|
+
const {
|
|
29
|
+
canMove,
|
|
30
|
+
rootClientId,
|
|
31
|
+
isFirst,
|
|
32
|
+
isLast,
|
|
33
|
+
orientation,
|
|
34
|
+
isManualGrid,
|
|
35
|
+
} = useSelect(
|
|
29
36
|
( select ) => {
|
|
30
37
|
const {
|
|
31
38
|
getBlockIndex,
|
|
@@ -33,6 +40,7 @@ function BlockMover( {
|
|
|
33
40
|
canMoveBlocks,
|
|
34
41
|
getBlockOrder,
|
|
35
42
|
getBlockRootClientId,
|
|
43
|
+
getBlockAttributes,
|
|
36
44
|
} = select( blockEditorStore );
|
|
37
45
|
const normalizedClientIds = Array.isArray( clientIds )
|
|
38
46
|
? clientIds
|
|
@@ -44,6 +52,7 @@ function BlockMover( {
|
|
|
44
52
|
normalizedClientIds[ normalizedClientIds.length - 1 ]
|
|
45
53
|
);
|
|
46
54
|
const blockOrder = getBlockOrder( _rootClientId );
|
|
55
|
+
const { layout = {} } = getBlockAttributes( _rootClientId ) ?? {};
|
|
47
56
|
|
|
48
57
|
return {
|
|
49
58
|
canMove: canMoveBlocks( clientIds ),
|
|
@@ -51,6 +60,10 @@ function BlockMover( {
|
|
|
51
60
|
isFirst: firstIndex === 0,
|
|
52
61
|
isLast: lastIndex === blockOrder.length - 1,
|
|
53
62
|
orientation: getBlockListSettings( _rootClientId )?.orientation,
|
|
63
|
+
isManualGrid:
|
|
64
|
+
layout.type === 'grid' &&
|
|
65
|
+
layout.isManualPlacement &&
|
|
66
|
+
window.__experimentalEnableGridInteractivity,
|
|
54
67
|
};
|
|
55
68
|
},
|
|
56
69
|
[ clientIds ]
|
|
@@ -60,8 +73,6 @@ function BlockMover( {
|
|
|
60
73
|
return null;
|
|
61
74
|
}
|
|
62
75
|
|
|
63
|
-
const dragHandleLabel = __( 'Drag' );
|
|
64
|
-
|
|
65
76
|
return (
|
|
66
77
|
<ToolbarGroup
|
|
67
78
|
className={ clsx( 'block-editor-block-mover', {
|
|
@@ -75,7 +86,7 @@ function BlockMover( {
|
|
|
75
86
|
icon={ dragHandle }
|
|
76
87
|
className="block-editor-block-mover__drag-handle"
|
|
77
88
|
aria-hidden="true"
|
|
78
|
-
label={
|
|
89
|
+
label={ __( 'Drag' ) }
|
|
79
90
|
// Should not be able to tab to drag handle as this
|
|
80
91
|
// button can only be used with a pointer device.
|
|
81
92
|
tabIndex="-1"
|
|
@@ -84,26 +95,28 @@ function BlockMover( {
|
|
|
84
95
|
) }
|
|
85
96
|
</BlockDraggable>
|
|
86
97
|
) }
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
{ ! isManualGrid && (
|
|
99
|
+
<div className="block-editor-block-mover__move-button-container">
|
|
100
|
+
<ToolbarItem>
|
|
101
|
+
{ ( itemProps ) => (
|
|
102
|
+
<BlockMoverUpButton
|
|
103
|
+
disabled={ isBlockMoverUpButtonDisabled }
|
|
104
|
+
clientIds={ clientIds }
|
|
105
|
+
{ ...itemProps }
|
|
106
|
+
/>
|
|
107
|
+
) }
|
|
108
|
+
</ToolbarItem>
|
|
109
|
+
<ToolbarItem>
|
|
110
|
+
{ ( itemProps ) => (
|
|
111
|
+
<BlockMoverDownButton
|
|
112
|
+
disabled={ isBlockMoverDownButtonDisabled }
|
|
113
|
+
clientIds={ clientIds }
|
|
114
|
+
{ ...itemProps }
|
|
115
|
+
/>
|
|
116
|
+
) }
|
|
117
|
+
</ToolbarItem>
|
|
118
|
+
</div>
|
|
119
|
+
) }
|
|
107
120
|
</ToolbarGroup>
|
|
108
121
|
);
|
|
109
122
|
}
|
|
@@ -35,14 +35,14 @@ const CarouselNavigation = ( {
|
|
|
35
35
|
label={ __( 'Previous pattern' ) }
|
|
36
36
|
onClick={ handlePrevious }
|
|
37
37
|
disabled={ activeSlide === 0 }
|
|
38
|
-
|
|
38
|
+
accessibleWhenDisabled
|
|
39
39
|
/>
|
|
40
40
|
<Button
|
|
41
41
|
icon={ chevronRight }
|
|
42
42
|
label={ __( 'Next pattern' ) }
|
|
43
43
|
onClick={ handleNext }
|
|
44
44
|
disabled={ activeSlide === totalSlides - 1 }
|
|
45
|
-
|
|
45
|
+
accessibleWhenDisabled
|
|
46
46
|
/>
|
|
47
47
|
</div>
|
|
48
48
|
);
|
|
@@ -18,14 +18,11 @@ export default function Pagination( {
|
|
|
18
18
|
return (
|
|
19
19
|
<VStack className="block-editor-patterns__grid-pagination-wrapper">
|
|
20
20
|
<Text variant="muted">
|
|
21
|
-
{
|
|
21
|
+
{ sprintf(
|
|
22
22
|
// translators: %s: Total number of patterns.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
totalItems
|
|
27
|
-
)
|
|
28
|
-
}
|
|
23
|
+
_n( '%s item', '%s items', totalItems ),
|
|
24
|
+
totalItems
|
|
25
|
+
) }
|
|
29
26
|
</Text>
|
|
30
27
|
|
|
31
28
|
{ numPages > 1 && (
|
|
@@ -45,7 +42,7 @@ export default function Pagination( {
|
|
|
45
42
|
onClick={ () => changePage( 1 ) }
|
|
46
43
|
disabled={ currentPage === 1 }
|
|
47
44
|
aria-label={ __( 'First page' ) }
|
|
48
|
-
|
|
45
|
+
accessibleWhenDisabled
|
|
49
46
|
>
|
|
50
47
|
<span>«</span>
|
|
51
48
|
</Button>
|
|
@@ -54,7 +51,7 @@ export default function Pagination( {
|
|
|
54
51
|
onClick={ () => changePage( currentPage - 1 ) }
|
|
55
52
|
disabled={ currentPage === 1 }
|
|
56
53
|
aria-label={ __( 'Previous page' ) }
|
|
57
|
-
|
|
54
|
+
accessibleWhenDisabled
|
|
58
55
|
>
|
|
59
56
|
<span>‹</span>
|
|
60
57
|
</Button>
|
|
@@ -77,7 +74,7 @@ export default function Pagination( {
|
|
|
77
74
|
onClick={ () => changePage( currentPage + 1 ) }
|
|
78
75
|
disabled={ currentPage === numPages }
|
|
79
76
|
aria-label={ __( 'Next page' ) }
|
|
80
|
-
|
|
77
|
+
accessibleWhenDisabled
|
|
81
78
|
>
|
|
82
79
|
<span>›</span>
|
|
83
80
|
</Button>
|
|
@@ -87,7 +84,7 @@ export default function Pagination( {
|
|
|
87
84
|
disabled={ currentPage === numPages }
|
|
88
85
|
aria-label={ __( 'Last page' ) }
|
|
89
86
|
size="default"
|
|
90
|
-
|
|
87
|
+
accessibleWhenDisabled
|
|
91
88
|
>
|
|
92
89
|
<span>»</span>
|
|
93
90
|
</Button>
|
|
@@ -42,4 +42,22 @@
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
@media screen and (min-width: $break-large) {
|
|
47
|
+
.block-editor-patterns__grid-pagination {
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
.block-editor-patterns__grid-pagination-previous,
|
|
50
|
+
.block-editor-patterns__grid-pagination-next {
|
|
51
|
+
flex-direction: row;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.block-editor-block-patterns-list .block-editor-patterns__grid-pagination {
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
.block-editor-patterns__grid-pagination-previous,
|
|
60
|
+
.block-editor-patterns__grid-pagination-next {
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
}
|
|
45
63
|
}
|
|
@@ -10,18 +10,16 @@ import {
|
|
|
10
10
|
FlexBlock,
|
|
11
11
|
FlexItem,
|
|
12
12
|
} from '@wordpress/components';
|
|
13
|
-
import {
|
|
14
|
-
__experimentalGetBlockLabel,
|
|
15
|
-
store as blocksStore,
|
|
16
|
-
} from '@wordpress/blocks';
|
|
17
13
|
|
|
18
14
|
/**
|
|
19
15
|
* Internal dependencies
|
|
20
16
|
*/
|
|
21
17
|
import { store as blockEditorStore } from '../../store';
|
|
22
18
|
import BlockIcon from '../block-icon';
|
|
19
|
+
import useBlockDisplayInformation from '../use-block-display-information';
|
|
20
|
+
import useBlockDisplayTitle from '../block-title/use-block-display-title';
|
|
23
21
|
|
|
24
|
-
export default function BlockQuickNavigation( { clientIds } ) {
|
|
22
|
+
export default function BlockQuickNavigation( { clientIds, onSelect } ) {
|
|
25
23
|
if ( ! clientIds.length ) {
|
|
26
24
|
return null;
|
|
27
25
|
}
|
|
@@ -29,6 +27,7 @@ export default function BlockQuickNavigation( { clientIds } ) {
|
|
|
29
27
|
<VStack spacing={ 1 }>
|
|
30
28
|
{ clientIds.map( ( clientId ) => (
|
|
31
29
|
<BlockQuickNavigationItem
|
|
30
|
+
onSelect={ onSelect }
|
|
32
31
|
key={ clientId }
|
|
33
32
|
clientId={ clientId }
|
|
34
33
|
/>
|
|
@@ -37,29 +36,18 @@ export default function BlockQuickNavigation( { clientIds } ) {
|
|
|
37
36
|
);
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
function BlockQuickNavigationItem( { clientId } ) {
|
|
41
|
-
const
|
|
39
|
+
function BlockQuickNavigationItem( { clientId, onSelect } ) {
|
|
40
|
+
const blockInformation = useBlockDisplayInformation( clientId );
|
|
41
|
+
const blockTitle = useBlockDisplayTitle( {
|
|
42
|
+
clientId,
|
|
43
|
+
context: 'list-view',
|
|
44
|
+
} );
|
|
45
|
+
const { isSelected } = useSelect(
|
|
42
46
|
( select ) => {
|
|
43
|
-
const {
|
|
44
|
-
|
|
45
|
-
getBlockAttributes,
|
|
46
|
-
isBlockSelected,
|
|
47
|
-
hasSelectedInnerBlock,
|
|
48
|
-
} = select( blockEditorStore );
|
|
49
|
-
const { getBlockType } = select( blocksStore );
|
|
50
|
-
|
|
51
|
-
const blockType = getBlockType( getBlockName( clientId ) );
|
|
52
|
-
const attributes = getBlockAttributes( clientId );
|
|
47
|
+
const { isBlockSelected, hasSelectedInnerBlock } =
|
|
48
|
+
select( blockEditorStore );
|
|
53
49
|
|
|
54
50
|
return {
|
|
55
|
-
name:
|
|
56
|
-
blockType &&
|
|
57
|
-
__experimentalGetBlockLabel(
|
|
58
|
-
blockType,
|
|
59
|
-
attributes,
|
|
60
|
-
'list-view'
|
|
61
|
-
),
|
|
62
|
-
icon: blockType?.icon,
|
|
63
51
|
isSelected:
|
|
64
52
|
isBlockSelected( clientId ) ||
|
|
65
53
|
hasSelectedInnerBlock( clientId, /* deep: */ true ),
|
|
@@ -72,14 +60,19 @@ function BlockQuickNavigationItem( { clientId } ) {
|
|
|
72
60
|
return (
|
|
73
61
|
<Button
|
|
74
62
|
isPressed={ isSelected }
|
|
75
|
-
onClick={ () =>
|
|
63
|
+
onClick={ async () => {
|
|
64
|
+
await selectBlock( clientId );
|
|
65
|
+
if ( onSelect ) {
|
|
66
|
+
onSelect( clientId );
|
|
67
|
+
}
|
|
68
|
+
} }
|
|
76
69
|
>
|
|
77
70
|
<Flex>
|
|
78
71
|
<FlexItem>
|
|
79
|
-
<BlockIcon icon={ icon } />
|
|
72
|
+
<BlockIcon icon={ blockInformation?.icon } />
|
|
80
73
|
</FlexItem>
|
|
81
74
|
<FlexBlock style={ { textAlign: 'left' } }>
|
|
82
|
-
<Truncate>{
|
|
75
|
+
<Truncate>{ blockTitle }</Truncate>
|
|
83
76
|
</FlexBlock>
|
|
84
77
|
</Flex>
|
|
85
78
|
</Button>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Modal,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
11
|
import { __, sprintf } from '@wordpress/i18n';
|
|
12
|
-
import { useState
|
|
12
|
+
import { useState } from '@wordpress/element';
|
|
13
13
|
import { speak } from '@wordpress/a11y';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -27,7 +27,6 @@ export default function BlockRenameModal( {
|
|
|
27
27
|
hasOverridesWarning,
|
|
28
28
|
} ) {
|
|
29
29
|
const [ editedBlockName, setEditedBlockName ] = useState( blockName );
|
|
30
|
-
const descriptionId = useId();
|
|
31
30
|
|
|
32
31
|
const nameHasChanged = editedBlockName !== blockName;
|
|
33
32
|
const nameIsOriginal = editedBlockName === originalBlockName;
|
|
@@ -65,7 +64,6 @@ export default function BlockRenameModal( {
|
|
|
65
64
|
onRequestClose={ onClose }
|
|
66
65
|
overlayClassName="block-editor-block-rename-modal"
|
|
67
66
|
focusOnMount="firstContentElement"
|
|
68
|
-
aria={ { describedby: descriptionId } }
|
|
69
67
|
size="small"
|
|
70
68
|
>
|
|
71
69
|
<form
|
|
@@ -79,16 +77,12 @@ export default function BlockRenameModal( {
|
|
|
79
77
|
handleSubmit();
|
|
80
78
|
} }
|
|
81
79
|
>
|
|
82
|
-
<p id={ descriptionId }>
|
|
83
|
-
{ __( 'Enter a custom name for this block.' ) }
|
|
84
|
-
</p>
|
|
85
80
|
<VStack spacing="3">
|
|
86
81
|
<TextControl
|
|
87
82
|
__nextHasNoMarginBottom
|
|
88
83
|
__next40pxDefaultSize
|
|
89
84
|
value={ editedBlockName }
|
|
90
|
-
label={ __( '
|
|
91
|
-
hideLabelFromVision
|
|
85
|
+
label={ __( 'Name' ) }
|
|
92
86
|
help={
|
|
93
87
|
hasOverridesWarning
|
|
94
88
|
? __(
|
|
@@ -134,7 +134,7 @@ describe( 'BlockSwitcher', () => {
|
|
|
134
134
|
expect( items[ 1 ] ).toHaveTextContent( headingBlockType.title );
|
|
135
135
|
} );
|
|
136
136
|
|
|
137
|
-
test( 'should render disabled block switcher when we have a single selected block without styles and we cannot remove it', () => {
|
|
137
|
+
test( 'should render accessibly disabled block switcher when we have a single selected block without styles and we cannot remove it', () => {
|
|
138
138
|
useSelect.mockImplementation( () => ( {
|
|
139
139
|
blocks: [ headingBlock1 ],
|
|
140
140
|
icon: copy,
|
|
@@ -142,11 +142,11 @@ describe( 'BlockSwitcher', () => {
|
|
|
142
142
|
canRemove: false,
|
|
143
143
|
} ) );
|
|
144
144
|
render( <BlockSwitcher clientIds={ [ headingBlock1.clientId ] } /> );
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
).
|
|
145
|
+
const blockSwitcher = screen.getByRole( 'button', {
|
|
146
|
+
name: 'Block Name',
|
|
147
|
+
} );
|
|
148
|
+
expect( blockSwitcher ).toBeEnabled();
|
|
149
|
+
expect( blockSwitcher ).toHaveAttribute( 'aria-disabled', 'true' );
|
|
150
150
|
} );
|
|
151
151
|
|
|
152
152
|
test( 'should render message for no available transforms', async () => {
|
|
@@ -60,7 +60,9 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
60
60
|
pattern.blocks.length === 1 &&
|
|
61
61
|
pattern.categories?.some( ( category ) => {
|
|
62
62
|
return categories.includes( category );
|
|
63
|
-
} )
|
|
63
|
+
} ) &&
|
|
64
|
+
// Check if the pattern is not a synced pattern.
|
|
65
|
+
( pattern.syncStatus === 'unsynced' || ! pattern.id )
|
|
64
66
|
);
|
|
65
67
|
} );
|
|
66
68
|
}, [ categories, patterns ] );
|
|
@@ -83,6 +85,7 @@ export default function Shuffle( { clientId, as = Container } ) {
|
|
|
83
85
|
<ComponentToUse
|
|
84
86
|
label={ __( 'Shuffle' ) }
|
|
85
87
|
icon={ shuffle }
|
|
88
|
+
className="block-editor-block-toolbar-shuffle"
|
|
86
89
|
onClick={ () => {
|
|
87
90
|
const nextPattern = getNextPattern();
|
|
88
91
|
nextPattern.blocks[ 0 ].attributes = {
|
|
@@ -24,8 +24,6 @@
|
|
|
24
24
|
.components-toolbar-group,
|
|
25
25
|
.components-toolbar {
|
|
26
26
|
background: none;
|
|
27
|
-
// IE11 has thick paddings without this.
|
|
28
|
-
line-height: 0;
|
|
29
27
|
|
|
30
28
|
// These margins make the buttons themselves overlap the chrome of the toolbar.
|
|
31
29
|
// This helps make them square, and maximize the hit area.
|
|
@@ -151,15 +149,7 @@
|
|
|
151
149
|
}
|
|
152
150
|
|
|
153
151
|
.block-editor-block-toolbar__slot {
|
|
154
|
-
|
|
155
|
-
display: inline-block;
|
|
156
|
-
// Fix for toolbar button misalignment on IE11
|
|
157
|
-
line-height: 0;
|
|
158
|
-
|
|
159
|
-
// IE11 doesn't read rules inside this query. They are applied only to modern browsers.
|
|
160
|
-
@supports (position: sticky) {
|
|
161
|
-
display: inline-flex;
|
|
162
|
-
}
|
|
152
|
+
display: inline-flex;
|
|
163
153
|
}
|
|
164
154
|
|
|
165
155
|
.show-icon-labels {
|