@wordpress/block-editor 11.1.0 → 11.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 +12 -0
- package/LICENSE.md +1 -1
- package/README.md +28 -4
- package/build/components/alignment-control/ui.js +1 -1
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/autocomplete/index.js +2 -7
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-actions/index.js +9 -0
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +2 -2
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-card/index.js +2 -4
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-edit/index.js +8 -0
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-inspector/index.js +18 -15
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +5 -0
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-lock/modal.js +0 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-mover/mover-description.js +2 -2
- package/build/components/block-mover/mover-description.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +3 -1
- package/build/components/block-navigation/dropdown.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-pattern-setup/use-patterns-setup.js +2 -2
- package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build/components/block-patterns-list/index.js +31 -3
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-preview/auto.js +9 -14
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +32 -8
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-selection-clearer/index.js +1 -1
- package/build/components/block-selection-clearer/index.js.map +1 -1
- package/build/components/block-settings/container.native.js +7 -33
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +12 -3
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +2 -8
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +3 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-switcher/utils.js +1 -1
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +55 -47
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +43 -10
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-vertical-alignment-control/icons.js +15 -1
- package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +9 -4
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/color-style-selector/index.js +3 -1
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +3 -4
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/default-style-picker/index.js +1 -0
- package/build/components/default-style-picker/index.js.map +1 -1
- package/build/components/font-family/index.js +1 -7
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +1 -1
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/utils.js +1 -1
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +5 -8
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/context.js +22 -0
- package/build/components/global-styles/context.js.map +1 -0
- package/build/components/global-styles/hooks.js +142 -0
- package/build/components/global-styles/hooks.js.map +1 -0
- package/build/components/global-styles/index.js +42 -0
- package/build/components/global-styles/index.js.map +1 -0
- package/build/components/global-styles/typography-utils.js +92 -0
- package/build/components/global-styles/typography-utils.js.map +1 -0
- package/build/components/global-styles/use-global-styles-output.js +974 -0
- package/build/components/global-styles/use-global-styles-output.js.map +1 -0
- package/build/components/global-styles/utils.js +340 -0
- package/build/components/global-styles/utils.js.map +1 -0
- package/build/components/height-control/index.js +13 -1
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/iframe/index.js +37 -8
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-compatibility-styles.js +6 -1
- package/build/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build/components/image-editor/constants.js +1 -1
- package/build/components/image-editor/constants.js.map +1 -1
- package/build/components/image-editor/context.js +1 -2
- package/build/components/image-editor/context.js.map +1 -1
- package/build/components/image-editor/cropper.js +3 -1
- package/build/components/image-editor/cropper.js.map +1 -1
- package/build/components/image-editor/index.js +13 -9
- package/build/components/image-editor/index.js.map +1 -1
- package/build/components/image-editor/use-transform-image.js +11 -35
- package/build/components/image-editor/use-transform-image.js.map +1 -1
- package/build/components/image-size-control/index.js +2 -7
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.js +8 -24
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +22 -32
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +8 -23
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-block-context.js +53 -0
- package/build/components/inner-blocks/use-block-context.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/explorer.js +0 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +11 -5
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +2 -2
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -7
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +8 -6
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +142 -56
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +74 -21
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +11 -13
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +6 -3
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/media-tab/utils.js +26 -15
- package/build/components/inserter/media-tab/utils.js.map +1 -1
- package/build/components/inserter/menu.js +12 -5
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/preview-panel.js +5 -3
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/search-results.js +2 -7
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter-list-item/index.js +1 -9
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inspector-controls/fill.js +15 -2
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +14 -1
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/groups.js +7 -1
- package/build/components/inspector-controls/groups.js.map +1 -1
- package/build/components/inspector-controls/index.js +2 -2
- package/build/components/inspector-controls/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +14 -1
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js +14 -1
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
- package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +2 -2
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +46 -0
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -0
- package/build/components/inspector-controls-tabs/settings-tab.js +3 -1
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +6 -4
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +20 -22
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/justify-content-control/ui.js +8 -1
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/link-control/index.js +45 -17
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +1 -0
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block.js +1 -1
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/media-upload/index.native.js +4 -1
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/off-canvas-editor/appender.js +49 -38
- package/build/components/off-canvas-editor/appender.js.map +1 -1
- package/build/components/off-canvas-editor/block-contents.js +38 -5
- package/build/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build/components/off-canvas-editor/block-select-button.js +10 -4
- package/build/components/off-canvas-editor/block-select-button.js.map +1 -1
- package/build/components/off-canvas-editor/block.js +13 -52
- package/build/components/off-canvas-editor/block.js.map +1 -1
- package/build/components/off-canvas-editor/branch.js +25 -10
- package/build/components/off-canvas-editor/branch.js.map +1 -1
- package/build/components/off-canvas-editor/index.js +15 -17
- package/build/components/off-canvas-editor/index.js.map +1 -1
- package/build/components/off-canvas-editor/link-ui.js +2 -2
- package/build/components/off-canvas-editor/link-ui.js.map +1 -1
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
- package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -1
- package/build/components/provider/index.js +22 -8
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +5 -6
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/rich-text/use-before-input-rules.js +11 -3
- package/build/components/rich-text/use-before-input-rules.js.map +1 -1
- package/build/components/rich-text/use-enter.js +4 -5
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/components/rich-text/utils.js +1 -1
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +2 -8
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/tool-selector/index.js +3 -1
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/url-input/button.js +1 -0
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +15 -1
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +7 -8
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/link-editor.js +1 -0
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/use-block-display-information/index.js +1 -1
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-paste-styles/index.js +188 -0
- package/build/components/use-paste-styles/index.js.map +1 -0
- package/build/components/writing-flow/use-arrow-nav.js +22 -29
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/experiments.js +45 -0
- package/build/experiments.js.map +1 -0
- package/build/experiments.native.js +40 -0
- package/build/experiments.native.js.map +1 -0
- package/build/hooks/anchor.js +2 -1
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border.js +1 -1
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/child-layout.js +5 -1
- package/build/hooks/child-layout.js.map +1 -1
- package/build/hooks/color-panel.js +1 -1
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +3 -3
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/custom-class-name.js +2 -1
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/dimensions.js +7 -5
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/margin.js +1 -0
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/metadata.js +1 -1
- package/build/hooks/metadata.js.map +1 -1
- package/build/hooks/padding.js +1 -0
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +395 -0
- package/build/hooks/position.js.map +1 -0
- package/build/hooks/supports.js +328 -0
- package/build/hooks/supports.js.map +1 -0
- package/build/hooks/typography.js +1 -1
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-color-props.js +3 -3
- package/build/hooks/use-color-props.js.map +1 -1
- package/build/hooks/utils.js +69 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +10 -1
- package/build/index.js.map +1 -1
- package/build/layouts/constrained.js +3 -0
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +59 -9
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +0 -18
- package/build/layouts/flow.js.map +1 -1
- package/build/store/actions.js +3 -30
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +5 -2
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +11 -2
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +78 -0
- package/build/store/private-actions.js.map +1 -0
- package/build/store/private-selectors.js +18 -0
- package/build/store/private-selectors.js.map +1 -0
- package/build/store/reducer.js +7 -3
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +68 -40
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-variation-transforms.js +1 -1
- package/build/utils/block-variation-transforms.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +1 -1
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build/utils/transform-styles/index.js +1 -7
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +1 -1
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/autocomplete/index.js +2 -6
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +6 -0
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +2 -2
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-card/index.js +2 -4
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-edit/index.js +7 -0
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +17 -15
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +5 -0
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-lock/modal.js +0 -1
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-mover/mover-description.js +2 -2
- package/build-module/components/block-mover/mover-description.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +3 -1
- package/build-module/components/block-navigation/dropdown.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-pattern-setup/use-patterns-setup.js +2 -2
- package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +32 -3
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +9 -14
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +31 -8
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-selection-clearer/index.js +1 -1
- package/build-module/components/block-selection-clearer/index.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +6 -30
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -3
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +2 -7
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +2 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +1 -1
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +55 -48
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +42 -11
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/icons.js +12 -0
- package/build-module/components/block-vertical-alignment-control/icons.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +10 -5
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/color-style-selector/index.js +3 -1
- package/build-module/components/color-style-selector/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +4 -5
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/default-style-picker/index.js +1 -0
- package/build-module/components/default-style-picker/index.js.map +1 -1
- package/build-module/components/font-family/index.js +1 -6
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +1 -1
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +1 -1
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +5 -7
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/context.js +12 -0
- package/build-module/components/global-styles/context.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +121 -0
- package/build-module/components/global-styles/hooks.js.map +1 -0
- package/build-module/components/global-styles/index.js +4 -0
- package/build-module/components/global-styles/index.js.map +1 -0
- package/build-module/components/global-styles/typography-utils.js +84 -0
- package/build-module/components/global-styles/typography-utils.js.map +1 -0
- package/build-module/components/global-styles/use-global-styles-output.js +930 -0
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -0
- package/build-module/components/global-styles/utils.js +321 -0
- package/build-module/components/global-styles/utils.js.map +1 -0
- package/build-module/components/height-control/index.js +14 -1
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +36 -9
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-compatibility-styles.js +6 -1
- package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build-module/components/image-editor/constants.js +1 -1
- package/build-module/components/image-editor/constants.js.map +1 -1
- package/build-module/components/image-editor/context.js +1 -2
- package/build-module/components/image-editor/context.js.map +1 -1
- package/build-module/components/image-editor/cropper.js +3 -1
- package/build-module/components/image-editor/cropper.js.map +1 -1
- package/build-module/components/image-editor/index.js +13 -3
- package/build-module/components/image-editor/index.js.map +1 -1
- package/build-module/components/image-editor/use-transform-image.js +12 -37
- package/build-module/components/image-editor/use-transform-image.js.map +1 -1
- package/build-module/components/image-size-control/index.js +2 -6
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.js +2 -3
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +21 -32
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +9 -22
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-block-context.js +43 -0
- package/build-module/components/inner-blocks/use-block-context.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/explorer.js +0 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +11 -5
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +3 -3
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +1 -6
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +8 -6
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +145 -56
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +74 -24
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +14 -14
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +7 -4
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/media-tab/utils.js +27 -15
- package/build-module/components/inserter/media-tab/utils.js.map +1 -1
- package/build-module/components/inserter/menu.js +12 -5
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +5 -3
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/search-results.js +2 -6
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +1 -9
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +14 -2
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +13 -1
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/groups.js +7 -1
- package/build-module/components/inspector-controls/groups.js.map +1 -1
- package/build-module/components/inspector-controls/index.js +2 -2
- package/build-module/components/inspector-controls/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +13 -1
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls/slot.native.js +13 -1
- package/build-module/components/inspector-controls/slot.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +2 -2
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +33 -0
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/settings-tab.js +2 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +6 -4
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +20 -22
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/justify-content-control/ui.js +9 -2
- package/build-module/components/justify-content-control/ui.js.map +1 -1
- package/build-module/components/link-control/index.js +45 -16
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +1 -0
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block.js +1 -1
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +4 -1
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/off-canvas-editor/appender.js +46 -36
- package/build-module/components/off-canvas-editor/appender.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-contents.js +37 -7
- package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
- package/build-module/components/off-canvas-editor/block-select-button.js +9 -4
- package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -1
- package/build-module/components/off-canvas-editor/block.js +15 -52
- package/build-module/components/off-canvas-editor/block.js.map +1 -1
- package/build-module/components/off-canvas-editor/branch.js +23 -11
- package/build-module/components/off-canvas-editor/branch.js.map +1 -1
- package/build-module/components/off-canvas-editor/index.js +15 -16
- package/build-module/components/off-canvas-editor/index.js.map +1 -1
- package/build-module/components/off-canvas-editor/link-ui.js +2 -2
- package/build-module/components/off-canvas-editor/link-ui.js.map +1 -1
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
- package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/provider/index.js +17 -8
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +4 -4
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-before-input-rules.js +10 -2
- package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +4 -5
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/components/rich-text/utils.js +1 -1
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +2 -7
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/tool-selector/index.js +3 -1
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/url-input/button.js +1 -0
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +14 -1
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +8 -8
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +1 -0
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +1 -1
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-paste-styles/index.js +174 -0
- package/build-module/components/use-paste-styles/index.js.map +1 -0
- package/build-module/components/writing-flow/use-arrow-nav.js +22 -29
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/experiments.js +25 -0
- package/build-module/experiments.js.map +1 -0
- package/build-module/experiments.native.js +23 -0
- package/build-module/experiments.native.js.map +1 -0
- package/build-module/hooks/anchor.js +2 -1
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border.js +1 -1
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/child-layout.js +5 -1
- package/build-module/hooks/child-layout.js.map +1 -1
- package/build-module/hooks/color-panel.js +1 -1
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +3 -3
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +2 -1
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/dimensions.js +6 -5
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/margin.js +1 -0
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/metadata.js +1 -1
- package/build-module/hooks/metadata.js.map +1 -1
- package/build-module/hooks/padding.js +1 -0
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +354 -0
- package/build-module/hooks/position.js.map +1 -0
- package/build-module/hooks/supports.js +257 -0
- package/build-module/hooks/supports.js.map +1 -0
- package/build-module/hooks/typography.js +1 -1
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-color-props.js +3 -3
- package/build-module/hooks/use-color-props.js.map +1 -1
- package/build-module/hooks/utils.js +70 -4
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/constrained.js +3 -0
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +60 -10
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +0 -18
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/store/actions.js +2 -26
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +5 -2
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js +8 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +66 -0
- package/build-module/store/private-actions.js.map +1 -0
- package/build-module/store/private-selectors.js +11 -0
- package/build-module/store/private-selectors.js.map +1 -0
- package/build-module/store/reducer.js +7 -3
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +55 -30
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-variation-transforms.js +1 -1
- package/build-module/utils/block-variation-transforms.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +1 -1
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +1 -6
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +340 -3
- package/build-style/content.css +340 -3
- package/build-style/style-rtl.css +125 -272
- package/build-style/style.css +125 -272
- package/package.json +30 -29
- package/src/components/alignment-control/test/__snapshots__/index.js.snap +3 -3
- package/src/components/alignment-control/test/index.js +5 -15
- package/src/components/alignment-control/ui.js +1 -1
- package/src/components/autocomplete/index.js +3 -6
- package/src/components/block-actions/index.js +5 -0
- package/src/components/block-alignment-control/test/index.js +3 -11
- package/src/components/block-alignment-matrix-control/index.js +1 -2
- package/src/components/block-card/index.js +1 -4
- package/src/components/block-content-overlay/content.scss +4 -4
- package/src/components/block-edit/index.js +15 -1
- package/src/components/block-icon/content.scss +31 -0
- package/src/components/block-inspector/index.js +15 -17
- package/src/components/block-list/use-in-between-inserter.js +5 -0
- package/src/components/block-lock/modal.js +0 -1
- package/src/components/block-mover/mover-description.js +2 -2
- package/src/components/block-mover/stories/index.js +3 -3
- package/src/components/block-navigation/dropdown.js +1 -1
- package/src/components/block-pattern-setup/index.js +1 -4
- package/src/components/block-pattern-setup/use-patterns-setup.js +2 -5
- package/src/components/block-patterns-list/index.js +29 -3
- package/src/components/block-preview/README.md +9 -9
- package/src/components/block-preview/auto.js +10 -14
- package/src/components/block-preview/content.scss +23 -0
- package/src/components/block-preview/index.js +40 -10
- package/src/components/block-preview/style.scss +0 -23
- package/src/components/block-selection-clearer/index.js +1 -1
- package/src/components/block-selection-clearer/test/index.js +6 -6
- package/src/components/block-settings/container.native.js +7 -26
- package/src/components/block-settings-menu/block-settings-dropdown.js +14 -2
- package/src/components/block-settings-menu-controls/index.js +2 -10
- package/src/components/block-styles/index.js +4 -1
- package/src/components/block-switcher/test/index.js +43 -44
- package/src/components/block-switcher/utils.js +1 -1
- package/src/components/block-tools/selected-block-popover.js +77 -80
- package/src/components/block-tools/style.scss +0 -1
- package/src/components/block-tools/use-block-toolbar-popover-props.js +68 -12
- package/src/components/block-variation-picker/{style.scss → content.scss} +0 -0
- package/src/components/block-vertical-alignment-control/icons.js +12 -0
- package/src/components/block-vertical-alignment-control/test/index.js +3 -11
- package/src/components/block-vertical-alignment-control/ui.js +16 -6
- package/src/components/button-block-appender/{style.scss → content.scss} +0 -0
- package/src/components/color-style-selector/index.js +1 -1
- package/src/components/colors/test/with-colors.js +2 -8
- package/src/components/date-format-picker/index.js +23 -24
- package/src/components/date-format-picker/style.scss +0 -6
- package/src/components/default-block-appender/content.scss +18 -0
- package/src/components/default-block-appender/test/index.js +2 -8
- package/src/components/default-style-picker/index.js +1 -0
- package/src/components/font-family/index.js +1 -6
- package/src/components/font-sizes/fluid-utils.js +1 -1
- package/src/components/font-sizes/utils.js +1 -1
- package/src/components/font-sizes/with-font-sizes.js +33 -33
- package/src/components/global-styles/README.md +77 -0
- package/src/components/global-styles/context.js +15 -0
- package/src/components/global-styles/hooks.js +145 -0
- package/src/components/global-styles/index.js +7 -0
- package/src/components/global-styles/test/typography-utils.js +393 -0
- package/src/components/global-styles/test/use-global-styles-output.js +814 -0
- package/src/components/global-styles/test/utils.js +206 -0
- package/src/components/global-styles/typography-utils.js +87 -0
- package/src/components/global-styles/use-global-styles-output.js +1088 -0
- package/src/components/global-styles/utils.js +373 -0
- package/src/components/height-control/README.md +55 -0
- package/src/components/height-control/index.js +13 -1
- package/src/components/iframe/index.js +52 -19
- package/src/components/iframe/use-compatibility-styles.js +6 -0
- package/src/components/image-editor/constants.js +1 -1
- package/src/components/image-editor/context.js +5 -9
- package/src/components/image-editor/cropper.js +3 -1
- package/src/components/image-editor/index.js +13 -4
- package/src/components/image-editor/use-transform-image.js +14 -55
- package/src/components/image-size-control/index.js +2 -6
- package/src/components/index.js +2 -6
- package/src/components/inner-blocks/index.js +29 -33
- package/src/components/inner-blocks/index.native.js +27 -47
- package/src/components/inner-blocks/use-block-context.js +47 -0
- package/src/components/inserter/block-patterns-explorer/explorer.js +0 -1
- package/src/components/inserter/block-patterns-tab.js +14 -4
- package/src/components/inserter/block-types-tab.js +3 -4
- package/src/components/inserter/hooks/use-patterns-state.js +1 -6
- package/src/components/inserter/index.js +46 -42
- package/src/components/inserter/media-tab/hooks.js +167 -65
- package/src/components/inserter/media-tab/media-list.js +94 -26
- package/src/components/inserter/media-tab/media-panel.js +9 -20
- package/src/components/inserter/media-tab/media-tab.js +12 -4
- package/src/components/inserter/media-tab/utils.js +20 -10
- package/src/components/inserter/menu.js +9 -4
- package/src/components/inserter/preview-panel.js +4 -2
- package/src/components/inserter/search-results.js +2 -6
- package/src/components/inserter/stories/index.js +9 -9
- package/src/components/inserter/style.scss +58 -11
- package/src/components/inserter/test/__snapshots__/index.native.js.snap +117 -0
- package/src/components/inserter/test/index.native.js +255 -1
- package/src/components/inserter-list-item/index.js +0 -7
- package/src/components/inspector-controls/README.md +3 -7
- package/src/components/inspector-controls/fill.js +15 -1
- package/src/components/inspector-controls/fill.native.js +14 -1
- package/src/components/inspector-controls/groups.js +5 -0
- package/src/components/inspector-controls/index.js +2 -6
- package/src/components/inspector-controls/slot.js +14 -1
- package/src/components/inspector-controls/slot.native.js +14 -1
- package/src/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
- package/src/components/inspector-controls-tabs/index.js +2 -4
- package/src/components/inspector-controls-tabs/position-controls-panel.js +37 -0
- package/src/components/inspector-controls-tabs/settings-tab.js +2 -0
- package/src/components/inspector-controls-tabs/style.scss +15 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -7
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +24 -18
- package/src/components/justify-content-control/ui.js +9 -0
- package/src/components/link-control/index.js +59 -23
- package/src/components/link-control/search-input.js +1 -0
- package/src/components/link-control/style.scss +8 -24
- package/src/components/link-control/test/index.js +134 -5
- package/src/components/list-view/block.js +1 -1
- package/src/components/list-view/style.scss +13 -3
- package/src/components/list-view/use-list-view-drop-zone.js +1 -1
- package/src/components/media-replace-flow/test/index.js +4 -12
- package/src/components/media-upload/index.native.js +2 -2
- package/src/components/off-canvas-editor/README.md +2 -2
- package/src/components/off-canvas-editor/appender.js +82 -76
- package/src/components/off-canvas-editor/block-contents.js +84 -23
- package/src/components/off-canvas-editor/block-select-button.js +12 -1
- package/src/components/off-canvas-editor/block.js +31 -102
- package/src/components/off-canvas-editor/branch.js +32 -5
- package/src/components/off-canvas-editor/index.js +19 -24
- package/src/components/off-canvas-editor/link-ui.js +2 -2
- package/src/components/off-canvas-editor/style.scss +5 -1
- package/src/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
- package/src/components/provider/index.js +33 -11
- package/src/components/provider/index.native.js +4 -3
- package/src/components/provider/test/experimental-provider.js +94 -0
- package/src/components/provider/test/use-block-sync.js +10 -0
- package/src/components/responsive-block-control/test/index.js +1 -5
- package/src/components/rich-text/use-before-input-rules.js +10 -2
- package/src/components/rich-text/use-enter.js +4 -4
- package/src/components/rich-text/utils.js +1 -1
- package/src/components/spacing-sizes-control/utils.js +2 -7
- package/src/components/tool-selector/index.js +1 -1
- package/src/components/url-input/README.md +5 -0
- package/src/components/url-input/button.js +1 -0
- package/src/components/url-input/index.js +15 -1
- package/src/components/url-input/test/button.js +24 -24
- package/src/components/url-popover/image-url-input-ui.js +7 -8
- package/src/components/url-popover/link-editor.js +1 -0
- package/src/components/url-popover/style.scss +0 -10
- package/src/components/use-block-display-information/index.js +1 -1
- package/src/components/use-paste-styles/index.js +230 -0
- package/src/components/warning/{style.scss → content.scss} +0 -0
- package/src/components/warning/test/index.js +1 -5
- package/src/components/writing-flow/use-arrow-nav.js +20 -28
- package/src/content.scss +8 -0
- package/src/experiments.js +27 -0
- package/src/experiments.native.js +25 -0
- package/src/hooks/anchor.js +2 -1
- package/src/hooks/border.js +1 -1
- package/src/hooks/child-layout.js +6 -1
- package/src/hooks/color-panel.js +1 -1
- package/src/hooks/color.js +3 -3
- package/src/hooks/custom-class-name.js +2 -1
- package/src/hooks/dimensions.js +6 -6
- package/src/hooks/index.js +1 -0
- package/src/hooks/layout.scss +4 -0
- package/src/hooks/margin.js +1 -0
- package/src/hooks/metadata.js +1 -2
- package/src/hooks/padding.js +1 -0
- package/src/hooks/position.js +391 -0
- package/src/hooks/position.scss +18 -0
- package/src/hooks/supports.js +302 -0
- package/src/hooks/test/__snapshots__/align.native.js.snap +73 -0
- package/src/hooks/test/align.native.js +133 -0
- package/src/hooks/test/utils.js +104 -0
- package/src/hooks/typography.js +1 -1
- package/src/hooks/use-color-props.js +3 -3
- package/src/hooks/utils.js +68 -2
- package/src/index.js +1 -0
- package/src/layouts/constrained.js +3 -0
- package/src/layouts/flex.js +66 -14
- package/src/layouts/flow.js +0 -9
- package/src/store/actions.js +2 -26
- package/src/store/defaults.js +7 -2
- package/src/store/index.js +8 -2
- package/src/store/private-actions.js +65 -0
- package/src/store/private-selectors.js +10 -0
- package/src/store/reducer.js +8 -3
- package/src/store/selectors.js +108 -57
- package/src/store/test/actions.js +0 -18
- package/src/store/test/private-actions.js +22 -0
- package/src/store/test/private-selectors.js +24 -0
- package/src/store/test/reducer.js +45 -3
- package/src/store/test/selectors.js +64 -39
- package/src/style.scss +5 -6
- package/src/utils/block-variation-transforms.js +1 -1
- package/src/utils/parse-css-unit-to-px.js +3 -1
- package/src/utils/test/parse-css-unit-to-px.js +16 -24
- package/src/utils/transform-styles/index.js +1 -6
- package/build/components/inner-blocks/get-block-context.js +0 -45
- package/build/components/inner-blocks/get-block-context.js.map +0 -1
- package/build/components/off-canvas-editor/block-edit-button.js +0 -50
- package/build/components/off-canvas-editor/block-edit-button.js.map +0 -1
- package/build-module/components/inner-blocks/get-block-context.js +0 -37
- package/build-module/components/inner-blocks/get-block-context.js.map +0 -1
- package/build-module/components/off-canvas-editor/block-edit-button.js +0 -35
- package/build-module/components/off-canvas-editor/block-edit-button.js.map +0 -1
- package/src/components/inner-blocks/get-block-context.js +0 -39
- package/src/components/off-canvas-editor/block-edit-button.js +0 -27
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { isEmpty } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -75,7 +70,7 @@ export function getPresetValueFromCustomValue( value, spacingSizes ) {
|
|
|
75
70
|
*
|
|
76
71
|
* @param {string} value Value to convert.
|
|
77
72
|
*
|
|
78
|
-
* @return {string} CSS var string for given spacing preset value.
|
|
73
|
+
* @return {string | undefined} CSS var string for given spacing preset value.
|
|
79
74
|
*/
|
|
80
75
|
export function getSpacingPresetCssVar( value ) {
|
|
81
76
|
if ( ! value ) {
|
|
@@ -211,5 +206,5 @@ export function isValuesDefined( values ) {
|
|
|
211
206
|
if ( values === undefined || values === null ) {
|
|
212
207
|
return false;
|
|
213
208
|
}
|
|
214
|
-
return
|
|
209
|
+
return Object.values( values ).filter( ( value ) => !! value ).length > 0;
|
|
215
210
|
}
|
|
@@ -160,6 +160,10 @@ When hiding the URLInput using CSS (as is sometimes done for accessibility purpo
|
|
|
160
160
|
|
|
161
161
|
This prop allows the suggestions list to be programmatically not rendered by passing a boolean—it can be `true` to make sure suggestions aren't rendered, or `false`/`undefined` to fall back to the default behaviour of showing suggestions when matching autocompletion items are found.
|
|
162
162
|
|
|
163
|
+
### `__nextHasNoMarginBottom: Boolean`
|
|
164
|
+
|
|
165
|
+
Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 6.4. (The prop can be safely removed once this happens.)
|
|
166
|
+
|
|
163
167
|
## Example
|
|
164
168
|
|
|
165
169
|
{% codetabs %}
|
|
@@ -217,6 +221,7 @@ registerBlockType( /* ... */, {
|
|
|
217
221
|
edit( { className, attributes, setAttributes } ) {
|
|
218
222
|
return (
|
|
219
223
|
<URLInput
|
|
224
|
+
__nextHasNoMarginBottom
|
|
220
225
|
className={ className }
|
|
221
226
|
value={ attributes.url }
|
|
222
227
|
onChange={ ( url, post ) => setAttributes( { url, text: (post && post.title) || 'Click here' } ) }
|
|
@@ -7,6 +7,7 @@ import scrollIntoView from 'dom-scroll-into-view';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
+
import deprecated from '@wordpress/deprecated';
|
|
10
11
|
import { __, sprintf, _n } from '@wordpress/i18n';
|
|
11
12
|
import { Component, createRef } from '@wordpress/element';
|
|
12
13
|
import { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';
|
|
@@ -424,6 +425,8 @@ class URLInput extends Component {
|
|
|
424
425
|
|
|
425
426
|
renderControl() {
|
|
426
427
|
const {
|
|
428
|
+
/** Start opting into the new margin-free styles that will become the default in a future version. */
|
|
429
|
+
__nextHasNoMarginBottom = false,
|
|
427
430
|
label = null,
|
|
428
431
|
className,
|
|
429
432
|
isFullWidth,
|
|
@@ -477,8 +480,19 @@ class URLInput extends Component {
|
|
|
477
480
|
return renderControl( controlProps, inputProps, loading );
|
|
478
481
|
}
|
|
479
482
|
|
|
483
|
+
if ( ! __nextHasNoMarginBottom ) {
|
|
484
|
+
deprecated( 'Bottom margin styles for wp.blockEditor.URLInput', {
|
|
485
|
+
since: '6.2',
|
|
486
|
+
version: '6.5',
|
|
487
|
+
hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version',
|
|
488
|
+
} );
|
|
489
|
+
}
|
|
490
|
+
|
|
480
491
|
return (
|
|
481
|
-
<BaseControl
|
|
492
|
+
<BaseControl
|
|
493
|
+
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
494
|
+
{ ...controlProps }
|
|
495
|
+
>
|
|
482
496
|
<input { ...inputProps } />
|
|
483
497
|
{ loading && <Spinner /> }
|
|
484
498
|
</BaseControl>
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
import { render, screen } from '@testing-library/react';
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* WordPress dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { useState } from '@wordpress/element';
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* Internal dependencies
|
|
9
14
|
*/
|
|
10
15
|
import URLInputButton from '../button';
|
|
11
16
|
|
|
12
|
-
jest.useFakeTimers();
|
|
13
|
-
|
|
14
17
|
describe( 'URLInputButton', () => {
|
|
15
18
|
it( 'should render a `Insert link` button and not be pressed when `url` is not provided', () => {
|
|
16
19
|
render( <URLInputButton /> );
|
|
@@ -57,9 +60,7 @@ describe( 'URLInputButton', () => {
|
|
|
57
60
|
} );
|
|
58
61
|
|
|
59
62
|
it( 'should render a form when `Insert link` button is clicked', async () => {
|
|
60
|
-
const user = userEvent.setup(
|
|
61
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
62
|
-
} );
|
|
63
|
+
const user = userEvent.setup();
|
|
63
64
|
render( <URLInputButton /> );
|
|
64
65
|
|
|
65
66
|
// Click the button to insert a link.
|
|
@@ -76,9 +77,7 @@ describe( 'URLInputButton', () => {
|
|
|
76
77
|
} );
|
|
77
78
|
|
|
78
79
|
it( 'should call `onChange` function once per each value change', async () => {
|
|
79
|
-
const user = userEvent.setup(
|
|
80
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
81
|
-
} );
|
|
80
|
+
const user = userEvent.setup();
|
|
82
81
|
const onChangeMock = jest.fn();
|
|
83
82
|
|
|
84
83
|
render( <URLInputButton onChange={ onChangeMock } /> );
|
|
@@ -104,9 +103,7 @@ describe( 'URLInputButton', () => {
|
|
|
104
103
|
} );
|
|
105
104
|
|
|
106
105
|
it( 'should close the form when the user clicks the `Close` button', async () => {
|
|
107
|
-
const user = userEvent.setup(
|
|
108
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
109
|
-
} );
|
|
106
|
+
const user = userEvent.setup();
|
|
110
107
|
|
|
111
108
|
render( <URLInputButton /> );
|
|
112
109
|
|
|
@@ -135,12 +132,15 @@ describe( 'URLInputButton', () => {
|
|
|
135
132
|
} );
|
|
136
133
|
|
|
137
134
|
it( 'should close the form when user submits it', async () => {
|
|
138
|
-
const user = userEvent.setup(
|
|
139
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
140
|
-
} );
|
|
141
|
-
const onChangeMock = jest.fn();
|
|
135
|
+
const user = userEvent.setup();
|
|
142
136
|
|
|
143
|
-
|
|
137
|
+
function TestURLInputButton() {
|
|
138
|
+
// maintain state for the controlled component and process value changes
|
|
139
|
+
const [ url, setUrl ] = useState( '' );
|
|
140
|
+
return <URLInputButton url={ url } onChange={ setUrl } />;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
render( <TestURLInputButton /> );
|
|
144
144
|
|
|
145
145
|
// Click the button to insert a link.
|
|
146
146
|
await user.click(
|
|
@@ -153,15 +153,15 @@ describe( 'URLInputButton', () => {
|
|
|
153
153
|
// Type something into the URL field.
|
|
154
154
|
await user.type( screen.getByRole( 'combobox' ), 'foo' );
|
|
155
155
|
|
|
156
|
+
const submitButton = screen.getByRole( 'button', {
|
|
157
|
+
name: 'Submit',
|
|
158
|
+
} );
|
|
159
|
+
|
|
160
|
+
expect( submitButton ).toBeInTheDocument();
|
|
161
|
+
|
|
156
162
|
// Submit the form.
|
|
157
|
-
await user.click(
|
|
158
|
-
screen.getByRole( 'button', {
|
|
159
|
-
name: 'Submit',
|
|
160
|
-
} )
|
|
161
|
-
);
|
|
163
|
+
await user.click( submitButton );
|
|
162
164
|
|
|
163
|
-
expect(
|
|
164
|
-
screen.queryByRole( 'button', { name: 'Submit' } )
|
|
165
|
-
).not.toBeInTheDocument();
|
|
165
|
+
expect( submitButton ).not.toBeInTheDocument();
|
|
166
166
|
} );
|
|
167
167
|
} );
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { map } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -17,6 +12,7 @@ import {
|
|
|
17
12
|
TextControl,
|
|
18
13
|
SVG,
|
|
19
14
|
Path,
|
|
15
|
+
__experimentalVStack as VStack,
|
|
20
16
|
} from '@wordpress/components';
|
|
21
17
|
import { link as linkIcon, close } from '@wordpress/icons';
|
|
22
18
|
|
|
@@ -214,23 +210,26 @@ const ImageURLInputUI = ( {
|
|
|
214
210
|
};
|
|
215
211
|
|
|
216
212
|
const advancedOptions = (
|
|
217
|
-
|
|
213
|
+
<VStack spacing="3">
|
|
218
214
|
<ToggleControl
|
|
215
|
+
__nextHasNoMarginBottom
|
|
219
216
|
label={ __( 'Open in new tab' ) }
|
|
220
217
|
onChange={ onSetNewTab }
|
|
221
218
|
checked={ linkTarget === '_blank' }
|
|
222
219
|
/>
|
|
223
220
|
<TextControl
|
|
221
|
+
__nextHasNoMarginBottom
|
|
224
222
|
label={ __( 'Link rel' ) }
|
|
225
223
|
value={ rel ?? '' }
|
|
226
224
|
onChange={ onSetLinkRel }
|
|
227
225
|
/>
|
|
228
226
|
<TextControl
|
|
227
|
+
__nextHasNoMarginBottom
|
|
229
228
|
label={ __( 'Link CSS Class' ) }
|
|
230
229
|
value={ linkClass || '' }
|
|
231
230
|
onChange={ onSetLinkClass }
|
|
232
231
|
/>
|
|
233
|
-
|
|
232
|
+
</VStack>
|
|
234
233
|
);
|
|
235
234
|
|
|
236
235
|
const linkEditorValue = urlInput !== null ? urlInput : url;
|
|
@@ -260,7 +259,7 @@ const ImageURLInputUI = ( {
|
|
|
260
259
|
additionalControls={
|
|
261
260
|
! linkEditorValue && (
|
|
262
261
|
<NavigableMenu>
|
|
263
|
-
{
|
|
262
|
+
{ getLinkDestinations().map( ( link ) => (
|
|
264
263
|
<MenuItem
|
|
265
264
|
key={ link.linkDestination }
|
|
266
265
|
icon={ link.icon }
|
|
@@ -52,12 +52,6 @@
|
|
|
52
52
|
transform: rotate(180deg);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
.block-editor-url-popover__input-container {
|
|
56
|
-
.components-base-control:last-child,
|
|
57
|
-
.components-base-control:last-child .components-base-control__field {
|
|
58
|
-
margin-bottom: 0;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
55
|
|
|
62
56
|
.block-editor-url-popover__settings {
|
|
63
57
|
display: block;
|
|
@@ -68,10 +62,6 @@
|
|
|
68
62
|
.block-editor-url-popover__link-editor,
|
|
69
63
|
.block-editor-url-popover__link-viewer {
|
|
70
64
|
display: flex;
|
|
71
|
-
|
|
72
|
-
.block-editor-url-input .components-base-control__field {
|
|
73
|
-
margin-bottom: 0;
|
|
74
|
-
}
|
|
75
65
|
}
|
|
76
66
|
|
|
77
67
|
.block-editor-url-popover__link-viewer-url {
|
|
@@ -34,7 +34,7 @@ import { store as blockEditorStore } from '../../store';
|
|
|
34
34
|
* 1. Block's client id to extract it's current attributes.
|
|
35
35
|
* 2. A block variation should have set `isActive` prop to a proper function.
|
|
36
36
|
*
|
|
37
|
-
* If for any reason a block
|
|
37
|
+
* If for any reason a block variation match cannot be found,
|
|
38
38
|
* the returned information come from the Block Type.
|
|
39
39
|
* If no blockType is found with the provided clientId, returns null.
|
|
40
40
|
*
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useCallback } from '@wordpress/element';
|
|
5
|
+
import { getBlockType, parse } from '@wordpress/blocks';
|
|
6
|
+
import { useDispatch, useRegistry } from '@wordpress/data';
|
|
7
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
8
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { store as blockEditorStore } from '../../store';
|
|
14
|
+
import {
|
|
15
|
+
hasAlignSupport,
|
|
16
|
+
hasBorderSupport,
|
|
17
|
+
hasBackgroundColorSupport,
|
|
18
|
+
hasTextColorSupport,
|
|
19
|
+
hasGradientSupport,
|
|
20
|
+
hasCustomClassNameSupport,
|
|
21
|
+
hasFontFamilySupport,
|
|
22
|
+
hasFontSizeSupport,
|
|
23
|
+
hasLayoutSupport,
|
|
24
|
+
hasStyleSupport,
|
|
25
|
+
} from '../../hooks/supports';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Determine if the copied text looks like serialized blocks or not.
|
|
29
|
+
* Since plain text will always get parsed into a freeform block,
|
|
30
|
+
* we check that if the parsed blocks is anything other than that.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} text The copied text.
|
|
33
|
+
* @return {boolean} True if the text looks like serialized blocks, false otherwise.
|
|
34
|
+
*/
|
|
35
|
+
function hasSerializedBlocks( text ) {
|
|
36
|
+
try {
|
|
37
|
+
const blocks = parse( text, {
|
|
38
|
+
__unstableSkipMigrationLogs: true,
|
|
39
|
+
__unstableSkipAutop: true,
|
|
40
|
+
} );
|
|
41
|
+
if ( blocks.length === 1 && blocks[ 0 ].name === 'core/freeform' ) {
|
|
42
|
+
// It's likely that the text is just plain text and not serialized blocks.
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
} catch ( err ) {
|
|
47
|
+
// Parsing error, the text is not serialized blocks.
|
|
48
|
+
// (Even though that it technically won't happen)
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Style attributes are attributes being added in `block-editor/src/hooks/*`.
|
|
55
|
+
* (Except for some unrelated to style like `anchor` or `settings`.)
|
|
56
|
+
* They generally represent the default block supports.
|
|
57
|
+
*/
|
|
58
|
+
const STYLE_ATTRIBUTES = {
|
|
59
|
+
align: hasAlignSupport,
|
|
60
|
+
borderColor: ( nameOrType ) => hasBorderSupport( nameOrType, 'color' ),
|
|
61
|
+
backgroundColor: hasBackgroundColorSupport,
|
|
62
|
+
textColor: hasTextColorSupport,
|
|
63
|
+
gradient: hasGradientSupport,
|
|
64
|
+
className: hasCustomClassNameSupport,
|
|
65
|
+
fontFamily: hasFontFamilySupport,
|
|
66
|
+
fontSize: hasFontSizeSupport,
|
|
67
|
+
layout: hasLayoutSupport,
|
|
68
|
+
style: hasStyleSupport,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Get the "style attributes" from a given block to a target block.
|
|
73
|
+
*
|
|
74
|
+
* @param {WPBlock} sourceBlock The source block.
|
|
75
|
+
* @param {WPBlock} targetBlock The target block.
|
|
76
|
+
* @return {Object} the filtered attributes object.
|
|
77
|
+
*/
|
|
78
|
+
function getStyleAttributes( sourceBlock, targetBlock ) {
|
|
79
|
+
return Object.entries( STYLE_ATTRIBUTES ).reduce(
|
|
80
|
+
( attributes, [ attributeKey, hasSupport ] ) => {
|
|
81
|
+
// Only apply the attribute if both blocks support it.
|
|
82
|
+
if (
|
|
83
|
+
hasSupport( sourceBlock.name ) &&
|
|
84
|
+
hasSupport( targetBlock.name )
|
|
85
|
+
) {
|
|
86
|
+
// Override attributes that are not present in the block to their defaults.
|
|
87
|
+
attributes[ attributeKey ] =
|
|
88
|
+
sourceBlock.attributes[ attributeKey ];
|
|
89
|
+
}
|
|
90
|
+
return attributes;
|
|
91
|
+
},
|
|
92
|
+
{}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Update the target blocks with style attributes recursively.
|
|
98
|
+
*
|
|
99
|
+
* @param {WPBlock[]} targetBlocks The target blocks to be updated.
|
|
100
|
+
* @param {WPBlock[]} sourceBlocks The source blocks to get th style attributes from.
|
|
101
|
+
* @param {Function} updateBlockAttributes The function to update the attributes.
|
|
102
|
+
*/
|
|
103
|
+
function recursivelyUpdateBlockAttributes(
|
|
104
|
+
targetBlocks,
|
|
105
|
+
sourceBlocks,
|
|
106
|
+
updateBlockAttributes
|
|
107
|
+
) {
|
|
108
|
+
for (
|
|
109
|
+
let index = 0;
|
|
110
|
+
index < Math.min( sourceBlocks.length, targetBlocks.length );
|
|
111
|
+
index += 1
|
|
112
|
+
) {
|
|
113
|
+
updateBlockAttributes(
|
|
114
|
+
targetBlocks[ index ].clientId,
|
|
115
|
+
getStyleAttributes( sourceBlocks[ index ], targetBlocks[ index ] )
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
recursivelyUpdateBlockAttributes(
|
|
119
|
+
targetBlocks[ index ].innerBlocks,
|
|
120
|
+
sourceBlocks[ index ].innerBlocks,
|
|
121
|
+
updateBlockAttributes
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* A hook to return a pasteStyles event function for handling pasting styles to blocks.
|
|
128
|
+
*
|
|
129
|
+
* @return {Function} A function to update the styles to the blocks.
|
|
130
|
+
*/
|
|
131
|
+
export default function usePasteStyles() {
|
|
132
|
+
const registry = useRegistry();
|
|
133
|
+
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
134
|
+
const { createSuccessNotice, createWarningNotice, createErrorNotice } =
|
|
135
|
+
useDispatch( noticesStore );
|
|
136
|
+
|
|
137
|
+
return useCallback(
|
|
138
|
+
async ( targetBlocks ) => {
|
|
139
|
+
let html = '';
|
|
140
|
+
try {
|
|
141
|
+
// `http:` sites won't have the clipboard property on navigator.
|
|
142
|
+
// (with the exception of localhost.)
|
|
143
|
+
if ( ! window.navigator.clipboard ) {
|
|
144
|
+
createErrorNotice(
|
|
145
|
+
__(
|
|
146
|
+
'Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.'
|
|
147
|
+
),
|
|
148
|
+
{ type: 'snackbar' }
|
|
149
|
+
);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
html = await window.navigator.clipboard.readText();
|
|
154
|
+
} catch ( error ) {
|
|
155
|
+
// Possibly the permission is denied.
|
|
156
|
+
createErrorNotice(
|
|
157
|
+
__(
|
|
158
|
+
'Unable to paste styles. Please allow browser clipboard permissions before continuing.'
|
|
159
|
+
),
|
|
160
|
+
{
|
|
161
|
+
type: 'snackbar',
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Abort if the copied text is empty or doesn't look like serialized blocks.
|
|
168
|
+
if ( ! html || ! hasSerializedBlocks( html ) ) {
|
|
169
|
+
createWarningNotice(
|
|
170
|
+
__(
|
|
171
|
+
"Unable to paste styles. Block styles couldn't be found within the copied content."
|
|
172
|
+
),
|
|
173
|
+
{
|
|
174
|
+
type: 'snackbar',
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const copiedBlocks = parse( html );
|
|
181
|
+
|
|
182
|
+
if ( copiedBlocks.length === 1 ) {
|
|
183
|
+
// Apply styles of the block to all the target blocks.
|
|
184
|
+
registry.batch( () => {
|
|
185
|
+
recursivelyUpdateBlockAttributes(
|
|
186
|
+
targetBlocks,
|
|
187
|
+
targetBlocks.map( () => copiedBlocks[ 0 ] ),
|
|
188
|
+
updateBlockAttributes
|
|
189
|
+
);
|
|
190
|
+
} );
|
|
191
|
+
} else {
|
|
192
|
+
registry.batch( () => {
|
|
193
|
+
recursivelyUpdateBlockAttributes(
|
|
194
|
+
targetBlocks,
|
|
195
|
+
copiedBlocks,
|
|
196
|
+
updateBlockAttributes
|
|
197
|
+
);
|
|
198
|
+
} );
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if ( targetBlocks.length === 1 ) {
|
|
202
|
+
const title = getBlockType( targetBlocks[ 0 ].name )?.title;
|
|
203
|
+
createSuccessNotice(
|
|
204
|
+
sprintf(
|
|
205
|
+
// Translators: Name of the block being pasted, e.g. "Paragraph".
|
|
206
|
+
__( 'Pasted styles to %s.' ),
|
|
207
|
+
title
|
|
208
|
+
),
|
|
209
|
+
{ type: 'snackbar' }
|
|
210
|
+
);
|
|
211
|
+
} else {
|
|
212
|
+
createSuccessNotice(
|
|
213
|
+
sprintf(
|
|
214
|
+
// Translators: The number of the blocks.
|
|
215
|
+
__( 'Pasted styles to %d blocks.' ),
|
|
216
|
+
targetBlocks.length
|
|
217
|
+
),
|
|
218
|
+
{ type: 'snackbar' }
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
[
|
|
223
|
+
registry.batch,
|
|
224
|
+
updateBlockAttributes,
|
|
225
|
+
createSuccessNotice,
|
|
226
|
+
createWarningNotice,
|
|
227
|
+
createErrorNotice,
|
|
228
|
+
]
|
|
229
|
+
);
|
|
230
|
+
}
|
|
File without changes
|
|
@@ -9,8 +9,6 @@ import userEvent from '@testing-library/user-event';
|
|
|
9
9
|
*/
|
|
10
10
|
import Warning from '../index';
|
|
11
11
|
|
|
12
|
-
jest.useFakeTimers();
|
|
13
|
-
|
|
14
12
|
describe( 'Warning', () => {
|
|
15
13
|
it( 'should match snapshot', () => {
|
|
16
14
|
const { container } = render( <Warning>error</Warning> );
|
|
@@ -33,9 +31,7 @@ describe( 'Warning', () => {
|
|
|
33
31
|
} );
|
|
34
32
|
|
|
35
33
|
it( 'should show hidden secondary actions', async () => {
|
|
36
|
-
const user = userEvent.setup(
|
|
37
|
-
advanceTimers: jest.advanceTimersByTime,
|
|
38
|
-
} );
|
|
34
|
+
const user = userEvent.setup();
|
|
39
35
|
|
|
40
36
|
render(
|
|
41
37
|
<Warning secondaryActions={ [ { title: 'test', onClick: null } ] }>
|
|
@@ -167,6 +167,12 @@ export default function useArrowNav() {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
function onKeyDown( event ) {
|
|
170
|
+
// Abort if navigation has already been handled (e.g. RichText
|
|
171
|
+
// inline boundaries).
|
|
172
|
+
if ( event.defaultPrevented ) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
170
176
|
const { keyCode, target, shiftKey, ctrlKey, altKey, metaKey } =
|
|
171
177
|
event;
|
|
172
178
|
const isUp = keyCode === UP;
|
|
@@ -182,24 +188,20 @@ export default function useArrowNav() {
|
|
|
182
188
|
const { ownerDocument } = node;
|
|
183
189
|
const { defaultView } = ownerDocument;
|
|
184
190
|
|
|
191
|
+
if ( ! isNav ) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
|
|
185
195
|
// If there is a multi-selection, the arrow keys should collapse the
|
|
186
196
|
// selection to the start or end of the selection.
|
|
187
197
|
if ( hasMultiSelection() ) {
|
|
188
|
-
|
|
189
|
-
// selection).
|
|
190
|
-
if ( ! __unstableIsFullySelected() ) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if ( event.defaultPrevented ) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
if ( ! isNav ) {
|
|
198
|
+
if ( shiftKey ) {
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
if (
|
|
202
|
+
// Only handle if we have a full selection (not a native partial
|
|
203
|
+
// selection).
|
|
204
|
+
if ( ! __unstableIsFullySelected() ) {
|
|
203
205
|
return;
|
|
204
206
|
}
|
|
205
207
|
|
|
@@ -214,6 +216,12 @@ export default function useArrowNav() {
|
|
|
214
216
|
return;
|
|
215
217
|
}
|
|
216
218
|
|
|
219
|
+
// Abort if our current target is not a candidate for navigation
|
|
220
|
+
// (e.g. preserve native input behaviors).
|
|
221
|
+
if ( ! isNavigationCandidate( target, keyCode, hasModifier ) ) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
217
225
|
// When presing any key other than up or down, the initial vertical
|
|
218
226
|
// position must ALWAYS be reset. The vertical position is saved so
|
|
219
227
|
// it can be restored as well as possible on sebsequent vertical
|
|
@@ -227,22 +235,6 @@ export default function useArrowNav() {
|
|
|
227
235
|
verticalRect = computeCaretRect( defaultView );
|
|
228
236
|
}
|
|
229
237
|
|
|
230
|
-
// Abort if navigation has already been handled (e.g. RichText
|
|
231
|
-
// inline boundaries).
|
|
232
|
-
if ( event.defaultPrevented ) {
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
if ( ! isNav ) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// Abort if our current target is not a candidate for navigation
|
|
241
|
-
// (e.g. preserve native input behaviors).
|
|
242
|
-
if ( ! isNavigationCandidate( target, keyCode, hasModifier ) ) {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
238
|
// In the case of RTL scripts, right means previous and left means
|
|
247
239
|
// next, which is the exact reverse of LTR.
|
|
248
240
|
const isReverseDir = isRTL( target ) ? ! isReverse : isReverse;
|
package/src/content.scss
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
@import "./components/block-icon/content.scss";
|
|
1
2
|
@import "./components/block-list/content.scss";
|
|
2
3
|
@import "./components/block-list-appender/content.scss";
|
|
3
4
|
@import "./components/block-content-overlay/content.scss";
|
|
4
5
|
@import "./components/block-draggable/content.scss";
|
|
5
6
|
@import "./components/block-preview/content.scss";
|
|
7
|
+
@import "./components/block-variation-picker/content.scss";
|
|
8
|
+
@import "./components/button-block-appender/content.scss";
|
|
6
9
|
@import "./components/default-block-appender/content.scss";
|
|
7
10
|
@import "./components/inner-blocks/content.scss";
|
|
8
11
|
@import "./components/media-placeholder/content.scss";
|
|
9
12
|
@import "./components/plain-text/content.scss";
|
|
10
13
|
@import "./components/rich-text/content.scss";
|
|
14
|
+
@import "./components/warning/content.scss";
|
|
15
|
+
|
|
16
|
+
// To do: ideally the iframe does not contain UI, but there's still the block
|
|
17
|
+
// placeholders that will be moved to shadow DOM in the future.
|
|
18
|
+
@include wordpress-admin-schemes();
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import * as globalStyles from './components/global-styles';
|
|
10
|
+
import { ExperimentalBlockEditorProvider } from './components/provider';
|
|
11
|
+
import OffCanvasEditor from './components/off-canvas-editor';
|
|
12
|
+
|
|
13
|
+
export const { lock, unlock } =
|
|
14
|
+
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
15
|
+
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
|
|
16
|
+
'@wordpress/block-editor'
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Experimental @wordpress/block-editor APIs.
|
|
21
|
+
*/
|
|
22
|
+
export const experiments = {};
|
|
23
|
+
lock( experiments, {
|
|
24
|
+
...globalStyles,
|
|
25
|
+
ExperimentalBlockEditorProvider,
|
|
26
|
+
OffCanvasEditor,
|
|
27
|
+
} );
|