@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
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 } from '../components/grid-visualizer';
|
|
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,8 +100,8 @@ export default {
|
|
|
92
100
|
</>
|
|
93
101
|
);
|
|
94
102
|
},
|
|
95
|
-
toolBarControls: function GridLayoutToolbarControls(
|
|
96
|
-
return
|
|
103
|
+
toolBarControls: function GridLayoutToolbarControls() {
|
|
104
|
+
return null;
|
|
97
105
|
},
|
|
98
106
|
getLayoutStyle: function getLayoutStyle( {
|
|
99
107
|
selector,
|
|
@@ -104,11 +112,28 @@ export default {
|
|
|
104
112
|
layoutDefinitions = LAYOUT_DEFINITIONS,
|
|
105
113
|
} ) {
|
|
106
114
|
const {
|
|
107
|
-
minimumColumnWidth =
|
|
115
|
+
minimumColumnWidth = null,
|
|
108
116
|
columnCount = null,
|
|
109
117
|
rowCount = null,
|
|
110
118
|
} = layout;
|
|
111
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
|
+
|
|
112
137
|
// If a block's block.json skips serialization for spacing or spacing.blockGap,
|
|
113
138
|
// don't apply the user-defined value to the styles.
|
|
114
139
|
const blockGapValue =
|
|
@@ -120,18 +145,33 @@ export default {
|
|
|
120
145
|
let output = '';
|
|
121
146
|
const rules = [];
|
|
122
147
|
|
|
123
|
-
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 ) {
|
|
124
162
|
rules.push(
|
|
125
163
|
`grid-template-columns: repeat(${ columnCount }, minmax(0, 1fr))`
|
|
126
164
|
);
|
|
127
165
|
if ( rowCount ) {
|
|
128
166
|
rules.push(
|
|
129
|
-
`grid-template-rows: repeat(${ rowCount }, minmax(
|
|
167
|
+
`grid-template-rows: repeat(${ rowCount }, minmax(1rem, auto))`
|
|
130
168
|
);
|
|
131
169
|
}
|
|
132
|
-
} else
|
|
170
|
+
} else {
|
|
133
171
|
rules.push(
|
|
134
|
-
`grid-template-columns: repeat(auto-fill, minmax(min(${
|
|
172
|
+
`grid-template-columns: repeat(auto-fill, minmax(min(${
|
|
173
|
+
minimumColumnWidth || '12rem'
|
|
174
|
+
}, 100%), 1fr))`,
|
|
135
175
|
'container-type: inline-size'
|
|
136
176
|
);
|
|
137
177
|
}
|
|
@@ -165,8 +205,11 @@ export default {
|
|
|
165
205
|
|
|
166
206
|
// Enables setting minimum width of grid items.
|
|
167
207
|
function GridLayoutMinimumWidthControl( { layout, onChange } ) {
|
|
168
|
-
const { minimumColumnWidth
|
|
169
|
-
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 );
|
|
170
213
|
|
|
171
214
|
const handleSliderChange = ( next ) => {
|
|
172
215
|
onChange( {
|
|
@@ -207,7 +250,8 @@ function GridLayoutMinimumWidthControl( { layout, onChange } ) {
|
|
|
207
250
|
onChange={ ( newValue ) => {
|
|
208
251
|
onChange( {
|
|
209
252
|
...layout,
|
|
210
|
-
minimumColumnWidth:
|
|
253
|
+
minimumColumnWidth:
|
|
254
|
+
newValue === '' ? undefined : newValue,
|
|
211
255
|
} );
|
|
212
256
|
} }
|
|
213
257
|
onUnitChange={ handleUnitChange }
|
|
@@ -221,7 +265,7 @@ function GridLayoutMinimumWidthControl( { layout, onChange } ) {
|
|
|
221
265
|
<FlexItem isBlock>
|
|
222
266
|
<RangeControl
|
|
223
267
|
onChange={ handleSliderChange }
|
|
224
|
-
value={ quantity }
|
|
268
|
+
value={ quantity || 0 }
|
|
225
269
|
min={ 0 }
|
|
226
270
|
max={ RANGE_CONTROL_MAX_VALUES[ unit ] || 600 }
|
|
227
271
|
withInputField={ false }
|
|
@@ -240,101 +284,114 @@ function GridLayoutColumnsAndRowsControl( {
|
|
|
240
284
|
onChange,
|
|
241
285
|
allowSizingOnChildren,
|
|
242
286
|
} ) {
|
|
243
|
-
|
|
287
|
+
// If the grid interactivity experiment is enabled, allow unsetting the column count.
|
|
288
|
+
const defaultColumnCount = window.__experimentalEnableGridInteractivity
|
|
289
|
+
? undefined
|
|
290
|
+
: 3;
|
|
291
|
+
const {
|
|
292
|
+
columnCount = defaultColumnCount,
|
|
293
|
+
rowCount,
|
|
294
|
+
isManualPlacement,
|
|
295
|
+
} = layout;
|
|
244
296
|
|
|
245
297
|
return (
|
|
246
298
|
<>
|
|
247
299
|
<fieldset>
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
300
|
+
{ ( ! window.__experimentalEnableGridInteractivity ||
|
|
301
|
+
! isManualPlacement ) && (
|
|
302
|
+
<BaseControl.VisualLabel as="legend">
|
|
303
|
+
{ __( 'Columns' ) }
|
|
304
|
+
</BaseControl.VisualLabel>
|
|
305
|
+
) }
|
|
251
306
|
<Flex gap={ 4 }>
|
|
252
307
|
<FlexItem isBlock>
|
|
253
308
|
<NumberControl
|
|
254
309
|
size="__unstable-large"
|
|
255
310
|
onChange={ ( value ) => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
311
|
+
if (
|
|
312
|
+
window.__experimentalEnableGridInteractivity
|
|
313
|
+
) {
|
|
314
|
+
// Allow unsetting the column count when in auto mode.
|
|
315
|
+
const defaultNewColumnCount =
|
|
316
|
+
isManualPlacement ? 1 : undefined;
|
|
317
|
+
const newColumnCount =
|
|
318
|
+
value === ''
|
|
319
|
+
? defaultNewColumnCount
|
|
320
|
+
: parseInt( value, 10 );
|
|
321
|
+
onChange( {
|
|
322
|
+
...layout,
|
|
323
|
+
columnCount: newColumnCount,
|
|
324
|
+
} );
|
|
325
|
+
} else {
|
|
326
|
+
// Don't allow unsetting the column count.
|
|
327
|
+
const newColumnCount =
|
|
328
|
+
value === ''
|
|
329
|
+
? 1
|
|
330
|
+
: parseInt( value, 10 );
|
|
331
|
+
onChange( {
|
|
332
|
+
...layout,
|
|
333
|
+
columnCount: newColumnCount,
|
|
334
|
+
} );
|
|
335
|
+
}
|
|
265
336
|
} }
|
|
266
337
|
value={ columnCount }
|
|
267
|
-
min={
|
|
338
|
+
min={ 0 }
|
|
268
339
|
label={ __( 'Columns' ) }
|
|
269
|
-
hideLabelFromVision
|
|
340
|
+
hideLabelFromVision={
|
|
341
|
+
! window.__experimentalEnableGridInteractivity ||
|
|
342
|
+
! isManualPlacement
|
|
343
|
+
}
|
|
270
344
|
/>
|
|
271
345
|
</FlexItem>
|
|
346
|
+
|
|
272
347
|
<FlexItem isBlock>
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
348
|
+
{ window.__experimentalEnableGridInteractivity &&
|
|
349
|
+
allowSizingOnChildren &&
|
|
350
|
+
isManualPlacement ? (
|
|
351
|
+
<NumberControl
|
|
352
|
+
size="__unstable-large"
|
|
353
|
+
onChange={ ( value ) => {
|
|
354
|
+
// Don't allow unsetting the row count.
|
|
355
|
+
const newRowCount =
|
|
356
|
+
value === ''
|
|
357
|
+
? 1
|
|
358
|
+
: parseInt( value, 10 );
|
|
359
|
+
onChange( {
|
|
360
|
+
...layout,
|
|
361
|
+
rowCount: newRowCount,
|
|
362
|
+
} );
|
|
363
|
+
} }
|
|
364
|
+
value={ rowCount }
|
|
365
|
+
min={ 0 }
|
|
366
|
+
label={ __( 'Rows' ) }
|
|
367
|
+
/>
|
|
368
|
+
) : (
|
|
369
|
+
<RangeControl
|
|
370
|
+
value={ columnCount ?? 0 }
|
|
371
|
+
onChange={ ( value ) =>
|
|
372
|
+
onChange( {
|
|
373
|
+
...layout,
|
|
374
|
+
columnCount: value,
|
|
375
|
+
} )
|
|
376
|
+
}
|
|
377
|
+
min={ 0 }
|
|
378
|
+
max={ 16 }
|
|
379
|
+
withInputField={ false }
|
|
380
|
+
label={ __( 'Columns' ) }
|
|
381
|
+
hideLabelFromVision
|
|
382
|
+
/>
|
|
383
|
+
) }
|
|
287
384
|
</FlexItem>
|
|
288
385
|
</Flex>
|
|
289
386
|
</fieldset>
|
|
290
|
-
{ allowSizingOnChildren &&
|
|
291
|
-
window.__experimentalEnableGridInteractivity && (
|
|
292
|
-
<fieldset>
|
|
293
|
-
<BaseControl.VisualLabel as="legend">
|
|
294
|
-
{ __( 'Rows' ) }
|
|
295
|
-
</BaseControl.VisualLabel>
|
|
296
|
-
<Flex gap={ 4 }>
|
|
297
|
-
<FlexItem isBlock>
|
|
298
|
-
<NumberControl
|
|
299
|
-
size="__unstable-large"
|
|
300
|
-
onChange={ ( value ) => {
|
|
301
|
-
onChange( {
|
|
302
|
-
...layout,
|
|
303
|
-
rowCount: value,
|
|
304
|
-
} );
|
|
305
|
-
} }
|
|
306
|
-
value={ rowCount }
|
|
307
|
-
min={ 1 }
|
|
308
|
-
label={ __( 'Rows' ) }
|
|
309
|
-
hideLabelFromVision
|
|
310
|
-
/>
|
|
311
|
-
</FlexItem>
|
|
312
|
-
<FlexItem isBlock>
|
|
313
|
-
<RangeControl
|
|
314
|
-
value={ parseInt( rowCount, 10 ) } // RangeControl can't deal with strings.
|
|
315
|
-
onChange={ ( value ) =>
|
|
316
|
-
onChange( {
|
|
317
|
-
...layout,
|
|
318
|
-
rowCount: value,
|
|
319
|
-
} )
|
|
320
|
-
}
|
|
321
|
-
min={ 1 }
|
|
322
|
-
max={ 16 }
|
|
323
|
-
withInputField={ false }
|
|
324
|
-
label={ __( 'Rows' ) }
|
|
325
|
-
hideLabelFromVision
|
|
326
|
-
/>
|
|
327
|
-
</FlexItem>
|
|
328
|
-
</Flex>
|
|
329
|
-
</fieldset>
|
|
330
|
-
) }
|
|
331
387
|
</>
|
|
332
388
|
);
|
|
333
389
|
}
|
|
334
390
|
|
|
335
391
|
// Enables switching between grid types
|
|
336
392
|
function GridLayoutTypeControl( { layout, onChange } ) {
|
|
337
|
-
const { columnCount, minimumColumnWidth } =
|
|
393
|
+
const { columnCount, rowCount, minimumColumnWidth, isManualPlacement } =
|
|
394
|
+
layout;
|
|
338
395
|
|
|
339
396
|
/**
|
|
340
397
|
* When switching, temporarily save any custom values set on the
|
|
@@ -343,33 +400,63 @@ function GridLayoutTypeControl( { layout, onChange } ) {
|
|
|
343
400
|
const [ tempColumnCount, setTempColumnCount ] = useState(
|
|
344
401
|
columnCount || 3
|
|
345
402
|
);
|
|
403
|
+
const [ tempRowCount, setTempRowCount ] = useState( rowCount );
|
|
346
404
|
const [ tempMinimumColumnWidth, setTempMinimumColumnWidth ] = useState(
|
|
347
405
|
minimumColumnWidth || '12rem'
|
|
348
406
|
);
|
|
349
407
|
|
|
350
|
-
const
|
|
408
|
+
const gridPlacement =
|
|
409
|
+
isManualPlacement ||
|
|
410
|
+
( !! columnCount && ! window.__experimentalEnableGridInteractivity )
|
|
411
|
+
? 'manual'
|
|
412
|
+
: 'auto';
|
|
351
413
|
|
|
352
414
|
const onChangeType = ( value ) => {
|
|
353
415
|
if ( value === 'manual' ) {
|
|
354
416
|
setTempMinimumColumnWidth( minimumColumnWidth || '12rem' );
|
|
355
417
|
} else {
|
|
356
418
|
setTempColumnCount( columnCount || 3 );
|
|
419
|
+
setTempRowCount( rowCount );
|
|
357
420
|
}
|
|
358
421
|
onChange( {
|
|
359
422
|
...layout,
|
|
360
423
|
columnCount: value === 'manual' ? tempColumnCount : null,
|
|
424
|
+
rowCount:
|
|
425
|
+
value === 'manual' &&
|
|
426
|
+
window.__experimentalEnableGridInteractivity
|
|
427
|
+
? tempRowCount
|
|
428
|
+
: undefined,
|
|
429
|
+
isManualPlacement:
|
|
430
|
+
value === 'manual' &&
|
|
431
|
+
window.__experimentalEnableGridInteractivity
|
|
432
|
+
? true
|
|
433
|
+
: undefined,
|
|
361
434
|
minimumColumnWidth:
|
|
362
435
|
value === 'auto' ? tempMinimumColumnWidth : null,
|
|
363
436
|
} );
|
|
364
437
|
};
|
|
365
438
|
|
|
439
|
+
const helpText =
|
|
440
|
+
gridPlacement === 'manual'
|
|
441
|
+
? __(
|
|
442
|
+
'Grid items can be manually placed in any position on the grid.'
|
|
443
|
+
)
|
|
444
|
+
: __(
|
|
445
|
+
'Grid items are placed automatically depending on their order.'
|
|
446
|
+
);
|
|
447
|
+
|
|
366
448
|
return (
|
|
367
449
|
<ToggleGroupControl
|
|
368
450
|
__nextHasNoMarginBottom
|
|
369
|
-
label={ __( '
|
|
370
|
-
value={
|
|
451
|
+
label={ __( 'Grid item position' ) }
|
|
452
|
+
value={ gridPlacement }
|
|
371
453
|
onChange={ onChangeType }
|
|
372
454
|
isBlock
|
|
455
|
+
help={
|
|
456
|
+
window.__experimentalEnableGridInteractivity
|
|
457
|
+
? helpText
|
|
458
|
+
: undefined
|
|
459
|
+
}
|
|
373
460
|
>
|
|
374
461
|
<ToggleGroupControlOption
|
|
375
462
|
key="auto"
|
package/src/lock-unlock.js
CHANGED
|
@@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
|
|
|
5
5
|
|
|
6
6
|
export const { lock, unlock } =
|
|
7
7
|
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
8
|
-
'I
|
|
8
|
+
'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',
|
|
9
9
|
'@wordpress/block-editor'
|
|
10
10
|
);
|
package/src/private-apis.js
CHANGED
|
@@ -20,7 +20,12 @@ 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';
|
|
@@ -36,6 +41,7 @@ import {
|
|
|
36
41
|
selectBlockPatternsKey,
|
|
37
42
|
reusableBlocksSelectKey,
|
|
38
43
|
globalStylesDataKey,
|
|
44
|
+
globalStylesLinksDataKey,
|
|
39
45
|
} from './store/private-keys';
|
|
40
46
|
import { requiresWrapperOnCopy } from './components/writing-flow/utils';
|
|
41
47
|
import { PrivateRichText } from './components/rich-text/';
|
|
@@ -44,6 +50,7 @@ import { PrivateInserterLibrary } from './components/inserter/library';
|
|
|
44
50
|
import { PrivatePublishDateTimePicker } from './components/publish-date-time-picker';
|
|
45
51
|
import useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';
|
|
46
52
|
import useBlockDisplayTitle from './components/block-title/use-block-display-title';
|
|
53
|
+
import TabbedSidebar from './components/tabbed-sidebar';
|
|
47
54
|
|
|
48
55
|
/**
|
|
49
56
|
* Private @wordpress/block-editor APIs.
|
|
@@ -73,12 +80,14 @@ lock( privateApis, {
|
|
|
73
80
|
useLayoutStyles,
|
|
74
81
|
DimensionsTool,
|
|
75
82
|
ResolutionTool,
|
|
83
|
+
TabbedSidebar,
|
|
76
84
|
TextAlignmentControl,
|
|
77
85
|
ReusableBlocksRenameHint,
|
|
78
86
|
useReusableBlocksRenameHint,
|
|
79
87
|
usesContextKey,
|
|
80
88
|
useFlashEditableBlocks,
|
|
81
89
|
globalStylesDataKey,
|
|
90
|
+
globalStylesLinksDataKey,
|
|
82
91
|
selectBlockPatternsKey,
|
|
83
92
|
requiresWrapperOnCopy,
|
|
84
93
|
PrivateRichText,
|
|
@@ -88,4 +97,6 @@ lock( privateApis, {
|
|
|
88
97
|
PrivatePublishDateTimePicker,
|
|
89
98
|
useSpacingSizes,
|
|
90
99
|
useBlockDisplayTitle,
|
|
100
|
+
__unstableBlockStyleVariationOverridesWithConfig,
|
|
101
|
+
setBackgroundStyleDefaults,
|
|
91
102
|
} );
|
package/src/store/actions.js
CHANGED
|
@@ -982,7 +982,7 @@ export const __unstableSplitSelection =
|
|
|
982
982
|
},
|
|
983
983
|
};
|
|
984
984
|
|
|
985
|
-
|
|
985
|
+
let tail = {
|
|
986
986
|
...blockB,
|
|
987
987
|
// Only preserve the original client ID if the end is different.
|
|
988
988
|
clientId:
|
|
@@ -995,6 +995,26 @@ export const __unstableSplitSelection =
|
|
|
995
995
|
},
|
|
996
996
|
};
|
|
997
997
|
|
|
998
|
+
// When splitting a block, attempt to convert the tail block to the
|
|
999
|
+
// default block type. For example, when splitting a heading block, the
|
|
1000
|
+
// tail block will be converted to a paragraph block. Note that for
|
|
1001
|
+
// blocks such as a list item and button, this will be skipped because
|
|
1002
|
+
// the default block type cannot be inserted.
|
|
1003
|
+
const defaultBlockName = getDefaultBlockName();
|
|
1004
|
+
if (
|
|
1005
|
+
// A block is only split when the selection is within the same
|
|
1006
|
+
// block.
|
|
1007
|
+
blockA.clientId === blockB.clientId &&
|
|
1008
|
+
defaultBlockName &&
|
|
1009
|
+
tail.name !== defaultBlockName &&
|
|
1010
|
+
select.canInsertBlockType( defaultBlockName, anchorRootClientId )
|
|
1011
|
+
) {
|
|
1012
|
+
const switched = switchToBlockType( tail, defaultBlockName );
|
|
1013
|
+
if ( switched?.length === 1 ) {
|
|
1014
|
+
tail = switched[ 0 ];
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
998
1018
|
if ( ! blocks.length ) {
|
|
999
1019
|
dispatch.replaceBlocks( select.getSelectedBlockClientIds(), [
|
|
1000
1020
|
head,
|
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/style.scss
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
@import "./components/duotone-control/style.scss";
|
|
28
28
|
@import "./components/font-appearance-control/style.scss";
|
|
29
29
|
@import "./components/global-styles/style.scss";
|
|
30
|
-
@import "./components/grid
|
|
30
|
+
@import "./components/grid/style.scss";
|
|
31
31
|
@import "./components/height-control/style.scss";
|
|
32
32
|
@import "./components/image-size-control/style.scss";
|
|
33
33
|
@import "./components/inserter-list-item/style.scss";
|
|
@@ -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
|
+
}
|