@wordpress/block-editor 8.1.2 → 8.3.0-next.e230fbab09.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 +10 -0
- package/README.md +6 -26
- package/build/autocompleters/link.js +78 -0
- package/build/autocompleters/link.js.map +1 -0
- package/build/components/autocomplete/index.js +3 -1
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-actions/index.js +1 -1
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +4 -2
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-compare/index.js +2 -2
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-controls/index.js +1 -1
- package/build/components/block-controls/index.js.map +1 -1
- package/build/components/block-draggable/index.js +1 -1
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-edit/edit.js +1 -1
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-list/block-html.js +1 -1
- package/build/components/block-list/block-html.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.js +1 -1
- package/build/components/block-list/block-invalid-warning.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +4 -4
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js +4 -3
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js +17 -3
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +6 -6
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +5 -5
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +1 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +3 -0
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-multi-selection.js +25 -27
- package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +4 -4
- package/build/components/block-media-update-progress/index.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.native.js +1 -1
- package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build/components/block-mover/mover-description.js +4 -4
- package/build/components/block-mover/mover-description.js.map +1 -1
- package/build/components/block-mover/mover-description.native.js +5 -5
- package/build/components/block-mover/mover-description.native.js.map +1 -1
- package/build/components/block-settings/container.native.js +1 -5
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +7 -12
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/preview.native.js +1 -1
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/index.js +2 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +0 -1
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-title/index.js +7 -62
- package/build/components/block-title/index.js.map +1 -1
- package/build/components/block-title/use-block-display-title.js +94 -0
- package/build/components/block-title/use-block-display-title.js.map +1 -0
- package/build/components/block-toolbar/utils.js +9 -1
- package/build/components/block-toolbar/utils.js.map +1 -1
- package/build/components/block-tools/block-popover.js +1 -1
- package/build/components/block-tools/block-popover.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +2 -1
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-types-list/index.native.js +1 -1
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/border-radius-control/index.js +2 -2
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/utils.js +10 -6
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/contrast-checker/index.js +3 -3
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +1 -1
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +1 -3
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build/components/copy-handler/index.js +3 -3
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +3 -3
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +38 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +4 -4
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +1 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +2 -2
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/index.js +3 -3
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +7 -7
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js +3 -3
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +20 -8
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-items.js +1 -1
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +28 -11
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +3 -3
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.js +63 -45
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/line-height-control/index.native.js +3 -1
- package/build/components/line-height-control/index.native.js.map +1 -1
- package/build/components/link-control/index.js +2 -2
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-results.js +2 -2
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/use-rich-url-data.js +1 -1
- package/build/components/link-control/use-rich-url-data.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +2 -2
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block-contents.js +8 -4
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +2 -2
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +20 -9
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +2 -1
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +49 -41
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +139 -0
- package/build/components/list-view/use-block-selection.js.map +1 -0
- package/build/components/list-view/use-list-view-expand-selected-item.js +60 -0
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -0
- package/build/components/list-view/utils.js +29 -1
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +7 -5
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +20 -24
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +4 -3
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/media-upload-progress/index.native.js +2 -2
- package/build/components/media-upload-progress/index.native.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +3 -3
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +3 -3
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +2 -2
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.native.js +1 -1
- package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
- package/build/components/rich-text/index.js +7 -12
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +3 -3
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +7 -12
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/url-input/index.js +11 -11
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +1 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +2 -2
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/writing-flow/index.js +1 -0
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js +22 -24
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/components/writing-flow/use-select-all.js +3 -2
- package/build/components/writing-flow/use-select-all.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +4 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +1 -1
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +1 -1
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border.js +2 -14
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +2 -2
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/custom-class-name.js +40 -0
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/duotone.js +22 -4
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/generated-class-name.js +3 -3
- package/build/hooks/generated-class-name.js.map +1 -1
- package/build/hooks/line-height.js +2 -0
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/lock.js +1 -1
- package/build/hooks/lock.js.map +1 -1
- package/build/hooks/style.js +32 -13
- package/build/hooks/style.js.map +1 -1
- package/build/layouts/flow.js +7 -5
- package/build/layouts/flow.js.map +1 -1
- package/build/store/actions.js +55 -48
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +2 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +1 -2
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +13 -13
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +6 -6
- package/build/store/selectors.js.map +1 -1
- package/build/utils/index.js +0 -14
- package/build/utils/index.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +3 -3
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build/utils/pasting.js +91 -0
- package/build/utils/pasting.js.map +1 -0
- package/build/utils/transform-styles/ast/parse.js +5 -5
- package/build/utils/transform-styles/ast/parse.js.map +1 -1
- package/build/utils/transform-styles/transforms/url-rewrite.js +2 -2
- package/build/utils/transform-styles/transforms/url-rewrite.js.map +1 -1
- package/build-module/autocompleters/link.js +64 -0
- package/build-module/autocompleters/link.js.map +1 -0
- package/build-module/components/autocomplete/index.js +2 -1
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +1 -1
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +4 -2
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-compare/index.js +2 -2
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-controls/index.js +1 -1
- package/build-module/components/block-controls/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +1 -1
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-edit/edit.js +1 -1
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-list/block-html.js +1 -1
- package/build-module/components/block-list/block-html.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +1 -1
- package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +4 -4
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js +4 -3
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.js +18 -4
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +7 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +5 -5
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +1 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +2 -0
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-multi-selection.js +23 -28
- package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
- package/build-module/components/block-media-update-progress/index.native.js +4 -4
- package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-mover/mover-description.js +4 -4
- package/build-module/components/block-mover/mover-description.js.map +1 -1
- package/build-module/components/block-mover/mover-description.native.js +5 -5
- package/build-module/components/block-mover/mover-description.native.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +2 -6
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -13
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +1 -1
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/index.js +2 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-title/index.js +7 -58
- package/build-module/components/block-title/index.js.map +1 -1
- package/build-module/components/block-title/use-block-display-title.js +80 -0
- package/build-module/components/block-title/use-block-display-title.js.map +1 -0
- package/build-module/components/block-toolbar/utils.js +9 -1
- package/build-module/components/block-toolbar/utils.js.map +1 -1
- package/build-module/components/block-tools/block-popover.js +1 -1
- package/build-module/components/block-tools/block-popover.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +2 -1
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +1 -1
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +3 -3
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +11 -7
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/contrast-checker/index.js +3 -3
- package/build-module/components/contrast-checker/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +1 -1
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +1 -3
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build-module/components/copy-handler/index.js +2 -2
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +3 -3
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +5 -4
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +4 -4
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +1 -1
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +2 -2
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/index.js +3 -3
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +7 -7
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js +3 -3
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +20 -8
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-items.js +1 -1
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +28 -11
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +3 -3
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +61 -45
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +3 -1
- package/build-module/components/line-height-control/index.native.js.map +1 -1
- package/build-module/components/link-control/index.js +2 -2
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-results.js +2 -2
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/use-rich-url-data.js +1 -1
- package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +2 -2
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +8 -4
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +2 -2
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +20 -9
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +2 -1
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +46 -42
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +123 -0
- package/build-module/components/list-view/use-block-selection.js.map +1 -0
- package/build-module/components/list-view/use-list-view-expand-selected-item.js +50 -0
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -0
- package/build-module/components/list-view/utils.js +25 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +7 -5
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +22 -27
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +4 -3
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/media-upload-progress/index.native.js +2 -2
- package/build-module/components/media-upload-progress/index.native.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +3 -3
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +3 -3
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +2 -2
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.native.js +1 -1
- package/build-module/components/rich-text/format-toolbar-container.native.js.map +1 -1
- package/build-module/components/rich-text/index.js +7 -12
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +3 -3
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +6 -12
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/url-input/index.js +11 -11
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +1 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +2 -2
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +1 -0
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js +21 -21
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-select-all.js +3 -2
- package/build-module/components/writing-flow/use-select-all.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +4 -3
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +1 -1
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +1 -1
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border.js +2 -14
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +2 -2
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +38 -0
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/duotone.js +23 -5
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/generated-class-name.js +3 -3
- package/build-module/hooks/generated-class-name.js.map +1 -1
- package/build-module/hooks/line-height.js +2 -0
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/lock.js +1 -1
- package/build-module/hooks/lock.js.map +1 -1
- package/build-module/hooks/style.js +31 -13
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/layouts/flow.js +7 -5
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/store/actions.js +52 -45
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +2 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js +1 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +13 -13
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +6 -6
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/index.js +0 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +3 -3
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/utils/pasting.js +80 -0
- package/build-module/utils/pasting.js.map +1 -0
- package/build-module/utils/transform-styles/ast/parse.js +5 -5
- package/build-module/utils/transform-styles/ast/parse.js.map +1 -1
- package/build-module/utils/transform-styles/transforms/url-rewrite.js +2 -2
- package/build-module/utils/transform-styles/transforms/url-rewrite.js.map +1 -1
- package/build-style/style-rtl.css +10 -12
- package/build-style/style.css +10 -12
- package/package.json +27 -26
- package/src/autocompleters/link.js +62 -0
- package/src/autocompleters/style.scss +8 -0
- package/src/components/alignment-control/test/index.js +2 -2
- package/src/components/autocomplete/index.js +2 -0
- package/src/components/block-actions/index.js +1 -1
- package/src/components/block-alignment-control/test/index.js +1 -1
- package/src/components/block-breadcrumb/index.js +5 -2
- package/src/components/block-compare/index.js +2 -2
- package/src/components/block-controls/index.js +1 -1
- package/src/components/block-draggable/index.js +1 -1
- package/src/components/block-draggable/stories/index.js +1 -1
- package/src/components/block-edit/edit.js +1 -1
- package/src/components/block-list/block-html.js +1 -1
- package/src/components/block-list/block-invalid-warning.js +1 -1
- package/src/components/block-list/block-list-item.native.js +4 -4
- package/src/components/block-list/block-selection-button.native.js +3 -3
- package/src/components/block-list/block.js +28 -4
- package/src/components/block-list/block.native.js +7 -6
- package/src/components/block-list/index.native.js +5 -5
- package/src/components/block-list/style.scss +3 -1
- package/src/components/block-list/use-block-props/use-block-class-names.js +1 -1
- package/src/components/block-list/use-block-props/use-focus-first-element.js +3 -0
- package/src/components/block-list/use-block-props/use-multi-selection.js +22 -30
- package/src/components/block-media-update-progress/index.native.js +4 -4
- package/src/components/block-media-update-progress/test/index.native.js +2 -2
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
- package/src/components/block-mobile-toolbar/index.native.js +2 -2
- package/src/components/block-mover/mover-description.js +4 -4
- package/src/components/block-mover/mover-description.native.js +5 -5
- package/src/components/block-settings/container.native.js +5 -6
- package/src/components/block-settings-menu/block-settings-dropdown.js +7 -8
- package/src/components/block-styles/preview.native.js +1 -1
- package/src/components/block-switcher/index.js +4 -1
- package/src/components/block-switcher/use-transformed-patterns.js +0 -1
- package/src/components/block-title/README.md +17 -1
- package/src/components/block-title/index.js +7 -62
- package/src/components/block-title/test/index.js +21 -3
- package/src/components/block-title/use-block-display-title.js +83 -0
- package/src/components/block-toolbar/utils.js +12 -2
- package/src/components/block-tools/block-popover.js +1 -1
- package/src/components/block-tools/block-selection-button.js +4 -1
- package/src/components/block-types-list/index.native.js +1 -1
- package/src/components/border-radius-control/index.js +5 -3
- package/src/components/border-radius-control/test/utils.js +10 -10
- package/src/components/border-radius-control/utils.js +10 -8
- package/src/components/contrast-checker/index.js +3 -3
- package/src/components/convert-to-group-buttons/index.js +1 -1
- package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +1 -6
- package/src/components/copy-handler/index.js +2 -2
- package/src/components/font-sizes/with-font-sizes.js +3 -3
- package/src/components/image-size-control/test/index.js +1 -1
- package/src/components/index.js +1 -0
- package/src/components/index.native.js +11 -4
- package/src/components/inserter/block-patterns-tab.js +13 -17
- package/src/components/inserter/block-types-tab.js +1 -1
- package/src/components/inserter/hooks/use-block-type-impressions.native.js +2 -2
- package/src/components/inserter/index.js +3 -3
- package/src/components/inserter/index.native.js +7 -7
- package/src/components/inserter/menu.js +1 -1
- package/src/components/inserter/menu.native.js +3 -3
- package/src/components/inserter/quick-inserter.js +32 -10
- package/src/components/inserter/search-items.js +1 -1
- package/src/components/inserter/search-results.js +55 -43
- package/src/components/inserter/test/fixtures/index.native.js +1 -1
- package/src/components/inserter/test/reusable-blocks-tab.js +2 -2
- package/src/components/justify-content-control/README.md +1 -1
- package/src/components/keyboard-shortcuts/index.js +1 -1
- package/src/components/letter-spacing-control/index.js +1 -1
- package/src/components/line-height-control/README.md +13 -2
- package/src/components/line-height-control/index.js +66 -43
- package/src/components/line-height-control/index.native.js +2 -0
- package/src/components/line-height-control/stories/index.js +33 -0
- package/src/components/line-height-control/test/index.js +61 -0
- package/src/components/link-control/index.js +2 -2
- package/src/components/link-control/search-input.js +1 -1
- package/src/components/link-control/search-results.js +2 -2
- package/src/components/link-control/test/index.js +142 -144
- package/src/components/link-control/use-rich-url-data.js +1 -1
- package/src/components/link-control/use-search-handler.js +2 -2
- package/src/components/list-view/README.md +2 -2
- package/src/components/list-view/block-contents.js +10 -3
- package/src/components/list-view/block-select-button.js +1 -2
- package/src/components/list-view/block.js +30 -10
- package/src/components/list-view/branch.js +1 -0
- package/src/components/list-view/index.js +56 -30
- package/src/components/list-view/test/utils.js +50 -0
- package/src/components/list-view/use-block-selection.js +163 -0
- package/src/components/list-view/use-list-view-expand-selected-item.js +58 -0
- package/src/components/list-view/utils.js +31 -0
- package/src/components/media-placeholder/index.native.js +11 -9
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +20 -26
- package/src/components/media-replace-flow/test/index.js +100 -0
- package/src/components/media-upload/index.native.js +3 -2
- package/src/components/media-upload-progress/index.native.js +2 -2
- package/src/components/navigable-toolbar/index.js +3 -3
- package/src/components/plain-text/index.native.js +3 -3
- package/src/components/responsive-block-control/test/index.js +6 -6
- package/src/components/rich-text/format-toolbar-container.js +2 -2
- package/src/components/rich-text/format-toolbar-container.native.js +1 -1
- package/src/components/rich-text/index.js +7 -14
- package/src/components/rich-text/index.native.js +3 -3
- package/src/components/rich-text/use-paste-handler.js +7 -14
- package/src/components/url-input/index.js +11 -11
- package/src/components/use-block-drop-zone/test/index.js +1 -1
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-on-block-drop/index.js +2 -2
- package/src/components/writing-flow/index.js +1 -0
- package/src/components/writing-flow/use-multi-selection.js +17 -20
- package/src/components/writing-flow/use-select-all.js +6 -2
- package/src/components/writing-flow/use-tab-nav.js +6 -3
- package/src/hooks/align.js +1 -1
- package/src/hooks/anchor.js +1 -1
- package/src/hooks/border.js +8 -19
- package/src/hooks/color.js +2 -2
- package/src/hooks/custom-class-name.js +45 -0
- package/src/hooks/duotone.js +27 -3
- package/src/hooks/generated-class-name.js +3 -3
- package/src/hooks/line-height.js +2 -0
- package/src/hooks/lock.js +1 -1
- package/src/hooks/style.js +31 -13
- package/src/hooks/test/align.js +1 -1
- package/src/hooks/typography.scss +0 -4
- package/src/layouts/flow.js +10 -5
- package/src/store/actions.js +24 -14
- package/src/store/defaults.js +2 -2
- package/src/store/index.js +0 -1
- package/src/store/reducer.js +13 -12
- package/src/store/selectors.js +6 -6
- package/src/store/test/actions.js +2 -2
- package/src/store/test/reducer.js +10 -1
- package/src/store/test/selectors.js +1 -1
- package/src/style.scss +0 -1
- package/src/utils/index.js +0 -1
- package/src/utils/parse-css-unit-to-px.js +3 -3
- package/src/utils/pasting.js +77 -0
- package/src/utils/test/parse-css-unit-to-px.js +5 -5
- package/src/utils/test/pasting.js +84 -0
- package/src/utils/transform-styles/ast/parse.js +5 -5
- package/src/utils/transform-styles/transforms/url-rewrite.js +2 -2
- package/build/utils/get-paste-event-data.js +0 -56
- package/build/utils/get-paste-event-data.js.map +0 -1
- package/build/utils/theme.js +0 -63
- package/build/utils/theme.js.map +0 -1
- package/build-module/utils/get-paste-event-data.js +0 -47
- package/build-module/utils/get-paste-event-data.js.map +0 -1
- package/build-module/utils/theme.js +0 -53
- package/build-module/utils/theme.js.map +0 -1
- package/src/components/line-height-control/style.scss +0 -8
- package/src/components/writing-flow/test/use-multi-selection.js +0 -36
- package/src/utils/get-paste-event-data.js +0 -42
- package/src/utils/theme.js +0 -48
|
@@ -102,7 +102,7 @@ function useMovingAnimation( {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
if ( prefersReducedMotion ) {
|
|
105
|
-
//
|
|
105
|
+
// If the animation is disabled and the scroll needs to be adjusted,
|
|
106
106
|
// just move directly to the final scroll position.
|
|
107
107
|
preserveScrollPosition();
|
|
108
108
|
|
|
@@ -78,7 +78,7 @@ export function onBlockDrop(
|
|
|
78
78
|
blocks,
|
|
79
79
|
} = parseDropEvent( event );
|
|
80
80
|
|
|
81
|
-
// If the user is inserting a block
|
|
81
|
+
// If the user is inserting a block.
|
|
82
82
|
if ( dropType === 'inserter' ) {
|
|
83
83
|
clearSelectedBlock();
|
|
84
84
|
const blocksToInsert = blocks.map( ( block ) =>
|
|
@@ -93,7 +93,7 @@ export function onBlockDrop(
|
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// If the user is moving a block
|
|
96
|
+
// If the user is moving a block.
|
|
97
97
|
if ( dropType === 'block' ) {
|
|
98
98
|
const sourceBlockIndex = getBlockIndex( sourceClientIds[ 0 ] );
|
|
99
99
|
|
|
@@ -15,21 +15,6 @@ import { useSelect } from '@wordpress/data';
|
|
|
15
15
|
import { store as blockEditorStore } from '../../store';
|
|
16
16
|
import { __unstableUseBlockRef as useBlockRef } from '../block-list/use-block-props/use-block-refs';
|
|
17
17
|
|
|
18
|
-
export function toggleRichText( container, toggle ) {
|
|
19
|
-
Array.from(
|
|
20
|
-
container.querySelectorAll(
|
|
21
|
-
// Exclude the Post Title from multi-select disable.
|
|
22
|
-
'.rich-text:not( .editor-post-title__input )'
|
|
23
|
-
)
|
|
24
|
-
).forEach( ( node ) => {
|
|
25
|
-
if ( toggle ) {
|
|
26
|
-
node.setAttribute( 'contenteditable', true );
|
|
27
|
-
} else {
|
|
28
|
-
node.removeAttribute( 'contenteditable' );
|
|
29
|
-
}
|
|
30
|
-
} );
|
|
31
|
-
}
|
|
32
|
-
|
|
33
18
|
/**
|
|
34
19
|
* Returns for the deepest node at the start or end of a container node. Ignores
|
|
35
20
|
* any text nodes that only contain HTML formatting whitespace.
|
|
@@ -62,6 +47,7 @@ function selector( select ) {
|
|
|
62
47
|
getMultiSelectedBlockClientIds,
|
|
63
48
|
hasMultiSelection,
|
|
64
49
|
getSelectedBlockClientId,
|
|
50
|
+
getSelectedBlocksInitialCaretPosition,
|
|
65
51
|
} = select( blockEditorStore );
|
|
66
52
|
|
|
67
53
|
return {
|
|
@@ -69,11 +55,13 @@ function selector( select ) {
|
|
|
69
55
|
multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),
|
|
70
56
|
hasMultiSelection: hasMultiSelection(),
|
|
71
57
|
selectedBlockClientId: getSelectedBlockClientId(),
|
|
58
|
+
initialPosition: getSelectedBlocksInitialCaretPosition(),
|
|
72
59
|
};
|
|
73
60
|
}
|
|
74
61
|
|
|
75
62
|
export default function useMultiSelection() {
|
|
76
63
|
const {
|
|
64
|
+
initialPosition,
|
|
77
65
|
isMultiSelecting,
|
|
78
66
|
multiSelectedBlockClientIds,
|
|
79
67
|
hasMultiSelection,
|
|
@@ -93,6 +81,13 @@ export default function useMultiSelection() {
|
|
|
93
81
|
const { ownerDocument } = node;
|
|
94
82
|
const { defaultView } = ownerDocument;
|
|
95
83
|
|
|
84
|
+
// Allow initialPosition to bypass focus behavior. This is useful
|
|
85
|
+
// for the list view or other areas where we don't want to transfer
|
|
86
|
+
// focus to the editor canvas.
|
|
87
|
+
if ( initialPosition === undefined || initialPosition === null ) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
96
91
|
if ( ! hasMultiSelection || isMultiSelecting ) {
|
|
97
92
|
if ( ! selectedBlockClientId || isMultiSelecting ) {
|
|
98
93
|
return;
|
|
@@ -131,6 +126,12 @@ export default function useMultiSelection() {
|
|
|
131
126
|
return;
|
|
132
127
|
}
|
|
133
128
|
|
|
129
|
+
// Allow cross contentEditable selection by temporarily making
|
|
130
|
+
// all content editable. We can't rely on using the store and
|
|
131
|
+
// React because re-rending happens too slowly. We need to be
|
|
132
|
+
// able to select across instances immediately.
|
|
133
|
+
node.contentEditable = true;
|
|
134
|
+
|
|
134
135
|
// For some browsers, like Safari, it is important that focus happens
|
|
135
136
|
// BEFORE selection.
|
|
136
137
|
node.focus();
|
|
@@ -144,11 +145,6 @@ export default function useMultiSelection() {
|
|
|
144
145
|
const startNode = getDeepestNode( startRef.current, 'start' );
|
|
145
146
|
const endNode = getDeepestNode( endRef.current, 'end' );
|
|
146
147
|
|
|
147
|
-
// While rich text will be disabled with a delay when there is a multi
|
|
148
|
-
// selection, we must do it immediately because it's not possible to set
|
|
149
|
-
// selection across editable hosts.
|
|
150
|
-
toggleRichText( node, false );
|
|
151
|
-
|
|
152
148
|
range.setStartBefore( startNode );
|
|
153
149
|
range.setEndAfter( endNode );
|
|
154
150
|
|
|
@@ -160,6 +156,7 @@ export default function useMultiSelection() {
|
|
|
160
156
|
isMultiSelecting,
|
|
161
157
|
multiSelectedBlockClientIds,
|
|
162
158
|
selectedBlockClientId,
|
|
159
|
+
initialPosition,
|
|
163
160
|
]
|
|
164
161
|
);
|
|
165
162
|
}
|
|
@@ -31,11 +31,15 @@ export default function useSelectAll() {
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
const selectedClientIds = getSelectedBlockClientIds();
|
|
35
|
+
|
|
36
|
+
if (
|
|
37
|
+
selectedClientIds.length < 2 &&
|
|
38
|
+
! isEntirelySelected( event.target )
|
|
39
|
+
) {
|
|
35
40
|
return;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
const selectedClientIds = getSelectedBlockClientIds();
|
|
39
43
|
const [ firstSelectedClientId ] = selectedClientIds;
|
|
40
44
|
const rootClientId = getBlockRootClientId( firstSelectedClientId );
|
|
41
45
|
let blockClientIds = getBlockOrder( rootClientId );
|
|
@@ -118,13 +118,16 @@ export default function useTabNav() {
|
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
// Allow tabbing
|
|
121
|
+
// Allow tabbing from the block wrapper to a form element,
|
|
122
|
+
// and between form elements rendered in a block,
|
|
122
123
|
// such as inside a placeholder. Form elements are generally
|
|
123
124
|
// meant to be UI rather than part of the content. Ideally
|
|
124
125
|
// these are not rendered in the content and perhaps in the
|
|
125
126
|
// future they can be rendered in an iframe or shadow DOM.
|
|
126
127
|
if (
|
|
127
|
-
isFormElement( event.target )
|
|
128
|
+
( isFormElement( event.target ) ||
|
|
129
|
+
event.target.getAttribute( 'data-block' ) ===
|
|
130
|
+
getSelectedBlockClientId() ) &&
|
|
128
131
|
isFormElement( focus.tabbable[ direction ]( event.target ) )
|
|
129
132
|
) {
|
|
130
133
|
return;
|
|
@@ -183,7 +186,7 @@ export default function useTabNav() {
|
|
|
183
186
|
const isShift = event.shiftKey;
|
|
184
187
|
const direction = isShift ? 'findPrevious' : 'findNext';
|
|
185
188
|
const target = focus.tabbable[ direction ]( event.target );
|
|
186
|
-
//
|
|
189
|
+
// Only do something when the next tabbable is a focus capture div (before/after)
|
|
187
190
|
if (
|
|
188
191
|
target === focusCaptureBeforeRef.current ||
|
|
189
192
|
target === focusCaptureAfterRef.current
|
package/src/hooks/align.js
CHANGED
|
@@ -86,7 +86,7 @@ export function getValidAlignments(
|
|
|
86
86
|
* @return {Object} Filtered block settings.
|
|
87
87
|
*/
|
|
88
88
|
export function addAttribute( settings ) {
|
|
89
|
-
//
|
|
89
|
+
// Allow blocks to specify their own attribute definition with default values if needed.
|
|
90
90
|
if ( has( settings.attributes, [ 'align', 'type' ] ) ) {
|
|
91
91
|
return settings;
|
|
92
92
|
}
|
package/src/hooks/anchor.js
CHANGED
|
@@ -34,7 +34,7 @@ const ANCHOR_REGEX = /[\s#]/g;
|
|
|
34
34
|
* @return {Object} Filtered block settings.
|
|
35
35
|
*/
|
|
36
36
|
export function addAttribute( settings ) {
|
|
37
|
-
//
|
|
37
|
+
// Allow blocks to specify their own attribute definition with default values if needed.
|
|
38
38
|
if ( has( settings.attributes, [ 'anchor', 'type' ] ) ) {
|
|
39
39
|
return settings;
|
|
40
40
|
}
|
package/src/hooks/border.js
CHANGED
|
@@ -37,8 +37,6 @@ export const BORDER_SUPPORT_KEY = '__experimentalBorder';
|
|
|
37
37
|
|
|
38
38
|
export function BorderPanel( props ) {
|
|
39
39
|
const { clientId } = props;
|
|
40
|
-
const isDisabled = useIsBorderDisabled( props );
|
|
41
|
-
const isSupported = hasBorderSupport( props.name );
|
|
42
40
|
|
|
43
41
|
const isColorSupported =
|
|
44
42
|
useSetting( 'border.color' ) && hasBorderSupport( props.name, 'color' );
|
|
@@ -53,7 +51,14 @@ export function BorderPanel( props ) {
|
|
|
53
51
|
const isWidthSupported =
|
|
54
52
|
useSetting( 'border.width' ) && hasBorderSupport( props.name, 'width' );
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
const isDisabled = [
|
|
55
|
+
! isColorSupported,
|
|
56
|
+
! isRadiusSupported,
|
|
57
|
+
! isStyleSupported,
|
|
58
|
+
! isWidthSupported,
|
|
59
|
+
].every( Boolean );
|
|
60
|
+
|
|
61
|
+
if ( isDisabled ) {
|
|
57
62
|
return null;
|
|
58
63
|
}
|
|
59
64
|
|
|
@@ -179,22 +184,6 @@ export function shouldSkipSerialization( blockType ) {
|
|
|
179
184
|
return support?.__experimentalSkipSerialization;
|
|
180
185
|
}
|
|
181
186
|
|
|
182
|
-
/**
|
|
183
|
-
* Determines if all border support features have been disabled.
|
|
184
|
-
*
|
|
185
|
-
* @return {boolean} If border support is completely disabled.
|
|
186
|
-
*/
|
|
187
|
-
const useIsBorderDisabled = () => {
|
|
188
|
-
const configs = [
|
|
189
|
-
! useSetting( 'border.color' ),
|
|
190
|
-
! useSetting( 'border.radius' ),
|
|
191
|
-
! useSetting( 'border.style' ),
|
|
192
|
-
! useSetting( 'border.width' ),
|
|
193
|
-
];
|
|
194
|
-
|
|
195
|
-
return configs.every( Boolean );
|
|
196
|
-
};
|
|
197
|
-
|
|
198
187
|
/**
|
|
199
188
|
* Returns a new style object where the specified border attribute has been
|
|
200
189
|
* removed.
|
package/src/hooks/color.js
CHANGED
|
@@ -209,7 +209,7 @@ function addAttributes( settings ) {
|
|
|
209
209
|
return settings;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
//
|
|
212
|
+
// Allow blocks to specify their own attribute definition with default values if needed.
|
|
213
213
|
if ( ! settings.attributes.backgroundColor ) {
|
|
214
214
|
Object.assign( settings.attributes, {
|
|
215
215
|
backgroundColor: {
|
|
@@ -269,7 +269,7 @@ export function addSaveProps( props, blockType, attributes ) {
|
|
|
269
269
|
textClass,
|
|
270
270
|
gradientClass,
|
|
271
271
|
{
|
|
272
|
-
// Don't apply the background class if there's a custom gradient
|
|
272
|
+
// Don't apply the background class if there's a custom gradient.
|
|
273
273
|
[ backgroundClass ]:
|
|
274
274
|
( ! hasGradient || ! style?.color?.gradient ) &&
|
|
275
275
|
!! backgroundClass,
|
|
@@ -112,6 +112,45 @@ export function addSaveProps( extraProps, blockType, attributes ) {
|
|
|
112
112
|
return extraProps;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
export function addTransforms( result, source, index, results ) {
|
|
116
|
+
if ( ! hasBlockSupport( result.name, 'customClassName', true ) ) {
|
|
117
|
+
return result;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// If the condition verifies we are probably in the presence of a wrapping transform
|
|
121
|
+
// e.g: nesting paragraphs in a group or columns and in that case the class should not be kept.
|
|
122
|
+
if ( results.length === 1 && result.innerBlocks.length === source.length ) {
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// If we are transforming one block to multiple blocks or multiple blocks to one block,
|
|
127
|
+
// we ignore the class during the transform.
|
|
128
|
+
if (
|
|
129
|
+
( results.length === 1 && source.length > 1 ) ||
|
|
130
|
+
( results.length > 1 && source.length === 1 )
|
|
131
|
+
) {
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// If we are in presence of transform between one or more block in the source
|
|
136
|
+
// that have one or more blocks in the result
|
|
137
|
+
// we apply the class on source N to the result N,
|
|
138
|
+
// if source N does not exists we do nothing.
|
|
139
|
+
if ( source[ index ] ) {
|
|
140
|
+
const originClassName = source[ index ]?.attributes.className;
|
|
141
|
+
if ( originClassName ) {
|
|
142
|
+
return {
|
|
143
|
+
...result,
|
|
144
|
+
attributes: {
|
|
145
|
+
...result.attributes,
|
|
146
|
+
className: originClassName,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
|
|
115
154
|
addFilter(
|
|
116
155
|
'blocks.registerBlockType',
|
|
117
156
|
'core/custom-class-name/attribute',
|
|
@@ -127,3 +166,9 @@ addFilter(
|
|
|
127
166
|
'core/custom-class-name/save-props',
|
|
128
167
|
addSaveProps
|
|
129
168
|
);
|
|
169
|
+
|
|
170
|
+
addFilter(
|
|
171
|
+
'blocks.switchToBlockType.transformedBlock',
|
|
172
|
+
'core/color/addTransforms',
|
|
173
|
+
addTransforms
|
|
174
|
+
);
|
package/src/hooks/duotone.js
CHANGED
|
@@ -12,7 +12,7 @@ import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
|
|
|
12
12
|
import { SVG } from '@wordpress/components';
|
|
13
13
|
import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';
|
|
14
14
|
import { addFilter } from '@wordpress/hooks';
|
|
15
|
-
import { useContext, createPortal } from '@wordpress/element';
|
|
15
|
+
import { useMemo, useContext, createPortal } from '@wordpress/element';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Internal dependencies
|
|
@@ -140,12 +140,36 @@ ${ selector } {
|
|
|
140
140
|
);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
function useMultiOriginPresets( { presetSetting, defaultSetting } ) {
|
|
144
|
+
const disableDefault = ! useSetting( defaultSetting );
|
|
145
|
+
const userPresets =
|
|
146
|
+
useSetting( `${ presetSetting }.custom` ) || EMPTY_ARRAY;
|
|
147
|
+
const themePresets =
|
|
148
|
+
useSetting( `${ presetSetting }.theme` ) || EMPTY_ARRAY;
|
|
149
|
+
const defaultPresets =
|
|
150
|
+
useSetting( `${ presetSetting }.default` ) || EMPTY_ARRAY;
|
|
151
|
+
return useMemo(
|
|
152
|
+
() => [
|
|
153
|
+
...userPresets,
|
|
154
|
+
...themePresets,
|
|
155
|
+
...( disableDefault ? EMPTY_ARRAY : defaultPresets ),
|
|
156
|
+
],
|
|
157
|
+
[ disableDefault, userPresets, themePresets, defaultPresets ]
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
143
161
|
function DuotonePanel( { attributes, setAttributes } ) {
|
|
144
162
|
const style = attributes?.style;
|
|
145
163
|
const duotone = style?.color?.duotone;
|
|
146
164
|
|
|
147
|
-
const duotonePalette =
|
|
148
|
-
|
|
165
|
+
const duotonePalette = useMultiOriginPresets( {
|
|
166
|
+
presetSetting: 'color.duotone',
|
|
167
|
+
defaultSetting: 'color.defaultDuotone',
|
|
168
|
+
} );
|
|
169
|
+
const colorPalette = useMultiOriginPresets( {
|
|
170
|
+
presetSetting: 'color.palette',
|
|
171
|
+
defaultSetting: 'color.defaultPalette',
|
|
172
|
+
} );
|
|
149
173
|
const disableCustomColors = ! useSetting( 'color.custom' );
|
|
150
174
|
const disableCustomDuotone =
|
|
151
175
|
! useSetting( 'color.customDuotone' ) ||
|
|
@@ -20,11 +20,11 @@ import { hasBlockSupport, getBlockDefaultClassName } from '@wordpress/blocks';
|
|
|
20
20
|
* @return {Object} Filtered props applied to save element.
|
|
21
21
|
*/
|
|
22
22
|
export function addGeneratedClassName( extraProps, blockType ) {
|
|
23
|
-
// Adding the generated className
|
|
23
|
+
// Adding the generated className.
|
|
24
24
|
if ( hasBlockSupport( blockType, 'className', true ) ) {
|
|
25
25
|
if ( typeof extraProps.className === 'string' ) {
|
|
26
26
|
// We have some extra classes and want to add the default classname
|
|
27
|
-
// We use uniq to prevent duplicate classnames
|
|
27
|
+
// We use uniq to prevent duplicate classnames.
|
|
28
28
|
|
|
29
29
|
extraProps.className = uniq( [
|
|
30
30
|
getBlockDefaultClassName( blockType.name ),
|
|
@@ -34,7 +34,7 @@ export function addGeneratedClassName( extraProps, blockType ) {
|
|
|
34
34
|
.trim();
|
|
35
35
|
} else {
|
|
36
36
|
// There is no string in the className variable,
|
|
37
|
-
// so we just dump the default name in there
|
|
37
|
+
// so we just dump the default name in there.
|
|
38
38
|
extraProps.className = getBlockDefaultClassName( blockType.name );
|
|
39
39
|
}
|
|
40
40
|
}
|
package/src/hooks/line-height.js
CHANGED
package/src/hooks/lock.js
CHANGED
|
@@ -16,7 +16,7 @@ import { addFilter } from '@wordpress/hooks';
|
|
|
16
16
|
* @return {Object} Filtered block settings.
|
|
17
17
|
*/
|
|
18
18
|
export function addAttribute( settings ) {
|
|
19
|
-
//
|
|
19
|
+
// Allow blocks to specify their own attribute definition with default values if needed.
|
|
20
20
|
if ( has( settings.attributes, [ 'lock', 'type' ] ) ) {
|
|
21
21
|
return settings;
|
|
22
22
|
}
|
package/src/hooks/style.js
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
__EXPERIMENTAL_ELEMENTS as ELEMENTS,
|
|
28
28
|
} from '@wordpress/blocks';
|
|
29
29
|
import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';
|
|
30
|
+
import { getCSSRules } from '@wordpress/style-engine';
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Internal dependencies
|
|
@@ -85,21 +86,35 @@ export function getInlineStyles( styles = {} ) {
|
|
|
85
86
|
// option and backwards compatibility for border radius support.
|
|
86
87
|
const styleValue = get( styles, path );
|
|
87
88
|
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
if ( ! STYLE_PROPERTY[ propKey ].useEngine ) {
|
|
90
|
+
if ( !! subPaths && ! isString( styleValue ) ) {
|
|
91
|
+
Object.entries( subPaths ).forEach( ( entry ) => {
|
|
92
|
+
const [ name, subPath ] = entry;
|
|
93
|
+
const value = get( styleValue, [ subPath ] );
|
|
94
|
+
|
|
95
|
+
if ( value ) {
|
|
96
|
+
output[ name ] = compileStyleValue( value );
|
|
97
|
+
}
|
|
98
|
+
} );
|
|
99
|
+
} else if ( ! ignoredStyles.includes( path.join( '.' ) ) ) {
|
|
100
|
+
output[ propKey ] = compileStyleValue(
|
|
101
|
+
get( styles, path )
|
|
102
|
+
);
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
106
|
} );
|
|
102
107
|
|
|
108
|
+
// The goal is to move everything to server side generated engine styles
|
|
109
|
+
// This is temporary as we absorb more and more styles into the engine.
|
|
110
|
+
const extraRules = getCSSRules( styles, { selector: 'self' } );
|
|
111
|
+
extraRules.forEach( ( rule ) => {
|
|
112
|
+
if ( rule.selector !== 'self' ) {
|
|
113
|
+
throw "This style can't be added as inline style";
|
|
114
|
+
}
|
|
115
|
+
output[ rule.key ] = rule.value;
|
|
116
|
+
} );
|
|
117
|
+
|
|
103
118
|
return output;
|
|
104
119
|
}
|
|
105
120
|
|
|
@@ -107,8 +122,11 @@ function compileElementsStyles( selector, elements = {} ) {
|
|
|
107
122
|
return map( elements, ( styles, element ) => {
|
|
108
123
|
const elementStyles = getInlineStyles( styles );
|
|
109
124
|
if ( ! isEmpty( elementStyles ) ) {
|
|
125
|
+
// The .editor-styles-wrapper selector is required on elements styles. As it is
|
|
126
|
+
// added to all other editor styles, not providing it causes reset and global
|
|
127
|
+
// styles to override element styles because of higher specificity.
|
|
110
128
|
return [
|
|
111
|
-
|
|
129
|
+
`.editor-styles-wrapper .${ selector } ${ ELEMENTS[ element ] }{`,
|
|
112
130
|
...map(
|
|
113
131
|
elementStyles,
|
|
114
132
|
( value, property ) =>
|
|
@@ -133,7 +151,7 @@ function addAttribute( settings ) {
|
|
|
133
151
|
return settings;
|
|
134
152
|
}
|
|
135
153
|
|
|
136
|
-
//
|
|
154
|
+
// Allow blocks to specify their own attribute definition with default values if needed.
|
|
137
155
|
if ( ! settings.attributes.style ) {
|
|
138
156
|
Object.assign( settings.attributes, {
|
|
139
157
|
style: {
|
package/src/hooks/test/align.js
CHANGED
|
@@ -167,7 +167,7 @@ describe( 'align', () => {
|
|
|
167
167
|
isSelected
|
|
168
168
|
/>
|
|
169
169
|
);
|
|
170
|
-
//
|
|
170
|
+
// When there's only one child, `rendered` in the tree is an object not an array.
|
|
171
171
|
expect( wrapper.toTree().rendered ).toBeInstanceOf( Object );
|
|
172
172
|
} );
|
|
173
173
|
|
package/src/layouts/flow.js
CHANGED
|
@@ -115,31 +115,36 @@ export default {
|
|
|
115
115
|
let output =
|
|
116
116
|
!! contentSize || !! wideSize
|
|
117
117
|
? `
|
|
118
|
-
${ appendSelectors(
|
|
118
|
+
${ appendSelectors(
|
|
119
|
+
selector,
|
|
120
|
+
'> :where(:not(.alignleft):not(.alignright))'
|
|
121
|
+
) } {
|
|
119
122
|
max-width: ${ contentSize ?? wideSize };
|
|
120
123
|
margin-left: auto !important;
|
|
121
124
|
margin-right: auto !important;
|
|
122
125
|
}
|
|
123
126
|
|
|
124
|
-
${ appendSelectors( selector, '>
|
|
127
|
+
${ appendSelectors( selector, '> .alignwide' ) } {
|
|
125
128
|
max-width: ${ wideSize ?? contentSize };
|
|
126
129
|
}
|
|
127
130
|
|
|
128
|
-
${ appendSelectors( selector, '>
|
|
131
|
+
${ appendSelectors( selector, '> .alignfull' ) } {
|
|
129
132
|
max-width: none;
|
|
130
133
|
}
|
|
131
134
|
`
|
|
132
135
|
: '';
|
|
133
136
|
|
|
134
137
|
output += `
|
|
135
|
-
${ appendSelectors( selector, '>
|
|
138
|
+
${ appendSelectors( selector, '> .alignleft' ) } {
|
|
136
139
|
float: left;
|
|
137
140
|
margin-right: 2em;
|
|
141
|
+
margin-left: 0;
|
|
138
142
|
}
|
|
139
143
|
|
|
140
|
-
${ appendSelectors( selector, '>
|
|
144
|
+
${ appendSelectors( selector, '> .alignright' ) } {
|
|
141
145
|
float: right;
|
|
142
146
|
margin-left: 2em;
|
|
147
|
+
margin-right: 0;
|
|
143
148
|
}
|
|
144
149
|
|
|
145
150
|
`;
|
package/src/store/actions.js
CHANGED
|
@@ -259,10 +259,15 @@ export function stopMultiSelect() {
|
|
|
259
259
|
/**
|
|
260
260
|
* Action that changes block multi-selection.
|
|
261
261
|
*
|
|
262
|
-
* @param {string}
|
|
263
|
-
* @param {string}
|
|
262
|
+
* @param {string} start First block of the multi selection.
|
|
263
|
+
* @param {string} end Last block of the multiselection.
|
|
264
|
+
* @param {number|null} __experimentalInitialPosition Optional initial position. Pass as null to skip focus within editor canvas.
|
|
264
265
|
*/
|
|
265
|
-
export const multiSelect = (
|
|
266
|
+
export const multiSelect = (
|
|
267
|
+
start,
|
|
268
|
+
end,
|
|
269
|
+
__experimentalInitialPosition = 0
|
|
270
|
+
) => ( { select, dispatch } ) => {
|
|
266
271
|
const startBlockRootClientId = select.getBlockRootClientId( start );
|
|
267
272
|
const endBlockRootClientId = select.getBlockRootClientId( end );
|
|
268
273
|
|
|
@@ -271,7 +276,12 @@ export const multiSelect = ( start, end ) => ( { select, dispatch } ) => {
|
|
|
271
276
|
return;
|
|
272
277
|
}
|
|
273
278
|
|
|
274
|
-
dispatch( {
|
|
279
|
+
dispatch( {
|
|
280
|
+
type: 'MULTI_SELECT',
|
|
281
|
+
start,
|
|
282
|
+
end,
|
|
283
|
+
initialPosition: __experimentalInitialPosition,
|
|
284
|
+
} );
|
|
275
285
|
|
|
276
286
|
const blockCount = select.getSelectedBlockCount();
|
|
277
287
|
|
|
@@ -665,7 +675,7 @@ export const mergeBlocks = ( firstBlockClientId, secondBlockClientId ) => ( {
|
|
|
665
675
|
const blockA = select.getBlock( clientIdA );
|
|
666
676
|
const blockAType = getBlockType( blockA.name );
|
|
667
677
|
|
|
668
|
-
// Only focus the previous block if it's not mergeable
|
|
678
|
+
// Only focus the previous block if it's not mergeable.
|
|
669
679
|
if ( blockAType && ! blockAType.merge ) {
|
|
670
680
|
dispatch.selectBlock( blockA.clientId );
|
|
671
681
|
return;
|
|
@@ -734,18 +744,18 @@ export const mergeBlocks = ( firstBlockClientId, secondBlockClientId ) => ( {
|
|
|
734
744
|
}
|
|
735
745
|
|
|
736
746
|
// We can only merge blocks with similar types
|
|
737
|
-
// thus, we transform the block to merge first
|
|
747
|
+
// thus, we transform the block to merge first.
|
|
738
748
|
const blocksWithTheSameType =
|
|
739
749
|
blockA.name === blockB.name
|
|
740
750
|
? [ cloneB ]
|
|
741
751
|
: switchToBlockType( cloneB, blockA.name );
|
|
742
752
|
|
|
743
|
-
// If the block types can not match, do nothing
|
|
753
|
+
// If the block types can not match, do nothing.
|
|
744
754
|
if ( ! blocksWithTheSameType || ! blocksWithTheSameType.length ) {
|
|
745
755
|
return;
|
|
746
756
|
}
|
|
747
757
|
|
|
748
|
-
// Calling the merge to update the attributes and remove the block to be merged
|
|
758
|
+
// Calling the merge to update the attributes and remove the block to be merged.
|
|
749
759
|
const updatedAttributes = blockAType.merge(
|
|
750
760
|
cloneA.attributes,
|
|
751
761
|
blocksWithTheSameType[ 0 ].attributes
|
|
@@ -996,11 +1006,11 @@ export function selectionChange(
|
|
|
996
1006
|
* @param {?Object} attributes Optional attributes of the block to assign.
|
|
997
1007
|
* @param {?string} rootClientId Optional root client ID of block list on which
|
|
998
1008
|
* to append.
|
|
999
|
-
* @param {?number} index Optional index where to insert the default block
|
|
1000
|
-
*
|
|
1001
|
-
* @return {Object} Action object
|
|
1009
|
+
* @param {?number} index Optional index where to insert the default block.
|
|
1002
1010
|
*/
|
|
1003
|
-
export
|
|
1011
|
+
export const insertDefaultBlock = ( attributes, rootClientId, index ) => ( {
|
|
1012
|
+
dispatch,
|
|
1013
|
+
} ) => {
|
|
1004
1014
|
// Abort if there is no default block type (if it has been unregistered).
|
|
1005
1015
|
const defaultBlockName = getDefaultBlockName();
|
|
1006
1016
|
if ( ! defaultBlockName ) {
|
|
@@ -1009,8 +1019,8 @@ export function insertDefaultBlock( attributes, rootClientId, index ) {
|
|
|
1009
1019
|
|
|
1010
1020
|
const block = createBlock( defaultBlockName, attributes );
|
|
1011
1021
|
|
|
1012
|
-
return insertBlock( block, index, rootClientId );
|
|
1013
|
-
}
|
|
1022
|
+
return dispatch.insertBlock( block, index, rootClientId );
|
|
1023
|
+
};
|
|
1014
1024
|
|
|
1015
1025
|
/**
|
|
1016
1026
|
* Action that changes the nested settings of a given block.
|
package/src/store/defaults.js
CHANGED
|
@@ -134,7 +134,7 @@ export const SETTINGS_DEFAULTS = {
|
|
|
134
134
|
{ slug: 'full', name: __( 'Full Size' ) },
|
|
135
135
|
],
|
|
136
136
|
|
|
137
|
-
// Allow plugin to disable Image Editor if need be
|
|
137
|
+
// Allow plugin to disable Image Editor if need be.
|
|
138
138
|
imageEditing: true,
|
|
139
139
|
|
|
140
140
|
// This is current max width of the block inner area
|
|
@@ -156,8 +156,8 @@ export const SETTINGS_DEFAULTS = {
|
|
|
156
156
|
__experimentalBlockPatterns: [],
|
|
157
157
|
__experimentalBlockPatternCategories: [],
|
|
158
158
|
__experimentalSpotlightEntityBlocks: [],
|
|
159
|
+
__experimentalGenerateAnchors: false,
|
|
159
160
|
__unstableGalleryWithImageBlocks: false,
|
|
160
|
-
|
|
161
161
|
// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
|
|
162
162
|
// The setting is only kept for backward compatibility purposes.
|
|
163
163
|
gradients: [
|