@wordpress/block-library 9.11.0 → 9.12.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 +2 -0
- package/build/button/index.js +1 -1
- package/build/button/index.js.map +1 -1
- package/build/cover/deprecated.js +140 -4
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +1 -1
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +1 -2
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +22 -22
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/save.js +13 -13
- package/build/cover/save.js.map +1 -1
- package/build/details/index.js +1 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/image/edit.js +1 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +144 -78
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +1 -1
- package/build/latest-posts/edit.js +0 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/navigation/edit/index.js +2 -23
- package/build/navigation/edit/index.js.map +1 -1
- package/build/paragraph/edit.js +1 -1
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-content/index.js +13 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-template/edit.js +11 -0
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/query/edit/inspector-controls/index.js +2 -2
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +0 -3
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/edit/query-content.js +10 -12
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/index.js +1 -1
- package/build/query/utils.js +32 -1
- package/build/query/utils.js.map +1 -1
- package/build/template-part/edit/index.js +1 -4
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +0 -3
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +0 -2
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/cover/deprecated.js +140 -4
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +1 -1
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +1 -2
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +22 -22
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/save.js +13 -13
- package/build-module/cover/save.js.map +1 -1
- package/build-module/details/index.js +1 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +1 -1
- package/build-module/file/edit.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/image/edit.js +1 -1
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +149 -83
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +1 -1
- package/build-module/latest-posts/edit.js +0 -1
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/navigation/edit/index.js +2 -23
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/paragraph/edit.js +1 -1
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-content/index.js +13 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-template/edit.js +11 -0
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js +2 -2
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +0 -3
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/edit/query-content.js +10 -12
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/index.js +1 -1
- package/build-module/query/utils.js +29 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +0 -3
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +0 -2
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/cover/editor-rtl.css +3 -5
- package/build-style/cover/editor.css +3 -5
- package/build-style/cover/style-rtl.css +19 -15
- package/build-style/cover/style.css +19 -15
- package/build-style/editor-rtl.css +7 -22
- package/build-style/editor.css +7 -22
- package/build-style/group/editor-rtl.css +0 -10
- package/build-style/group/editor.css +0 -10
- package/build-style/image/editor-rtl.css +4 -0
- package/build-style/image/editor.css +4 -0
- package/build-style/image/style-rtl.css +0 -2
- package/build-style/image/style.css +0 -2
- package/build-style/latest-posts/editor-rtl.css +0 -7
- package/build-style/latest-posts/editor.css +0 -7
- package/build-style/media-text/style-rtl.css +1 -1
- package/build-style/media-text/style.css +1 -1
- package/build-style/style-rtl.css +20 -18
- package/build-style/style.css +20 -18
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/package.json +8 -8
- package/src/button/index.js +1 -1
- package/src/comments/block.json +3 -9
- package/src/cover/deprecated.js +182 -4
- package/src/cover/edit/block-controls.js +1 -1
- package/src/cover/edit/cover-placeholder.js +0 -3
- package/src/cover/edit/index.js +41 -26
- package/src/cover/editor.scss +4 -5
- package/src/cover/save.js +27 -20
- package/src/cover/style.scss +40 -16
- package/src/cover/test/__snapshots__/edit.native.js.snap +9 -9
- package/src/cover/test/__snapshots__/transforms.native.js.snap +4 -4
- package/src/cover/test/edit.native.js +4 -4
- package/src/cover/test/transforms.native.js +4 -4
- package/src/details/block.json +1 -0
- package/src/file/edit.js +1 -1
- package/src/gallery/edit.js +1 -1
- package/src/group/editor.scss +0 -12
- package/src/image/block.json +1 -1
- package/src/image/edit.js +1 -1
- package/src/image/editor.scss +4 -0
- package/src/image/image.js +200 -109
- package/src/image/style.scss +0 -1
- package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/latest-posts/edit.js +0 -1
- package/src/latest-posts/editor.scss +0 -11
- package/src/media-text/style.scss +1 -1
- package/src/media-text/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/navigation/edit/index.js +3 -30
- package/src/navigation/index.php +1 -1
- package/src/paragraph/edit.js +1 -1
- package/src/post-content/block.json +14 -1
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +19 -0
- package/src/query/block.json +1 -1
- package/src/query/edit/inspector-controls/index.js +2 -2
- package/src/query/edit/pattern-selection-modal.js +0 -3
- package/src/query/edit/query-content.js +9 -17
- package/src/query/test/utils.js +59 -1
- package/src/query/utils.js +29 -0
- package/src/search/index.php +2 -2
- package/src/template-part/edit/index.js +1 -4
- package/src/template-part/edit/selection-modal.js +0 -3
- package/src/video/edit.js +1 -1
- package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/video/tracks-editor.js +0 -2
- package/tsconfig.tsbuildinfo +1 -1
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
package/CHANGELOG.md
CHANGED
package/build/button/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","role","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","role","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -153,7 +153,7 @@ const v8ToV11BlockAttributes = {
|
|
|
153
153
|
enum: ['all', 'insert', false]
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
|
-
const
|
|
156
|
+
const v12toV13BlockAttributes = {
|
|
157
157
|
...v8ToV11BlockAttributes,
|
|
158
158
|
useFeaturedImage: {
|
|
159
159
|
type: 'boolean',
|
|
@@ -164,6 +164,19 @@ const v12BlockAttributes = {
|
|
|
164
164
|
default: 'div'
|
|
165
165
|
}
|
|
166
166
|
};
|
|
167
|
+
const v14BlockAttributes = {
|
|
168
|
+
...v12toV13BlockAttributes,
|
|
169
|
+
isUserOverlayColor: {
|
|
170
|
+
type: 'boolean'
|
|
171
|
+
},
|
|
172
|
+
sizeSlug: {
|
|
173
|
+
type: 'string'
|
|
174
|
+
},
|
|
175
|
+
alt: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
default: ''
|
|
178
|
+
}
|
|
179
|
+
};
|
|
167
180
|
const v7toV11BlockSupports = {
|
|
168
181
|
anchor: true,
|
|
169
182
|
align: true,
|
|
@@ -228,10 +241,133 @@ const v12BlockSupports = {
|
|
|
228
241
|
allowJustification: false
|
|
229
242
|
}
|
|
230
243
|
};
|
|
244
|
+
const v14BlockSupports = {
|
|
245
|
+
...v12BlockSupports,
|
|
246
|
+
shadow: true,
|
|
247
|
+
dimensions: {
|
|
248
|
+
aspectRatio: true
|
|
249
|
+
},
|
|
250
|
+
interactivity: {
|
|
251
|
+
clientNavigation: true
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
// Deprecation for blocks that have z-index.
|
|
256
|
+
const v14 = {
|
|
257
|
+
attributes: v14BlockAttributes,
|
|
258
|
+
supports: v14BlockSupports,
|
|
259
|
+
save({
|
|
260
|
+
attributes
|
|
261
|
+
}) {
|
|
262
|
+
const {
|
|
263
|
+
backgroundType,
|
|
264
|
+
gradient,
|
|
265
|
+
contentPosition,
|
|
266
|
+
customGradient,
|
|
267
|
+
customOverlayColor,
|
|
268
|
+
dimRatio,
|
|
269
|
+
focalPoint,
|
|
270
|
+
useFeaturedImage,
|
|
271
|
+
hasParallax,
|
|
272
|
+
isDark,
|
|
273
|
+
isRepeated,
|
|
274
|
+
overlayColor,
|
|
275
|
+
url,
|
|
276
|
+
alt,
|
|
277
|
+
id,
|
|
278
|
+
minHeight: minHeightProp,
|
|
279
|
+
minHeightUnit,
|
|
280
|
+
tagName: Tag,
|
|
281
|
+
sizeSlug
|
|
282
|
+
} = attributes;
|
|
283
|
+
const overlayColorClass = (0, _blockEditor.getColorClassName)('background-color', overlayColor);
|
|
284
|
+
const gradientClass = (0, _blockEditor.__experimentalGetGradientClass)(gradient);
|
|
285
|
+
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
|
|
286
|
+
const isImageBackground = _shared.IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
287
|
+
const isVideoBackground = _shared.VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
288
|
+
const isImgElement = !(hasParallax || isRepeated);
|
|
289
|
+
const style = {
|
|
290
|
+
minHeight: minHeight || undefined
|
|
291
|
+
};
|
|
292
|
+
const bgStyle = {
|
|
293
|
+
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
|
|
294
|
+
background: customGradient ? customGradient : undefined
|
|
295
|
+
};
|
|
296
|
+
const objectPosition =
|
|
297
|
+
// prettier-ignore
|
|
298
|
+
focalPoint && isImgElement ? (0, _shared.mediaPosition)(focalPoint) : undefined;
|
|
299
|
+
const backgroundImage = url ? `url(${url})` : undefined;
|
|
300
|
+
const backgroundPosition = (0, _shared.mediaPosition)(focalPoint);
|
|
301
|
+
const classes = (0, _clsx.default)({
|
|
302
|
+
'is-light': !isDark,
|
|
303
|
+
'has-parallax': hasParallax,
|
|
304
|
+
'is-repeated': isRepeated,
|
|
305
|
+
'has-custom-content-position': !(0, _shared.isContentPositionCenter)(contentPosition)
|
|
306
|
+
}, (0, _shared.getPositionClassName)(contentPosition));
|
|
307
|
+
const imgClasses = (0, _clsx.default)('wp-block-cover__image-background', id ? `wp-image-${id}` : null, {
|
|
308
|
+
[`size-${sizeSlug}`]: sizeSlug,
|
|
309
|
+
'has-parallax': hasParallax,
|
|
310
|
+
'is-repeated': isRepeated
|
|
311
|
+
});
|
|
312
|
+
const gradientValue = gradient || customGradient;
|
|
313
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Tag, {
|
|
314
|
+
..._blockEditor.useBlockProps.save({
|
|
315
|
+
className: classes,
|
|
316
|
+
style
|
|
317
|
+
}),
|
|
318
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
319
|
+
"aria-hidden": "true",
|
|
320
|
+
className: (0, _clsx.default)('wp-block-cover__background', overlayColorClass, (0, _shared.dimRatioToClass)(dimRatio), {
|
|
321
|
+
'has-background-dim': dimRatio !== undefined,
|
|
322
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
323
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
324
|
+
// media, a gradient and a dim.
|
|
325
|
+
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
|
|
326
|
+
'has-background-gradient': gradientValue,
|
|
327
|
+
[gradientClass]: gradientClass
|
|
328
|
+
}),
|
|
329
|
+
style: bgStyle
|
|
330
|
+
}), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
331
|
+
className: imgClasses,
|
|
332
|
+
alt: alt,
|
|
333
|
+
src: url,
|
|
334
|
+
style: {
|
|
335
|
+
objectPosition
|
|
336
|
+
},
|
|
337
|
+
"data-object-fit": "cover",
|
|
338
|
+
"data-object-position": objectPosition
|
|
339
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
340
|
+
role: alt ? 'img' : undefined,
|
|
341
|
+
"aria-label": alt ? alt : undefined,
|
|
342
|
+
className: imgClasses,
|
|
343
|
+
style: {
|
|
344
|
+
backgroundPosition,
|
|
345
|
+
backgroundImage
|
|
346
|
+
}
|
|
347
|
+
})), isVideoBackground && url && /*#__PURE__*/(0, _jsxRuntime.jsx)("video", {
|
|
348
|
+
className: (0, _clsx.default)('wp-block-cover__video-background', 'intrinsic-ignore'),
|
|
349
|
+
autoPlay: true,
|
|
350
|
+
muted: true,
|
|
351
|
+
loop: true,
|
|
352
|
+
playsInline: true,
|
|
353
|
+
src: url,
|
|
354
|
+
style: {
|
|
355
|
+
objectPosition
|
|
356
|
+
},
|
|
357
|
+
"data-object-fit": "cover",
|
|
358
|
+
"data-object-position": objectPosition
|
|
359
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
360
|
+
..._blockEditor.useInnerBlocksProps.save({
|
|
361
|
+
className: 'wp-block-cover__inner-container'
|
|
362
|
+
})
|
|
363
|
+
})]
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
};
|
|
231
367
|
|
|
232
368
|
// Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated.
|
|
233
369
|
const v13 = {
|
|
234
|
-
attributes:
|
|
370
|
+
attributes: v12toV13BlockAttributes,
|
|
235
371
|
supports: v12BlockSupports,
|
|
236
372
|
save({
|
|
237
373
|
attributes
|
|
@@ -341,7 +477,7 @@ const v13 = {
|
|
|
341
477
|
|
|
342
478
|
// Deprecation for blocks to prevent auto overlay color from overriding previously set values.
|
|
343
479
|
const v12 = {
|
|
344
|
-
attributes:
|
|
480
|
+
attributes: v12toV13BlockAttributes,
|
|
345
481
|
supports: v12BlockSupports,
|
|
346
482
|
isEligible(attributes) {
|
|
347
483
|
return (attributes.customOverlayColor !== undefined || attributes.overlayColor !== undefined) && attributes.isUserOverlayColor === undefined;
|
|
@@ -1430,5 +1566,5 @@ const v1 = {
|
|
|
1430
1566
|
})]];
|
|
1431
1567
|
}
|
|
1432
1568
|
};
|
|
1433
|
-
var _default = exports.default = [v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1];
|
|
1569
|
+
var _default = exports.default = [v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1];
|
|
1434
1570
|
//# sourceMappingURL=deprecated.js.map
|