@wordpress/block-editor 9.3.0 → 9.6.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/README.md +1 -8
- package/build/components/block-list/block-invalid-warning.native.js +54 -6
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block.js +2 -2
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +2 -1
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.native.js +4 -3
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/layout.js +20 -5
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-class-names.js +5 -2
- package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build/components/block-lock/modal.js +37 -7
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-mover/mover-description.js +95 -32
- package/build/components/block-mover/mover-description.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +8 -26
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +3 -8
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-popover/inbetween.js +1 -1
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +1 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/auto.js +21 -5
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-settings-menu/block-edit-visually-button.js +70 -0
- package/build/components/block-settings-menu/block-edit-visually-button.js.map +1 -0
- package/build/components/block-settings-menu/block-mode-toggle.js +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +5 -2
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js +6 -2
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +5 -2
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/index.js +7 -1
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-title/index.js +8 -2
- package/build/components/block-title/index.js.map +1 -1
- package/build/components/block-title/use-block-display-title.js +15 -15
- package/build/components/block-title/use-block-display-title.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +1 -7
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +4 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +65 -23
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/border-radius-control/index.js +2 -0
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/colors/with-colors.js +1 -1
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +46 -39
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +7 -3
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/date-format-picker/index.js +1 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/duotone/components.js +145 -0
- package/build/components/duotone/components.js.map +1 -0
- package/build/components/duotone/index.js +40 -0
- package/build/components/duotone/index.js.map +1 -0
- package/build/components/duotone/utils.js +38 -0
- package/build/components/duotone/utils.js.map +1 -0
- package/build/components/duotone-control/index.js +17 -5
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/iframe/index.js +19 -6
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/cropper.js +4 -3
- package/build/components/image-editor/cropper.js.map +1 -1
- package/build/components/image-editor/index.js +3 -1
- package/build/components/image-editor/index.js.map +1 -1
- package/build/components/index.js +14 -0
- package/build/components/index.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +30 -16
- package/build/components/inserter/block-types-tab.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/preview-panel.js +8 -8
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +5 -1
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-results.native.js +5 -2
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inserter/utils.native.js +21 -0
- package/build/components/inserter/utils.native.js.map +1 -1
- package/build/components/inserter-list-item/index.js +5 -1
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/link-control/index.js +1 -1
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +15 -7
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/branch.js +1 -7
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +1 -1
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/media-placeholder/index.js +14 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +4 -4
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +6 -13
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/observe-typing/index.js +22 -8
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +3 -0
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +61 -12
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/index.js +2 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +36 -16
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +4 -13
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +20 -5
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/url-popover/index.js +2 -1
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +34 -2
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js +3 -47
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/components/writing-flow/use-selection-observer.js +1 -3
- package/build/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +1 -1
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/elements/index.js +11 -3
- package/build/elements/index.js.map +1 -1
- package/build/hooks/aria-label.js +71 -0
- package/build/hooks/aria-label.js.map +1 -0
- package/build/hooks/color.js +2 -4
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/duotone.js +33 -160
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +11 -7
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +59 -18
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/style.js +41 -31
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/utils.js +5 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +7 -7
- package/build/index.js.map +1 -1
- package/build/layouts/flex.js +42 -38
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +35 -37
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/utils.js +35 -3
- package/build/layouts/utils.js.map +1 -1
- package/build/store/actions.js +24 -31
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +0 -4
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +23 -12
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +3 -3
- package/build/store/selectors.js.map +1 -1
- package/build/utils/selection.js +34 -0
- package/build/utils/selection.js.map +1 -0
- package/build-module/components/block-list/block-invalid-warning.native.js +50 -6
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block.js +2 -2
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +2 -1
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.native.js +3 -1
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/layout.js +19 -4
- package/build-module/components/block-list/layout.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-class-names.js +5 -2
- package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
- package/build-module/components/block-lock/modal.js +39 -8
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +2 -2
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-mover/mover-description.js +97 -33
- package/build-module/components/block-mover/mover-description.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +9 -27
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +3 -8
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +1 -1
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +1 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +20 -5
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-settings-menu/block-edit-visually-button.js +56 -0
- package/build-module/components/block-settings-menu/block-edit-visually-button.js.map +1 -0
- package/build-module/components/block-settings-menu/block-mode-toggle.js +1 -1
- 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 +6 -5
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +6 -3
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +7 -4
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/index.js +7 -1
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-title/index.js +8 -2
- package/build-module/components/block-title/index.js.map +1 -1
- package/build-module/components/block-title/use-block-display-title.js +15 -14
- package/build-module/components/block-title/use-block-display-title.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +1 -7
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +4 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +67 -25
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +2 -0
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/colors/with-colors.js +2 -2
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +47 -40
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +8 -4
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +1 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/duotone/components.js +130 -0
- package/build-module/components/duotone/components.js.map +1 -0
- package/build-module/components/duotone/index.js +3 -0
- package/build-module/components/duotone/index.js.map +1 -0
- package/build-module/components/duotone/utils.js +30 -0
- package/build-module/components/duotone/utils.js.map +1 -0
- package/build-module/components/duotone-control/index.js +18 -6
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +19 -6
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/cropper.js +4 -3
- package/build-module/components/image-editor/cropper.js.map +1 -1
- package/build-module/components/image-editor/index.js +3 -1
- package/build-module/components/image-editor/index.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/inserter/block-types-tab.native.js +31 -15
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/index.js +3 -2
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +9 -9
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +6 -2
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js +6 -3
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +19 -0
- package/build-module/components/inserter/utils.native.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +4 -1
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/link-control/index.js +1 -1
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +16 -8
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/branch.js +1 -6
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +1 -1
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +14 -2
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +5 -3
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +7 -13
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +22 -8
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +2 -0
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +58 -12
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/index.js +2 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +37 -18
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +3 -11
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +20 -5
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/url-popover/index.js +2 -1
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.js +35 -3
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js +3 -45
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-selection-observer.js +1 -3
- package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/elements/index.js +7 -1
- package/build-module/elements/index.js.map +1 -1
- package/build-module/hooks/aria-label.js +59 -0
- package/build-module/hooks/aria-label.js.map +1 -0
- package/build-module/hooks/color.js +2 -3
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/duotone.js +22 -140
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +2 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +60 -19
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/style.js +44 -35
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/utils.js +5 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/flex.js +43 -35
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +35 -38
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/layouts/utils.js +33 -3
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/store/actions.js +14 -20
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +0 -4
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +23 -11
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +4 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/selection.js +24 -0
- package/build-module/utils/selection.js.map +1 -0
- package/build-style/style-rtl.css +43 -13
- package/build-style/style.css +43 -13
- package/package.json +28 -28
- package/src/components/block-draggable/test/helpers.native.js +3 -3
- package/src/components/block-list/block-invalid-warning.native.js +42 -7
- package/src/components/block-list/block.js +2 -2
- package/src/components/block-list/block.native.js +1 -0
- package/src/components/block-list/index.native.js +1 -1
- package/src/components/block-list/layout.js +15 -3
- package/src/components/block-list/style.scss +2 -2
- package/src/components/block-list/use-block-props/use-block-class-names.js +5 -1
- package/src/components/block-lock/modal.js +47 -9
- package/src/components/block-lock/style.scss +10 -0
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
- package/src/components/block-mover/mover-description.js +131 -48
- package/src/components/block-mover/test/mover-description.js +55 -3
- package/src/components/block-pattern-setup/index.js +5 -25
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -9
- package/src/components/block-pattern-setup/style.scss +4 -2
- package/src/components/block-popover/inbetween.js +1 -1
- package/src/components/block-popover/index.js +1 -1
- package/src/components/block-preview/auto.js +17 -3
- package/src/components/block-settings-menu/block-edit-visually-button.js +52 -0
- package/src/components/block-settings-menu/block-mode-toggle.js +1 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +7 -3
- package/src/components/block-settings-menu/index.js +15 -11
- package/src/components/block-settings-menu-controls/index.js +5 -4
- package/src/components/block-styles/preview.native.js +1 -0
- package/src/components/block-switcher/index.js +7 -1
- package/src/components/block-title/index.js +3 -2
- package/src/components/block-title/use-block-display-title.js +20 -12
- package/src/components/block-tools/block-contextual-toolbar.js +3 -1
- package/src/components/block-tools/block-selection-button.js +0 -5
- package/src/components/block-tools/index.js +4 -1
- package/src/components/block-types-list/index.native.js +76 -24
- package/src/components/block-types-list/style.native.scss +18 -0
- package/src/components/border-radius-control/index.js +2 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -4
- package/src/components/colors/test/__snapshots__/with-colors.js.snap +1 -1
- package/src/components/colors/test/with-colors.js +1 -1
- package/src/components/colors/with-colors.js +2 -2
- package/src/components/colors-gradients/control.js +78 -65
- package/src/components/colors-gradients/dropdown.js +9 -2
- package/src/components/colors-gradients/style.scss +11 -8
- package/src/components/colors-gradients/test/control.js +16 -23
- package/src/components/date-format-picker/index.js +1 -0
- package/src/components/duotone/components.js +133 -0
- package/src/components/duotone/index.js +7 -0
- package/src/components/duotone/utils.js +25 -0
- package/src/components/duotone-control/index.js +12 -7
- package/src/components/duotone-control/style.scss +5 -0
- package/src/components/iframe/index.js +25 -6
- package/src/components/image-editor/cropper.js +9 -3
- package/src/components/image-editor/index.js +2 -0
- package/src/components/index.js +1 -0
- package/src/components/inserter/block-types-tab.native.js +42 -21
- package/src/components/inserter/index.js +3 -5
- package/src/components/inserter/preview-panel.js +6 -14
- package/src/components/inserter/reusable-blocks-tab.native.js +4 -2
- package/src/components/inserter/search-results.native.js +4 -2
- package/src/components/inserter/style.scss +1 -1
- package/src/components/inserter/test/block-types-tab.native.js +2 -0
- package/src/components/inserter/test/utils.native.js +37 -0
- package/src/components/inserter/utils.native.js +11 -0
- package/src/components/inserter-list-item/index.js +4 -1
- package/src/components/link-control/index.js +1 -0
- package/src/components/link-control/test/fixtures/index.js +3 -4
- package/src/components/link-control/test/index.js +64 -73
- package/src/components/list-view/block-select-button.js +29 -14
- package/src/components/list-view/branch.js +1 -6
- package/src/components/list-view/drop-indicator.js +1 -1
- package/src/components/list-view/style.scss +18 -4
- package/src/components/media-placeholder/index.js +20 -0
- package/src/components/media-placeholder/index.native.js +9 -5
- package/src/components/media-replace-flow/index.js +5 -14
- package/src/components/media-replace-flow/test/index.js +14 -4
- package/src/components/media-upload/README.md +8 -0
- package/src/components/observe-typing/index.js +17 -14
- package/src/components/publish-date-time-picker/index.js +2 -0
- package/src/components/responsive-block-control/README.md +3 -1
- package/src/components/responsive-block-control/test/index.js +1 -2
- package/src/components/rich-text/format-toolbar-container.js +63 -14
- package/src/components/rich-text/index.js +1 -0
- package/src/components/rich-text/use-format-types.js +38 -17
- package/src/components/rich-text/use-input-rules.js +6 -15
- package/src/components/rich-text/use-paste-handler.js +17 -5
- package/src/components/url-popover/index.js +1 -0
- package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -0
- package/src/components/writing-flow/use-arrow-nav.js +32 -1
- package/src/components/writing-flow/use-multi-selection.js +1 -48
- package/src/components/writing-flow/use-selection-observer.js +2 -3
- package/src/components/writing-flow/use-tab-nav.js +1 -1
- package/src/elements/index.js +8 -1
- package/src/elements/test/index.js +18 -0
- package/src/hooks/aria-label.js +67 -0
- package/src/hooks/color.js +10 -3
- package/src/hooks/duotone.js +18 -139
- package/src/hooks/index.js +2 -1
- package/src/hooks/layout.js +77 -29
- package/src/hooks/style.js +46 -39
- package/src/hooks/utils.js +7 -3
- package/src/index.js +1 -1
- package/src/layouts/flex.js +49 -43
- package/src/layouts/flow.js +35 -34
- package/src/layouts/test/flex.js +21 -0
- package/src/layouts/test/flow.js +21 -0
- package/src/layouts/test/utils.js +138 -0
- package/src/layouts/utils.js +44 -3
- package/src/store/actions.js +17 -31
- package/src/store/index.js +0 -4
- package/src/store/reducer.js +24 -11
- package/src/store/selectors.js +3 -4
- package/src/store/test/reducer.js +138 -10
- package/src/store/test/selectors.js +3 -6
- package/src/utils/selection.js +26 -0
- package/src/utils/test/selection.js +39 -0
- package/tsconfig.json +2 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A robust way to retain selection position through various
|
|
3
|
+
* transforms is to insert a special character at the position and
|
|
4
|
+
* then recover it.
|
|
5
|
+
*/
|
|
6
|
+
export const START_OF_SELECTED_AREA = '\u0086';
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve the block attribute that contains the selection position.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} blockAttributes Block attributes.
|
|
11
|
+
* @return {string|void} The name of the block attribute that was previously selected.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export function retrieveSelectedAttribute(blockAttributes) {
|
|
15
|
+
if (!blockAttributes) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return Object.keys(blockAttributes).find(name => {
|
|
20
|
+
const value = blockAttributes[name];
|
|
21
|
+
return typeof value === 'string' && value.indexOf(START_OF_SELECTED_AREA) !== -1;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/selection.js"],"names":["START_OF_SELECTED_AREA","retrieveSelectedAttribute","blockAttributes","Object","keys","find","name","value","indexOf"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,sBAAsB,GAAG,QAA/B;AAEP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,yBAAT,CAAoCC,eAApC,EAAsD;AAC5D,MAAK,CAAEA,eAAP,EAAyB;AACxB;AACA;;AAED,SAAOC,MAAM,CAACC,IAAP,CAAaF,eAAb,EAA+BG,IAA/B,CAAuCC,IAAF,IAAY;AACvD,UAAMC,KAAK,GAAGL,eAAe,CAAEI,IAAF,CAA7B;AACA,WACC,OAAOC,KAAP,KAAiB,QAAjB,IACAA,KAAK,CAACC,OAAN,CAAeR,sBAAf,MAA4C,CAAC,CAF9C;AAIA,GANM,CAAP;AAOA","sourcesContent":["/**\n * A robust way to retain selection position through various\n * transforms is to insert a special character at the position and\n * then recover it.\n */\nexport const START_OF_SELECTED_AREA = '\\u0086';\n\n/**\n * Retrieve the block attribute that contains the selection position.\n *\n * @param {Object} blockAttributes Block attributes.\n * @return {string|void} The name of the block attribute that was previously selected.\n */\nexport function retrieveSelectedAttribute( blockAttributes ) {\n\tif ( ! blockAttributes ) {\n\t\treturn;\n\t}\n\n\treturn Object.keys( blockAttributes ).find( ( name ) => {\n\t\tconst value = blockAttributes[ name ];\n\t\treturn (\n\t\t\ttypeof value === 'string' &&\n\t\t\tvalue.indexOf( START_OF_SELECTED_AREA ) !== -1\n\t\t);\n\t} );\n}\n"]}
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
cursor: default;
|
|
178
178
|
}
|
|
179
179
|
.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered::after,
|
|
180
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(
|
|
180
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after,
|
|
181
181
|
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
|
|
182
182
|
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
|
|
183
183
|
position: absolute;
|
|
@@ -193,13 +193,13 @@
|
|
|
193
193
|
outline: 2px solid transparent;
|
|
194
194
|
}
|
|
195
195
|
.is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after, .is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered::after,
|
|
196
|
-
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(
|
|
196
|
+
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after,
|
|
197
197
|
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
|
|
198
198
|
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
|
|
199
199
|
box-shadow: 0 0 0 1px #fff;
|
|
200
200
|
}
|
|
201
201
|
.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected .components-placeholder ::selection, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered .components-placeholder ::selection,
|
|
202
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(
|
|
202
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .components-placeholder ::selection,
|
|
203
203
|
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .components-placeholder ::selection,
|
|
204
204
|
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .components-placeholder ::selection {
|
|
205
205
|
background: transparent;
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
|
|
371
|
-
opacity: 0.
|
|
371
|
+
opacity: 0.2;
|
|
372
372
|
transition: opacity 0.1s linear;
|
|
373
373
|
}
|
|
374
374
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -709,6 +709,15 @@
|
|
|
709
709
|
border-radius: 2px;
|
|
710
710
|
}
|
|
711
711
|
|
|
712
|
+
.block-editor-block-lock-modal__template-lock {
|
|
713
|
+
border-top: 1px solid #ddd;
|
|
714
|
+
margin-top: 16px;
|
|
715
|
+
padding: 12px 0;
|
|
716
|
+
}
|
|
717
|
+
.block-editor-block-lock-modal__template-lock .components-base-control__field {
|
|
718
|
+
margin: 0;
|
|
719
|
+
}
|
|
720
|
+
|
|
712
721
|
.block-editor-block-lock-modal__actions {
|
|
713
722
|
margin-top: 24px;
|
|
714
723
|
}
|
|
@@ -1434,6 +1443,8 @@
|
|
|
1434
1443
|
display: block;
|
|
1435
1444
|
width: 100%;
|
|
1436
1445
|
padding: 32px;
|
|
1446
|
+
padding-bottom: 0;
|
|
1447
|
+
padding-top: 0;
|
|
1437
1448
|
column-count: 2;
|
|
1438
1449
|
}
|
|
1439
1450
|
@media (min-width: 1440px) {
|
|
@@ -1465,7 +1476,8 @@
|
|
|
1465
1476
|
text-align: right;
|
|
1466
1477
|
margin: 0;
|
|
1467
1478
|
color: #1e1e1e;
|
|
1468
|
-
|
|
1479
|
+
position: absolute;
|
|
1480
|
+
bottom: 0;
|
|
1469
1481
|
background-color: #fff;
|
|
1470
1482
|
display: flex;
|
|
1471
1483
|
flex-direction: row;
|
|
@@ -1531,7 +1543,6 @@
|
|
|
1531
1543
|
.block-editor-block-pattern-setup__carousel,
|
|
1532
1544
|
.block-editor-block-pattern-setup__grid {
|
|
1533
1545
|
width: 100%;
|
|
1534
|
-
overflow-y: auto;
|
|
1535
1546
|
}
|
|
1536
1547
|
|
|
1537
1548
|
.block-editor-block-variation-transforms {
|
|
@@ -1669,8 +1680,8 @@
|
|
|
1669
1680
|
margin-bottom: inherit;
|
|
1670
1681
|
}
|
|
1671
1682
|
|
|
1672
|
-
.block-editor-panel-color-gradient-settings__dropdown-content
|
|
1673
|
-
width:
|
|
1683
|
+
.block-editor-panel-color-gradient-settings__dropdown-content {
|
|
1684
|
+
width: 228px;
|
|
1674
1685
|
}
|
|
1675
1686
|
|
|
1676
1687
|
.block-editor-panel-color-gradient-settings__color-indicator {
|
|
@@ -1721,6 +1732,10 @@
|
|
|
1721
1732
|
width: 100%;
|
|
1722
1733
|
}
|
|
1723
1734
|
|
|
1735
|
+
.block-editor-color-gradient-control__tab-panel {
|
|
1736
|
+
padding-top: 8px;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1724
1739
|
.block-editor-contrast-checker > .components-notice {
|
|
1725
1740
|
margin: 0;
|
|
1726
1741
|
}
|
|
@@ -1868,6 +1883,10 @@
|
|
|
1868
1883
|
font-size: 12px;
|
|
1869
1884
|
}
|
|
1870
1885
|
|
|
1886
|
+
.block-editor-duotone-control__unset-indicator {
|
|
1887
|
+
background: linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1871
1890
|
.components-font-appearance-control {
|
|
1872
1891
|
margin-bottom: 24px;
|
|
1873
1892
|
}
|
|
@@ -2544,7 +2563,7 @@
|
|
|
2544
2563
|
align-items: center;
|
|
2545
2564
|
width: 100%;
|
|
2546
2565
|
height: auto;
|
|
2547
|
-
padding: 6px 0 6px
|
|
2566
|
+
padding: 6px 0 6px 4px;
|
|
2548
2567
|
text-align: right;
|
|
2549
2568
|
color: #1e1e1e;
|
|
2550
2569
|
border-radius: 2px;
|
|
@@ -2662,7 +2681,7 @@
|
|
|
2662
2681
|
padding: 0;
|
|
2663
2682
|
}
|
|
2664
2683
|
.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell {
|
|
2665
|
-
padding-left:
|
|
2684
|
+
padding-left: 4px;
|
|
2666
2685
|
}
|
|
2667
2686
|
.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell .components-button.has-icon {
|
|
2668
2687
|
height: 24px;
|
|
@@ -2736,13 +2755,24 @@
|
|
|
2736
2755
|
.block-editor-list-view-leaf .block-editor-inserter__toggle:active {
|
|
2737
2756
|
color: #fff;
|
|
2738
2757
|
}
|
|
2758
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__label-wrapper {
|
|
2759
|
+
min-width: 120px;
|
|
2760
|
+
}
|
|
2761
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__title {
|
|
2762
|
+
flex: 1;
|
|
2763
|
+
position: relative;
|
|
2764
|
+
}
|
|
2765
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__title .components-truncate {
|
|
2766
|
+
position: absolute;
|
|
2767
|
+
width: 100%;
|
|
2768
|
+
transform: translateY(-50%);
|
|
2769
|
+
}
|
|
2739
2770
|
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__anchor {
|
|
2740
2771
|
background: rgba(0, 0, 0, 0.1);
|
|
2741
2772
|
border-radius: 2px;
|
|
2742
2773
|
display: inline-block;
|
|
2743
2774
|
padding: 2px 6px;
|
|
2744
|
-
|
|
2745
|
-
max-width: 120px;
|
|
2775
|
+
max-width: min(100px, 40%);
|
|
2746
2776
|
overflow: hidden;
|
|
2747
2777
|
text-overflow: ellipsis;
|
|
2748
2778
|
}
|
|
@@ -4063,7 +4093,7 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
4063
4093
|
|
|
4064
4094
|
.block-editor-block-patterns-explorer__sidebar {
|
|
4065
4095
|
position: absolute;
|
|
4066
|
-
top:
|
|
4096
|
+
top: 76px;
|
|
4067
4097
|
right: 0;
|
|
4068
4098
|
bottom: 0;
|
|
4069
4099
|
width: 280px;
|
package/build-style/style.css
CHANGED
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
cursor: default;
|
|
178
178
|
}
|
|
179
179
|
.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered::after,
|
|
180
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(
|
|
180
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after,
|
|
181
181
|
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
|
|
182
182
|
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
|
|
183
183
|
position: absolute;
|
|
@@ -193,13 +193,13 @@
|
|
|
193
193
|
outline: 2px solid transparent;
|
|
194
194
|
}
|
|
195
195
|
.is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after, .is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered::after,
|
|
196
|
-
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(
|
|
196
|
+
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after,
|
|
197
197
|
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
|
|
198
198
|
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
|
|
199
199
|
box-shadow: 0 0 0 1px #fff;
|
|
200
200
|
}
|
|
201
201
|
.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected .components-placeholder ::selection, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered .components-placeholder ::selection,
|
|
202
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(
|
|
202
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .components-placeholder ::selection,
|
|
203
203
|
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .components-placeholder ::selection,
|
|
204
204
|
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .components-placeholder ::selection {
|
|
205
205
|
background: transparent;
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
|
|
371
|
-
opacity: 0.
|
|
371
|
+
opacity: 0.2;
|
|
372
372
|
transition: opacity 0.1s linear;
|
|
373
373
|
}
|
|
374
374
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -709,6 +709,15 @@
|
|
|
709
709
|
border-radius: 2px;
|
|
710
710
|
}
|
|
711
711
|
|
|
712
|
+
.block-editor-block-lock-modal__template-lock {
|
|
713
|
+
border-top: 1px solid #ddd;
|
|
714
|
+
margin-top: 16px;
|
|
715
|
+
padding: 12px 0;
|
|
716
|
+
}
|
|
717
|
+
.block-editor-block-lock-modal__template-lock .components-base-control__field {
|
|
718
|
+
margin: 0;
|
|
719
|
+
}
|
|
720
|
+
|
|
712
721
|
.block-editor-block-lock-modal__actions {
|
|
713
722
|
margin-top: 24px;
|
|
714
723
|
}
|
|
@@ -1434,6 +1443,8 @@
|
|
|
1434
1443
|
display: block;
|
|
1435
1444
|
width: 100%;
|
|
1436
1445
|
padding: 32px;
|
|
1446
|
+
padding-bottom: 0;
|
|
1447
|
+
padding-top: 0;
|
|
1437
1448
|
column-count: 2;
|
|
1438
1449
|
}
|
|
1439
1450
|
@media (min-width: 1440px) {
|
|
@@ -1465,7 +1476,8 @@
|
|
|
1465
1476
|
text-align: left;
|
|
1466
1477
|
margin: 0;
|
|
1467
1478
|
color: #1e1e1e;
|
|
1468
|
-
|
|
1479
|
+
position: absolute;
|
|
1480
|
+
bottom: 0;
|
|
1469
1481
|
background-color: #fff;
|
|
1470
1482
|
display: flex;
|
|
1471
1483
|
flex-direction: row;
|
|
@@ -1531,7 +1543,6 @@
|
|
|
1531
1543
|
.block-editor-block-pattern-setup__carousel,
|
|
1532
1544
|
.block-editor-block-pattern-setup__grid {
|
|
1533
1545
|
width: 100%;
|
|
1534
|
-
overflow-y: auto;
|
|
1535
1546
|
}
|
|
1536
1547
|
|
|
1537
1548
|
.block-editor-block-variation-transforms {
|
|
@@ -1669,8 +1680,8 @@
|
|
|
1669
1680
|
margin-bottom: inherit;
|
|
1670
1681
|
}
|
|
1671
1682
|
|
|
1672
|
-
.block-editor-panel-color-gradient-settings__dropdown-content
|
|
1673
|
-
width:
|
|
1683
|
+
.block-editor-panel-color-gradient-settings__dropdown-content {
|
|
1684
|
+
width: 228px;
|
|
1674
1685
|
}
|
|
1675
1686
|
|
|
1676
1687
|
.block-editor-panel-color-gradient-settings__color-indicator {
|
|
@@ -1721,6 +1732,10 @@
|
|
|
1721
1732
|
width: 100%;
|
|
1722
1733
|
}
|
|
1723
1734
|
|
|
1735
|
+
.block-editor-color-gradient-control__tab-panel {
|
|
1736
|
+
padding-top: 8px;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1724
1739
|
.block-editor-contrast-checker > .components-notice {
|
|
1725
1740
|
margin: 0;
|
|
1726
1741
|
}
|
|
@@ -1868,6 +1883,10 @@
|
|
|
1868
1883
|
font-size: 12px;
|
|
1869
1884
|
}
|
|
1870
1885
|
|
|
1886
|
+
.block-editor-duotone-control__unset-indicator {
|
|
1887
|
+
background: linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1871
1890
|
.components-font-appearance-control {
|
|
1872
1891
|
margin-bottom: 24px;
|
|
1873
1892
|
}
|
|
@@ -2544,7 +2563,7 @@
|
|
|
2544
2563
|
align-items: center;
|
|
2545
2564
|
width: 100%;
|
|
2546
2565
|
height: auto;
|
|
2547
|
-
padding: 6px
|
|
2566
|
+
padding: 6px 4px 6px 0;
|
|
2548
2567
|
text-align: left;
|
|
2549
2568
|
color: #1e1e1e;
|
|
2550
2569
|
border-radius: 2px;
|
|
@@ -2662,7 +2681,7 @@
|
|
|
2662
2681
|
padding: 0;
|
|
2663
2682
|
}
|
|
2664
2683
|
.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell {
|
|
2665
|
-
padding-right:
|
|
2684
|
+
padding-right: 4px;
|
|
2666
2685
|
}
|
|
2667
2686
|
.block-editor-list-view-leaf .block-editor-list-view-block__menu-cell .components-button.has-icon {
|
|
2668
2687
|
height: 24px;
|
|
@@ -2736,13 +2755,24 @@
|
|
|
2736
2755
|
.block-editor-list-view-leaf .block-editor-inserter__toggle:active {
|
|
2737
2756
|
color: #fff;
|
|
2738
2757
|
}
|
|
2758
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__label-wrapper {
|
|
2759
|
+
min-width: 120px;
|
|
2760
|
+
}
|
|
2761
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__title {
|
|
2762
|
+
flex: 1;
|
|
2763
|
+
position: relative;
|
|
2764
|
+
}
|
|
2765
|
+
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__title .components-truncate {
|
|
2766
|
+
position: absolute;
|
|
2767
|
+
width: 100%;
|
|
2768
|
+
transform: translateY(-50%);
|
|
2769
|
+
}
|
|
2739
2770
|
.block-editor-list-view-leaf .block-editor-list-view-block-select-button__anchor {
|
|
2740
2771
|
background: rgba(0, 0, 0, 0.1);
|
|
2741
2772
|
border-radius: 2px;
|
|
2742
2773
|
display: inline-block;
|
|
2743
2774
|
padding: 2px 6px;
|
|
2744
|
-
|
|
2745
|
-
max-width: 120px;
|
|
2775
|
+
max-width: min(100px, 40%);
|
|
2746
2776
|
overflow: hidden;
|
|
2747
2777
|
text-overflow: ellipsis;
|
|
2748
2778
|
}
|
|
@@ -4063,7 +4093,7 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
|
|
|
4063
4093
|
|
|
4064
4094
|
.block-editor-block-patterns-explorer__sidebar {
|
|
4065
4095
|
position: absolute;
|
|
4066
|
-
top:
|
|
4096
|
+
top: 76px;
|
|
4067
4097
|
left: 0;
|
|
4068
4098
|
bottom: 0;
|
|
4069
4099
|
width: 280px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,32 +33,32 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.16.0",
|
|
35
35
|
"@react-spring/web": "^9.4.5",
|
|
36
|
-
"@wordpress/a11y": "^3.
|
|
37
|
-
"@wordpress/api-fetch": "^6.
|
|
38
|
-
"@wordpress/blob": "^3.
|
|
39
|
-
"@wordpress/blocks": "^11.
|
|
40
|
-
"@wordpress/components": "^19.
|
|
41
|
-
"@wordpress/compose": "^5.
|
|
42
|
-
"@wordpress/data": "^6.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^4.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^3.
|
|
53
|
-
"@wordpress/keycodes": "^3.
|
|
54
|
-
"@wordpress/notices": "^3.
|
|
55
|
-
"@wordpress/rich-text": "^5.
|
|
56
|
-
"@wordpress/shortcode": "^3.
|
|
57
|
-
"@wordpress/style-engine": "^0.
|
|
58
|
-
"@wordpress/token-list": "^2.
|
|
59
|
-
"@wordpress/url": "^3.
|
|
60
|
-
"@wordpress/warning": "^2.
|
|
61
|
-
"@wordpress/wordcount": "^3.
|
|
36
|
+
"@wordpress/a11y": "^3.14.0",
|
|
37
|
+
"@wordpress/api-fetch": "^6.11.0",
|
|
38
|
+
"@wordpress/blob": "^3.14.0",
|
|
39
|
+
"@wordpress/blocks": "^11.13.0",
|
|
40
|
+
"@wordpress/components": "^19.16.0",
|
|
41
|
+
"@wordpress/compose": "^5.12.0",
|
|
42
|
+
"@wordpress/data": "^6.14.0",
|
|
43
|
+
"@wordpress/date": "^4.14.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.14.0",
|
|
45
|
+
"@wordpress/dom": "^3.14.0",
|
|
46
|
+
"@wordpress/element": "^4.12.0",
|
|
47
|
+
"@wordpress/hooks": "^3.14.0",
|
|
48
|
+
"@wordpress/html-entities": "^3.14.0",
|
|
49
|
+
"@wordpress/i18n": "^4.14.0",
|
|
50
|
+
"@wordpress/icons": "^9.5.0",
|
|
51
|
+
"@wordpress/is-shallow-equal": "^4.14.0",
|
|
52
|
+
"@wordpress/keyboard-shortcuts": "^3.12.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.14.0",
|
|
54
|
+
"@wordpress/notices": "^3.14.0",
|
|
55
|
+
"@wordpress/rich-text": "^5.12.0",
|
|
56
|
+
"@wordpress/shortcode": "^3.14.0",
|
|
57
|
+
"@wordpress/style-engine": "^0.13.0",
|
|
58
|
+
"@wordpress/token-list": "^2.14.0",
|
|
59
|
+
"@wordpress/url": "^3.15.0",
|
|
60
|
+
"@wordpress/warning": "^2.14.0",
|
|
61
|
+
"@wordpress/wordcount": "^3.14.0",
|
|
62
62
|
"classnames": "^2.3.1",
|
|
63
63
|
"colord": "^2.7.0",
|
|
64
64
|
"diff": "^4.0.2",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "0315dbc240cb2aa146d7c1bafd251f004b88300e"
|
|
81
81
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
initializeEditor,
|
|
8
8
|
waitForStoreResolvers,
|
|
9
9
|
within,
|
|
10
|
-
|
|
10
|
+
advanceAnimationByFrames,
|
|
11
11
|
} from 'test/helpers';
|
|
12
12
|
import { fireGestureHandler } from 'react-native-gesture-handler/jest-utils';
|
|
13
13
|
import { State } from 'react-native-gesture-handler';
|
|
@@ -135,7 +135,7 @@ export const fireLongPress = (
|
|
|
135
135
|
}
|
|
136
136
|
// Advance timers one frame to ensure that shared values
|
|
137
137
|
// are updated and trigger animation reactions.
|
|
138
|
-
act( () =>
|
|
138
|
+
act( () => advanceAnimationByFrames( 1 ) );
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
/**
|
|
@@ -162,7 +162,7 @@ export const firePanGesture = (
|
|
|
162
162
|
] );
|
|
163
163
|
// Advance timers one frame to ensure that shared values
|
|
164
164
|
// are updated and trigger animation reactions.
|
|
165
|
-
act( () =>
|
|
165
|
+
act( () => advanceAnimationByFrames( 1 ) );
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
/**
|
|
@@ -1,27 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { TouchableWithoutFeedback } from 'react-native';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
9
|
import { __, sprintf } from '@wordpress/i18n';
|
|
10
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
|
+
import { createBlock } from '@wordpress/blocks';
|
|
5
12
|
|
|
6
13
|
/**
|
|
7
14
|
* Internal dependencies
|
|
8
15
|
*/
|
|
9
16
|
import Warning from '../warning';
|
|
17
|
+
import { store as blockEditorStore } from '../../store';
|
|
10
18
|
|
|
11
|
-
export default function BlockInvalidWarning( { blockTitle, icon } ) {
|
|
19
|
+
export default function BlockInvalidWarning( { blockTitle, icon, clientId } ) {
|
|
12
20
|
const accessibilityLabel = sprintf(
|
|
13
21
|
/* translators: accessibility text for blocks with invalid content. %d: localized block title */
|
|
14
22
|
__( '%s block. This block has invalid content' ),
|
|
15
23
|
blockTitle
|
|
16
24
|
);
|
|
17
25
|
|
|
26
|
+
const selector = ( select ) => {
|
|
27
|
+
const { getBlock } = select( blockEditorStore );
|
|
28
|
+
const block = getBlock( clientId );
|
|
29
|
+
return {
|
|
30
|
+
block,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const { block } = useSelect( selector, [ clientId ] );
|
|
35
|
+
|
|
36
|
+
const { replaceBlock } = useDispatch( blockEditorStore );
|
|
37
|
+
|
|
38
|
+
const recoverBlock = ( { name, attributes, innerBlocks } ) =>
|
|
39
|
+
createBlock( name, attributes, innerBlocks );
|
|
40
|
+
|
|
41
|
+
const attemptBlockRecovery = () => {
|
|
42
|
+
replaceBlock( block.clientId, recoverBlock( block ) );
|
|
43
|
+
};
|
|
44
|
+
|
|
18
45
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
message={ __( 'Problem displaying block' ) }
|
|
22
|
-
icon={ icon }
|
|
46
|
+
<TouchableWithoutFeedback
|
|
47
|
+
onPress={ attemptBlockRecovery }
|
|
23
48
|
accessible={ true }
|
|
24
|
-
|
|
25
|
-
|
|
49
|
+
accessibilityRole={ 'button' }
|
|
50
|
+
>
|
|
51
|
+
<Warning
|
|
52
|
+
title={ blockTitle }
|
|
53
|
+
// eslint-disable-next-line @wordpress/i18n-no-collapsible-whitespace
|
|
54
|
+
message={ __(
|
|
55
|
+
'Problem displaying block. \nTap to attempt block recovery.'
|
|
56
|
+
) }
|
|
57
|
+
icon={ icon }
|
|
58
|
+
accessibilityLabel={ accessibilityLabel }
|
|
59
|
+
/>
|
|
60
|
+
</TouchableWithoutFeedback>
|
|
26
61
|
);
|
|
27
62
|
}
|
|
@@ -56,10 +56,10 @@ function mergeWrapperProps( propsA, propsB ) {
|
|
|
56
56
|
...propsB,
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
if ( propsA
|
|
59
|
+
if ( propsA?.className && propsB?.className ) {
|
|
60
60
|
newProps.className = classnames( propsA.className, propsB.className );
|
|
61
61
|
}
|
|
62
|
-
if ( propsA
|
|
62
|
+
if ( propsA?.style && propsB?.style ) {
|
|
63
63
|
newProps.style = { ...propsA.style, ...propsB.style };
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { identity } from 'lodash';
|
|
5
4
|
import { View, Platform, TouchableWithoutFeedback } from 'react-native';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -35,6 +34,7 @@ import { BlockDraggableWrapper } from '../block-draggable';
|
|
|
35
34
|
import { store as blockEditorStore } from '../../store';
|
|
36
35
|
|
|
37
36
|
export const OnCaretVerticalPositionChange = createContext();
|
|
37
|
+
const identity = ( x ) => x;
|
|
38
38
|
|
|
39
39
|
const stylesMemo = {};
|
|
40
40
|
const getStyles = (
|
|
@@ -7,6 +7,7 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { getLayoutType } from '../../layouts';
|
|
10
|
+
import useSetting from '../use-setting';
|
|
10
11
|
|
|
11
12
|
export const defaultLayout = { type: 'default' };
|
|
12
13
|
|
|
@@ -24,12 +25,23 @@ export function useLayout() {
|
|
|
24
25
|
return useContext( Layout );
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
export function LayoutStyle( { layout = {}, ...props } ) {
|
|
28
|
+
export function LayoutStyle( { layout = {}, css, ...props } ) {
|
|
28
29
|
const layoutType = getLayoutType( layout.type );
|
|
30
|
+
const blockGapSupport = useSetting( 'spacing.blockGap' );
|
|
31
|
+
const hasBlockGapSupport = blockGapSupport !== null;
|
|
29
32
|
|
|
30
33
|
if ( layoutType ) {
|
|
31
|
-
|
|
34
|
+
if ( css ) {
|
|
35
|
+
return <style>{ css }</style>;
|
|
36
|
+
}
|
|
37
|
+
const layoutStyle = layoutType.getLayoutStyle?.( {
|
|
38
|
+
hasBlockGapSupport,
|
|
39
|
+
layout,
|
|
40
|
+
...props,
|
|
41
|
+
} );
|
|
42
|
+
if ( layoutStyle ) {
|
|
43
|
+
return <style>{ layoutStyle }</style>;
|
|
44
|
+
}
|
|
32
45
|
}
|
|
33
|
-
|
|
34
46
|
return null;
|
|
35
47
|
}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
// When selecting multiple blocks, we provide an additional selection indicator.
|
|
27
27
|
&.is-navigate-mode .block-editor-block-list__block.is-selected,
|
|
28
28
|
&.is-navigate-mode .block-editor-block-list__block.is-hovered,
|
|
29
|
-
.block-editor-block-list__block.is-multi-selected:not(
|
|
29
|
+
.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected),
|
|
30
30
|
.block-editor-block-list__block.is-highlighted,
|
|
31
31
|
.block-editor-block-list__block.is-highlighted ~ .is-multi-selected {
|
|
32
32
|
&::after {
|
|
@@ -293,7 +293,7 @@
|
|
|
293
293
|
|
|
294
294
|
// Spotlight mode. Fade out blocks unless they contain a selected block.
|
|
295
295
|
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
|
|
296
|
-
opacity: 0.
|
|
296
|
+
opacity: 0.2;
|
|
297
297
|
transition: opacity 0.1s linear;
|
|
298
298
|
@include reduce-motion("transition");
|
|
299
299
|
|
|
@@ -33,6 +33,7 @@ export function useBlockClassNames( clientId ) {
|
|
|
33
33
|
getSettings,
|
|
34
34
|
hasSelectedInnerBlock,
|
|
35
35
|
isTyping,
|
|
36
|
+
__unstableIsFullySelected,
|
|
36
37
|
} = select( blockEditorStore );
|
|
37
38
|
const { outlineMode } = getSettings();
|
|
38
39
|
const isDragging = isBlockBeingDragged( clientId );
|
|
@@ -44,10 +45,13 @@ export function useBlockClassNames( clientId ) {
|
|
|
44
45
|
clientId,
|
|
45
46
|
checkDeep
|
|
46
47
|
);
|
|
48
|
+
const isMultiSelected = isBlockMultiSelected( clientId );
|
|
47
49
|
return classnames( {
|
|
48
50
|
'is-selected': isSelected,
|
|
49
51
|
'is-highlighted': isBlockHighlighted( clientId ),
|
|
50
|
-
'is-multi-selected':
|
|
52
|
+
'is-multi-selected': isMultiSelected,
|
|
53
|
+
'is-partially-selected':
|
|
54
|
+
isMultiSelected && ! __unstableIsFullySelected(),
|
|
51
55
|
'is-reusable': isReusableBlock( getBlockType( name ) ),
|
|
52
56
|
'is-dragging': isDragging,
|
|
53
57
|
'has-child-selected': isAncestorOfSelectedBlock,
|