@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
|
@@ -31,6 +31,7 @@ import { GlobalStylesContext } from './context';
|
|
|
31
31
|
import { useGlobalSetting } from './hooks';
|
|
32
32
|
import { getDuotoneFilter } from '../duotone/utils';
|
|
33
33
|
import { getGapCSSValue } from '../../hooks/gap';
|
|
34
|
+
import { setBackgroundStyleDefaults } from '../../hooks/background';
|
|
34
35
|
import { store as blockEditorStore } from '../../store';
|
|
35
36
|
import { LAYOUT_DEFINITIONS } from '../../layouts/definitions';
|
|
36
37
|
import { getValueFromObjectPath, setImmutably } from '../../utils/object';
|
|
@@ -387,6 +388,20 @@ export function getStylesDeclarations(
|
|
|
387
388
|
[]
|
|
388
389
|
);
|
|
389
390
|
|
|
391
|
+
/*
|
|
392
|
+
* Set background defaults.
|
|
393
|
+
* Applies to all background styles except the top-level site background.
|
|
394
|
+
*/
|
|
395
|
+
if ( ! isRoot && !! blockStyles.background ) {
|
|
396
|
+
blockStyles = {
|
|
397
|
+
...blockStyles,
|
|
398
|
+
background: {
|
|
399
|
+
...blockStyles.background,
|
|
400
|
+
...setBackgroundStyleDefaults( blockStyles.background ),
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
390
405
|
// The goal is to move everything to server side generated engine styles
|
|
391
406
|
// This is temporary as we absorb more and more styles into the engine.
|
|
392
407
|
const extraRules = getCSSRules( blockStyles );
|
|
@@ -656,7 +671,7 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
|
|
|
656
671
|
}
|
|
657
672
|
const variationSelector =
|
|
658
673
|
blockSelectors[ blockName ]
|
|
659
|
-
|
|
674
|
+
?.styleVariationSelectors?.[ variationName ];
|
|
660
675
|
|
|
661
676
|
// Process the variation's inner element styles.
|
|
662
677
|
// This comes before the inner block styles so the
|
|
@@ -685,18 +700,18 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
|
|
|
685
700
|
const variationBlockSelector = scopeSelector(
|
|
686
701
|
variationSelector,
|
|
687
702
|
blockSelectors[ variationBlockName ]
|
|
688
|
-
|
|
703
|
+
?.selector
|
|
689
704
|
);
|
|
690
705
|
const variationDuotoneSelector = scopeSelector(
|
|
691
706
|
variationSelector,
|
|
692
707
|
blockSelectors[ variationBlockName ]
|
|
693
|
-
|
|
708
|
+
?.duotoneSelector
|
|
694
709
|
);
|
|
695
710
|
const variationFeatureSelectors =
|
|
696
711
|
scopeFeatureSelectors(
|
|
697
712
|
variationSelector,
|
|
698
713
|
blockSelectors[ variationBlockName ]
|
|
699
|
-
|
|
714
|
+
?.featureSelectors
|
|
700
715
|
);
|
|
701
716
|
|
|
702
717
|
const variationBlockStyleNodes =
|
|
@@ -713,10 +728,10 @@ export const getNodesWithStyles = ( tree, blockSelectors ) => {
|
|
|
713
728
|
featureSelectors: variationFeatureSelectors,
|
|
714
729
|
fallbackGapValue:
|
|
715
730
|
blockSelectors[ variationBlockName ]
|
|
716
|
-
|
|
731
|
+
?.fallbackGapValue,
|
|
717
732
|
hasLayoutSupport:
|
|
718
733
|
blockSelectors[ variationBlockName ]
|
|
719
|
-
|
|
734
|
+
?.hasLayoutSupport,
|
|
720
735
|
styles: variationBlockStyleNodes,
|
|
721
736
|
} );
|
|
722
737
|
|
|
@@ -881,6 +896,7 @@ export const toStyles = (
|
|
|
881
896
|
marginReset: true,
|
|
882
897
|
presets: true,
|
|
883
898
|
rootPadding: true,
|
|
899
|
+
variationStyles: false,
|
|
884
900
|
...styleOptions,
|
|
885
901
|
};
|
|
886
902
|
const nodesWithStyles = getNodesWithStyles( tree, blockSelectors );
|
|
@@ -923,8 +939,8 @@ export const toStyles = (
|
|
|
923
939
|
ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }
|
|
924
940
|
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
|
|
925
941
|
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
|
|
926
|
-
.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull
|
|
927
|
-
.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull
|
|
942
|
+
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }
|
|
943
|
+
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;
|
|
928
944
|
`;
|
|
929
945
|
}
|
|
930
946
|
|
|
@@ -1010,7 +1026,7 @@ export const toStyles = (
|
|
|
1010
1026
|
);
|
|
1011
1027
|
}
|
|
1012
1028
|
|
|
1013
|
-
if ( styleVariationSelectors ) {
|
|
1029
|
+
if ( options.variationStyles && styleVariationSelectors ) {
|
|
1014
1030
|
Object.entries( styleVariationSelectors ).forEach(
|
|
1015
1031
|
( [ styleVariationName, styleVariationSelector ] ) => {
|
|
1016
1032
|
const styleVariations =
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import fastDeepEqual from 'fast-deep-equal/es6';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Internal dependencies
|
|
8
13
|
*/
|
|
@@ -136,12 +141,18 @@ export const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
|
|
|
136
141
|
'typography.fontFamily': 'fontFamily',
|
|
137
142
|
};
|
|
138
143
|
|
|
139
|
-
export
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
export function useToolsPanelDropdownMenuProps() {
|
|
145
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
146
|
+
return ! isMobile
|
|
147
|
+
? {
|
|
148
|
+
popoverProps: {
|
|
149
|
+
placement: 'left-start',
|
|
150
|
+
// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)
|
|
151
|
+
offset: 259,
|
|
152
|
+
},
|
|
153
|
+
}
|
|
154
|
+
: {};
|
|
155
|
+
}
|
|
145
156
|
|
|
146
157
|
function findInPresetsBy(
|
|
147
158
|
features,
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { ToolbarButton } from '@wordpress/components';
|
|
6
|
+
import { arrowLeft, arrowUp, arrowDown, arrowRight } from '@wordpress/icons';
|
|
7
|
+
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import BlockControls from '../block-controls';
|
|
13
|
+
import { useGetNumberOfBlocksBeforeCell } from './use-get-number-of-blocks-before-cell';
|
|
14
|
+
import { store as blockEditorStore } from '../../store';
|
|
15
|
+
|
|
16
|
+
export function GridItemMovers( {
|
|
17
|
+
layout,
|
|
18
|
+
parentLayout,
|
|
19
|
+
onChange,
|
|
20
|
+
gridClientId,
|
|
21
|
+
blockClientId,
|
|
22
|
+
} ) {
|
|
23
|
+
const { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } =
|
|
24
|
+
useDispatch( blockEditorStore );
|
|
25
|
+
|
|
26
|
+
const columnStart = layout?.columnStart ?? 1;
|
|
27
|
+
const rowStart = layout?.rowStart ?? 1;
|
|
28
|
+
const columnSpan = layout?.columnSpan ?? 1;
|
|
29
|
+
const rowSpan = layout?.rowSpan ?? 1;
|
|
30
|
+
const columnEnd = columnStart + columnSpan - 1;
|
|
31
|
+
const rowEnd = rowStart + rowSpan - 1;
|
|
32
|
+
const columnCount = parentLayout?.columnCount;
|
|
33
|
+
const rowCount = parentLayout?.rowCount;
|
|
34
|
+
|
|
35
|
+
const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(
|
|
36
|
+
gridClientId,
|
|
37
|
+
columnCount
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<BlockControls group="parent">
|
|
42
|
+
<ToolbarButton
|
|
43
|
+
icon={ arrowUp }
|
|
44
|
+
label={ __( 'Move block up' ) }
|
|
45
|
+
disabled={ rowStart <= 1 }
|
|
46
|
+
onClick={ () => {
|
|
47
|
+
onChange( {
|
|
48
|
+
rowStart: rowStart - 1,
|
|
49
|
+
} );
|
|
50
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
51
|
+
moveBlocksToPosition(
|
|
52
|
+
[ blockClientId ],
|
|
53
|
+
gridClientId,
|
|
54
|
+
gridClientId,
|
|
55
|
+
getNumberOfBlocksBeforeCell( columnStart, rowStart - 1 )
|
|
56
|
+
);
|
|
57
|
+
} }
|
|
58
|
+
/>
|
|
59
|
+
<ToolbarButton
|
|
60
|
+
icon={ arrowDown }
|
|
61
|
+
label={ __( 'Move block down' ) }
|
|
62
|
+
disabled={ rowCount && rowEnd >= rowCount }
|
|
63
|
+
onClick={ () => {
|
|
64
|
+
onChange( {
|
|
65
|
+
rowStart: rowStart + 1,
|
|
66
|
+
} );
|
|
67
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
68
|
+
moveBlocksToPosition(
|
|
69
|
+
[ blockClientId ],
|
|
70
|
+
gridClientId,
|
|
71
|
+
gridClientId,
|
|
72
|
+
getNumberOfBlocksBeforeCell( columnStart, rowStart + 1 )
|
|
73
|
+
);
|
|
74
|
+
} }
|
|
75
|
+
/>
|
|
76
|
+
<ToolbarButton
|
|
77
|
+
icon={ arrowLeft }
|
|
78
|
+
label={ __( 'Move block left' ) }
|
|
79
|
+
disabled={ columnStart <= 1 }
|
|
80
|
+
onClick={ () => {
|
|
81
|
+
onChange( {
|
|
82
|
+
columnStart: columnStart - 1,
|
|
83
|
+
} );
|
|
84
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
85
|
+
moveBlocksToPosition(
|
|
86
|
+
[ blockClientId ],
|
|
87
|
+
gridClientId,
|
|
88
|
+
gridClientId,
|
|
89
|
+
getNumberOfBlocksBeforeCell( columnStart - 1, rowStart )
|
|
90
|
+
);
|
|
91
|
+
} }
|
|
92
|
+
/>
|
|
93
|
+
<ToolbarButton
|
|
94
|
+
icon={ arrowRight }
|
|
95
|
+
label={ __( 'Move block right' ) }
|
|
96
|
+
disabled={ columnCount && columnEnd >= columnCount }
|
|
97
|
+
onClick={ () => {
|
|
98
|
+
onChange( {
|
|
99
|
+
columnStart: columnStart + 1,
|
|
100
|
+
} );
|
|
101
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
102
|
+
moveBlocksToPosition(
|
|
103
|
+
[ blockClientId ],
|
|
104
|
+
gridClientId,
|
|
105
|
+
gridClientId,
|
|
106
|
+
getNumberOfBlocksBeforeCell( columnStart + 1, rowStart )
|
|
107
|
+
);
|
|
108
|
+
} }
|
|
109
|
+
/>
|
|
110
|
+
</BlockControls>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
@@ -9,11 +9,17 @@ import { useState, useEffect } from '@wordpress/element';
|
|
|
9
9
|
*/
|
|
10
10
|
import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
11
11
|
import BlockPopoverCover from '../block-popover/cover';
|
|
12
|
-
import { getComputedCSS } from './utils';
|
|
12
|
+
import { getComputedCSS, getGridTracks, getClosestTrack } from './utils';
|
|
13
13
|
|
|
14
|
-
export function GridItemResizer( {
|
|
14
|
+
export function GridItemResizer( {
|
|
15
|
+
clientId,
|
|
16
|
+
bounds,
|
|
17
|
+
onChange,
|
|
18
|
+
parentLayout,
|
|
19
|
+
} ) {
|
|
15
20
|
const blockElement = useBlockElement( clientId );
|
|
16
21
|
const rootBlockElement = blockElement?.parentElement;
|
|
22
|
+
const { isManualPlacement } = parentLayout;
|
|
17
23
|
|
|
18
24
|
if ( ! blockElement || ! rootBlockElement ) {
|
|
19
25
|
return null;
|
|
@@ -26,6 +32,10 @@ export function GridItemResizer( { clientId, bounds, onChange } ) {
|
|
|
26
32
|
blockElement={ blockElement }
|
|
27
33
|
rootBlockElement={ rootBlockElement }
|
|
28
34
|
onChange={ onChange }
|
|
35
|
+
isManualGrid={
|
|
36
|
+
isManualPlacement &&
|
|
37
|
+
window.__experimentalEnableGridInteractivity
|
|
38
|
+
}
|
|
29
39
|
/>
|
|
30
40
|
);
|
|
31
41
|
}
|
|
@@ -36,6 +46,7 @@ function GridItemResizerInner( {
|
|
|
36
46
|
blockElement,
|
|
37
47
|
rootBlockElement,
|
|
38
48
|
onChange,
|
|
49
|
+
isManualGrid,
|
|
39
50
|
} ) {
|
|
40
51
|
const [ resizeDirection, setResizeDirection ] = useState( null );
|
|
41
52
|
const [ enableSide, setEnableSide ] = useState( {
|
|
@@ -171,59 +182,11 @@ function GridItemResizerInner( {
|
|
|
171
182
|
onChange( {
|
|
172
183
|
columnSpan: columnEnd - columnStart + 1,
|
|
173
184
|
rowSpan: rowEnd - rowStart + 1,
|
|
185
|
+
columnStart: isManualGrid ? columnStart : undefined,
|
|
186
|
+
rowStart: isManualGrid ? rowStart : undefined,
|
|
174
187
|
} );
|
|
175
188
|
} }
|
|
176
189
|
/>
|
|
177
190
|
</BlockPopoverCover>
|
|
178
191
|
);
|
|
179
192
|
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Given a grid-template-columns or grid-template-rows CSS property value, gets the start and end
|
|
183
|
-
* position in pixels of each grid track.
|
|
184
|
-
*
|
|
185
|
-
* https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track
|
|
186
|
-
*
|
|
187
|
-
* @param {string} template The grid-template-columns or grid-template-rows CSS property value.
|
|
188
|
-
* Only supports fixed sizes in pixels.
|
|
189
|
-
* @param {number} gap The gap between grid tracks in pixels.
|
|
190
|
-
*
|
|
191
|
-
* @return {Array<{start: number, end: number}>} An array of objects with the start and end
|
|
192
|
-
* position in pixels of each grid track.
|
|
193
|
-
*/
|
|
194
|
-
function getGridTracks( template, gap ) {
|
|
195
|
-
const tracks = [];
|
|
196
|
-
for ( const size of template.split( ' ' ) ) {
|
|
197
|
-
const previousTrack = tracks[ tracks.length - 1 ];
|
|
198
|
-
const start = previousTrack ? previousTrack.end + gap : 0;
|
|
199
|
-
const end = start + parseFloat( size );
|
|
200
|
-
tracks.push( { start, end } );
|
|
201
|
-
}
|
|
202
|
-
return tracks;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Given an array of grid tracks and a position in pixels, gets the index of the closest track to
|
|
207
|
-
* that position.
|
|
208
|
-
*
|
|
209
|
-
* https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track
|
|
210
|
-
*
|
|
211
|
-
* @param {Array<{start: number, end: number}>} tracks An array of objects with the start and end
|
|
212
|
-
* position in pixels of each grid track.
|
|
213
|
-
* @param {number} position The position in pixels.
|
|
214
|
-
* @param {string} edge The edge of the track to compare the
|
|
215
|
-
* position to. Either 'start' or 'end'.
|
|
216
|
-
*
|
|
217
|
-
* @return {number} The index of the closest track to the position. 0-based, unlike CSS grid which
|
|
218
|
-
* is 1-based.
|
|
219
|
-
*/
|
|
220
|
-
function getClosestTrack( tracks, position, edge = 'start' ) {
|
|
221
|
-
return tracks.reduce(
|
|
222
|
-
( closest, track, index ) =>
|
|
223
|
-
Math.abs( track[ edge ] - position ) <
|
|
224
|
-
Math.abs( tracks[ closest ][ edge ] - position )
|
|
225
|
-
? index
|
|
226
|
-
: closest,
|
|
227
|
-
0
|
|
228
|
-
);
|
|
229
|
-
}
|