@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import BlockLibrary from '../library';
|
|
5
|
-
import
|
|
5
|
+
import { ExperimentalBlockEditorProvider } from '../../provider';
|
|
6
6
|
import { patternCategories, patterns, reusableBlocks } from './utils/fixtures';
|
|
7
7
|
import Inserter from '../';
|
|
8
8
|
|
|
@@ -16,11 +16,11 @@ export const libraryWithoutPatterns = () => {
|
|
|
16
16
|
display: 'inline-block',
|
|
17
17
|
};
|
|
18
18
|
return (
|
|
19
|
-
<
|
|
19
|
+
<ExperimentalBlockEditorProvider>
|
|
20
20
|
<div style={ wrapperStyle }>
|
|
21
21
|
<BlockLibrary showInserterHelpPanel />
|
|
22
22
|
</div>
|
|
23
|
-
</
|
|
23
|
+
</ExperimentalBlockEditorProvider>
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -32,7 +32,7 @@ export const libraryWithPatterns = () => {
|
|
|
32
32
|
display: 'inline-block',
|
|
33
33
|
};
|
|
34
34
|
return (
|
|
35
|
-
<
|
|
35
|
+
<ExperimentalBlockEditorProvider
|
|
36
36
|
settings={ {
|
|
37
37
|
__experimentalBlockPatternCategories: patternCategories,
|
|
38
38
|
__experimentalBlockPatterns: patterns,
|
|
@@ -41,7 +41,7 @@ export const libraryWithPatterns = () => {
|
|
|
41
41
|
<div style={ wrapperStyle }>
|
|
42
42
|
<BlockLibrary showInserterHelpPanel />
|
|
43
43
|
</div>
|
|
44
|
-
</
|
|
44
|
+
</ExperimentalBlockEditorProvider>
|
|
45
45
|
);
|
|
46
46
|
};
|
|
47
47
|
|
|
@@ -53,7 +53,7 @@ export const libraryWithPatternsAndReusableBlocks = () => {
|
|
|
53
53
|
display: 'inline-block',
|
|
54
54
|
};
|
|
55
55
|
return (
|
|
56
|
-
<
|
|
56
|
+
<ExperimentalBlockEditorProvider
|
|
57
57
|
settings={ {
|
|
58
58
|
__experimentalBlockPatternCategories: patternCategories,
|
|
59
59
|
__experimentalBlockPatterns: patterns,
|
|
@@ -63,7 +63,7 @@ export const libraryWithPatternsAndReusableBlocks = () => {
|
|
|
63
63
|
<div style={ wrapperStyle }>
|
|
64
64
|
<BlockLibrary showInserterHelpPanel />
|
|
65
65
|
</div>
|
|
66
|
-
</
|
|
66
|
+
</ExperimentalBlockEditorProvider>
|
|
67
67
|
);
|
|
68
68
|
};
|
|
69
69
|
|
|
@@ -75,7 +75,7 @@ export const quickInserter = () => {
|
|
|
75
75
|
display: 'inline-block',
|
|
76
76
|
};
|
|
77
77
|
return (
|
|
78
|
-
<
|
|
78
|
+
<ExperimentalBlockEditorProvider
|
|
79
79
|
settings={ {
|
|
80
80
|
__experimentalBlockPatternCategories: patternCategories,
|
|
81
81
|
__experimentalBlockPatterns: patterns,
|
|
@@ -85,6 +85,6 @@ export const quickInserter = () => {
|
|
|
85
85
|
<div style={ wrapperStyle }>
|
|
86
86
|
<Inserter __experimentalIsQuick />
|
|
87
87
|
</div>
|
|
88
|
-
</
|
|
88
|
+
</ExperimentalBlockEditorProvider>
|
|
89
89
|
);
|
|
90
90
|
};
|
|
@@ -564,8 +564,10 @@ $block-inserter-tabs-height: 44px;
|
|
|
564
564
|
}
|
|
565
565
|
|
|
566
566
|
.block-editor-inserter__media-panel {
|
|
567
|
-
height: 100%;
|
|
567
|
+
min-height: 100%;
|
|
568
568
|
padding: 0 $grid-unit-20;
|
|
569
|
+
display: flex;
|
|
570
|
+
flex-direction: column;
|
|
569
571
|
|
|
570
572
|
@include break-medium {
|
|
571
573
|
padding: 0;
|
|
@@ -576,6 +578,7 @@ $block-inserter-tabs-height: 44px;
|
|
|
576
578
|
display: flex;
|
|
577
579
|
align-items: center;
|
|
578
580
|
justify-content: center;
|
|
581
|
+
flex: 1;
|
|
579
582
|
}
|
|
580
583
|
|
|
581
584
|
.block-editor-inserter__media-panel-search {
|
|
@@ -583,13 +586,19 @@ $block-inserter-tabs-height: 44px;
|
|
|
583
586
|
input[type="search"].components-search-control__input {
|
|
584
587
|
background: $white;
|
|
585
588
|
}
|
|
589
|
+
button.components-button {
|
|
590
|
+
min-width: auto;
|
|
591
|
+
padding-left: $grid-unit-05 * 0.5;
|
|
592
|
+
padding-right: $grid-unit-05 * 0.5;
|
|
593
|
+
}
|
|
586
594
|
}
|
|
587
595
|
}
|
|
588
596
|
}
|
|
589
597
|
|
|
590
598
|
.block-editor-inserter__media-list {
|
|
591
599
|
margin-top: $grid-unit-20;
|
|
592
|
-
|
|
600
|
+
.block-editor-inserter__media-list__list-item {
|
|
601
|
+
position: relative;
|
|
593
602
|
cursor: pointer;
|
|
594
603
|
margin-bottom: $grid-unit-30;
|
|
595
604
|
|
|
@@ -600,16 +609,52 @@ $block-inserter-tabs-height: 44px;
|
|
|
600
609
|
&[draggable="true"] .block-editor-block-preview__container {
|
|
601
610
|
cursor: grab;
|
|
602
611
|
}
|
|
612
|
+
|
|
613
|
+
&.is-hovered {
|
|
614
|
+
.block-editor-inserter__media-list__item-preview {
|
|
615
|
+
box-shadow: 0 0 0 2px $gray-900, 0 15px 25px rgb(0 0 0 / 7%);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.block-editor-inserter__media-list__item-preview-options > button {
|
|
619
|
+
display: block;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.block-editor-inserter__media-list__item-preview-options {
|
|
624
|
+
position: absolute;
|
|
625
|
+
right: $grid-unit-10;
|
|
626
|
+
top: $grid-unit-10;
|
|
627
|
+
|
|
628
|
+
> button {
|
|
629
|
+
background: $white;
|
|
630
|
+
border-radius: $radius-block-ui;
|
|
631
|
+
display: none;
|
|
632
|
+
|
|
633
|
+
// These styles are important so as focus isn't lost
|
|
634
|
+
// when the button is focused and we hover away.
|
|
635
|
+
&.is-opened,
|
|
636
|
+
&:focus {
|
|
637
|
+
display: block;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
&:hover {
|
|
641
|
+
box-shadow: inset 0 0 0 2px $white, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
642
|
+
|
|
643
|
+
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
644
|
+
outline: 2px solid transparent;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
603
648
|
}
|
|
604
649
|
|
|
605
|
-
|
|
650
|
+
.block-editor-inserter__media-list__item {
|
|
606
651
|
height: 100%;
|
|
607
652
|
|
|
608
|
-
|
|
653
|
+
.block-editor-inserter__media-list__item-preview {
|
|
609
654
|
display: flex;
|
|
610
655
|
align-items: center;
|
|
611
656
|
overflow: hidden;
|
|
612
|
-
border-radius:
|
|
657
|
+
border-radius: 2px;
|
|
613
658
|
|
|
614
659
|
> * {
|
|
615
660
|
margin: 0 auto;
|
|
@@ -617,12 +662,8 @@ $block-inserter-tabs-height: 44px;
|
|
|
617
662
|
}
|
|
618
663
|
}
|
|
619
664
|
|
|
620
|
-
&:
|
|
621
|
-
box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
&:focus &-preview {
|
|
625
|
-
box-shadow: inset 0 0 0 1px $white, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
665
|
+
&:focus .block-editor-inserter__media-list__item-preview {
|
|
666
|
+
box-shadow: inset 0 0 0 2px $white, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
626
667
|
|
|
627
668
|
// Windows High Contrast mode will show this outline, but not the box-shadow.
|
|
628
669
|
outline: 2px solid transparent;
|
|
@@ -630,6 +671,12 @@ $block-inserter-tabs-height: 44px;
|
|
|
630
671
|
}
|
|
631
672
|
}
|
|
632
673
|
|
|
674
|
+
.block-editor-inserter__media-list__item-preview-options__popover {
|
|
675
|
+
.components-menu-item__button .components-menu-item__item {
|
|
676
|
+
min-width: auto;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
|
|
633
680
|
|
|
634
681
|
.block-editor-inserter__mobile-tab-navigation {
|
|
635
682
|
padding: $grid-unit-20;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Inserter can add blocks adds new block at the end of post 1`] = `
|
|
4
|
+
"<!-- wp:spacer -->
|
|
5
|
+
<div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
6
|
+
<!-- /wp:spacer -->
|
|
7
|
+
|
|
8
|
+
<!-- wp:heading -->
|
|
9
|
+
<h2 class=\\"wp-block-heading\\"></h2>
|
|
10
|
+
<!-- /wp:heading -->"
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
exports[`Inserter can add blocks after another block 1`] = `
|
|
14
|
+
"<!-- wp:spacer -->
|
|
15
|
+
<div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
16
|
+
<!-- /wp:spacer -->
|
|
17
|
+
|
|
18
|
+
<!-- wp:heading -->
|
|
19
|
+
<h2 class=\\"wp-block-heading\\"></h2>
|
|
20
|
+
<!-- /wp:heading -->
|
|
21
|
+
|
|
22
|
+
<!-- wp:more -->
|
|
23
|
+
<!--more-->
|
|
24
|
+
<!-- /wp:more -->
|
|
25
|
+
|
|
26
|
+
<!-- wp:paragraph -->
|
|
27
|
+
<p></p>
|
|
28
|
+
<!-- /wp:paragraph -->"
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
exports[`Inserter can add blocks before another block 1`] = `
|
|
32
|
+
"<!-- wp:heading -->
|
|
33
|
+
<h2 class=\\"wp-block-heading\\"></h2>
|
|
34
|
+
<!-- /wp:heading -->
|
|
35
|
+
|
|
36
|
+
<!-- wp:paragraph -->
|
|
37
|
+
<p></p>
|
|
38
|
+
<!-- /wp:paragraph -->"
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
exports[`Inserter can add blocks creates a new Paragraph block tapping on the empty area below the last block 1`] = `
|
|
42
|
+
"<!-- wp:spacer -->
|
|
43
|
+
<div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
44
|
+
<!-- /wp:spacer -->
|
|
45
|
+
|
|
46
|
+
<!-- wp:heading -->
|
|
47
|
+
<h2 class=\\"wp-block-heading\\"></h2>
|
|
48
|
+
<!-- /wp:heading -->
|
|
49
|
+
|
|
50
|
+
<!-- wp:paragraph -->
|
|
51
|
+
<p></p>
|
|
52
|
+
<!-- /wp:paragraph -->"
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
exports[`Inserter can add blocks inserts between 2 existing blocks 1`] = `
|
|
56
|
+
"<!-- wp:spacer -->
|
|
57
|
+
<div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
58
|
+
<!-- /wp:spacer -->
|
|
59
|
+
|
|
60
|
+
<!-- wp:more -->
|
|
61
|
+
<!--more-->
|
|
62
|
+
<!-- /wp:more -->
|
|
63
|
+
|
|
64
|
+
<!-- wp:heading -->
|
|
65
|
+
<h2 class=\\"wp-block-heading\\"></h2>
|
|
66
|
+
<!-- /wp:heading -->"
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
exports[`Inserter can add blocks inserts block at the end of post when no block is selected 1`] = `
|
|
70
|
+
"<!-- wp:spacer -->
|
|
71
|
+
<div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
72
|
+
<!-- /wp:spacer -->
|
|
73
|
+
|
|
74
|
+
<!-- wp:heading -->
|
|
75
|
+
<h2 class=\\"wp-block-heading\\"></h2>
|
|
76
|
+
<!-- /wp:heading -->
|
|
77
|
+
|
|
78
|
+
<!-- wp:more -->
|
|
79
|
+
<!--more-->
|
|
80
|
+
<!-- /wp:more -->"
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
exports[`Inserter can add blocks to the beginning 1`] = `
|
|
84
|
+
"<!-- wp:more -->
|
|
85
|
+
<!--more-->
|
|
86
|
+
<!-- /wp:more -->
|
|
87
|
+
|
|
88
|
+
<!-- wp:spacer -->
|
|
89
|
+
<div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
90
|
+
<!-- /wp:spacer -->
|
|
91
|
+
|
|
92
|
+
<!-- wp:heading -->
|
|
93
|
+
<h2 class=\\"wp-block-heading\\"></h2>
|
|
94
|
+
<!-- /wp:heading -->
|
|
95
|
+
|
|
96
|
+
<!-- wp:paragraph -->
|
|
97
|
+
<p></p>
|
|
98
|
+
<!-- /wp:paragraph -->"
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
exports[`Inserter can add blocks to the end 1`] = `
|
|
102
|
+
"<!-- wp:spacer -->
|
|
103
|
+
<div style=\\"height:100px\\" aria-hidden=\\"true\\" class=\\"wp-block-spacer\\"></div>
|
|
104
|
+
<!-- /wp:spacer -->
|
|
105
|
+
|
|
106
|
+
<!-- wp:heading -->
|
|
107
|
+
<h2 class=\\"wp-block-heading\\"></h2>
|
|
108
|
+
<!-- /wp:heading -->
|
|
109
|
+
|
|
110
|
+
<!-- wp:paragraph -->
|
|
111
|
+
<p></p>
|
|
112
|
+
<!-- /wp:paragraph -->
|
|
113
|
+
|
|
114
|
+
<!-- wp:more -->
|
|
115
|
+
<!--more-->
|
|
116
|
+
<!-- /wp:more -->"
|
|
117
|
+
`;
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
addBlock,
|
|
6
|
+
fireEvent,
|
|
7
|
+
initializeEditor,
|
|
8
|
+
getBlock,
|
|
9
|
+
getEditorHtml,
|
|
10
|
+
render,
|
|
11
|
+
} from 'test/helpers';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* WordPress dependencies
|
|
15
|
+
*/
|
|
16
|
+
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
17
|
+
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
5
18
|
|
|
6
19
|
/**
|
|
7
20
|
* Internal dependencies
|
|
@@ -20,4 +33,245 @@ describe( 'Inserter', () => {
|
|
|
20
33
|
|
|
21
34
|
expect( screen.getByTestId( 'add-block-button' ) ).toBeTruthy();
|
|
22
35
|
} );
|
|
36
|
+
|
|
37
|
+
describe( 'can add blocks', () => {
|
|
38
|
+
beforeAll( () => {
|
|
39
|
+
// Register all core blocks
|
|
40
|
+
registerCoreBlocks();
|
|
41
|
+
} );
|
|
42
|
+
|
|
43
|
+
afterAll( () => {
|
|
44
|
+
// Clean up registered blocks
|
|
45
|
+
getBlockTypes().forEach( ( block ) => {
|
|
46
|
+
unregisterBlockType( block.name );
|
|
47
|
+
} );
|
|
48
|
+
} );
|
|
49
|
+
|
|
50
|
+
it( 'to the beginning', async () => {
|
|
51
|
+
const screen = await initializeEditor();
|
|
52
|
+
const { getByLabelText, getByTestId } = screen;
|
|
53
|
+
|
|
54
|
+
// Add Spacer block
|
|
55
|
+
await addBlock( screen, 'Spacer' );
|
|
56
|
+
|
|
57
|
+
// Add Heading block
|
|
58
|
+
await addBlock( screen, 'Heading' );
|
|
59
|
+
|
|
60
|
+
// Add Paragraph block
|
|
61
|
+
await addBlock( screen, 'Paragraph' );
|
|
62
|
+
|
|
63
|
+
// Get Inserter button
|
|
64
|
+
const addBlockButton = await getByTestId( 'add-block-button' );
|
|
65
|
+
|
|
66
|
+
// Long press the inserter button
|
|
67
|
+
fireEvent( addBlockButton, 'onLongPress' );
|
|
68
|
+
|
|
69
|
+
// Get Add To Beginning option
|
|
70
|
+
const addBlockToBeginningButton = await getByLabelText(
|
|
71
|
+
'Add To Beginning'
|
|
72
|
+
);
|
|
73
|
+
expect( addBlockToBeginningButton ).toBeVisible();
|
|
74
|
+
fireEvent.press( addBlockToBeginningButton );
|
|
75
|
+
|
|
76
|
+
// Add another block at the beginning
|
|
77
|
+
await addBlock( screen, 'More', { isPickerOpened: true } );
|
|
78
|
+
|
|
79
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
80
|
+
} );
|
|
81
|
+
|
|
82
|
+
it( 'before another block', async () => {
|
|
83
|
+
const screen = await initializeEditor();
|
|
84
|
+
const { getByLabelText, getByTestId } = screen;
|
|
85
|
+
|
|
86
|
+
// Add Paragraph block
|
|
87
|
+
await addBlock( screen, 'Paragraph' );
|
|
88
|
+
|
|
89
|
+
// Get Paragraph block
|
|
90
|
+
const paragraphBlock = await getBlock( screen, 'Paragraph' );
|
|
91
|
+
fireEvent.press( paragraphBlock );
|
|
92
|
+
|
|
93
|
+
// Get Inserter button
|
|
94
|
+
const addBlockButton = await getByTestId( 'add-block-button' );
|
|
95
|
+
|
|
96
|
+
// Long press the inserter button
|
|
97
|
+
fireEvent( addBlockButton, 'onLongPress' );
|
|
98
|
+
|
|
99
|
+
// Get Add Block Before option
|
|
100
|
+
const addBlockBeforeButton = await getByLabelText(
|
|
101
|
+
'Add Block Before'
|
|
102
|
+
);
|
|
103
|
+
expect( addBlockBeforeButton ).toBeVisible();
|
|
104
|
+
fireEvent.press( addBlockBeforeButton );
|
|
105
|
+
|
|
106
|
+
// Add another block before the first one
|
|
107
|
+
await addBlock( screen, 'Heading', { isPickerOpened: true } );
|
|
108
|
+
|
|
109
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
110
|
+
} );
|
|
111
|
+
|
|
112
|
+
it( 'after another block', async () => {
|
|
113
|
+
const screen = await initializeEditor();
|
|
114
|
+
const { getByLabelText, getByTestId } = screen;
|
|
115
|
+
|
|
116
|
+
// Add Spacer block
|
|
117
|
+
await addBlock( screen, 'Spacer' );
|
|
118
|
+
|
|
119
|
+
// Add Heading block
|
|
120
|
+
await addBlock( screen, 'Heading' );
|
|
121
|
+
|
|
122
|
+
// Add Paragraph block
|
|
123
|
+
await addBlock( screen, 'Paragraph' );
|
|
124
|
+
|
|
125
|
+
// Get Heading block
|
|
126
|
+
const headingBlock = await getBlock( screen, 'Heading', {
|
|
127
|
+
rowIndex: 2,
|
|
128
|
+
} );
|
|
129
|
+
fireEvent.press( headingBlock );
|
|
130
|
+
|
|
131
|
+
// Get Inserter button
|
|
132
|
+
const addBlockButton = await getByTestId( 'add-block-button' );
|
|
133
|
+
|
|
134
|
+
// Long press the inserter button
|
|
135
|
+
fireEvent( addBlockButton, 'onLongPress' );
|
|
136
|
+
|
|
137
|
+
// Get Add Block After option
|
|
138
|
+
const addBlockAfterButton = await getByLabelText(
|
|
139
|
+
'Add Block After'
|
|
140
|
+
);
|
|
141
|
+
expect( addBlockAfterButton ).toBeVisible();
|
|
142
|
+
fireEvent.press( addBlockAfterButton );
|
|
143
|
+
|
|
144
|
+
// Add another block after the Heading block
|
|
145
|
+
await addBlock( screen, 'More', { isPickerOpened: true } );
|
|
146
|
+
|
|
147
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
148
|
+
} );
|
|
149
|
+
|
|
150
|
+
it( 'to the end', async () => {
|
|
151
|
+
const screen = await initializeEditor();
|
|
152
|
+
const { getByLabelText, getByTestId } = screen;
|
|
153
|
+
|
|
154
|
+
// Add Spacer block
|
|
155
|
+
await addBlock( screen, 'Spacer' );
|
|
156
|
+
|
|
157
|
+
// Add Heading block
|
|
158
|
+
await addBlock( screen, 'Heading' );
|
|
159
|
+
|
|
160
|
+
// Add Paragraph block
|
|
161
|
+
await addBlock( screen, 'Paragraph' );
|
|
162
|
+
|
|
163
|
+
// Get Spacer block
|
|
164
|
+
const spacerBlock = await getBlock( screen, 'Spacer' );
|
|
165
|
+
fireEvent.press( spacerBlock );
|
|
166
|
+
|
|
167
|
+
// Get Inserter button
|
|
168
|
+
const addBlockButton = await getByTestId( 'add-block-button' );
|
|
169
|
+
|
|
170
|
+
// Long press the inserter button
|
|
171
|
+
fireEvent( addBlockButton, 'onLongPress' );
|
|
172
|
+
|
|
173
|
+
// Get Add To End option
|
|
174
|
+
const addBlockToEndButton = await getByLabelText( 'Add To End' );
|
|
175
|
+
expect( addBlockToEndButton ).toBeVisible();
|
|
176
|
+
fireEvent.press( addBlockToEndButton );
|
|
177
|
+
|
|
178
|
+
// Add another block to the end after the Paragraph Block
|
|
179
|
+
await addBlock( screen, 'More', { isPickerOpened: true } );
|
|
180
|
+
|
|
181
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
182
|
+
} );
|
|
183
|
+
|
|
184
|
+
it( 'adds new block at the end of post', async () => {
|
|
185
|
+
const screen = await initializeEditor();
|
|
186
|
+
|
|
187
|
+
// Add Spacer block
|
|
188
|
+
await addBlock( screen, 'Spacer' );
|
|
189
|
+
|
|
190
|
+
// Add Heading block
|
|
191
|
+
await addBlock( screen, 'Heading' );
|
|
192
|
+
|
|
193
|
+
// Get Heading block
|
|
194
|
+
const headingBlock = await getBlock( screen, 'Heading', {
|
|
195
|
+
rowIndex: 2,
|
|
196
|
+
} );
|
|
197
|
+
expect( headingBlock ).toBeVisible();
|
|
198
|
+
|
|
199
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
200
|
+
} );
|
|
201
|
+
|
|
202
|
+
it( 'inserts between 2 existing blocks', async () => {
|
|
203
|
+
const screen = await initializeEditor();
|
|
204
|
+
|
|
205
|
+
// Add Spacer block
|
|
206
|
+
await addBlock( screen, 'Spacer' );
|
|
207
|
+
|
|
208
|
+
// Add Heading block
|
|
209
|
+
await addBlock( screen, 'Heading' );
|
|
210
|
+
|
|
211
|
+
// Get Spacer block
|
|
212
|
+
const spacerBlock = await getBlock( screen, 'Spacer' );
|
|
213
|
+
fireEvent.press( spacerBlock );
|
|
214
|
+
|
|
215
|
+
// Add More block
|
|
216
|
+
await addBlock( screen, 'More' );
|
|
217
|
+
|
|
218
|
+
// Get More block
|
|
219
|
+
const moreBlock = await getBlock( screen, 'More', { rowIndex: 2 } );
|
|
220
|
+
expect( moreBlock ).toBeVisible();
|
|
221
|
+
|
|
222
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
223
|
+
} );
|
|
224
|
+
|
|
225
|
+
it( 'inserts block at the end of post when no block is selected', async () => {
|
|
226
|
+
const screen = await initializeEditor();
|
|
227
|
+
const { getAllByLabelText } = screen;
|
|
228
|
+
|
|
229
|
+
// Add Spacer block
|
|
230
|
+
await addBlock( screen, 'Spacer' );
|
|
231
|
+
|
|
232
|
+
// Add Heading block
|
|
233
|
+
await addBlock( screen, 'Heading' );
|
|
234
|
+
|
|
235
|
+
// Select the title
|
|
236
|
+
const titleInputElement = await getAllByLabelText(
|
|
237
|
+
'Post title. test'
|
|
238
|
+
)[ 0 ];
|
|
239
|
+
expect( titleInputElement ).toBeVisible();
|
|
240
|
+
fireEvent.press( titleInputElement );
|
|
241
|
+
|
|
242
|
+
// Add More block
|
|
243
|
+
await addBlock( screen, 'More' );
|
|
244
|
+
|
|
245
|
+
// Get More block
|
|
246
|
+
const moreBlock = await getBlock( screen, 'More', { rowIndex: 3 } );
|
|
247
|
+
expect( moreBlock ).toBeVisible();
|
|
248
|
+
|
|
249
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
250
|
+
} );
|
|
251
|
+
|
|
252
|
+
it( 'creates a new Paragraph block tapping on the empty area below the last block', async () => {
|
|
253
|
+
const screen = await initializeEditor();
|
|
254
|
+
const { getByLabelText } = screen;
|
|
255
|
+
|
|
256
|
+
// Add Spacer block
|
|
257
|
+
await addBlock( screen, 'Spacer' );
|
|
258
|
+
|
|
259
|
+
// Add Heading block
|
|
260
|
+
await addBlock( screen, 'Heading' );
|
|
261
|
+
|
|
262
|
+
// Get the empty paragraph placeholder
|
|
263
|
+
const paragraphPlaceholder = await getByLabelText(
|
|
264
|
+
'Add paragraph block'
|
|
265
|
+
);
|
|
266
|
+
fireEvent.press( paragraphPlaceholder );
|
|
267
|
+
|
|
268
|
+
// Get Paragraph block
|
|
269
|
+
const paragraphBlock = await getBlock( screen, 'Paragraph', {
|
|
270
|
+
rowIndex: 3,
|
|
271
|
+
} );
|
|
272
|
+
expect( paragraphBlock ).toBeVisible();
|
|
273
|
+
|
|
274
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
275
|
+
} );
|
|
276
|
+
} );
|
|
23
277
|
} );
|
|
@@ -107,12 +107,6 @@ function InserterListItem( {
|
|
|
107
107
|
onHover( null );
|
|
108
108
|
}
|
|
109
109
|
} }
|
|
110
|
-
onFocus={ () => {
|
|
111
|
-
if ( isDragging.current ) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
onHover( item );
|
|
115
|
-
} }
|
|
116
110
|
onMouseEnter={ () => {
|
|
117
111
|
if ( isDragging.current ) {
|
|
118
112
|
return;
|
|
@@ -120,7 +114,6 @@ function InserterListItem( {
|
|
|
120
114
|
onHover( item );
|
|
121
115
|
} }
|
|
122
116
|
onMouseLeave={ () => onHover( null ) }
|
|
123
|
-
onBlur={ () => onHover( null ) }
|
|
124
117
|
{ ...props }
|
|
125
118
|
>
|
|
126
119
|
<span
|
|
@@ -188,9 +188,7 @@ Inspector Advanced Controls appear under the _Advanced_ panel of a block's [Insp
|
|
|
188
188
|
### Usage
|
|
189
189
|
|
|
190
190
|
```js
|
|
191
|
-
import {
|
|
192
|
-
TextControl,
|
|
193
|
-
} from '@wordpress/components';
|
|
191
|
+
import { TextControl } from '@wordpress/components';
|
|
194
192
|
import {
|
|
195
193
|
InspectorControls,
|
|
196
194
|
InspectorAdvancedControls,
|
|
@@ -199,11 +197,9 @@ import {
|
|
|
199
197
|
function MyBlockEdit( { attributes, setAttributes } ) {
|
|
200
198
|
return (
|
|
201
199
|
<>
|
|
202
|
-
<div>
|
|
203
|
-
{ /* Block markup goes here */ }
|
|
204
|
-
</div
|
|
200
|
+
<div>{ /* Block markup goes here */ }</div>
|
|
205
201
|
<InspectorControls>
|
|
206
|
-
{ /* Regular control goes here */
|
|
202
|
+
{ /* Regular control goes here */ }
|
|
207
203
|
</InspectorControls>
|
|
208
204
|
<InspectorAdvancedControls>
|
|
209
205
|
<TextControl
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
__experimentalToolsPanelContext as ToolsPanelContext,
|
|
12
12
|
} from '@wordpress/components';
|
|
13
13
|
import warning from '@wordpress/warning';
|
|
14
|
+
import deprecated from '@wordpress/deprecated';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Internal dependencies
|
|
@@ -19,9 +20,22 @@ import useDisplayBlockControls from '../use-display-block-controls';
|
|
|
19
20
|
import groups from './groups';
|
|
20
21
|
|
|
21
22
|
export default function InspectorControlsFill( {
|
|
22
|
-
__experimentalGroup: group = 'default',
|
|
23
23
|
children,
|
|
24
|
+
group = 'default',
|
|
25
|
+
__experimentalGroup,
|
|
24
26
|
} ) {
|
|
27
|
+
if ( __experimentalGroup ) {
|
|
28
|
+
deprecated(
|
|
29
|
+
'`__experimentalGroup` property in `InspectorControlsFill`',
|
|
30
|
+
{
|
|
31
|
+
since: '6.2',
|
|
32
|
+
version: '6.4',
|
|
33
|
+
alternative: '`group`',
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
group = __experimentalGroup;
|
|
37
|
+
}
|
|
38
|
+
|
|
25
39
|
const isDisplayed = useDisplayBlockControls();
|
|
26
40
|
const Fill = groups[ group ]?.Fill;
|
|
27
41
|
if ( ! Fill ) {
|
|
@@ -9,6 +9,7 @@ import { View } from 'react-native';
|
|
|
9
9
|
import { Children } from '@wordpress/element';
|
|
10
10
|
import { BottomSheetConsumer } from '@wordpress/components';
|
|
11
11
|
import warning from '@wordpress/warning';
|
|
12
|
+
import deprecated from '@wordpress/deprecated';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
@@ -19,9 +20,21 @@ import { BlockSettingsButton } from '../block-settings';
|
|
|
19
20
|
|
|
20
21
|
export default function InspectorControlsFill( {
|
|
21
22
|
children,
|
|
22
|
-
|
|
23
|
+
group = 'default',
|
|
24
|
+
__experimentalGroup,
|
|
23
25
|
...props
|
|
24
26
|
} ) {
|
|
27
|
+
if ( __experimentalGroup ) {
|
|
28
|
+
deprecated(
|
|
29
|
+
'`__experimentalGroup` property in `InspectorControlsFill`',
|
|
30
|
+
{
|
|
31
|
+
since: '6.2',
|
|
32
|
+
version: '6.4',
|
|
33
|
+
alternative: '`group`',
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
group = __experimentalGroup;
|
|
37
|
+
}
|
|
25
38
|
const isDisplayed = useDisplayBlockControls();
|
|
26
39
|
|
|
27
40
|
const Fill = groups[ group ]?.Fill;
|