@wordpress/block-editor 13.2.0 → 13.4.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 +4 -0
- package/README.md +0 -5
- package/build/components/alignment-control/ui.js +2 -2
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +1 -1
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +1 -1
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +12 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-inspector/index.js +6 -3
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +3 -1
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +9 -2
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +25 -9
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +3 -2
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +2 -0
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-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 +1 -1
- 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-removal-warning-modal/index.js +2 -0
- package/build/components/block-removal-warning-modal/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-switcher/index.js +1 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +11 -12
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +20 -17
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-toolbar/shuffle.js +6 -2
- 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 +9 -8
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserter-button.js +45 -0
- package/build/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
- package/build/components/block-tools/zoom-out-mode-inserters.js +29 -28
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-popover.js +58 -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 +26 -18
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +1 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +7 -4
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/dimensions-tool/index.js +6 -4
- package/build/components/dimensions-tool/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +22 -62
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +185 -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 +13 -1
- 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 +45 -24
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +121 -0
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +47 -13
- 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 +90 -48
- package/build/components/grid/grid-item-movers.js.map +1 -1
- package/build/components/grid/grid-item-resizer.js +2 -2
- package/build/components/grid/grid-item-resizer.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +117 -37
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +60 -41
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/index.js +1 -9
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -2
- 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/block-patterns-tab/patterns-filter.js +20 -23
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +1 -0
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/menu.js +26 -4
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +20 -3
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -1
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +10 -3
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +2 -1
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.js +1 -2
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/link-control/link-preview.js +1 -1
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/list-view/block-select-button.js +2 -6
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +2 -2
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/utils.js +3 -1
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-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/format-toolbar/index.js +1 -1
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -3
- 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/image-url-input-ui.js +3 -3
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/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 +169 -4
- 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 +62 -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 +47 -23
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/position.js +4 -15
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +96 -55
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/utils.js +2 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +50 -4
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/grid.js +92 -51
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +6 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +18 -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/store/reducer.js +19 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -1
- package/build/store/selectors.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/alignment-control/ui.js +2 -2
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +1 -1
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +1 -1
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +12 -1
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +6 -3
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +3 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-refs.js +11 -4
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +26 -9
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +3 -2
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +2 -0
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-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 +1 -1
- 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-removal-warning-modal/index.js +2 -0
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
- package/build-module/components/block-rename/modal.js +5 -13
- package/build-module/components/block-rename/modal.js.map +1 -1
- package/build-module/components/block-switcher/index.js +1 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +12 -13
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +20 -17
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-toolbar/shuffle.js +6 -2
- 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 +9 -8
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js +37 -0
- package/build-module/components/block-tools/zoom-out-mode-inserter-button.js.map +1 -0
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +30 -29
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-popover.js +49 -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 +27 -19
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +2 -2
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +7 -4
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/dimensions-tool/index.js +6 -4
- package/build-module/components/dimensions-tool/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +24 -62
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +188 -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 +13 -1
- 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 +47 -26
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +117 -0
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +47 -13
- 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 +93 -50
- package/build-module/components/grid/grid-item-movers.js.map +1 -1
- package/build-module/components/grid/grid-item-resizer.js +2 -2
- package/build-module/components/grid/grid-item-resizer.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +118 -38
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +61 -42
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/index.js +0 -5
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -2
- 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/block-patterns-tab/patterns-filter.js +20 -23
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +1 -0
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/menu.js +26 -4
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +20 -3
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +10 -3
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/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/inspector-controls-tabs/settings-tab.js +1 -2
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +1 -1
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +3 -7
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +2 -2
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/utils.js +3 -1
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-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/format-toolbar/index.js +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -3
- 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/image-url-input-ui.js +3 -3
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/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 +168 -4
- 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 +61 -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 +47 -23
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/position.js +4 -15
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +96 -56
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/utils.js +2 -0
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +50 -4
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/grid.js +92 -51
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +8 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +15 -0
- 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/store/reducer.js +18 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +10 -0
- package/build-module/store/selectors.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 +7 -6
- package/build-style/content.css +7 -6
- package/build-style/style-rtl.css +356 -181
- package/build-style/style.css +356 -181
- package/build-types/components/block-context/index.d.ts +2 -2
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +32 -32
- package/src/components/alignment-control/ui.js +2 -2
- package/src/components/block-alignment-control/ui.js +1 -1
- package/src/components/block-alignment-control/ui.native.js +1 -1
- package/src/components/block-breadcrumb/index.js +16 -1
- package/src/components/block-context/README.md +4 -4
- package/src/components/block-inspector/index.js +8 -4
- package/src/components/block-list/content.scss +2 -16
- package/src/components/block-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-block-props/use-block-refs.js +19 -3
- package/src/components/block-list/use-block-props/use-is-hovered.js +26 -11
- package/src/components/block-list/use-in-between-inserter.js +5 -1
- package/src/components/block-lock/modal.js +10 -2
- package/src/components/block-lock/style.scss +4 -8
- package/src/components/block-lock/toolbar.js +0 -1
- package/src/components/block-mover/button.js +1 -1
- package/src/components/block-mover/index.js +1 -1
- 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 +0 -5
- package/src/components/block-quick-navigation/index.js +21 -28
- package/src/components/block-removal-warning-modal/index.js +10 -2
- package/src/components/block-rename/modal.js +2 -8
- package/src/components/block-switcher/index.js +1 -1
- package/src/components/block-switcher/pattern-transformations-menu.js +17 -15
- package/src/components/block-switcher/preview-block-popover.js +20 -14
- package/src/components/block-switcher/style.scss +8 -17
- package/src/components/block-switcher/test/index.js +6 -6
- package/src/components/block-toolbar/shuffle.js +9 -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 +23 -0
- package/src/components/block-tools/use-show-block-tools.js +21 -10
- package/src/components/block-tools/zoom-out-mode-inserter-button.js +47 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +44 -33
- package/src/components/block-tools/zoom-out-popover.js +50 -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 +41 -23
- package/src/components/date-format-picker/index.js +2 -2
- package/src/components/date-format-picker/style.scss +0 -9
- package/src/components/default-block-appender/index.js +11 -4
- package/src/components/dimensions-tool/index.js +97 -89
- package/src/components/font-appearance-control/index.js +24 -82
- package/src/components/font-appearance-control/style.scss +3 -5
- package/src/components/global-styles/background-panel.js +266 -167
- 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 +14 -1
- package/src/components/global-styles/image-settings-panel.js +3 -2
- package/src/components/global-styles/style.scss +116 -19
- package/src/components/global-styles/test/typography-utils.js +594 -0
- package/src/components/global-styles/test/use-global-styles-output.js +3 -1
- package/src/components/global-styles/typography-panel.js +56 -27
- package/src/components/global-styles/typography-utils.js +159 -0
- package/src/components/global-styles/use-global-styles-output.js +45 -10
- package/src/components/global-styles/utils.js +17 -6
- package/src/components/grid/grid-item-movers.js +140 -86
- package/src/components/grid/grid-item-resizer.js +3 -2
- package/src/components/grid/grid-visualizer.js +172 -55
- package/src/components/grid/style.scss +157 -8
- package/src/components/grid/use-grid-layout-sync.js +88 -46
- package/src/components/iframe/content.scss +2 -1
- package/src/components/index.js +0 -5
- package/src/components/inner-blocks/index.js +6 -2
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +1 -16
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +40 -44
- package/src/components/inserter/media-tab/media-panel.js +1 -0
- package/src/components/inserter/menu.js +47 -13
- package/src/components/inserter/preview-panel.js +27 -4
- package/src/components/inserter/quick-inserter.js +6 -1
- package/src/components/inserter/style.scss +58 -92
- package/src/components/inserter-draggable-blocks/index.js +11 -3
- package/src/components/inspector-controls/block-support-tools-panel.js +3 -3
- package/src/components/inspector-controls-tabs/settings-tab.js +0 -2
- package/src/components/inspector-controls-tabs/style.scss +0 -21
- package/src/components/link-control/link-preview.js +1 -1
- package/src/components/list-view/block-select-button.js +3 -13
- package/src/components/list-view/block.js +10 -3
- package/src/components/list-view/style.scss +2 -1
- package/src/components/list-view/utils.js +13 -2
- package/src/components/media-placeholder/index.js +22 -32
- package/src/components/navigable-toolbar/index.js +3 -1
- package/src/components/rich-text/format-toolbar/index.js +1 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -2
- 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/image-url-input-ui.js +3 -3
- package/src/components/url-popover/index.js +3 -0
- package/src/components/url-popover/style.scss +1 -0
- package/src/hooks/background.js +25 -10
- package/src/hooks/block-hooks.js +9 -16
- package/src/hooks/block-style-variation.js +202 -3
- package/src/hooks/duotone.js +16 -12
- package/src/hooks/grid-visualizer.js +62 -0
- package/src/hooks/index.js +3 -0
- package/src/hooks/layout-child.js +64 -39
- package/src/hooks/position.js +3 -20
- package/src/hooks/test/get-variation-styles-with-ref-values.js +91 -0
- package/src/hooks/use-bindings-attributes.js +107 -63
- package/src/hooks/utils.js +2 -0
- package/src/layouts/constrained.js +53 -4
- package/src/layouts/grid.js +148 -51
- package/src/private-apis.js +12 -7
- package/src/store/actions.js +15 -0
- 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/store/reducer.js +18 -0
- package/src/store/selectors.js +10 -0
- package/src/style.scss +1 -1
- 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/inserter/reusable-block-rename-hint.js +0 -71
- package/build/components/inserter/reusable-block-rename-hint.js.map +0 -1
- package/build/components/inspector-controls-tabs/settings-tab-hint.js +0 -53
- package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
- package/build-module/components/inserter/reusable-block-rename-hint.js +0 -64
- package/build-module/components/inserter/reusable-block-rename-hint.js.map +0 -1
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +0 -47
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +0 -1
- package/src/components/inserter/reusable-block-rename-hint.js +0 -69
- package/src/components/inspector-controls-tabs/settings-tab-hint.js +0 -52
- package/src/hooks/position.scss +0 -18
package/src/layouts/grid.js
CHANGED
|
@@ -23,7 +23,6 @@ import { appendSelectors, getBlockGapCSS } from './utils';
|
|
|
23
23
|
import { getGapCSSValue } from '../hooks/gap';
|
|
24
24
|
import { shouldSkipSerialization } from '../hooks/utils';
|
|
25
25
|
import { LAYOUT_DEFINITIONS } from './definitions';
|
|
26
|
-
import { GridVisualizer, useGridLayoutSync } from '../components/grid';
|
|
27
26
|
|
|
28
27
|
const RANGE_CONTROL_MAX_VALUES = {
|
|
29
28
|
px: 600,
|
|
@@ -71,19 +70,28 @@ export default {
|
|
|
71
70
|
layoutBlockSupport = {},
|
|
72
71
|
} ) {
|
|
73
72
|
const { allowSizingOnChildren = false } = layoutBlockSupport;
|
|
73
|
+
|
|
74
|
+
// In the experiment we want to also show column control in Auto mode, and
|
|
75
|
+
// the minimum width control in Manual mode.
|
|
76
|
+
const showColumnsControl =
|
|
77
|
+
window.__experimentalEnableGridInteractivity || layout?.columnCount;
|
|
78
|
+
const showMinWidthControl =
|
|
79
|
+
window.__experimentalEnableGridInteractivity ||
|
|
80
|
+
! layout?.columnCount;
|
|
74
81
|
return (
|
|
75
82
|
<>
|
|
76
83
|
<GridLayoutTypeControl
|
|
77
84
|
layout={ layout }
|
|
78
85
|
onChange={ onChange }
|
|
79
86
|
/>
|
|
80
|
-
{
|
|
87
|
+
{ showColumnsControl && (
|
|
81
88
|
<GridLayoutColumnsAndRowsControl
|
|
82
89
|
layout={ layout }
|
|
83
90
|
onChange={ onChange }
|
|
84
91
|
allowSizingOnChildren={ allowSizingOnChildren }
|
|
85
92
|
/>
|
|
86
|
-
)
|
|
93
|
+
) }
|
|
94
|
+
{ showMinWidthControl && (
|
|
87
95
|
<GridLayoutMinimumWidthControl
|
|
88
96
|
layout={ layout }
|
|
89
97
|
onChange={ onChange }
|
|
@@ -92,15 +100,8 @@ export default {
|
|
|
92
100
|
</>
|
|
93
101
|
);
|
|
94
102
|
},
|
|
95
|
-
toolBarControls: function GridLayoutToolbarControls(
|
|
96
|
-
return
|
|
97
|
-
<>
|
|
98
|
-
{ window.__experimentalEnableGridInteractivity && (
|
|
99
|
-
<GridLayoutSync clientId={ clientId } />
|
|
100
|
-
) }
|
|
101
|
-
<GridVisualizer clientId={ clientId } />
|
|
102
|
-
</>
|
|
103
|
-
);
|
|
103
|
+
toolBarControls: function GridLayoutToolbarControls() {
|
|
104
|
+
return null;
|
|
104
105
|
},
|
|
105
106
|
getLayoutStyle: function getLayoutStyle( {
|
|
106
107
|
selector,
|
|
@@ -111,11 +112,28 @@ export default {
|
|
|
111
112
|
layoutDefinitions = LAYOUT_DEFINITIONS,
|
|
112
113
|
} ) {
|
|
113
114
|
const {
|
|
114
|
-
minimumColumnWidth =
|
|
115
|
+
minimumColumnWidth = null,
|
|
115
116
|
columnCount = null,
|
|
116
117
|
rowCount = null,
|
|
117
118
|
} = layout;
|
|
118
119
|
|
|
120
|
+
// Check that the grid layout attributes are of the correct type, so that we don't accidentally
|
|
121
|
+
// write code that stores a string attribute instead of a number.
|
|
122
|
+
if ( process.env.NODE_ENV === 'development' ) {
|
|
123
|
+
if (
|
|
124
|
+
minimumColumnWidth &&
|
|
125
|
+
typeof minimumColumnWidth !== 'string'
|
|
126
|
+
) {
|
|
127
|
+
throw new Error( 'minimumColumnWidth must be a string' );
|
|
128
|
+
}
|
|
129
|
+
if ( columnCount && typeof columnCount !== 'number' ) {
|
|
130
|
+
throw new Error( 'columnCount must be a number' );
|
|
131
|
+
}
|
|
132
|
+
if ( rowCount && typeof rowCount !== 'number' ) {
|
|
133
|
+
throw new Error( 'rowCount must be a number' );
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
119
137
|
// If a block's block.json skips serialization for spacing or spacing.blockGap,
|
|
120
138
|
// don't apply the user-defined value to the styles.
|
|
121
139
|
const blockGapValue =
|
|
@@ -127,18 +145,33 @@ export default {
|
|
|
127
145
|
let output = '';
|
|
128
146
|
const rules = [];
|
|
129
147
|
|
|
130
|
-
if ( columnCount ) {
|
|
148
|
+
if ( minimumColumnWidth && columnCount > 0 ) {
|
|
149
|
+
const maxValue = `max(${ minimumColumnWidth }, ( 100% - (${
|
|
150
|
+
blockGapValue || '1.2rem'
|
|
151
|
+
}*${ columnCount - 1 }) ) / ${ columnCount })`;
|
|
152
|
+
rules.push(
|
|
153
|
+
`grid-template-columns: repeat(auto-fill, minmax(${ maxValue }, 1fr))`,
|
|
154
|
+
`container-type: inline-size`
|
|
155
|
+
);
|
|
156
|
+
if ( rowCount ) {
|
|
157
|
+
rules.push(
|
|
158
|
+
`grid-template-rows: repeat(${ rowCount }, minmax(1rem, auto))`
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
} else if ( columnCount ) {
|
|
131
162
|
rules.push(
|
|
132
163
|
`grid-template-columns: repeat(${ columnCount }, minmax(0, 1fr))`
|
|
133
164
|
);
|
|
134
165
|
if ( rowCount ) {
|
|
135
166
|
rules.push(
|
|
136
|
-
`grid-template-rows: repeat(${ rowCount }, minmax(
|
|
167
|
+
`grid-template-rows: repeat(${ rowCount }, minmax(1rem, auto))`
|
|
137
168
|
);
|
|
138
169
|
}
|
|
139
|
-
} else
|
|
170
|
+
} else {
|
|
140
171
|
rules.push(
|
|
141
|
-
`grid-template-columns: repeat(auto-fill, minmax(min(${
|
|
172
|
+
`grid-template-columns: repeat(auto-fill, minmax(min(${
|
|
173
|
+
minimumColumnWidth || '12rem'
|
|
174
|
+
}, 100%), 1fr))`,
|
|
142
175
|
'container-type: inline-size'
|
|
143
176
|
);
|
|
144
177
|
}
|
|
@@ -172,8 +205,11 @@ export default {
|
|
|
172
205
|
|
|
173
206
|
// Enables setting minimum width of grid items.
|
|
174
207
|
function GridLayoutMinimumWidthControl( { layout, onChange } ) {
|
|
175
|
-
const { minimumColumnWidth
|
|
176
|
-
const
|
|
208
|
+
const { minimumColumnWidth, columnCount, isManualPlacement } = layout;
|
|
209
|
+
const defaultValue = isManualPlacement || columnCount ? null : '12rem';
|
|
210
|
+
const value = minimumColumnWidth || defaultValue;
|
|
211
|
+
const [ quantity, unit = 'rem' ] =
|
|
212
|
+
parseQuantityAndUnitFromRawValue( value );
|
|
177
213
|
|
|
178
214
|
const handleSliderChange = ( next ) => {
|
|
179
215
|
onChange( {
|
|
@@ -214,7 +250,8 @@ function GridLayoutMinimumWidthControl( { layout, onChange } ) {
|
|
|
214
250
|
onChange={ ( newValue ) => {
|
|
215
251
|
onChange( {
|
|
216
252
|
...layout,
|
|
217
|
-
minimumColumnWidth:
|
|
253
|
+
minimumColumnWidth:
|
|
254
|
+
newValue === '' ? undefined : newValue,
|
|
218
255
|
} );
|
|
219
256
|
} }
|
|
220
257
|
onUnitChange={ handleUnitChange }
|
|
@@ -227,8 +264,9 @@ function GridLayoutMinimumWidthControl( { layout, onChange } ) {
|
|
|
227
264
|
</FlexItem>
|
|
228
265
|
<FlexItem isBlock>
|
|
229
266
|
<RangeControl
|
|
267
|
+
__nextHasNoMarginBottom
|
|
230
268
|
onChange={ handleSliderChange }
|
|
231
|
-
value={ quantity }
|
|
269
|
+
value={ quantity || 0 }
|
|
232
270
|
min={ 0 }
|
|
233
271
|
max={ RANGE_CONTROL_MAX_VALUES[ unit ] || 600 }
|
|
234
272
|
withInputField={ false }
|
|
@@ -247,57 +285,98 @@ function GridLayoutColumnsAndRowsControl( {
|
|
|
247
285
|
onChange,
|
|
248
286
|
allowSizingOnChildren,
|
|
249
287
|
} ) {
|
|
250
|
-
|
|
288
|
+
// If the grid interactivity experiment is enabled, allow unsetting the column count.
|
|
289
|
+
const defaultColumnCount = window.__experimentalEnableGridInteractivity
|
|
290
|
+
? undefined
|
|
291
|
+
: 3;
|
|
292
|
+
const {
|
|
293
|
+
columnCount = defaultColumnCount,
|
|
294
|
+
rowCount,
|
|
295
|
+
isManualPlacement,
|
|
296
|
+
} = layout;
|
|
251
297
|
|
|
252
298
|
return (
|
|
253
299
|
<>
|
|
254
300
|
<fieldset>
|
|
301
|
+
{ ( ! window.__experimentalEnableGridInteractivity ||
|
|
302
|
+
! isManualPlacement ) && (
|
|
303
|
+
<BaseControl.VisualLabel as="legend">
|
|
304
|
+
{ __( 'Columns' ) }
|
|
305
|
+
</BaseControl.VisualLabel>
|
|
306
|
+
) }
|
|
255
307
|
<Flex gap={ 4 }>
|
|
256
308
|
<FlexItem isBlock>
|
|
257
309
|
<NumberControl
|
|
258
310
|
size="__unstable-large"
|
|
259
311
|
onChange={ ( value ) => {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
312
|
+
if (
|
|
313
|
+
window.__experimentalEnableGridInteractivity
|
|
314
|
+
) {
|
|
315
|
+
// Allow unsetting the column count when in auto mode.
|
|
316
|
+
const defaultNewColumnCount =
|
|
317
|
+
isManualPlacement ? 1 : undefined;
|
|
318
|
+
const newColumnCount =
|
|
319
|
+
value === ''
|
|
320
|
+
? defaultNewColumnCount
|
|
321
|
+
: parseInt( value, 10 );
|
|
322
|
+
onChange( {
|
|
323
|
+
...layout,
|
|
324
|
+
columnCount: newColumnCount,
|
|
325
|
+
} );
|
|
326
|
+
} else {
|
|
327
|
+
// Don't allow unsetting the column count.
|
|
328
|
+
const newColumnCount =
|
|
329
|
+
value === ''
|
|
330
|
+
? 1
|
|
331
|
+
: parseInt( value, 10 );
|
|
332
|
+
onChange( {
|
|
333
|
+
...layout,
|
|
334
|
+
columnCount: newColumnCount,
|
|
335
|
+
} );
|
|
336
|
+
}
|
|
269
337
|
} }
|
|
270
338
|
value={ columnCount }
|
|
271
|
-
min={
|
|
339
|
+
min={ 0 }
|
|
272
340
|
label={ __( 'Columns' ) }
|
|
341
|
+
hideLabelFromVision={
|
|
342
|
+
! window.__experimentalEnableGridInteractivity ||
|
|
343
|
+
! isManualPlacement
|
|
344
|
+
}
|
|
273
345
|
/>
|
|
274
346
|
</FlexItem>
|
|
275
347
|
|
|
276
348
|
<FlexItem isBlock>
|
|
277
349
|
{ window.__experimentalEnableGridInteractivity &&
|
|
278
|
-
allowSizingOnChildren
|
|
350
|
+
allowSizingOnChildren &&
|
|
351
|
+
isManualPlacement ? (
|
|
279
352
|
<NumberControl
|
|
280
353
|
size="__unstable-large"
|
|
281
354
|
onChange={ ( value ) => {
|
|
355
|
+
// Don't allow unsetting the row count.
|
|
356
|
+
const newRowCount =
|
|
357
|
+
value === ''
|
|
358
|
+
? 1
|
|
359
|
+
: parseInt( value, 10 );
|
|
282
360
|
onChange( {
|
|
283
361
|
...layout,
|
|
284
|
-
rowCount:
|
|
362
|
+
rowCount: newRowCount,
|
|
285
363
|
} );
|
|
286
364
|
} }
|
|
287
365
|
value={ rowCount }
|
|
288
|
-
min={
|
|
366
|
+
min={ 0 }
|
|
289
367
|
label={ __( 'Rows' ) }
|
|
290
368
|
/>
|
|
291
369
|
) : (
|
|
292
370
|
<RangeControl
|
|
293
|
-
|
|
371
|
+
__nextHasNoMarginBottom
|
|
372
|
+
value={ columnCount ?? 0 }
|
|
294
373
|
onChange={ ( value ) =>
|
|
295
374
|
onChange( {
|
|
296
375
|
...layout,
|
|
297
376
|
columnCount: value,
|
|
298
377
|
} )
|
|
299
378
|
}
|
|
300
|
-
min={
|
|
379
|
+
min={ 0 }
|
|
301
380
|
max={ 16 }
|
|
302
381
|
withInputField={ false }
|
|
303
382
|
label={ __( 'Columns' ) }
|
|
@@ -313,7 +392,8 @@ function GridLayoutColumnsAndRowsControl( {
|
|
|
313
392
|
|
|
314
393
|
// Enables switching between grid types
|
|
315
394
|
function GridLayoutTypeControl( { layout, onChange } ) {
|
|
316
|
-
const { columnCount, minimumColumnWidth } =
|
|
395
|
+
const { columnCount, rowCount, minimumColumnWidth, isManualPlacement } =
|
|
396
|
+
layout;
|
|
317
397
|
|
|
318
398
|
/**
|
|
319
399
|
* When switching, temporarily save any custom values set on the
|
|
@@ -322,41 +402,62 @@ function GridLayoutTypeControl( { layout, onChange } ) {
|
|
|
322
402
|
const [ tempColumnCount, setTempColumnCount ] = useState(
|
|
323
403
|
columnCount || 3
|
|
324
404
|
);
|
|
405
|
+
const [ tempRowCount, setTempRowCount ] = useState( rowCount );
|
|
325
406
|
const [ tempMinimumColumnWidth, setTempMinimumColumnWidth ] = useState(
|
|
326
407
|
minimumColumnWidth || '12rem'
|
|
327
408
|
);
|
|
328
409
|
|
|
329
|
-
const
|
|
410
|
+
const gridPlacement =
|
|
411
|
+
isManualPlacement ||
|
|
412
|
+
( !! columnCount && ! window.__experimentalEnableGridInteractivity )
|
|
413
|
+
? 'manual'
|
|
414
|
+
: 'auto';
|
|
330
415
|
|
|
331
416
|
const onChangeType = ( value ) => {
|
|
332
417
|
if ( value === 'manual' ) {
|
|
333
418
|
setTempMinimumColumnWidth( minimumColumnWidth || '12rem' );
|
|
334
419
|
} else {
|
|
335
420
|
setTempColumnCount( columnCount || 3 );
|
|
421
|
+
setTempRowCount( rowCount );
|
|
336
422
|
}
|
|
337
423
|
onChange( {
|
|
338
424
|
...layout,
|
|
339
425
|
columnCount: value === 'manual' ? tempColumnCount : null,
|
|
426
|
+
rowCount:
|
|
427
|
+
value === 'manual' &&
|
|
428
|
+
window.__experimentalEnableGridInteractivity
|
|
429
|
+
? tempRowCount
|
|
430
|
+
: undefined,
|
|
431
|
+
isManualPlacement:
|
|
432
|
+
value === 'manual' &&
|
|
433
|
+
window.__experimentalEnableGridInteractivity
|
|
434
|
+
? true
|
|
435
|
+
: undefined,
|
|
340
436
|
minimumColumnWidth:
|
|
341
437
|
value === 'auto' ? tempMinimumColumnWidth : null,
|
|
342
438
|
} );
|
|
343
439
|
};
|
|
344
440
|
|
|
441
|
+
const helpText =
|
|
442
|
+
gridPlacement === 'manual'
|
|
443
|
+
? __(
|
|
444
|
+
'Grid items can be manually placed in any position on the grid.'
|
|
445
|
+
)
|
|
446
|
+
: __(
|
|
447
|
+
'Grid items are placed automatically depending on their order.'
|
|
448
|
+
);
|
|
449
|
+
|
|
345
450
|
return (
|
|
346
451
|
<ToggleGroupControl
|
|
347
452
|
__nextHasNoMarginBottom
|
|
348
453
|
label={ __( 'Grid item position' ) }
|
|
349
|
-
value={
|
|
454
|
+
value={ gridPlacement }
|
|
350
455
|
onChange={ onChangeType }
|
|
351
456
|
isBlock
|
|
352
457
|
help={
|
|
353
|
-
|
|
354
|
-
?
|
|
355
|
-
|
|
356
|
-
)
|
|
357
|
-
: __(
|
|
358
|
-
'Grid items are placed automatically depending on their order.'
|
|
359
|
-
)
|
|
458
|
+
window.__experimentalEnableGridInteractivity
|
|
459
|
+
? helpText
|
|
460
|
+
: undefined
|
|
360
461
|
}
|
|
361
462
|
>
|
|
362
463
|
<ToggleGroupControlOption
|
|
@@ -372,7 +473,3 @@ function GridLayoutTypeControl( { layout, onChange } ) {
|
|
|
372
473
|
</ToggleGroupControl>
|
|
373
474
|
);
|
|
374
475
|
}
|
|
375
|
-
|
|
376
|
-
function GridLayoutSync( props ) {
|
|
377
|
-
useGridLayoutSync( props );
|
|
378
|
-
}
|
package/src/private-apis.js
CHANGED
|
@@ -20,14 +20,15 @@ import { cleanEmptyObject, useStyleOverride } from './hooks/utils';
|
|
|
20
20
|
import BlockQuickNavigation from './components/block-quick-navigation';
|
|
21
21
|
import { LayoutStyle } from './components/block-list/layout';
|
|
22
22
|
import { BlockRemovalWarningModal } from './components/block-removal-warning-modal';
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
setBackgroundStyleDefaults,
|
|
25
|
+
useLayoutClasses,
|
|
26
|
+
useLayoutStyles,
|
|
27
|
+
__unstableBlockStyleVariationOverridesWithConfig,
|
|
28
|
+
} from './hooks';
|
|
24
29
|
import DimensionsTool from './components/dimensions-tool';
|
|
25
30
|
import ResolutionTool from './components/resolution-tool';
|
|
26
31
|
import TextAlignmentControl from './components/text-alignment-control';
|
|
27
|
-
import {
|
|
28
|
-
default as ReusableBlocksRenameHint,
|
|
29
|
-
useReusableBlocksRenameHint,
|
|
30
|
-
} from './components/inserter/reusable-block-rename-hint';
|
|
31
32
|
import { usesContextKey } from './components/rich-text/format-edit';
|
|
32
33
|
import { ExperimentalBlockCanvas } from './components/block-canvas';
|
|
33
34
|
import { getDuotoneFilter } from './components/duotone/utils';
|
|
@@ -36,6 +37,7 @@ import {
|
|
|
36
37
|
selectBlockPatternsKey,
|
|
37
38
|
reusableBlocksSelectKey,
|
|
38
39
|
globalStylesDataKey,
|
|
40
|
+
globalStylesLinksDataKey,
|
|
39
41
|
} from './store/private-keys';
|
|
40
42
|
import { requiresWrapperOnCopy } from './components/writing-flow/utils';
|
|
41
43
|
import { PrivateRichText } from './components/rich-text/';
|
|
@@ -44,6 +46,7 @@ import { PrivateInserterLibrary } from './components/inserter/library';
|
|
|
44
46
|
import { PrivatePublishDateTimePicker } from './components/publish-date-time-picker';
|
|
45
47
|
import useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';
|
|
46
48
|
import useBlockDisplayTitle from './components/block-title/use-block-display-title';
|
|
49
|
+
import TabbedSidebar from './components/tabbed-sidebar';
|
|
47
50
|
|
|
48
51
|
/**
|
|
49
52
|
* Private @wordpress/block-editor APIs.
|
|
@@ -73,12 +76,12 @@ lock( privateApis, {
|
|
|
73
76
|
useLayoutStyles,
|
|
74
77
|
DimensionsTool,
|
|
75
78
|
ResolutionTool,
|
|
79
|
+
TabbedSidebar,
|
|
76
80
|
TextAlignmentControl,
|
|
77
|
-
ReusableBlocksRenameHint,
|
|
78
|
-
useReusableBlocksRenameHint,
|
|
79
81
|
usesContextKey,
|
|
80
82
|
useFlashEditableBlocks,
|
|
81
83
|
globalStylesDataKey,
|
|
84
|
+
globalStylesLinksDataKey,
|
|
82
85
|
selectBlockPatternsKey,
|
|
83
86
|
requiresWrapperOnCopy,
|
|
84
87
|
PrivateRichText,
|
|
@@ -88,4 +91,6 @@ lock( privateApis, {
|
|
|
88
91
|
PrivatePublishDateTimePicker,
|
|
89
92
|
useSpacingSizes,
|
|
90
93
|
useBlockDisplayTitle,
|
|
94
|
+
__unstableBlockStyleVariationOverridesWithConfig,
|
|
95
|
+
setBackgroundStyleDefaults,
|
|
91
96
|
} );
|
package/src/store/actions.js
CHANGED
|
@@ -213,6 +213,21 @@ export function selectBlock( clientId, initialPosition = 0 ) {
|
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Returns an action object used in signalling that the block with the
|
|
218
|
+
* specified client ID has been hovered.
|
|
219
|
+
*
|
|
220
|
+
* @param {string} clientId Block client ID.
|
|
221
|
+
*
|
|
222
|
+
* @return {Object} Action object.
|
|
223
|
+
*/
|
|
224
|
+
export function hoverBlock( clientId ) {
|
|
225
|
+
return {
|
|
226
|
+
type: 'HOVER_BLOCK',
|
|
227
|
+
clientId,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
216
231
|
/**
|
|
217
232
|
* Yields action objects used in signalling that the block preceding the given
|
|
218
233
|
* clientId (or optionally, its first parent from bottom to top)
|
package/src/store/defaults.js
CHANGED
|
@@ -33,7 +33,6 @@ export const PREFERENCES_DEFAULTS = {
|
|
|
33
33
|
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
|
|
34
34
|
* @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
|
|
35
35
|
* @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
|
|
36
|
-
* @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks
|
|
37
36
|
*/
|
|
38
37
|
export const SETTINGS_DEFAULTS = {
|
|
39
38
|
alignWide: false,
|
|
@@ -168,7 +167,6 @@ export const SETTINGS_DEFAULTS = {
|
|
|
168
167
|
__mobileEnablePageTemplates: false,
|
|
169
168
|
__experimentalBlockPatterns: [],
|
|
170
169
|
__experimentalBlockPatternCategories: [],
|
|
171
|
-
__unstableGalleryWithImageBlocks: false,
|
|
172
170
|
__unstableIsPreviewMode: false,
|
|
173
171
|
|
|
174
172
|
// These settings will be completely revamped in the future.
|
|
@@ -10,9 +10,6 @@ const SETTINGS_DEFAULTS = {
|
|
|
10
10
|
...SETTINGS,
|
|
11
11
|
// Don't add the default font sizes for standard themes
|
|
12
12
|
fontSizes: undefined,
|
|
13
|
-
// FOR TESTING ONLY - Later, this will come from a REST API
|
|
14
|
-
// eslint-disable-next-line no-undef
|
|
15
|
-
__unstableGalleryWithImageBlocks: __DEV__,
|
|
16
13
|
alignWide: true,
|
|
17
14
|
supportsLayout: false,
|
|
18
15
|
__experimentalFeatures: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export const globalStylesDataKey = Symbol( 'globalStylesDataKey' );
|
|
2
|
+
export const globalStylesLinksDataKey = Symbol( 'globalStylesLinks' );
|
|
2
3
|
export const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );
|
|
3
4
|
export const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );
|
package/src/store/reducer.js
CHANGED
|
@@ -2068,6 +2068,23 @@ export function lastFocus( state = false, action ) {
|
|
|
2068
2068
|
return state;
|
|
2069
2069
|
}
|
|
2070
2070
|
|
|
2071
|
+
/**
|
|
2072
|
+
* Reducer setting currently hovered block.
|
|
2073
|
+
*
|
|
2074
|
+
* @param {boolean} state Current state.
|
|
2075
|
+
* @param {Object} action Dispatched action.
|
|
2076
|
+
*
|
|
2077
|
+
* @return {boolean} Updated state.
|
|
2078
|
+
*/
|
|
2079
|
+
export function hoveredBlockClientId( state = false, action ) {
|
|
2080
|
+
switch ( action.type ) {
|
|
2081
|
+
case 'HOVER_BLOCK':
|
|
2082
|
+
return action.clientId;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
return state;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2071
2088
|
const combinedReducers = combineReducers( {
|
|
2072
2089
|
blocks,
|
|
2073
2090
|
isDragging,
|
|
@@ -2100,6 +2117,7 @@ const combinedReducers = combineReducers( {
|
|
|
2100
2117
|
blockRemovalRules,
|
|
2101
2118
|
openedBlockSettingsMenu,
|
|
2102
2119
|
registeredInserterMediaCategories,
|
|
2120
|
+
hoveredBlockClientId,
|
|
2103
2121
|
} );
|
|
2104
2122
|
|
|
2105
2123
|
function withAutomaticChangeReset( reducer ) {
|
package/src/store/selectors.js
CHANGED
|
@@ -2809,6 +2809,16 @@ export function isBlockVisible( state, clientId ) {
|
|
|
2809
2809
|
return state.blockVisibility?.[ clientId ] ?? true;
|
|
2810
2810
|
}
|
|
2811
2811
|
|
|
2812
|
+
/**
|
|
2813
|
+
* Returns the currently hovered block.
|
|
2814
|
+
*
|
|
2815
|
+
* @param {Object} state Global application state.
|
|
2816
|
+
* @return {Object} Client Id of the hovered block.
|
|
2817
|
+
*/
|
|
2818
|
+
export function getHoveredBlockClientId( state ) {
|
|
2819
|
+
return state.hoveredBlockClientId;
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2812
2822
|
/**
|
|
2813
2823
|
* Returns the list of all hidden blocks.
|
|
2814
2824
|
*
|
package/src/style.scss
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
@import "./components/rich-text/style.scss";
|
|
43
43
|
@import "./components/segmented-text-control/style.scss";
|
|
44
44
|
@import "./components/skip-to-selected-block/style.scss";
|
|
45
|
+
@import "./components/tabbed-sidebar/style.scss";
|
|
45
46
|
@import "./components/tool-selector/style.scss";
|
|
46
47
|
@import "./components/url-input/style.scss";
|
|
47
48
|
@import "./components/url-popover/style.scss";
|
|
@@ -51,7 +52,6 @@
|
|
|
51
52
|
@import "./hooks/color.scss";
|
|
52
53
|
@import "./hooks/dimensions.scss";
|
|
53
54
|
@import "./hooks/layout.scss";
|
|
54
|
-
@import "./hooks/position.scss";
|
|
55
55
|
@import "./hooks/spacing.scss";
|
|
56
56
|
@import "./hooks/typography.scss";
|
|
57
57
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { _x } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formats font styles to human readable names.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} fontStyle font style string
|
|
10
|
+
* @return {Object} new object with formatted font style
|
|
11
|
+
*/
|
|
12
|
+
export function formatFontStyle( fontStyle ) {
|
|
13
|
+
if ( ! fontStyle ) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if ( typeof fontStyle === 'object' ) {
|
|
18
|
+
return fontStyle;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let name;
|
|
22
|
+
|
|
23
|
+
switch ( fontStyle ) {
|
|
24
|
+
case 'normal':
|
|
25
|
+
name = _x( 'Regular', 'font style' );
|
|
26
|
+
break;
|
|
27
|
+
case 'italic':
|
|
28
|
+
name = _x( 'Italic', 'font style' );
|
|
29
|
+
break;
|
|
30
|
+
case 'oblique':
|
|
31
|
+
name = _x( 'Oblique', 'font style' );
|
|
32
|
+
break;
|
|
33
|
+
|
|
34
|
+
default:
|
|
35
|
+
name = fontStyle;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return { name, value: fontStyle };
|
|
40
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { _x } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Formats font weights to human readable names.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} fontWeight font weight string
|
|
10
|
+
* @return {Object} new object with formatted font weight
|
|
11
|
+
*/
|
|
12
|
+
export function formatFontWeight( fontWeight ) {
|
|
13
|
+
if ( ! fontWeight ) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if ( typeof fontWeight === 'object' ) {
|
|
18
|
+
return fontWeight;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let name;
|
|
22
|
+
|
|
23
|
+
switch ( fontWeight ) {
|
|
24
|
+
case 'normal':
|
|
25
|
+
case '400':
|
|
26
|
+
name = _x( 'Regular', 'font weight' );
|
|
27
|
+
break;
|
|
28
|
+
case 'bold':
|
|
29
|
+
case '700':
|
|
30
|
+
name = _x( 'Bold', 'font weight' );
|
|
31
|
+
break;
|
|
32
|
+
case '100':
|
|
33
|
+
name = _x( 'Thin', 'font weight' );
|
|
34
|
+
break;
|
|
35
|
+
case '200':
|
|
36
|
+
name = _x( 'Extra Light', 'font weight' );
|
|
37
|
+
break;
|
|
38
|
+
case '300':
|
|
39
|
+
name = _x( 'Light', 'font weight' );
|
|
40
|
+
break;
|
|
41
|
+
case '500':
|
|
42
|
+
name = _x( 'Medium', 'font weight' );
|
|
43
|
+
break;
|
|
44
|
+
case '600':
|
|
45
|
+
name = _x( 'Semi Bold', 'font weight' );
|
|
46
|
+
break;
|
|
47
|
+
case '800':
|
|
48
|
+
name = _x( 'Extra Bold', 'font weight' );
|
|
49
|
+
break;
|
|
50
|
+
case '900':
|
|
51
|
+
name = _x( 'Black', 'font weight' );
|
|
52
|
+
break;
|
|
53
|
+
case '1000':
|
|
54
|
+
name = _x( 'Extra Black', 'font weight' );
|
|
55
|
+
break;
|
|
56
|
+
|
|
57
|
+
default:
|
|
58
|
+
name = fontWeight;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return { name, value: fontWeight };
|
|
63
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the editor region for a given editor canvas element or
|
|
3
|
+
* returns the passed element if no region is found
|
|
4
|
+
*
|
|
5
|
+
* @param { Object } editor The editor canvas element.
|
|
6
|
+
* @return { Object } The editor region or given editor element
|
|
7
|
+
*/
|
|
8
|
+
export default function getEditorRegion( editor ) {
|
|
9
|
+
if ( ! editor ) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// If there are multiple editors, we need to find the iframe that contains our contentRef to make sure
|
|
14
|
+
// we're focusing the region that contains this editor.
|
|
15
|
+
const editorCanvas =
|
|
16
|
+
Array.from(
|
|
17
|
+
document.querySelectorAll( 'iframe[name="editor-canvas"]' ).values()
|
|
18
|
+
).find( ( iframe ) => {
|
|
19
|
+
// Find the iframe that contains our contentRef
|
|
20
|
+
const iframeDocument =
|
|
21
|
+
iframe.contentDocument || iframe.contentWindow.document;
|
|
22
|
+
|
|
23
|
+
return iframeDocument === editor.ownerDocument;
|
|
24
|
+
} ) ?? editor;
|
|
25
|
+
|
|
26
|
+
// The region is provivided by the editor, not the block-editor.
|
|
27
|
+
// We should send focus to the region if one is available to reuse the
|
|
28
|
+
// same interface for navigating landmarks. If no region is available,
|
|
29
|
+
// use the canvas instead.
|
|
30
|
+
return editorCanvas?.closest( '[role="region"]' ) ?? editorCanvas;
|
|
31
|
+
}
|