@wordpress/block-editor 7.0.1 → 8.0.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 +11 -0
- package/README.md +47 -4
- package/build/components/autocomplete/index.js +1 -1
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-actions/index.js +8 -4
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +61 -14
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +25 -3
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-content-overlay/index.js +2 -4
- package/build/components/block-content-overlay/index.js.map +1 -1
- package/build/components/block-controls/fill.js +6 -6
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-controls/groups.js +3 -1
- package/build/components/block-controls/groups.js.map +1 -1
- package/build/components/block-controls/hook.js +57 -0
- package/build/components/block-controls/hook.js.map +1 -0
- package/build/components/block-edit/context.js +6 -5
- package/build/components/block-edit/context.js.map +1 -1
- package/build/components/block-edit/edit.js +1 -1
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-icon/index.js +5 -1
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-icon/index.native.js +13 -9
- package/build/components/block-icon/index.native.js.map +1 -1
- package/build/components/block-inspector/index.js +14 -7
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-html.js +5 -0
- package/build/components/block-list/block-html.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +31 -12
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js +4 -4
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js +15 -9
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +6 -7
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/grid-item.native.js +68 -0
- package/build/components/block-list/grid-item.native.js.map +1 -0
- package/build/components/block-list/index.js +19 -15
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +13 -9
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +6 -6
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +4 -6
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
- package/build/components/block-list/use-block-props/use-multi-selection.js +21 -6
- package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +9 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list-appender/index.js +9 -1
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-mover/index.js +4 -4
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +4 -4
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +0 -1
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-patterns-list/index.js +1 -8
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-preview/auto.js +42 -14
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-settings/container.native.js +5 -2
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +26 -5
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +10 -3
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +5 -1
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/preview.native.js +2 -2
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-switcher/block-styles-menu.js +1 -1
- package/build/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build/components/block-switcher/index.js +10 -3
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-title/index.js +3 -2
- package/build/components/block-title/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +3 -0
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-popover.js +8 -7
- package/build/components/block-tools/block-popover.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +2 -4
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +4 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +96 -7
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-types-list/index.native.js +3 -2
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/utils.js +17 -8
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/colors/utils.js +11 -3
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors-gradients/control.js +22 -57
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +83 -7
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/contrast-checker/index.js +18 -12
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/copy-handler/index.js +9 -3
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +2 -2
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/duotone-control/index.js +41 -39
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/editor-styles/index.js +9 -3
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +44 -12
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-sizes/index.native.js +24 -0
- package/build/components/font-sizes/index.native.js.map +1 -1
- package/build/components/iframe/index.js +46 -63
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +126 -0
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -0
- package/build/components/image-editor/constants.js +16 -0
- package/build/components/image-editor/constants.js.map +1 -0
- package/build/components/image-editor/context.js +59 -0
- package/build/components/image-editor/context.js.map +1 -0
- package/build/components/image-editor/cropper.js +83 -0
- package/build/components/image-editor/cropper.js.map +1 -0
- package/build/components/image-editor/form-controls.js +36 -0
- package/build/components/image-editor/form-controls.js.map +1 -0
- package/build/components/image-editor/index.js +60 -0
- package/build/components/image-editor/index.js.map +1 -0
- package/build/components/image-editor/rotation-button.js +37 -0
- package/build/components/image-editor/rotation-button.js.map +1 -0
- package/build/components/image-editor/use-save-image.js +84 -0
- package/build/components/image-editor/use-save-image.js.map +1 -0
- package/build/components/image-editor/use-transform-image.js +135 -0
- package/build/components/image-editor/use-transform-image.js.map +1 -0
- package/build/components/image-editor/zoom-dropdown.js +55 -0
- package/build/components/image-editor/zoom-dropdown.js.map +1 -0
- package/build/components/image-size-control/use-dimension-handler.js +14 -3
- package/build/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build/components/index.js +42 -37
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +12 -7
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +11 -1
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +28 -10
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +42 -4
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +24 -13
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js +62 -0
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/patterns-list.js +111 -0
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/sidebar.js +78 -0
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
- package/build/components/inserter/block-patterns-tab.js +74 -35
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +3 -6
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +4 -7
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-clipboard-block.native.js +5 -4
- package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
- package/build/components/inserter/index.js +12 -4
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +1 -7
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +2 -0
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +2 -1
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js +18 -17
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/pattern-panel.js +19 -10
- package/build/components/inserter/pattern-panel.js.map +1 -1
- package/build/components/inserter/preview-panel.js +1 -1
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -1
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +5 -6
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-results.native.js +9 -2
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inserter/tabs.native.js +1 -4
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/utils.native.js +44 -0
- package/build/components/inserter/utils.native.js.map +1 -0
- package/build/components/inspector-controls/block-support-slot-container.js +28 -0
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -0
- package/build/components/inspector-controls/block-support-tools-panel.js +78 -0
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -0
- package/build/components/inspector-controls/fill.js +64 -0
- package/build/components/inspector-controls/fill.js.map +1 -0
- package/build/components/inspector-controls/{index.native.js → fill.native.js} +20 -19
- package/build/components/inspector-controls/fill.native.js.map +1 -0
- package/build/components/inspector-controls/groups.js +25 -0
- package/build/components/inspector-controls/groups.js.map +1 -0
- package/build/components/inspector-controls/index.js +22 -20
- package/build/components/inspector-controls/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +67 -0
- package/build/components/inspector-controls/slot.js.map +1 -0
- package/build/components/inspector-controls/slot.native.js +38 -0
- package/build/components/inspector-controls/slot.native.js.map +1 -0
- package/build/components/letter-spacing-control/index.js +9 -6
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.native.js +39 -0
- package/build/components/line-height-control/index.native.js.map +1 -0
- package/build/components/link-control/index.js +93 -34
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +45 -15
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-input.js +25 -7
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block-contents.js +1 -20
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block.js +54 -69
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +102 -76
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +53 -23
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +2 -2
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/list-item.js +3 -2
- package/build/components/list-view/list-item.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +13 -54
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/media-placeholder/index.js +35 -21
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +2 -1
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +5 -3
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +1 -4
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/observe-typing/index.js +1 -1
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +30 -1
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +66 -0
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -0
- package/build/components/rich-text/format-edit.js +28 -2
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +32 -11
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +29 -7
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +43 -5
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/input-event.js +25 -24
- package/build/components/rich-text/input-event.js.map +1 -1
- package/build/components/rich-text/shortcut.js +23 -9
- package/build/components/rich-text/shortcut.js.map +1 -1
- package/build/components/rich-text/use-input-events.js +27 -0
- package/build/components/rich-text/use-input-events.js.map +1 -0
- package/build/components/rich-text/use-paste-handler.js +45 -10
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/rich-text/use-shortcuts.js +27 -0
- package/build/components/rich-text/use-shortcuts.js.map +1 -0
- package/build/components/rich-text/utils.js +22 -0
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/typewriter/index.js +1 -1
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/url-input/index.js +25 -11
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-display-block-controls/index.js +5 -7
- package/build/components/use-display-block-controls/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +13 -10
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +2 -1
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +2 -13
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-setting/index.js +49 -14
- package/build/components/use-setting/index.js.map +1 -1
- package/build/components/writing-flow/use-multi-selection.js +6 -0
- package/build/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +18 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +14 -14
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +4 -2
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/border-color.js +9 -5
- package/build/hooks/border-color.js.map +1 -1
- package/build/hooks/border.js +5 -5
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color-panel.js +5 -2
- package/build/hooks/color-panel.js.map +1 -1
- package/build/hooks/color.js +6 -4
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/compat.js +23 -0
- package/build/hooks/compat.js.map +1 -0
- package/build/hooks/custom-class-name.js +3 -1
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/dimensions.js +63 -28
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +63 -18
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-appearance.js +49 -6
- package/build/hooks/font-appearance.js.map +1 -1
- package/build/hooks/font-family.js +123 -32
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +51 -9
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/gap.js +163 -0
- package/build/hooks/gap.js.map +1 -0
- package/build/hooks/index.js +12 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +10 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +47 -30
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/letter-spacing.js +45 -8
- package/build/hooks/letter-spacing.js.map +1 -1
- package/build/hooks/line-height.js +45 -8
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/lock.js +43 -0
- package/build/hooks/lock.js.map +1 -0
- package/build/hooks/margin.js +6 -3
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/padding.js +6 -3
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/style.js +39 -11
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/text-decoration.js +42 -6
- package/build/hooks/text-decoration.js.map +1 -1
- package/build/hooks/text-transform.js +42 -6
- package/build/hooks/text-transform.js.map +1 -1
- package/build/hooks/typography.js +109 -9
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +60 -0
- package/build/hooks/typography.native.js.map +1 -0
- package/build/hooks/use-cached-truthy.js +29 -0
- package/build/hooks/use-cached-truthy.js.map +1 -0
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/layouts/flex.js +215 -11
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +99 -6
- package/build/layouts/flow.js.map +1 -1
- package/build/store/actions.js +331 -266
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +2 -0
- package/build/store/defaults.js.map +1 -1
- package/build/store/defaults.native.js +16 -1
- package/build/store/defaults.native.js.map +1 -1
- package/build/store/index.js +1 -3
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +165 -114
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +203 -115
- package/build/store/selectors.js.map +1 -1
- package/build/utils/index.js +10 -1
- package/build/utils/index.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +295 -0
- package/build/utils/parse-css-unit-to-px.js.map +1 -0
- package/build/utils/transform-styles/transforms/wrap.js +16 -0
- package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-module/components/autocomplete/index.js +2 -2
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +8 -4
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +64 -17
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +25 -3
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-content-overlay/index.js +2 -4
- package/build-module/components/block-content-overlay/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +6 -5
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-controls/groups.js +3 -1
- package/build-module/components/block-controls/groups.js.map +1 -1
- package/build-module/components/block-controls/hook.js +42 -0
- package/build-module/components/block-controls/hook.js.map +1 -0
- package/build-module/components/block-edit/context.js +4 -4
- package/build-module/components/block-edit/context.js.map +1 -1
- package/build-module/components/block-edit/edit.js +1 -1
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-icon/index.js +5 -1
- package/build-module/components/block-icon/index.js.map +1 -1
- package/build-module/components/block-icon/index.native.js +14 -9
- package/build-module/components/block-icon/index.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +12 -6
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-html.js +5 -0
- package/build-module/components/block-list/block-html.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +30 -12
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js +3 -4
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.js +16 -10
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +6 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/grid-item.native.js +57 -0
- package/build-module/components/block-list/grid-item.native.js.map +1 -0
- package/build-module/components/block-list/index.js +17 -14
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +13 -9
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +7 -7
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +5 -7
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +2 -2
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-multi-selection.js +21 -6
- package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +9 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +9 -1
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-mover/index.js +4 -4
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +4 -4
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +0 -1
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +1 -6
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +40 -16
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +6 -3
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +28 -7
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +10 -3
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +5 -1
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +2 -2
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build-module/components/block-switcher/index.js +10 -3
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-title/index.js +3 -2
- package/build-module/components/block-title/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +3 -0
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/block-popover.js +9 -8
- package/build-module/components/block-tools/block-popover.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +2 -4
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +4 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +96 -8
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +3 -2
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +16 -9
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/colors/utils.js +9 -3
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +26 -63
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +84 -7
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/contrast-checker/index.js +13 -10
- package/build-module/components/contrast-checker/index.js.map +1 -1
- package/build-module/components/copy-handler/index.js +9 -3
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +2 -2
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/duotone-control/index.js +43 -39
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/editor-styles/index.js +7 -3
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +40 -12
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-sizes/index.native.js +3 -1
- package/build-module/components/font-sizes/index.native.js.map +1 -1
- package/build-module/components/iframe/index.js +47 -65
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +115 -0
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -0
- package/build-module/components/image-editor/constants.js +7 -0
- package/build-module/components/image-editor/constants.js.map +1 -0
- package/build-module/components/image-editor/context.js +44 -0
- package/build-module/components/image-editor/context.js.map +1 -0
- package/build-module/components/image-editor/cropper.js +69 -0
- package/build-module/components/image-editor/cropper.js.map +1 -0
- package/build-module/components/image-editor/form-controls.js +26 -0
- package/build-module/components/image-editor/form-controls.js.map +1 -0
- package/build-module/components/image-editor/index.js +37 -0
- package/build-module/components/image-editor/index.js.map +1 -0
- package/build-module/components/image-editor/rotation-button.js +26 -0
- package/build-module/components/image-editor/rotation-button.js.map +1 -0
- package/build-module/components/image-editor/use-save-image.js +70 -0
- package/build-module/components/image-editor/use-save-image.js.map +1 -0
- package/build-module/components/image-editor/use-transform-image.js +127 -0
- package/build-module/components/image-editor/use-transform-image.js.map +1 -0
- package/build-module/components/image-editor/zoom-dropdown.js +43 -0
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -0
- package/build-module/components/image-size-control/use-dimension-handler.js +13 -2
- package/build-module/components/image-size-control/use-dimension-handler.js.map +1 -1
- package/build-module/components/index.js +5 -6
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +2 -3
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +10 -1
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +29 -11
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +41 -5
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -13
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js +50 -0
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +92 -0
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +69 -0
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab.js +75 -36
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +2 -5
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +4 -7
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-clipboard-block.native.js +5 -4
- package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
- package/build-module/components/inserter/index.js +12 -4
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +1 -7
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/library.js +2 -0
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +2 -1
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js +17 -17
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/pattern-panel.js +21 -13
- package/build-module/components/inserter/pattern-panel.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +1 -1
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +4 -5
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js +8 -2
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +1 -4
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +35 -0
- package/build-module/components/inserter/utils.native.js.map +1 -0
- package/build-module/components/inspector-controls/block-support-slot-container.js +18 -0
- package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -0
- package/build-module/components/inspector-controls/block-support-tools-panel.js +67 -0
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -0
- package/build-module/components/inspector-controls/fill.js +50 -0
- package/build-module/components/inspector-controls/fill.js.map +1 -0
- package/build-module/components/inspector-controls/{index.native.js → fill.native.js} +16 -18
- package/build-module/components/inspector-controls/fill.native.js.map +1 -0
- package/build-module/components/inspector-controls/groups.js +16 -0
- package/build-module/components/inspector-controls/groups.js.map +1 -0
- package/build-module/components/inspector-controls/index.js +16 -17
- package/build-module/components/inspector-controls/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +52 -0
- package/build-module/components/inspector-controls/slot.js.map +1 -0
- package/build-module/components/inspector-controls/slot.native.js +27 -0
- package/build-module/components/inspector-controls/slot.native.js.map +1 -0
- package/build-module/components/letter-spacing-control/index.js +9 -6
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +29 -0
- package/build-module/components/line-height-control/index.native.js.map +1 -0
- package/build-module/components/link-control/index.js +93 -35
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +46 -17
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-input.js +24 -7
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block-contents.js +1 -18
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block.js +56 -71
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +102 -78
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +55 -27
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +2 -2
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/list-item.js +3 -2
- package/build-module/components/list-view/list-item.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +13 -54
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +35 -21
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +2 -1
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +5 -3
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +1 -4
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +1 -1
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +29 -2
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +54 -0
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -0
- package/build-module/components/rich-text/format-edit.js +28 -3
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +29 -11
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +22 -6
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +43 -6
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/input-event.js +24 -22
- package/build-module/components/rich-text/input-event.js.map +1 -1
- package/build-module/components/rich-text/shortcut.js +22 -9
- package/build-module/components/rich-text/shortcut.js.map +1 -1
- package/build-module/components/rich-text/use-input-events.js +19 -0
- package/build-module/components/rich-text/use-input-events.js.map +1 -0
- package/build-module/components/rich-text/use-paste-handler.js +44 -10
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/use-shortcuts.js +19 -0
- package/build-module/components/rich-text/use-shortcuts.js.map +1 -0
- package/build-module/components/rich-text/utils.js +20 -0
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/typewriter/index.js +1 -1
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/url-input/index.js +25 -11
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-display-block-controls/index.js +5 -7
- package/build-module/components/use-display-block-controls/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +13 -10
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +3 -2
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +2 -10
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-setting/index.js +48 -14
- package/build-module/components/use-setting/index.js.map +1 -1
- package/build-module/components/writing-flow/use-multi-selection.js +6 -0
- package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +18 -3
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +15 -15
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +5 -3
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/border-color.js +10 -5
- package/build-module/hooks/border-color.js.map +1 -1
- package/build-module/hooks/border.js +5 -5
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color-panel.js +6 -3
- package/build-module/hooks/color-panel.js.map +1 -1
- package/build-module/hooks/color.js +6 -4
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/compat.js +20 -0
- package/build-module/hooks/compat.js.map +1 -0
- package/build-module/hooks/custom-class-name.js +4 -2
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/dimensions.js +57 -26
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +62 -18
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-appearance.js +45 -6
- package/build-module/hooks/font-appearance.js.map +1 -1
- package/build-module/hooks/font-family.js +117 -33
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +47 -9
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/gap.js +140 -0
- package/build-module/hooks/gap.js.map +1 -0
- package/build-module/hooks/index.js +3 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +2 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.js +47 -30
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/letter-spacing.js +41 -8
- package/build-module/hooks/letter-spacing.js.map +1 -1
- package/build-module/hooks/line-height.js +41 -8
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/lock.js +33 -0
- package/build-module/hooks/lock.js.map +1 -0
- package/build-module/hooks/margin.js +7 -4
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/padding.js +7 -4
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/style.js +39 -11
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/text-decoration.js +38 -6
- package/build-module/hooks/text-decoration.js.map +1 -1
- package/build-module/hooks/text-transform.js +38 -6
- package/build-module/hooks/text-transform.js.map +1 -1
- package/build-module/hooks/typography.js +118 -19
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +41 -0
- package/build-module/hooks/typography.native.js.map +1 -0
- package/build-module/hooks/use-cached-truthy.js +21 -0
- package/build-module/hooks/use-cached-truthy.js.map +1 -0
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/flex.js +210 -12
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +99 -7
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/store/actions.js +294 -242
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +2 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/defaults.native.js +15 -1
- package/build-module/store/defaults.native.js.map +1 -1
- package/build-module/store/index.js +1 -2
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +167 -115
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +189 -104
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/index.js +1 -0
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +285 -0
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -0
- package/build-module/utils/transform-styles/transforms/wrap.js +16 -0
- package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-style/default-editor-styles-rtl.css +114 -0
- package/build-style/default-editor-styles.css +114 -0
- package/build-style/style-rtl.css +292 -181
- package/build-style/style.css +292 -181
- package/build-types/components/block-context/index.d.ts +1 -1
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/package.json +28 -27
- package/src/components/autocomplete/index.js +5 -2
- package/src/components/block-actions/index.js +9 -5
- package/src/components/block-alignment-control/style.scss +5 -0
- package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +15 -1
- package/src/components/block-alignment-control/test/index.native.js +37 -0
- package/src/components/block-alignment-control/ui.js +98 -27
- package/src/components/block-alignment-control/use-available-alignments.js +31 -10
- package/src/components/block-content-overlay/index.js +3 -6
- package/src/components/block-content-overlay/style.scss +9 -21
- package/src/components/block-controls/fill.js +7 -4
- package/src/components/block-controls/groups.js +2 -0
- package/src/components/block-controls/hook.js +44 -0
- package/src/components/block-draggable/style.scss +19 -4
- package/src/components/block-edit/context.js +4 -3
- package/src/components/block-edit/edit.js +1 -4
- package/src/components/block-icon/index.js +4 -1
- package/src/components/block-icon/index.native.js +11 -12
- package/src/components/block-inspector/index.js +19 -9
- package/src/components/block-list/block-html.js +5 -0
- package/src/components/block-list/block-list-item.native.js +34 -11
- package/src/components/block-list/block-list-item.native.scss +4 -0
- package/src/components/block-list/block-selection-button.native.js +8 -5
- package/src/components/block-list/block.js +13 -9
- package/src/components/block-list/block.native.js +7 -5
- package/src/components/block-list/grid-item.native.js +58 -0
- package/src/components/block-list/index.js +33 -27
- package/src/components/block-list/index.native.js +10 -4
- package/src/components/block-list/style.native.scss +0 -1
- package/src/components/block-list/style.scss +15 -0
- package/src/components/block-list/use-block-props/index.js +4 -7
- package/src/components/block-list/use-block-props/use-block-custom-class-name.js +5 -7
- package/src/components/block-list/use-block-props/use-block-default-class-name.js +2 -8
- package/src/components/block-list/use-block-props/use-multi-selection.js +30 -4
- package/src/components/block-list/use-in-between-inserter.js +9 -0
- package/src/components/block-list-appender/index.js +8 -0
- package/src/components/block-mover/index.js +4 -4
- package/src/components/block-mover/index.native.js +4 -4
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +10 -6
- package/src/components/block-mover/test/index.native.js +26 -28
- package/src/components/block-navigation/dropdown.js +0 -1
- package/src/components/block-patterns-list/index.js +1 -8
- package/src/components/block-patterns-list/style.scss +22 -12
- package/src/components/block-preview/README.md +1 -1
- package/src/components/block-preview/auto.js +36 -18
- package/src/components/block-preview/style.scss +0 -20
- package/src/components/block-settings/container.native.js +7 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +26 -13
- package/src/components/block-settings-menu-controls/index.js +9 -6
- package/src/components/block-styles/index.js +6 -1
- package/src/components/block-styles/preview.native.js +2 -2
- package/src/components/block-switcher/block-styles-menu.js +1 -1
- package/src/components/block-switcher/index.js +7 -3
- package/src/components/block-switcher/test/__snapshots__/index.js.snap +1 -1
- package/src/components/block-switcher/test/index.js +3 -0
- package/src/components/block-title/index.js +5 -2
- package/src/components/block-toolbar/index.js +4 -0
- package/src/components/block-tools/block-contextual-toolbar.js +7 -5
- package/src/components/block-tools/block-popover.js +8 -8
- package/src/components/block-tools/block-selection-button.js +2 -4
- package/src/components/block-tools/index.js +5 -2
- package/src/components/block-tools/insertion-point.js +97 -9
- package/src/components/block-tools/style.scss +4 -35
- package/src/components/block-types-list/index.native.js +8 -2
- package/src/components/block-types-list/style.scss +0 -3
- package/src/components/block-variation-picker/README.md +47 -14
- package/src/components/block-variation-picker/style.native.scss +4 -0
- package/src/components/border-radius-control/index.js +1 -0
- package/src/components/border-radius-control/test/utils.js +216 -0
- package/src/components/border-radius-control/utils.js +18 -10
- package/src/components/color-palette/test/__snapshots__/control.js.snap +128 -71
- package/src/components/colors/test/utils.js +41 -0
- package/src/components/colors/utils.js +9 -5
- package/src/components/colors-gradients/control.js +70 -110
- package/src/components/colors-gradients/panel-color-gradient-settings.js +79 -7
- package/src/components/colors-gradients/style.scss +10 -18
- package/src/components/colors-gradients/test/control.js +41 -66
- package/src/components/contrast-checker/index.js +14 -10
- package/src/components/copy-handler/index.js +6 -1
- package/src/components/default-block-appender/index.js +2 -2
- package/src/components/default-block-appender/test/__snapshots__/index.js.snap +3 -3
- package/src/components/duotone-control/index.js +49 -41
- package/src/components/duotone-control/style.scss +27 -12
- package/src/components/editor-styles/index.js +8 -4
- package/src/components/font-appearance-control/index.js +62 -24
- package/src/components/font-appearance-control/style.scss +1 -1
- package/src/components/font-sizes/index.native.js +7 -1
- package/src/components/iframe/index.js +64 -75
- package/src/components/image-editor/aspect-ratio-dropdown.js +129 -0
- package/src/components/image-editor/constants.js +6 -0
- package/src/components/image-editor/context.js +56 -0
- package/src/components/image-editor/cropper.js +74 -0
- package/src/components/image-editor/form-controls.js +22 -0
- package/src/components/image-editor/index.js +52 -0
- package/src/components/image-editor/rotation-button.js +24 -0
- package/src/components/image-editor/use-save-image.js +97 -0
- package/src/components/image-editor/use-transform-image.js +162 -0
- package/src/components/image-editor/zoom-dropdown.js +40 -0
- package/src/components/image-size-control/use-dimension-handler.js +18 -1
- package/src/components/index.js +10 -8
- package/src/components/index.native.js +5 -3
- package/src/components/inner-blocks/button-block-appender.js +9 -0
- package/src/components/inner-blocks/index.js +43 -14
- package/src/components/inner-blocks/index.native.js +48 -4
- package/src/components/inner-blocks/use-nested-settings-update.js +26 -11
- package/src/components/inserter/block-patterns-explorer/explorer.js +50 -0
- package/src/components/inserter/block-patterns-explorer/patterns-list.js +122 -0
- package/src/components/inserter/block-patterns-explorer/sidebar.js +73 -0
- package/src/components/inserter/block-patterns-tab.js +107 -73
- package/src/components/inserter/block-types-tab.native.js +3 -6
- package/src/components/inserter/hooks/use-block-type-impressions.native.js +14 -21
- package/src/components/inserter/hooks/use-clipboard-block.native.js +3 -2
- package/src/components/inserter/index.js +15 -3
- package/src/components/inserter/index.native.js +2 -19
- package/src/components/inserter/library.js +2 -0
- package/src/components/inserter/menu.js +4 -1
- package/src/components/inserter/menu.native.js +18 -15
- package/src/components/inserter/pattern-panel.js +33 -16
- package/src/components/inserter/preview-panel.js +1 -1
- package/src/components/inserter/quick-inserter.js +1 -1
- package/src/components/inserter/reusable-blocks-tab.native.js +4 -6
- package/src/components/inserter/search-results.native.js +8 -1
- package/src/components/inserter/style.native.scss +8 -5
- package/src/components/inserter/style.scss +80 -16
- package/src/components/inserter/tabs.native.js +1 -7
- package/src/components/inserter/test/block-types-tab.native.js +3 -2
- package/src/components/inserter/test/fixtures/index.native.js +12 -0
- package/src/components/inserter/utils.native.js +35 -0
- package/src/components/inserter-list-item/style.scss +4 -2
- package/src/components/inspector-controls/README.md +43 -198
- package/src/components/inspector-controls/block-support-slot-container.js +10 -0
- package/src/components/inspector-controls/block-support-tools-panel.js +60 -0
- package/src/components/inspector-controls/fill.js +53 -0
- package/src/components/inspector-controls/{index.native.js → fill.native.js} +14 -14
- package/src/components/inspector-controls/groups.js +22 -0
- package/src/components/inspector-controls/index.js +16 -18
- package/src/components/inspector-controls/slot.js +45 -0
- package/src/components/inspector-controls/slot.native.js +22 -0
- package/src/components/letter-spacing-control/index.js +12 -6
- package/src/components/line-height-control/index.native.js +25 -0
- package/src/components/link-control/README.md +47 -14
- package/src/components/link-control/index.js +102 -31
- package/src/components/link-control/link-preview.js +53 -20
- package/src/components/link-control/search-input.js +21 -7
- package/src/components/link-control/style.scss +66 -19
- package/src/components/link-control/test/index.js +311 -4
- package/src/components/list-view/block-contents.js +17 -38
- package/src/components/list-view/block.js +73 -84
- package/src/components/list-view/branch.js +123 -94
- package/src/components/list-view/index.js +95 -37
- package/src/components/list-view/leaf.js +2 -2
- package/src/components/list-view/list-item.js +5 -4
- package/src/components/list-view/style.scss +70 -33
- package/src/components/list-view/use-list-view-client-ids.js +9 -68
- package/src/components/media-placeholder/README.md +9 -0
- package/src/components/media-placeholder/index.js +31 -20
- package/src/components/media-placeholder/index.native.js +2 -1
- package/src/components/media-placeholder/style.scss +2 -0
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +4 -1
- package/src/components/media-replace-flow/style.scss +11 -12
- package/src/components/media-upload/README.md +1 -1
- package/src/components/navigable-toolbar/index.js +1 -4
- package/src/components/observe-typing/index.js +3 -2
- package/src/components/plain-text/index.native.js +26 -4
- package/src/components/rich-text/embed-handler-picker.native.js +68 -0
- package/src/components/rich-text/format-edit.js +36 -2
- package/src/components/rich-text/format-toolbar/index.js +25 -6
- package/src/components/rich-text/index.js +38 -12
- package/src/components/rich-text/index.native.js +37 -4
- package/src/components/rich-text/input-event.js +21 -20
- package/src/components/rich-text/shortcut.js +24 -9
- package/src/components/rich-text/style.scss +7 -5
- package/src/components/rich-text/use-input-events.js +19 -0
- package/src/components/rich-text/use-paste-handler.js +47 -12
- package/src/components/rich-text/use-shortcuts.js +19 -0
- package/src/components/rich-text/utils.js +16 -0
- package/src/components/skip-to-selected-block/README.md +39 -0
- package/src/components/tool-selector/style.scss +5 -5
- package/src/components/typewriter/index.js +3 -2
- package/src/components/url-input/index.js +26 -10
- package/src/components/use-display-block-controls/index.js +7 -10
- package/src/components/use-moving-animation/index.js +9 -8
- package/src/components/use-on-block-drop/index.js +5 -1
- package/src/components/use-resize-canvas/index.js +2 -17
- package/src/components/use-setting/index.js +48 -16
- package/src/components/writing-flow/use-multi-selection.js +6 -0
- package/src/components/writing-flow/use-tab-nav.js +21 -11
- package/src/default-editor-styles.scss +24 -0
- package/src/hooks/align.js +28 -20
- package/src/hooks/anchor.js +5 -5
- package/src/hooks/border-color.js +12 -1
- package/src/hooks/border.js +8 -11
- package/src/hooks/color-panel.js +4 -1
- package/src/hooks/color.js +11 -4
- package/src/hooks/compat.js +23 -0
- package/src/hooks/custom-class-name.js +3 -3
- package/src/hooks/dimensions.js +94 -50
- package/src/hooks/duotone.js +70 -21
- package/src/hooks/font-appearance.js +38 -7
- package/src/hooks/font-family.js +129 -33
- package/src/hooks/font-size.js +42 -6
- package/src/hooks/gap.js +146 -0
- package/src/hooks/index.js +3 -0
- package/src/hooks/index.native.js +2 -0
- package/src/hooks/layout.js +82 -56
- package/src/hooks/layout.scss +8 -0
- package/src/hooks/letter-spacing.js +37 -8
- package/src/hooks/line-height.js +37 -9
- package/src/hooks/lock.js +34 -0
- package/src/hooks/margin.js +13 -3
- package/src/hooks/padding.js +13 -3
- package/src/hooks/style.js +57 -18
- package/src/hooks/test/style.js +4 -0
- package/src/hooks/text-decoration.js +34 -6
- package/src/hooks/text-transform.js +34 -6
- package/src/hooks/typography.js +167 -21
- package/src/hooks/typography.native.js +64 -0
- package/src/hooks/typography.scss +16 -0
- package/src/hooks/use-cached-truthy.js +20 -0
- package/src/index.js +1 -0
- package/src/layouts/flex.js +237 -14
- package/src/layouts/flow.js +81 -14
- package/src/store/actions.js +248 -378
- package/src/store/defaults.js +2 -0
- package/src/store/defaults.native.js +15 -0
- package/src/store/index.js +1 -2
- package/src/store/reducer.js +248 -145
- package/src/store/selectors.js +212 -158
- package/src/store/test/actions.js +407 -705
- package/src/store/test/reducer.js +184 -146
- package/src/store/test/selectors.js +197 -177
- package/src/style.scss +2 -15
- package/src/utils/index.js +1 -0
- package/src/utils/parse-css-unit-to-px.js +272 -0
- package/src/utils/test/parse-css-unit-to-px.js +166 -0
- package/src/utils/transform-styles/transforms/test/wrap.js +1 -1
- package/src/utils/transform-styles/transforms/wrap.js +16 -0
- package/tsconfig.tsbuildinfo +1 -466
- package/build/components/block-list/head.js +0 -27
- package/build/components/block-list/head.js.map +0 -1
- package/build/components/duotone-control/duotone-picker-popover.js +0 -44
- package/build/components/duotone-control/duotone-picker-popover.js.map +0 -1
- package/build/components/inspector-advanced-controls/index.js +0 -46
- package/build/components/inspector-advanced-controls/index.js.map +0 -1
- package/build/components/inspector-controls/index.native.js.map +0 -1
- package/build/components/list-view/block-slot.js +0 -121
- package/build/components/list-view/block-slot.js.map +0 -1
- package/build/components/list-view/editor.js +0 -35
- package/build/components/list-view/editor.js.map +0 -1
- package/build/components/text-decoration-and-transform/index.js +0 -39
- package/build/components/text-decoration-and-transform/index.js.map +0 -1
- package/build/components/use-simulated-media-query/index.js +0 -137
- package/build/components/use-simulated-media-query/index.js.map +0 -1
- package/build/store/controls.js +0 -44
- package/build/store/controls.js.map +0 -1
- package/build-module/components/block-list/head.js +0 -19
- package/build-module/components/block-list/head.js.map +0 -1
- package/build-module/components/duotone-control/duotone-picker-popover.js +0 -35
- package/build-module/components/duotone-control/duotone-picker-popover.js.map +0 -1
- package/build-module/components/inspector-advanced-controls/index.js +0 -36
- package/build-module/components/inspector-advanced-controls/index.js.map +0 -1
- package/build-module/components/inspector-controls/index.native.js.map +0 -1
- package/build-module/components/list-view/block-slot.js +0 -96
- package/build-module/components/list-view/block-slot.js.map +0 -1
- package/build-module/components/list-view/editor.js +0 -25
- package/build-module/components/list-view/editor.js.map +0 -1
- package/build-module/components/text-decoration-and-transform/index.js +0 -30
- package/build-module/components/text-decoration-and-transform/index.js.map +0 -1
- package/build-module/components/use-simulated-media-query/index.js +0 -126
- package/build-module/components/use-simulated-media-query/index.js.map +0 -1
- package/build-module/store/controls.js +0 -32
- package/build-module/store/controls.js.map +0 -1
- package/src/components/block-list/head.js +0 -18
- package/src/components/duotone-control/duotone-picker-popover.js +0 -36
- package/src/components/inspector-advanced-controls/README.md +0 -72
- package/src/components/inspector-advanced-controls/index.js +0 -32
- package/src/components/list-view/block-slot.js +0 -120
- package/src/components/list-view/editor.js +0 -29
- package/src/components/text-decoration-and-transform/index.js +0 -36
- package/src/components/text-decoration-and-transform/style.scss +0 -3
- package/src/components/use-simulated-media-query/index.js +0 -144
- package/src/store/controls.js +0 -39
|
@@ -7,7 +7,7 @@ import deepFreeze from 'deep-freeze';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { createRegistry } from '@wordpress/data';
|
|
11
11
|
import {
|
|
12
12
|
getBlockTypes,
|
|
13
13
|
unregisterBlockType,
|
|
@@ -41,7 +41,6 @@ const {
|
|
|
41
41
|
replaceInnerBlocks,
|
|
42
42
|
resetBlocks,
|
|
43
43
|
selectBlock,
|
|
44
|
-
selectPreviousBlock,
|
|
45
44
|
showInsertionPoint,
|
|
46
45
|
startMultiSelect,
|
|
47
46
|
startTyping,
|
|
@@ -55,7 +54,6 @@ const {
|
|
|
55
54
|
updateBlockAttributes,
|
|
56
55
|
updateBlockListSettings,
|
|
57
56
|
updateSettings,
|
|
58
|
-
selectionChange,
|
|
59
57
|
validateBlocksToTemplate,
|
|
60
58
|
} = actions;
|
|
61
59
|
|
|
@@ -70,10 +68,11 @@ describe( 'actions', () => {
|
|
|
70
68
|
};
|
|
71
69
|
|
|
72
70
|
describe( 'resetBlocks', () => {
|
|
73
|
-
it( 'should
|
|
71
|
+
it( 'should dispatch the RESET_BLOCKS action', () => {
|
|
72
|
+
const dispatch = jest.fn();
|
|
74
73
|
const blocks = [];
|
|
75
|
-
|
|
76
|
-
expect(
|
|
74
|
+
resetBlocks( blocks )( { dispatch } );
|
|
75
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
77
76
|
type: 'RESET_BLOCKS',
|
|
78
77
|
blocks,
|
|
79
78
|
} );
|
|
@@ -147,59 +146,51 @@ describe( 'actions', () => {
|
|
|
147
146
|
} );
|
|
148
147
|
} );
|
|
149
148
|
describe( 'multiSelect', () => {
|
|
150
|
-
it( 'should
|
|
149
|
+
it( 'should dispatch MULTI_SELECT action if blocks have the same root client id', () => {
|
|
151
150
|
const start = 'start';
|
|
152
151
|
const end = 'end';
|
|
153
|
-
const
|
|
152
|
+
const select = {
|
|
153
|
+
getBlockRootClientId() {
|
|
154
|
+
return 'parent'; // for all client IDs
|
|
155
|
+
},
|
|
156
|
+
getSelectedBlockCount() {
|
|
157
|
+
return 0;
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
const dispatch = jest.fn();
|
|
154
161
|
|
|
155
|
-
|
|
156
|
-
controls.select(
|
|
157
|
-
blockEditorStoreName,
|
|
158
|
-
'getBlockRootClientId',
|
|
159
|
-
start
|
|
160
|
-
)
|
|
161
|
-
);
|
|
162
|
+
multiSelect( start, end )( { select, dispatch } );
|
|
162
163
|
|
|
163
|
-
expect(
|
|
164
|
-
controls.select(
|
|
165
|
-
blockEditorStoreName,
|
|
166
|
-
'getBlockRootClientId',
|
|
167
|
-
end
|
|
168
|
-
)
|
|
169
|
-
);
|
|
170
|
-
|
|
171
|
-
expect( multiSelectGenerator.next( 'parent' ).value ).toEqual( {
|
|
164
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
172
165
|
type: 'MULTI_SELECT',
|
|
173
166
|
start,
|
|
174
167
|
end,
|
|
175
168
|
} );
|
|
176
169
|
} );
|
|
177
170
|
|
|
178
|
-
it( 'should
|
|
171
|
+
it( 'should do nothing if blocks have different root client ids', () => {
|
|
179
172
|
const start = 'start';
|
|
180
173
|
const end = 'end';
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
174
|
+
const select = {
|
|
175
|
+
getBlockRootClientId( clientId ) {
|
|
176
|
+
switch ( clientId ) {
|
|
177
|
+
case start:
|
|
178
|
+
return 'parent';
|
|
179
|
+
case end:
|
|
180
|
+
return 'another parent';
|
|
181
|
+
default:
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
getSelectedBlockCount() {
|
|
186
|
+
return 0;
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
const dispatch = jest.fn();
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
controls.select(
|
|
193
|
-
blockEditorStoreName,
|
|
194
|
-
'getBlockRootClientId',
|
|
195
|
-
end
|
|
196
|
-
)
|
|
197
|
-
);
|
|
191
|
+
multiSelect( start, end )( { select, dispatch } );
|
|
198
192
|
|
|
199
|
-
expect(
|
|
200
|
-
done: true,
|
|
201
|
-
value: undefined,
|
|
202
|
-
} );
|
|
193
|
+
expect( dispatch ).not.toHaveBeenCalled();
|
|
203
194
|
} );
|
|
204
195
|
} );
|
|
205
196
|
|
|
@@ -212,55 +203,34 @@ describe( 'actions', () => {
|
|
|
212
203
|
} );
|
|
213
204
|
|
|
214
205
|
describe( 'replaceBlock', () => {
|
|
215
|
-
it( 'should
|
|
206
|
+
it( 'should dispatch the REPLACE_BLOCKS action if the new block can be inserted in the destination root block', () => {
|
|
216
207
|
const block = {
|
|
217
208
|
clientId: 'ribs',
|
|
218
209
|
name: 'core/test-block',
|
|
219
210
|
};
|
|
220
211
|
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
blockEditorStoreName,
|
|
229
|
-
'getBlockRootClientId',
|
|
230
|
-
'chicken'
|
|
231
|
-
)
|
|
232
|
-
);
|
|
212
|
+
const select = {
|
|
213
|
+
getSettings: () => null,
|
|
214
|
+
getBlockRootClientId: () => null,
|
|
215
|
+
canInsertBlockType: () => true,
|
|
216
|
+
getBlockCount: () => 1,
|
|
217
|
+
};
|
|
218
|
+
const dispatch = jest.fn();
|
|
233
219
|
|
|
234
|
-
|
|
235
|
-
controls.select(
|
|
236
|
-
blockEditorStoreName,
|
|
237
|
-
'canInsertBlockType',
|
|
238
|
-
'core/test-block',
|
|
239
|
-
undefined
|
|
240
|
-
)
|
|
241
|
-
);
|
|
220
|
+
replaceBlock( 'chicken', block )( { select, dispatch } );
|
|
242
221
|
|
|
243
|
-
expect(
|
|
222
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
244
223
|
type: 'REPLACE_BLOCKS',
|
|
245
224
|
clientIds: [ 'chicken' ],
|
|
246
225
|
blocks: [ block ],
|
|
247
226
|
time: expect.any( Number ),
|
|
248
227
|
initialPosition: 0,
|
|
249
228
|
} );
|
|
250
|
-
|
|
251
|
-
expect( replaceBlockGenerator.next().value ).toEqual(
|
|
252
|
-
controls.select( blockEditorStoreName, 'getBlockCount' )
|
|
253
|
-
);
|
|
254
|
-
|
|
255
|
-
expect( replaceBlockGenerator.next( 1 ) ).toEqual( {
|
|
256
|
-
value: undefined,
|
|
257
|
-
done: true,
|
|
258
|
-
} );
|
|
259
229
|
} );
|
|
260
230
|
} );
|
|
261
231
|
|
|
262
232
|
describe( 'replaceBlocks', () => {
|
|
263
|
-
it( 'should not
|
|
233
|
+
it( 'should not dispatch the REPLACE_BLOCKS action if the replacement is not possible', () => {
|
|
264
234
|
const blocks = [
|
|
265
235
|
{
|
|
266
236
|
clientId: 'ribs',
|
|
@@ -272,48 +242,27 @@ describe( 'actions', () => {
|
|
|
272
242
|
},
|
|
273
243
|
];
|
|
274
244
|
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
)
|
|
290
|
-
);
|
|
245
|
+
const select = {
|
|
246
|
+
getSettings: () => null,
|
|
247
|
+
getBlockRootClientId: () => null,
|
|
248
|
+
canInsertBlockType: ( clientId ) => {
|
|
249
|
+
switch ( clientId ) {
|
|
250
|
+
case 'core/test-ribs':
|
|
251
|
+
return true;
|
|
252
|
+
case 'core/test-chicken':
|
|
253
|
+
default:
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
};
|
|
258
|
+
const dispatch = jest.fn();
|
|
291
259
|
|
|
292
|
-
|
|
293
|
-
controls.select(
|
|
294
|
-
blockEditorStoreName,
|
|
295
|
-
'canInsertBlockType',
|
|
296
|
-
'core/test-ribs',
|
|
297
|
-
undefined
|
|
298
|
-
)
|
|
299
|
-
);
|
|
260
|
+
replaceBlocks( [ 'chicken' ], blocks )( { select, dispatch } );
|
|
300
261
|
|
|
301
|
-
expect(
|
|
302
|
-
controls.select(
|
|
303
|
-
blockEditorStoreName,
|
|
304
|
-
'canInsertBlockType',
|
|
305
|
-
'core/test-chicken',
|
|
306
|
-
undefined
|
|
307
|
-
)
|
|
308
|
-
);
|
|
309
|
-
|
|
310
|
-
expect( replaceBlockGenerator.next( false ) ).toEqual( {
|
|
311
|
-
value: undefined,
|
|
312
|
-
done: true,
|
|
313
|
-
} );
|
|
262
|
+
expect( dispatch ).not.toHaveBeenCalled();
|
|
314
263
|
} );
|
|
315
264
|
|
|
316
|
-
it( 'should
|
|
265
|
+
it( 'should dispatch the REPLACE_BLOCKS action if the all the replacement blocks can be inserted in the parent block', () => {
|
|
317
266
|
const blocks = [
|
|
318
267
|
{
|
|
319
268
|
clientId: 'ribs',
|
|
@@ -325,56 +274,23 @@ describe( 'actions', () => {
|
|
|
325
274
|
},
|
|
326
275
|
];
|
|
327
276
|
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
expect( replaceBlockGenerator.next().value ).toEqual(
|
|
337
|
-
controls.select(
|
|
338
|
-
blockEditorStoreName,
|
|
339
|
-
'getBlockRootClientId',
|
|
340
|
-
'chicken'
|
|
341
|
-
)
|
|
342
|
-
);
|
|
343
|
-
|
|
344
|
-
expect( replaceBlockGenerator.next().value ).toEqual(
|
|
345
|
-
controls.select(
|
|
346
|
-
blockEditorStoreName,
|
|
347
|
-
'canInsertBlockType',
|
|
348
|
-
'core/test-ribs',
|
|
349
|
-
undefined
|
|
350
|
-
)
|
|
351
|
-
);
|
|
277
|
+
const select = {
|
|
278
|
+
getSettings: () => null,
|
|
279
|
+
getBlockRootClientId: () => null,
|
|
280
|
+
canInsertBlockType: () => true,
|
|
281
|
+
getBlockCount: () => 1,
|
|
282
|
+
};
|
|
283
|
+
const dispatch = jest.fn();
|
|
352
284
|
|
|
353
|
-
|
|
354
|
-
controls.select(
|
|
355
|
-
blockEditorStoreName,
|
|
356
|
-
'canInsertBlockType',
|
|
357
|
-
'core/test-chicken',
|
|
358
|
-
undefined
|
|
359
|
-
)
|
|
360
|
-
);
|
|
285
|
+
replaceBlocks( [ 'chicken' ], blocks )( { select, dispatch } );
|
|
361
286
|
|
|
362
|
-
expect(
|
|
287
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
363
288
|
type: 'REPLACE_BLOCKS',
|
|
364
289
|
clientIds: [ 'chicken' ],
|
|
365
290
|
blocks,
|
|
366
291
|
time: expect.any( Number ),
|
|
367
292
|
initialPosition: 0,
|
|
368
293
|
} );
|
|
369
|
-
|
|
370
|
-
expect( replaceBlockGenerator.next().value ).toEqual(
|
|
371
|
-
controls.select( blockEditorStoreName, 'getBlockCount' )
|
|
372
|
-
);
|
|
373
|
-
|
|
374
|
-
expect( replaceBlockGenerator.next( 1 ) ).toEqual( {
|
|
375
|
-
value: undefined,
|
|
376
|
-
done: true,
|
|
377
|
-
} );
|
|
378
294
|
} );
|
|
379
295
|
|
|
380
296
|
it( 'should pass patternName through metadata to REPLACE_BLOCKS action', () => {
|
|
@@ -391,21 +307,23 @@ describe( 'actions', () => {
|
|
|
391
307
|
|
|
392
308
|
const meta = { patternName: 'core/chicken-ribs-pattern' };
|
|
393
309
|
|
|
394
|
-
const
|
|
310
|
+
const select = {
|
|
311
|
+
getSettings: () => null,
|
|
312
|
+
getBlockRootClientId: () => null,
|
|
313
|
+
canInsertBlockType: () => true,
|
|
314
|
+
getBlockCount: () => 1,
|
|
315
|
+
};
|
|
316
|
+
const dispatch = jest.fn();
|
|
317
|
+
|
|
318
|
+
replaceBlocks(
|
|
395
319
|
[ 'chicken' ],
|
|
396
320
|
blocks,
|
|
397
321
|
null,
|
|
398
322
|
null,
|
|
399
323
|
meta
|
|
400
|
-
);
|
|
401
|
-
|
|
402
|
-
// Skip to action yield.
|
|
403
|
-
replaceBlockGenerator.next();
|
|
404
|
-
replaceBlockGenerator.next();
|
|
405
|
-
replaceBlockGenerator.next();
|
|
406
|
-
replaceBlockGenerator.next( true );
|
|
324
|
+
)( { select, dispatch } );
|
|
407
325
|
|
|
408
|
-
expect(
|
|
326
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
409
327
|
type: 'REPLACE_BLOCKS',
|
|
410
328
|
clientIds: [ 'chicken' ],
|
|
411
329
|
blocks,
|
|
@@ -425,36 +343,27 @@ describe( 'actions', () => {
|
|
|
425
343
|
};
|
|
426
344
|
const index = 5;
|
|
427
345
|
|
|
428
|
-
const
|
|
346
|
+
const select = {
|
|
347
|
+
getSettings: () => null,
|
|
348
|
+
canInsertBlockType: () => true,
|
|
349
|
+
};
|
|
350
|
+
const dispatch = jest.fn();
|
|
351
|
+
|
|
352
|
+
insertBlock(
|
|
429
353
|
block,
|
|
430
354
|
index,
|
|
431
355
|
'testclientid',
|
|
432
356
|
true
|
|
433
|
-
);
|
|
357
|
+
)( { select, dispatch } );
|
|
434
358
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
'testclientid'
|
|
444
|
-
)
|
|
445
|
-
);
|
|
446
|
-
|
|
447
|
-
expect( insertBlockGenerator.next( true ) ).toEqual( {
|
|
448
|
-
done: true,
|
|
449
|
-
value: {
|
|
450
|
-
type: 'INSERT_BLOCKS',
|
|
451
|
-
blocks: [ block ],
|
|
452
|
-
index,
|
|
453
|
-
rootClientId: 'testclientid',
|
|
454
|
-
time: expect.any( Number ),
|
|
455
|
-
updateSelection: true,
|
|
456
|
-
initialPosition: 0,
|
|
457
|
-
},
|
|
359
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
360
|
+
type: 'INSERT_BLOCKS',
|
|
361
|
+
blocks: [ block ],
|
|
362
|
+
index,
|
|
363
|
+
rootClientId: 'testclientid',
|
|
364
|
+
time: expect.any( Number ),
|
|
365
|
+
updateSelection: true,
|
|
366
|
+
initialPosition: 0,
|
|
458
367
|
} );
|
|
459
368
|
} );
|
|
460
369
|
} );
|
|
@@ -475,74 +384,44 @@ describe( 'actions', () => {
|
|
|
475
384
|
};
|
|
476
385
|
const blocks = [ ribsBlock, chickenBlock, chickenRibsBlock ];
|
|
477
386
|
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
5,
|
|
481
|
-
'testrootid',
|
|
482
|
-
false
|
|
483
|
-
);
|
|
484
|
-
|
|
485
|
-
expect( insertBlocksGenerator.next().value ).toEqual(
|
|
486
|
-
controls.select( blockEditorStoreName, 'getSettings' )
|
|
487
|
-
);
|
|
488
|
-
|
|
489
|
-
expect(
|
|
490
|
-
insertBlocksGenerator.next( {
|
|
387
|
+
const select = {
|
|
388
|
+
getSettings: () => ( {
|
|
491
389
|
__experimentalPreferredStyleVariations: {
|
|
492
390
|
value: {
|
|
493
391
|
'core/test-ribs': 'squared',
|
|
494
392
|
'core/test-chicken-ribs': 'colorful',
|
|
495
393
|
},
|
|
496
394
|
},
|
|
497
|
-
} )
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
'canInsertBlockType',
|
|
502
|
-
'core/test-ribs',
|
|
503
|
-
'testrootid'
|
|
504
|
-
)
|
|
505
|
-
);
|
|
506
|
-
|
|
507
|
-
expect( insertBlocksGenerator.next( true ).value ).toEqual(
|
|
508
|
-
controls.select(
|
|
509
|
-
blockEditorStoreName,
|
|
510
|
-
'canInsertBlockType',
|
|
511
|
-
'core/test-chicken',
|
|
512
|
-
'testrootid'
|
|
513
|
-
)
|
|
514
|
-
);
|
|
395
|
+
} ),
|
|
396
|
+
canInsertBlockType: () => true,
|
|
397
|
+
};
|
|
398
|
+
const dispatch = jest.fn();
|
|
515
399
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
)
|
|
523
|
-
);
|
|
400
|
+
insertBlocks(
|
|
401
|
+
blocks,
|
|
402
|
+
5,
|
|
403
|
+
'testrootid',
|
|
404
|
+
false
|
|
405
|
+
)( { select, dispatch } );
|
|
524
406
|
|
|
525
|
-
expect(
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
{
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
{
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
updateSelection: false,
|
|
544
|
-
initialPosition: null,
|
|
545
|
-
},
|
|
407
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
408
|
+
type: 'INSERT_BLOCKS',
|
|
409
|
+
blocks: [
|
|
410
|
+
{
|
|
411
|
+
...ribsBlock,
|
|
412
|
+
attributes: { className: 'is-style-squared' },
|
|
413
|
+
},
|
|
414
|
+
chickenBlock,
|
|
415
|
+
{
|
|
416
|
+
...chickenRibsBlock,
|
|
417
|
+
attributes: { className: 'is-style-colorful' },
|
|
418
|
+
},
|
|
419
|
+
],
|
|
420
|
+
index: 5,
|
|
421
|
+
rootClientId: 'testrootid',
|
|
422
|
+
time: expect.any( Number ),
|
|
423
|
+
updateSelection: false,
|
|
424
|
+
initialPosition: null,
|
|
546
425
|
} );
|
|
547
426
|
} );
|
|
548
427
|
|
|
@@ -556,52 +435,41 @@ describe( 'actions', () => {
|
|
|
556
435
|
};
|
|
557
436
|
const blocks = [ ribsWithStyleBlock ];
|
|
558
437
|
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
5,
|
|
562
|
-
'testrootid',
|
|
563
|
-
false
|
|
564
|
-
);
|
|
565
|
-
|
|
566
|
-
expect( insertBlocksGenerator.next().value ).toEqual(
|
|
567
|
-
controls.select( blockEditorStoreName, 'getSettings' )
|
|
568
|
-
);
|
|
569
|
-
|
|
570
|
-
expect(
|
|
571
|
-
insertBlocksGenerator.next( {
|
|
438
|
+
const select = {
|
|
439
|
+
getSettings: () => ( {
|
|
572
440
|
__experimentalPreferredStyleVariations: {
|
|
573
441
|
value: {
|
|
574
442
|
'core/test-ribs': 'squared',
|
|
575
443
|
},
|
|
576
444
|
},
|
|
577
|
-
} )
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
'canInsertBlockType',
|
|
582
|
-
'core/test-ribs',
|
|
583
|
-
'testrootid'
|
|
584
|
-
)
|
|
585
|
-
);
|
|
445
|
+
} ),
|
|
446
|
+
canInsertBlockType: () => true,
|
|
447
|
+
};
|
|
448
|
+
const dispatch = jest.fn();
|
|
586
449
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
450
|
+
insertBlocks(
|
|
451
|
+
blocks,
|
|
452
|
+
5,
|
|
453
|
+
'testrootid',
|
|
454
|
+
false
|
|
455
|
+
)( { select, dispatch } );
|
|
456
|
+
|
|
457
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
458
|
+
type: 'INSERT_BLOCKS',
|
|
459
|
+
blocks: [
|
|
460
|
+
{
|
|
461
|
+
...ribsWithStyleBlock,
|
|
462
|
+
attributes: { className: 'is-style-colorful' },
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
index: 5,
|
|
466
|
+
rootClientId: 'testrootid',
|
|
467
|
+
time: expect.any( Number ),
|
|
468
|
+
updateSelection: false,
|
|
469
|
+
initialPosition: null,
|
|
603
470
|
} );
|
|
604
471
|
} );
|
|
472
|
+
|
|
605
473
|
it( 'should filter the allowed blocks in INSERT_BLOCKS action', () => {
|
|
606
474
|
const ribsBlock = {
|
|
607
475
|
clientId: 'ribs',
|
|
@@ -617,58 +485,42 @@ describe( 'actions', () => {
|
|
|
617
485
|
};
|
|
618
486
|
const blocks = [ ribsBlock, chickenBlock, chickenRibsBlock ];
|
|
619
487
|
|
|
620
|
-
const
|
|
488
|
+
const select = {
|
|
489
|
+
getSettings: () => null,
|
|
490
|
+
canInsertBlockType: ( clientId ) => {
|
|
491
|
+
switch ( clientId ) {
|
|
492
|
+
case 'core/test-ribs':
|
|
493
|
+
return true;
|
|
494
|
+
case 'core/test-chicken':
|
|
495
|
+
return false;
|
|
496
|
+
case 'core/test-chicken-ribs':
|
|
497
|
+
return true;
|
|
498
|
+
default:
|
|
499
|
+
return false;
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
};
|
|
503
|
+
const dispatch = jest.fn();
|
|
504
|
+
|
|
505
|
+
insertBlocks(
|
|
621
506
|
blocks,
|
|
622
507
|
5,
|
|
623
508
|
'testrootid',
|
|
624
509
|
false
|
|
625
|
-
);
|
|
626
|
-
|
|
627
|
-
// Skip getSettings select.
|
|
628
|
-
insertBlocksGenerator.next();
|
|
629
|
-
|
|
630
|
-
expect( insertBlocksGenerator.next().value ).toEqual(
|
|
631
|
-
controls.select(
|
|
632
|
-
blockEditorStoreName,
|
|
633
|
-
'canInsertBlockType',
|
|
634
|
-
'core/test-ribs',
|
|
635
|
-
'testrootid'
|
|
636
|
-
)
|
|
637
|
-
);
|
|
638
|
-
|
|
639
|
-
expect( insertBlocksGenerator.next( true ).value ).toEqual(
|
|
640
|
-
controls.select(
|
|
641
|
-
blockEditorStoreName,
|
|
642
|
-
'canInsertBlockType',
|
|
643
|
-
'core/test-chicken',
|
|
644
|
-
'testrootid'
|
|
645
|
-
)
|
|
646
|
-
);
|
|
647
|
-
|
|
648
|
-
expect( insertBlocksGenerator.next( false ).value ).toEqual(
|
|
649
|
-
controls.select(
|
|
650
|
-
blockEditorStoreName,
|
|
651
|
-
'canInsertBlockType',
|
|
652
|
-
'core/test-chicken-ribs',
|
|
653
|
-
'testrootid'
|
|
654
|
-
)
|
|
655
|
-
);
|
|
510
|
+
)( { select, dispatch } );
|
|
656
511
|
|
|
657
|
-
expect(
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
updateSelection: false,
|
|
666
|
-
initialPosition: null,
|
|
667
|
-
},
|
|
512
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
513
|
+
type: 'INSERT_BLOCKS',
|
|
514
|
+
blocks: [ ribsBlock, chickenRibsBlock ],
|
|
515
|
+
index: 5,
|
|
516
|
+
rootClientId: 'testrootid',
|
|
517
|
+
time: expect.any( Number ),
|
|
518
|
+
updateSelection: false,
|
|
519
|
+
initialPosition: null,
|
|
668
520
|
} );
|
|
669
521
|
} );
|
|
670
522
|
|
|
671
|
-
it( 'does not
|
|
523
|
+
it( 'does not dispatch INSERT_BLOCKS action if all the blocks are impossible to insert', () => {
|
|
672
524
|
const ribsBlock = {
|
|
673
525
|
clientId: 'ribs',
|
|
674
526
|
name: 'core/test-ribs',
|
|
@@ -679,38 +531,20 @@ describe( 'actions', () => {
|
|
|
679
531
|
};
|
|
680
532
|
const blocks = [ ribsBlock, chickenBlock ];
|
|
681
533
|
|
|
682
|
-
const
|
|
534
|
+
const select = {
|
|
535
|
+
getSettings: () => null,
|
|
536
|
+
canInsertBlockType: () => false,
|
|
537
|
+
};
|
|
538
|
+
const dispatch = jest.fn();
|
|
539
|
+
|
|
540
|
+
insertBlocks(
|
|
683
541
|
blocks,
|
|
684
542
|
5,
|
|
685
543
|
'testrootid',
|
|
686
544
|
false
|
|
687
|
-
);
|
|
545
|
+
)( { select, dispatch } );
|
|
688
546
|
|
|
689
|
-
|
|
690
|
-
insertBlocksGenerator.next();
|
|
691
|
-
|
|
692
|
-
expect( insertBlocksGenerator.next().value ).toEqual(
|
|
693
|
-
controls.select(
|
|
694
|
-
blockEditorStoreName,
|
|
695
|
-
'canInsertBlockType',
|
|
696
|
-
'core/test-ribs',
|
|
697
|
-
'testrootid'
|
|
698
|
-
)
|
|
699
|
-
);
|
|
700
|
-
|
|
701
|
-
expect( insertBlocksGenerator.next( false ).value ).toEqual(
|
|
702
|
-
controls.select(
|
|
703
|
-
blockEditorStoreName,
|
|
704
|
-
'canInsertBlockType',
|
|
705
|
-
'core/test-chicken',
|
|
706
|
-
'testrootid'
|
|
707
|
-
)
|
|
708
|
-
);
|
|
709
|
-
|
|
710
|
-
expect( insertBlocksGenerator.next( false ) ).toEqual( {
|
|
711
|
-
done: true,
|
|
712
|
-
value: undefined,
|
|
713
|
-
} );
|
|
547
|
+
expect( dispatch ).not.toHaveBeenCalled();
|
|
714
548
|
} );
|
|
715
549
|
|
|
716
550
|
it( 'should pass patternName through metadata to INSERT_BLOCKS action', () => {
|
|
@@ -729,57 +563,41 @@ describe( 'actions', () => {
|
|
|
729
563
|
const blocks = [ ribsBlock, chickenBlock, chickenRibsBlock ];
|
|
730
564
|
const meta = { patternName: 'core/chicken-ribs-pattern' };
|
|
731
565
|
|
|
732
|
-
const
|
|
566
|
+
const select = {
|
|
567
|
+
getSettings: () => null,
|
|
568
|
+
canInsertBlockType: ( clientId ) => {
|
|
569
|
+
switch ( clientId ) {
|
|
570
|
+
case 'core/test-ribs':
|
|
571
|
+
return true;
|
|
572
|
+
case 'core/test-chicken':
|
|
573
|
+
return false;
|
|
574
|
+
case 'core/test-chicken-ribs':
|
|
575
|
+
return true;
|
|
576
|
+
default:
|
|
577
|
+
return false;
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
};
|
|
581
|
+
const dispatch = jest.fn();
|
|
582
|
+
|
|
583
|
+
insertBlocks(
|
|
733
584
|
blocks,
|
|
734
585
|
5,
|
|
735
586
|
'testrootid',
|
|
736
587
|
false,
|
|
737
588
|
0,
|
|
738
589
|
meta
|
|
739
|
-
);
|
|
740
|
-
|
|
741
|
-
// Skip getSettings select.
|
|
742
|
-
insertBlocksGenerator.next();
|
|
590
|
+
)( { select, dispatch } );
|
|
743
591
|
|
|
744
|
-
expect(
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
expect( insertBlocksGenerator.next( true ).value ).toEqual(
|
|
754
|
-
controls.select(
|
|
755
|
-
blockEditorStoreName,
|
|
756
|
-
'canInsertBlockType',
|
|
757
|
-
'core/test-chicken',
|
|
758
|
-
'testrootid'
|
|
759
|
-
)
|
|
760
|
-
);
|
|
761
|
-
|
|
762
|
-
expect( insertBlocksGenerator.next( false ).value ).toEqual(
|
|
763
|
-
controls.select(
|
|
764
|
-
blockEditorStoreName,
|
|
765
|
-
'canInsertBlockType',
|
|
766
|
-
'core/test-chicken-ribs',
|
|
767
|
-
'testrootid'
|
|
768
|
-
)
|
|
769
|
-
);
|
|
770
|
-
|
|
771
|
-
expect( insertBlocksGenerator.next( true ) ).toEqual( {
|
|
772
|
-
done: true,
|
|
773
|
-
value: {
|
|
774
|
-
type: 'INSERT_BLOCKS',
|
|
775
|
-
blocks: [ ribsBlock, chickenRibsBlock ],
|
|
776
|
-
index: 5,
|
|
777
|
-
rootClientId: 'testrootid',
|
|
778
|
-
time: expect.any( Number ),
|
|
779
|
-
updateSelection: false,
|
|
780
|
-
initialPosition: null,
|
|
781
|
-
meta: { patternName: 'core/chicken-ribs-pattern' },
|
|
782
|
-
},
|
|
592
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
593
|
+
type: 'INSERT_BLOCKS',
|
|
594
|
+
blocks: [ ribsBlock, chickenRibsBlock ],
|
|
595
|
+
index: 5,
|
|
596
|
+
rootClientId: 'testrootid',
|
|
597
|
+
time: expect.any( Number ),
|
|
598
|
+
updateSelection: false,
|
|
599
|
+
initialPosition: null,
|
|
600
|
+
meta: { patternName: 'core/chicken-ribs-pattern' },
|
|
783
601
|
} );
|
|
784
602
|
} );
|
|
785
603
|
} );
|
|
@@ -801,260 +619,158 @@ describe( 'actions', () => {
|
|
|
801
619
|
} );
|
|
802
620
|
|
|
803
621
|
describe( 'removeBlocks', () => {
|
|
804
|
-
it( 'should
|
|
622
|
+
it( 'should dispatch REMOVE_BLOCKS action', () => {
|
|
805
623
|
const clientId = 'clientId';
|
|
806
624
|
const clientIds = [ clientId ];
|
|
807
625
|
|
|
808
|
-
const
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
),
|
|
816
|
-
controls.select(
|
|
817
|
-
blockEditorStoreName,
|
|
818
|
-
'getTemplateLock',
|
|
819
|
-
undefined
|
|
820
|
-
),
|
|
821
|
-
selectPreviousBlock( clientId ),
|
|
822
|
-
{
|
|
823
|
-
type: 'REMOVE_BLOCKS',
|
|
824
|
-
clientIds,
|
|
825
|
-
},
|
|
826
|
-
controls.select( blockEditorStoreName, 'getBlockCount' ),
|
|
827
|
-
] );
|
|
828
|
-
} );
|
|
829
|
-
} );
|
|
626
|
+
const select = {
|
|
627
|
+
getBlockRootClientId: () => undefined,
|
|
628
|
+
canRemoveBlocks: () => true,
|
|
629
|
+
};
|
|
630
|
+
const dispatch = Object.assign( jest.fn(), {
|
|
631
|
+
selectPreviousBlock: jest.fn(),
|
|
632
|
+
} );
|
|
830
633
|
|
|
831
|
-
|
|
832
|
-
it( 'should yield MOVE_BLOCKS_TO_POSITION action if locking is insert and move is not changing the root block', () => {
|
|
833
|
-
const moveBlockToPositionGenerator = moveBlocksToPosition(
|
|
834
|
-
[ 'chicken' ],
|
|
835
|
-
'ribs',
|
|
836
|
-
'ribs',
|
|
837
|
-
5
|
|
838
|
-
);
|
|
634
|
+
removeBlocks( clientIds )( { select, dispatch } );
|
|
839
635
|
|
|
840
|
-
expect(
|
|
841
|
-
|
|
842
|
-
blockEditorStoreName,
|
|
843
|
-
'getTemplateLock',
|
|
844
|
-
'ribs'
|
|
845
|
-
)
|
|
636
|
+
expect( dispatch.selectPreviousBlock ).toHaveBeenCalledWith(
|
|
637
|
+
clientId
|
|
846
638
|
);
|
|
847
639
|
|
|
848
|
-
expect(
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
type: 'MOVE_BLOCKS_TO_POSITION',
|
|
852
|
-
fromRootClientId: 'ribs',
|
|
853
|
-
toRootClientId: 'ribs',
|
|
854
|
-
clientIds: [ 'chicken' ],
|
|
855
|
-
index: 5,
|
|
640
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
641
|
+
type: 'REMOVE_BLOCKS',
|
|
642
|
+
clientIds,
|
|
856
643
|
} );
|
|
857
|
-
|
|
858
|
-
expect( moveBlockToPositionGenerator.next().done ).toBe( true );
|
|
859
644
|
} );
|
|
645
|
+
} );
|
|
646
|
+
|
|
647
|
+
describe( 'moveBlocksToPosition', () => {
|
|
648
|
+
it( 'should not dispatch MOVE_BLOCKS_TO_POSITION action if locking is all', () => {
|
|
649
|
+
const select = {
|
|
650
|
+
canMoveBlocks: () => false,
|
|
651
|
+
};
|
|
652
|
+
const dispatch = jest.fn();
|
|
860
653
|
|
|
861
|
-
|
|
862
|
-
const moveBlockToPositionGenerator = moveBlocksToPosition(
|
|
654
|
+
moveBlocksToPosition(
|
|
863
655
|
[ 'chicken' ],
|
|
864
656
|
'ribs',
|
|
865
657
|
'ribs',
|
|
866
658
|
5
|
|
867
|
-
);
|
|
868
|
-
|
|
869
|
-
expect( moveBlockToPositionGenerator.next().value ).toEqual(
|
|
870
|
-
controls.select(
|
|
871
|
-
blockEditorStoreName,
|
|
872
|
-
'getTemplateLock',
|
|
873
|
-
'ribs'
|
|
874
|
-
)
|
|
875
|
-
);
|
|
659
|
+
)( { select, dispatch } );
|
|
876
660
|
|
|
877
|
-
expect(
|
|
878
|
-
done: true,
|
|
879
|
-
value: undefined,
|
|
880
|
-
} );
|
|
661
|
+
expect( dispatch ).not.toHaveBeenCalled();
|
|
881
662
|
} );
|
|
882
663
|
|
|
883
|
-
it( 'should
|
|
884
|
-
const
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
);
|
|
890
|
-
|
|
891
|
-
expect( moveBlockToPositionGenerator.next().value ).toEqual(
|
|
892
|
-
controls.select(
|
|
893
|
-
blockEditorStoreName,
|
|
894
|
-
'getTemplateLock',
|
|
895
|
-
'ribs'
|
|
896
|
-
)
|
|
897
|
-
);
|
|
898
|
-
|
|
899
|
-
expect( moveBlockToPositionGenerator.next( 'insert' ) ).toEqual( {
|
|
900
|
-
done: true,
|
|
901
|
-
value: undefined,
|
|
902
|
-
} );
|
|
903
|
-
} );
|
|
664
|
+
it( 'should dispatch MOVE_BLOCKS_TO_POSITION action if there is not locking in the original root block and block can be inserted in the destination', () => {
|
|
665
|
+
const select = {
|
|
666
|
+
canMoveBlocks: () => true,
|
|
667
|
+
canRemoveBlocks: () => true,
|
|
668
|
+
canInsertBlocks: () => true,
|
|
669
|
+
};
|
|
670
|
+
const dispatch = jest.fn();
|
|
904
671
|
|
|
905
|
-
|
|
906
|
-
const moveBlockToPositionGenerator = moveBlocksToPosition(
|
|
672
|
+
moveBlocksToPosition(
|
|
907
673
|
[ 'chicken' ],
|
|
908
674
|
'ribs',
|
|
909
675
|
'chicken-ribs',
|
|
910
676
|
5
|
|
911
|
-
);
|
|
912
|
-
|
|
913
|
-
expect( moveBlockToPositionGenerator.next().value ).toEqual(
|
|
914
|
-
controls.select(
|
|
915
|
-
blockEditorStoreName,
|
|
916
|
-
'getTemplateLock',
|
|
917
|
-
'ribs'
|
|
918
|
-
)
|
|
919
|
-
);
|
|
920
|
-
|
|
921
|
-
expect( moveBlockToPositionGenerator.next().value ).toEqual(
|
|
922
|
-
controls.select(
|
|
923
|
-
blockEditorStoreName,
|
|
924
|
-
'canInsertBlocks',
|
|
925
|
-
[ 'chicken' ],
|
|
926
|
-
'chicken-ribs'
|
|
927
|
-
)
|
|
928
|
-
);
|
|
677
|
+
)( { select, dispatch } );
|
|
929
678
|
|
|
930
|
-
expect(
|
|
679
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
931
680
|
type: 'MOVE_BLOCKS_TO_POSITION',
|
|
932
681
|
fromRootClientId: 'ribs',
|
|
933
682
|
toRootClientId: 'chicken-ribs',
|
|
934
683
|
clientIds: [ 'chicken' ],
|
|
935
684
|
index: 5,
|
|
936
685
|
} );
|
|
937
|
-
|
|
938
|
-
expect( moveBlockToPositionGenerator.next() ).toEqual( {
|
|
939
|
-
done: true,
|
|
940
|
-
value: undefined,
|
|
941
|
-
} );
|
|
942
686
|
} );
|
|
943
687
|
|
|
944
|
-
it( 'should not
|
|
945
|
-
const
|
|
688
|
+
it( 'should not dispatch MOVE_BLOCKS_TO_POSITION action if there is not locking in the original root block and block can be inserted in the destination', () => {
|
|
689
|
+
const select = {
|
|
690
|
+
canMoveBlocks: () => true,
|
|
691
|
+
canRemoveBlocks: () => true,
|
|
692
|
+
canInsertBlocks: () => false,
|
|
693
|
+
};
|
|
694
|
+
const dispatch = jest.fn();
|
|
695
|
+
|
|
696
|
+
moveBlocksToPosition(
|
|
946
697
|
[ 'chicken' ],
|
|
947
698
|
'ribs',
|
|
948
699
|
'chicken-ribs',
|
|
949
700
|
5
|
|
950
|
-
);
|
|
951
|
-
|
|
952
|
-
expect( moveBlockToPositionGenerator.next().value ).toEqual(
|
|
953
|
-
controls.select(
|
|
954
|
-
blockEditorStoreName,
|
|
955
|
-
'getTemplateLock',
|
|
956
|
-
'ribs'
|
|
957
|
-
)
|
|
958
|
-
);
|
|
959
|
-
|
|
960
|
-
expect( moveBlockToPositionGenerator.next().value ).toEqual(
|
|
961
|
-
controls.select(
|
|
962
|
-
blockEditorStoreName,
|
|
963
|
-
'canInsertBlocks',
|
|
964
|
-
[ 'chicken' ],
|
|
965
|
-
'chicken-ribs'
|
|
966
|
-
)
|
|
967
|
-
);
|
|
701
|
+
)( { select, dispatch } );
|
|
968
702
|
|
|
969
|
-
expect(
|
|
970
|
-
done: true,
|
|
971
|
-
value: undefined,
|
|
972
|
-
} );
|
|
703
|
+
expect( dispatch ).not.toHaveBeenCalled();
|
|
973
704
|
} );
|
|
974
705
|
} );
|
|
975
706
|
|
|
976
707
|
describe( 'moveBlockToPosition', () => {
|
|
977
|
-
it( 'should
|
|
978
|
-
const
|
|
708
|
+
it( 'should dispatch MOVE_BLOCKS_TO_POSITION action with a single block', () => {
|
|
709
|
+
const select = {
|
|
710
|
+
canMoveBlocks: () => true,
|
|
711
|
+
};
|
|
712
|
+
const dispatch = jest.fn();
|
|
713
|
+
|
|
714
|
+
moveBlocksToPosition(
|
|
979
715
|
'chicken',
|
|
980
716
|
'ribs',
|
|
981
717
|
'ribs',
|
|
982
718
|
5
|
|
983
|
-
);
|
|
719
|
+
)( { select, dispatch } );
|
|
984
720
|
|
|
985
|
-
expect(
|
|
986
|
-
controls.select(
|
|
987
|
-
blockEditorStoreName,
|
|
988
|
-
'getTemplateLock',
|
|
989
|
-
'ribs'
|
|
990
|
-
)
|
|
991
|
-
);
|
|
992
|
-
|
|
993
|
-
expect( moveBlockToPositionGenerator.next().value ).toEqual( {
|
|
721
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
994
722
|
type: 'MOVE_BLOCKS_TO_POSITION',
|
|
995
723
|
fromRootClientId: 'ribs',
|
|
996
724
|
toRootClientId: 'ribs',
|
|
997
725
|
clientIds: 'chicken',
|
|
998
726
|
index: 5,
|
|
999
727
|
} );
|
|
1000
|
-
|
|
1001
|
-
expect( moveBlockToPositionGenerator.next().done ).toBe( true );
|
|
1002
728
|
} );
|
|
1003
729
|
} );
|
|
1004
730
|
|
|
1005
731
|
describe( 'removeBlock', () => {
|
|
1006
|
-
it( 'should
|
|
732
|
+
it( 'should dispatch REMOVE_BLOCKS action', () => {
|
|
1007
733
|
const clientId = 'myclientid';
|
|
1008
734
|
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
controls.select( blockEditorStoreName, 'getBlockCount' ),
|
|
1028
|
-
] );
|
|
735
|
+
const select = {
|
|
736
|
+
getBlockRootClientId: () => null,
|
|
737
|
+
canRemoveBlocks: () => true,
|
|
738
|
+
};
|
|
739
|
+
const dispatch = Object.assign( jest.fn(), {
|
|
740
|
+
selectPreviousBlock: jest.fn(),
|
|
741
|
+
} );
|
|
742
|
+
|
|
743
|
+
removeBlock( clientId )( { select, dispatch } );
|
|
744
|
+
|
|
745
|
+
expect( dispatch.selectPreviousBlock ).toHaveBeenCalledWith(
|
|
746
|
+
clientId
|
|
747
|
+
);
|
|
748
|
+
|
|
749
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
750
|
+
type: 'REMOVE_BLOCKS',
|
|
751
|
+
clientIds: [ clientId ],
|
|
752
|
+
} );
|
|
1029
753
|
} );
|
|
1030
754
|
|
|
1031
|
-
it( 'should
|
|
755
|
+
it( 'should dispatch REMOVE_BLOCKS action, opting out of select previous', () => {
|
|
1032
756
|
const clientId = 'myclientid';
|
|
1033
757
|
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
'myclientid'
|
|
1051
|
-
),
|
|
1052
|
-
{
|
|
1053
|
-
type: 'REMOVE_BLOCKS',
|
|
1054
|
-
clientIds: [ clientId ],
|
|
1055
|
-
},
|
|
1056
|
-
controls.select( blockEditorStoreName, 'getBlockCount' ),
|
|
1057
|
-
] );
|
|
758
|
+
const select = {
|
|
759
|
+
getBlockRootClientId: () => null,
|
|
760
|
+
canRemoveBlocks: () => true,
|
|
761
|
+
};
|
|
762
|
+
const dispatch = Object.assign( jest.fn(), {
|
|
763
|
+
selectPreviousBlock: jest.fn(),
|
|
764
|
+
} );
|
|
765
|
+
|
|
766
|
+
removeBlocks( [ clientId ], false )( { select, dispatch } );
|
|
767
|
+
|
|
768
|
+
expect( dispatch.selectPreviousBlock ).not.toHaveBeenCalled();
|
|
769
|
+
|
|
770
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
771
|
+
type: 'REMOVE_BLOCKS',
|
|
772
|
+
clientIds: [ clientId ],
|
|
773
|
+
} );
|
|
1058
774
|
} );
|
|
1059
775
|
} );
|
|
1060
776
|
|
|
@@ -1196,19 +912,6 @@ describe( 'actions', () => {
|
|
|
1196
912
|
} );
|
|
1197
913
|
} );
|
|
1198
914
|
|
|
1199
|
-
it( 'should return MERGE_BLOCKS action', () => {
|
|
1200
|
-
const firstBlockClientId = 'blockA';
|
|
1201
|
-
const secondBlockClientId = 'blockB';
|
|
1202
|
-
const fulfillment = mergeBlocks(
|
|
1203
|
-
firstBlockClientId,
|
|
1204
|
-
secondBlockClientId
|
|
1205
|
-
);
|
|
1206
|
-
expect( fulfillment.next().value ).toEqual( {
|
|
1207
|
-
type: 'MERGE_BLOCKS',
|
|
1208
|
-
blocks: [ firstBlockClientId, secondBlockClientId ],
|
|
1209
|
-
} );
|
|
1210
|
-
} );
|
|
1211
|
-
|
|
1212
915
|
it( 'should only focus the blockA if the blockA has no merge function', () => {
|
|
1213
916
|
registerBlockType( 'core/test-block', defaultBlockSettings );
|
|
1214
917
|
const blockA = deepFreeze( {
|
|
@@ -1220,20 +923,24 @@ describe( 'actions', () => {
|
|
|
1220
923
|
name: 'core/test-block',
|
|
1221
924
|
} );
|
|
1222
925
|
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
},
|
|
926
|
+
const select = {
|
|
927
|
+
getBlock: ( clientId ) =>
|
|
928
|
+
[ blockA, blockB ].find( ( b ) => b.clientId === clientId ),
|
|
929
|
+
};
|
|
930
|
+
const dispatch = Object.assign( jest.fn(), {
|
|
931
|
+
selectBlock: jest.fn(),
|
|
1230
932
|
} );
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
933
|
+
|
|
934
|
+
mergeBlocks(
|
|
935
|
+
blockA.clientId,
|
|
936
|
+
blockB.clientId
|
|
937
|
+
)( { select, dispatch } );
|
|
938
|
+
|
|
939
|
+
expect( dispatch ).toHaveBeenCalledWith( {
|
|
940
|
+
type: 'MERGE_BLOCKS',
|
|
941
|
+
blocks: [ blockA.clientId, blockB.clientId ],
|
|
1235
942
|
} );
|
|
1236
|
-
expect(
|
|
943
|
+
expect( dispatch.selectBlock ).toHaveBeenCalledWith( 'chicken' );
|
|
1237
944
|
} );
|
|
1238
945
|
|
|
1239
946
|
it( 'should merge the blocks if blocks of the same type', () => {
|
|
@@ -1266,42 +973,43 @@ describe( 'actions', () => {
|
|
|
1266
973
|
innerBlocks: [],
|
|
1267
974
|
} );
|
|
1268
975
|
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
offset: 0,
|
|
976
|
+
const select = {
|
|
977
|
+
getBlock: ( clientId ) =>
|
|
978
|
+
[ blockA, blockB ].find( ( b ) => b.clientId === clientId ),
|
|
979
|
+
getSelectionStart: () => ( {
|
|
980
|
+
clientId: blockB.clientId,
|
|
981
|
+
attributeKey: 'content',
|
|
982
|
+
offset: 0,
|
|
983
|
+
} ),
|
|
984
|
+
};
|
|
985
|
+
const dispatch = Object.assign( jest.fn(), {
|
|
986
|
+
replaceBlocks: jest.fn(),
|
|
987
|
+
selectionChange: jest.fn(),
|
|
1282
988
|
} );
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
989
|
+
|
|
990
|
+
mergeBlocks(
|
|
991
|
+
blockA.clientId,
|
|
992
|
+
blockB.clientId
|
|
993
|
+
)( { select, dispatch } );
|
|
994
|
+
|
|
995
|
+
expect( dispatch.selectionChange ).toHaveBeenCalledWith(
|
|
996
|
+
blockA.clientId,
|
|
997
|
+
'content',
|
|
998
|
+
'chicken'.length + 1,
|
|
999
|
+
'chicken'.length + 1
|
|
1291
1000
|
);
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
blocks: [
|
|
1298
|
-
{
|
|
1001
|
+
|
|
1002
|
+
expect( dispatch.replaceBlocks ).toHaveBeenCalledWith(
|
|
1003
|
+
[ 'chicken', 'ribs' ],
|
|
1004
|
+
[
|
|
1005
|
+
expect.objectContaining( {
|
|
1299
1006
|
clientId: 'chicken',
|
|
1300
1007
|
name: 'core/test-block',
|
|
1301
1008
|
attributes: { content: 'chicken ribs' },
|
|
1302
|
-
},
|
|
1009
|
+
} ),
|
|
1303
1010
|
],
|
|
1304
|
-
|
|
1011
|
+
0
|
|
1012
|
+
);
|
|
1305
1013
|
} );
|
|
1306
1014
|
|
|
1307
1015
|
it( 'should not merge the blocks have different types without transformation', () => {
|
|
@@ -1335,27 +1043,25 @@ describe( 'actions', () => {
|
|
|
1335
1043
|
innerBlocks: [],
|
|
1336
1044
|
} );
|
|
1337
1045
|
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
type: '@@data/SELECT',
|
|
1350
|
-
} );
|
|
1351
|
-
// getSelectionStart
|
|
1352
|
-
const next = fulfillment.next( {
|
|
1353
|
-
clientId: blockB.clientId,
|
|
1354
|
-
attributeKey: 'content',
|
|
1355
|
-
offset: 0,
|
|
1046
|
+
const select = {
|
|
1047
|
+
getBlock: ( clientId ) =>
|
|
1048
|
+
[ blockA, blockB ].find( ( b ) => b.clientId === clientId ),
|
|
1049
|
+
getSelectionStart: () => ( {
|
|
1050
|
+
clientId: blockB.clientId,
|
|
1051
|
+
attributeKey: 'content',
|
|
1052
|
+
offset: 0,
|
|
1053
|
+
} ),
|
|
1054
|
+
};
|
|
1055
|
+
const dispatch = Object.assign( jest.fn(), {
|
|
1056
|
+
replaceBlocks: jest.fn(),
|
|
1356
1057
|
} );
|
|
1357
|
-
|
|
1358
|
-
|
|
1058
|
+
|
|
1059
|
+
mergeBlocks(
|
|
1060
|
+
blockA.clientId,
|
|
1061
|
+
blockB.clientId
|
|
1062
|
+
)( { select, dispatch } );
|
|
1063
|
+
|
|
1064
|
+
expect( dispatch.replaceBlocks ).not.toHaveBeenCalled();
|
|
1359
1065
|
} );
|
|
1360
1066
|
|
|
1361
1067
|
it( 'should transform and merge the blocks', () => {
|
|
@@ -1413,48 +1119,43 @@ describe( 'actions', () => {
|
|
|
1413
1119
|
innerBlocks: [],
|
|
1414
1120
|
} );
|
|
1415
1121
|
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
fulfillment.next();
|
|
1421
|
-
fulfillment.next( blockA );
|
|
1422
|
-
// getBlock B
|
|
1423
|
-
expect( fulfillment.next( blockB ).value ).toEqual( {
|
|
1424
|
-
args: [],
|
|
1425
|
-
selectorName: 'getSelectionStart',
|
|
1426
|
-
storeKey: blockEditorStoreName,
|
|
1427
|
-
type: '@@data/SELECT',
|
|
1428
|
-
} );
|
|
1429
|
-
expect(
|
|
1430
|
-
fulfillment.next( {
|
|
1122
|
+
const select = {
|
|
1123
|
+
getBlock: ( clientId ) =>
|
|
1124
|
+
[ blockA, blockB ].find( ( b ) => b.clientId === clientId ),
|
|
1125
|
+
getSelectionStart: () => ( {
|
|
1431
1126
|
clientId: blockB.clientId,
|
|
1432
1127
|
attributeKey: 'content2',
|
|
1433
1128
|
offset: 0,
|
|
1434
|
-
} )
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1129
|
+
} ),
|
|
1130
|
+
};
|
|
1131
|
+
const dispatch = Object.assign( jest.fn(), {
|
|
1132
|
+
replaceBlocks: jest.fn(),
|
|
1133
|
+
selectionChange: jest.fn(),
|
|
1134
|
+
} );
|
|
1135
|
+
|
|
1136
|
+
mergeBlocks(
|
|
1137
|
+
blockA.clientId,
|
|
1138
|
+
blockB.clientId
|
|
1139
|
+
)( { select, dispatch } );
|
|
1140
|
+
|
|
1141
|
+
expect( dispatch.selectionChange ).toHaveBeenCalledWith(
|
|
1142
|
+
blockA.clientId,
|
|
1143
|
+
'content',
|
|
1144
|
+
'chicken'.length + 1,
|
|
1145
|
+
'chicken'.length + 1
|
|
1442
1146
|
);
|
|
1443
1147
|
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
type: 'REPLACE_BLOCKS',
|
|
1449
|
-
clientIds: [ 'chicken', 'ribs' ],
|
|
1450
|
-
blocks: [
|
|
1451
|
-
{
|
|
1148
|
+
expect( dispatch.replaceBlocks ).toHaveBeenCalledWith(
|
|
1149
|
+
[ 'chicken', 'ribs' ],
|
|
1150
|
+
[
|
|
1151
|
+
expect.objectContaining( {
|
|
1452
1152
|
clientId: 'chicken',
|
|
1453
1153
|
name: 'core/test-block',
|
|
1454
1154
|
attributes: { content: 'chicken ribs' },
|
|
1455
|
-
},
|
|
1155
|
+
} ),
|
|
1456
1156
|
],
|
|
1457
|
-
|
|
1157
|
+
0
|
|
1158
|
+
);
|
|
1458
1159
|
} );
|
|
1459
1160
|
} );
|
|
1460
1161
|
|
|
@@ -1465,6 +1166,7 @@ describe( 'actions', () => {
|
|
|
1465
1166
|
actions,
|
|
1466
1167
|
selectors,
|
|
1467
1168
|
reducer,
|
|
1169
|
+
__experimentalUseThunks: true,
|
|
1468
1170
|
} );
|
|
1469
1171
|
|
|
1470
1172
|
registerBlockType( 'core/test-block', defaultBlockSettings );
|