@wordpress/block-editor 17.0.2-next.v.202608281122.0 → 17.1.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 +29 -1
- package/build/components/background-image-control/index.cjs +18 -1
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-allowed-blocks/modal.cjs +2 -1
- package/build/components/block-allowed-blocks/modal.cjs.map +3 -3
- package/build/components/block-edit/edit.cjs.map +1 -1
- package/build/components/block-inspector/index.cjs +3 -12
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-is-hovered.cjs +17 -4
- package/build/components/block-list/use-block-props/use-is-hovered.cjs.map +2 -2
- package/build/components/block-preview/index.cjs +1 -2
- package/build/components/block-preview/index.cjs.map +2 -2
- package/build/components/block-switcher/index.cjs +2 -1
- package/build/components/block-switcher/index.cjs.map +3 -3
- package/build/components/block-toolbar/pattern-overrides-dropdown.cjs +2 -1
- package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +3 -3
- package/build/components/global-styles/border-panel.cjs +19 -42
- package/build/components/global-styles/border-panel.cjs.map +2 -2
- package/build/components/global-styles/image-settings-panel.cjs.map +1 -1
- package/build/components/iframe/index.cjs.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.cjs.map +1 -1
- package/build/components/inserter-draggable-blocks/index.cjs.map +1 -1
- package/build/components/inspector-controls-tabs/content-tab.cjs +2 -3
- package/build/components/inspector-controls-tabs/content-tab.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/styles-tab.cjs +1 -3
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +1 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
- package/build/components/inspector-popover-header/index.cjs +5 -4
- package/build/components/inspector-popover-header/index.cjs.map +3 -3
- package/build/components/link-control/index.cjs.map +2 -2
- package/build/components/link-control/search-input.cjs.map +1 -1
- package/build/components/list-view/block-select-button.cjs +9 -1
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +2 -1
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/list-view/use-list-view-drop-zone.cjs.map +1 -1
- package/build/components/media-replace-flow/index.cjs +4 -1
- package/build/components/media-replace-flow/index.cjs.map +2 -2
- package/build/components/navigable-toolbar/index.cjs +3 -0
- package/build/components/navigable-toolbar/index.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/enter.cjs +23 -11
- package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/index.cjs +0 -2
- package/build/components/rich-text/event-listeners/index.cjs.map +3 -3
- package/build/components/rich-text/event-listeners/input-rules.cjs +4 -2
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +2 -2
- package/build/components/use-block-drop-zone/index.cjs.map +1 -1
- package/build/components/writing-flow/index.cjs +5 -0
- package/build/components/writing-flow/index.cjs.map +3 -3
- package/build/components/writing-flow/use-arrow-nav.cjs.map +1 -1
- package/build/components/writing-flow/use-input.cjs +12 -2
- package/build/components/writing-flow/use-input.cjs.map +2 -2
- package/build/components/writing-flow/use-tab-nav.cjs +84 -41
- package/build/components/writing-flow/use-tab-nav.cjs.map +3 -3
- package/build/components/{rich-text/event-listeners/undo-automatic-change.cjs → writing-flow/use-undo-automatic-change.cjs} +18 -15
- package/build/components/writing-flow/use-undo-automatic-change.cjs.map +7 -0
- package/build/hooks/border.cjs +2 -46
- package/build/hooks/border.cjs.map +2 -2
- package/build/hooks/generate-fields-from-attributes.cjs.map +1 -1
- package/build/hooks/index.cjs +0 -2
- package/build/hooks/index.cjs.map +3 -3
- package/build/hooks/style.cjs +2 -2
- package/build/hooks/style.cjs.map +2 -2
- package/build/layouts/flex.cjs +3 -0
- package/build/layouts/flex.cjs.map +2 -2
- package/build/store/actions.cjs +12 -9
- package/build/store/actions.cjs.map +3 -3
- package/build-module/components/background-image-control/index.mjs +18 -1
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-allowed-blocks/modal.mjs +2 -2
- package/build-module/components/block-allowed-blocks/modal.mjs.map +2 -2
- package/build-module/components/block-edit/edit.mjs.map +1 -1
- package/build-module/components/block-inspector/index.mjs +3 -12
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-is-hovered.mjs +17 -4
- package/build-module/components/block-list/use-block-props/use-is-hovered.mjs.map +2 -2
- package/build-module/components/block-preview/index.mjs +1 -2
- package/build-module/components/block-preview/index.mjs.map +2 -2
- package/build-module/components/block-switcher/index.mjs +2 -2
- package/build-module/components/block-switcher/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs +3 -6
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +2 -2
- package/build-module/components/global-styles/border-panel.mjs +19 -42
- package/build-module/components/global-styles/border-panel.mjs.map +2 -2
- package/build-module/components/global-styles/image-settings-panel.mjs.map +1 -1
- package/build-module/components/iframe/index.mjs.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.mjs.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.mjs.map +1 -1
- package/build-module/components/inspector-controls-tabs/content-tab.mjs +3 -4
- package/build-module/components/inspector-controls-tabs/content-tab.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +1 -3
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +1 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
- package/build-module/components/inspector-popover-header/index.mjs +6 -7
- package/build-module/components/inspector-popover-header/index.mjs.map +2 -2
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/link-control/search-input.mjs.map +1 -1
- package/build-module/components/list-view/block-select-button.mjs +9 -1
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +2 -1
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/list-view/use-list-view-drop-zone.mjs.map +1 -1
- package/build-module/components/media-replace-flow/index.mjs +4 -1
- package/build-module/components/media-replace-flow/index.mjs.map +2 -2
- package/build-module/components/navigable-toolbar/index.mjs +3 -0
- package/build-module/components/navigable-toolbar/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/enter.mjs +23 -11
- package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/index.mjs +0 -2
- package/build-module/components/rich-text/event-listeners/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +4 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/use-block-drop-zone/index.mjs.map +1 -1
- package/build-module/components/writing-flow/index.mjs +5 -0
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +1 -1
- package/build-module/components/writing-flow/use-input.mjs +12 -2
- package/build-module/components/writing-flow/use-input.mjs.map +2 -2
- package/build-module/components/writing-flow/use-tab-nav.mjs +86 -43
- package/build-module/components/writing-flow/use-tab-nav.mjs.map +3 -3
- package/build-module/components/writing-flow/use-undo-automatic-change.mjs +36 -0
- package/build-module/components/writing-flow/use-undo-automatic-change.mjs.map +7 -0
- package/build-module/hooks/border.mjs +1 -45
- package/build-module/hooks/border.mjs.map +2 -2
- package/build-module/hooks/generate-fields-from-attributes.mjs.map +1 -1
- package/build-module/hooks/index.mjs +0 -2
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/hooks/style.mjs +3 -2
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +3 -0
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/store/actions.mjs +12 -9
- package/build-module/store/actions.mjs.map +2 -2
- package/build-style/content-rtl.css +9 -20
- package/build-style/content.css +9 -20
- package/build-style/style-rtl.css +100 -221
- package/build-style/style.css +100 -221
- package/package.json +42 -41
- package/src/autocompleters/test/block.js +1 -0
- package/src/components/alignment-control/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +34 -16
- package/src/components/alignment-control/test/{index.jsx → index.jsdom.test.jsx} +2 -1
- package/src/components/background-image-control/index.jsx +32 -1
- package/src/components/background-image-control/style.scss +5 -3
- package/src/components/background-image-control/test/{index.js → index.jsdom.test.js} +1 -0
- package/src/components/block-alignment-control/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +68 -13
- package/src/components/block-alignment-control/test/{index.jsx → index.jsdom.test.jsx} +2 -1
- package/src/components/block-allowed-blocks/modal.jsx +3 -3
- package/src/components/block-bindings/test/{use-block-bindings-utils.js → use-block-bindings-utils.jsdom.test.js} +2 -1
- package/src/components/block-breadcrumb/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +2 -2
- package/src/components/block-breadcrumb/test/{index.jsx → index.jsdom.test.jsx} +1 -0
- package/src/components/block-compare/test/__snapshots__/{block-view.jsx.snap → block-view.jsdom.test.jsx.snap} +2 -2
- package/src/components/block-compare/test/{block-view.jsx → block-view.jsdom.test.jsx} +1 -0
- package/src/components/block-controls/test/{index.jsx → index.jsdom.test.jsx} +1 -0
- package/src/components/block-edit/edit.jsx +1 -1
- package/src/components/block-edit/test/{edit.jsx → edit.jsdom.test.jsx} +1 -0
- package/src/components/block-icon/content.scss +0 -6
- package/src/components/block-icon/style.scss +0 -6
- package/src/components/block-icon/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +6 -2
- package/src/components/block-inspector/index.jsx +3 -11
- package/src/components/block-list/content.scss +4 -1
- package/src/components/block-list/use-block-props/use-is-hovered.js +24 -5
- package/src/components/block-manager/style.scss +2 -0
- package/src/components/block-mover/test/mover-description.js +1 -0
- package/src/components/block-preview/index.jsx +1 -2
- package/src/components/block-preview/test/{index.jsx → index.jsdom.test.jsx} +10 -6
- package/src/components/block-selection-clearer/test/{index.jsx → index.jsdom.test.jsx} +24 -19
- package/src/components/block-settings-menu/test/{block-mode-toggle.jsx → block-mode-toggle.jsdom.test.jsx} +5 -1
- package/src/components/block-styles/test/utils.js +1 -0
- package/src/components/block-switcher/index.jsx +3 -3
- package/src/components/block-switcher/test/{index.jsx → index.jsdom.test.jsx} +8 -4
- package/src/components/block-switcher/test/use-transformed.patterns.js +1 -0
- package/src/components/block-switcher/test/utils.js +1 -0
- package/src/components/block-title/test/{index.jsx → index.jsdom.test.jsx} +7 -3
- package/src/components/block-toolbar/pattern-overrides-dropdown.jsx +3 -6
- package/src/components/block-toolbar/style.scss +1 -1
- package/src/components/block-toolbar/test/{block-toolbar-icon.jsx → block-toolbar-icon.jsdom.test.jsx} +25 -21
- package/src/components/block-variation-picker/content.scss +5 -3
- package/src/components/block-vertical-alignment-control/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +55 -11
- package/src/components/block-vertical-alignment-control/test/{index.jsx → index.jsdom.test.jsx} +2 -1
- package/src/components/block-visibility/test/{use-block-visibility.js → use-block-visibility.jsdom.test.js} +6 -5
- package/src/components/block-visibility/test/utils.js +2 -1
- package/src/components/border-radius-control/test/{index.jsx → index.jsdom.test.jsx} +8 -1
- package/src/components/border-radius-control/test/utils.js +1 -0
- package/src/components/button-block-appender/content.scss +1 -1
- package/src/components/child-layout-control/test/{index.jsx → index.jsdom.test.jsx} +18 -15
- package/src/components/color-palette/test/{control.jsx → control.jsdom.test.jsx} +15 -4
- package/src/components/colors/test/utils.js +1 -0
- package/src/components/colors/test/{with-colors.jsx → with-colors.jsdom.test.jsx} +4 -3
- package/src/components/colors-gradients/test/{control.jsx → control.jsdom.test.jsx} +8 -3
- package/src/components/contrast-checker/test/{index.jsx → index.jsdom.test.jsx} +2 -1
- package/src/components/default-block-appender/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +4 -4
- package/src/components/default-block-appender/test/{index.jsx → index.jsdom.test.jsx} +8 -7
- package/src/components/dimensions-tool/test/{index.jsx → index.jsdom.test.jsx} +27 -22
- package/src/components/dimensions-tool/test/utils.js +1 -0
- package/src/components/duotone-control/test/{index.jsx → index.jsdom.test.jsx} +6 -3
- package/src/components/font-sizes/test/fluid-utils.js +1 -0
- package/src/components/font-sizes/test/utils.js +1 -0
- package/src/components/global-styles/border-panel.jsx +17 -40
- package/src/components/global-styles/image-settings-panel.jsx +1 -1
- package/src/components/global-styles/inheritance/test/{index.jsx → index.jsdom.test.jsx} +5 -2
- package/src/components/global-styles/test/{background-panel.jsx → background-panel.jsdom.test.jsx} +10 -5
- package/src/components/global-styles/test/{border-panel.jsx → border-panel.jsdom.test.jsx} +113 -13
- package/src/components/global-styles/test/{color-panel.jsx → color-panel.jsdom.test.jsx} +5 -0
- package/src/components/global-styles/test/{dimensions-panel.jsx → dimensions-panel.jsdom.test.jsx} +14 -14
- package/src/components/global-styles/test/{filters-panel.jsx → filters-panel.jsdom.test.jsx} +7 -4
- package/src/components/global-styles/test/{inherited-value-context-core.js → inherited-value-context-core.jsdom.test.js} +10 -9
- package/src/components/global-styles/test/{inherited-value-context.jsx → inherited-value-context.jsdom.test.jsx} +18 -17
- package/src/components/global-styles/test/{state-control-badges.jsx → state-control-badges.jsdom.test.jsx} +3 -2
- package/src/components/global-styles/test/{typography-panel-core.jsx → typography-panel-core.jsdom.test.jsx} +5 -2
- package/src/components/global-styles/test/{typography-panel.jsx → typography-panel.jsdom.test.jsx} +17 -12
- package/src/components/global-styles/test/typography-utils.js +1 -0
- package/src/components/global-styles/test/utils.js +1 -0
- package/src/components/grid/style.scss +0 -10
- package/src/components/iframe/index.jsx +3 -3
- package/src/components/image-editor/test/index.js +1 -0
- package/src/components/image-size-control/test/{index.jsx → index.jsdom.test.jsx} +8 -3
- package/src/components/inner-blocks/test/__snapshots__/index.jsdom.test.jsx.snap +15 -0
- package/src/components/inner-blocks/test/{index.jsx → index.jsdom.test.jsx} +2 -0
- package/src/components/inner-content/test/{index.jsx → index.jsdom.test.jsx} +1 -0
- package/src/components/inserter/hooks/use-patterns-paging.js +1 -1
- package/src/components/inserter/media-tab/test/{hooks.js → hooks.jsdom.test.js} +12 -11
- package/src/components/inserter/media-tab/test/{media-panel.jsx → media-panel.jsdom.test.jsx} +15 -12
- package/src/components/inserter/style.scss +2 -2
- package/src/components/inserter/test/get-appender-label.js +12 -11
- package/src/components/inserter/test/search-items.js +1 -0
- package/src/components/inserter-draggable-blocks/index.jsx +1 -1
- package/src/components/inserter-list-item/style.scss +1 -0
- package/src/components/inspector-controls-tabs/content-tab.jsx +7 -14
- package/src/components/inspector-controls-tabs/styles-tab.jsx +1 -4
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -8
- package/src/components/inspector-popover-header/index.jsx +6 -7
- package/src/components/line-height-control/test/{index.jsx → index.jsdom.test.jsx} +3 -0
- package/src/components/link-control/index.jsx +3 -0
- package/src/components/link-control/search-input.jsx +1 -1
- package/src/components/link-control/style.scss +1 -1
- package/src/components/link-control/test/{index.jsx → index.jsdom.test.jsx} +52 -42
- package/src/components/link-control/test/is-url-like.js +1 -0
- package/src/components/link-control/test/{url-normalization.test.jsx → url-normalization.jsdom.test.jsx} +21 -20
- package/src/components/link-picker/test/{index.jsx → index.jsdom.test.jsx} +31 -30
- package/src/components/list-view/block-select-button.jsx +6 -1
- package/src/components/list-view/block.jsx +6 -4
- package/src/components/list-view/style.scss +55 -35
- package/src/components/list-view/test/use-list-view-drop-zone.js +1 -0
- package/src/components/list-view/test/utils.js +1 -0
- package/src/components/list-view/use-list-view-drop-zone.js +1 -1
- package/src/components/media-placeholder/test/get-computed-accept-attribute.js +1 -0
- package/src/components/media-placeholder/test/{index.jsx → index.jsdom.test.jsx} +8 -2
- package/src/components/media-replace-flow/index.jsx +6 -1
- package/src/components/media-replace-flow/test/{index.jsx → index.jsdom.test.jsx} +3 -0
- package/src/components/navigable-toolbar/index.jsx +4 -0
- package/src/components/navigable-toolbar/test/index.browser.test.js +50 -0
- package/src/components/panel-color-settings/test/{index.jsx → index.jsdom.test.jsx} +3 -0
- package/src/components/preset-input-control/test/{index.jsx → index.jsdom.test.jsx} +8 -2
- package/src/components/preset-input-control/test/utils.js +1 -0
- package/src/components/provider/test/{experimental-provider.jsx → experimental-provider.jsdom.test.jsx} +3 -2
- package/src/components/provider/test/{use-block-sync.jsx → use-block-sync.jsdom.test.jsx} +45 -44
- package/src/components/recursion-provider/test/{index.jsx → index.jsdom.test.jsx} +1 -0
- package/src/components/responsive-block-control/style.scss +1 -0
- package/src/components/responsive-block-control/test/{index.jsx → index.jsdom.test.jsx} +6 -3
- package/src/components/rich-text/event-listeners/enter.js +29 -14
- package/src/components/rich-text/event-listeners/index.js +0 -2
- package/src/components/rich-text/event-listeners/input-rules.js +7 -2
- package/src/components/spacing-sizes-control/test/{index.jsx → index.jsdom.test.jsx} +23 -20
- package/src/components/spacing-sizes-control/test/utils.js +1 -0
- package/src/components/url-input/test/{button.jsx → button.jsdom.test.jsx} +4 -1
- package/src/components/url-input/test/fixtures/validated-input-control-deprecation.js +2 -0
- package/src/components/url-input/test/{index.jsx → index.jsdom.test.jsx} +23 -13
- package/src/components/use-block-display-information/test/{index.jsx → index.jsdom.test.jsx} +14 -10
- package/src/components/use-block-drop-zone/index.js +2 -2
- package/src/components/use-block-drop-zone/test/index.js +1 -0
- package/src/components/use-on-block-drop/test/index.js +28 -31
- package/src/components/warning/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +2 -2
- package/src/components/warning/test/{index.jsx → index.jsdom.test.jsx} +1 -0
- package/src/components/writing-flow/index.jsx +5 -0
- package/src/components/writing-flow/style.scss +48 -0
- package/src/components/writing-flow/test/{index.js → index.jsdom.test.js} +1 -0
- package/src/components/writing-flow/use-arrow-nav.js +2 -2
- package/src/components/writing-flow/use-input.js +29 -2
- package/src/components/writing-flow/use-tab-nav.jsx +155 -70
- package/src/components/writing-flow/use-undo-automatic-change.js +40 -0
- package/src/elements/test/{index.js → index.jsdom.test.js} +1 -0
- package/src/hooks/border.jsx +0 -53
- package/src/hooks/generate-fields-from-attributes.js +1 -1
- package/src/hooks/index.js +0 -2
- package/src/hooks/style.jsx +3 -2
- package/src/hooks/test/{align.jsx → align.jsdom.test.jsx} +1 -0
- package/src/hooks/test/allowed-blocks.js +1 -0
- package/src/hooks/test/{anchor.js → anchor.jsdom.test.js} +1 -0
- package/src/hooks/test/{auto-inspector-controls.js → auto-inspector-controls.jsdom.test.js} +1 -0
- package/src/hooks/test/{background.jsx → background.jsdom.test.jsx} +5 -2
- package/src/hooks/test/{block-style-state.js → block-style-state.jsdom.test.js} +4 -3
- package/src/hooks/test/{cross-origin-isolation.js → cross-origin-isolation.jsdom.test.js} +18 -25
- package/src/hooks/test/{custom-class-name.jsx → custom-class-name.jsdom.test.jsx} +1 -0
- package/src/hooks/test/{dimensions.js → dimensions.jsdom.test.js} +1 -0
- package/src/hooks/test/{duotone.js → duotone.jsdom.test.js} +1 -0
- package/src/hooks/test/{font-size.js → font-size.jsdom.test.js} +1 -0
- package/src/hooks/test/gap.js +1 -0
- package/src/hooks/test/generate-fields-from-attributes.js +1 -0
- package/src/hooks/test/generated-class-name.js +1 -0
- package/src/hooks/test/{inherited-value-wiring.jsx → inherited-value-wiring.jsdom.test.jsx} +49 -51
- package/src/hooks/test/{layout-child.js → layout-child.jsdom.test.js} +1 -0
- package/src/hooks/test/{layout.js → layout.jsdom.test.js} +1 -0
- package/src/hooks/test/metadata.js +1 -0
- package/src/hooks/test/preset-round-trip.js +2 -0
- package/src/hooks/test/settings.jsx +1 -0
- package/src/hooks/test/state-utils.js +1 -0
- package/src/hooks/test/{style.jsx → style.jsdom.test.jsx} +1 -0
- package/src/hooks/test/{text-align.jsx → text-align.jsdom.test.jsx} +1 -0
- package/src/hooks/test/{use-typography-props.js → use-typography-props.jsdom.test.js} +1 -0
- package/src/hooks/test/{utils.js → utils.jsdom.test.js} +1 -0
- package/src/layouts/flex.jsx +7 -0
- package/src/layouts/test/{constrained.jsx → constrained.jsdom.test.jsx} +6 -3
- package/src/layouts/test/{flex.jsx → flex.jsdom.test.jsx} +52 -2
- package/src/layouts/test/{flow.js → flow.jsdom.test.js} +1 -0
- package/src/layouts/test/{grid.jsx → grid.jsdom.test.jsx} +5 -2
- package/src/layouts/test/utils.js +1 -0
- package/src/store/actions.js +14 -12
- package/src/store/test/{actions.js → actions.jsdom.test.js} +50 -49
- package/src/store/test/array.js +1 -0
- package/src/store/test/get-block-settings.js +1 -0
- package/src/store/test/performance.js +2 -1
- package/src/store/test/private-actions.js +1 -0
- package/src/store/test/private-selectors.js +13 -3
- package/src/store/test/reducer.js +37 -8
- package/src/store/test/{registry-selectors.js → registry-selectors.jsdom.test.js} +9 -0
- package/src/store/test/{selectors.jsx → selectors.jsdom.test.jsx} +13 -3
- package/src/style.scss +1 -1
- package/src/utils/test/block-bindings.js +1 -0
- package/src/utils/test/color-values.js +1 -0
- package/src/utils/test/{dom.jsx → dom.jsdom.test.jsx} +38 -43
- package/src/utils/test/format-font-style.js +1 -0
- package/src/utils/test/format-font-weight.js +1 -0
- package/src/utils/test/get-font-styles-and-weights.js +1 -0
- package/src/utils/test/math.js +1 -0
- package/src/utils/test/object.js +1 -0
- package/src/utils/test/pasting.js +1 -0
- package/src/utils/test/selection.js +1 -0
- package/src/utils/test/sorting.js +1 -0
- package/src/utils/test/transform-styles.js +2 -1
- package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +0 -7
- package/build/hooks/block-fields/fields-dropdown-menu.cjs +0 -67
- package/build/hooks/block-fields/fields-dropdown-menu.cjs.map +0 -7
- package/build/hooks/block-fields/index.cjs +0 -238
- package/build/hooks/block-fields/index.cjs.map +0 -7
- package/build/hooks/block-fields/link/index.cjs +0 -174
- package/build/hooks/block-fields/link/index.cjs.map +0 -7
- package/build/hooks/block-fields/media/index.cjs +0 -262
- package/build/hooks/block-fields/media/index.cjs.map +0 -7
- package/build/hooks/block-fields/rich-text/index.cjs +0 -146
- package/build/hooks/block-fields/rich-text/index.cjs.map +0 -7
- package/build/hooks/block-fields/use-inspector-popover-placement.cjs +0 -41
- package/build/hooks/block-fields/use-inspector-popover-placement.cjs.map +0 -7
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +0 -33
- package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +0 -7
- package/build-module/hooks/block-fields/fields-dropdown-menu.mjs +0 -46
- package/build-module/hooks/block-fields/fields-dropdown-menu.mjs.map +0 -7
- package/build-module/hooks/block-fields/index.mjs +0 -210
- package/build-module/hooks/block-fields/index.mjs.map +0 -7
- package/build-module/hooks/block-fields/link/index.mjs +0 -141
- package/build-module/hooks/block-fields/link/index.mjs.map +0 -7
- package/build-module/hooks/block-fields/media/index.mjs +0 -241
- package/build-module/hooks/block-fields/media/index.mjs.map +0 -7
- package/build-module/hooks/block-fields/rich-text/index.mjs +0 -115
- package/build-module/hooks/block-fields/rich-text/index.mjs.map +0 -7
- package/build-module/hooks/block-fields/use-inspector-popover-placement.mjs +0 -16
- package/build-module/hooks/block-fields/use-inspector-popover-placement.mjs.map +0 -7
- package/src/components/color-palette/test/__snapshots__/control.jsx.snap +0 -143
- package/src/components/inner-blocks/test/__snapshots__/index.jsx.snap +0 -15
- package/src/components/rich-text/event-listeners/undo-automatic-change.js +0 -39
- package/src/hooks/block-fields/fields-dropdown-menu.jsx +0 -47
- package/src/hooks/block-fields/index.jsx +0 -302
- package/src/hooks/block-fields/link/index.jsx +0 -155
- package/src/hooks/block-fields/link/styles.scss +0 -18
- package/src/hooks/block-fields/media/index.jsx +0 -269
- package/src/hooks/block-fields/media/styles.scss +0 -77
- package/src/hooks/block-fields/rich-text/index.jsx +0 -123
- package/src/hooks/block-fields/rich-text/styles.scss +0 -24
- package/src/hooks/block-fields/styles.scss +0 -33
- package/src/hooks/block-fields/use-inspector-popover-placement.js +0 -16
- /package/src/components/block-icon/test/{index.jsx → index.jsdom.test.jsx} +0 -0
|
@@ -1,17 +1,20 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
1
2
|
import { render, screen } from '@testing-library/react';
|
|
2
3
|
import { __experimentalToolsPanel as ToolsPanel } from '@wordpress/components';
|
|
3
4
|
import grid from '../grid';
|
|
4
5
|
|
|
6
|
+
globalThis.wpVitest.mockMatchMedia();
|
|
7
|
+
|
|
5
8
|
const GridLayoutInspectorControls = grid.inspectorControls;
|
|
6
9
|
const PANEL_ID = 'test-panel';
|
|
7
10
|
|
|
8
11
|
function renderInspectorControls( props = {} ) {
|
|
9
12
|
return render(
|
|
10
|
-
<ToolsPanel label="Layout" resetAll={
|
|
13
|
+
<ToolsPanel label="Layout" resetAll={ vi.fn() } panelId={ PANEL_ID }>
|
|
11
14
|
<GridLayoutInspectorControls
|
|
12
15
|
clientId={ PANEL_ID }
|
|
13
16
|
layout={ {} }
|
|
14
|
-
onChange={
|
|
17
|
+
onChange={ vi.fn() }
|
|
15
18
|
{ ...props }
|
|
16
19
|
/>
|
|
17
20
|
</ToolsPanel>
|
package/src/store/actions.js
CHANGED
|
@@ -18,7 +18,6 @@ import { __, _n, sprintf } from '@wordpress/i18n';
|
|
|
18
18
|
import { store as noticesStore } from '@wordpress/notices';
|
|
19
19
|
import { create, insert, remove, toHTMLString } from '@wordpress/rich-text';
|
|
20
20
|
import deprecated from '@wordpress/deprecated';
|
|
21
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
22
21
|
import {
|
|
23
22
|
retrieveSelectedAttribute,
|
|
24
23
|
findRichTextAttributeKey,
|
|
@@ -1821,21 +1820,24 @@ export const __unstableMarkAutomaticChange =
|
|
|
1821
1820
|
};
|
|
1822
1821
|
|
|
1823
1822
|
/**
|
|
1824
|
-
* Action that
|
|
1823
|
+
* Action that used to set the editor mode (Write/Design tool).
|
|
1825
1824
|
*
|
|
1826
|
-
* @
|
|
1825
|
+
* @deprecated
|
|
1826
|
+
*
|
|
1827
|
+
* @return {Object} Action object.
|
|
1827
1828
|
*/
|
|
1828
|
-
export
|
|
1829
|
-
(
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
speak( __( 'You are currently in Write mode.' ) );
|
|
1835
|
-
} else if ( mode === 'edit' ) {
|
|
1836
|
-
speak( __( 'You are currently in Design mode.' ) );
|
|
1829
|
+
export function __unstableSetEditorMode() {
|
|
1830
|
+
deprecated(
|
|
1831
|
+
'wp.data.dispatch( "core/block-editor" ).__unstableSetEditorMode',
|
|
1832
|
+
{
|
|
1833
|
+
since: '7.2',
|
|
1834
|
+
hint: 'The Write/Design editor tool has been removed.',
|
|
1837
1835
|
}
|
|
1836
|
+
);
|
|
1837
|
+
return {
|
|
1838
|
+
type: 'DO_NOTHING',
|
|
1838
1839
|
};
|
|
1840
|
+
}
|
|
1839
1841
|
|
|
1840
1842
|
/**
|
|
1841
1843
|
* Set the block moving client ID.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
1
2
|
import deepFreeze from 'deep-freeze';
|
|
2
3
|
import { createRegistry } from '@wordpress/data';
|
|
3
4
|
import {
|
|
@@ -60,7 +61,7 @@ describe( 'actions', () => {
|
|
|
60
61
|
|
|
61
62
|
describe( 'resetBlocks', () => {
|
|
62
63
|
it( 'should dispatch the RESET_BLOCKS action', () => {
|
|
63
|
-
const dispatch =
|
|
64
|
+
const dispatch = vi.fn();
|
|
64
65
|
const blocks = [];
|
|
65
66
|
resetBlocks( blocks )( { dispatch } );
|
|
66
67
|
expect( dispatch ).toHaveBeenCalledWith( {
|
|
@@ -166,7 +167,7 @@ describe( 'actions', () => {
|
|
|
166
167
|
return [];
|
|
167
168
|
},
|
|
168
169
|
};
|
|
169
|
-
const dispatch =
|
|
170
|
+
const dispatch = vi.fn();
|
|
170
171
|
|
|
171
172
|
multiSelect( start, end )( { select, dispatch } );
|
|
172
173
|
|
|
@@ -196,7 +197,7 @@ describe( 'actions', () => {
|
|
|
196
197
|
return 0;
|
|
197
198
|
},
|
|
198
199
|
};
|
|
199
|
-
const dispatch =
|
|
200
|
+
const dispatch = vi.fn();
|
|
200
201
|
|
|
201
202
|
multiSelect( start, end )( { select, dispatch } );
|
|
202
203
|
|
|
@@ -226,8 +227,8 @@ describe( 'actions', () => {
|
|
|
226
227
|
canInsertBlockType: () => true,
|
|
227
228
|
getBlockCount: () => 1,
|
|
228
229
|
};
|
|
229
|
-
const dispatch =
|
|
230
|
-
dispatch.ensureDefaultBlock =
|
|
230
|
+
const dispatch = vi.fn();
|
|
231
|
+
dispatch.ensureDefaultBlock = vi.fn();
|
|
231
232
|
const registry = createRegistry();
|
|
232
233
|
|
|
233
234
|
replaceBlock( 'chicken', block )( { select, dispatch, registry } );
|
|
@@ -269,7 +270,7 @@ describe( 'actions', () => {
|
|
|
269
270
|
}
|
|
270
271
|
},
|
|
271
272
|
};
|
|
272
|
-
const dispatch =
|
|
273
|
+
const dispatch = vi.fn();
|
|
273
274
|
|
|
274
275
|
replaceBlocks( [ 'chicken' ], blocks )( { select, dispatch } );
|
|
275
276
|
|
|
@@ -295,8 +296,8 @@ describe( 'actions', () => {
|
|
|
295
296
|
canInsertBlockType: () => true,
|
|
296
297
|
getBlockCount: () => 1,
|
|
297
298
|
};
|
|
298
|
-
const dispatch =
|
|
299
|
-
dispatch.ensureDefaultBlock =
|
|
299
|
+
const dispatch = vi.fn();
|
|
300
|
+
dispatch.ensureDefaultBlock = vi.fn();
|
|
300
301
|
const registry = createRegistry();
|
|
301
302
|
|
|
302
303
|
replaceBlocks(
|
|
@@ -334,8 +335,8 @@ describe( 'actions', () => {
|
|
|
334
335
|
canInsertBlockType: () => true,
|
|
335
336
|
getBlockCount: () => 1,
|
|
336
337
|
};
|
|
337
|
-
const dispatch =
|
|
338
|
-
dispatch.ensureDefaultBlock =
|
|
338
|
+
const dispatch = vi.fn();
|
|
339
|
+
dispatch.ensureDefaultBlock = vi.fn();
|
|
339
340
|
const registry = createRegistry();
|
|
340
341
|
|
|
341
342
|
replaceBlocks(
|
|
@@ -371,7 +372,7 @@ describe( 'actions', () => {
|
|
|
371
372
|
getSelectedBlockClientId: () => null,
|
|
372
373
|
canInsertBlockType: () => true,
|
|
373
374
|
};
|
|
374
|
-
const dispatch =
|
|
375
|
+
const dispatch = vi.fn();
|
|
375
376
|
|
|
376
377
|
insertBlock(
|
|
377
378
|
block,
|
|
@@ -412,7 +413,7 @@ describe( 'actions', () => {
|
|
|
412
413
|
getSelectedBlockClientId: () => null,
|
|
413
414
|
canInsertBlockType: () => true,
|
|
414
415
|
};
|
|
415
|
-
const dispatch =
|
|
416
|
+
const dispatch = vi.fn();
|
|
416
417
|
|
|
417
418
|
insertBlocks(
|
|
418
419
|
[ containerBlock ],
|
|
@@ -461,8 +462,8 @@ describe( 'actions', () => {
|
|
|
461
462
|
getSelectedBlockClientId: () => containerBlock.clientId,
|
|
462
463
|
canInsertBlockType: () => true,
|
|
463
464
|
};
|
|
464
|
-
const dispatch =
|
|
465
|
-
dispatch.selectBlock =
|
|
465
|
+
const dispatch = vi.fn();
|
|
466
|
+
dispatch.selectBlock = vi.fn();
|
|
466
467
|
|
|
467
468
|
insertBlocks(
|
|
468
469
|
[ containerBlock ],
|
|
@@ -498,7 +499,7 @@ describe( 'actions', () => {
|
|
|
498
499
|
getSelectedBlockClientId: () => null,
|
|
499
500
|
canInsertBlockType: () => true,
|
|
500
501
|
};
|
|
501
|
-
const dispatch =
|
|
502
|
+
const dispatch = vi.fn();
|
|
502
503
|
|
|
503
504
|
insertBlocks(
|
|
504
505
|
[ containerBlock ],
|
|
@@ -531,7 +532,7 @@ describe( 'actions', () => {
|
|
|
531
532
|
getSelectedBlockClientId: () => null,
|
|
532
533
|
canInsertBlockType: () => true,
|
|
533
534
|
};
|
|
534
|
-
const dispatch =
|
|
535
|
+
const dispatch = vi.fn();
|
|
535
536
|
|
|
536
537
|
insertBlocks(
|
|
537
538
|
[ containerBlock ],
|
|
@@ -597,7 +598,7 @@ describe( 'actions', () => {
|
|
|
597
598
|
}
|
|
598
599
|
},
|
|
599
600
|
};
|
|
600
|
-
const dispatch =
|
|
601
|
+
const dispatch = vi.fn();
|
|
601
602
|
|
|
602
603
|
insertBlocks(
|
|
603
604
|
blocks,
|
|
@@ -633,7 +634,7 @@ describe( 'actions', () => {
|
|
|
633
634
|
getSelectedBlockClientId: () => null,
|
|
634
635
|
canInsertBlockType: () => false,
|
|
635
636
|
};
|
|
636
|
-
const dispatch =
|
|
637
|
+
const dispatch = vi.fn();
|
|
637
638
|
|
|
638
639
|
insertBlocks(
|
|
639
640
|
blocks,
|
|
@@ -677,7 +678,7 @@ describe( 'actions', () => {
|
|
|
677
678
|
}
|
|
678
679
|
},
|
|
679
680
|
};
|
|
680
|
-
const dispatch =
|
|
681
|
+
const dispatch = vi.fn();
|
|
681
682
|
|
|
682
683
|
insertBlocks(
|
|
683
684
|
blocks,
|
|
@@ -719,8 +720,8 @@ describe( 'actions', () => {
|
|
|
719
720
|
canRemoveBlocks: () => true,
|
|
720
721
|
getBlockRemovalRules: () => false,
|
|
721
722
|
};
|
|
722
|
-
const dispatch = Object.assign(
|
|
723
|
-
selectPreviousBlock:
|
|
723
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
724
|
+
selectPreviousBlock: vi.fn(),
|
|
724
725
|
} );
|
|
725
726
|
const registry = createRegistry();
|
|
726
727
|
|
|
@@ -743,7 +744,7 @@ describe( 'actions', () => {
|
|
|
743
744
|
const select = {
|
|
744
745
|
canMoveBlocks: () => false,
|
|
745
746
|
};
|
|
746
|
-
const dispatch =
|
|
747
|
+
const dispatch = vi.fn();
|
|
747
748
|
|
|
748
749
|
moveBlocksToPosition(
|
|
749
750
|
[ 'chicken' ],
|
|
@@ -761,7 +762,7 @@ describe( 'actions', () => {
|
|
|
761
762
|
canRemoveBlocks: () => true,
|
|
762
763
|
canInsertBlocks: () => true,
|
|
763
764
|
};
|
|
764
|
-
const dispatch =
|
|
765
|
+
const dispatch = vi.fn();
|
|
765
766
|
|
|
766
767
|
moveBlocksToPosition(
|
|
767
768
|
[ 'chicken' ],
|
|
@@ -785,7 +786,7 @@ describe( 'actions', () => {
|
|
|
785
786
|
canRemoveBlocks: () => true,
|
|
786
787
|
canInsertBlocks: () => false,
|
|
787
788
|
};
|
|
788
|
-
const dispatch =
|
|
789
|
+
const dispatch = vi.fn();
|
|
789
790
|
|
|
790
791
|
moveBlocksToPosition(
|
|
791
792
|
[ 'chicken' ],
|
|
@@ -803,7 +804,7 @@ describe( 'actions', () => {
|
|
|
803
804
|
const select = {
|
|
804
805
|
canMoveBlocks: () => true,
|
|
805
806
|
};
|
|
806
|
-
const dispatch =
|
|
807
|
+
const dispatch = vi.fn();
|
|
807
808
|
|
|
808
809
|
moveBlocksToPosition(
|
|
809
810
|
'chicken',
|
|
@@ -832,8 +833,8 @@ describe( 'actions', () => {
|
|
|
832
833
|
canRemoveBlocks: () => true,
|
|
833
834
|
getBlockRemovalRules: () => false,
|
|
834
835
|
};
|
|
835
|
-
const dispatch = Object.assign(
|
|
836
|
-
selectPreviousBlock:
|
|
836
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
837
|
+
selectPreviousBlock: vi.fn(),
|
|
837
838
|
} );
|
|
838
839
|
const registry = createRegistry();
|
|
839
840
|
removeBlock( clientId )( { select, dispatch, registry } );
|
|
@@ -858,8 +859,8 @@ describe( 'actions', () => {
|
|
|
858
859
|
canRemoveBlocks: () => true,
|
|
859
860
|
getBlockRemovalRules: () => false,
|
|
860
861
|
};
|
|
861
|
-
const dispatch = Object.assign(
|
|
862
|
-
selectPreviousBlock:
|
|
862
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
863
|
+
selectPreviousBlock: vi.fn(),
|
|
863
864
|
} );
|
|
864
865
|
|
|
865
866
|
const registry = createRegistry();
|
|
@@ -1047,9 +1048,9 @@ describe( 'actions', () => {
|
|
|
1047
1048
|
getBlockEditingMode: () => 'default',
|
|
1048
1049
|
isBlockSelected: () => false,
|
|
1049
1050
|
};
|
|
1050
|
-
const dispatch = Object.assign(
|
|
1051
|
-
selectBlock:
|
|
1052
|
-
removeBlock:
|
|
1051
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
1052
|
+
selectBlock: vi.fn(),
|
|
1053
|
+
removeBlock: vi.fn(),
|
|
1053
1054
|
} );
|
|
1054
1055
|
|
|
1055
1056
|
mergeBlocks(
|
|
@@ -1101,9 +1102,9 @@ describe( 'actions', () => {
|
|
|
1101
1102
|
} ),
|
|
1102
1103
|
getBlockEditingMode: () => 'default',
|
|
1103
1104
|
};
|
|
1104
|
-
const dispatch = Object.assign(
|
|
1105
|
-
replaceBlocks:
|
|
1106
|
-
selectionChange:
|
|
1105
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
1106
|
+
replaceBlocks: vi.fn(),
|
|
1107
|
+
selectionChange: vi.fn(),
|
|
1107
1108
|
} );
|
|
1108
1109
|
|
|
1109
1110
|
mergeBlocks(
|
|
@@ -1173,8 +1174,8 @@ describe( 'actions', () => {
|
|
|
1173
1174
|
} ),
|
|
1174
1175
|
getBlockEditingMode: () => 'default',
|
|
1175
1176
|
};
|
|
1176
|
-
const dispatch = Object.assign(
|
|
1177
|
-
replaceBlocks:
|
|
1177
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
1178
|
+
replaceBlocks: vi.fn(),
|
|
1178
1179
|
} );
|
|
1179
1180
|
|
|
1180
1181
|
mergeBlocks(
|
|
@@ -1252,9 +1253,9 @@ describe( 'actions', () => {
|
|
|
1252
1253
|
} ),
|
|
1253
1254
|
getBlockEditingMode: () => 'default',
|
|
1254
1255
|
};
|
|
1255
|
-
const dispatch = Object.assign(
|
|
1256
|
-
replaceBlocks:
|
|
1257
|
-
selectionChange:
|
|
1256
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
1257
|
+
replaceBlocks: vi.fn(),
|
|
1258
|
+
selectionChange: vi.fn(),
|
|
1258
1259
|
} );
|
|
1259
1260
|
|
|
1260
1261
|
mergeBlocks(
|
|
@@ -1328,9 +1329,9 @@ describe( 'actions', () => {
|
|
|
1328
1329
|
} ),
|
|
1329
1330
|
getBlockEditingMode: ( clientId ) => modes[ clientId ],
|
|
1330
1331
|
};
|
|
1331
|
-
const dispatch = Object.assign(
|
|
1332
|
-
replaceBlocks:
|
|
1333
|
-
selectionChange:
|
|
1332
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
1333
|
+
replaceBlocks: vi.fn(),
|
|
1334
|
+
selectionChange: vi.fn(),
|
|
1334
1335
|
} );
|
|
1335
1336
|
|
|
1336
1337
|
mergeBlocks(
|
|
@@ -1388,9 +1389,9 @@ describe( 'actions', () => {
|
|
|
1388
1389
|
} ),
|
|
1389
1390
|
getBlockEditingMode: ( clientId ) => modes[ clientId ],
|
|
1390
1391
|
};
|
|
1391
|
-
const dispatch = Object.assign(
|
|
1392
|
-
replaceBlocks:
|
|
1393
|
-
selectionChange:
|
|
1392
|
+
const dispatch = Object.assign( vi.fn(), {
|
|
1393
|
+
replaceBlocks: vi.fn(),
|
|
1394
|
+
selectionChange: vi.fn(),
|
|
1394
1395
|
} );
|
|
1395
1396
|
|
|
1396
1397
|
mergeBlocks(
|
|
@@ -1479,9 +1480,9 @@ describe( 'actions', () => {
|
|
|
1479
1480
|
|
|
1480
1481
|
describe( 'updateSettings', () => {
|
|
1481
1482
|
it( 'warns when setting the deprecated __unstableIsPreviewMode property and sets the stable property instead', () => {
|
|
1482
|
-
const consoleWarn =
|
|
1483
|
+
const consoleWarn = vi
|
|
1483
1484
|
.spyOn( global.console, 'warn' )
|
|
1484
|
-
.mockImplementation();
|
|
1485
|
+
.mockImplementation( () => {} );
|
|
1485
1486
|
|
|
1486
1487
|
const store = createRegistry().registerStore(
|
|
1487
1488
|
blockEditorStoreName,
|
|
@@ -1604,7 +1605,7 @@ describe( 'actions', () => {
|
|
|
1604
1605
|
const inserterMediaCategories = [
|
|
1605
1606
|
{ name: 'a', labels: { name: 'a' } },
|
|
1606
1607
|
];
|
|
1607
|
-
const dispatch =
|
|
1608
|
+
const dispatch = vi.fn();
|
|
1608
1609
|
registerInserterMediaCategory( category )( {
|
|
1609
1610
|
select: {
|
|
1610
1611
|
getRegisteredInserterMediaCategories: () =>
|
package/src/store/test/array.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
1
2
|
import reducer from '../reducer';
|
|
2
3
|
|
|
3
4
|
describe( 'performance', () => {
|
|
@@ -19,7 +20,7 @@ describe( 'performance', () => {
|
|
|
19
20
|
blocks,
|
|
20
21
|
} );
|
|
21
22
|
expect( preparedState ).toBeDefined();
|
|
22
|
-
} );
|
|
23
|
+
}, 60_000 );
|
|
23
24
|
|
|
24
25
|
it( 'should update blocks', () => {
|
|
25
26
|
const updatedState = reducer( preparedState, {
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterAll,
|
|
3
|
+
afterEach,
|
|
4
|
+
beforeAll,
|
|
5
|
+
beforeEach,
|
|
6
|
+
describe,
|
|
7
|
+
expect,
|
|
8
|
+
it,
|
|
9
|
+
vi,
|
|
10
|
+
} from 'vitest';
|
|
1
11
|
import {
|
|
2
12
|
registerBlockType,
|
|
3
13
|
unregisterBlockType,
|
|
@@ -430,10 +440,10 @@ describe( 'private selectors', () => {
|
|
|
430
440
|
derivedBlockEditingModes: new Map(),
|
|
431
441
|
};
|
|
432
442
|
|
|
433
|
-
const hasContentRoleAttribute =
|
|
434
|
-
const get =
|
|
443
|
+
const hasContentRoleAttribute = vi.fn( () => false );
|
|
444
|
+
const get = vi.fn( () => 'edit' );
|
|
435
445
|
getBlockEditingMode.registry = {
|
|
436
|
-
select:
|
|
446
|
+
select: vi.fn( () => ( {
|
|
437
447
|
hasContentRoleAttribute,
|
|
438
448
|
get,
|
|
439
449
|
} ) ),
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterAll,
|
|
3
|
+
beforeAll,
|
|
4
|
+
beforeEach,
|
|
5
|
+
describe,
|
|
6
|
+
expect,
|
|
7
|
+
it,
|
|
8
|
+
vi,
|
|
9
|
+
} from 'vitest';
|
|
1
10
|
import deepFreeze from 'deep-freeze';
|
|
2
11
|
import {
|
|
3
12
|
registerBlockType,
|
|
@@ -40,18 +49,38 @@ import { sectionRootClientIdKey, isIsolatedEditorKey } from '.././private-keys';
|
|
|
40
49
|
|
|
41
50
|
const { isContentBlock } = unlock( privateApis );
|
|
42
51
|
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
const { mockIsContentBlock } = vi.hoisted( () => ( {
|
|
53
|
+
mockIsContentBlock: vi.fn(),
|
|
54
|
+
} ) );
|
|
55
|
+
|
|
56
|
+
vi.mock( import( '@wordpress/data' ), async ( importOriginal ) => {
|
|
57
|
+
const actualData = await importOriginal();
|
|
45
58
|
|
|
46
59
|
return {
|
|
47
|
-
|
|
60
|
+
...actualData,
|
|
61
|
+
select: vi.fn( ( ...args ) => actualData.select( ...args ) ),
|
|
48
62
|
};
|
|
49
63
|
} );
|
|
50
64
|
|
|
51
|
-
|
|
65
|
+
vi.mock( import( '../../lock-unlock' ), async ( importOriginal ) => {
|
|
66
|
+
const actualLockUnlock = await importOriginal();
|
|
67
|
+
|
|
52
68
|
return {
|
|
53
|
-
...
|
|
54
|
-
|
|
69
|
+
...actualLockUnlock,
|
|
70
|
+
unlock: ( value ) => {
|
|
71
|
+
const unlocked = actualLockUnlock.unlock( value );
|
|
72
|
+
if (
|
|
73
|
+
unlocked &&
|
|
74
|
+
typeof unlocked === 'object' &&
|
|
75
|
+
'isContentBlock' in unlocked
|
|
76
|
+
) {
|
|
77
|
+
return {
|
|
78
|
+
...unlocked,
|
|
79
|
+
isContentBlock: mockIsContentBlock,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return unlocked;
|
|
83
|
+
},
|
|
55
84
|
};
|
|
56
85
|
} );
|
|
57
86
|
|
|
@@ -3445,9 +3474,9 @@ describe( 'state', () => {
|
|
|
3445
3474
|
|
|
3446
3475
|
describe( 'settings', () => {
|
|
3447
3476
|
it( 'should warn about __unstableIsPreviewMode deprecation', () => {
|
|
3448
|
-
const consoleWarn =
|
|
3477
|
+
const consoleWarn = vi
|
|
3449
3478
|
.spyOn( global.console, 'warn' )
|
|
3450
|
-
.mockImplementation();
|
|
3479
|
+
.mockImplementation( () => {} );
|
|
3451
3480
|
|
|
3452
3481
|
const settingsObject = settings( undefined, {
|
|
3453
3482
|
type: 'UPDATE_SETTINGS',
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterAll,
|
|
3
|
+
afterEach,
|
|
4
|
+
beforeAll,
|
|
5
|
+
beforeEach,
|
|
6
|
+
describe,
|
|
7
|
+
expect,
|
|
8
|
+
it,
|
|
9
|
+
} from 'vitest';
|
|
1
10
|
import { registerBlockType, unregisterBlockType } from '@wordpress/blocks';
|
|
2
11
|
import { select, dispatch } from '@wordpress/data';
|
|
3
12
|
import { store } from '../';
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterAll,
|
|
3
|
+
afterEach,
|
|
4
|
+
beforeAll,
|
|
5
|
+
beforeEach,
|
|
6
|
+
describe,
|
|
7
|
+
expect,
|
|
8
|
+
it,
|
|
9
|
+
vi,
|
|
10
|
+
} from 'vitest';
|
|
1
11
|
import {
|
|
2
12
|
registerBlockType,
|
|
3
13
|
unregisterBlockType,
|
|
@@ -5389,8 +5399,8 @@ describe( 'getBlockEditingMode', () => {
|
|
|
5389
5399
|
derivedBlockEditingModes: new Map(),
|
|
5390
5400
|
};
|
|
5391
5401
|
|
|
5392
|
-
const hasContentRoleAttribute =
|
|
5393
|
-
const get =
|
|
5402
|
+
const hasContentRoleAttribute = vi.fn( () => false );
|
|
5403
|
+
const get = vi.fn( () => 'edit' );
|
|
5394
5404
|
|
|
5395
5405
|
const mockedSelectors = { get };
|
|
5396
5406
|
|
|
@@ -5399,7 +5409,7 @@ describe( 'getBlockEditingMode', () => {
|
|
|
5399
5409
|
} );
|
|
5400
5410
|
|
|
5401
5411
|
getBlockEditingMode.registry = {
|
|
5402
|
-
select:
|
|
5412
|
+
select: vi.fn( () => mockedSelectors ),
|
|
5403
5413
|
};
|
|
5404
5414
|
|
|
5405
5415
|
it( 'should return default by default', () => {
|
package/src/style.scss
CHANGED
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
@use "./components/url-input/style.scss" as *;
|
|
60
60
|
@use "./components/url-popover/style.scss" as *;
|
|
61
61
|
@use "./hooks/background.scss" as *;
|
|
62
|
-
@use "./hooks/block-fields/styles.scss" as *;
|
|
63
62
|
@use "./hooks/block-hooks.scss" as *;
|
|
64
63
|
@use "./hooks/block-bindings.scss" as *;
|
|
65
64
|
@use "./hooks/border.scss" as *;
|
|
@@ -74,3 +73,4 @@
|
|
|
74
73
|
@use "./components/inserter/style.scss" as *;
|
|
75
74
|
@use "./components/spacing-sizes-control/style.scss" as *;
|
|
76
75
|
@use "./components/block-visibility/style.scss" as *;
|
|
76
|
+
@use "./components/writing-flow/style.scss" as *;
|