@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
package/src/store/selectors.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { map } from 'lodash';
|
|
5
4
|
import createSelector from 'rememo';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -202,7 +201,7 @@ export const __unstableGetClientIdWithClientIdsTree = createSelector(
|
|
|
202
201
|
*/
|
|
203
202
|
export const __unstableGetClientIdsTree = createSelector(
|
|
204
203
|
( state, rootClientId = '' ) =>
|
|
205
|
-
|
|
204
|
+
getBlockOrder( state, rootClientId ).map( ( clientId ) =>
|
|
206
205
|
__unstableGetClientIdWithClientIdsTree( state, clientId )
|
|
207
206
|
),
|
|
208
207
|
( state ) => [ state.blocks.order ]
|
|
@@ -314,17 +313,32 @@ export const __experimentalGetGlobalBlocksByName = createSelector(
|
|
|
314
313
|
*/
|
|
315
314
|
export const getBlocksByClientId = createSelector(
|
|
316
315
|
( state, clientIds ) =>
|
|
317
|
-
map(
|
|
318
|
-
Array.isArray( clientIds ) ? clientIds : [ clientIds ],
|
|
316
|
+
( Array.isArray( clientIds ) ? clientIds : [ clientIds ] ).map(
|
|
319
317
|
( clientId ) => getBlock( state, clientId )
|
|
320
318
|
),
|
|
321
319
|
( state, clientIds ) =>
|
|
322
|
-
map(
|
|
323
|
-
Array.isArray( clientIds ) ? clientIds : [ clientIds ],
|
|
320
|
+
( Array.isArray( clientIds ) ? clientIds : [ clientIds ] ).map(
|
|
324
321
|
( clientId ) => state.blocks.tree.get( clientId )
|
|
325
322
|
)
|
|
326
323
|
);
|
|
327
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Given an array of block client IDs, returns the corresponding array of block
|
|
327
|
+
* names.
|
|
328
|
+
*
|
|
329
|
+
* @param {Object} state Editor state.
|
|
330
|
+
* @param {string[]} clientIds Client IDs for which block names are to be returned.
|
|
331
|
+
*
|
|
332
|
+
* @return {string[]} Block names.
|
|
333
|
+
*/
|
|
334
|
+
export const getBlockNamesByClientId = createSelector(
|
|
335
|
+
( state, clientIds ) =>
|
|
336
|
+
getBlocksByClientId( state, clientIds )
|
|
337
|
+
.filter( Boolean )
|
|
338
|
+
.map( ( block ) => block.name ),
|
|
339
|
+
( state, clientIds ) => getBlocksByClientId( state, clientIds )
|
|
340
|
+
);
|
|
341
|
+
|
|
328
342
|
/**
|
|
329
343
|
* Returns the number of blocks currently present in the post.
|
|
330
344
|
*
|
|
@@ -507,18 +521,18 @@ export const getBlockParents = createSelector(
|
|
|
507
521
|
export const getBlockParentsByBlockName = createSelector(
|
|
508
522
|
( state, clientId, blockName, ascending = false ) => {
|
|
509
523
|
const parents = getBlockParents( state, clientId, ascending );
|
|
510
|
-
return
|
|
511
|
-
map(
|
|
524
|
+
return parents
|
|
525
|
+
.map( ( id ) => ( {
|
|
512
526
|
id,
|
|
513
527
|
name: getBlockName( state, id ),
|
|
514
|
-
} ) )
|
|
528
|
+
} ) )
|
|
529
|
+
.filter( ( { name } ) => {
|
|
515
530
|
if ( Array.isArray( blockName ) ) {
|
|
516
531
|
return blockName.includes( name );
|
|
517
532
|
}
|
|
518
533
|
return name === blockName;
|
|
519
|
-
} )
|
|
520
|
-
( { id } ) => id
|
|
521
|
-
);
|
|
534
|
+
} )
|
|
535
|
+
.map( ( { id } ) => id );
|
|
522
536
|
},
|
|
523
537
|
( state ) => [ state.blocks.parents ]
|
|
524
538
|
);
|
|
@@ -1265,17 +1279,6 @@ export function isTyping( state ) {
|
|
|
1265
1279
|
return state.isTyping;
|
|
1266
1280
|
}
|
|
1267
1281
|
|
|
1268
|
-
/**
|
|
1269
|
-
* Returns true if the the block interface should be hidden, or false otherwise.
|
|
1270
|
-
*
|
|
1271
|
-
* @param {Object} state Global application state.
|
|
1272
|
-
*
|
|
1273
|
-
* @return {boolean} Whether the block toolbar is hidden.
|
|
1274
|
-
*/
|
|
1275
|
-
export function __experimentalIsBlockInterfaceHidden( state ) {
|
|
1276
|
-
return state.isBlockInterfaceHidden;
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
1282
|
/**
|
|
1280
1283
|
* Returns true if the user is dragging blocks, or false otherwise.
|
|
1281
1284
|
*
|
|
@@ -1364,28 +1367,36 @@ export function isCaretWithinFormattedText() {
|
|
|
1364
1367
|
*
|
|
1365
1368
|
* @return {Object} Insertion point object with `rootClientId`, `index`.
|
|
1366
1369
|
*/
|
|
1367
|
-
export
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1370
|
+
export const getBlockInsertionPoint = createSelector(
|
|
1371
|
+
( state ) => {
|
|
1372
|
+
let rootClientId, index;
|
|
1373
|
+
|
|
1374
|
+
const {
|
|
1375
|
+
insertionPoint,
|
|
1376
|
+
selection: { selectionEnd },
|
|
1377
|
+
} = state;
|
|
1378
|
+
if ( insertionPoint !== null ) {
|
|
1379
|
+
return insertionPoint;
|
|
1380
|
+
}
|
|
1377
1381
|
|
|
1378
|
-
|
|
1382
|
+
const { clientId } = selectionEnd;
|
|
1379
1383
|
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1384
|
+
if ( clientId ) {
|
|
1385
|
+
rootClientId = getBlockRootClientId( state, clientId ) || undefined;
|
|
1386
|
+
index = getBlockIndex( state, selectionEnd.clientId ) + 1;
|
|
1387
|
+
} else {
|
|
1388
|
+
index = getBlockOrder( state ).length;
|
|
1389
|
+
}
|
|
1386
1390
|
|
|
1387
|
-
|
|
1388
|
-
}
|
|
1391
|
+
return { rootClientId, index };
|
|
1392
|
+
},
|
|
1393
|
+
( state ) => [
|
|
1394
|
+
state.insertionPoint,
|
|
1395
|
+
state.selection.selectionEnd.clientId,
|
|
1396
|
+
state.blocks.parents,
|
|
1397
|
+
state.blocks.order,
|
|
1398
|
+
]
|
|
1399
|
+
);
|
|
1389
1400
|
|
|
1390
1401
|
/**
|
|
1391
1402
|
* Returns true if we should show the block insertion point.
|
|
@@ -1660,7 +1671,7 @@ export function canRemoveBlocks( state, clientIds, rootClientId = null ) {
|
|
|
1660
1671
|
* @param {string} clientId The block client Id.
|
|
1661
1672
|
* @param {?string} rootClientId Optional root client ID of block list.
|
|
1662
1673
|
*
|
|
1663
|
-
* @return {boolean} Whether the given block is allowed to be moved.
|
|
1674
|
+
* @return {boolean | undefined} Whether the given block is allowed to be moved.
|
|
1664
1675
|
*/
|
|
1665
1676
|
export function canMoveBlock( state, clientId, rootClientId = null ) {
|
|
1666
1677
|
const attributes = getBlockAttributes( state, clientId );
|
|
@@ -2144,14 +2155,14 @@ export const hasInserterItems = createSelector(
|
|
|
2144
2155
|
);
|
|
2145
2156
|
|
|
2146
2157
|
/**
|
|
2147
|
-
* Returns the list of allowed inserter blocks for inner blocks children
|
|
2158
|
+
* Returns the list of allowed inserter blocks for inner blocks children.
|
|
2148
2159
|
*
|
|
2149
2160
|
* @param {Object} state Editor state.
|
|
2150
2161
|
* @param {?string} rootClientId Optional root client ID of block list.
|
|
2151
2162
|
*
|
|
2152
2163
|
* @return {Array?} The list of allowed block types.
|
|
2153
2164
|
*/
|
|
2154
|
-
export const
|
|
2165
|
+
export const getAllowedBlocks = createSelector(
|
|
2155
2166
|
( state, rootClientId = null ) => {
|
|
2156
2167
|
if ( ! rootClientId ) {
|
|
2157
2168
|
return;
|
|
@@ -2170,6 +2181,24 @@ export const __experimentalGetAllowedBlocks = createSelector(
|
|
|
2170
2181
|
]
|
|
2171
2182
|
);
|
|
2172
2183
|
|
|
2184
|
+
export const __experimentalGetAllowedBlocks = createSelector(
|
|
2185
|
+
( state, rootClientId = null ) => {
|
|
2186
|
+
deprecated(
|
|
2187
|
+
'wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',
|
|
2188
|
+
{
|
|
2189
|
+
alternative:
|
|
2190
|
+
'wp.data.select( "core/block-editor" ).getAllowedBlocks',
|
|
2191
|
+
since: '6.2',
|
|
2192
|
+
version: '6.4',
|
|
2193
|
+
}
|
|
2194
|
+
);
|
|
2195
|
+
return getAllowedBlocks( state, rootClientId );
|
|
2196
|
+
},
|
|
2197
|
+
( state, rootClientId ) => [
|
|
2198
|
+
...getAllowedBlocks.getDependants( state, rootClientId ),
|
|
2199
|
+
]
|
|
2200
|
+
);
|
|
2201
|
+
|
|
2173
2202
|
/**
|
|
2174
2203
|
* Returns the block to be directly inserted by the block appender.
|
|
2175
2204
|
*
|
|
@@ -2313,7 +2342,7 @@ export const __experimentalGetAllowedPatterns = createSelector(
|
|
|
2313
2342
|
*
|
|
2314
2343
|
* @return {Array} The list of matched block patterns based on declared `blockTypes` and block name.
|
|
2315
2344
|
*/
|
|
2316
|
-
export const
|
|
2345
|
+
export const getPatternsByBlockTypes = createSelector(
|
|
2317
2346
|
( state, blockNames, rootClientId = null ) => {
|
|
2318
2347
|
if ( ! blockNames ) return EMPTY_ARRAY;
|
|
2319
2348
|
const patterns = __experimentalGetAllowedPatterns(
|
|
@@ -2323,11 +2352,36 @@ export const __experimentalGetPatternsByBlockTypes = createSelector(
|
|
|
2323
2352
|
const normalizedBlockNames = Array.isArray( blockNames )
|
|
2324
2353
|
? blockNames
|
|
2325
2354
|
: [ blockNames ];
|
|
2326
|
-
|
|
2355
|
+
const filteredPatterns = patterns.filter( ( pattern ) =>
|
|
2327
2356
|
pattern?.blockTypes?.some?.( ( blockName ) =>
|
|
2328
2357
|
normalizedBlockNames.includes( blockName )
|
|
2329
2358
|
)
|
|
2330
2359
|
);
|
|
2360
|
+
if ( filteredPatterns.length === 0 ) {
|
|
2361
|
+
return EMPTY_ARRAY;
|
|
2362
|
+
}
|
|
2363
|
+
return filteredPatterns;
|
|
2364
|
+
},
|
|
2365
|
+
( state, blockNames, rootClientId ) => [
|
|
2366
|
+
...__experimentalGetAllowedPatterns.getDependants(
|
|
2367
|
+
state,
|
|
2368
|
+
rootClientId
|
|
2369
|
+
),
|
|
2370
|
+
]
|
|
2371
|
+
);
|
|
2372
|
+
|
|
2373
|
+
export const __experimentalGetPatternsByBlockTypes = createSelector(
|
|
2374
|
+
( state, blockNames, rootClientId = null ) => {
|
|
2375
|
+
deprecated(
|
|
2376
|
+
'wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',
|
|
2377
|
+
{
|
|
2378
|
+
alternative:
|
|
2379
|
+
'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',
|
|
2380
|
+
since: '6.2',
|
|
2381
|
+
version: '6.4',
|
|
2382
|
+
}
|
|
2383
|
+
);
|
|
2384
|
+
return getPatternsByBlockTypes( state, blockNames, rootClientId );
|
|
2331
2385
|
},
|
|
2332
2386
|
( state, blockNames, rootClientId ) => [
|
|
2333
2387
|
...__experimentalGetAllowedPatterns.getDependants(
|
|
@@ -2384,17 +2438,14 @@ export const __experimentalGetPatternTransformItems = createSelector(
|
|
|
2384
2438
|
* block pattern's blocks and try to find matches from the selected blocks.
|
|
2385
2439
|
* Now this happens in the consumer to avoid heavy operations in the selector.
|
|
2386
2440
|
*/
|
|
2387
|
-
return
|
|
2441
|
+
return getPatternsByBlockTypes(
|
|
2388
2442
|
state,
|
|
2389
2443
|
selectedBlockNames,
|
|
2390
2444
|
rootClientId
|
|
2391
2445
|
);
|
|
2392
2446
|
},
|
|
2393
2447
|
( state, blocks, rootClientId ) => [
|
|
2394
|
-
...
|
|
2395
|
-
state,
|
|
2396
|
-
rootClientId
|
|
2397
|
-
),
|
|
2448
|
+
...getPatternsByBlockTypes.getDependants( state, rootClientId ),
|
|
2398
2449
|
]
|
|
2399
2450
|
);
|
|
2400
2451
|
|
|
@@ -2647,19 +2698,19 @@ export const __experimentalGetActiveBlockIdByBlockNames = createSelector(
|
|
|
2647
2698
|
export function wasBlockJustInserted( state, clientId, source ) {
|
|
2648
2699
|
const { lastBlockInserted } = state;
|
|
2649
2700
|
return (
|
|
2650
|
-
lastBlockInserted.clientId
|
|
2701
|
+
lastBlockInserted.clientIds?.includes( clientId ) &&
|
|
2651
2702
|
lastBlockInserted.source === source
|
|
2652
2703
|
);
|
|
2653
2704
|
}
|
|
2654
2705
|
|
|
2655
2706
|
/**
|
|
2656
|
-
* Gets the client
|
|
2707
|
+
* Gets the client ids of the last inserted blocks.
|
|
2657
2708
|
*
|
|
2658
2709
|
* @param {Object} state Global application state.
|
|
2659
|
-
* @return {
|
|
2710
|
+
* @return {Array|undefined} Client Ids of the last inserted block(s).
|
|
2660
2711
|
*/
|
|
2661
|
-
export function
|
|
2662
|
-
return state?.lastBlockInserted?.
|
|
2712
|
+
export function getLastInsertedBlocksClientIds( state ) {
|
|
2713
|
+
return state?.lastBlockInserted?.clientIds;
|
|
2663
2714
|
}
|
|
2664
2715
|
|
|
2665
2716
|
/**
|
|
@@ -27,7 +27,6 @@ const noop = () => {};
|
|
|
27
27
|
|
|
28
28
|
const {
|
|
29
29
|
clearSelectedBlock,
|
|
30
|
-
__experimentalHideBlockInterface: hideBlockInterface,
|
|
31
30
|
insertBlock,
|
|
32
31
|
insertBlocks,
|
|
33
32
|
mergeBlocks,
|
|
@@ -40,7 +39,6 @@ const {
|
|
|
40
39
|
replaceInnerBlocks,
|
|
41
40
|
resetBlocks,
|
|
42
41
|
selectBlock,
|
|
43
|
-
__experimentalShowBlockInterface: showBlockInterface,
|
|
44
42
|
showInsertionPoint,
|
|
45
43
|
startMultiSelect,
|
|
46
44
|
startTyping,
|
|
@@ -777,22 +775,6 @@ describe( 'actions', () => {
|
|
|
777
775
|
} );
|
|
778
776
|
} );
|
|
779
777
|
|
|
780
|
-
describe( 'hideBlockInterface', () => {
|
|
781
|
-
it( 'should return the HIDE_BLOCK_INTERFACE action', () => {
|
|
782
|
-
expect( hideBlockInterface() ).toEqual( {
|
|
783
|
-
type: 'HIDE_BLOCK_INTERFACE',
|
|
784
|
-
} );
|
|
785
|
-
} );
|
|
786
|
-
} );
|
|
787
|
-
|
|
788
|
-
describe( 'showBlockInterface', () => {
|
|
789
|
-
it( 'should return the SHOW_BLOCK_INTERFACE action', () => {
|
|
790
|
-
expect( showBlockInterface() ).toEqual( {
|
|
791
|
-
type: 'SHOW_BLOCK_INTERFACE',
|
|
792
|
-
} );
|
|
793
|
-
} );
|
|
794
|
-
} );
|
|
795
|
-
|
|
796
778
|
describe( 'startTyping', () => {
|
|
797
779
|
it( 'should return the START_TYPING action', () => {
|
|
798
780
|
expect( startTyping() ).toEqual( {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { hideBlockInterface, showBlockInterface } from '../private-actions';
|
|
5
|
+
|
|
6
|
+
describe( 'private actions', () => {
|
|
7
|
+
describe( 'hideBlockInterface', () => {
|
|
8
|
+
it( 'should return the HIDE_BLOCK_INTERFACE action', () => {
|
|
9
|
+
expect( hideBlockInterface() ).toEqual( {
|
|
10
|
+
type: 'HIDE_BLOCK_INTERFACE',
|
|
11
|
+
} );
|
|
12
|
+
} );
|
|
13
|
+
} );
|
|
14
|
+
|
|
15
|
+
describe( 'showBlockInterface', () => {
|
|
16
|
+
it( 'should return the SHOW_BLOCK_INTERFACE action', () => {
|
|
17
|
+
expect( showBlockInterface() ).toEqual( {
|
|
18
|
+
type: 'SHOW_BLOCK_INTERFACE',
|
|
19
|
+
} );
|
|
20
|
+
} );
|
|
21
|
+
} );
|
|
22
|
+
} );
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { isBlockInterfaceHidden } from '../private-selectors';
|
|
5
|
+
|
|
6
|
+
describe( 'private selectors', () => {
|
|
7
|
+
describe( 'isBlockInterfaceHidden', () => {
|
|
8
|
+
it( 'should return the true if toggled true in state', () => {
|
|
9
|
+
const state = {
|
|
10
|
+
isBlockInterfaceHidden: true,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
expect( isBlockInterfaceHidden( state ) ).toBe( true );
|
|
14
|
+
} );
|
|
15
|
+
|
|
16
|
+
it( 'should return false if toggled false in state', () => {
|
|
17
|
+
const state = {
|
|
18
|
+
isBlockInterfaceHidden: false,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
expect( isBlockInterfaceHidden( state ) ).toBe( false );
|
|
22
|
+
} );
|
|
23
|
+
} );
|
|
24
|
+
} );
|
|
@@ -3255,7 +3255,7 @@ describe( 'state', () => {
|
|
|
3255
3255
|
} );
|
|
3256
3256
|
|
|
3257
3257
|
describe( 'lastBlockInserted', () => {
|
|
3258
|
-
it( 'should
|
|
3258
|
+
it( 'should contain client id if last block inserted is called with action INSERT_BLOCKS', () => {
|
|
3259
3259
|
const expectedClientId = '62bfef6e-d5e9-43ba-b7f9-c77cf354141f';
|
|
3260
3260
|
|
|
3261
3261
|
const action = {
|
|
@@ -3272,7 +3272,7 @@ describe( 'state', () => {
|
|
|
3272
3272
|
|
|
3273
3273
|
const state = lastBlockInserted( {}, action );
|
|
3274
3274
|
|
|
3275
|
-
expect( state.
|
|
3275
|
+
expect( state.clientIds ).toContain( expectedClientId );
|
|
3276
3276
|
} );
|
|
3277
3277
|
|
|
3278
3278
|
it( 'should return inserter_menu source if last block inserted is called with action INSERT_BLOCKS', () => {
|
|
@@ -3297,7 +3297,7 @@ describe( 'state', () => {
|
|
|
3297
3297
|
|
|
3298
3298
|
it( 'should return state if last block inserted is called with action INSERT_BLOCKS and block list is empty', () => {
|
|
3299
3299
|
const expectedState = {
|
|
3300
|
-
|
|
3300
|
+
clientIds: [ '9db792c6-a25a-495d-adbd-97d56a4c4189' ],
|
|
3301
3301
|
};
|
|
3302
3302
|
|
|
3303
3303
|
const action = {
|
|
@@ -3313,6 +3313,48 @@ describe( 'state', () => {
|
|
|
3313
3313
|
expect( state ).toEqual( expectedState );
|
|
3314
3314
|
} );
|
|
3315
3315
|
|
|
3316
|
+
it( 'should return client ids of blocks when called with REPLACE_BLOCKS', () => {
|
|
3317
|
+
const clientIdOne = '62bfef6e-d5e9-43ba-b7f9-c77cf354141f';
|
|
3318
|
+
const clientIdTwo = '9db792c6-a25a-495d-adbd-97d56a4c4189';
|
|
3319
|
+
|
|
3320
|
+
const action = {
|
|
3321
|
+
blocks: [
|
|
3322
|
+
{
|
|
3323
|
+
clientId: clientIdOne,
|
|
3324
|
+
},
|
|
3325
|
+
{
|
|
3326
|
+
clientId: clientIdTwo,
|
|
3327
|
+
},
|
|
3328
|
+
],
|
|
3329
|
+
type: 'REPLACE_BLOCKS',
|
|
3330
|
+
};
|
|
3331
|
+
|
|
3332
|
+
const state = lastBlockInserted( {}, action );
|
|
3333
|
+
|
|
3334
|
+
expect( state.clientIds ).toEqual( [ clientIdOne, clientIdTwo ] );
|
|
3335
|
+
} );
|
|
3336
|
+
|
|
3337
|
+
it( 'should return client ids of all blocks when inner blocks are replaced with REPLACE_INNER_BLOCKS', () => {
|
|
3338
|
+
const clientIdOne = '62bfef6e-d5e9-43ba-b7f9-c77cf354141f';
|
|
3339
|
+
const clientIdTwo = '9db792c6-a25a-495d-adbd-97d56a4c4189';
|
|
3340
|
+
|
|
3341
|
+
const action = {
|
|
3342
|
+
blocks: [
|
|
3343
|
+
{
|
|
3344
|
+
clientId: clientIdOne,
|
|
3345
|
+
},
|
|
3346
|
+
{
|
|
3347
|
+
clientId: clientIdTwo,
|
|
3348
|
+
},
|
|
3349
|
+
],
|
|
3350
|
+
type: 'REPLACE_INNER_BLOCKS',
|
|
3351
|
+
};
|
|
3352
|
+
|
|
3353
|
+
const state = lastBlockInserted( {}, action );
|
|
3354
|
+
|
|
3355
|
+
expect( state.clientIds ).toEqual( [ clientIdOne, clientIdTwo ] );
|
|
3356
|
+
} );
|
|
3357
|
+
|
|
3316
3358
|
it( 'should return empty state if last block inserted is called with action RESET_BLOCKS', () => {
|
|
3317
3359
|
const expectedState = {};
|
|
3318
3360
|
|
|
@@ -44,7 +44,6 @@ const {
|
|
|
44
44
|
isBlockMultiSelected,
|
|
45
45
|
isFirstMultiSelectedBlock,
|
|
46
46
|
getBlockMode,
|
|
47
|
-
__experimentalIsBlockInterfaceHidden: isBlockInterfaceHidden,
|
|
48
47
|
isTyping,
|
|
49
48
|
isDraggingBlocks,
|
|
50
49
|
getDraggedBlockClientIds,
|
|
@@ -67,13 +66,13 @@ const {
|
|
|
67
66
|
__experimentalGetActiveBlockIdByBlockNames: getActiveBlockIdByBlockNames,
|
|
68
67
|
__experimentalGetAllowedPatterns,
|
|
69
68
|
__experimentalGetParsedPattern,
|
|
70
|
-
|
|
69
|
+
getPatternsByBlockTypes,
|
|
71
70
|
__unstableGetClientIdWithClientIdsTree,
|
|
72
71
|
__unstableGetClientIdsTree,
|
|
73
72
|
__experimentalGetPatternTransformItems,
|
|
74
73
|
wasBlockJustInserted,
|
|
75
74
|
__experimentalGetGlobalBlocksByName,
|
|
76
|
-
|
|
75
|
+
getLastInsertedBlocksClientIds,
|
|
77
76
|
} = selectors;
|
|
78
77
|
|
|
79
78
|
describe( 'selectors', () => {
|
|
@@ -2259,24 +2258,6 @@ describe( 'selectors', () => {
|
|
|
2259
2258
|
} );
|
|
2260
2259
|
} );
|
|
2261
2260
|
|
|
2262
|
-
describe( 'isBlockInterfaceHidden', () => {
|
|
2263
|
-
it( 'should return the true if toggled true in state', () => {
|
|
2264
|
-
const state = {
|
|
2265
|
-
isBlockInterfaceHidden: true,
|
|
2266
|
-
};
|
|
2267
|
-
|
|
2268
|
-
expect( isBlockInterfaceHidden( state ) ).toBe( true );
|
|
2269
|
-
} );
|
|
2270
|
-
|
|
2271
|
-
it( 'should return false if toggled false in state', () => {
|
|
2272
|
-
const state = {
|
|
2273
|
-
isBlockInterfaceHidden: false,
|
|
2274
|
-
};
|
|
2275
|
-
|
|
2276
|
-
expect( isBlockInterfaceHidden( state ) ).toBe( false );
|
|
2277
|
-
} );
|
|
2278
|
-
} );
|
|
2279
|
-
|
|
2280
2261
|
describe( 'isTyping', () => {
|
|
2281
2262
|
it( 'should return the isTyping flag if the block is selected', () => {
|
|
2282
2263
|
const state = {
|
|
@@ -2493,6 +2474,44 @@ describe( 'selectors', () => {
|
|
|
2493
2474
|
} );
|
|
2494
2475
|
} );
|
|
2495
2476
|
|
|
2477
|
+
it( 'should cache and return the same object if state has not changed', () => {
|
|
2478
|
+
const state = {
|
|
2479
|
+
selection: {
|
|
2480
|
+
selectionStart: { clientId: 'clientId1' },
|
|
2481
|
+
selectionEnd: { clientId: 'clientId1' },
|
|
2482
|
+
},
|
|
2483
|
+
blocks: {
|
|
2484
|
+
byClientId: new Map(
|
|
2485
|
+
Object.entries( {
|
|
2486
|
+
clientId1: { clientId: 'clientId1' },
|
|
2487
|
+
} )
|
|
2488
|
+
),
|
|
2489
|
+
attributes: new Map(
|
|
2490
|
+
Object.entries( {
|
|
2491
|
+
clientId1: {},
|
|
2492
|
+
} )
|
|
2493
|
+
),
|
|
2494
|
+
order: new Map(
|
|
2495
|
+
Object.entries( {
|
|
2496
|
+
'': [ 'clientId1' ],
|
|
2497
|
+
clientId1: [],
|
|
2498
|
+
} )
|
|
2499
|
+
),
|
|
2500
|
+
parents: new Map(
|
|
2501
|
+
Object.entries( {
|
|
2502
|
+
clientId1: '',
|
|
2503
|
+
} )
|
|
2504
|
+
),
|
|
2505
|
+
},
|
|
2506
|
+
insertionPoint: null,
|
|
2507
|
+
};
|
|
2508
|
+
|
|
2509
|
+
const insertionPoint1 = getBlockInsertionPoint( state );
|
|
2510
|
+
const insertionPoint2 = getBlockInsertionPoint( state );
|
|
2511
|
+
|
|
2512
|
+
expect( insertionPoint1 ).toBe( insertionPoint2 );
|
|
2513
|
+
} );
|
|
2514
|
+
|
|
2496
2515
|
it( 'should return an object for the nested selected block', () => {
|
|
2497
2516
|
const state = {
|
|
2498
2517
|
selection: {
|
|
@@ -4223,7 +4242,7 @@ describe( 'selectors', () => {
|
|
|
4223
4242
|
);
|
|
4224
4243
|
} );
|
|
4225
4244
|
} );
|
|
4226
|
-
describe( '
|
|
4245
|
+
describe( 'getPatternsByBlockTypes', () => {
|
|
4227
4246
|
const state = {
|
|
4228
4247
|
blocks: {
|
|
4229
4248
|
byClientId: new Map(
|
|
@@ -4263,22 +4282,25 @@ describe( 'selectors', () => {
|
|
|
4263
4282
|
},
|
|
4264
4283
|
};
|
|
4265
4284
|
it( 'should return empty array if no block name is provided', () => {
|
|
4266
|
-
expect(
|
|
4267
|
-
[]
|
|
4268
|
-
);
|
|
4285
|
+
expect( getPatternsByBlockTypes( state ) ).toEqual( [] );
|
|
4269
4286
|
} );
|
|
4270
|
-
it( '
|
|
4271
|
-
const patterns =
|
|
4287
|
+
it( 'should return empty array if no match is found', () => {
|
|
4288
|
+
const patterns = getPatternsByBlockTypes(
|
|
4272
4289
|
state,
|
|
4273
4290
|
'test/block-not-exists'
|
|
4274
4291
|
);
|
|
4275
4292
|
expect( patterns ).toEqual( [] );
|
|
4276
4293
|
} );
|
|
4277
|
-
it( 'should return
|
|
4278
|
-
const
|
|
4294
|
+
it( 'should return the same empty array in both empty array cases', () => {
|
|
4295
|
+
const patterns1 = getPatternsByBlockTypes( state );
|
|
4296
|
+
const patterns2 = getPatternsByBlockTypes(
|
|
4279
4297
|
state,
|
|
4280
|
-
'test/block-
|
|
4298
|
+
'test/block-not-exists'
|
|
4281
4299
|
);
|
|
4300
|
+
expect( patterns1 ).toBe( patterns2 );
|
|
4301
|
+
} );
|
|
4302
|
+
it( 'should return proper results when there are matched block patterns', () => {
|
|
4303
|
+
const patterns = getPatternsByBlockTypes( state, 'test/block-a' );
|
|
4282
4304
|
expect( patterns ).toHaveLength( 2 );
|
|
4283
4305
|
expect( patterns ).toEqual(
|
|
4284
4306
|
expect.arrayContaining( [
|
|
@@ -4288,7 +4310,7 @@ describe( 'selectors', () => {
|
|
|
4288
4310
|
);
|
|
4289
4311
|
} );
|
|
4290
4312
|
it( 'should return proper result with matched patterns and allowed blocks from rootClientId', () => {
|
|
4291
|
-
const patterns =
|
|
4313
|
+
const patterns = getPatternsByBlockTypes(
|
|
4292
4314
|
state,
|
|
4293
4315
|
'test/block-a',
|
|
4294
4316
|
'block1'
|
|
@@ -4457,7 +4479,7 @@ describe( 'selectors', () => {
|
|
|
4457
4479
|
|
|
4458
4480
|
const state = {
|
|
4459
4481
|
lastBlockInserted: {
|
|
4460
|
-
|
|
4482
|
+
clientIds: [ expectedClientId ],
|
|
4461
4483
|
source,
|
|
4462
4484
|
},
|
|
4463
4485
|
};
|
|
@@ -4474,7 +4496,7 @@ describe( 'selectors', () => {
|
|
|
4474
4496
|
|
|
4475
4497
|
const state = {
|
|
4476
4498
|
lastBlockInserted: {
|
|
4477
|
-
|
|
4499
|
+
clientIds: [ unexpectedClientId ],
|
|
4478
4500
|
source,
|
|
4479
4501
|
},
|
|
4480
4502
|
};
|
|
@@ -4490,7 +4512,7 @@ describe( 'selectors', () => {
|
|
|
4490
4512
|
|
|
4491
4513
|
const state = {
|
|
4492
4514
|
lastBlockInserted: {
|
|
4493
|
-
clientId,
|
|
4515
|
+
clientIds: [ clientId ],
|
|
4494
4516
|
},
|
|
4495
4517
|
};
|
|
4496
4518
|
|
|
@@ -4667,22 +4689,25 @@ describe( '__unstableGetClientIdsTree', () => {
|
|
|
4667
4689
|
} );
|
|
4668
4690
|
} );
|
|
4669
4691
|
|
|
4670
|
-
describe( '
|
|
4692
|
+
describe( 'getLastInsertedBlocksClientIds', () => {
|
|
4671
4693
|
it( 'should return undefined if no blocks have been inserted', () => {
|
|
4672
4694
|
const state = {
|
|
4673
4695
|
lastBlockInserted: {},
|
|
4674
4696
|
};
|
|
4675
4697
|
|
|
4676
|
-
expect(
|
|
4698
|
+
expect( getLastInsertedBlocksClientIds( state ) ).toEqual( undefined );
|
|
4677
4699
|
} );
|
|
4678
4700
|
|
|
4679
|
-
it( 'should return
|
|
4701
|
+
it( 'should return clientIds if blocks have been inserted', () => {
|
|
4680
4702
|
const state = {
|
|
4681
4703
|
lastBlockInserted: {
|
|
4682
|
-
|
|
4704
|
+
clientIds: [ '123456', '78910' ],
|
|
4683
4705
|
},
|
|
4684
4706
|
};
|
|
4685
4707
|
|
|
4686
|
-
expect(
|
|
4708
|
+
expect( getLastInsertedBlocksClientIds( state ) ).toEqual( [
|
|
4709
|
+
'123456',
|
|
4710
|
+
'78910',
|
|
4711
|
+
] );
|
|
4687
4712
|
} );
|
|
4688
4713
|
} );
|
package/src/style.scss
CHANGED
|
@@ -18,11 +18,9 @@
|
|
|
18
18
|
@import "./components/block-styles/style.scss";
|
|
19
19
|
@import "./components/block-switcher/style.scss";
|
|
20
20
|
@import "./components/block-types-list/style.scss";
|
|
21
|
-
@import "./components/block-variation-picker/style.scss";
|
|
22
21
|
@import "./components/block-pattern-setup/style.scss";
|
|
23
22
|
@import "./components/block-variation-transforms/style.scss";
|
|
24
23
|
@import "./components/border-radius-control/style.scss";
|
|
25
|
-
@import "./components/button-block-appender/style.scss";
|
|
26
24
|
@import "./components/colors-gradients/style.scss";
|
|
27
25
|
@import "./components/contrast-checker/style.scss";
|
|
28
26
|
@import "./components/date-format-picker/style.scss";
|
|
@@ -31,6 +29,7 @@
|
|
|
31
29
|
@import "./components/height-control/style.scss";
|
|
32
30
|
@import "./components/image-size-control/style.scss";
|
|
33
31
|
@import "./components/inserter-list-item/style.scss";
|
|
32
|
+
@import "./components/inspector-controls-tabs/style.scss";
|
|
34
33
|
@import "./components/inspector-popover-header/style.scss";
|
|
35
34
|
@import "./components/justify-content-control/style.scss";
|
|
36
35
|
@import "./components/link-control/style.scss";
|
|
@@ -45,14 +44,14 @@
|
|
|
45
44
|
@import "./components/tool-selector/style.scss";
|
|
46
45
|
@import "./components/url-input/style.scss";
|
|
47
46
|
@import "./components/url-popover/style.scss";
|
|
48
|
-
@import "./components/warning/style.scss";
|
|
49
47
|
@import "./hooks/anchor.scss";
|
|
50
|
-
@import "./hooks/layout.scss";
|
|
51
48
|
@import "./hooks/border.scss";
|
|
52
|
-
@import "./hooks/dimensions.scss";
|
|
53
|
-
@import "./hooks/typography.scss";
|
|
54
49
|
@import "./hooks/color.scss";
|
|
50
|
+
@import "./hooks/dimensions.scss";
|
|
51
|
+
@import "./hooks/layout.scss";
|
|
55
52
|
@import "./hooks/padding.scss";
|
|
53
|
+
@import "./hooks/position.scss";
|
|
54
|
+
@import "./hooks/typography.scss";
|
|
56
55
|
|
|
57
56
|
@import "./components/block-toolbar/style.scss";
|
|
58
57
|
@import "./components/inserter/style.scss";
|