@wordpress/block-editor 11.2.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 +5 -0
- 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-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 +15 -14
- 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 -11
- 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 -6
- 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-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-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/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/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/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 +1 -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 +7 -1
- 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 +5 -4
- 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 +1 -0
- 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 +4 -0
- 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 +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.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 +17 -12
- 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/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 +50 -3
- package/build/components/off-canvas-editor/appender.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 +6 -27
- 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 +11 -16
- 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 +21 -9
- 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/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-popover/image-url-input-ui.js +7 -8
- package/build/components/url-popover/image-url-input-ui.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/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/margin.js +1 -0
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +1 -0
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +34 -15
- package/build/hooks/position.js.map +1 -1
- 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 +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +60 -34
- 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-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 +15 -14
- 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 -11
- 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 -6
- 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-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-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/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/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/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 +1 -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 +7 -1
- 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 +5 -4
- 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 +1 -0
- 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 +4 -0
- 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 +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.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 +17 -12
- 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/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 +47 -4
- package/build-module/components/off-canvas-editor/appender.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 +6 -25
- 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 +11 -15
- 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 +16 -9
- 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/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-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/use-block-display-information/index.js +1 -1
- package/build-module/components/use-block-display-information/index.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/margin.js +1 -0
- package/build-module/hooks/margin.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 +31 -14
- package/build-module/hooks/position.js.map +1 -1
- 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 +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +48 -25
- 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 +283 -3
- package/build-style/content.css +283 -3
- package/build-style/style-rtl.css +105 -221
- package/build-style/style.css +105 -221
- 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-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 +13 -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 +9 -11
- 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 +13 -5
- package/src/components/block-settings-menu-controls/index.js +2 -10
- 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-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/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/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/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/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 +1 -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 +7 -0
- 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 +3 -4
- 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 +1 -0
- 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-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 +3 -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 +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +5 -7
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +21 -10
- package/src/components/justify-content-control/ui.js +9 -0
- package/src/components/link-control/index.js +59 -23
- package/src/components/link-control/style.scss +7 -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/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 +93 -37
- package/src/components/off-canvas-editor/block-select-button.js +12 -1
- package/src/components/off-canvas-editor/block.js +3 -42
- package/src/components/off-canvas-editor/branch.js +32 -5
- package/src/components/off-canvas-editor/index.js +10 -25
- 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 -14
- 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/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/test/button.js +24 -24
- package/src/components/url-popover/image-url-input-ui.js +7 -8
- package/src/components/url-popover/style.scss +0 -10
- package/src/components/use-block-display-information/index.js +1 -1
- package/src/components/warning/{style.scss → content.scss} +0 -0
- package/src/components/warning/test/index.js +1 -5
- package/src/content.scss +7 -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/layout.scss +4 -0
- package/src/hooks/margin.js +1 -0
- package/src/hooks/padding.js +1 -0
- package/src/hooks/position.js +52 -36
- package/src/hooks/test/align.native.js +1 -1
- 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 +1 -1
- package/src/store/selectors.js +103 -52
- 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/selectors.js +52 -30
- package/src/style.scss +3 -5
- 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
package/src/hooks/position.js
CHANGED
|
@@ -10,6 +10,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
|
|
10
10
|
import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
|
|
11
11
|
import { BaseControl, CustomSelectControl } from '@wordpress/components';
|
|
12
12
|
import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';
|
|
13
|
+
import { useSelect } from '@wordpress/data';
|
|
13
14
|
import {
|
|
14
15
|
useContext,
|
|
15
16
|
useMemo,
|
|
@@ -25,6 +26,7 @@ import BlockList from '../components/block-list';
|
|
|
25
26
|
import useSetting from '../components/use-setting';
|
|
26
27
|
import InspectorControls from '../components/inspector-controls';
|
|
27
28
|
import { cleanEmptyObject } from './utils';
|
|
29
|
+
import { store as blockEditorStore } from '../store';
|
|
28
30
|
|
|
29
31
|
const POSITION_SUPPORT_KEY = 'position';
|
|
30
32
|
|
|
@@ -196,15 +198,16 @@ export function useIsPositionDisabled( { name: blockName } = {} ) {
|
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
/*
|
|
199
|
-
* Position controls
|
|
201
|
+
* Position controls rendered in an inspector control panel.
|
|
200
202
|
*
|
|
201
203
|
* @param {Object} props
|
|
202
204
|
*
|
|
203
|
-
* @return {WPElement}
|
|
205
|
+
* @return {WPElement} Position panel.
|
|
204
206
|
*/
|
|
205
|
-
export function
|
|
207
|
+
export function PositionPanel( props ) {
|
|
206
208
|
const {
|
|
207
209
|
attributes: { style = {} },
|
|
210
|
+
clientId,
|
|
208
211
|
name: blockName,
|
|
209
212
|
setAttributes,
|
|
210
213
|
} = props;
|
|
@@ -213,16 +216,32 @@ export function PositionEdit( props ) {
|
|
|
213
216
|
const allowSticky = hasStickyPositionSupport( blockName );
|
|
214
217
|
const value = style?.position?.type;
|
|
215
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
|
+
|
|
216
230
|
const options = useMemo( () => {
|
|
217
231
|
const availableOptions = [ DEFAULT_OPTION ];
|
|
218
|
-
if (
|
|
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
|
+
) {
|
|
219
238
|
availableOptions.push( STICKY_OPTION );
|
|
220
239
|
}
|
|
221
240
|
if ( allowFixed || value === FIXED_OPTION.value ) {
|
|
222
241
|
availableOptions.push( FIXED_OPTION );
|
|
223
242
|
}
|
|
224
243
|
return availableOptions;
|
|
225
|
-
}, [ allowFixed, allowSticky, value ] );
|
|
244
|
+
}, [ allowFixed, allowSticky, hasParents, value ] );
|
|
226
245
|
|
|
227
246
|
const onChangeType = ( next ) => {
|
|
228
247
|
// For now, use a hard-coded `0px` value for the position.
|
|
@@ -251,32 +270,34 @@ export function PositionEdit( props ) {
|
|
|
251
270
|
? options.find( ( option ) => option.value === value ) || DEFAULT_OPTION
|
|
252
271
|
: DEFAULT_OPTION;
|
|
253
272
|
|
|
273
|
+
// Only display position controls if there is at least one option to choose from.
|
|
254
274
|
return Platform.select( {
|
|
255
|
-
web:
|
|
256
|
-
|
|
257
|
-
<
|
|
258
|
-
<
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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,
|
|
280
301
|
native: null,
|
|
281
302
|
} );
|
|
282
303
|
}
|
|
@@ -300,12 +321,7 @@ export const withInspectorControls = createHigherOrderComponent(
|
|
|
300
321
|
|
|
301
322
|
return [
|
|
302
323
|
showPositionControls && (
|
|
303
|
-
<
|
|
304
|
-
key="position"
|
|
305
|
-
__experimentalGroup="position"
|
|
306
|
-
>
|
|
307
|
-
<PositionEdit { ...props } />
|
|
308
|
-
</InspectorControls>
|
|
324
|
+
<PositionPanel key="position" { ...props } />
|
|
309
325
|
),
|
|
310
326
|
<BlockEdit key="edit" { ...props } />,
|
|
311
327
|
];
|
|
@@ -83,7 +83,7 @@ describe( 'Align options', () => {
|
|
|
83
83
|
expect( paragraphBlock ).toBeVisible();
|
|
84
84
|
|
|
85
85
|
// Open alignments menu
|
|
86
|
-
const alignmentButtons = getByLabelText( 'Align' );
|
|
86
|
+
const alignmentButtons = getByLabelText( 'Align text' );
|
|
87
87
|
fireEvent.press( alignmentButtons );
|
|
88
88
|
|
|
89
89
|
// Select alignment option.
|
package/src/hooks/test/utils.js
CHANGED
|
@@ -7,9 +7,113 @@ import { applyFilters } from '@wordpress/hooks';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import '../anchor';
|
|
10
|
+
import { immutableSet } from '../utils';
|
|
10
11
|
|
|
11
12
|
const noop = () => {};
|
|
12
13
|
|
|
14
|
+
describe( 'immutableSet', () => {
|
|
15
|
+
describe( 'handling falsy values properly', () => {
|
|
16
|
+
it( 'should create a new object if `undefined` is passed', () => {
|
|
17
|
+
const result = immutableSet( undefined, 'test', 1 );
|
|
18
|
+
|
|
19
|
+
expect( result ).toEqual( { test: 1 } );
|
|
20
|
+
} );
|
|
21
|
+
|
|
22
|
+
it( 'should create a new object if `null` is passed', () => {
|
|
23
|
+
const result = immutableSet( null, 'test', 1 );
|
|
24
|
+
|
|
25
|
+
expect( result ).toEqual( { test: 1 } );
|
|
26
|
+
} );
|
|
27
|
+
|
|
28
|
+
it( 'should create a new object if `false` is passed', () => {
|
|
29
|
+
const result = immutableSet( false, 'test', 1 );
|
|
30
|
+
|
|
31
|
+
expect( result ).toEqual( { test: 1 } );
|
|
32
|
+
} );
|
|
33
|
+
|
|
34
|
+
it( 'should create a new object if `0` is passed', () => {
|
|
35
|
+
const result = immutableSet( 0, 'test', 1 );
|
|
36
|
+
|
|
37
|
+
expect( result ).toEqual( { test: 1 } );
|
|
38
|
+
} );
|
|
39
|
+
|
|
40
|
+
it( 'should create a new object if an empty string is passed', () => {
|
|
41
|
+
const result = immutableSet( '', 'test', 1 );
|
|
42
|
+
|
|
43
|
+
expect( result ).toEqual( { test: 1 } );
|
|
44
|
+
} );
|
|
45
|
+
|
|
46
|
+
it( 'should create a new object if a NaN is passed', () => {
|
|
47
|
+
const result = immutableSet( NaN, 'test', 1 );
|
|
48
|
+
|
|
49
|
+
expect( result ).toEqual( { test: 1 } );
|
|
50
|
+
} );
|
|
51
|
+
} );
|
|
52
|
+
|
|
53
|
+
describe( 'manages data assignment properly', () => {
|
|
54
|
+
it( 'assigns value properly when it does not exist', () => {
|
|
55
|
+
const result = immutableSet( {}, 'test', 1 );
|
|
56
|
+
|
|
57
|
+
expect( result ).toEqual( { test: 1 } );
|
|
58
|
+
} );
|
|
59
|
+
|
|
60
|
+
it( 'overrides existing values', () => {
|
|
61
|
+
const result = immutableSet( { test: 1 }, 'test', 2 );
|
|
62
|
+
|
|
63
|
+
expect( result ).toEqual( { test: 2 } );
|
|
64
|
+
} );
|
|
65
|
+
|
|
66
|
+
describe( 'with array notation access', () => {
|
|
67
|
+
it( 'assigns values at deeper levels', () => {
|
|
68
|
+
const result = immutableSet( {}, [ 'foo', 'bar', 'baz' ], 5 );
|
|
69
|
+
|
|
70
|
+
expect( result ).toEqual( { foo: { bar: { baz: 5 } } } );
|
|
71
|
+
} );
|
|
72
|
+
|
|
73
|
+
it( 'overrides existing values at deeper levels', () => {
|
|
74
|
+
const result = immutableSet(
|
|
75
|
+
{ foo: { bar: { baz: 1 } } },
|
|
76
|
+
[ 'foo', 'bar', 'baz' ],
|
|
77
|
+
5
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
expect( result ).toEqual( { foo: { bar: { baz: 5 } } } );
|
|
81
|
+
} );
|
|
82
|
+
|
|
83
|
+
it( 'keeps other properties intact', () => {
|
|
84
|
+
const result = immutableSet(
|
|
85
|
+
{ foo: { bar: { baz: 1 } } },
|
|
86
|
+
[ 'foo', 'bar', 'test' ],
|
|
87
|
+
5
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
expect( result ).toEqual( {
|
|
91
|
+
foo: { bar: { baz: 1, test: 5 } },
|
|
92
|
+
} );
|
|
93
|
+
} );
|
|
94
|
+
} );
|
|
95
|
+
} );
|
|
96
|
+
|
|
97
|
+
describe( 'does not mutate the original object', () => {
|
|
98
|
+
it( 'clones the object at the first level', () => {
|
|
99
|
+
const input = {};
|
|
100
|
+
const result = immutableSet( input, 'test', 1 );
|
|
101
|
+
|
|
102
|
+
expect( result ).not.toBe( input );
|
|
103
|
+
} );
|
|
104
|
+
|
|
105
|
+
it( 'clones the object at deeper levels', () => {
|
|
106
|
+
const input = { foo: { bar: { baz: 1 } } };
|
|
107
|
+
const result = immutableSet( input, [ 'foo', 'bar', 'baz' ], 2 );
|
|
108
|
+
|
|
109
|
+
expect( result ).not.toBe( input );
|
|
110
|
+
expect( result.foo ).not.toBe( input.foo );
|
|
111
|
+
expect( result.foo.bar ).not.toBe( input.foo.bar );
|
|
112
|
+
expect( result.foo.bar.baz ).not.toBe( input.foo.bar.baz );
|
|
113
|
+
} );
|
|
114
|
+
} );
|
|
115
|
+
} );
|
|
116
|
+
|
|
13
117
|
describe( 'anchor', () => {
|
|
14
118
|
const blockSettings = {
|
|
15
119
|
save: noop,
|
package/src/hooks/typography.js
CHANGED
|
@@ -111,7 +111,7 @@ export function TypographyPanel( props ) {
|
|
|
111
111
|
} );
|
|
112
112
|
|
|
113
113
|
return (
|
|
114
|
-
<InspectorControls
|
|
114
|
+
<InspectorControls group="typography">
|
|
115
115
|
{ ! isFontFamilyDisabled && (
|
|
116
116
|
<ToolsPanelItem
|
|
117
117
|
hasValue={ () => hasFontFamilyValue( props ) }
|
|
@@ -92,9 +92,9 @@ export function useColorProps( attributes ) {
|
|
|
92
92
|
// Some color settings have a special handling for deprecated flags in `useSetting`,
|
|
93
93
|
// so we can't unwrap them by doing const { ... } = useSetting('color')
|
|
94
94
|
// until https://github.com/WordPress/gutenberg/issues/37094 is fixed.
|
|
95
|
-
const userPalette = useSetting( 'color.palette.custom' )
|
|
96
|
-
const themePalette = useSetting( 'color.palette.theme' )
|
|
97
|
-
const defaultPalette = useSetting( 'color.palette.default' )
|
|
95
|
+
const userPalette = useSetting( 'color.palette.custom' );
|
|
96
|
+
const themePalette = useSetting( 'color.palette.theme' );
|
|
97
|
+
const defaultPalette = useSetting( 'color.palette.default' );
|
|
98
98
|
const gradientsPerOrigin = useSetting( 'color.gradients' ) || EMPTY_OBJECT;
|
|
99
99
|
const colors = useMemo(
|
|
100
100
|
() => [
|
package/src/hooks/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { isEmpty, mapValues, get
|
|
4
|
+
import { isEmpty, mapValues, get } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -30,8 +30,74 @@ export const cleanEmptyObject = ( object ) => {
|
|
|
30
30
|
return isEmpty( cleanedNestedObjects ) ? undefined : cleanedNestedObjects;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Converts a path to an array of its fragments.
|
|
35
|
+
* Supports strings, numbers and arrays:
|
|
36
|
+
*
|
|
37
|
+
* 'foo' => [ 'foo' ]
|
|
38
|
+
* 2 => [ '2' ]
|
|
39
|
+
* [ 'foo', 'bar' ] => [ 'foo', 'bar' ]
|
|
40
|
+
*
|
|
41
|
+
* @param {string|number|Array} path Path
|
|
42
|
+
* @return {Array} Normalized path.
|
|
43
|
+
*/
|
|
44
|
+
function normalizePath( path ) {
|
|
45
|
+
if ( Array.isArray( path ) ) {
|
|
46
|
+
return path;
|
|
47
|
+
} else if ( typeof path === 'number' ) {
|
|
48
|
+
return [ path.toString() ];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return [ path ];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Clones an object.
|
|
56
|
+
* Non-object values are returned unchanged.
|
|
57
|
+
*
|
|
58
|
+
* @param {*} object Object to clone.
|
|
59
|
+
* @return {*} Cloned object, or original literal non-object value.
|
|
60
|
+
*/
|
|
61
|
+
function cloneObject( object ) {
|
|
62
|
+
if ( typeof object === 'object' ) {
|
|
63
|
+
return {
|
|
64
|
+
...Object.fromEntries(
|
|
65
|
+
Object.entries( object ).map( ( [ key, value ] ) => [
|
|
66
|
+
key,
|
|
67
|
+
cloneObject( value ),
|
|
68
|
+
] )
|
|
69
|
+
),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return object;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Perform an immutable set.
|
|
78
|
+
* Handles nullish initial values.
|
|
79
|
+
* Clones all nested objects in the specified object.
|
|
80
|
+
*
|
|
81
|
+
* @param {Object} object Object to set a value in.
|
|
82
|
+
* @param {number|string|Array} path Path in the object to modify.
|
|
83
|
+
* @param {*} value New value to set.
|
|
84
|
+
* @return {Object} Cloned object with the new value set.
|
|
85
|
+
*/
|
|
33
86
|
export function immutableSet( object, path, value ) {
|
|
34
|
-
|
|
87
|
+
const normalizedPath = normalizePath( path );
|
|
88
|
+
const newObject = object ? cloneObject( object ) : {};
|
|
89
|
+
|
|
90
|
+
normalizedPath.reduce( ( acc, key, i ) => {
|
|
91
|
+
if ( acc[ key ] === undefined ) {
|
|
92
|
+
acc[ key ] = {};
|
|
93
|
+
}
|
|
94
|
+
if ( i === normalizedPath.length - 1 ) {
|
|
95
|
+
acc[ key ] = value;
|
|
96
|
+
}
|
|
97
|
+
return acc[ key ];
|
|
98
|
+
}, newObject );
|
|
99
|
+
|
|
100
|
+
return newObject;
|
|
35
101
|
}
|
|
36
102
|
|
|
37
103
|
export function transformStyles(
|
package/src/index.js
CHANGED
|
@@ -71,6 +71,7 @@ export default {
|
|
|
71
71
|
<div className="block-editor-hooks__layout-controls">
|
|
72
72
|
<div className="block-editor-hooks__layout-controls-unit">
|
|
73
73
|
<UnitControl
|
|
74
|
+
className="block-editor-hooks__layout-controls-unit-input"
|
|
74
75
|
label={ __( 'Content' ) }
|
|
75
76
|
labelPosition="top"
|
|
76
77
|
__unstableInputWidth="80px"
|
|
@@ -91,6 +92,7 @@ export default {
|
|
|
91
92
|
</div>
|
|
92
93
|
<div className="block-editor-hooks__layout-controls-unit">
|
|
93
94
|
<UnitControl
|
|
95
|
+
className="block-editor-hooks__layout-controls-unit-input"
|
|
94
96
|
label={ __( 'Wide' ) }
|
|
95
97
|
labelPosition="top"
|
|
96
98
|
__unstableInputWidth="80px"
|
|
@@ -116,6 +118,7 @@ export default {
|
|
|
116
118
|
) }
|
|
117
119
|
</p>
|
|
118
120
|
<ToggleGroupControl
|
|
121
|
+
__nextHasNoMarginBottom
|
|
119
122
|
label={ __( 'Justification' ) }
|
|
120
123
|
value={ justifyContent }
|
|
121
124
|
onChange={ onJustificationChange }
|
package/src/layouts/flex.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
justifyCenter,
|
|
8
8
|
justifyRight,
|
|
9
9
|
justifySpaceBetween,
|
|
10
|
+
justifyStretch,
|
|
10
11
|
arrowRight,
|
|
11
12
|
arrowDown,
|
|
12
13
|
} from '@wordpress/icons';
|
|
@@ -44,12 +45,15 @@ const alignItemsMap = {
|
|
|
44
45
|
left: 'flex-start',
|
|
45
46
|
right: 'flex-end',
|
|
46
47
|
center: 'center',
|
|
48
|
+
stretch: 'stretch',
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
const verticalAlignmentMap = {
|
|
50
52
|
top: 'flex-start',
|
|
51
53
|
center: 'center',
|
|
52
54
|
bottom: 'flex-end',
|
|
55
|
+
stretch: 'stretch',
|
|
56
|
+
'space-between': 'space-between',
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
const flexWrapOptions = [ 'wrap', 'nowrap' ];
|
|
@@ -101,14 +105,13 @@ export default {
|
|
|
101
105
|
onChange={ onChange }
|
|
102
106
|
isToolbar
|
|
103
107
|
/>
|
|
104
|
-
{ allowVerticalAlignment &&
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
) }
|
|
108
|
+
{ allowVerticalAlignment && (
|
|
109
|
+
<FlexLayoutVerticalAlignmentControl
|
|
110
|
+
layout={ layout }
|
|
111
|
+
onChange={ onChange }
|
|
112
|
+
isToolbar
|
|
113
|
+
/>
|
|
114
|
+
) }
|
|
112
115
|
</BlockControls>
|
|
113
116
|
);
|
|
114
117
|
},
|
|
@@ -153,6 +156,9 @@ export default {
|
|
|
153
156
|
rules.push( `justify-content: ${ justifyContent }` );
|
|
154
157
|
}
|
|
155
158
|
} else {
|
|
159
|
+
if ( verticalAlignment ) {
|
|
160
|
+
rules.push( `justify-content: ${ verticalAlignment }` );
|
|
161
|
+
}
|
|
156
162
|
rules.push( 'flex-direction: column' );
|
|
157
163
|
rules.push( `align-items: ${ alignItems }` );
|
|
158
164
|
}
|
|
@@ -188,7 +194,14 @@ function FlexLayoutVerticalAlignmentControl( {
|
|
|
188
194
|
onChange,
|
|
189
195
|
isToolbar = false,
|
|
190
196
|
} ) {
|
|
191
|
-
const {
|
|
197
|
+
const { orientation = 'horizontal' } = layout;
|
|
198
|
+
|
|
199
|
+
const defaultVerticalAlignment =
|
|
200
|
+
orientation === 'horizontal'
|
|
201
|
+
? verticalAlignmentMap.center
|
|
202
|
+
: verticalAlignmentMap.top;
|
|
203
|
+
|
|
204
|
+
const { verticalAlignment = defaultVerticalAlignment } = layout;
|
|
192
205
|
|
|
193
206
|
const onVerticalAlignmentChange = ( value ) => {
|
|
194
207
|
onChange( {
|
|
@@ -201,6 +214,11 @@ function FlexLayoutVerticalAlignmentControl( {
|
|
|
201
214
|
<BlockVerticalAlignmentControl
|
|
202
215
|
onChange={ onVerticalAlignmentChange }
|
|
203
216
|
value={ verticalAlignment }
|
|
217
|
+
controls={
|
|
218
|
+
orientation === 'horizontal'
|
|
219
|
+
? [ 'top', 'center', 'bottom', 'stretch' ]
|
|
220
|
+
: [ 'top', 'center', 'bottom', 'space-between' ]
|
|
221
|
+
}
|
|
204
222
|
/>
|
|
205
223
|
);
|
|
206
224
|
}
|
|
@@ -255,6 +273,8 @@ function FlexLayoutJustifyContentControl( {
|
|
|
255
273
|
const allowedControls = [ 'left', 'center', 'right' ];
|
|
256
274
|
if ( orientation === 'horizontal' ) {
|
|
257
275
|
allowedControls.push( 'space-between' );
|
|
276
|
+
} else {
|
|
277
|
+
allowedControls.push( 'stretch' );
|
|
258
278
|
}
|
|
259
279
|
if ( isToolbar ) {
|
|
260
280
|
return (
|
|
@@ -293,10 +313,17 @@ function FlexLayoutJustifyContentControl( {
|
|
|
293
313
|
icon: justifySpaceBetween,
|
|
294
314
|
label: __( 'Space between items' ),
|
|
295
315
|
} );
|
|
316
|
+
} else {
|
|
317
|
+
justificationOptions.push( {
|
|
318
|
+
value: 'stretch',
|
|
319
|
+
icon: justifyStretch,
|
|
320
|
+
label: __( 'Stretch items' ),
|
|
321
|
+
} );
|
|
296
322
|
}
|
|
297
323
|
|
|
298
324
|
return (
|
|
299
325
|
<ToggleGroupControl
|
|
326
|
+
__nextHasNoMarginBottom
|
|
300
327
|
label={ __( 'Justification' ) }
|
|
301
328
|
value={ justifyContent }
|
|
302
329
|
onChange={ onJustificationChange }
|
|
@@ -333,18 +360,43 @@ function FlexWrapControl( { layout, onChange } ) {
|
|
|
333
360
|
}
|
|
334
361
|
|
|
335
362
|
function OrientationControl( { layout, onChange } ) {
|
|
336
|
-
const {
|
|
363
|
+
const {
|
|
364
|
+
orientation = 'horizontal',
|
|
365
|
+
verticalAlignment,
|
|
366
|
+
justifyContent,
|
|
367
|
+
} = layout;
|
|
337
368
|
return (
|
|
338
369
|
<ToggleGroupControl
|
|
370
|
+
__nextHasNoMarginBottom
|
|
339
371
|
className="block-editor-hooks__flex-layout-orientation-controls"
|
|
340
372
|
label={ __( 'Orientation' ) }
|
|
341
373
|
value={ orientation }
|
|
342
|
-
onChange={ ( value ) =>
|
|
343
|
-
|
|
374
|
+
onChange={ ( value ) => {
|
|
375
|
+
// Make sure the vertical alignment and justification are compatible with the new orientation.
|
|
376
|
+
let newVerticalAlignment = verticalAlignment;
|
|
377
|
+
let newJustification = justifyContent;
|
|
378
|
+
if ( value === 'horizontal' ) {
|
|
379
|
+
if ( verticalAlignment === 'space-between' ) {
|
|
380
|
+
newVerticalAlignment = 'center';
|
|
381
|
+
}
|
|
382
|
+
if ( justifyContent === 'stretch' ) {
|
|
383
|
+
newJustification = 'left';
|
|
384
|
+
}
|
|
385
|
+
} else {
|
|
386
|
+
if ( verticalAlignment === 'stretch' ) {
|
|
387
|
+
newVerticalAlignment = 'top';
|
|
388
|
+
}
|
|
389
|
+
if ( justifyContent === 'space-between' ) {
|
|
390
|
+
newJustification = 'left';
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return onChange( {
|
|
344
394
|
...layout,
|
|
345
395
|
orientation: value,
|
|
346
|
-
|
|
347
|
-
|
|
396
|
+
verticalAlignment: newVerticalAlignment,
|
|
397
|
+
justifyContent: newJustification,
|
|
398
|
+
} );
|
|
399
|
+
} }
|
|
348
400
|
>
|
|
349
401
|
<ToggleGroupControlOptionIcon
|
|
350
402
|
icon={ arrowRight }
|
package/src/layouts/flow.js
CHANGED
|
@@ -67,7 +67,6 @@ export default {
|
|
|
67
67
|
info: alignmentInfo[ alignment ],
|
|
68
68
|
} ) );
|
|
69
69
|
}
|
|
70
|
-
const { contentSize, wideSize } = layout;
|
|
71
70
|
|
|
72
71
|
const alignments = [
|
|
73
72
|
{ name: 'left' },
|
|
@@ -75,14 +74,6 @@ export default {
|
|
|
75
74
|
{ name: 'right' },
|
|
76
75
|
];
|
|
77
76
|
|
|
78
|
-
if ( contentSize ) {
|
|
79
|
-
alignments.unshift( { name: 'full' } );
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if ( wideSize ) {
|
|
83
|
-
alignments.unshift( { name: 'wide', info: alignmentInfo.wide } );
|
|
84
|
-
}
|
|
85
|
-
|
|
86
77
|
alignments.unshift( { name: 'none', info: alignmentInfo.none } );
|
|
87
78
|
|
|
88
79
|
return alignments;
|
package/src/store/actions.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
retrieveSelectedAttribute,
|
|
26
26
|
START_OF_SELECTED_AREA,
|
|
27
27
|
} from '../utils/selection';
|
|
28
|
+
import { __experimentalUpdateSettings } from './private-actions';
|
|
28
29
|
|
|
29
30
|
/** @typedef {import('../components/use-on-block-drop/types').WPDropOperation} WPDropOperation */
|
|
30
31
|
|
|
@@ -1263,28 +1264,6 @@ export function toggleBlockMode( clientId ) {
|
|
|
1263
1264
|
};
|
|
1264
1265
|
}
|
|
1265
1266
|
|
|
1266
|
-
/**
|
|
1267
|
-
* Returns an action object used in signalling that the block interface, eg. toolbar, outline, etc. should be hidden.
|
|
1268
|
-
*
|
|
1269
|
-
* @return {Object} Action object.
|
|
1270
|
-
*/
|
|
1271
|
-
export function __experimentalHideBlockInterface() {
|
|
1272
|
-
return {
|
|
1273
|
-
type: 'HIDE_BLOCK_INTERFACE',
|
|
1274
|
-
};
|
|
1275
|
-
}
|
|
1276
|
-
|
|
1277
|
-
/**
|
|
1278
|
-
* Returns an action object used in signalling that the block interface, eg. toolbar, outline, etc. should be shown.
|
|
1279
|
-
*
|
|
1280
|
-
* @return {Object} Action object.
|
|
1281
|
-
*/
|
|
1282
|
-
export function __experimentalShowBlockInterface() {
|
|
1283
|
-
return {
|
|
1284
|
-
type: 'SHOW_BLOCK_INTERFACE',
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
1267
|
/**
|
|
1289
1268
|
* Returns an action object used in signalling that the user has begun to type.
|
|
1290
1269
|
*
|
|
@@ -1442,10 +1421,7 @@ export function updateBlockListSettings( clientId, settings ) {
|
|
|
1442
1421
|
* @return {Object} Action object
|
|
1443
1422
|
*/
|
|
1444
1423
|
export function updateSettings( settings ) {
|
|
1445
|
-
return
|
|
1446
|
-
type: 'UPDATE_SETTINGS',
|
|
1447
|
-
settings,
|
|
1448
|
-
};
|
|
1424
|
+
return __experimentalUpdateSettings( settings, true );
|
|
1449
1425
|
}
|
|
1450
1426
|
|
|
1451
1427
|
/**
|
package/src/store/defaults.js
CHANGED
|
@@ -26,8 +26,9 @@ export const PREFERENCES_DEFAULTS = {
|
|
|
26
26
|
* @property {boolean} canLockBlocks Whether the user can manage Block Lock state
|
|
27
27
|
* @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor
|
|
28
28
|
* @property {boolean} generateAnchors Enable/Disable auto anchor generation for Heading blocks
|
|
29
|
+
* @property {boolean} enableOpenverseMediaCategory Enable/Disable the Openverse media category in the inserter.
|
|
30
|
+
* @property {boolean} clearBlockSelection Whether the block editor should clear selection on mousedown when a block is not clicked.
|
|
29
31
|
* @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.
|
|
30
|
-
* @property {boolean} __experimentalClearBlockSelection Whether the block editor should clear selection on mousedown when a block is not clicked.
|
|
31
32
|
* @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
|
|
32
33
|
* @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
|
|
33
34
|
* @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
|
|
@@ -156,8 +157,12 @@ export const SETTINGS_DEFAULTS = {
|
|
|
156
157
|
// Allows to disable block locking interface.
|
|
157
158
|
canLockBlocks: true,
|
|
158
159
|
|
|
160
|
+
// Allows to disable Openverse media category in the inserter.
|
|
161
|
+
enableOpenverseMediaCategory: true,
|
|
162
|
+
|
|
163
|
+
clearBlockSelection: true,
|
|
164
|
+
|
|
159
165
|
__experimentalCanUserUseUnfilteredHTML: false,
|
|
160
|
-
__experimentalClearBlockSelection: true,
|
|
161
166
|
__experimentalBlockDirectory: false,
|
|
162
167
|
__mobileEnablePageTemplates: false,
|
|
163
168
|
__experimentalBlockPatterns: [],
|
package/src/store/index.js
CHANGED
|
@@ -8,8 +8,11 @@ import { createReduxStore, registerStore } from '@wordpress/data';
|
|
|
8
8
|
*/
|
|
9
9
|
import reducer from './reducer';
|
|
10
10
|
import * as selectors from './selectors';
|
|
11
|
+
import * as privateActions from './private-actions';
|
|
12
|
+
import * as privateSelectors from './private-selectors';
|
|
11
13
|
import * as actions from './actions';
|
|
12
14
|
import { STORE_NAME } from './constants';
|
|
15
|
+
import { unlock } from '../experiments';
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* Block editor data store configuration.
|
|
@@ -32,8 +35,11 @@ export const store = createReduxStore( STORE_NAME, {
|
|
|
32
35
|
persist: [ 'preferences' ],
|
|
33
36
|
} );
|
|
34
37
|
|
|
35
|
-
//
|
|
36
|
-
|
|
38
|
+
// We will be able to use the `register` function once we switch
|
|
39
|
+
// the "preferences" persistence to use the new preferences package.
|
|
40
|
+
const registeredStore = registerStore( STORE_NAME, {
|
|
37
41
|
...storeConfig,
|
|
38
42
|
persist: [ 'preferences' ],
|
|
39
43
|
} );
|
|
44
|
+
unlock( registeredStore ).registerPrivateActions( privateActions );
|
|
45
|
+
unlock( registeredStore ).registerPrivateSelectors( privateSelectors );
|