@wordpress/block-editor 15.16.1-next.v.202604091042.0 → 15.18.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 +8 -0
- package/build/components/autocomplete/index.cjs.map +3 -3
- package/build/components/background-image-control/index.cjs +2 -1
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-allowed-blocks/modal.cjs.map +2 -2
- package/build/components/block-bindings/attribute-control.cjs.map +3 -3
- package/build/components/block-card/index.cjs +2 -2
- package/build/components/block-card/index.cjs.map +3 -3
- package/build/components/block-mover/button.cjs +9 -3
- package/build/components/block-mover/button.cjs.map +2 -2
- package/build/components/block-pattern-setup/index.cjs +3 -2
- package/build/components/block-pattern-setup/index.cjs.map +2 -2
- package/build/components/block-patterns-list/index.cjs +2 -1
- package/build/components/block-patterns-list/index.cjs.map +2 -2
- package/build/components/block-patterns-paging/index.cjs.map +3 -3
- package/build/components/block-settings-menu/block-settings-dropdown.cjs +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +3 -3
- package/build/components/block-settings-menu/index.cjs +2 -2
- package/build/components/block-settings-menu/index.cjs.map +3 -3
- package/build/components/block-styles/menu-items.cjs.map +3 -3
- package/build/components/block-switcher/index.cjs.map +3 -3
- package/build/components/block-switcher/pattern-transformations-menu.cjs +2 -1
- package/build/components/block-switcher/pattern-transformations-menu.cjs.map +2 -2
- package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +3 -3
- package/build/components/block-variation-transforms/index.cjs +2 -1
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs +4 -4
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +3 -3
- package/build/components/collab/{block-comment-icon-slot.cjs → note-icon-slot.cjs} +8 -8
- package/build/components/collab/note-icon-slot.cjs.map +7 -0
- package/build/components/collab/{block-comment-icon-toolbar-slot.cjs → note-icon-toolbar-slot.cjs} +9 -9
- package/build/components/collab/note-icon-toolbar-slot.cjs.map +7 -0
- package/build/components/copy-handler/index.cjs.map +2 -2
- package/build/components/date-format-picker/index.cjs +2 -1
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/global-styles/color-panel.cjs.map +2 -2
- package/build/components/global-styles/dimensions-panel.cjs +87 -62
- package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
- package/build/components/global-styles/filters-panel.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +9 -7
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/grid/grid-item-movers.cjs +2 -1
- package/build/components/grid/grid-item-movers.cjs.map +2 -2
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.cjs.map +2 -2
- package/build/components/inserter/menu.cjs +2 -1
- package/build/components/inserter/menu.cjs.map +2 -2
- package/build/components/inserter/search-results.cjs +3 -3
- package/build/components/inserter/search-results.cjs.map +2 -2
- package/build/components/inspector-popover-header/index.cjs.map +3 -3
- package/build/components/link-control/link-preview.cjs +5 -3
- package/build/components/link-control/link-preview.cjs.map +2 -2
- package/build/components/link-control/settings.cjs +2 -1
- package/build/components/link-control/settings.cjs.map +2 -2
- package/build/components/link-picker/link-picker.cjs +3 -2
- package/build/components/link-picker/link-picker.cjs.map +2 -2
- package/build/components/link-picker/link-preview.cjs +2 -2
- package/build/components/link-picker/link-preview.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +2 -2
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/index.cjs +2 -1
- package/build/components/list-view/index.cjs.map +2 -2
- package/build/components/preset-input-control/index.cjs +7 -4
- package/build/components/preset-input-control/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +80 -7
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/responsive-block-control/label.cjs +9 -2
- package/build/components/responsive-block-control/label.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/index.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/paste-handler.cjs +12 -5
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
- package/build/components/spacing-sizes-control/utils.cjs +1 -1
- package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
- package/build/components/url-popover/image-url-input-ui.cjs +1 -1
- package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
- package/build/components/writing-flow/use-arrow-nav.cjs +1 -1
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-selection-observer.cjs +23 -1
- package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
- package/build/hooks/block-bindings.cjs.map +3 -3
- package/build/hooks/block-fields/link/index.cjs +1 -1
- package/build/hooks/block-fields/link/index.cjs.map +1 -1
- package/build/hooks/custom-css.cjs +21 -0
- package/build/hooks/custom-css.cjs.map +3 -3
- package/build/hooks/dimensions.cjs +5 -1
- package/build/hooks/dimensions.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +1 -1
- package/build/hooks/grid-visualizer.cjs.map +1 -1
- package/build/hooks/layout-child.cjs +1 -1
- package/build/hooks/layout-child.cjs.map +1 -1
- package/build/hooks/style.cjs +54 -52
- package/build/hooks/style.cjs.map +2 -2
- package/build/hooks/utils.cjs +4 -0
- package/build/hooks/utils.cjs.map +2 -2
- package/build/layouts/flex.cjs +5 -8
- package/build/layouts/flex.cjs.map +3 -3
- package/build/layouts/grid.cjs +5 -5
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +5 -4
- package/build/private-apis.cjs.map +3 -3
- package/build/store/private-keys.cjs +3 -0
- package/build/store/private-keys.cjs.map +2 -2
- package/build/utils/dom.cjs +3 -1
- package/build/utils/dom.cjs.map +2 -2
- package/build-module/components/autocomplete/index.mjs +2 -2
- package/build-module/components/autocomplete/index.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +2 -2
- 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-bindings/attribute-control.mjs +3 -3
- package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
- package/build-module/components/block-card/index.mjs +4 -4
- package/build-module/components/block-card/index.mjs.map +2 -2
- package/build-module/components/block-mover/button.mjs +11 -5
- package/build-module/components/block-mover/button.mjs.map +2 -2
- package/build-module/components/block-pattern-setup/index.mjs +2 -1
- package/build-module/components/block-pattern-setup/index.mjs.map +2 -2
- package/build-module/components/block-patterns-list/index.mjs +1 -1
- package/build-module/components/block-patterns-list/index.mjs.map +2 -2
- package/build-module/components/block-patterns-paging/index.mjs +3 -3
- package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
- package/build-module/components/block-settings-menu/index.mjs +2 -2
- package/build-module/components/block-settings-menu/index.mjs.map +2 -2
- package/build-module/components/block-styles/menu-items.mjs +2 -2
- package/build-module/components/block-styles/menu-items.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-switcher/pattern-transformations-menu.mjs +2 -7
- package/build-module/components/block-switcher/pattern-transformations-menu.mjs.map +2 -2
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs +2 -2
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +2 -2
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +6 -6
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
- package/build-module/components/collab/note-icon-slot.mjs +8 -0
- package/build-module/components/collab/note-icon-slot.mjs.map +7 -0
- package/build-module/components/collab/note-icon-toolbar-slot.mjs +10 -0
- package/build-module/components/collab/note-icon-toolbar-slot.mjs.map +7 -0
- package/build-module/components/copy-handler/index.mjs.map +2 -2
- package/build-module/components/date-format-picker/index.mjs +2 -2
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/global-styles/color-panel.mjs.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.mjs +87 -62
- package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
- package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +9 -7
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/grid/grid-item-movers.mjs +2 -5
- package/build-module/components/grid/grid-item-movers.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs +3 -3
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs.map +1 -1
- package/build-module/components/inserter/menu.mjs +3 -2
- package/build-module/components/inserter/menu.mjs.map +2 -2
- package/build-module/components/inserter/search-results.mjs +1 -1
- package/build-module/components/inserter/search-results.mjs.map +1 -1
- package/build-module/components/inspector-popover-header/index.mjs +2 -2
- package/build-module/components/inspector-popover-header/index.mjs.map +2 -2
- package/build-module/components/link-control/link-preview.mjs +5 -3
- package/build-module/components/link-control/link-preview.mjs.map +2 -2
- package/build-module/components/link-control/settings.mjs +3 -2
- package/build-module/components/link-control/settings.mjs.map +2 -2
- package/build-module/components/link-picker/link-picker.mjs +1 -1
- package/build-module/components/link-picker/link-picker.mjs.map +2 -2
- package/build-module/components/link-picker/link-preview.mjs +2 -2
- package/build-module/components/link-picker/link-preview.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +2 -2
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/index.mjs +2 -4
- package/build-module/components/list-view/index.mjs.map +2 -2
- package/build-module/components/preset-input-control/index.mjs +7 -4
- package/build-module/components/preset-input-control/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +82 -8
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/responsive-block-control/label.mjs +9 -2
- package/build-module/components/responsive-block-control/label.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs +12 -5
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
- package/build-module/components/spacing-sizes-control/utils.mjs +1 -1
- package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs +1 -1
- package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-selection-observer.mjs +23 -1
- package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
- package/build-module/hooks/block-bindings.mjs +2 -2
- package/build-module/hooks/block-bindings.mjs.map +2 -2
- package/build-module/hooks/block-fields/link/index.mjs +1 -1
- package/build-module/hooks/block-fields/link/index.mjs.map +1 -1
- package/build-module/hooks/custom-css.mjs +23 -2
- package/build-module/hooks/custom-css.mjs.map +2 -2
- package/build-module/hooks/dimensions.mjs +5 -1
- package/build-module/hooks/dimensions.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +1 -1
- package/build-module/hooks/grid-visualizer.mjs.map +1 -1
- package/build-module/hooks/layout-child.mjs +1 -1
- package/build-module/hooks/layout-child.mjs.map +1 -1
- package/build-module/hooks/style.mjs +54 -52
- package/build-module/hooks/style.mjs.map +2 -2
- package/build-module/hooks/utils.mjs +4 -0
- package/build-module/hooks/utils.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +4 -7
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +4 -4
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/private-apis.mjs +7 -5
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +2 -0
- package/build-module/store/private-keys.mjs.map +2 -2
- package/build-module/utils/dom.mjs +2 -1
- package/build-module/utils/dom.mjs.map +2 -2
- package/build-style/content-rtl.css +1 -4
- package/build-style/content.css +1 -4
- package/build-style/style-rtl.css +12 -12
- package/build-style/style.css +12 -12
- package/build-types/utils/dom.d.ts +7 -0
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +39 -38
- package/src/components/autocomplete/index.js +4 -2
- package/src/components/background-image-control/index.js +2 -2
- package/src/components/background-image-control/style.scss +1 -1
- package/src/components/block-allowed-blocks/modal.js +3 -3
- package/src/components/block-bindings/attribute-control.js +4 -4
- package/src/components/block-card/index.js +5 -5
- package/src/components/block-list/content.scss +0 -4
- package/src/components/block-mover/button.js +17 -7
- package/src/components/block-pattern-setup/index.js +2 -1
- package/src/components/block-pattern-setup/style.scss +2 -2
- package/src/components/block-patterns-list/index.js +1 -1
- package/src/components/block-patterns-list/style.scss +1 -1
- package/src/components/block-patterns-paging/index.js +5 -6
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-styles/menu-items.js +3 -3
- package/src/components/block-switcher/index.js +3 -3
- package/src/components/block-switcher/pattern-transformations-menu.js +2 -7
- package/src/components/block-switcher/style.scss +2 -2
- package/src/components/block-toolbar/pattern-overrides-dropdown.js +2 -2
- package/src/components/block-variation-transforms/index.js +2 -2
- package/src/components/block-visibility/viewport-visibility-info.js +7 -7
- package/src/components/collab/note-icon-slot.js +8 -0
- package/src/components/collab/note-icon-toolbar-slot.js +10 -0
- package/src/components/copy-handler/index.js +1 -0
- package/src/components/date-format-picker/index.js +4 -2
- package/src/components/global-styles/color-panel.js +0 -2
- package/src/components/global-styles/dimensions-panel.js +100 -73
- package/src/components/global-styles/filters-panel.js +0 -2
- package/src/components/global-styles/hooks.js +9 -7
- package/src/components/global-styles/style.scss +1 -1
- package/src/components/grid/grid-item-movers.js +2 -5
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -5
- package/src/components/inserter/menu.js +3 -2
- package/src/components/inserter/search-results.js +1 -1
- package/src/components/inserter/style.scss +2 -2
- package/src/components/inserter-list-item/style.scss +1 -1
- package/src/components/inspector-popover-header/index.js +2 -2
- package/src/components/link-control/link-preview.js +6 -4
- package/src/components/link-control/settings.js +3 -2
- package/src/components/link-picker/link-picker.js +1 -1
- package/src/components/link-picker/link-preview.js +3 -3
- package/src/components/list-view/block-select-button.js +3 -3
- package/src/components/list-view/index.js +2 -4
- package/src/components/list-view/style.scss +1 -1
- package/src/components/media-placeholder/content.scss +1 -1
- package/src/components/preset-input-control/index.js +10 -4
- package/src/components/preset-input-control/test/index.js +70 -0
- package/src/components/provider/index.js +149 -8
- package/src/components/responsive-block-control/label.js +5 -2
- package/src/components/rich-text/event-listeners/index.js +1 -0
- package/src/components/rich-text/event-listeners/paste-handler.js +18 -4
- package/src/components/spacing-sizes-control/utils.js +1 -1
- package/src/components/url-input/style.scss +1 -1
- package/src/components/url-popover/image-url-input-ui.js +1 -1
- package/src/components/writing-flow/use-arrow-nav.js +9 -2
- package/src/components/writing-flow/use-selection-observer.js +39 -1
- package/src/hooks/block-bindings.js +3 -3
- package/src/hooks/block-fields/link/index.js +1 -1
- package/src/hooks/custom-css.js +30 -9
- package/src/hooks/dimensions.js +6 -1
- package/src/hooks/grid-visualizer.js +1 -1
- package/src/hooks/layout-child.js +1 -1
- package/src/hooks/style.js +75 -61
- package/src/hooks/test/dimensions.js +16 -0
- package/src/hooks/test/style.js +2 -0
- package/src/hooks/utils.js +4 -0
- package/src/layouts/flex.js +7 -9
- package/src/layouts/grid.js +7 -4
- package/src/private-apis.js +6 -4
- package/src/store/private-keys.js +1 -0
- package/src/utils/dom.js +3 -3
- package/src/utils/test/dom.js +47 -4
- package/build/components/collab/block-comment-icon-slot.cjs.map +0 -7
- package/build/components/collab/block-comment-icon-toolbar-slot.cjs.map +0 -7
- package/build-module/components/collab/block-comment-icon-slot.mjs +0 -8
- package/build-module/components/collab/block-comment-icon-slot.mjs.map +0 -7
- package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs +0 -10
- package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs.map +0 -7
- package/src/components/collab/block-comment-icon-slot.js +0 -8
- package/src/components/collab/block-comment-icon-toolbar-slot.js +0 -10
|
@@ -7,11 +7,8 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { __, isRTL } from '@wordpress/i18n';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
ToolbarButton,
|
|
13
|
-
ToolbarGroup,
|
|
14
|
-
} from '@wordpress/components';
|
|
10
|
+
import { ToolbarButton, ToolbarGroup } from '@wordpress/components';
|
|
11
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
15
12
|
import {
|
|
16
13
|
chevronLeft,
|
|
17
14
|
chevronUp,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
__experimentalHStack as HStack,
|
|
15
15
|
__experimentalVStack as VStack,
|
|
16
16
|
__experimentalHeading as Heading,
|
|
17
|
-
__experimentalText as
|
|
17
|
+
__experimentalText as WCText,
|
|
18
18
|
FlexBlock,
|
|
19
19
|
} from '@wordpress/components';
|
|
20
20
|
|
|
@@ -162,23 +162,23 @@ export function PatternCategoryPreviews( {
|
|
|
162
162
|
/>
|
|
163
163
|
</HStack>
|
|
164
164
|
{ ! currentCategoryPatterns.length && (
|
|
165
|
-
<
|
|
165
|
+
<WCText
|
|
166
166
|
variant="muted"
|
|
167
167
|
className="block-editor-inserter__patterns-category-no-results"
|
|
168
168
|
>
|
|
169
169
|
{ __( 'No results found' ) }
|
|
170
|
-
</
|
|
170
|
+
</WCText>
|
|
171
171
|
) }
|
|
172
172
|
</VStack>
|
|
173
173
|
{ currentCategoryPatterns.length > 0 && (
|
|
174
174
|
<>
|
|
175
|
-
<
|
|
175
|
+
<WCText
|
|
176
176
|
size="12"
|
|
177
177
|
as="p"
|
|
178
178
|
className="block-editor-inserter__help-text"
|
|
179
179
|
>
|
|
180
180
|
{ __( 'Drag and drop patterns into the canvas.' ) }
|
|
181
|
-
</
|
|
181
|
+
</WCText>
|
|
182
182
|
<BlockPatternsList
|
|
183
183
|
ref={ scrollContainerRef }
|
|
184
184
|
blockPatterns={ pagingProps.categoryPatterns }
|
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
useRef,
|
|
15
15
|
useLayoutEffect,
|
|
16
16
|
} from '@wordpress/element';
|
|
17
|
-
import {
|
|
17
|
+
import { SearchControl, Popover } from '@wordpress/components';
|
|
18
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
18
19
|
import { __ } from '@wordpress/i18n';
|
|
19
20
|
import { useDebouncedInput, useViewportMatch } from '@wordpress/compose';
|
|
20
21
|
import { useSelect } from '@wordpress/data';
|
|
@@ -235,7 +236,7 @@ function InserterMenu(
|
|
|
235
236
|
</div>
|
|
236
237
|
{ showInserterHelpPanel && (
|
|
237
238
|
<div className="block-editor-inserter__tips">
|
|
238
|
-
<VisuallyHidden
|
|
239
|
+
<VisuallyHidden render={ <h2 /> }>
|
|
239
240
|
{ __( 'A tip for using the block editor' ) }
|
|
240
241
|
</VisuallyHidden>
|
|
241
242
|
<Tips />
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useMemo, useEffect } from '@wordpress/element';
|
|
5
5
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
6
|
-
import { VisuallyHidden } from '@wordpress/
|
|
6
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
7
7
|
import { useDebounce, useAsyncList } from '@wordpress/compose';
|
|
8
8
|
import { speak } from '@wordpress/a11y';
|
|
9
9
|
import { useSelect } from '@wordpress/data';
|
|
@@ -85,7 +85,7 @@ $block-inserter-tabs-height: 44px;
|
|
|
85
85
|
.block-editor-inserter__toggle.components-button {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
align-items: center;
|
|
88
|
-
cursor:
|
|
88
|
+
cursor: var(--wpds-cursor-control);
|
|
89
89
|
border: none;
|
|
90
90
|
outline: none;
|
|
91
91
|
padding: 0;
|
|
@@ -482,7 +482,7 @@ $block-inserter-tabs-height: 44px;
|
|
|
482
482
|
|
|
483
483
|
.block-editor-inserter__media-list__list-item {
|
|
484
484
|
position: relative;
|
|
485
|
-
cursor:
|
|
485
|
+
cursor: var(--wpds-cursor-control);
|
|
486
486
|
margin-bottom: $grid-unit-30;
|
|
487
487
|
|
|
488
488
|
&.is-placeholder {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
__experimentalHeading as Heading,
|
|
8
8
|
__experimentalSpacer as Spacer,
|
|
9
9
|
Button,
|
|
10
|
-
__experimentalText as
|
|
10
|
+
__experimentalText as WCText,
|
|
11
11
|
} from '@wordpress/components';
|
|
12
12
|
import { closeSmall } from '@wordpress/icons';
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
@@ -52,7 +52,7 @@ export default function InspectorPopoverHeader( {
|
|
|
52
52
|
/>
|
|
53
53
|
) }
|
|
54
54
|
</HStack>
|
|
55
|
-
{ help && <
|
|
55
|
+
{ help && <WCText>{ help }</WCText> }
|
|
56
56
|
</VStack>
|
|
57
57
|
);
|
|
58
58
|
}
|
|
@@ -36,7 +36,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
36
36
|
import { unlock } from '../../lock-unlock';
|
|
37
37
|
import { ViewerSlot } from './viewer-slot';
|
|
38
38
|
|
|
39
|
-
const { Badge } = unlock( componentsPrivateApis );
|
|
39
|
+
const { Badge: WCBadge } = unlock( componentsPrivateApis );
|
|
40
40
|
|
|
41
41
|
import useRichUrlData from './use-rich-url-data';
|
|
42
42
|
|
|
@@ -70,7 +70,9 @@ export default function LinkPreview( {
|
|
|
70
70
|
|
|
71
71
|
const displayTitle =
|
|
72
72
|
! isEmptyURL &&
|
|
73
|
-
stripHTML(
|
|
73
|
+
stripHTML(
|
|
74
|
+
value?.entityTitle || richData?.title || value?.title || displayURL
|
|
75
|
+
);
|
|
74
76
|
|
|
75
77
|
let icon;
|
|
76
78
|
|
|
@@ -162,12 +164,12 @@ export default function LinkPreview( {
|
|
|
162
164
|
>
|
|
163
165
|
{ value.badges.map(
|
|
164
166
|
( badge, index ) => (
|
|
165
|
-
<
|
|
167
|
+
<WCBadge
|
|
166
168
|
key={ `${ badge.label }|${ badge.intent }|${ index }` }
|
|
167
169
|
intent={ badge.intent }
|
|
168
170
|
>
|
|
169
171
|
{ badge.label }
|
|
170
|
-
</
|
|
172
|
+
</WCBadge>
|
|
171
173
|
)
|
|
172
174
|
) }
|
|
173
175
|
</HStack>
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { CheckboxControl
|
|
5
|
+
import { CheckboxControl } from '@wordpress/components';
|
|
6
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
6
7
|
|
|
7
8
|
const noop = () => {};
|
|
8
9
|
|
|
@@ -58,7 +59,7 @@ const LinkControlSettings = ( { value, onChange = noop, settings } ) => {
|
|
|
58
59
|
|
|
59
60
|
return (
|
|
60
61
|
<fieldset className="block-editor-link-control__settings">
|
|
61
|
-
<VisuallyHidden
|
|
62
|
+
<VisuallyHidden render={ <legend /> }>
|
|
62
63
|
{ __( 'Currently selected link settings' ) }
|
|
63
64
|
</VisuallyHidden>
|
|
64
65
|
{ theSettings }
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
BaseControl,
|
|
6
6
|
Button,
|
|
7
7
|
Popover,
|
|
8
|
-
VisuallyHidden,
|
|
9
8
|
useBaseControlProps,
|
|
10
9
|
} from '@wordpress/components';
|
|
10
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
11
11
|
import { useState, useId, useRef } from '@wordpress/element';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
|
|
|
16
16
|
*/
|
|
17
17
|
import { unlock } from '../../lock-unlock';
|
|
18
18
|
|
|
19
|
-
const { Badge } = unlock( componentsPrivateApis );
|
|
19
|
+
const { Badge: WCBadge } = unlock( componentsPrivateApis );
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Link preview component that displays the current link information.
|
|
@@ -67,12 +67,12 @@ export function LinkPreview( { title, url, image, badges } ) {
|
|
|
67
67
|
alignment="left"
|
|
68
68
|
>
|
|
69
69
|
{ badges.map( ( badge ) => (
|
|
70
|
-
<
|
|
70
|
+
<WCBadge
|
|
71
71
|
key={ `${ badge.label }|${ badge.intent }` }
|
|
72
72
|
intent={ badge.intent }
|
|
73
73
|
>
|
|
74
74
|
{ badge.label }
|
|
75
|
-
</
|
|
75
|
+
</WCBadge>
|
|
76
76
|
) ) }
|
|
77
77
|
</HStack>
|
|
78
78
|
) }
|
|
@@ -36,7 +36,7 @@ import { store as blockEditorStore } from '../../store';
|
|
|
36
36
|
import { unlock } from '../../lock-unlock';
|
|
37
37
|
import { getBlockVisibilityLabel } from '../block-visibility';
|
|
38
38
|
|
|
39
|
-
const { Badge } = unlock( componentsPrivateApis );
|
|
39
|
+
const { Badge: WCBadge } = unlock( componentsPrivateApis );
|
|
40
40
|
|
|
41
41
|
function ListViewBlockSelectButton(
|
|
42
42
|
{
|
|
@@ -136,9 +136,9 @@ function ListViewBlockSelectButton(
|
|
|
136
136
|
</span>
|
|
137
137
|
{ blockInformation?.anchor && (
|
|
138
138
|
<span className="block-editor-list-view-block-select-button__anchor-wrapper">
|
|
139
|
-
<
|
|
139
|
+
<WCBadge className="block-editor-list-view-block-select-button__anchor">
|
|
140
140
|
{ blockInformation.anchor }
|
|
141
|
-
</
|
|
141
|
+
</WCBadge>
|
|
142
142
|
</span>
|
|
143
143
|
) }
|
|
144
144
|
{ isSticky && (
|
|
@@ -11,10 +11,8 @@ import {
|
|
|
11
11
|
useMergeRefs,
|
|
12
12
|
__experimentalUseFixedWindowList as useFixedWindowList,
|
|
13
13
|
} from '@wordpress/compose';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
VisuallyHidden,
|
|
17
|
-
} from '@wordpress/components';
|
|
14
|
+
import { __experimentalTreeGrid as TreeGrid } from '@wordpress/components';
|
|
15
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
18
16
|
import { AsyncModeProvider, useSelect } from '@wordpress/data';
|
|
19
17
|
import deprecated from '@wordpress/deprecated';
|
|
20
18
|
import {
|
|
@@ -469,7 +469,7 @@ $block-navigation-max-indent: 8;
|
|
|
469
469
|
.block-editor-list-view__expander {
|
|
470
470
|
height: $icon-size;
|
|
471
471
|
width: $icon-size;
|
|
472
|
-
cursor:
|
|
472
|
+
cursor: var(--wpds-cursor-control);
|
|
473
473
|
}
|
|
474
474
|
|
|
475
475
|
.block-editor-list-view-leaf[aria-level] .block-editor-list-view__expander {
|
|
@@ -168,12 +168,18 @@ export default function PresetInputControl( {
|
|
|
168
168
|
unitConfig?.max ?? customValueSettings[ computedUnit ]?.max ?? 10;
|
|
169
169
|
|
|
170
170
|
const handleCustomValueChange = ( newValue ) => {
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
// Treat empty or undefined as an explicit clear and propagate undefined.
|
|
172
|
+
if ( newValue === undefined || newValue === '' ) {
|
|
173
|
+
onChange( undefined );
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
173
176
|
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
// Ignore non-numeric intermediate input (e.g. just a unit).
|
|
178
|
+
if ( isNaN( parseFloat( newValue ) ) ) {
|
|
179
|
+
return;
|
|
176
180
|
}
|
|
181
|
+
|
|
182
|
+
onChange( newValue );
|
|
177
183
|
};
|
|
178
184
|
const handleCustomValueSliderChange = ( next ) => {
|
|
179
185
|
onChange( [ next, computedUnit ].join( '' ) );
|
|
@@ -92,6 +92,76 @@ describe( 'PresetInputControl', () => {
|
|
|
92
92
|
expect( mockOnChange ).toHaveBeenCalledWith( '25px' );
|
|
93
93
|
} );
|
|
94
94
|
|
|
95
|
+
it( 'clears value with undefined when input is fully erased via backspace', () => {
|
|
96
|
+
render(
|
|
97
|
+
<PresetInputControl
|
|
98
|
+
{ ...defaultProps }
|
|
99
|
+
presets={ presets }
|
|
100
|
+
value="60px"
|
|
101
|
+
disableCustomValues={ false }
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const input = screen.getByRole( 'spinbutton' );
|
|
106
|
+
|
|
107
|
+
// Simulate the bug scenario: backspace through "60" one character
|
|
108
|
+
// at a time. fireEvent.change is used here (rather than userEvent
|
|
109
|
+
// keyboard interactions) because the controlled UnitControl input
|
|
110
|
+
// does not respond to synthesised key events in jsdom. The
|
|
111
|
+
// intermediate "6" forwarding is expected and correct; the bug
|
|
112
|
+
// was that the final clear silently failed to propagate, leaving
|
|
113
|
+
// the parent stuck on the partial value.
|
|
114
|
+
fireEvent.change( input, { target: { value: '6' } } );
|
|
115
|
+
fireEvent.change( input, { target: { value: '' } } );
|
|
116
|
+
|
|
117
|
+
// The final clear must propagate as undefined, not be swallowed,
|
|
118
|
+
// and never be persisted as an empty string.
|
|
119
|
+
expect( mockOnChange ).toHaveBeenLastCalledWith( undefined );
|
|
120
|
+
expect( mockOnChange ).not.toHaveBeenCalledWith( '' );
|
|
121
|
+
} );
|
|
122
|
+
|
|
123
|
+
it( 'clears value with undefined when input is cleared in one shot', async () => {
|
|
124
|
+
const user = userEvent.setup();
|
|
125
|
+
|
|
126
|
+
render(
|
|
127
|
+
<PresetInputControl
|
|
128
|
+
{ ...defaultProps }
|
|
129
|
+
presets={ presets }
|
|
130
|
+
value="25px"
|
|
131
|
+
disableCustomValues={ false }
|
|
132
|
+
/>
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const input = screen.getByRole( 'spinbutton' );
|
|
136
|
+
await user.clear( input );
|
|
137
|
+
|
|
138
|
+
expect( mockOnChange ).toHaveBeenCalledWith( undefined );
|
|
139
|
+
expect( mockOnChange ).not.toHaveBeenCalledWith( '' );
|
|
140
|
+
} );
|
|
141
|
+
|
|
142
|
+
it( 'does not call onChange for non-numeric intermediate input', async () => {
|
|
143
|
+
const user = userEvent.setup();
|
|
144
|
+
|
|
145
|
+
render(
|
|
146
|
+
<PresetInputControl
|
|
147
|
+
{ ...defaultProps }
|
|
148
|
+
presets={ presets }
|
|
149
|
+
value="15px"
|
|
150
|
+
disableCustomValues={ false }
|
|
151
|
+
/>
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
const input = screen.getByRole( 'spinbutton' );
|
|
155
|
+
await user.clear( input );
|
|
156
|
+
mockOnChange.mockClear();
|
|
157
|
+
|
|
158
|
+
// Typing a stray non-numeric character should not propagate a change.
|
|
159
|
+
await user.type( input, 'a' );
|
|
160
|
+
|
|
161
|
+
expect( mockOnChange ).not.toHaveBeenCalledWith( 'a' );
|
|
162
|
+
expect( mockOnChange ).not.toHaveBeenCalledWith( 'apx' );
|
|
163
|
+
} );
|
|
164
|
+
|
|
95
165
|
it( 'uses select dropdown for many presets', async () => {
|
|
96
166
|
const manyPresets = Array.from( { length: 12 }, ( _, i ) => ( {
|
|
97
167
|
name: `Preset ${ i + 1 }`,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
MediaUploadProvider,
|
|
9
9
|
store as uploadStore,
|
|
10
10
|
detectClientSideMediaSupport,
|
|
11
|
+
isHeicCanvasSupported,
|
|
11
12
|
} from '@wordpress/upload-media';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -38,6 +39,17 @@ let hasLoggedFallback = false;
|
|
|
38
39
|
*/
|
|
39
40
|
let isClientSideMediaEnabledCache = null;
|
|
40
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Cached result of whether HEIC-only canvas processing should be enabled.
|
|
44
|
+
*/
|
|
45
|
+
let isHeicCanvasEnabledCache = null;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* HEIC MIME types that should be routed through the upload-media pipeline
|
|
49
|
+
* when in HEIC-only mode.
|
|
50
|
+
*/
|
|
51
|
+
const HEIC_MIME_TYPES = [ 'image/heic', 'image/heif' ];
|
|
52
|
+
|
|
41
53
|
/**
|
|
42
54
|
* Checks if client-side media processing should be enabled.
|
|
43
55
|
*
|
|
@@ -85,6 +97,44 @@ function shouldEnableClientSideMediaProcessing() {
|
|
|
85
97
|
return true;
|
|
86
98
|
}
|
|
87
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Checks if HEIC-only canvas processing should be enabled.
|
|
102
|
+
*
|
|
103
|
+
* Returns true when:
|
|
104
|
+
* 1. Full client-side processing is NOT available (otherwise it handles HEIC already)
|
|
105
|
+
* 2. The server has set the __heicUploadSupport flag
|
|
106
|
+
* 3. The browser supports createImageBitmap + OffscreenCanvas (e.g. Safari)
|
|
107
|
+
*
|
|
108
|
+
* @return {boolean} Whether HEIC-only canvas processing should be enabled.
|
|
109
|
+
*/
|
|
110
|
+
function shouldEnableHeicCanvasProcessing() {
|
|
111
|
+
if ( isHeicCanvasEnabledCache !== null ) {
|
|
112
|
+
return isHeicCanvasEnabledCache;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// If full client-side processing is enabled, it already handles HEIC.
|
|
116
|
+
if ( shouldEnableClientSideMediaProcessing() ) {
|
|
117
|
+
isHeicCanvasEnabledCache = false;
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if ( ! window.__heicUploadSupport ) {
|
|
122
|
+
isHeicCanvasEnabledCache = false;
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (
|
|
127
|
+
typeof isHeicCanvasSupported !== 'function' ||
|
|
128
|
+
! isHeicCanvasSupported()
|
|
129
|
+
) {
|
|
130
|
+
isHeicCanvasEnabledCache = false;
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
isHeicCanvasEnabledCache = true;
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
|
|
88
138
|
/**
|
|
89
139
|
* Upload a media file when the file upload button is activated
|
|
90
140
|
* or when adding a file to the editor via drag & drop.
|
|
@@ -128,6 +178,92 @@ function mediaUpload(
|
|
|
128
178
|
} );
|
|
129
179
|
}
|
|
130
180
|
|
|
181
|
+
/**
|
|
182
|
+
* Upload interceptor for HEIC-only mode.
|
|
183
|
+
*
|
|
184
|
+
* Routes HEIC files through the upload-media pipeline for canvas-based
|
|
185
|
+
* conversion, while passing non-HEIC files to the original mediaUpload
|
|
186
|
+
* function for standard server-side processing.
|
|
187
|
+
*
|
|
188
|
+
* @param {WPDataRegistry} registry
|
|
189
|
+
* @param {Object} settings Block editor settings.
|
|
190
|
+
* @param {Object} $3 Parameters object passed to the function.
|
|
191
|
+
* @param {Array} $3.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.
|
|
192
|
+
* @param {Object} $3.additionalData Additional data to include in the request.
|
|
193
|
+
* @param {Array<File>} $3.filesList List of files.
|
|
194
|
+
* @param {Function} $3.onError Function called when an error happens.
|
|
195
|
+
* @param {Function} $3.onFileChange Function called each time a file or a temporary representation of the file is available.
|
|
196
|
+
* @param {Function} $3.onSuccess Function called once a file has completely finished uploading, including thumbnails.
|
|
197
|
+
* @param {Function} $3.onBatchSuccess Function called once all files in a group have completely finished uploading, including thumbnails.
|
|
198
|
+
*/
|
|
199
|
+
function heicMediaUpload(
|
|
200
|
+
registry,
|
|
201
|
+
settings,
|
|
202
|
+
{
|
|
203
|
+
allowedTypes,
|
|
204
|
+
additionalData = {},
|
|
205
|
+
filesList,
|
|
206
|
+
onError = noop,
|
|
207
|
+
onFileChange,
|
|
208
|
+
onSuccess,
|
|
209
|
+
onBatchSuccess,
|
|
210
|
+
}
|
|
211
|
+
) {
|
|
212
|
+
const files = Array.from( filesList );
|
|
213
|
+
const heicFiles = files.filter( ( file ) =>
|
|
214
|
+
HEIC_MIME_TYPES.includes( file.type )
|
|
215
|
+
);
|
|
216
|
+
const otherFiles = files.filter(
|
|
217
|
+
( file ) => ! HEIC_MIME_TYPES.includes( file.type )
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
// When the batch contains both HEIC and non-HEIC files, coordinate
|
|
221
|
+
// onBatchSuccess so it fires only after *both* paths have completed.
|
|
222
|
+
const hasBothPaths =
|
|
223
|
+
heicFiles.length > 0 && otherFiles.length > 0 && settings?.mediaUpload;
|
|
224
|
+
let pathsRemaining = hasBothPaths ? 2 : 1;
|
|
225
|
+
const coordinatedBatchSuccess = hasBothPaths
|
|
226
|
+
? () => {
|
|
227
|
+
pathsRemaining--;
|
|
228
|
+
if ( pathsRemaining <= 0 ) {
|
|
229
|
+
onBatchSuccess?.();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
: onBatchSuccess;
|
|
233
|
+
|
|
234
|
+
// Route HEIC files through the upload-media pipeline.
|
|
235
|
+
if ( heicFiles.length > 0 ) {
|
|
236
|
+
void registry.dispatch( uploadStore ).addItems( {
|
|
237
|
+
files: heicFiles,
|
|
238
|
+
onChange: onFileChange,
|
|
239
|
+
onSuccess: ( attachments ) => {
|
|
240
|
+
settings?.[ mediaUploadOnSuccessKey ]?.( attachments );
|
|
241
|
+
onSuccess?.( attachments );
|
|
242
|
+
},
|
|
243
|
+
onBatchSuccess: coordinatedBatchSuccess,
|
|
244
|
+
onError: ( error ) =>
|
|
245
|
+
onError(
|
|
246
|
+
typeof error === 'string' ? error : error?.message ?? ''
|
|
247
|
+
),
|
|
248
|
+
additionalData,
|
|
249
|
+
allowedTypes,
|
|
250
|
+
} );
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Pass non-HEIC files to the original server-side upload function.
|
|
254
|
+
if ( otherFiles.length > 0 && settings?.mediaUpload ) {
|
|
255
|
+
settings.mediaUpload( {
|
|
256
|
+
allowedTypes,
|
|
257
|
+
additionalData,
|
|
258
|
+
filesList: otherFiles,
|
|
259
|
+
onError,
|
|
260
|
+
onFileChange,
|
|
261
|
+
onSuccess,
|
|
262
|
+
onBatchSuccess: coordinatedBatchSuccess,
|
|
263
|
+
} );
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
131
267
|
/**
|
|
132
268
|
* Calls useBlockSync as a child of SelectionContext.Provider so that the
|
|
133
269
|
* hook can read selection state from the context provided by this tree
|
|
@@ -152,6 +288,9 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(
|
|
|
152
288
|
|
|
153
289
|
const isClientSideMediaEnabled =
|
|
154
290
|
shouldEnableClientSideMediaProcessing();
|
|
291
|
+
const isHeicCanvasEnabled = shouldEnableHeicCanvasProcessing();
|
|
292
|
+
const useUploadMediaPipeline =
|
|
293
|
+
isClientSideMediaEnabled || isHeicCanvasEnabled;
|
|
155
294
|
|
|
156
295
|
// Nested providers (e.g. from useBlockPreview) inherit settings
|
|
157
296
|
// where mediaUpload has already been replaced with the
|
|
@@ -162,16 +301,17 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(
|
|
|
162
301
|
|
|
163
302
|
const settings = useMemo( () => {
|
|
164
303
|
if (
|
|
165
|
-
|
|
304
|
+
useUploadMediaPipeline &&
|
|
166
305
|
_settings?.mediaUpload &&
|
|
167
306
|
! isMediaUploadIntercepted
|
|
168
307
|
) {
|
|
169
|
-
//
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
308
|
+
// Choose the right interceptor:
|
|
309
|
+
// - Full mode: all uploads go through upload-media pipeline.
|
|
310
|
+
// - HEIC-only mode: only HEIC files go through, rest use legacy path.
|
|
311
|
+
const uploadFn = isClientSideMediaEnabled
|
|
312
|
+
? mediaUpload
|
|
313
|
+
: heicMediaUpload;
|
|
314
|
+
const interceptor = uploadFn.bind( null, registry, _settings );
|
|
175
315
|
interceptor.__isMediaUploadInterceptor = true;
|
|
176
316
|
return {
|
|
177
317
|
..._settings,
|
|
@@ -182,6 +322,7 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(
|
|
|
182
322
|
}, [
|
|
183
323
|
_settings,
|
|
184
324
|
registry,
|
|
325
|
+
useUploadMediaPipeline,
|
|
185
326
|
isClientSideMediaEnabled,
|
|
186
327
|
isMediaUploadIntercepted,
|
|
187
328
|
] );
|
|
@@ -258,7 +399,7 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(
|
|
|
258
399
|
// overwrite the store's server-side function with the
|
|
259
400
|
// interceptor, causing uploads to loop instead of reaching
|
|
260
401
|
// the server.
|
|
261
|
-
if (
|
|
402
|
+
if ( useUploadMediaPipeline && ! isMediaUploadIntercepted ) {
|
|
262
403
|
return (
|
|
263
404
|
<MediaUploadProvider
|
|
264
405
|
settings={ mediaUploadSettings }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useInstanceId } from '@wordpress/compose';
|
|
5
|
-
import { VisuallyHidden } from '@wordpress/
|
|
5
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
6
6
|
import { _x, sprintf } from '@wordpress/i18n';
|
|
7
7
|
|
|
8
8
|
export default function ResponsiveBlockControlLabel( {
|
|
@@ -27,7 +27,10 @@ export default function ResponsiveBlockControlLabel( {
|
|
|
27
27
|
<span aria-describedby={ `rbc-desc-${ instanceId }` }>
|
|
28
28
|
{ viewport.label }
|
|
29
29
|
</span>
|
|
30
|
-
<VisuallyHidden
|
|
30
|
+
<VisuallyHidden
|
|
31
|
+
id={ `rbc-desc-${ instanceId }` }
|
|
32
|
+
render={ <span /> }
|
|
33
|
+
>
|
|
31
34
|
{ accessibleLabel }
|
|
32
35
|
</VisuallyHidden>
|
|
33
36
|
</>
|
|
@@ -36,6 +36,7 @@ const allEventListeners = [
|
|
|
36
36
|
export function useEventListeners( props ) {
|
|
37
37
|
const propsRef = useRef( props );
|
|
38
38
|
useInsertionEffect( () => {
|
|
39
|
+
// eslint-disable-next-line react-compiler/react-compiler -- false positive, see https://github.com/facebook/react/issues/29196
|
|
39
40
|
propsRef.current = props;
|
|
40
41
|
} );
|
|
41
42
|
const refEffects = useMemo(
|
|
@@ -8,6 +8,7 @@ import { isURL } from '@wordpress/url';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
+
import { store as blockEditorStore } from '../../../store';
|
|
11
12
|
import { addActiveFormats } from '../utils';
|
|
12
13
|
import { getPasteEventData } from '../../../utils/pasting';
|
|
13
14
|
|
|
@@ -25,6 +26,7 @@ export default ( props ) => ( element ) => {
|
|
|
25
26
|
__unstableEmbedURLOnPaste,
|
|
26
27
|
preserveWhiteSpace,
|
|
27
28
|
pastePlainText,
|
|
29
|
+
registry,
|
|
28
30
|
} = props.current;
|
|
29
31
|
|
|
30
32
|
// The event listener is attached to the window, so we need to check if
|
|
@@ -116,11 +118,23 @@ export default ( props ) => ( element ) => {
|
|
|
116
118
|
|
|
117
119
|
if ( typeof content === 'string' ) {
|
|
118
120
|
pasteInline( content );
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if ( ! content.length || ! onReplace || ! isEmpty( value ) ) {
|
|
125
|
+
return;
|
|
123
126
|
}
|
|
127
|
+
|
|
128
|
+
// Record an intermediate paragraph-with-URL state so a single undo
|
|
129
|
+
// after the URL → block transformation restores the pasted link.
|
|
130
|
+
if ( mode === 'BLOCKS' ) {
|
|
131
|
+
pasteInline( html );
|
|
132
|
+
registry
|
|
133
|
+
.dispatch( blockEditorStore )
|
|
134
|
+
.__unstableMarkLastChangeAsPersistent();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
onReplace( content, content.length - 1, -1 );
|
|
124
138
|
}
|
|
125
139
|
|
|
126
140
|
const { defaultView } = element.ownerDocument;
|