@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
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
|
|
12
|
+
export const { lock, unlock } =
|
|
13
|
+
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
14
|
+
'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',
|
|
15
|
+
'@wordpress/block-editor'
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Experimental @wordpress/block-editor APIs.
|
|
20
|
+
*/
|
|
21
|
+
export const experiments = {};
|
|
22
|
+
lock( experiments, {
|
|
23
|
+
...globalStyles,
|
|
24
|
+
ExperimentalBlockEditorProvider,
|
|
25
|
+
} );
|
package/src/hooks/anchor.js
CHANGED
|
@@ -68,6 +68,7 @@ export const withInspectorControl = createHigherOrderComponent(
|
|
|
68
68
|
const isWeb = Platform.OS === 'web';
|
|
69
69
|
const textControl = (
|
|
70
70
|
<TextControl
|
|
71
|
+
__nextHasNoMarginBottom
|
|
71
72
|
className="html-anchor-control"
|
|
72
73
|
label={ __( 'HTML anchor' ) }
|
|
73
74
|
help={
|
|
@@ -104,7 +105,7 @@ export const withInspectorControl = createHigherOrderComponent(
|
|
|
104
105
|
<>
|
|
105
106
|
<BlockEdit { ...props } />
|
|
106
107
|
{ isWeb && (
|
|
107
|
-
<InspectorControls
|
|
108
|
+
<InspectorControls group="advanced">
|
|
108
109
|
{ textControl }
|
|
109
110
|
</InspectorControls>
|
|
110
111
|
) }
|
package/src/hooks/border.js
CHANGED
|
@@ -255,7 +255,7 @@ export function BorderPanel( props ) {
|
|
|
255
255
|
const hydratedBorder = getBorderObject( attributes, colors );
|
|
256
256
|
|
|
257
257
|
return (
|
|
258
|
-
<InspectorControls
|
|
258
|
+
<InspectorControls group="border">
|
|
259
259
|
{ ( isWidthSupported || isColorSupported ) && (
|
|
260
260
|
<ToolsPanelItem
|
|
261
261
|
hasValue={ () => hasBorderValue( props ) }
|
|
@@ -65,6 +65,7 @@ export function ChildLayoutEdit( {
|
|
|
65
65
|
return (
|
|
66
66
|
<>
|
|
67
67
|
<ToggleGroupControl
|
|
68
|
+
__nextHasNoMarginBottom
|
|
68
69
|
size={ '__unstable-large' }
|
|
69
70
|
label={ childLayoutOrientation( parentLayout ) }
|
|
70
71
|
value={ selfStretch || 'fit' }
|
|
@@ -134,9 +135,13 @@ export function hasChildLayoutSupport( {
|
|
|
134
135
|
} ) {
|
|
135
136
|
const {
|
|
136
137
|
type: parentLayoutType = 'default',
|
|
138
|
+
default: { type: defaultParentLayoutType = 'default' } = {},
|
|
137
139
|
allowSizingOnChildren = false,
|
|
138
140
|
} = parentLayout;
|
|
139
|
-
|
|
141
|
+
|
|
142
|
+
const support =
|
|
143
|
+
( defaultParentLayoutType === 'flex' || parentLayoutType === 'flex' ) &&
|
|
144
|
+
allowSizingOnChildren;
|
|
140
145
|
|
|
141
146
|
return support;
|
|
142
147
|
}
|
package/src/hooks/color-panel.js
CHANGED
|
@@ -75,7 +75,7 @@ export default function ColorPanel( {
|
|
|
75
75
|
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
|
76
76
|
|
|
77
77
|
return (
|
|
78
|
-
<InspectorControls
|
|
78
|
+
<InspectorControls group="color">
|
|
79
79
|
<ColorGradientSettingsDropdown
|
|
80
80
|
enableAlpha={ enableAlpha }
|
|
81
81
|
panelId={ clientId }
|
package/src/hooks/color.js
CHANGED
|
@@ -544,9 +544,9 @@ export const withColorPaletteStyles = createHigherOrderComponent(
|
|
|
544
544
|
( BlockListBlock ) => ( props ) => {
|
|
545
545
|
const { name, attributes } = props;
|
|
546
546
|
const { backgroundColor, textColor } = attributes;
|
|
547
|
-
const userPalette = useSetting( 'color.palette.custom' )
|
|
548
|
-
const themePalette = useSetting( 'color.palette.theme' )
|
|
549
|
-
const defaultPalette = useSetting( 'color.palette.default' )
|
|
547
|
+
const userPalette = useSetting( 'color.palette.custom' );
|
|
548
|
+
const themePalette = useSetting( 'color.palette.theme' );
|
|
549
|
+
const defaultPalette = useSetting( 'color.palette.default' );
|
|
550
550
|
const colors = useMemo(
|
|
551
551
|
() => [
|
|
552
552
|
...( userPalette || [] ),
|
|
@@ -59,8 +59,9 @@ export const withInspectorControl = createHigherOrderComponent(
|
|
|
59
59
|
return (
|
|
60
60
|
<>
|
|
61
61
|
<BlockEdit { ...props } />
|
|
62
|
-
<InspectorControls
|
|
62
|
+
<InspectorControls group="advanced">
|
|
63
63
|
<TextControl
|
|
64
|
+
__nextHasNoMarginBottom
|
|
64
65
|
autoComplete="off"
|
|
65
66
|
label={ __( 'Additional CSS class(es)' ) }
|
|
66
67
|
value={ props.attributes.className || '' }
|
package/src/hooks/dimensions.js
CHANGED
|
@@ -59,6 +59,7 @@ import {
|
|
|
59
59
|
} from './child-layout';
|
|
60
60
|
import useSetting from '../components/use-setting';
|
|
61
61
|
import { store as blockEditorStore } from '../store';
|
|
62
|
+
import { unlock } from '../experiments';
|
|
62
63
|
|
|
63
64
|
export const DIMENSIONS_SUPPORT_KEY = 'dimensions';
|
|
64
65
|
export const SPACING_SUPPORT_KEY = 'spacing';
|
|
@@ -67,10 +68,9 @@ export const AXIAL_SIDES = [ 'vertical', 'horizontal' ];
|
|
|
67
68
|
|
|
68
69
|
function useVisualizerMouseOver() {
|
|
69
70
|
const [ isMouseOver, setIsMouseOver ] = useState( false );
|
|
70
|
-
const {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} = useDispatch( blockEditorStore );
|
|
71
|
+
const { hideBlockInterface, showBlockInterface } = unlock(
|
|
72
|
+
useDispatch( blockEditorStore )
|
|
73
|
+
);
|
|
74
74
|
const onMouseOver = ( e ) => {
|
|
75
75
|
e.stopPropagation();
|
|
76
76
|
hideBlockInterface();
|
|
@@ -137,7 +137,7 @@ export function DimensionsPanel( props ) {
|
|
|
137
137
|
|
|
138
138
|
return (
|
|
139
139
|
<>
|
|
140
|
-
<InspectorControls
|
|
140
|
+
<InspectorControls group="dimensions">
|
|
141
141
|
{ ! isPaddingDisabled && (
|
|
142
142
|
<ToolsPanelItem
|
|
143
143
|
className={ spacingClassnames }
|
|
@@ -301,7 +301,7 @@ const useIsDimensionsDisabled = ( props = {} ) => {
|
|
|
301
301
|
* @param {string} blockName Block name.
|
|
302
302
|
* @param {string} feature The feature custom sides relate to e.g. padding or margins.
|
|
303
303
|
*
|
|
304
|
-
* @return {
|
|
304
|
+
* @return {string[] | undefined} Strings representing the custom sides available.
|
|
305
305
|
*/
|
|
306
306
|
export function useCustomSides( blockName, feature ) {
|
|
307
307
|
const support = getBlockSupport( blockName, SPACING_SUPPORT_KEY );
|
package/src/hooks/index.js
CHANGED
package/src/hooks/layout.scss
CHANGED
package/src/hooks/margin.js
CHANGED
|
@@ -237,6 +237,7 @@ export function MarginVisualizer( { clientId, attributes, forceShow } ) {
|
|
|
237
237
|
clientId={ clientId }
|
|
238
238
|
__unstableCoverTarget
|
|
239
239
|
__unstableRefreshSize={ margin }
|
|
240
|
+
__unstablePopoverSlot="block-toolbar"
|
|
240
241
|
shift={ false }
|
|
241
242
|
>
|
|
242
243
|
<div className="block-editor__padding-visualizer" style={ style } />
|
package/src/hooks/metadata.js
CHANGED
package/src/hooks/padding.js
CHANGED
|
@@ -226,6 +226,7 @@ export function PaddingVisualizer( { clientId, attributes, forceShow } ) {
|
|
|
226
226
|
clientId={ clientId }
|
|
227
227
|
__unstableCoverTarget
|
|
228
228
|
__unstableRefreshSize={ padding }
|
|
229
|
+
__unstablePopoverSlot="block-toolbar"
|
|
229
230
|
shift={ false }
|
|
230
231
|
>
|
|
231
232
|
<div className="block-editor__padding-visualizer" style={ style } />
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
10
|
+
import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
|
|
11
|
+
import { BaseControl, CustomSelectControl } from '@wordpress/components';
|
|
12
|
+
import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';
|
|
13
|
+
import { useSelect } from '@wordpress/data';
|
|
14
|
+
import {
|
|
15
|
+
useContext,
|
|
16
|
+
useMemo,
|
|
17
|
+
createPortal,
|
|
18
|
+
Platform,
|
|
19
|
+
} from '@wordpress/element';
|
|
20
|
+
import { addFilter } from '@wordpress/hooks';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
import BlockList from '../components/block-list';
|
|
26
|
+
import useSetting from '../components/use-setting';
|
|
27
|
+
import InspectorControls from '../components/inspector-controls';
|
|
28
|
+
import { cleanEmptyObject } from './utils';
|
|
29
|
+
import { store as blockEditorStore } from '../store';
|
|
30
|
+
|
|
31
|
+
const POSITION_SUPPORT_KEY = 'position';
|
|
32
|
+
|
|
33
|
+
const OPTION_CLASSNAME =
|
|
34
|
+
'block-editor-hooks__position-selection__select-control__option';
|
|
35
|
+
|
|
36
|
+
const DEFAULT_OPTION = {
|
|
37
|
+
key: 'default',
|
|
38
|
+
value: '',
|
|
39
|
+
name: __( 'Default' ),
|
|
40
|
+
className: OPTION_CLASSNAME,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const STICKY_OPTION = {
|
|
44
|
+
key: 'sticky',
|
|
45
|
+
value: 'sticky',
|
|
46
|
+
name: __( 'Sticky' ),
|
|
47
|
+
className: OPTION_CLASSNAME,
|
|
48
|
+
__experimentalHint: __(
|
|
49
|
+
'The block will stick to the top of the window instead of scrolling.'
|
|
50
|
+
),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const FIXED_OPTION = {
|
|
54
|
+
key: 'fixed',
|
|
55
|
+
value: 'fixed',
|
|
56
|
+
name: __( 'Fixed' ),
|
|
57
|
+
className: OPTION_CLASSNAME,
|
|
58
|
+
__experimentalHint: __(
|
|
59
|
+
'The block will not move when the page is scrolled.'
|
|
60
|
+
),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const POSITION_SIDES = [ 'top', 'right', 'bottom', 'left' ];
|
|
64
|
+
const VALID_POSITION_TYPES = [ 'sticky', 'fixed' ];
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Get calculated position CSS.
|
|
68
|
+
*
|
|
69
|
+
* @param {Object} props Component props.
|
|
70
|
+
* @param {string} props.selector Selector to use.
|
|
71
|
+
* @param {Object} props.style Style object.
|
|
72
|
+
* @return {string} The generated CSS rules.
|
|
73
|
+
*/
|
|
74
|
+
export function getPositionCSS( { selector, style } ) {
|
|
75
|
+
let output = '';
|
|
76
|
+
|
|
77
|
+
const { type: positionType } = style?.position || {};
|
|
78
|
+
|
|
79
|
+
if ( ! VALID_POSITION_TYPES.includes( positionType ) ) {
|
|
80
|
+
return output;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
output += `${ selector } {`;
|
|
84
|
+
output += `position: ${ positionType };`;
|
|
85
|
+
|
|
86
|
+
POSITION_SIDES.forEach( ( side ) => {
|
|
87
|
+
if ( style?.position?.[ side ] !== undefined ) {
|
|
88
|
+
output += `${ side }: ${ style.position[ side ] };`;
|
|
89
|
+
}
|
|
90
|
+
} );
|
|
91
|
+
|
|
92
|
+
if ( positionType === 'sticky' || positionType === 'fixed' ) {
|
|
93
|
+
// TODO: Replace hard-coded z-index value with a z-index preset approach in theme.json.
|
|
94
|
+
output += `z-index: 10`;
|
|
95
|
+
}
|
|
96
|
+
output += `}`;
|
|
97
|
+
|
|
98
|
+
return output;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Determines if there is sticky position support.
|
|
103
|
+
*
|
|
104
|
+
* @param {string|Object} blockType Block name or Block Type object.
|
|
105
|
+
*
|
|
106
|
+
* @return {boolean} Whether there is support.
|
|
107
|
+
*/
|
|
108
|
+
export function hasStickyPositionSupport( blockType ) {
|
|
109
|
+
const support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );
|
|
110
|
+
return !! ( true === support || support?.sticky );
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Determines if there is fixed position support.
|
|
115
|
+
*
|
|
116
|
+
* @param {string|Object} blockType Block name or Block Type object.
|
|
117
|
+
*
|
|
118
|
+
* @return {boolean} Whether there is support.
|
|
119
|
+
*/
|
|
120
|
+
export function hasFixedPositionSupport( blockType ) {
|
|
121
|
+
const support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );
|
|
122
|
+
return !! ( true === support || support?.fixed );
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Determines if there is position support.
|
|
127
|
+
*
|
|
128
|
+
* @param {string|Object} blockType Block name or Block Type object.
|
|
129
|
+
*
|
|
130
|
+
* @return {boolean} Whether there is support.
|
|
131
|
+
*/
|
|
132
|
+
export function hasPositionSupport( blockType ) {
|
|
133
|
+
const support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );
|
|
134
|
+
return !! support;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Checks if there is a current value in the position block support attributes.
|
|
139
|
+
*
|
|
140
|
+
* @param {Object} props Block props.
|
|
141
|
+
* @return {boolean} Whether or not the block has a position value set.
|
|
142
|
+
*/
|
|
143
|
+
export function hasPositionValue( props ) {
|
|
144
|
+
return props.attributes.style?.position?.type !== undefined;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Checks if the block is currently set to a sticky or fixed position.
|
|
149
|
+
* This check is helpful for determining how to position block toolbars or other elements.
|
|
150
|
+
*
|
|
151
|
+
* @param {Object} attributes Block attributes.
|
|
152
|
+
* @return {boolean} Whether or not the block is set to a sticky or fixed position.
|
|
153
|
+
*/
|
|
154
|
+
export function hasStickyOrFixedPositionValue( attributes ) {
|
|
155
|
+
const positionType = attributes.style?.position?.type;
|
|
156
|
+
return positionType === 'sticky' || positionType === 'fixed';
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Resets the position block support attributes. This can be used when disabling
|
|
161
|
+
* the position support controls for a block via a `ToolsPanel`.
|
|
162
|
+
*
|
|
163
|
+
* @param {Object} props Block props.
|
|
164
|
+
* @param {Object} props.attributes Block's attributes.
|
|
165
|
+
* @param {Object} props.setAttributes Function to set block's attributes.
|
|
166
|
+
*/
|
|
167
|
+
export function resetPosition( { attributes = {}, setAttributes } ) {
|
|
168
|
+
const { style = {} } = attributes;
|
|
169
|
+
|
|
170
|
+
setAttributes( {
|
|
171
|
+
style: cleanEmptyObject( {
|
|
172
|
+
...style,
|
|
173
|
+
position: {
|
|
174
|
+
...style?.position,
|
|
175
|
+
type: undefined,
|
|
176
|
+
top: undefined,
|
|
177
|
+
right: undefined,
|
|
178
|
+
bottom: undefined,
|
|
179
|
+
left: undefined,
|
|
180
|
+
},
|
|
181
|
+
} ),
|
|
182
|
+
} );
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Custom hook that checks if position settings have been disabled.
|
|
187
|
+
*
|
|
188
|
+
* @param {string} name The name of the block.
|
|
189
|
+
*
|
|
190
|
+
* @return {boolean} Whether padding setting is disabled.
|
|
191
|
+
*/
|
|
192
|
+
export function useIsPositionDisabled( { name: blockName } = {} ) {
|
|
193
|
+
const allowFixed = useSetting( 'position.fixed' );
|
|
194
|
+
const allowSticky = useSetting( 'position.sticky' );
|
|
195
|
+
const isDisabled = ! allowFixed && ! allowSticky;
|
|
196
|
+
|
|
197
|
+
return ! hasPositionSupport( blockName ) || isDisabled;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/*
|
|
201
|
+
* Position controls rendered in an inspector control panel.
|
|
202
|
+
*
|
|
203
|
+
* @param {Object} props
|
|
204
|
+
*
|
|
205
|
+
* @return {WPElement} Position panel.
|
|
206
|
+
*/
|
|
207
|
+
export function PositionPanel( props ) {
|
|
208
|
+
const {
|
|
209
|
+
attributes: { style = {} },
|
|
210
|
+
clientId,
|
|
211
|
+
name: blockName,
|
|
212
|
+
setAttributes,
|
|
213
|
+
} = props;
|
|
214
|
+
|
|
215
|
+
const allowFixed = hasFixedPositionSupport( blockName );
|
|
216
|
+
const allowSticky = hasStickyPositionSupport( blockName );
|
|
217
|
+
const value = style?.position?.type;
|
|
218
|
+
|
|
219
|
+
const { hasParents } = useSelect(
|
|
220
|
+
( select ) => {
|
|
221
|
+
const { getBlockParents } = select( blockEditorStore );
|
|
222
|
+
const parents = getBlockParents( clientId );
|
|
223
|
+
return {
|
|
224
|
+
hasParents: parents.length,
|
|
225
|
+
};
|
|
226
|
+
},
|
|
227
|
+
[ clientId ]
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
const options = useMemo( () => {
|
|
231
|
+
const availableOptions = [ DEFAULT_OPTION ];
|
|
232
|
+
// Only display sticky option if the block has no parents (is at the root of the document),
|
|
233
|
+
// or if the block already has a sticky position value set.
|
|
234
|
+
if (
|
|
235
|
+
( allowSticky && ! hasParents ) ||
|
|
236
|
+
value === STICKY_OPTION.value
|
|
237
|
+
) {
|
|
238
|
+
availableOptions.push( STICKY_OPTION );
|
|
239
|
+
}
|
|
240
|
+
if ( allowFixed || value === FIXED_OPTION.value ) {
|
|
241
|
+
availableOptions.push( FIXED_OPTION );
|
|
242
|
+
}
|
|
243
|
+
return availableOptions;
|
|
244
|
+
}, [ allowFixed, allowSticky, hasParents, value ] );
|
|
245
|
+
|
|
246
|
+
const onChangeType = ( next ) => {
|
|
247
|
+
// For now, use a hard-coded `0px` value for the position.
|
|
248
|
+
// `0px` is preferred over `0` as it can be used in `calc()` functions.
|
|
249
|
+
// In the future, it could be useful to allow for an offset value.
|
|
250
|
+
const placementValue = '0px';
|
|
251
|
+
|
|
252
|
+
const newStyle = {
|
|
253
|
+
...style,
|
|
254
|
+
position: {
|
|
255
|
+
...style?.position,
|
|
256
|
+
type: next,
|
|
257
|
+
top:
|
|
258
|
+
next === 'sticky' || next === 'fixed'
|
|
259
|
+
? placementValue
|
|
260
|
+
: undefined,
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
setAttributes( {
|
|
265
|
+
style: cleanEmptyObject( newStyle ),
|
|
266
|
+
} );
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
const selectedOption = value
|
|
270
|
+
? options.find( ( option ) => option.value === value ) || DEFAULT_OPTION
|
|
271
|
+
: DEFAULT_OPTION;
|
|
272
|
+
|
|
273
|
+
// Only display position controls if there is at least one option to choose from.
|
|
274
|
+
return Platform.select( {
|
|
275
|
+
web:
|
|
276
|
+
options.length > 1 ? (
|
|
277
|
+
<InspectorControls group="position">
|
|
278
|
+
<BaseControl className="block-editor-hooks__position-selection">
|
|
279
|
+
<CustomSelectControl
|
|
280
|
+
__nextUnconstrainedWidth
|
|
281
|
+
__next36pxDefaultSize
|
|
282
|
+
className="block-editor-hooks__position-selection__select-control"
|
|
283
|
+
label={ __( 'Position' ) }
|
|
284
|
+
hideLabelFromVision
|
|
285
|
+
describedBy={ sprintf(
|
|
286
|
+
// translators: %s: Currently selected position.
|
|
287
|
+
__( 'Currently selected position: %s' ),
|
|
288
|
+
selectedOption.name
|
|
289
|
+
) }
|
|
290
|
+
options={ options }
|
|
291
|
+
value={ selectedOption }
|
|
292
|
+
__experimentalShowSelectedHint
|
|
293
|
+
onChange={ ( { selectedItem } ) => {
|
|
294
|
+
onChangeType( selectedItem.value );
|
|
295
|
+
} }
|
|
296
|
+
size={ '__unstable-large' }
|
|
297
|
+
/>
|
|
298
|
+
</BaseControl>
|
|
299
|
+
</InspectorControls>
|
|
300
|
+
) : null,
|
|
301
|
+
native: null,
|
|
302
|
+
} );
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Override the default edit UI to include position controls.
|
|
307
|
+
*
|
|
308
|
+
* @param {Function} BlockEdit Original component.
|
|
309
|
+
*
|
|
310
|
+
* @return {Function} Wrapped component.
|
|
311
|
+
*/
|
|
312
|
+
export const withInspectorControls = createHigherOrderComponent(
|
|
313
|
+
( BlockEdit ) => ( props ) => {
|
|
314
|
+
const { name: blockName } = props;
|
|
315
|
+
const positionSupport = hasBlockSupport(
|
|
316
|
+
blockName,
|
|
317
|
+
POSITION_SUPPORT_KEY
|
|
318
|
+
);
|
|
319
|
+
const showPositionControls =
|
|
320
|
+
positionSupport && ! useIsPositionDisabled( props );
|
|
321
|
+
|
|
322
|
+
return [
|
|
323
|
+
showPositionControls && (
|
|
324
|
+
<PositionPanel key="position" { ...props } />
|
|
325
|
+
),
|
|
326
|
+
<BlockEdit key="edit" { ...props } />,
|
|
327
|
+
];
|
|
328
|
+
},
|
|
329
|
+
'withInspectorControls'
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Override the default block element to add the position styles.
|
|
334
|
+
*
|
|
335
|
+
* @param {Function} BlockListBlock Original component.
|
|
336
|
+
*
|
|
337
|
+
* @return {Function} Wrapped component.
|
|
338
|
+
*/
|
|
339
|
+
export const withPositionStyles = createHigherOrderComponent(
|
|
340
|
+
( BlockListBlock ) => ( props ) => {
|
|
341
|
+
const { name, attributes } = props;
|
|
342
|
+
const hasPositionBlockSupport = hasBlockSupport(
|
|
343
|
+
name,
|
|
344
|
+
POSITION_SUPPORT_KEY
|
|
345
|
+
);
|
|
346
|
+
const allowPositionStyles =
|
|
347
|
+
hasPositionBlockSupport && ! useIsPositionDisabled( props );
|
|
348
|
+
|
|
349
|
+
const id = useInstanceId( BlockListBlock );
|
|
350
|
+
const element = useContext( BlockList.__unstableElementContext );
|
|
351
|
+
|
|
352
|
+
// Higher specificity to override defaults in editor UI.
|
|
353
|
+
const positionSelector = `.wp-container-${ id }.wp-container-${ id }`;
|
|
354
|
+
|
|
355
|
+
// Get CSS string for the current position values.
|
|
356
|
+
let css;
|
|
357
|
+
if ( allowPositionStyles ) {
|
|
358
|
+
css =
|
|
359
|
+
getPositionCSS( {
|
|
360
|
+
selector: positionSelector,
|
|
361
|
+
style: attributes?.style,
|
|
362
|
+
} ) || '';
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Attach a `wp-container-` id-based class name.
|
|
366
|
+
const className = classnames( props?.className, {
|
|
367
|
+
[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.
|
|
368
|
+
} );
|
|
369
|
+
|
|
370
|
+
return (
|
|
371
|
+
<>
|
|
372
|
+
{ allowPositionStyles &&
|
|
373
|
+
element &&
|
|
374
|
+
!! css &&
|
|
375
|
+
createPortal( <style>{ css }</style>, element ) }
|
|
376
|
+
<BlockListBlock { ...props } className={ className } />
|
|
377
|
+
</>
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
addFilter(
|
|
383
|
+
'editor.BlockListBlock',
|
|
384
|
+
'core/editor/position/with-position-styles',
|
|
385
|
+
withPositionStyles
|
|
386
|
+
);
|
|
387
|
+
addFilter(
|
|
388
|
+
'editor.BlockEdit',
|
|
389
|
+
'core/editor/position/with-inspector-controls',
|
|
390
|
+
withInspectorControls
|
|
391
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.block-editor-hooks__position-selection__select-control {
|
|
2
|
+
.components-custom-select-control__hint {
|
|
3
|
+
display: none;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.block-editor-hooks__position-selection__select-control__option {
|
|
8
|
+
&.has-hint {
|
|
9
|
+
grid-template-columns: auto 30px;
|
|
10
|
+
line-height: $default-line-height;
|
|
11
|
+
margin-bottom: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.components-custom-select-control__item-hint {
|
|
15
|
+
grid-row: 2;
|
|
16
|
+
text-align: left;
|
|
17
|
+
}
|
|
18
|
+
}
|