@wordpress/block-editor 9.2.0 → 9.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 +6 -0
- package/build/autocompleters/block.js +3 -1
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +3 -7
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-context/index.js.map +1 -1
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-list-appender/index.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +1 -1
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-selection-clearer/index.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +3 -7
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +6 -3
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.js +6 -3
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/menu-items.js +3 -7
- package/build/components/block-styles/menu-items.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-toolbar/index.native.js.map +1 -1
- package/build/components/block-toolbar/utils.js +5 -8
- package/build/components/block-toolbar/utils.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/copy-handler/index.js +17 -1
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/default-block-appender/index.native.js.map +1 -1
- package/build/components/default-style-picker/index.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-size-control/index.js +3 -1
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.js +18 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +3 -7
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/no-results.native.js.map +1 -1
- 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.native.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +56 -0
- package/build/components/inspector-popover-header/index.js.map +1 -0
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/index.js +4 -4
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-create-button.js +1 -3
- package/build/components/link-control/search-create-button.js.map +1 -1
- package/build/components/link-control/search-input.js +5 -3
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +3 -7
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +1 -7
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +4 -4
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +20 -5
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +1 -1
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +4 -0
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +5 -3
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +14 -16
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +4 -8
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/ungroup-button/index.native.js +3 -7
- package/build/components/ungroup-button/index.native.js.map +1 -1
- package/build/components/url-input/index.js +14 -3
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-display-block-controls/index.native.js.map +1 -1
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.native.js.map +1 -1
- package/build/components/use-setting/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +12 -12
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/components/writing-flow/use-click-selection.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/components/writing-flow/use-select-all.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color-panel.native.js.map +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/layout.js +38 -1
- package/build/hooks/layout.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/pasting.js.map +1 -1
- package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-module/autocompleters/block.js +4 -1
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +2 -5
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-context/index.js.map +1 -1
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- 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.map +1 -1
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +1 -1
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-selection-clearer/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.js +3 -5
- package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +9 -3
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.js +5 -2
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +3 -5
- package/build-module/components/block-styles/menu-items.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-toolbar/utils.js +3 -5
- package/build-module/components/block-toolbar/utils.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/color-style-selector/index.js.map +1 -1
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/copy-handler/index.js +18 -2
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.native.js.map +1 -1
- package/build-module/components/default-style-picker/index.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-size-control/index.js +4 -1
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.js +2 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/library.js +2 -5
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/no-results.native.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-items.js +2 -2
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +46 -0
- package/build-module/components/inspector-popover-header/index.js.map +1 -0
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/index.js +2 -1
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-create-button.js +1 -2
- package/build-module/components/link-control/search-create-button.js.map +1 -1
- package/build-module/components/link-control/search-input.js +3 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +2 -5
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +1 -6
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +2 -1
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +22 -7
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +1 -1
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +4 -0
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +4 -1
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +14 -16
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +3 -5
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/ungroup-button/index.native.js +3 -5
- package/build-module/components/ungroup-button/index.native.js.map +1 -1
- package/build-module/components/url-input/index.js +11 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-display-block-controls/index.native.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.js +12 -11
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/components/writing-flow/use-click-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-select-all.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color-panel.native.js.map +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/layout.js +39 -2
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +2 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/pasting.js.map +1 -1
- package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-style/style-rtl.css +16 -23
- package/build-style/style.css +16 -23
- package/package.json +28 -28
- package/src/autocompleters/block.js +2 -1
- package/src/components/block-actions/index.js +2 -3
- package/src/components/block-alignment-control/ui.js +4 -6
- package/src/components/block-alignment-matrix-control/index.js +2 -4
- package/src/components/block-breadcrumb/index.js +2 -5
- package/src/components/block-compare/test/block-view.js +2 -1
- package/src/components/block-content-overlay/index.js +2 -5
- package/src/components/block-context/index.js +4 -4
- package/src/components/block-controls/hook.js +2 -3
- package/src/components/block-draggable/index.js +6 -13
- package/src/components/block-draggable/index.native.js +6 -14
- package/src/components/block-draggable/test/index.native.js +12 -15
- package/src/components/block-edit/test/edit.js +2 -1
- package/src/components/block-list/block-list-item.native.js +4 -12
- package/src/components/block-list/block-selection-button.native.js +2 -3
- package/src/components/block-list/block.js +8 -10
- package/src/components/block-list/block.native.js +10 -15
- package/src/components/block-list/index.js +2 -3
- package/src/components/block-list/index.native.js +12 -21
- package/src/components/block-list/test/block-list-context.native.js +8 -16
- package/src/components/block-list/use-block-props/index.js +6 -3
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +2 -3
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +2 -3
- package/src/components/block-list/use-in-between-inserter.js +2 -3
- package/src/components/block-list-appender/index.js +2 -5
- package/src/components/block-list-appender/index.native.js +2 -3
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +4 -6
- package/src/components/block-mover/button.js +2 -3
- package/src/components/block-mover/index.native.js +4 -6
- package/src/components/block-parent-selector/index.js +2 -3
- package/src/components/block-pattern-setup/index.js +3 -5
- package/src/components/block-preview/auto.js +4 -8
- package/src/components/block-selection-clearer/index.js +2 -3
- package/src/components/block-settings-menu/block-mode-toggle.js +4 -8
- package/src/components/block-settings-menu/block-settings-dropdown.js +9 -9
- package/src/components/block-styles/index.js +3 -1
- package/src/components/block-styles/menu-items.js +2 -5
- package/src/components/block-switcher/block-transformations-menu.js +2 -4
- package/src/components/block-toolbar/index.native.js +2 -5
- package/src/components/block-toolbar/utils.js +3 -11
- package/src/components/block-tools/block-contextual-toolbar.js +2 -5
- package/src/components/block-tools/index.js +2 -3
- package/src/components/block-types-list/index.native.js +2 -4
- package/src/components/block-variation-transforms/index.js +4 -6
- package/src/components/color-palette/test/control.js +2 -1
- package/src/components/color-style-selector/index.js +27 -28
- package/src/components/colors/test/with-colors.js +14 -14
- package/src/components/colors/with-colors.js +8 -12
- package/src/components/colors-gradients/dropdown.js +21 -16
- package/src/components/colors-gradients/test/control.js +10 -10
- package/src/components/convert-to-group-buttons/toolbar.js +2 -6
- package/src/components/copy-handler/README.md +7 -2
- package/src/components/copy-handler/index.js +26 -6
- package/src/components/default-block-appender/index.js +4 -6
- package/src/components/default-block-appender/index.native.js +4 -9
- package/src/components/default-style-picker/index.js +20 -21
- package/src/components/font-sizes/with-font-sizes.js +2 -3
- package/src/components/image-editor/aspect-ratio-dropdown.js +2 -6
- package/src/components/image-size-control/index.js +4 -7
- package/src/components/index.js +2 -0
- package/src/components/inner-blocks/use-inner-block-template-sync.js +2 -3
- package/src/components/inner-blocks/use-nested-settings-update.js +6 -9
- package/src/components/inserter/block-types-tab.native.js +2 -3
- package/src/components/inserter/hooks/use-block-type-impressions.native.js +2 -3
- package/src/components/inserter/hooks/use-insertion-point.js +3 -2
- package/src/components/inserter/hooks/use-patterns-state.js +4 -5
- package/src/components/inserter/index.js +4 -6
- package/src/components/inserter/index.native.js +6 -11
- package/src/components/inserter/library.js +2 -5
- package/src/components/inserter/menu.js +14 -19
- package/src/components/inserter/menu.native.js +8 -6
- package/src/components/inserter/no-results.native.js +2 -1
- package/src/components/inserter/quick-inserter.js +2 -3
- package/src/components/inserter/search-items.js +6 -6
- package/src/components/inserter/search-results.native.js +4 -6
- package/src/components/inspector-popover-header/README.md +76 -0
- package/src/components/inspector-popover-header/index.js +56 -0
- package/src/components/inspector-popover-header/style.scss +16 -0
- package/src/components/line-height-control/index.js +1 -2
- package/src/components/link-control/index.js +4 -4
- package/src/components/link-control/search-create-button.js +4 -2
- package/src/components/link-control/search-input.js +3 -1
- package/src/components/link-control/settings-drawer.js +2 -5
- package/src/components/link-control/test/fixtures/index.js +3 -4
- package/src/components/link-control/test/index.js +24 -36
- package/src/components/link-control/use-search-handler.js +2 -2
- package/src/components/list-view/block-contents.js +2 -4
- package/src/components/list-view/branch.js +22 -23
- package/src/components/list-view/index.js +4 -8
- package/src/components/list-view/use-block-selection.js +5 -5
- package/src/components/list-view/use-list-view-drop-zone.js +2 -1
- package/src/components/list-view/utils.js +1 -6
- package/src/components/media-placeholder/index.js +2 -1
- package/src/components/media-replace-flow/index.js +77 -46
- package/src/components/media-upload/index.native.js +1 -1
- package/src/components/navigable-toolbar/index.js +1 -2
- package/src/components/panel-color-settings/test/index.js +2 -1
- package/src/components/plain-text/index.native.js +2 -6
- package/src/components/preview-options/index.js +4 -0
- package/src/components/provider/use-block-sync.js +5 -2
- package/src/components/publish-date-time-picker/README.md +1 -1
- package/src/components/publish-date-time-picker/index.js +16 -27
- package/src/components/responsive-block-control/test/index.js +3 -2
- package/src/components/rich-text/embed-handler-picker.native.js +2 -5
- package/src/components/rich-text/index.js +7 -4
- package/src/components/rich-text/use-format-types.js +16 -16
- package/src/components/rich-text/use-mark-persistent.js +2 -3
- package/src/components/skip-to-selected-block/index.js +2 -3
- package/src/components/ungroup-button/index.native.js +4 -8
- package/src/components/url-input/index.js +21 -20
- package/src/components/use-block-display-information/index.js +4 -6
- package/src/components/use-block-drop-zone/index.js +2 -3
- package/src/components/use-block-drop-zone/index.native.js +2 -4
- package/src/components/use-block-drop-zone/test/index.js +22 -23
- package/src/components/use-display-block-controls/index.native.js +2 -3
- package/src/components/use-no-recursive-renders/test/use-no-recursive-renders.js +2 -3
- package/src/components/use-on-block-drop/index.js +2 -5
- package/src/components/use-on-block-drop/index.native.js +4 -8
- package/src/components/use-setting/index.js +8 -6
- package/src/components/writing-flow/test/index.js +22 -4
- package/src/components/writing-flow/use-arrow-nav.js +22 -10
- package/src/components/writing-flow/use-click-selection.js +2 -5
- package/src/components/writing-flow/use-drag-selection.js +6 -9
- package/src/components/writing-flow/use-multi-selection.js +2 -4
- package/src/components/writing-flow/use-select-all.js +2 -5
- package/src/components/writing-flow/use-selection-observer.js +4 -6
- package/src/components/writing-flow/use-tab-nav.js +2 -5
- package/src/hooks/color-panel.js +4 -4
- package/src/hooks/color-panel.native.js +2 -2
- package/src/hooks/color.js +2 -2
- package/src/hooks/font-family.js +4 -2
- package/src/hooks/gap.js +2 -3
- package/src/hooks/layout.js +54 -4
- package/src/hooks/test/align.js +2 -1
- package/src/hooks/test/generated-class-name.js +2 -5
- package/src/hooks/test/utils.js +2 -5
- package/src/store/actions.js +772 -728
- package/src/store/reducer.js +188 -177
- package/src/store/selectors.js +54 -54
- package/src/store/test/actions.js +2 -1
- package/src/store/test/reducer.js +3 -1
- package/src/store/test/selectors.js +17 -21
- package/src/style.scss +1 -1
- package/src/utils/pasting.js +3 -3
- package/src/utils/transform-styles/transforms/wrap.js +30 -28
- package/tsconfig.tsbuildinfo +1 -1
- package/src/components/publish-date-time-picker/style.scss +0 -20
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { debounce
|
|
4
|
+
import { debounce } from 'lodash';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import scrollIntoView from 'dom-scroll-into-view';
|
|
7
7
|
|
|
@@ -27,6 +27,16 @@ import { isURL } from '@wordpress/url';
|
|
|
27
27
|
*/
|
|
28
28
|
import { store as blockEditorStore } from '../../store';
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Whether the argument is a function.
|
|
32
|
+
*
|
|
33
|
+
* @param {*} maybeFunc The argument to check.
|
|
34
|
+
* @return {boolean} True if the argument is a function, false otherwise.
|
|
35
|
+
*/
|
|
36
|
+
function isFunction( maybeFunc ) {
|
|
37
|
+
return typeof maybeFunc === 'function';
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
class URLInput extends Component {
|
|
31
41
|
constructor( props ) {
|
|
32
42
|
super( props );
|
|
@@ -60,10 +70,8 @@ class URLInput extends Component {
|
|
|
60
70
|
|
|
61
71
|
componentDidUpdate( prevProps ) {
|
|
62
72
|
const { showSuggestions, selectedSuggestion } = this.state;
|
|
63
|
-
const {
|
|
64
|
-
|
|
65
|
-
__experimentalShowInitialSuggestions = false,
|
|
66
|
-
} = this.props;
|
|
73
|
+
const { value, __experimentalShowInitialSuggestions = false } =
|
|
74
|
+
this.props;
|
|
67
75
|
|
|
68
76
|
// Only have to worry about scrolling selected suggestion into view
|
|
69
77
|
// when already expanded.
|
|
@@ -122,10 +130,8 @@ class URLInput extends Component {
|
|
|
122
130
|
|
|
123
131
|
shouldShowInitialSuggestions() {
|
|
124
132
|
const { suggestions } = this.state;
|
|
125
|
-
const {
|
|
126
|
-
|
|
127
|
-
value,
|
|
128
|
-
} = this.props;
|
|
133
|
+
const { __experimentalShowInitialSuggestions = false, value } =
|
|
134
|
+
this.props;
|
|
129
135
|
return (
|
|
130
136
|
! this.isUpdatingSuggestions &&
|
|
131
137
|
__experimentalShowInitialSuggestions &&
|
|
@@ -257,12 +263,8 @@ class URLInput extends Component {
|
|
|
257
263
|
}
|
|
258
264
|
|
|
259
265
|
onKeyDown( event ) {
|
|
260
|
-
const {
|
|
261
|
-
|
|
262
|
-
selectedSuggestion,
|
|
263
|
-
suggestions,
|
|
264
|
-
loading,
|
|
265
|
-
} = this.state;
|
|
266
|
+
const { showSuggestions, selectedSuggestion, suggestions, loading } =
|
|
267
|
+
this.state;
|
|
266
268
|
|
|
267
269
|
// If the suggestions are not shown or loading, we shouldn't handle the arrow keys
|
|
268
270
|
// We shouldn't preventDefault to allow block arrow keys navigation.
|
|
@@ -315,9 +317,8 @@ class URLInput extends Component {
|
|
|
315
317
|
return;
|
|
316
318
|
}
|
|
317
319
|
|
|
318
|
-
const suggestion =
|
|
319
|
-
this.state.selectedSuggestion
|
|
320
|
-
];
|
|
320
|
+
const suggestion =
|
|
321
|
+
this.state.suggestions[ this.state.selectedSuggestion ];
|
|
321
322
|
|
|
322
323
|
switch ( event.keyCode ) {
|
|
323
324
|
case UP: {
|
|
@@ -590,8 +591,8 @@ export default compose(
|
|
|
590
591
|
}
|
|
591
592
|
const { getSettings } = select( blockEditorStore );
|
|
592
593
|
return {
|
|
593
|
-
__experimentalFetchLinkSuggestions:
|
|
594
|
-
.__experimentalFetchLinkSuggestions,
|
|
594
|
+
__experimentalFetchLinkSuggestions:
|
|
595
|
+
getSettings().__experimentalFetchLinkSuggestions,
|
|
595
596
|
};
|
|
596
597
|
} )
|
|
597
598
|
)( URLInput );
|
|
@@ -41,12 +41,10 @@ export default function useBlockDisplayInformation( clientId ) {
|
|
|
41
41
|
return useSelect(
|
|
42
42
|
( select ) => {
|
|
43
43
|
if ( ! clientId ) return null;
|
|
44
|
-
const { getBlockName, getBlockAttributes } =
|
|
45
|
-
blockEditorStore
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
blocksStore
|
|
49
|
-
);
|
|
44
|
+
const { getBlockName, getBlockAttributes } =
|
|
45
|
+
select( blockEditorStore );
|
|
46
|
+
const { getBlockType, getActiveBlockVariation } =
|
|
47
|
+
select( blocksStore );
|
|
50
48
|
const blockName = getBlockName( clientId );
|
|
51
49
|
const blockType = getBlockType( blockName );
|
|
52
50
|
if ( ! blockType ) return null;
|
|
@@ -101,9 +101,8 @@ export default function useBlockDropZone( {
|
|
|
101
101
|
);
|
|
102
102
|
|
|
103
103
|
const { getBlockListSettings } = useSelect( blockEditorStore );
|
|
104
|
-
const { showInsertionPoint, hideInsertionPoint } =
|
|
105
|
-
blockEditorStore
|
|
106
|
-
);
|
|
104
|
+
const { showInsertionPoint, hideInsertionPoint } =
|
|
105
|
+
useDispatch( blockEditorStore );
|
|
107
106
|
|
|
108
107
|
const onBlockDrop = useOnBlockDrop( targetRootClientId, targetBlockIndex );
|
|
109
108
|
const throttled = useThrottle(
|
|
@@ -113,10 +113,8 @@ export default function useBlockDropZone( {
|
|
|
113
113
|
const targetBlockIndex = useSharedValue( null );
|
|
114
114
|
|
|
115
115
|
const { getBlockListSettings, getSettings } = useSelect( blockEditorStore );
|
|
116
|
-
const {
|
|
117
|
-
|
|
118
|
-
getBlockLayoutsOrderedByYCoord,
|
|
119
|
-
} = useBlockListContext();
|
|
116
|
+
const { blocksLayouts, getBlockLayoutsOrderedByYCoord } =
|
|
117
|
+
useBlockListContext();
|
|
120
118
|
|
|
121
119
|
const getSortedBlocksLayouts = useCallback( () => {
|
|
122
120
|
return getBlockLayoutsOrderedByYCoord( blocksLayouts.current );
|
|
@@ -39,30 +39,29 @@ const createMockClassList = ( classes ) => {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const mapElements =
|
|
43
|
-
|
|
44
|
-
index
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
const mapElements =
|
|
43
|
+
( orientation ) =>
|
|
44
|
+
( { top, right, bottom, left }, index ) => {
|
|
45
|
+
return {
|
|
46
|
+
dataset: { block: index + 1 },
|
|
47
|
+
getBoundingClientRect() {
|
|
48
|
+
return orientation === 'vertical'
|
|
49
|
+
? {
|
|
50
|
+
top,
|
|
51
|
+
right,
|
|
52
|
+
bottom,
|
|
53
|
+
left,
|
|
54
|
+
}
|
|
55
|
+
: {
|
|
56
|
+
top: left,
|
|
57
|
+
bottom: right,
|
|
58
|
+
left: top,
|
|
59
|
+
right: bottom,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
classList: createMockClassList( 'wp-block' ),
|
|
63
|
+
};
|
|
64
64
|
};
|
|
65
|
-
};
|
|
66
65
|
|
|
67
66
|
const verticalElements = elementData.map( mapElements( 'vertical' ) );
|
|
68
67
|
// Flip the elementData to make a horizontal block list.
|
|
@@ -14,9 +14,8 @@ export default function useDisplayBlockControls() {
|
|
|
14
14
|
const { isSelected, clientId, name } = useBlockEditContext();
|
|
15
15
|
return useSelect(
|
|
16
16
|
( select ) => {
|
|
17
|
-
const { getBlockName, getBlockRootClientId } =
|
|
18
|
-
blockEditorStore
|
|
19
|
-
);
|
|
17
|
+
const { getBlockName, getBlockRootClientId } =
|
|
18
|
+
select( blockEditorStore );
|
|
20
19
|
|
|
21
20
|
const parentId = getBlockRootClientId( clientId );
|
|
22
21
|
const parentBlockName = getBlockName( parentId );
|
|
@@ -16,9 +16,8 @@ import {
|
|
|
16
16
|
// of calling itself depending on its `uniqueId` attribute.
|
|
17
17
|
function Edit( { attributes: { uniqueId } } ) {
|
|
18
18
|
const { name } = useBlockEditContext();
|
|
19
|
-
const [ hasAlreadyRendered, RecursionProvider ] =
|
|
20
|
-
uniqueId
|
|
21
|
-
);
|
|
19
|
+
const [ hasAlreadyRendered, RecursionProvider ] =
|
|
20
|
+
useNoRecursiveRenders( uniqueId );
|
|
22
21
|
|
|
23
22
|
if ( hasAlreadyRendered ) {
|
|
24
23
|
return <div className={ `wp-block__${ name }--halted` }>Halt</div>;
|
|
@@ -217,11 +217,8 @@ export default function useOnBlockDrop( targetRootClientId, targetBlockIndex ) {
|
|
|
217
217
|
( select ) => select( blockEditorStore ).getSettings().mediaUpload,
|
|
218
218
|
[]
|
|
219
219
|
);
|
|
220
|
-
const {
|
|
221
|
-
|
|
222
|
-
getBlockIndex,
|
|
223
|
-
getClientIdsOfDescendants,
|
|
224
|
-
} = useSelect( blockEditorStore );
|
|
220
|
+
const { canInsertBlockType, getBlockIndex, getClientIdsOfDescendants } =
|
|
221
|
+
useSelect( blockEditorStore );
|
|
225
222
|
const {
|
|
226
223
|
insertBlocks,
|
|
227
224
|
moveBlocksToPosition,
|
|
@@ -100,14 +100,10 @@ export function onBlockDrop(
|
|
|
100
100
|
* @return {Function} The event handler for a block drop event.
|
|
101
101
|
*/
|
|
102
102
|
export default function useOnBlockDrop() {
|
|
103
|
-
const { getBlockIndex, getClientIdsOfDescendants } =
|
|
104
|
-
blockEditorStore
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
insertBlocks,
|
|
108
|
-
moveBlocksToPosition,
|
|
109
|
-
clearSelectedBlock,
|
|
110
|
-
} = useDispatch( blockEditorStore );
|
|
103
|
+
const { getBlockIndex, getClientIdsOfDescendants } =
|
|
104
|
+
useSelect( blockEditorStore );
|
|
105
|
+
const { insertBlocks, moveBlocksToPosition, clearSelectedBlock } =
|
|
106
|
+
useDispatch( blockEditorStore );
|
|
111
107
|
|
|
112
108
|
return onBlockDrop(
|
|
113
109
|
getBlockIndex,
|
|
@@ -128,9 +128,10 @@ export default function useSetting( path ) {
|
|
|
128
128
|
clientId, // The current block is added last, so it overwrites any ancestor.
|
|
129
129
|
];
|
|
130
130
|
candidates.forEach( ( candidateClientId ) => {
|
|
131
|
-
const candidateBlockName =
|
|
132
|
-
blockEditorStore
|
|
133
|
-
|
|
131
|
+
const candidateBlockName =
|
|
132
|
+
select( blockEditorStore ).getBlockName(
|
|
133
|
+
candidateClientId
|
|
134
|
+
);
|
|
134
135
|
if (
|
|
135
136
|
hasBlockSupport(
|
|
136
137
|
candidateBlockName,
|
|
@@ -138,9 +139,10 @@ export default function useSetting( path ) {
|
|
|
138
139
|
false
|
|
139
140
|
)
|
|
140
141
|
) {
|
|
141
|
-
const candidateAtts =
|
|
142
|
-
blockEditorStore
|
|
143
|
-
|
|
142
|
+
const candidateAtts =
|
|
143
|
+
select( blockEditorStore ).getBlockAttributes(
|
|
144
|
+
candidateClientId
|
|
145
|
+
);
|
|
144
146
|
const candidateResult =
|
|
145
147
|
get(
|
|
146
148
|
candidateAtts,
|
|
@@ -12,7 +12,13 @@ describe( 'isNavigationCandidate', () => {
|
|
|
12
12
|
let elements;
|
|
13
13
|
beforeAll( () => {
|
|
14
14
|
elements = {};
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
elements.inputText = document.createElement( 'input' );
|
|
17
|
+
elements.inputText.setAttribute( 'type', 'text' );
|
|
18
|
+
|
|
19
|
+
elements.inputCheckbox = document.createElement( 'input' );
|
|
20
|
+
elements.inputCheckbox.setAttribute( 'type', 'checkbox' );
|
|
21
|
+
|
|
16
22
|
elements.contentEditable = document.createElement( 'p' );
|
|
17
23
|
elements.contentEditable.contentEditable = true;
|
|
18
24
|
} );
|
|
@@ -20,7 +26,7 @@ describe( 'isNavigationCandidate', () => {
|
|
|
20
26
|
it( 'should return true if vertically navigating input without modifier', () => {
|
|
21
27
|
[ UP, DOWN ].forEach( ( keyCode ) => {
|
|
22
28
|
const result = isNavigationCandidate(
|
|
23
|
-
elements.
|
|
29
|
+
elements.inputText,
|
|
24
30
|
keyCode,
|
|
25
31
|
false
|
|
26
32
|
);
|
|
@@ -32,7 +38,7 @@ describe( 'isNavigationCandidate', () => {
|
|
|
32
38
|
it( 'should return false if vertically navigating input with modifier', () => {
|
|
33
39
|
[ UP, DOWN ].forEach( ( keyCode ) => {
|
|
34
40
|
const result = isNavigationCandidate(
|
|
35
|
-
elements.
|
|
41
|
+
elements.inputText,
|
|
36
42
|
keyCode,
|
|
37
43
|
true
|
|
38
44
|
);
|
|
@@ -44,7 +50,7 @@ describe( 'isNavigationCandidate', () => {
|
|
|
44
50
|
it( 'should return false if horizontally navigating input', () => {
|
|
45
51
|
[ LEFT, RIGHT ].forEach( ( keyCode ) => {
|
|
46
52
|
const result = isNavigationCandidate(
|
|
47
|
-
elements.
|
|
53
|
+
elements.inputText,
|
|
48
54
|
keyCode,
|
|
49
55
|
false
|
|
50
56
|
);
|
|
@@ -53,6 +59,18 @@ describe( 'isNavigationCandidate', () => {
|
|
|
53
59
|
} );
|
|
54
60
|
} );
|
|
55
61
|
|
|
62
|
+
it( 'should return true if horizontally navigating simple inputs like checkboxes', () => {
|
|
63
|
+
[ LEFT, RIGHT ].forEach( ( keyCode ) => {
|
|
64
|
+
const result = isNavigationCandidate(
|
|
65
|
+
elements.inputCheckbox,
|
|
66
|
+
keyCode,
|
|
67
|
+
false
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
expect( result ).toBe( true );
|
|
71
|
+
} );
|
|
72
|
+
} );
|
|
73
|
+
|
|
56
74
|
it( 'should return true if horizontally navigating non-input', () => {
|
|
57
75
|
[ LEFT, RIGHT ].forEach( ( keyCode ) => {
|
|
58
76
|
const result = isNavigationCandidate(
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { find, reverse } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -43,9 +38,25 @@ export function isNavigationCandidate( element, keyCode, hasModifier ) {
|
|
|
43
38
|
return true;
|
|
44
39
|
}
|
|
45
40
|
|
|
46
|
-
// Native inputs should not navigate horizontally.
|
|
47
41
|
const { tagName } = element;
|
|
48
|
-
|
|
42
|
+
|
|
43
|
+
// Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys.
|
|
44
|
+
if ( tagName === 'INPUT' ) {
|
|
45
|
+
const simpleInputTypes = [
|
|
46
|
+
'button',
|
|
47
|
+
'checkbox',
|
|
48
|
+
'color',
|
|
49
|
+
'file',
|
|
50
|
+
'image',
|
|
51
|
+
'radio',
|
|
52
|
+
'reset',
|
|
53
|
+
'submit',
|
|
54
|
+
];
|
|
55
|
+
return simpleInputTypes.includes( element.getAttribute( 'type' ) );
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Native textareas should not navigate horizontally.
|
|
59
|
+
return tagName !== 'TEXTAREA';
|
|
49
60
|
}
|
|
50
61
|
|
|
51
62
|
/**
|
|
@@ -73,7 +84,7 @@ export function getClosestTabbable(
|
|
|
73
84
|
let focusableNodes = focus.focusable.find( containerElement );
|
|
74
85
|
|
|
75
86
|
if ( isReverse ) {
|
|
76
|
-
focusableNodes
|
|
87
|
+
focusableNodes.reverse();
|
|
77
88
|
}
|
|
78
89
|
|
|
79
90
|
// Consider as candidates those focusables after the current target. It's
|
|
@@ -114,7 +125,7 @@ export function getClosestTabbable(
|
|
|
114
125
|
return true;
|
|
115
126
|
}
|
|
116
127
|
|
|
117
|
-
return find(
|
|
128
|
+
return focusableNodes.find( isTabCandidate );
|
|
118
129
|
}
|
|
119
130
|
|
|
120
131
|
export default function useArrowNav() {
|
|
@@ -215,7 +226,8 @@ export default function useArrowNav() {
|
|
|
215
226
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
216
227
|
|
|
217
228
|
if ( isShift ) {
|
|
218
|
-
const selectionEndClientId =
|
|
229
|
+
const selectionEndClientId =
|
|
230
|
+
getMultiSelectedBlocksEndClientId();
|
|
219
231
|
const selectionBeforeEndClientId = getPreviousBlockClientId(
|
|
220
232
|
selectionEndClientId || selectedBlockClientId
|
|
221
233
|
);
|
|
@@ -12,11 +12,8 @@ import { getBlockClientId } from '../../utils/dom';
|
|
|
12
12
|
|
|
13
13
|
export default function useClickSelection() {
|
|
14
14
|
const { selectBlock } = useDispatch( blockEditorStore );
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
getBlockSelectionStart,
|
|
18
|
-
hasMultiSelection,
|
|
19
|
-
} = useSelect( blockEditorStore );
|
|
15
|
+
const { isSelectionEnabled, getBlockSelectionStart, hasMultiSelection } =
|
|
16
|
+
useSelect( blockEditorStore );
|
|
20
17
|
return useRefEffect(
|
|
21
18
|
( node ) => {
|
|
22
19
|
function onMouseDown( event ) {
|
|
@@ -25,12 +25,10 @@ function setContentEditableWrapper( node, value ) {
|
|
|
25
25
|
* Sets a multi-selection based on the native selection across blocks.
|
|
26
26
|
*/
|
|
27
27
|
export default function useDragSelection() {
|
|
28
|
-
const { startMultiSelect, stopMultiSelect } =
|
|
29
|
-
blockEditorStore
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
blockEditorStore
|
|
33
|
-
);
|
|
28
|
+
const { startMultiSelect, stopMultiSelect } =
|
|
29
|
+
useDispatch( blockEditorStore );
|
|
30
|
+
const { isSelectionEnabled, hasMultiSelection } =
|
|
31
|
+
useSelect( blockEditorStore );
|
|
34
32
|
return useRefEffect(
|
|
35
33
|
( node ) => {
|
|
36
34
|
const { ownerDocument } = node;
|
|
@@ -61,9 +59,8 @@ export default function useDragSelection() {
|
|
|
61
59
|
const selection = defaultView.getSelection();
|
|
62
60
|
|
|
63
61
|
if ( selection.rangeCount ) {
|
|
64
|
-
const {
|
|
65
|
-
|
|
66
|
-
} = selection.getRangeAt( 0 );
|
|
62
|
+
const { commonAncestorContainer } =
|
|
63
|
+
selection.getRangeAt( 0 );
|
|
67
64
|
|
|
68
65
|
if (
|
|
69
66
|
anchorElement.contains( commonAncestorContainer )
|
|
@@ -74,10 +74,8 @@ export default function useMultiSelection() {
|
|
|
74
74
|
|
|
75
75
|
if ( selection.rangeCount && ! selection.isCollapsed ) {
|
|
76
76
|
const blockNode = selectedRef.current;
|
|
77
|
-
const {
|
|
78
|
-
|
|
79
|
-
endContainer,
|
|
80
|
-
} = selection.getRangeAt( 0 );
|
|
77
|
+
const { startContainer, endContainer } =
|
|
78
|
+
selection.getRangeAt( 0 );
|
|
81
79
|
|
|
82
80
|
if (
|
|
83
81
|
!! blockNode &&
|
|
@@ -17,11 +17,8 @@ import { useRefEffect } from '@wordpress/compose';
|
|
|
17
17
|
import { store as blockEditorStore } from '../../store';
|
|
18
18
|
|
|
19
19
|
export default function useSelectAll() {
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
getSelectedBlockClientIds,
|
|
23
|
-
getBlockRootClientId,
|
|
24
|
-
} = useSelect( blockEditorStore );
|
|
20
|
+
const { getBlockOrder, getSelectedBlockClientIds, getBlockRootClientId } =
|
|
21
|
+
useSelect( blockEditorStore );
|
|
25
22
|
const { multiSelect } = useDispatch( blockEditorStore );
|
|
26
23
|
const isMatch = useShortcutEventMatch();
|
|
27
24
|
|
|
@@ -73,12 +73,10 @@ function setContentEditableWrapper( node, value ) {
|
|
|
73
73
|
* Sets a multi-selection based on the native selection across blocks.
|
|
74
74
|
*/
|
|
75
75
|
export default function useSelectionObserver() {
|
|
76
|
-
const { multiSelect, selectBlock, selectionChange } =
|
|
77
|
-
blockEditorStore
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
blockEditorStore
|
|
81
|
-
);
|
|
76
|
+
const { multiSelect, selectBlock, selectionChange } =
|
|
77
|
+
useDispatch( blockEditorStore );
|
|
78
|
+
const { getBlockParents, getBlockSelectionStart } =
|
|
79
|
+
useSelect( blockEditorStore );
|
|
82
80
|
return useRefEffect(
|
|
83
81
|
( node ) => {
|
|
84
82
|
const { ownerDocument } = node;
|
|
@@ -17,11 +17,8 @@ export default function useTabNav() {
|
|
|
17
17
|
const focusCaptureBeforeRef = useRef();
|
|
18
18
|
const focusCaptureAfterRef = useRef();
|
|
19
19
|
const lastFocus = useRef();
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
getSelectedBlockClientId,
|
|
23
|
-
getBlockCount,
|
|
24
|
-
} = useSelect( blockEditorStore );
|
|
20
|
+
const { hasMultiSelection, getSelectedBlockClientId, getBlockCount } =
|
|
21
|
+
useSelect( blockEditorStore );
|
|
25
22
|
const { setNavigationMode } = useDispatch( blockEditorStore );
|
|
26
23
|
const isNavigationMode = useSelect(
|
|
27
24
|
( select ) => select( blockEditorStore ).isNavigationMode(),
|
package/src/hooks/color-panel.js
CHANGED
|
@@ -43,8 +43,8 @@ export default function ColorPanel( {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
let backgroundColorNode = ref.current;
|
|
46
|
-
let backgroundColor =
|
|
47
|
-
.backgroundColor;
|
|
46
|
+
let backgroundColor =
|
|
47
|
+
getComputedStyle( backgroundColorNode ).backgroundColor;
|
|
48
48
|
while (
|
|
49
49
|
backgroundColor === 'rgba(0, 0, 0, 0)' &&
|
|
50
50
|
backgroundColorNode.parentNode &&
|
|
@@ -52,8 +52,8 @@ export default function ColorPanel( {
|
|
|
52
52
|
backgroundColorNode.parentNode.ELEMENT_NODE
|
|
53
53
|
) {
|
|
54
54
|
backgroundColorNode = backgroundColorNode.parentNode;
|
|
55
|
-
backgroundColor =
|
|
56
|
-
.backgroundColor;
|
|
55
|
+
backgroundColor =
|
|
56
|
+
getComputedStyle( backgroundColorNode ).backgroundColor;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
setDetectedBackgroundColor( backgroundColor );
|
|
@@ -23,8 +23,8 @@ const ColorPanel = ( { settings } ) => {
|
|
|
23
23
|
const { baseGlobalStyles } = useSelect( ( select ) => {
|
|
24
24
|
const { getSettings } = select( blockEditorStore );
|
|
25
25
|
return {
|
|
26
|
-
baseGlobalStyles:
|
|
27
|
-
?.__experimentalGlobalStylesBaseStyles?.color,
|
|
26
|
+
baseGlobalStyles:
|
|
27
|
+
getSettings()?.__experimentalGlobalStylesBaseStyles?.color,
|
|
28
28
|
};
|
|
29
29
|
} );
|
|
30
30
|
|
package/src/hooks/color.js
CHANGED
|
@@ -503,8 +503,8 @@ export function ColorEdit( props ) {
|
|
|
503
503
|
allSolids,
|
|
504
504
|
style?.elements?.link?.color?.text
|
|
505
505
|
),
|
|
506
|
-
clearable:
|
|
507
|
-
?.text,
|
|
506
|
+
clearable:
|
|
507
|
+
!! style?.elements?.link?.color?.text,
|
|
508
508
|
isShownByDefault: defaultColorControls?.link,
|
|
509
509
|
resetAllFilter: resetAllLinkFilter,
|
|
510
510
|
},
|
package/src/hooks/font-family.js
CHANGED
|
@@ -111,8 +111,10 @@ export function FontFamilyEdit( {
|
|
|
111
111
|
} ) {
|
|
112
112
|
const fontFamilies = useSetting( 'typography.fontFamilies' );
|
|
113
113
|
|
|
114
|
-
const value = find(
|
|
115
|
-
|
|
114
|
+
const value = find(
|
|
115
|
+
fontFamilies,
|
|
116
|
+
( { slug } ) => fontFamily === slug
|
|
117
|
+
)?.fontFamily;
|
|
116
118
|
|
|
117
119
|
function onChange( newValue ) {
|
|
118
120
|
const predefinedFontFamily = find(
|
package/src/hooks/gap.js
CHANGED
|
@@ -67,9 +67,8 @@ export function getGapBoxControlValueFromStyle( blockGapValue ) {
|
|
|
67
67
|
* @return {string|null} The concatenated gap value (row and column).
|
|
68
68
|
*/
|
|
69
69
|
export function getGapCSSValue( blockGapValue, defaultValue = '0' ) {
|
|
70
|
-
const blockGapBoxControlValue =
|
|
71
|
-
blockGapValue
|
|
72
|
-
);
|
|
70
|
+
const blockGapBoxControlValue =
|
|
71
|
+
getGapBoxControlValueFromStyle( blockGapValue );
|
|
73
72
|
if ( ! blockGapBoxControlValue ) {
|
|
74
73
|
return null;
|
|
75
74
|
}
|
package/src/hooks/layout.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { has } from 'lodash';
|
|
5
|
+
import { has, kebabCase } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -32,6 +32,49 @@ import { getLayoutType, getLayoutTypes } from '../layouts';
|
|
|
32
32
|
|
|
33
33
|
const layoutBlockSupportKey = '__experimentalLayout';
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Generates the utility classnames for the given blocks layout attributes.
|
|
37
|
+
* This method was primarily added to reintroduce classnames that were removed
|
|
38
|
+
* in the 5.9 release (https://github.com/WordPress/gutenberg/issues/38719), rather
|
|
39
|
+
* than providing an extensive list of all possible layout classes. The plan is to
|
|
40
|
+
* have the style engine generate a more extensive list of utility classnames which
|
|
41
|
+
* will then replace this method.
|
|
42
|
+
*
|
|
43
|
+
* @param { Array } attributes Array of block attributes.
|
|
44
|
+
*
|
|
45
|
+
* @return { Array } Array of CSS classname strings.
|
|
46
|
+
*/
|
|
47
|
+
function getLayoutClasses( attributes ) {
|
|
48
|
+
const layoutClassnames = [];
|
|
49
|
+
|
|
50
|
+
if ( ! attributes.layout ) {
|
|
51
|
+
return layoutClassnames;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if ( attributes?.layout?.orientation ) {
|
|
55
|
+
layoutClassnames.push(
|
|
56
|
+
`is-${ kebabCase( attributes.layout.orientation ) }`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if ( attributes?.layout?.justifyContent ) {
|
|
61
|
+
layoutClassnames.push(
|
|
62
|
+
`is-content-justification-${ kebabCase(
|
|
63
|
+
attributes.layout.justifyContent
|
|
64
|
+
) }`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (
|
|
69
|
+
attributes?.layout?.flexWrap &&
|
|
70
|
+
attributes.layout.flexWrap === 'nowrap'
|
|
71
|
+
) {
|
|
72
|
+
layoutClassnames.push( 'is-nowrap' );
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return layoutClassnames;
|
|
76
|
+
}
|
|
77
|
+
|
|
35
78
|
function LayoutPanel( { setAttributes, attributes, name: blockName } ) {
|
|
36
79
|
const { layout } = attributes;
|
|
37
80
|
const defaultThemeLayout = useSetting( 'layout' );
|
|
@@ -212,9 +255,16 @@ export const withLayoutStyles = createHigherOrderComponent(
|
|
|
212
255
|
const usedLayout = layout?.inherit
|
|
213
256
|
? defaultThemeLayout
|
|
214
257
|
: layout || defaultBlockLayout || {};
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
258
|
+
const layoutClasses = shouldRenderLayoutStyles
|
|
259
|
+
? getLayoutClasses( attributes )
|
|
260
|
+
: null;
|
|
261
|
+
const className = classnames(
|
|
262
|
+
props?.className,
|
|
263
|
+
{
|
|
264
|
+
[ `wp-container-${ id }` ]: shouldRenderLayoutStyles,
|
|
265
|
+
},
|
|
266
|
+
layoutClasses
|
|
267
|
+
);
|
|
218
268
|
|
|
219
269
|
return (
|
|
220
270
|
<>
|