@wordpress/block-editor 10.0.4 → 10.0.6
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 +9 -0
- package/README.md +40 -0
- package/build/components/block-inspector/index.js +3 -4
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block.js +72 -14
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +208 -0
- package/build/components/font-sizes/fluid-utils.js.map +1 -0
- package/build/components/font-sizes/index.js +8 -0
- package/build/components/font-sizes/index.js.map +1 -1
- package/build/components/inserter/search-items.js +2 -17
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/hooks/font-size.js +60 -0
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/margin.js +4 -4
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/use-typography-props.js +17 -3
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build-module/components/block-inspector/index.js +3 -4
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block.js +72 -14
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +197 -0
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -0
- package/build-module/components/font-sizes/index.js +1 -0
- package/build-module/components/font-sizes/index.js.map +1 -1
- package/build-module/components/inserter/search-items.js +3 -17
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/hooks/font-size.js +59 -1
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/margin.js +4 -4
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +17 -4
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-style/style-rtl.css +61 -106
- package/build-style/style.css +61 -106
- package/package.json +3 -4
- package/src/components/block-inspector/index.js +4 -7
- package/src/components/block-list/block.js +111 -7
- package/src/components/block-list/style.scss +85 -133
- package/src/components/button-block-appender/style.scss +3 -1
- package/src/components/font-sizes/fluid-utils.js +221 -0
- package/src/components/font-sizes/index.js +1 -0
- package/src/components/font-sizes/test/fluid-utils.js +168 -0
- package/src/components/inserter/search-items.js +3 -15
- package/src/components/inserter/test/search-items.js +4 -0
- package/src/hooks/font-size.js +75 -0
- package/src/hooks/margin.js +4 -4
- package/src/hooks/test/use-typography-props.js +22 -0
- package/src/hooks/use-typography-props.js +18 -3
|
@@ -8,7 +8,8 @@ import classnames from 'classnames';
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { getInlineStyles } from './style';
|
|
11
|
-
import { getFontSizeClass } from '../components/font-sizes';
|
|
11
|
+
import { getFontSizeClass } from '../components/font-sizes';
|
|
12
|
+
import { getComputedFluidTypographyValue } from '../components/font-sizes/fluid-utils'; // This utility is intended to assist where the serialization of the typography
|
|
12
13
|
// block support is being skipped for a block but the typography related CSS
|
|
13
14
|
// styles still need to be generated so they can be applied to inner elements.
|
|
14
15
|
|
|
@@ -16,15 +17,27 @@ import { getFontSizeClass } from '../components/font-sizes'; // This utility is
|
|
|
16
17
|
* Provides the CSS class names and inline styles for a block's typography support
|
|
17
18
|
* attributes.
|
|
18
19
|
*
|
|
19
|
-
* @param {Object}
|
|
20
|
+
* @param {Object} attributes Block attributes.
|
|
21
|
+
* @param {boolean} isFluidFontSizeActive Whether the function should try to convert font sizes to fluid values.
|
|
20
22
|
*
|
|
21
23
|
* @return {Object} Typography block support derived CSS classes & styles.
|
|
22
24
|
*/
|
|
23
25
|
|
|
24
|
-
export function getTypographyClassesAndStyles(attributes) {
|
|
26
|
+
export function getTypographyClassesAndStyles(attributes, isFluidFontSizeActive) {
|
|
25
27
|
var _attributes$style;
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
let typographyStyles = (attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.typography) || {};
|
|
30
|
+
|
|
31
|
+
if (isFluidFontSizeActive) {
|
|
32
|
+
var _attributes$style2, _attributes$style2$ty;
|
|
33
|
+
|
|
34
|
+
typographyStyles = { ...typographyStyles,
|
|
35
|
+
fontSize: getComputedFluidTypographyValue({
|
|
36
|
+
fontSize: attributes === null || attributes === void 0 ? void 0 : (_attributes$style2 = attributes.style) === null || _attributes$style2 === void 0 ? void 0 : (_attributes$style2$ty = _attributes$style2.typography) === null || _attributes$style2$ty === void 0 ? void 0 : _attributes$style2$ty.fontSize
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
28
41
|
const style = getInlineStyles({
|
|
29
42
|
typography: typographyStyles
|
|
30
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/hooks/use-typography-props.js"],"names":["kebabCase","classnames","getInlineStyles","getFontSizeClass","getTypographyClassesAndStyles","attributes","typographyStyles","style","typography","fontFamilyClassName","fontFamily","className"
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/hooks/use-typography-props.js"],"names":["kebabCase","classnames","getInlineStyles","getFontSizeClass","getComputedFluidTypographyValue","getTypographyClassesAndStyles","attributes","isFluidFontSizeActive","typographyStyles","style","typography","fontSize","fontFamilyClassName","fontFamily","className"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,SAAhC;AACA,SAASC,gBAAT,QAAiC,0BAAjC;AACA,SAASC,+BAAT,QAAgD,sCAAhD,C,CAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,6BAAT,CACNC,UADM,EAENC,qBAFM,EAGL;AAAA;;AACD,MAAIC,gBAAgB,GAAG,CAAAF,UAAU,SAAV,IAAAA,UAAU,WAAV,iCAAAA,UAAU,CAAEG,KAAZ,wEAAmBC,UAAnB,KAAiC,EAAxD;;AAEA,MAAKH,qBAAL,EAA6B;AAAA;;AAC5BC,IAAAA,gBAAgB,GAAG,EAClB,GAAGA,gBADe;AAElBG,MAAAA,QAAQ,EAAEP,+BAA+B,CAAE;AAC1CO,QAAAA,QAAQ,EAAEL,UAAF,aAAEA,UAAF,6CAAEA,UAAU,CAAEG,KAAd,gFAAE,mBAAmBC,UAArB,0DAAE,sBAA+BC;AADC,OAAF;AAFvB,KAAnB;AAMA;;AAED,QAAMF,KAAK,GAAGP,eAAe,CAAE;AAAEQ,IAAAA,UAAU,EAAEF;AAAd,GAAF,CAA7B;AACA,QAAMI,mBAAmB,GAAG,CAAC,EAAEN,UAAF,aAAEA,UAAF,eAAEA,UAAU,CAAEO,UAAd,CAAD,GACxB,OAAOb,SAAS,CAAEM,UAAU,CAACO,UAAb,CAA2B,cADnB,GAEzB,EAFH;AAIA,QAAMC,SAAS,GAAGb,UAAU,CAC3BW,mBAD2B,EAE3BT,gBAAgB,CAAEG,UAAF,aAAEA,UAAF,uBAAEA,UAAU,CAAEK,QAAd,CAFW,CAA5B;AAKA,SAAO;AACNG,IAAAA,SADM;AAENL,IAAAA;AAFM,GAAP;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\nimport { getFontSizeClass } from '../components/font-sizes';\nimport { getComputedFluidTypographyValue } from '../components/font-sizes/fluid-utils';\n\n// This utility is intended to assist where the serialization of the typography\n// block support is being skipped for a block but the typography related CSS\n// styles still need to be generated so they can be applied to inner elements.\n\n/**\n * Provides the CSS class names and inline styles for a block's typography support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n * @param {boolean} isFluidFontSizeActive Whether the function should try to convert font sizes to fluid values.\n *\n * @return {Object} Typography block support derived CSS classes & styles.\n */\nexport function getTypographyClassesAndStyles(\n\tattributes,\n\tisFluidFontSizeActive\n) {\n\tlet typographyStyles = attributes?.style?.typography || {};\n\n\tif ( isFluidFontSizeActive ) {\n\t\ttypographyStyles = {\n\t\t\t...typographyStyles,\n\t\t\tfontSize: getComputedFluidTypographyValue( {\n\t\t\t\tfontSize: attributes?.style?.typography?.fontSize,\n\t\t\t} ),\n\t\t};\n\t}\n\n\tconst style = getInlineStyles( { typography: typographyStyles } );\n\tconst fontFamilyClassName = !! attributes?.fontFamily\n\t\t? `has-${ kebabCase( attributes.fontFamily ) }-font-family`\n\t\t: '';\n\n\tconst className = classnames(\n\t\tfontFamilyClassName,\n\t\tgetFontSizeClass( attributes?.fontSize )\n\t);\n\n\treturn {\n\t\tclassName,\n\t\tstyle,\n\t};\n}\n"]}
|
|
@@ -172,52 +172,77 @@
|
|
|
172
172
|
/**
|
|
173
173
|
* Cross-Block Selection
|
|
174
174
|
*/
|
|
175
|
+
@keyframes selection-overlay__fade-in-animation {
|
|
176
|
+
from {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
}
|
|
179
|
+
to {
|
|
180
|
+
opacity: 0.4;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
175
183
|
.block-editor-block-list__layout {
|
|
176
184
|
position: relative;
|
|
177
185
|
}
|
|
178
186
|
.block-editor-block-list__layout::selection {
|
|
179
187
|
background: transparent;
|
|
180
188
|
}
|
|
181
|
-
.
|
|
182
|
-
|
|
183
|
-
|
|
189
|
+
.has-multi-selection .block-editor-block-list__layout::selection {
|
|
190
|
+
background: transparent;
|
|
191
|
+
}
|
|
192
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::selection, .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
|
|
193
|
+
background: transparent;
|
|
194
|
+
}
|
|
195
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after {
|
|
196
|
+
content: "";
|
|
184
197
|
position: absolute;
|
|
185
198
|
z-index: 1;
|
|
186
199
|
pointer-events: none;
|
|
187
|
-
content: "";
|
|
188
200
|
top: 1px;
|
|
201
|
+
left: 1px;
|
|
189
202
|
bottom: 1px;
|
|
190
203
|
right: 1px;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
background: var(--wp-admin-theme-color);
|
|
205
|
+
opacity: 0.4;
|
|
206
|
+
animation: selection-overlay__fade-in-animation 0.1s ease-out;
|
|
207
|
+
animation-fill-mode: forwards;
|
|
194
208
|
outline: 2px solid transparent;
|
|
195
209
|
}
|
|
196
|
-
|
|
197
|
-
.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .components-placeholder ::selection,
|
|
202
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection,
|
|
203
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .components-placeholder ::selection,
|
|
204
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection,
|
|
205
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .components-placeholder ::selection,
|
|
206
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
|
|
207
|
-
background: transparent;
|
|
210
|
+
@media (prefers-reduced-motion: reduce) {
|
|
211
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after {
|
|
212
|
+
animation-duration: 1ms;
|
|
213
|
+
animation-delay: 0s;
|
|
214
|
+
}
|
|
208
215
|
}
|
|
209
|
-
.
|
|
210
|
-
|
|
216
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
|
|
217
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected, .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
|
|
218
|
+
border-radius: 2px;
|
|
219
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
220
|
+
outline: 2px solid transparent;
|
|
211
221
|
}
|
|
212
|
-
.block-editor-block-list__layout .block-editor-block-list__block
|
|
213
|
-
|
|
214
|
-
outline: 1px solid transparent;
|
|
222
|
+
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
|
|
223
|
+
outline: none;
|
|
215
224
|
}
|
|
216
|
-
.block-editor-block-list__layout
|
|
225
|
+
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
|
|
226
|
+
content: "";
|
|
227
|
+
position: absolute;
|
|
228
|
+
z-index: 1;
|
|
229
|
+
pointer-events: none;
|
|
230
|
+
top: 1px;
|
|
231
|
+
left: 1px;
|
|
232
|
+
bottom: 1px;
|
|
233
|
+
right: 1px;
|
|
217
234
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
235
|
+
border-radius: 1px;
|
|
218
236
|
outline: 2px solid transparent;
|
|
219
237
|
}
|
|
220
|
-
.block-editor-block-list__layout .
|
|
238
|
+
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
|
|
239
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
|
|
240
|
+
}
|
|
241
|
+
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected {
|
|
242
|
+
box-shadow: none;
|
|
243
|
+
outline: none;
|
|
244
|
+
}
|
|
245
|
+
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
|
|
221
246
|
content: "";
|
|
222
247
|
position: absolute;
|
|
223
248
|
z-index: 0;
|
|
@@ -229,10 +254,7 @@
|
|
|
229
254
|
border-radius: 2px;
|
|
230
255
|
border-top: 4px solid #ccc;
|
|
231
256
|
}
|
|
232
|
-
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
|
|
233
|
-
content: none;
|
|
234
|
-
}
|
|
235
|
-
.block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::before {
|
|
257
|
+
.block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::after {
|
|
236
258
|
border-color: var(--wp-admin-theme-color);
|
|
237
259
|
}
|
|
238
260
|
.has-multi-selection .block-editor-block-list__layout {
|
|
@@ -266,24 +288,6 @@
|
|
|
266
288
|
/**
|
|
267
289
|
* Notices
|
|
268
290
|
*/
|
|
269
|
-
/**
|
|
270
|
-
* Block Layout
|
|
271
|
-
*/
|
|
272
|
-
/**
|
|
273
|
-
* Block styles and alignments
|
|
274
|
-
*/
|
|
275
|
-
}
|
|
276
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-partially-selected::after {
|
|
277
|
-
top: -0.5px;
|
|
278
|
-
left: -0.5px;
|
|
279
|
-
bottom: -0.5px;
|
|
280
|
-
right: -0.5px;
|
|
281
|
-
}
|
|
282
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after, .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
|
|
283
|
-
top: 0;
|
|
284
|
-
left: 0;
|
|
285
|
-
bottom: 0;
|
|
286
|
-
right: 0;
|
|
287
291
|
}
|
|
288
292
|
.block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel * {
|
|
289
293
|
z-index: 1;
|
|
@@ -302,43 +306,6 @@
|
|
|
302
306
|
.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content {
|
|
303
307
|
font-size: 13px;
|
|
304
308
|
}
|
|
305
|
-
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
|
|
306
|
-
outline: none;
|
|
307
|
-
}
|
|
308
|
-
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
|
|
309
|
-
position: absolute;
|
|
310
|
-
z-index: 1;
|
|
311
|
-
pointer-events: none;
|
|
312
|
-
content: "";
|
|
313
|
-
top: 1px;
|
|
314
|
-
bottom: 1px;
|
|
315
|
-
right: 1px;
|
|
316
|
-
left: 1px;
|
|
317
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
318
|
-
border-radius: 1px;
|
|
319
|
-
outline: 2px solid transparent;
|
|
320
|
-
}
|
|
321
|
-
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
|
|
322
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
|
|
323
|
-
}
|
|
324
|
-
.block-editor-block-list__layout .block-editor-block-list__block::after {
|
|
325
|
-
content: "";
|
|
326
|
-
pointer-events: none;
|
|
327
|
-
position: absolute;
|
|
328
|
-
top: 0;
|
|
329
|
-
left: 0;
|
|
330
|
-
bottom: 0;
|
|
331
|
-
right: 0;
|
|
332
|
-
border-radius: 2px;
|
|
333
|
-
box-shadow: 0 0 0 0 transparent;
|
|
334
|
-
transition: box-shadow 0.1s linear;
|
|
335
|
-
}
|
|
336
|
-
@media (prefers-reduced-motion: reduce) {
|
|
337
|
-
.block-editor-block-list__layout .block-editor-block-list__block::after {
|
|
338
|
-
transition-duration: 0s;
|
|
339
|
-
transition-delay: 0s;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
309
|
.block-editor-block-list__layout .block-editor-block-list__block.has-warning {
|
|
343
310
|
min-height: 48px;
|
|
344
311
|
}
|
|
@@ -378,31 +345,19 @@
|
|
|
378
345
|
|
|
379
346
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered {
|
|
380
347
|
cursor: default;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
top: 1px;
|
|
384
|
-
right: 1px;
|
|
385
|
-
left: 1px;
|
|
386
|
-
bottom: 1px;
|
|
387
|
-
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
|
|
388
|
-
border-radius: 1px;
|
|
348
|
+
box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
|
|
349
|
+
border-radius: 2px;
|
|
389
350
|
}
|
|
390
351
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected {
|
|
391
352
|
cursor: default;
|
|
353
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
354
|
+
border-radius: 2px;
|
|
392
355
|
}
|
|
393
356
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected.rich-text {
|
|
394
357
|
cursor: unset;
|
|
395
358
|
}
|
|
396
|
-
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected
|
|
397
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
398
|
-
top: 1px;
|
|
399
|
-
right: 1px;
|
|
400
|
-
left: 1px;
|
|
401
|
-
bottom: 1px;
|
|
402
|
-
border-radius: 1px;
|
|
403
|
-
}
|
|
404
|
-
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus::after {
|
|
405
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
359
|
+
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus {
|
|
360
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
406
361
|
}
|
|
407
362
|
|
|
408
363
|
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
|
|
@@ -1757,10 +1712,10 @@
|
|
|
1757
1712
|
color: #000;
|
|
1758
1713
|
}
|
|
1759
1714
|
|
|
1760
|
-
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child {
|
|
1715
|
+
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child {
|
|
1761
1716
|
pointer-events: none;
|
|
1762
1717
|
}
|
|
1763
|
-
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after {
|
|
1718
|
+
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after {
|
|
1764
1719
|
content: "";
|
|
1765
1720
|
position: absolute;
|
|
1766
1721
|
top: 0;
|
|
@@ -1771,7 +1726,7 @@
|
|
|
1771
1726
|
border: 1px dashed currentColor;
|
|
1772
1727
|
border-radius: 2px;
|
|
1773
1728
|
}
|
|
1774
|
-
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter {
|
|
1729
|
+
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter {
|
|
1775
1730
|
visibility: hidden;
|
|
1776
1731
|
}
|
|
1777
1732
|
|
package/build-style/style.css
CHANGED
|
@@ -172,52 +172,77 @@
|
|
|
172
172
|
/**
|
|
173
173
|
* Cross-Block Selection
|
|
174
174
|
*/
|
|
175
|
+
@keyframes selection-overlay__fade-in-animation {
|
|
176
|
+
from {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
}
|
|
179
|
+
to {
|
|
180
|
+
opacity: 0.4;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
175
183
|
.block-editor-block-list__layout {
|
|
176
184
|
position: relative;
|
|
177
185
|
}
|
|
178
186
|
.block-editor-block-list__layout::selection {
|
|
179
187
|
background: transparent;
|
|
180
188
|
}
|
|
181
|
-
.
|
|
182
|
-
|
|
183
|
-
|
|
189
|
+
.has-multi-selection .block-editor-block-list__layout::selection {
|
|
190
|
+
background: transparent;
|
|
191
|
+
}
|
|
192
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::selection, .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
|
|
193
|
+
background: transparent;
|
|
194
|
+
}
|
|
195
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after {
|
|
196
|
+
content: "";
|
|
184
197
|
position: absolute;
|
|
185
198
|
z-index: 1;
|
|
186
199
|
pointer-events: none;
|
|
187
|
-
content: "";
|
|
188
200
|
top: 1px;
|
|
201
|
+
right: 1px;
|
|
189
202
|
bottom: 1px;
|
|
190
203
|
left: 1px;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
background: var(--wp-admin-theme-color);
|
|
205
|
+
opacity: 0.4;
|
|
206
|
+
animation: selection-overlay__fade-in-animation 0.1s ease-out;
|
|
207
|
+
animation-fill-mode: forwards;
|
|
194
208
|
outline: 2px solid transparent;
|
|
195
209
|
}
|
|
196
|
-
|
|
197
|
-
.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .components-placeholder ::selection,
|
|
202
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection,
|
|
203
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .components-placeholder ::selection,
|
|
204
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection,
|
|
205
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .components-placeholder ::selection,
|
|
206
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) ::selection {
|
|
207
|
-
background: transparent;
|
|
210
|
+
@media (prefers-reduced-motion: reduce) {
|
|
211
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)::after {
|
|
212
|
+
animation-duration: 1ms;
|
|
213
|
+
animation-delay: 0s;
|
|
214
|
+
}
|
|
208
215
|
}
|
|
209
|
-
.
|
|
210
|
-
|
|
216
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
|
|
217
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected, .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
|
|
218
|
+
border-radius: 2px;
|
|
219
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
220
|
+
outline: 2px solid transparent;
|
|
211
221
|
}
|
|
212
|
-
.block-editor-block-list__layout .block-editor-block-list__block
|
|
213
|
-
|
|
214
|
-
outline: 1px solid transparent;
|
|
222
|
+
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
|
|
223
|
+
outline: none;
|
|
215
224
|
}
|
|
216
|
-
.block-editor-block-list__layout
|
|
225
|
+
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
|
|
226
|
+
content: "";
|
|
227
|
+
position: absolute;
|
|
228
|
+
z-index: 1;
|
|
229
|
+
pointer-events: none;
|
|
230
|
+
top: 1px;
|
|
231
|
+
right: 1px;
|
|
232
|
+
bottom: 1px;
|
|
233
|
+
left: 1px;
|
|
217
234
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
235
|
+
border-radius: 1px;
|
|
218
236
|
outline: 2px solid transparent;
|
|
219
237
|
}
|
|
220
|
-
.block-editor-block-list__layout .
|
|
238
|
+
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
|
|
239
|
+
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
|
|
240
|
+
}
|
|
241
|
+
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected {
|
|
242
|
+
box-shadow: none;
|
|
243
|
+
outline: none;
|
|
244
|
+
}
|
|
245
|
+
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
|
|
221
246
|
content: "";
|
|
222
247
|
position: absolute;
|
|
223
248
|
z-index: 0;
|
|
@@ -229,10 +254,7 @@
|
|
|
229
254
|
border-radius: 2px;
|
|
230
255
|
border-top: 4px solid #ccc;
|
|
231
256
|
}
|
|
232
|
-
.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
|
|
233
|
-
content: none;
|
|
234
|
-
}
|
|
235
|
-
.block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::before {
|
|
257
|
+
.block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected::after {
|
|
236
258
|
border-color: var(--wp-admin-theme-color);
|
|
237
259
|
}
|
|
238
260
|
.has-multi-selection .block-editor-block-list__layout {
|
|
@@ -266,24 +288,6 @@
|
|
|
266
288
|
/**
|
|
267
289
|
* Notices
|
|
268
290
|
*/
|
|
269
|
-
/**
|
|
270
|
-
* Block Layout
|
|
271
|
-
*/
|
|
272
|
-
/**
|
|
273
|
-
* Block styles and alignments
|
|
274
|
-
*/
|
|
275
|
-
}
|
|
276
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-partially-selected::after {
|
|
277
|
-
top: -0.5px;
|
|
278
|
-
right: -0.5px;
|
|
279
|
-
bottom: -0.5px;
|
|
280
|
-
left: -0.5px;
|
|
281
|
-
}
|
|
282
|
-
.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after, .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after {
|
|
283
|
-
top: 0;
|
|
284
|
-
right: 0;
|
|
285
|
-
bottom: 0;
|
|
286
|
-
left: 0;
|
|
287
291
|
}
|
|
288
292
|
.block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel * {
|
|
289
293
|
z-index: 1;
|
|
@@ -302,43 +306,6 @@
|
|
|
302
306
|
.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content {
|
|
303
307
|
font-size: 13px;
|
|
304
308
|
}
|
|
305
|
-
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
|
|
306
|
-
outline: none;
|
|
307
|
-
}
|
|
308
|
-
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
|
|
309
|
-
position: absolute;
|
|
310
|
-
z-index: 1;
|
|
311
|
-
pointer-events: none;
|
|
312
|
-
content: "";
|
|
313
|
-
top: 1px;
|
|
314
|
-
bottom: 1px;
|
|
315
|
-
left: 1px;
|
|
316
|
-
right: 1px;
|
|
317
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
318
|
-
border-radius: 1px;
|
|
319
|
-
outline: 2px solid transparent;
|
|
320
|
-
}
|
|
321
|
-
.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
|
|
322
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
|
|
323
|
-
}
|
|
324
|
-
.block-editor-block-list__layout .block-editor-block-list__block::after {
|
|
325
|
-
content: "";
|
|
326
|
-
pointer-events: none;
|
|
327
|
-
position: absolute;
|
|
328
|
-
top: 0;
|
|
329
|
-
right: 0;
|
|
330
|
-
bottom: 0;
|
|
331
|
-
left: 0;
|
|
332
|
-
border-radius: 2px;
|
|
333
|
-
box-shadow: 0 0 0 0 transparent;
|
|
334
|
-
transition: box-shadow 0.1s linear;
|
|
335
|
-
}
|
|
336
|
-
@media (prefers-reduced-motion: reduce) {
|
|
337
|
-
.block-editor-block-list__layout .block-editor-block-list__block::after {
|
|
338
|
-
transition-duration: 0s;
|
|
339
|
-
transition-delay: 0s;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
309
|
.block-editor-block-list__layout .block-editor-block-list__block.has-warning {
|
|
343
310
|
min-height: 48px;
|
|
344
311
|
}
|
|
@@ -378,31 +345,19 @@
|
|
|
378
345
|
|
|
379
346
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered {
|
|
380
347
|
cursor: default;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
top: 1px;
|
|
384
|
-
left: 1px;
|
|
385
|
-
right: 1px;
|
|
386
|
-
bottom: 1px;
|
|
387
|
-
box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
|
|
388
|
-
border-radius: 1px;
|
|
348
|
+
box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
|
|
349
|
+
border-radius: 2px;
|
|
389
350
|
}
|
|
390
351
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected {
|
|
391
352
|
cursor: default;
|
|
353
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
354
|
+
border-radius: 2px;
|
|
392
355
|
}
|
|
393
356
|
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected.rich-text {
|
|
394
357
|
cursor: unset;
|
|
395
358
|
}
|
|
396
|
-
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected
|
|
397
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
398
|
-
top: 1px;
|
|
399
|
-
left: 1px;
|
|
400
|
-
right: 1px;
|
|
401
|
-
bottom: 1px;
|
|
402
|
-
border-radius: 1px;
|
|
403
|
-
}
|
|
404
|
-
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus::after {
|
|
405
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
359
|
+
.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus {
|
|
360
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
406
361
|
}
|
|
407
362
|
|
|
408
363
|
.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
|
|
@@ -1757,10 +1712,10 @@
|
|
|
1757
1712
|
color: #000;
|
|
1758
1713
|
}
|
|
1759
1714
|
|
|
1760
|
-
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child {
|
|
1715
|
+
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child {
|
|
1761
1716
|
pointer-events: none;
|
|
1762
1717
|
}
|
|
1763
|
-
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after {
|
|
1718
|
+
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after {
|
|
1764
1719
|
content: "";
|
|
1765
1720
|
position: absolute;
|
|
1766
1721
|
top: 0;
|
|
@@ -1771,7 +1726,7 @@
|
|
|
1771
1726
|
border: 1px dashed currentColor;
|
|
1772
1727
|
border-radius: 2px;
|
|
1773
1728
|
}
|
|
1774
|
-
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter {
|
|
1729
|
+
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter {
|
|
1775
1730
|
visibility: hidden;
|
|
1776
1731
|
}
|
|
1777
1732
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.6",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@wordpress/api-fetch": "^6.14.1",
|
|
38
38
|
"@wordpress/blob": "^3.17.1",
|
|
39
39
|
"@wordpress/blocks": "^11.16.4",
|
|
40
|
-
"@wordpress/components": "^21.0.
|
|
40
|
+
"@wordpress/components": "^21.0.5",
|
|
41
41
|
"@wordpress/compose": "^5.15.2",
|
|
42
42
|
"@wordpress/data": "^7.1.3",
|
|
43
43
|
"@wordpress/date": "^4.17.1",
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
"@wordpress/url": "^3.18.1",
|
|
60
60
|
"@wordpress/warning": "^2.17.1",
|
|
61
61
|
"@wordpress/wordcount": "^3.17.1",
|
|
62
|
-
"change-case": "^4.1.2",
|
|
63
62
|
"classnames": "^2.3.1",
|
|
64
63
|
"colord": "^2.7.0",
|
|
65
64
|
"diff": "^4.0.2",
|
|
@@ -79,5 +78,5 @@
|
|
|
79
78
|
"publishConfig": {
|
|
80
79
|
"access": "public"
|
|
81
80
|
},
|
|
82
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "e0bb20cabd2152c8f0f6758e1b4e17fa24c5e588"
|
|
83
82
|
}
|
|
@@ -40,6 +40,7 @@ function useContentBlocks( blockTypes, block ) {
|
|
|
40
40
|
const contenBlocksObjectAux = useMemo( () => {
|
|
41
41
|
return blockTypes.reduce( ( result, blockType ) => {
|
|
42
42
|
if (
|
|
43
|
+
blockType.name !== 'core/list-item' &&
|
|
43
44
|
Object.entries( blockType.attributes ).some(
|
|
44
45
|
( [ , { __experimentalRole } ] ) =>
|
|
45
46
|
__experimentalRole === 'content'
|
|
@@ -143,7 +144,6 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
|
|
|
143
144
|
getSelectedBlockCount,
|
|
144
145
|
getBlockName,
|
|
145
146
|
__unstableGetContentLockingParent,
|
|
146
|
-
getTemplateLock,
|
|
147
147
|
} = select( blockEditorStore );
|
|
148
148
|
|
|
149
149
|
const _selectedBlockClientId = getSelectedBlockClientId();
|
|
@@ -157,12 +157,9 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
|
|
|
157
157
|
selectedBlockClientId: _selectedBlockClientId,
|
|
158
158
|
selectedBlockName: _selectedBlockName,
|
|
159
159
|
blockType: _blockType,
|
|
160
|
-
topLevelLockedBlock:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
: __unstableGetContentLockingParent(
|
|
164
|
-
_selectedBlockClientId
|
|
165
|
-
),
|
|
160
|
+
topLevelLockedBlock: __unstableGetContentLockingParent(
|
|
161
|
+
_selectedBlockClientId
|
|
162
|
+
),
|
|
166
163
|
};
|
|
167
164
|
}, [] );
|
|
168
165
|
|