@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,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`AlignmentUI should allow custom alignment controls to be specified 1`] = `
|
|
3
|
+
exports[`AlignmentUI > should allow custom alignment controls to be specified 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
6
|
class="components-toolbar"
|
|
@@ -18,15 +18,18 @@ exports[`AlignmentUI should allow custom alignment controls to be specified 1`]
|
|
|
18
18
|
>
|
|
19
19
|
<svg
|
|
20
20
|
aria-hidden="true"
|
|
21
|
-
fill="currentColor"
|
|
22
21
|
focusable="false"
|
|
23
22
|
height="24"
|
|
23
|
+
stroke="currentColor"
|
|
24
|
+
stroke-width="1.5"
|
|
25
|
+
style="fill: none;"
|
|
24
26
|
viewBox="0 0 24 24"
|
|
25
27
|
width="24"
|
|
26
28
|
xmlns="http://www.w3.org/2000/svg"
|
|
27
29
|
>
|
|
28
30
|
<path
|
|
29
|
-
d="
|
|
31
|
+
d="M4 5H13M4 12H20M4 19H13"
|
|
32
|
+
vector-effect="non-scaling-stroke"
|
|
30
33
|
/>
|
|
31
34
|
</svg>
|
|
32
35
|
</button>
|
|
@@ -42,15 +45,18 @@ exports[`AlignmentUI should allow custom alignment controls to be specified 1`]
|
|
|
42
45
|
>
|
|
43
46
|
<svg
|
|
44
47
|
aria-hidden="true"
|
|
45
|
-
fill="currentColor"
|
|
46
48
|
focusable="false"
|
|
47
49
|
height="24"
|
|
50
|
+
stroke="currentColor"
|
|
51
|
+
stroke-width="1.5"
|
|
52
|
+
style="fill: none;"
|
|
48
53
|
viewBox="0 0 24 24"
|
|
49
54
|
width="24"
|
|
50
55
|
xmlns="http://www.w3.org/2000/svg"
|
|
51
56
|
>
|
|
52
57
|
<path
|
|
53
|
-
d="M7.5
|
|
58
|
+
d="M7.5 5H16.5M4 12H20M7.5 19H16.5"
|
|
59
|
+
vector-effect="non-scaling-stroke"
|
|
54
60
|
/>
|
|
55
61
|
</svg>
|
|
56
62
|
</button>
|
|
@@ -59,7 +65,7 @@ exports[`AlignmentUI should allow custom alignment controls to be specified 1`]
|
|
|
59
65
|
</div>
|
|
60
66
|
`;
|
|
61
67
|
|
|
62
|
-
exports[`AlignmentUI should match snapshot when controls are hidden 1`] = `
|
|
68
|
+
exports[`AlignmentUI > should match snapshot when controls are hidden 1`] = `
|
|
63
69
|
<div>
|
|
64
70
|
<div
|
|
65
71
|
class="components-dropdown components-dropdown-menu components-toolbar"
|
|
@@ -75,15 +81,18 @@ exports[`AlignmentUI should match snapshot when controls are hidden 1`] = `
|
|
|
75
81
|
>
|
|
76
82
|
<svg
|
|
77
83
|
aria-hidden="true"
|
|
78
|
-
fill="currentColor"
|
|
79
84
|
focusable="false"
|
|
80
85
|
height="24"
|
|
86
|
+
stroke="currentColor"
|
|
87
|
+
stroke-width="1.5"
|
|
88
|
+
style="fill: none;"
|
|
81
89
|
viewBox="0 0 24 24"
|
|
82
90
|
width="24"
|
|
83
91
|
xmlns="http://www.w3.org/2000/svg"
|
|
84
92
|
>
|
|
85
93
|
<path
|
|
86
|
-
d="
|
|
94
|
+
d="M4 5H13M4 12H20M4 19H13"
|
|
95
|
+
vector-effect="non-scaling-stroke"
|
|
87
96
|
/>
|
|
88
97
|
</svg>
|
|
89
98
|
</button>
|
|
@@ -91,7 +100,7 @@ exports[`AlignmentUI should match snapshot when controls are hidden 1`] = `
|
|
|
91
100
|
</div>
|
|
92
101
|
`;
|
|
93
102
|
|
|
94
|
-
exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
|
|
103
|
+
exports[`AlignmentUI > should match snapshot when controls are visible 1`] = `
|
|
95
104
|
<div>
|
|
96
105
|
<div
|
|
97
106
|
class="components-toolbar"
|
|
@@ -109,15 +118,18 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
|
|
|
109
118
|
>
|
|
110
119
|
<svg
|
|
111
120
|
aria-hidden="true"
|
|
112
|
-
fill="currentColor"
|
|
113
121
|
focusable="false"
|
|
114
122
|
height="24"
|
|
123
|
+
stroke="currentColor"
|
|
124
|
+
stroke-width="1.5"
|
|
125
|
+
style="fill: none;"
|
|
115
126
|
viewBox="0 0 24 24"
|
|
116
127
|
width="24"
|
|
117
128
|
xmlns="http://www.w3.org/2000/svg"
|
|
118
129
|
>
|
|
119
130
|
<path
|
|
120
|
-
d="
|
|
131
|
+
d="M4 5H13M4 12H20M4 19H13"
|
|
132
|
+
vector-effect="non-scaling-stroke"
|
|
121
133
|
/>
|
|
122
134
|
</svg>
|
|
123
135
|
</button>
|
|
@@ -133,15 +145,18 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
|
|
|
133
145
|
>
|
|
134
146
|
<svg
|
|
135
147
|
aria-hidden="true"
|
|
136
|
-
fill="currentColor"
|
|
137
148
|
focusable="false"
|
|
138
149
|
height="24"
|
|
150
|
+
stroke="currentColor"
|
|
151
|
+
stroke-width="1.5"
|
|
152
|
+
style="fill: none;"
|
|
139
153
|
viewBox="0 0 24 24"
|
|
140
154
|
width="24"
|
|
141
155
|
xmlns="http://www.w3.org/2000/svg"
|
|
142
156
|
>
|
|
143
157
|
<path
|
|
144
|
-
d="M7.5
|
|
158
|
+
d="M7.5 5H16.5M4 12H20M7.5 19H16.5"
|
|
159
|
+
vector-effect="non-scaling-stroke"
|
|
145
160
|
/>
|
|
146
161
|
</svg>
|
|
147
162
|
</button>
|
|
@@ -157,15 +172,18 @@ exports[`AlignmentUI should match snapshot when controls are visible 1`] = `
|
|
|
157
172
|
>
|
|
158
173
|
<svg
|
|
159
174
|
aria-hidden="true"
|
|
160
|
-
fill="currentColor"
|
|
161
175
|
focusable="false"
|
|
162
176
|
height="24"
|
|
177
|
+
stroke="currentColor"
|
|
178
|
+
stroke-width="1.5"
|
|
179
|
+
style="fill: none;"
|
|
163
180
|
viewBox="0 0 24 24"
|
|
164
181
|
width="24"
|
|
165
182
|
xmlns="http://www.w3.org/2000/svg"
|
|
166
183
|
>
|
|
167
184
|
<path
|
|
168
|
-
d="M11
|
|
185
|
+
d="M11 5H20M4 12H20M11 19H20"
|
|
186
|
+
vector-effect="non-scaling-stroke"
|
|
169
187
|
/>
|
|
170
188
|
</svg>
|
|
171
189
|
</button>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { afterEach, describe, expect, test, vi } from 'vitest';
|
|
1
2
|
import { render, screen } from '@testing-library/react';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import { alignLeft, alignCenter } from '@wordpress/icons';
|
|
@@ -5,7 +6,7 @@ import AlignmentUI from '../ui';
|
|
|
5
6
|
|
|
6
7
|
describe( 'AlignmentUI', () => {
|
|
7
8
|
const alignment = 'left';
|
|
8
|
-
const onChangeSpy =
|
|
9
|
+
const onChangeSpy = vi.fn();
|
|
9
10
|
|
|
10
11
|
afterEach( () => {
|
|
11
12
|
onChangeSpy.mockClear();
|
|
@@ -360,6 +360,25 @@ function BackgroundImageControls( {
|
|
|
360
360
|
focusToggleButton( containerRef );
|
|
361
361
|
};
|
|
362
362
|
|
|
363
|
+
/*
|
|
364
|
+
* Sets an image entered as a direct URL. There is no attachment `id`:
|
|
365
|
+
* `source: 'url'` records that the image is externally hosted.
|
|
366
|
+
*/
|
|
367
|
+
const onSelectURL = ( newURL ) => {
|
|
368
|
+
if ( ! newURL || newURL === url ) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
onChange(
|
|
372
|
+
setImmutably( style, [ 'background' ], {
|
|
373
|
+
...style?.background,
|
|
374
|
+
backgroundImage: {
|
|
375
|
+
url: newURL,
|
|
376
|
+
source: 'url',
|
|
377
|
+
},
|
|
378
|
+
} )
|
|
379
|
+
);
|
|
380
|
+
};
|
|
381
|
+
|
|
363
382
|
// Drag and drop callback, restricting image to one.
|
|
364
383
|
const onFilesDrop = ( filesList ) => {
|
|
365
384
|
getSettings().mediaUpload( {
|
|
@@ -382,6 +401,17 @@ function BackgroundImageControls( {
|
|
|
382
401
|
} )
|
|
383
402
|
);
|
|
384
403
|
const canRemove = ! hasValue && hasBackgroundImageValue( inheritedValue );
|
|
404
|
+
// theme.json accepts a plain string for `backgroundImage`; the editor
|
|
405
|
+
// stores an object with a `url`. Resolve either for the URL field.
|
|
406
|
+
const rawURL =
|
|
407
|
+
typeof style?.background?.backgroundImage === 'string'
|
|
408
|
+
? style.background.backgroundImage
|
|
409
|
+
: url;
|
|
410
|
+
// Offer only absolute `http(s)` addresses to the URL field. A theme.json
|
|
411
|
+
// value can be theme-relative (`file:./…`), which the field could neither
|
|
412
|
+
// display usefully nor re-apply without breaking the image, and removing
|
|
413
|
+
// an inherited image stores the `'none'` sentinel string.
|
|
414
|
+
const currentURL = /^https?:\/\//.test( rawURL ?? '' ) ? rawURL : undefined;
|
|
385
415
|
const imgLabel = title || getFilename( url ) || __( 'Image' );
|
|
386
416
|
|
|
387
417
|
return (
|
|
@@ -389,10 +419,11 @@ function BackgroundImageControls( {
|
|
|
389
419
|
{ isUploading && <LoadingSpinner /> }
|
|
390
420
|
<MediaReplaceFlow
|
|
391
421
|
mediaId={ id }
|
|
392
|
-
mediaURL={
|
|
422
|
+
mediaURL={ currentURL }
|
|
393
423
|
allowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }
|
|
394
424
|
accept="image/*"
|
|
395
425
|
onSelect={ onSelectMedia }
|
|
426
|
+
onSelectURL={ onSelectURL }
|
|
396
427
|
popoverProps={ {
|
|
397
428
|
className: clsx( {
|
|
398
429
|
'block-editor-global-styles-background-panel__media-replace-popover':
|
|
@@ -170,11 +170,13 @@
|
|
|
170
170
|
|
|
171
171
|
.block-editor-global-styles-background-panel__media-replace-popover {
|
|
172
172
|
.components-popover__content {
|
|
173
|
-
//
|
|
174
|
-
|
|
173
|
+
// Sized by the widest child: the URL field (LinkControl min-width),
|
|
174
|
+
// with the menu items stretching to match.
|
|
175
|
+
width: auto;
|
|
175
176
|
}
|
|
176
177
|
|
|
177
|
-
.
|
|
178
|
+
// Scoped to menu items so the URL field's buttons keep their own padding.
|
|
179
|
+
.components-menu-item__button.components-button {
|
|
178
180
|
padding: 0 $grid-unit-10;
|
|
179
181
|
}
|
|
180
182
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`BlockAlignmentUI should match snapshot when controls are hidden 1`] = `
|
|
3
|
+
exports[`BlockAlignmentUI > should match snapshot when controls are hidden 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
6
|
class="components-dropdown components-dropdown-menu components-toolbar"
|
|
@@ -16,15 +16,26 @@ exports[`BlockAlignmentUI should match snapshot when controls are hidden 1`] = `
|
|
|
16
16
|
>
|
|
17
17
|
<svg
|
|
18
18
|
aria-hidden="true"
|
|
19
|
-
fill="currentColor"
|
|
20
19
|
focusable="false"
|
|
21
20
|
height="24"
|
|
21
|
+
stroke="currentColor"
|
|
22
|
+
stroke-width="1.5"
|
|
23
|
+
style="fill: none;"
|
|
22
24
|
viewBox="0 0 24 24"
|
|
23
25
|
width="24"
|
|
24
26
|
xmlns="http://www.w3.org/2000/svg"
|
|
25
27
|
>
|
|
26
28
|
<path
|
|
27
|
-
d="M5
|
|
29
|
+
d="M5 4.75H13M5 19.25H13"
|
|
30
|
+
vector-effect="non-scaling-stroke"
|
|
31
|
+
/>
|
|
32
|
+
<rect
|
|
33
|
+
fill="currentColor"
|
|
34
|
+
height="6"
|
|
35
|
+
stroke="none"
|
|
36
|
+
width="14"
|
|
37
|
+
x="5"
|
|
38
|
+
y="9"
|
|
28
39
|
/>
|
|
29
40
|
</svg>
|
|
30
41
|
</button>
|
|
@@ -32,7 +43,7 @@ exports[`BlockAlignmentUI should match snapshot when controls are hidden 1`] = `
|
|
|
32
43
|
</div>
|
|
33
44
|
`;
|
|
34
45
|
|
|
35
|
-
exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] = `
|
|
46
|
+
exports[`BlockAlignmentUI > should match snapshot when controls are visible 1`] = `
|
|
36
47
|
<div>
|
|
37
48
|
<div
|
|
38
49
|
class="components-toolbar"
|
|
@@ -49,15 +60,26 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
|
|
|
49
60
|
>
|
|
50
61
|
<svg
|
|
51
62
|
aria-hidden="true"
|
|
52
|
-
fill="currentColor"
|
|
53
63
|
focusable="false"
|
|
54
64
|
height="24"
|
|
65
|
+
stroke="currentColor"
|
|
66
|
+
stroke-width="1.5"
|
|
67
|
+
style="fill: none;"
|
|
55
68
|
viewBox="0 0 24 24"
|
|
56
69
|
width="24"
|
|
57
70
|
xmlns="http://www.w3.org/2000/svg"
|
|
58
71
|
>
|
|
59
72
|
<path
|
|
60
|
-
d="
|
|
73
|
+
d="M5 5H19M5 19H19"
|
|
74
|
+
vector-effect="non-scaling-stroke"
|
|
75
|
+
/>
|
|
76
|
+
<rect
|
|
77
|
+
fill="currentColor"
|
|
78
|
+
height="6"
|
|
79
|
+
stroke="none"
|
|
80
|
+
width="14"
|
|
81
|
+
x="5"
|
|
82
|
+
y="9"
|
|
61
83
|
/>
|
|
62
84
|
</svg>
|
|
63
85
|
</button>
|
|
@@ -72,15 +94,26 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
|
|
|
72
94
|
>
|
|
73
95
|
<svg
|
|
74
96
|
aria-hidden="true"
|
|
75
|
-
fill="currentColor"
|
|
76
97
|
focusable="false"
|
|
77
98
|
height="24"
|
|
99
|
+
stroke="currentColor"
|
|
100
|
+
stroke-width="1.5"
|
|
101
|
+
style="fill: none;"
|
|
78
102
|
viewBox="0 0 24 24"
|
|
79
103
|
width="24"
|
|
80
104
|
xmlns="http://www.w3.org/2000/svg"
|
|
81
105
|
>
|
|
82
106
|
<path
|
|
83
|
-
d="M5
|
|
107
|
+
d="M5 4.75H13M5 19.25H13"
|
|
108
|
+
vector-effect="non-scaling-stroke"
|
|
109
|
+
/>
|
|
110
|
+
<rect
|
|
111
|
+
fill="currentColor"
|
|
112
|
+
height="6"
|
|
113
|
+
stroke="none"
|
|
114
|
+
width="14"
|
|
115
|
+
x="5"
|
|
116
|
+
y="9"
|
|
84
117
|
/>
|
|
85
118
|
</svg>
|
|
86
119
|
</button>
|
|
@@ -95,15 +128,26 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
|
|
|
95
128
|
>
|
|
96
129
|
<svg
|
|
97
130
|
aria-hidden="true"
|
|
98
|
-
fill="currentColor"
|
|
99
131
|
focusable="false"
|
|
100
132
|
height="24"
|
|
133
|
+
stroke="currentColor"
|
|
134
|
+
stroke-width="1.5"
|
|
135
|
+
style="fill: none;"
|
|
101
136
|
viewBox="0 0 24 24"
|
|
102
137
|
width="24"
|
|
103
138
|
xmlns="http://www.w3.org/2000/svg"
|
|
104
139
|
>
|
|
105
140
|
<path
|
|
106
|
-
d="
|
|
141
|
+
d="M5 4.75H19M5 19.25H19"
|
|
142
|
+
vector-effect="non-scaling-stroke"
|
|
143
|
+
/>
|
|
144
|
+
<rect
|
|
145
|
+
fill="currentColor"
|
|
146
|
+
height="6"
|
|
147
|
+
stroke="none"
|
|
148
|
+
width="10"
|
|
149
|
+
x="7"
|
|
150
|
+
y="9"
|
|
107
151
|
/>
|
|
108
152
|
</svg>
|
|
109
153
|
</button>
|
|
@@ -118,15 +162,26 @@ exports[`BlockAlignmentUI should match snapshot when controls are visible 1`] =
|
|
|
118
162
|
>
|
|
119
163
|
<svg
|
|
120
164
|
aria-hidden="true"
|
|
121
|
-
fill="currentColor"
|
|
122
165
|
focusable="false"
|
|
123
166
|
height="24"
|
|
167
|
+
stroke="currentColor"
|
|
168
|
+
stroke-width="1.5"
|
|
169
|
+
style="fill: none;"
|
|
124
170
|
viewBox="0 0 24 24"
|
|
125
171
|
width="24"
|
|
126
172
|
xmlns="http://www.w3.org/2000/svg"
|
|
127
173
|
>
|
|
128
174
|
<path
|
|
129
|
-
d="
|
|
175
|
+
d="M11 4.75H19M11 19.25H19"
|
|
176
|
+
vector-effect="non-scaling-stroke"
|
|
177
|
+
/>
|
|
178
|
+
<rect
|
|
179
|
+
fill="currentColor"
|
|
180
|
+
height="6"
|
|
181
|
+
stroke="none"
|
|
182
|
+
width="14"
|
|
183
|
+
x="5"
|
|
184
|
+
y="9"
|
|
130
185
|
/>
|
|
131
186
|
</svg>
|
|
132
187
|
</button>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { afterEach, describe, expect, test, vi } from 'vitest';
|
|
1
2
|
import { render, screen } from '@testing-library/react';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import BlockAlignmentUI from '../ui';
|
|
4
5
|
|
|
5
6
|
describe( 'BlockAlignmentUI', () => {
|
|
6
7
|
const alignment = 'left';
|
|
7
|
-
const onChange =
|
|
8
|
+
const onChange = vi.fn();
|
|
8
9
|
|
|
9
10
|
afterEach( () => {
|
|
10
11
|
onChange.mockClear();
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
Flex,
|
|
4
4
|
FlexItem,
|
|
5
5
|
Modal,
|
|
6
|
-
__experimentalText as WCText,
|
|
7
6
|
__experimentalVStack as VStack,
|
|
8
7
|
} from '@wordpress/components';
|
|
9
8
|
import { useState } from '@wordpress/element';
|
|
10
9
|
import { _x, __ } from '@wordpress/i18n';
|
|
11
10
|
import { useDispatch } from '@wordpress/data';
|
|
11
|
+
import { Text } from '@wordpress/ui';
|
|
12
12
|
import { store as blockEditorStore } from '../../store';
|
|
13
13
|
import BlockManager from '../block-manager';
|
|
14
14
|
|
|
@@ -51,11 +51,11 @@ export default function BlockAllowedBlocksModal( {
|
|
|
51
51
|
} }
|
|
52
52
|
spacing="4"
|
|
53
53
|
>
|
|
54
|
-
<
|
|
54
|
+
<Text>
|
|
55
55
|
{ __(
|
|
56
56
|
'Select which blocks can be added inside this container.'
|
|
57
57
|
) }
|
|
58
|
-
</
|
|
58
|
+
</Text>
|
|
59
59
|
<BlockManager
|
|
60
60
|
blockTypes={ blockTypes }
|
|
61
61
|
selectedBlockTypes={ currentSelectedBlockTypes }
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest';
|
|
1
2
|
import { renderHook } from '@testing-library/react';
|
|
3
|
+
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
2
4
|
import { dispatch, select } from '@wordpress/data';
|
|
3
5
|
import {
|
|
4
6
|
createBlock,
|
|
5
7
|
getBlockTypes,
|
|
6
8
|
unregisterBlockType,
|
|
7
9
|
} from '@wordpress/blocks';
|
|
8
|
-
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
9
10
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
10
11
|
import { useBlockBindingsUtils } from '../';
|
|
11
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`BlockBreadcrumb should render correctly 1`] = `
|
|
3
|
+
exports[`BlockBreadcrumb > should render correctly 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<ul
|
|
6
6
|
aria-label="Block breadcrumb"
|
|
@@ -113,7 +113,7 @@ const EditWithGeneratedProps = ( props ) => {
|
|
|
113
113
|
let values = {};
|
|
114
114
|
if ( ! source.getValues ) {
|
|
115
115
|
Object.keys( bindings ).forEach( ( attr ) => {
|
|
116
|
-
// Default to the
|
|
116
|
+
// Default to the source label when `getValues` doesn't exist.
|
|
117
117
|
values[ attr ] = source.label;
|
|
118
118
|
} );
|
|
119
119
|
} else {
|
|
@@ -15,12 +15,6 @@
|
|
|
15
15
|
&.has-colors {
|
|
16
16
|
svg {
|
|
17
17
|
fill: currentColor;
|
|
18
|
-
|
|
19
|
-
// Optimize for high contrast modes.
|
|
20
|
-
// See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
|
|
21
|
-
@media (forced-colors: active) {
|
|
22
|
-
fill: CanvasText;
|
|
23
|
-
}
|
|
24
18
|
}
|
|
25
19
|
}
|
|
26
20
|
|
|
@@ -15,12 +15,6 @@
|
|
|
15
15
|
&.has-colors {
|
|
16
16
|
svg {
|
|
17
17
|
fill: currentColor;
|
|
18
|
-
|
|
19
|
-
// Optimize for high contrast modes.
|
|
20
|
-
// See also https://blogs.windows.com/msedgedev/2020/09/17/styling-for-windows-high-contrast-with-new-standards-for-forced-colors/.
|
|
21
|
-
@media (forced-colors: active) {
|
|
22
|
-
fill: CanvasText;
|
|
23
|
-
}
|
|
24
18
|
}
|
|
25
19
|
}
|
|
26
20
|
|
package/src/components/block-icon/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap}
RENAMED
|
@@ -7,15 +7,19 @@ exports[`BlockIcon renders a Icon 1`] = `
|
|
|
7
7
|
>
|
|
8
8
|
<svg
|
|
9
9
|
aria-hidden="true"
|
|
10
|
-
fill="currentColor"
|
|
11
10
|
focusable="false"
|
|
12
11
|
height="24"
|
|
12
|
+
stroke="currentColor"
|
|
13
|
+
stroke-width="1.5"
|
|
14
|
+
style="fill: none;"
|
|
13
15
|
viewBox="0 0 24 24"
|
|
14
16
|
width="24"
|
|
15
17
|
xmlns="http://www.w3.org/2000/svg"
|
|
16
18
|
>
|
|
17
19
|
<path
|
|
18
|
-
d="
|
|
20
|
+
d="M3.75 16.2031L8.6 12.7L12 15L16 11L20.25 15.2517M5 20.25H19C19.6904 20.25 20.25 19.6904 20.25 19V5C20.25 4.30964 19.6904 3.75 19 3.75H5C4.30964 3.75 3.75 4.30964 3.75 5V19C3.75 19.6904 4.30964 20.25 5 20.25Z"
|
|
21
|
+
stroke-linejoin="round"
|
|
22
|
+
vector-effect="non-scaling-stroke"
|
|
19
23
|
/>
|
|
20
24
|
</svg>
|
|
21
25
|
</span>
|
|
@@ -29,7 +29,6 @@ import InspectorControlsLastItem from '../inspector-controls/last-item';
|
|
|
29
29
|
import AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';
|
|
30
30
|
import PositionControls from '../inspector-controls-tabs/position-controls-panel';
|
|
31
31
|
import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
|
|
32
|
-
import { useBorderPanelLabel } from '../../hooks/border';
|
|
33
32
|
import { BlockStateBadges, BlockStatesControl } from '../../hooks/states';
|
|
34
33
|
import ContentTab from '../inspector-controls-tabs/content-tab';
|
|
35
34
|
import ViewportVisibilityInfo from '../block-visibility/viewport-visibility-info';
|
|
@@ -42,12 +41,10 @@ import {
|
|
|
42
41
|
} from '../../hooks/block-style-state';
|
|
43
42
|
|
|
44
43
|
function StyleInspectorSlots( {
|
|
45
|
-
clientId,
|
|
46
44
|
showAdvancedControls = true,
|
|
47
45
|
showPositionControls = true,
|
|
48
46
|
showBindingsControls = true,
|
|
49
47
|
} ) {
|
|
50
|
-
const borderPanelLabel = useBorderPanelLabel( { clientId } );
|
|
51
48
|
return (
|
|
52
49
|
<>
|
|
53
50
|
<InspectorControls.Slot />
|
|
@@ -70,7 +67,7 @@ function StyleInspectorSlots( {
|
|
|
70
67
|
group="dimensions"
|
|
71
68
|
label={ __( 'Dimensions' ) }
|
|
72
69
|
/>
|
|
73
|
-
<InspectorControls.Slot group="border" label={
|
|
70
|
+
<InspectorControls.Slot group="border" label={ __( 'Borders' ) } />
|
|
74
71
|
<InspectorControls.Slot
|
|
75
72
|
group="elements"
|
|
76
73
|
label={ __( 'Elements' ) }
|
|
@@ -97,7 +94,6 @@ function StyleStateInspectorSlots( {
|
|
|
97
94
|
isSectionBlock,
|
|
98
95
|
selectedBlockStyleState,
|
|
99
96
|
} ) {
|
|
100
|
-
const borderPanelLabel = useBorderPanelLabel( { clientId } );
|
|
101
97
|
const isViewportStyleState =
|
|
102
98
|
hasViewportBlockStyleState( selectedBlockStyleState ) &&
|
|
103
99
|
! hasPseudoBlockStyleState( selectedBlockStyleState );
|
|
@@ -142,7 +138,7 @@ function StyleStateInspectorSlots( {
|
|
|
142
138
|
/>
|
|
143
139
|
<InspectorControls.Slot
|
|
144
140
|
group="border"
|
|
145
|
-
label={
|
|
141
|
+
label={ __( 'Borders' ) }
|
|
146
142
|
/>
|
|
147
143
|
<InspectorControls.Slot
|
|
148
144
|
group="elements"
|
|
@@ -530,11 +526,7 @@ const BlockInspectorSingleBlock = ( {
|
|
|
530
526
|
<InspectorControls.Slot group="content" />
|
|
531
527
|
<InspectorControls.Slot group="list" ref={ listViewRef } />
|
|
532
528
|
<ListViewContentPopover listViewRef={ listViewRef } />
|
|
533
|
-
{ ! isSectionBlock &&
|
|
534
|
-
<StyleInspectorSlots
|
|
535
|
-
clientId={ renderedBlockClientId }
|
|
536
|
-
/>
|
|
537
|
-
) }
|
|
529
|
+
{ ! isSectionBlock && <StyleInspectorSlots /> }
|
|
538
530
|
</>
|
|
539
531
|
) }
|
|
540
532
|
{ ! isEditingStyleState && <InspectorControlsLastItem.Slot /> }
|
|
@@ -80,13 +80,16 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
// Block highlight, and navigation mode, and focus
|
|
83
|
+
// Block highlight, and navigation mode, and focus, and hover where the
|
|
84
|
+
// grab cursor shows what a drag would take.
|
|
84
85
|
// This piece of code has gone back and forth between using a pseudo element
|
|
85
86
|
// vs. styling the block directly. Ultimately we likely need a pseudo element
|
|
86
87
|
// (unless styles like focus and selection overlay can be rendered as separate elements),
|
|
87
88
|
// since things like border-radius need to be able to be set on the block itself.
|
|
88
89
|
.block-editor-block-list__block.is-highlighted,
|
|
89
90
|
.block-editor-block-list__block.is-highlighted ~ .is-multi-selected,
|
|
91
|
+
.block-editor-block-list__block.is-hovered-draggable[draggable="true"]:not(.is-multi-selected),
|
|
92
|
+
.block-editor-block-list__block.is-hovered-draggable[data-draggable="true"]:not(.is-multi-selected),
|
|
90
93
|
.block-editor-block-list__block:not([contenteditable="true"]):focus {
|
|
91
94
|
outline: none;
|
|
92
95
|
|