@wordpress/block-editor 14.15.0 → 14.17.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 +4 -0
- package/build/components/background-image-control/index.js +18 -10
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +3 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-list/block.js +4 -2
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +14 -11
- package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +1 -1
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-tools/index.js +9 -0
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +3 -2
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/global-styles/border-panel.js +4 -8
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +3 -0
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +1 -7
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +9 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/link-control/index.js +2 -0
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +2 -3
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block.js +9 -0
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +21 -14
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/spacing-visualizer.js +14 -8
- package/build/hooks/spacing-visualizer.js.map +1 -1
- package/build-module/components/background-image-control/index.js +19 -11
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +3 -1
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-list/block.js +4 -2
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +14 -11
- package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-tools/index.js +9 -0
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +3 -2
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +5 -9
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +4 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +1 -7
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +9 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/link-control/index.js +4 -1
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +2 -3
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block.js +9 -0
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +21 -14
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/spacing-visualizer.js +15 -9
- package/build-module/hooks/spacing-visualizer.js.map +1 -1
- package/build-style/style-rtl.css +3 -6
- package/build-style/style.css +3 -6
- package/package.json +34 -34
- package/src/components/background-image-control/index.js +22 -7
- package/src/components/block-breadcrumb/index.js +1 -1
- package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +3 -1
- package/src/components/block-list/block.js +6 -2
- package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +14 -11
- package/src/components/block-switcher/preview-block-popover.js +4 -1
- package/src/components/block-tools/index.js +9 -0
- package/src/components/block-tools/use-show-block-tools.js +2 -0
- package/src/components/global-styles/border-panel.js +5 -8
- package/src/components/global-styles/style.scss +2 -5
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +7 -0
- package/src/components/inserter/media-tab/media-preview.js +1 -8
- package/src/components/inserter/style.scss +1 -1
- package/src/components/keyboard-shortcuts/index.js +12 -0
- package/src/components/link-control/index.js +6 -1
- package/src/components/link-control/search-input.js +2 -4
- package/src/components/link-control/test/index.js +46 -46
- package/src/components/list-view/block.js +10 -0
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/writing-flow/use-tab-nav.js +22 -17
- package/src/hooks/spacing-visualizer.js +14 -17
package/build-style/style.css
CHANGED
|
@@ -1739,6 +1739,8 @@ iframe[name=editor-canvas] {
|
|
|
1739
1739
|
display: block;
|
|
1740
1740
|
padding: 0;
|
|
1741
1741
|
position: relative;
|
|
1742
|
+
border: 1px solid #ddd;
|
|
1743
|
+
border-radius: 2px;
|
|
1742
1744
|
}
|
|
1743
1745
|
|
|
1744
1746
|
.block-editor-global-styles-filters-panel__dropdown-toggle,
|
|
@@ -1772,11 +1774,6 @@ iframe[name=editor-canvas] {
|
|
|
1772
1774
|
}
|
|
1773
1775
|
}
|
|
1774
1776
|
|
|
1775
|
-
.block-editor-global-styles-filters-panel__dropdown {
|
|
1776
|
-
border: 1px solid #ddd;
|
|
1777
|
-
border-radius: 2px;
|
|
1778
|
-
}
|
|
1779
|
-
|
|
1780
1777
|
.block-editor-global-styles__shadow-indicator {
|
|
1781
1778
|
appearance: none;
|
|
1782
1779
|
background: none;
|
|
@@ -4137,7 +4134,7 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4137
4134
|
width: 280px;
|
|
4138
4135
|
padding: 24px 32px 32px;
|
|
4139
4136
|
overflow-x: visible;
|
|
4140
|
-
overflow-y:
|
|
4137
|
+
overflow-y: auto;
|
|
4141
4138
|
}
|
|
4142
4139
|
.block-editor-block-patterns-explorer__sidebar__categories-list__item {
|
|
4143
4140
|
display: block;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.17.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,38 +37,38 @@
|
|
|
37
37
|
"@emotion/react": "^11.7.1",
|
|
38
38
|
"@emotion/styled": "^11.6.0",
|
|
39
39
|
"@react-spring/web": "^9.4.5",
|
|
40
|
-
"@wordpress/a11y": "^4.
|
|
41
|
-
"@wordpress/api-fetch": "^7.
|
|
42
|
-
"@wordpress/blob": "^4.
|
|
43
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
44
|
-
"@wordpress/blocks": "^14.
|
|
45
|
-
"@wordpress/commands": "^1.
|
|
46
|
-
"@wordpress/components": "^29.
|
|
47
|
-
"@wordpress/compose": "^7.
|
|
48
|
-
"@wordpress/data": "^10.
|
|
49
|
-
"@wordpress/date": "^5.
|
|
50
|
-
"@wordpress/deprecated": "^4.
|
|
51
|
-
"@wordpress/dom": "^4.
|
|
52
|
-
"@wordpress/element": "^6.
|
|
53
|
-
"@wordpress/escape-html": "^3.
|
|
54
|
-
"@wordpress/hooks": "^4.
|
|
55
|
-
"@wordpress/html-entities": "^4.
|
|
56
|
-
"@wordpress/i18n": "^5.
|
|
57
|
-
"@wordpress/icons": "^10.
|
|
58
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
59
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
60
|
-
"@wordpress/keycodes": "^4.
|
|
61
|
-
"@wordpress/notices": "^5.
|
|
62
|
-
"@wordpress/preferences": "^4.
|
|
63
|
-
"@wordpress/priority-queue": "^3.
|
|
64
|
-
"@wordpress/private-apis": "^1.
|
|
65
|
-
"@wordpress/rich-text": "^7.
|
|
66
|
-
"@wordpress/style-engine": "^2.
|
|
67
|
-
"@wordpress/token-list": "^3.
|
|
68
|
-
"@wordpress/upload-media": "^0.
|
|
69
|
-
"@wordpress/url": "^4.
|
|
70
|
-
"@wordpress/warning": "^3.
|
|
71
|
-
"@wordpress/wordcount": "^4.
|
|
40
|
+
"@wordpress/a11y": "^4.22.0",
|
|
41
|
+
"@wordpress/api-fetch": "^7.22.0",
|
|
42
|
+
"@wordpress/blob": "^4.22.0",
|
|
43
|
+
"@wordpress/block-serialization-default-parser": "^5.22.0",
|
|
44
|
+
"@wordpress/blocks": "^14.11.0",
|
|
45
|
+
"@wordpress/commands": "^1.22.0",
|
|
46
|
+
"@wordpress/components": "^29.8.0",
|
|
47
|
+
"@wordpress/compose": "^7.22.0",
|
|
48
|
+
"@wordpress/data": "^10.22.0",
|
|
49
|
+
"@wordpress/date": "^5.22.0",
|
|
50
|
+
"@wordpress/deprecated": "^4.22.0",
|
|
51
|
+
"@wordpress/dom": "^4.22.0",
|
|
52
|
+
"@wordpress/element": "^6.22.0",
|
|
53
|
+
"@wordpress/escape-html": "^3.22.0",
|
|
54
|
+
"@wordpress/hooks": "^4.22.0",
|
|
55
|
+
"@wordpress/html-entities": "^4.22.0",
|
|
56
|
+
"@wordpress/i18n": "^5.22.0",
|
|
57
|
+
"@wordpress/icons": "^10.22.0",
|
|
58
|
+
"@wordpress/is-shallow-equal": "^5.22.0",
|
|
59
|
+
"@wordpress/keyboard-shortcuts": "^5.22.0",
|
|
60
|
+
"@wordpress/keycodes": "^4.22.0",
|
|
61
|
+
"@wordpress/notices": "^5.22.0",
|
|
62
|
+
"@wordpress/preferences": "^4.22.0",
|
|
63
|
+
"@wordpress/priority-queue": "^3.22.0",
|
|
64
|
+
"@wordpress/private-apis": "^1.22.0",
|
|
65
|
+
"@wordpress/rich-text": "^7.22.0",
|
|
66
|
+
"@wordpress/style-engine": "^2.22.0",
|
|
67
|
+
"@wordpress/token-list": "^3.22.0",
|
|
68
|
+
"@wordpress/upload-media": "^0.7.0",
|
|
69
|
+
"@wordpress/url": "^4.22.0",
|
|
70
|
+
"@wordpress/warning": "^3.22.0",
|
|
71
|
+
"@wordpress/wordcount": "^4.22.0",
|
|
72
72
|
"change-case": "^4.1.2",
|
|
73
73
|
"clsx": "^2.1.1",
|
|
74
74
|
"colord": "^2.7.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "01a314d7e46a50101e328fdb11959c441e49372d"
|
|
95
95
|
}
|
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
FocalPointPicker,
|
|
18
18
|
MenuItem,
|
|
19
19
|
VisuallyHidden,
|
|
20
|
-
__experimentalItemGroup as ItemGroup,
|
|
21
20
|
__experimentalHStack as HStack,
|
|
22
21
|
__experimentalTruncate as Truncate,
|
|
23
22
|
Dropdown,
|
|
@@ -119,13 +118,16 @@ function InspectorImagePreviewItem( {
|
|
|
119
118
|
className,
|
|
120
119
|
onToggleCallback = noop,
|
|
121
120
|
} ) {
|
|
121
|
+
const { isOpen, ...restToggleProps } = toggleProps;
|
|
122
|
+
|
|
122
123
|
useEffect( () => {
|
|
123
|
-
if ( typeof
|
|
124
|
-
onToggleCallback(
|
|
124
|
+
if ( typeof isOpen !== 'undefined' ) {
|
|
125
|
+
onToggleCallback( isOpen );
|
|
125
126
|
}
|
|
126
|
-
}, [
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
}, [ isOpen, onToggleCallback ] );
|
|
128
|
+
|
|
129
|
+
const renderPreviewContent = () => {
|
|
130
|
+
return (
|
|
129
131
|
<HStack
|
|
130
132
|
justify="flex-start"
|
|
131
133
|
as="span"
|
|
@@ -162,7 +164,20 @@ function InspectorImagePreviewItem( {
|
|
|
162
164
|
</VisuallyHidden>
|
|
163
165
|
</FlexItem>
|
|
164
166
|
</HStack>
|
|
165
|
-
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
return as === 'button' ? (
|
|
171
|
+
<Button
|
|
172
|
+
__next40pxDefaultSize
|
|
173
|
+
className={ className }
|
|
174
|
+
{ ...restToggleProps }
|
|
175
|
+
aria-expanded={ isOpen }
|
|
176
|
+
>
|
|
177
|
+
{ renderPreviewContent() }
|
|
178
|
+
</Button>
|
|
179
|
+
) : (
|
|
180
|
+
renderPreviewContent()
|
|
166
181
|
);
|
|
167
182
|
}
|
|
168
183
|
|
|
@@ -262,15 +262,19 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {
|
|
|
262
262
|
// Do not add new properties here, use `useDispatch` instead to avoid
|
|
263
263
|
// leaking new props to the public API (editor.BlockListBlock filter).
|
|
264
264
|
return {
|
|
265
|
-
setAttributes(
|
|
265
|
+
setAttributes( nextAttributes ) {
|
|
266
266
|
const { getMultiSelectedBlockClientIds } =
|
|
267
267
|
registry.select( blockEditorStore );
|
|
268
268
|
const multiSelectedBlockClientIds =
|
|
269
269
|
getMultiSelectedBlockClientIds();
|
|
270
|
-
const { clientId } = ownProps;
|
|
270
|
+
const { clientId, attributes } = ownProps;
|
|
271
271
|
const clientIds = multiSelectedBlockClientIds.length
|
|
272
272
|
? multiSelectedBlockClientIds
|
|
273
273
|
: [ clientId ];
|
|
274
|
+
const newAttributes =
|
|
275
|
+
typeof nextAttributes === 'function'
|
|
276
|
+
? nextAttributes( attributes )
|
|
277
|
+
: nextAttributes;
|
|
274
278
|
|
|
275
279
|
updateBlockAttributes( clientIds, newAttributes );
|
|
276
280
|
},
|
|
@@ -41,12 +41,15 @@ function restore( node ) {
|
|
|
41
41
|
|
|
42
42
|
function down( event ) {
|
|
43
43
|
const { target } = event;
|
|
44
|
-
const { ownerDocument, isContentEditable } = target;
|
|
44
|
+
const { ownerDocument, isContentEditable, tagName } = target;
|
|
45
|
+
const isInputOrTextArea = [ 'INPUT', 'TEXTAREA' ].includes( tagName );
|
|
46
|
+
|
|
45
47
|
const nodes = nodesByDocument.get( ownerDocument );
|
|
46
48
|
|
|
47
|
-
if ( isContentEditable ) {
|
|
48
|
-
// Whenever an editable element is clicked,
|
|
49
|
-
// blocks contain this element, and temporarily
|
|
49
|
+
if ( isContentEditable || isInputOrTextArea ) {
|
|
50
|
+
// Whenever an editable element or an input or textarea is clicked,
|
|
51
|
+
// check which draggable blocks contain this element, and temporarily
|
|
52
|
+
// disable draggability.
|
|
50
53
|
for ( const node of nodes ) {
|
|
51
54
|
if (
|
|
52
55
|
node.getAttribute( 'draggable' ) === 'true' &&
|
|
@@ -57,8 +60,8 @@ function down( event ) {
|
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
} else {
|
|
60
|
-
// Whenever a non-editable element is clicked,
|
|
61
|
-
// for any blocks that were previously disabled.
|
|
63
|
+
// Whenever a non-editable element or an input or textarea is clicked,
|
|
64
|
+
// re-enable draggability for any blocks that were previously disabled.
|
|
62
65
|
for ( const node of nodes ) {
|
|
63
66
|
restore( node );
|
|
64
67
|
}
|
|
@@ -66,11 +69,11 @@ function down( event ) {
|
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
/**
|
|
69
|
-
* In Firefox, the `draggable` and `contenteditable`
|
|
70
|
-
* together. When
|
|
71
|
-
* doesn't get set in the right place. The only
|
|
72
|
-
* remove the `draggable` attribute clicking inside
|
|
73
|
-
*
|
|
72
|
+
* In Firefox, the `draggable` and `contenteditable` or `input` or `textarea`
|
|
73
|
+
* elements don't play well together. When these elements are within a
|
|
74
|
+
* `draggable` element, selection doesn't get set in the right place. The only
|
|
75
|
+
* solution is to temporarily remove the `draggable` attribute clicking inside
|
|
76
|
+
* these elements.
|
|
74
77
|
* @return {Function} Cleanup function.
|
|
75
78
|
*/
|
|
76
79
|
export function useFirefoxDraggableCompatibility() {
|
|
@@ -29,7 +29,10 @@ export default function PreviewBlockPopover( { blocks } ) {
|
|
|
29
29
|
<div className="block-editor-block-switcher__preview-title">
|
|
30
30
|
{ __( 'Preview' ) }
|
|
31
31
|
</div>
|
|
32
|
-
|
|
32
|
+
{ /* 600px is the value of $break-small in base-styles/_breakpoints.scss.
|
|
33
|
+
We set the viewport width to 601px to make sure that the media-text
|
|
34
|
+
block which uses this breakpoint has the correct padding. */ }
|
|
35
|
+
<BlockPreview viewportWidth={ 601 } blocks={ blocks } />
|
|
33
36
|
</div>
|
|
34
37
|
</Popover>
|
|
35
38
|
</div>
|
|
@@ -24,6 +24,7 @@ import usePopoverScroll from '../block-popover/use-popover-scroll';
|
|
|
24
24
|
import ZoomOutModeInserters from './zoom-out-mode-inserters';
|
|
25
25
|
import { useShowBlockTools } from './use-show-block-tools';
|
|
26
26
|
import { unlock } from '../../lock-unlock';
|
|
27
|
+
import usePasteStyles from '../use-paste-styles';
|
|
27
28
|
|
|
28
29
|
function selector( select ) {
|
|
29
30
|
const {
|
|
@@ -74,6 +75,7 @@ export default function BlockTools( {
|
|
|
74
75
|
const { getGroupingBlockName } = useSelect( blocksStore );
|
|
75
76
|
const { showEmptyBlockSideInserter, showBlockToolbarPopover } =
|
|
76
77
|
useShowBlockTools();
|
|
78
|
+
const pasteStyles = usePasteStyles();
|
|
77
79
|
|
|
78
80
|
const {
|
|
79
81
|
duplicateBlocks,
|
|
@@ -134,6 +136,13 @@ export default function BlockTools( {
|
|
|
134
136
|
event.preventDefault();
|
|
135
137
|
removeBlocks( clientIds );
|
|
136
138
|
}
|
|
139
|
+
} else if ( isMatch( 'core/block-editor/paste-styles', event ) ) {
|
|
140
|
+
const clientIds = getSelectedBlockClientIds();
|
|
141
|
+
if ( clientIds.length ) {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
const blocks = getBlocksByClientId( clientIds );
|
|
144
|
+
pasteStyles( blocks );
|
|
145
|
+
}
|
|
137
146
|
} else if ( isMatch( 'core/block-editor/insert-after', event ) ) {
|
|
138
147
|
const clientIds = getSelectedBlockClientIds();
|
|
139
148
|
if ( clientIds.length ) {
|
|
@@ -25,6 +25,7 @@ export function useShowBlockTools() {
|
|
|
25
25
|
getSettings,
|
|
26
26
|
__unstableGetEditorMode,
|
|
27
27
|
isTyping,
|
|
28
|
+
isBlockInterfaceHidden,
|
|
28
29
|
} = unlock( select( blockEditorStore ) );
|
|
29
30
|
|
|
30
31
|
const clientId =
|
|
@@ -45,6 +46,7 @@ export function useShowBlockTools() {
|
|
|
45
46
|
editorMode !== 'navigation' &&
|
|
46
47
|
isEmptyDefaultBlock;
|
|
47
48
|
const _showBlockToolbarPopover =
|
|
49
|
+
! isBlockInterfaceHidden() &&
|
|
48
50
|
! getSettings().hasFixedToolbar &&
|
|
49
51
|
! _showEmptyBlockSideInserter &&
|
|
50
52
|
hasSelectedBlock &&
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
__experimentalIsDefinedBorder as isDefinedBorder,
|
|
8
8
|
__experimentalToolsPanel as ToolsPanel,
|
|
9
9
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
10
|
-
__experimentalItemGroup as ItemGroup,
|
|
11
10
|
BaseControl,
|
|
12
11
|
} from '@wordpress/components';
|
|
13
12
|
import { useCallback, useMemo } from '@wordpress/element';
|
|
@@ -298,13 +297,11 @@ export default function BorderPanel( {
|
|
|
298
297
|
</BaseControl.VisualLabel>
|
|
299
298
|
) : null }
|
|
300
299
|
|
|
301
|
-
<
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
/>
|
|
307
|
-
</ItemGroup>
|
|
300
|
+
<ShadowPopover
|
|
301
|
+
shadow={ shadow }
|
|
302
|
+
onShadowChange={ setShadow }
|
|
303
|
+
settings={ settings }
|
|
304
|
+
/>
|
|
308
305
|
</ToolsPanelItem>
|
|
309
306
|
) }
|
|
310
307
|
</Wrapper>
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
display: block;
|
|
26
26
|
padding: 0;
|
|
27
27
|
position: relative;
|
|
28
|
+
border: 1px solid $gray-300;
|
|
29
|
+
border-radius: $radius-small;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
.block-editor-global-styles-filters-panel__dropdown-toggle,
|
|
@@ -59,11 +61,6 @@
|
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
.block-editor-global-styles-filters-panel__dropdown {
|
|
63
|
-
border: 1px solid $gray-300;
|
|
64
|
-
border-radius: $radius-small;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
64
|
// These styles are similar to the color palette.
|
|
68
65
|
.block-editor-global-styles__shadow-indicator {
|
|
69
66
|
appearance: none;
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
INSERTER_PATTERN_TYPES,
|
|
22
22
|
allPatternsCategory,
|
|
23
23
|
myPatternsCategory,
|
|
24
|
+
starterPatternsCategory,
|
|
24
25
|
} from '../block-patterns-tab/utils';
|
|
25
26
|
|
|
26
27
|
function PatternsListHeader( { filterValue, filteredBlockPatternsLength } ) {
|
|
@@ -85,6 +86,12 @@ function PatternList( {
|
|
|
85
86
|
) {
|
|
86
87
|
return true;
|
|
87
88
|
}
|
|
89
|
+
if (
|
|
90
|
+
selectedCategory === starterPatternsCategory.name &&
|
|
91
|
+
pattern.blockTypes?.includes( 'core/post-content' )
|
|
92
|
+
) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
88
95
|
if ( selectedCategory === 'uncategorized' ) {
|
|
89
96
|
const hasKnownCategory =
|
|
90
97
|
pattern.categories?.some( ( category ) =>
|
|
@@ -36,7 +36,6 @@ import { getBlockAndPreviewFromMedia } from './utils';
|
|
|
36
36
|
import { store as blockEditorStore } from '../../../store';
|
|
37
37
|
|
|
38
38
|
const ALLOWED_MEDIA_TYPES = [ 'image' ];
|
|
39
|
-
const MAXIMUM_TITLE_LENGTH = 25;
|
|
40
39
|
const MEDIA_OPTIONS_POPOVER_PROPS = {
|
|
41
40
|
position: 'bottom left',
|
|
42
41
|
className:
|
|
@@ -239,12 +238,6 @@ export function MediaPreview( { media, onClick, category } ) {
|
|
|
239
238
|
? media.title
|
|
240
239
|
: media.title?.rendered || __( 'no title' );
|
|
241
240
|
|
|
242
|
-
let truncatedTitle;
|
|
243
|
-
if ( title.length > MAXIMUM_TITLE_LENGTH ) {
|
|
244
|
-
const omission = '...';
|
|
245
|
-
truncatedTitle =
|
|
246
|
-
title.slice( 0, MAXIMUM_TITLE_LENGTH - omission.length ) + omission;
|
|
247
|
-
}
|
|
248
241
|
const onMouseEnter = useCallback( () => setIsHovered( true ), [] );
|
|
249
242
|
const onMouseLeave = useCallback( () => setIsHovered( false ), [] );
|
|
250
243
|
return (
|
|
@@ -268,7 +261,7 @@ export function MediaPreview( { media, onClick, category } ) {
|
|
|
268
261
|
onMouseEnter={ onMouseEnter }
|
|
269
262
|
onMouseLeave={ onMouseLeave }
|
|
270
263
|
>
|
|
271
|
-
<Tooltip text={
|
|
264
|
+
<Tooltip text={ title }>
|
|
272
265
|
<Composite.Item
|
|
273
266
|
render={
|
|
274
267
|
<div
|
|
@@ -64,6 +64,18 @@ function KeyboardShortcutsRegister() {
|
|
|
64
64
|
},
|
|
65
65
|
} );
|
|
66
66
|
|
|
67
|
+
registerShortcut( {
|
|
68
|
+
name: 'core/block-editor/paste-styles',
|
|
69
|
+
category: 'block',
|
|
70
|
+
description: __(
|
|
71
|
+
'Paste the copied style to the selected block(s).'
|
|
72
|
+
),
|
|
73
|
+
keyCombination: {
|
|
74
|
+
modifier: 'primaryAlt',
|
|
75
|
+
character: 'v',
|
|
76
|
+
},
|
|
77
|
+
} );
|
|
78
|
+
|
|
67
79
|
registerShortcut( {
|
|
68
80
|
name: 'core/block-editor/insert-before',
|
|
69
81
|
category: 'block',
|
|
@@ -501,7 +501,7 @@ function LinkControl( {
|
|
|
501
501
|
LinkControl.ViewerFill = ViewerFill;
|
|
502
502
|
LinkControl.DEFAULT_LINK_SETTINGS = DEFAULT_LINK_SETTINGS;
|
|
503
503
|
|
|
504
|
-
|
|
504
|
+
const DeprecatedExperimentalLinkControl = ( props ) => {
|
|
505
505
|
deprecated( 'wp.blockEditor.__experimentalLinkControl', {
|
|
506
506
|
since: '6.8',
|
|
507
507
|
alternative: 'wp.blockEditor.LinkControl',
|
|
@@ -510,4 +510,9 @@ export const DeprecatedExperimentalLinkControl = ( props ) => {
|
|
|
510
510
|
return <LinkControl { ...props } />;
|
|
511
511
|
};
|
|
512
512
|
|
|
513
|
+
DeprecatedExperimentalLinkControl.ViewerFill = LinkControl.ViewerFill;
|
|
514
|
+
DeprecatedExperimentalLinkControl.DEFAULT_LINK_SETTINGS =
|
|
515
|
+
LinkControl.DEFAULT_LINK_SETTINGS;
|
|
516
|
+
|
|
517
|
+
export { DeprecatedExperimentalLinkControl };
|
|
513
518
|
export default LinkControl;
|
|
@@ -114,18 +114,16 @@ const LinkControlSearchInput = forwardRef(
|
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const inputLabel = placeholder ?? __( 'Search or type URL' );
|
|
118
|
-
|
|
119
117
|
return (
|
|
120
118
|
<div className="block-editor-link-control__search-input-container">
|
|
121
119
|
<URLInput
|
|
122
120
|
disableSuggestions={ currentLink?.url === value }
|
|
123
|
-
label={
|
|
121
|
+
label={ __( 'Link' ) }
|
|
124
122
|
hideLabelFromVision={ hideLabelFromVision }
|
|
125
123
|
className={ className }
|
|
126
124
|
value={ value }
|
|
127
125
|
onChange={ onInputChange }
|
|
128
|
-
placeholder={
|
|
126
|
+
placeholder={ placeholder ?? __( 'Search or type URL' ) }
|
|
129
127
|
__experimentalRenderSuggestions={
|
|
130
128
|
showSuggestions ? handleRenderSuggestions : null
|
|
131
129
|
}
|