@wordpress/block-library 7.6.0 → 7.7.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/deprecated.js +175 -35
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/save.js +1 -1
- package/build/button/save.js.map +1 -1
- package/build/columns/index.js +3 -1
- package/build/columns/index.js.map +1 -1
- package/build/cover/deprecated.js +212 -207
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/index.js +13 -3
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/save.js +18 -5
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +14 -17
- package/build/cover/shared.js.map +1 -1
- package/build/file/edit.js +1 -1
- package/build/file/edit.js.map +1 -1
- package/build/file/save.js +9 -1
- package/build/file/save.js.map +1 -1
- package/build/gallery/gap-styles.js +14 -4
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/gallery/index.js +1 -1
- package/build/image/edit.js +5 -59
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +56 -3
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +3 -13
- package/build/image/image.js.map +1 -1
- package/build/list-item/hooks/use-split.js +17 -3
- package/build/list-item/hooks/use-split.js.map +1 -1
- package/build/navigation-link/edit.js +31 -5
- package/build/navigation-link/edit.js.map +1 -1
- package/build/post-author-name/index.js +3 -0
- package/build/post-author-name/index.js.map +1 -1
- package/build/post-author-name/transforms.js +41 -0
- package/build/post-author-name/transforms.js.map +1 -0
- package/build/post-comments-form/form.js +11 -1
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-date/edit.js +13 -7
- package/build/post-date/edit.js.map +1 -1
- package/build/search/edit.js +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +4 -0
- package/build/search/index.js.map +1 -1
- package/build/shortcode/edit.native.js +16 -13
- package/build/shortcode/edit.native.js.map +1 -1
- package/build/social-links/edit.js +2 -2
- package/build/social-links/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +11 -3
- package/build/table-of-contents/edit.js.map +1 -1
- package/build-module/button/deprecated.js +175 -35
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +2 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/save.js +2 -2
- package/build-module/button/save.js.map +1 -1
- package/build-module/columns/index.js +3 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/cover/deprecated.js +206 -198
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/index.js +14 -4
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/save.js +19 -6
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +11 -12
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/file/edit.js +2 -2
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/save.js +7 -2
- package/build-module/file/save.js.map +1 -1
- package/build-module/gallery/gap-styles.js +14 -4
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/gallery/index.js +1 -1
- package/build-module/image/edit.js +5 -56
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +57 -5
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +4 -14
- package/build-module/image/image.js.map +1 -1
- package/build-module/list-item/hooks/use-split.js +19 -5
- package/build-module/list-item/hooks/use-split.js.map +1 -1
- package/build-module/navigation-link/edit.js +31 -6
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/post-author-name/index.js +2 -0
- package/build-module/post-author-name/index.js.map +1 -1
- package/build-module/post-author-name/transforms.js +32 -0
- package/build-module/post-author-name/transforms.js.map +1 -0
- package/build-module/post-comments-form/form.js +7 -1
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-date/edit.js +15 -9
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/search/edit.js +2 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +4 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/shortcode/edit.native.js +17 -13
- package/build-module/shortcode/edit.native.js.map +1 -1
- package/build-module/social-links/edit.js +2 -2
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +12 -4
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-style/cover/style-rtl.css +32 -23
- package/build-style/cover/style.css +32 -23
- package/build-style/site-logo/style-rtl.css +4 -0
- package/build-style/site-logo/style.css +4 -0
- package/build-style/style-rtl.css +36 -23
- package/build-style/style.css +36 -23
- package/package.json +28 -28
- package/src/button/deprecated.js +145 -0
- package/src/button/edit.js +3 -1
- package/src/button/save.js +3 -1
- package/src/buttons/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/buttons/test/edit.native.js +1 -1
- package/src/columns/block.json +3 -1
- package/src/cover/deprecated.js +230 -183
- package/src/cover/edit/index.js +25 -13
- package/src/cover/save.js +26 -13
- package/src/cover/shared.js +5 -7
- package/src/cover/style.scss +27 -22
- package/src/file/edit.js +5 -1
- package/src/file/save.js +14 -2
- package/src/gallery/block.json +1 -1
- package/src/gallery/gap-styles.js +21 -6
- package/src/gallery/index.php +23 -12
- package/src/image/edit.js +1 -53
- package/src/image/edit.native.js +65 -3
- package/src/image/image.js +2 -11
- package/src/image/styles.native.scss +11 -0
- package/src/list-item/hooks/use-split.js +18 -9
- package/src/navigation-link/edit.js +35 -5
- package/src/navigation-link/test/edit.js +0 -20
- package/src/post-author/index.php +3 -2
- package/src/post-author-name/index.js +2 -0
- package/src/post-author-name/index.php +1 -1
- package/src/post-author-name/transforms.js +25 -0
- package/src/post-comments/index.php +1 -1
- package/src/post-comments-form/form.js +11 -1
- package/src/post-comments-form/index.php +1 -1
- package/src/post-date/edit.js +4 -3
- package/src/query-pagination/index.php +0 -1
- package/src/search/block.json +4 -0
- package/src/search/edit.js +3 -1
- package/src/search/index.php +28 -15
- package/src/shortcode/edit.native.js +29 -15
- package/src/shortcode/style.native.scss +11 -4
- package/src/shortcode/test/__snapshots__/edit.native.js.snap +9 -0
- package/src/shortcode/test/edit.native.js +58 -40
- package/src/site-logo/style.scss +6 -0
- package/src/social-links/edit.js +11 -10
- package/src/table-of-contents/edit.js +19 -6
|
@@ -32,7 +32,11 @@ var _shared = require("./shared");
|
|
|
32
32
|
/**
|
|
33
33
|
* Internal dependencies
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
function backgroundImageStyles(url) {
|
|
36
|
+
return url ? {
|
|
37
|
+
backgroundImage: `url(${url})`
|
|
38
|
+
} : {};
|
|
39
|
+
}
|
|
36
40
|
/**
|
|
37
41
|
* Original function to determine the background opacity classname
|
|
38
42
|
*
|
|
@@ -41,6 +45,8 @@ var _shared = require("./shared");
|
|
|
41
45
|
* @param {number} ratio ratio to use for opacity.
|
|
42
46
|
* @return {string} background opacity class .
|
|
43
47
|
*/
|
|
48
|
+
|
|
49
|
+
|
|
44
50
|
function dimRatioToClassV1(ratio) {
|
|
45
51
|
return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
|
|
46
52
|
}
|
|
@@ -79,96 +85,190 @@ const blockAttributes = {
|
|
|
79
85
|
focalPoint: {
|
|
80
86
|
type: 'object'
|
|
81
87
|
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
url: {
|
|
87
|
-
type: 'string'
|
|
88
|
-
},
|
|
89
|
-
id: {
|
|
90
|
-
type: 'number'
|
|
91
|
-
},
|
|
92
|
-
alt: {
|
|
93
|
-
type: 'string',
|
|
94
|
-
source: 'attribute',
|
|
95
|
-
selector: 'img',
|
|
96
|
-
attribute: 'alt',
|
|
97
|
-
default: ''
|
|
98
|
-
},
|
|
99
|
-
hasParallax: {
|
|
100
|
-
type: 'boolean',
|
|
101
|
-
default: false
|
|
102
|
-
},
|
|
103
|
-
isRepeated: {
|
|
104
|
-
type: 'boolean',
|
|
105
|
-
default: false
|
|
106
|
-
},
|
|
107
|
-
dimRatio: {
|
|
108
|
-
type: 'number',
|
|
109
|
-
default: 100
|
|
110
|
-
},
|
|
111
|
-
overlayColor: {
|
|
112
|
-
type: 'string'
|
|
113
|
-
},
|
|
114
|
-
customOverlayColor: {
|
|
115
|
-
type: 'string'
|
|
116
|
-
},
|
|
117
|
-
backgroundType: {
|
|
118
|
-
type: 'string',
|
|
119
|
-
default: 'image'
|
|
120
|
-
},
|
|
121
|
-
focalPoint: {
|
|
122
|
-
type: 'object'
|
|
123
|
-
},
|
|
124
|
-
minHeight: {
|
|
125
|
-
type: 'number'
|
|
126
|
-
},
|
|
127
|
-
minHeightUnit: {
|
|
128
|
-
type: 'string'
|
|
129
|
-
},
|
|
130
|
-
gradient: {
|
|
131
|
-
type: 'string'
|
|
132
|
-
},
|
|
133
|
-
customGradient: {
|
|
134
|
-
type: 'string'
|
|
135
|
-
},
|
|
136
|
-
contentPosition: {
|
|
137
|
-
type: 'string'
|
|
138
|
-
},
|
|
139
|
-
isDark: {
|
|
140
|
-
type: 'boolean',
|
|
141
|
-
default: true
|
|
142
|
-
},
|
|
143
|
-
allowedBlocks: {
|
|
144
|
-
type: 'array'
|
|
145
|
-
},
|
|
146
|
-
templateLock: {
|
|
147
|
-
type: ['string', 'boolean'],
|
|
148
|
-
enum: ['all', 'insert', false]
|
|
149
|
-
}
|
|
88
|
+
};
|
|
89
|
+
const v8ToV10BlockAttributes = {
|
|
90
|
+
url: {
|
|
91
|
+
type: 'string'
|
|
150
92
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
93
|
+
id: {
|
|
94
|
+
type: 'number'
|
|
95
|
+
},
|
|
96
|
+
alt: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
source: 'attribute',
|
|
99
|
+
selector: 'img',
|
|
100
|
+
attribute: 'alt',
|
|
101
|
+
default: ''
|
|
102
|
+
},
|
|
103
|
+
hasParallax: {
|
|
104
|
+
type: 'boolean',
|
|
105
|
+
default: false
|
|
106
|
+
},
|
|
107
|
+
isRepeated: {
|
|
108
|
+
type: 'boolean',
|
|
109
|
+
default: false
|
|
110
|
+
},
|
|
111
|
+
dimRatio: {
|
|
112
|
+
type: 'number',
|
|
113
|
+
default: 100
|
|
114
|
+
},
|
|
115
|
+
overlayColor: {
|
|
116
|
+
type: 'string'
|
|
117
|
+
},
|
|
118
|
+
customOverlayColor: {
|
|
119
|
+
type: 'string'
|
|
120
|
+
},
|
|
121
|
+
backgroundType: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
default: 'image'
|
|
124
|
+
},
|
|
125
|
+
focalPoint: {
|
|
126
|
+
type: 'object'
|
|
127
|
+
},
|
|
128
|
+
minHeight: {
|
|
129
|
+
type: 'number'
|
|
130
|
+
},
|
|
131
|
+
minHeightUnit: {
|
|
132
|
+
type: 'string'
|
|
133
|
+
},
|
|
134
|
+
gradient: {
|
|
135
|
+
type: 'string'
|
|
136
|
+
},
|
|
137
|
+
customGradient: {
|
|
138
|
+
type: 'string'
|
|
139
|
+
},
|
|
140
|
+
contentPosition: {
|
|
141
|
+
type: 'string'
|
|
142
|
+
},
|
|
143
|
+
isDark: {
|
|
144
|
+
type: 'boolean',
|
|
145
|
+
default: true
|
|
146
|
+
},
|
|
147
|
+
allowedBlocks: {
|
|
148
|
+
type: 'array'
|
|
149
|
+
},
|
|
150
|
+
templateLock: {
|
|
151
|
+
type: ['string', 'boolean'],
|
|
152
|
+
enum: ['all', 'insert', false]
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const v7toV10BlockSupports = {
|
|
156
|
+
anchor: true,
|
|
157
|
+
align: true,
|
|
158
|
+
html: false,
|
|
159
|
+
spacing: {
|
|
160
|
+
padding: true,
|
|
161
|
+
__experimentalDefaultControls: {
|
|
162
|
+
padding: true
|
|
165
163
|
}
|
|
166
164
|
},
|
|
165
|
+
color: {
|
|
166
|
+
__experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
|
|
167
|
+
text: false,
|
|
168
|
+
background: false
|
|
169
|
+
}
|
|
170
|
+
}; // Deprecation for blocks that renders fixed background as backgroud from the main block container.
|
|
171
|
+
|
|
172
|
+
const v10 = {
|
|
173
|
+
attributes: v8ToV10BlockAttributes,
|
|
174
|
+
supports: v7toV10BlockSupports,
|
|
167
175
|
|
|
168
176
|
save(_ref) {
|
|
169
177
|
let {
|
|
170
178
|
attributes
|
|
171
179
|
} = _ref;
|
|
180
|
+
const {
|
|
181
|
+
backgroundType,
|
|
182
|
+
gradient,
|
|
183
|
+
contentPosition,
|
|
184
|
+
customGradient,
|
|
185
|
+
customOverlayColor,
|
|
186
|
+
dimRatio,
|
|
187
|
+
focalPoint,
|
|
188
|
+
useFeaturedImage,
|
|
189
|
+
hasParallax,
|
|
190
|
+
isDark,
|
|
191
|
+
isRepeated,
|
|
192
|
+
overlayColor,
|
|
193
|
+
url,
|
|
194
|
+
alt,
|
|
195
|
+
id,
|
|
196
|
+
minHeight: minHeightProp,
|
|
197
|
+
minHeightUnit
|
|
198
|
+
} = attributes;
|
|
199
|
+
const overlayColorClass = (0, _blockEditor.getColorClassName)('background-color', overlayColor);
|
|
200
|
+
const gradientClass = (0, _blockEditor.__experimentalGetGradientClass)(gradient);
|
|
201
|
+
const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
|
|
202
|
+
const isImageBackground = _shared.IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
203
|
+
const isVideoBackground = _shared.VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
204
|
+
const isImgElement = !(hasParallax || isRepeated);
|
|
205
|
+
const style = { ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}),
|
|
206
|
+
minHeight: minHeight || undefined
|
|
207
|
+
};
|
|
208
|
+
const bgStyle = {
|
|
209
|
+
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
|
|
210
|
+
background: customGradient ? customGradient : undefined
|
|
211
|
+
};
|
|
212
|
+
const objectPosition = // prettier-ignore
|
|
213
|
+
focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined;
|
|
214
|
+
const classes = (0, _classnames.default)({
|
|
215
|
+
'is-light': !isDark,
|
|
216
|
+
'has-parallax': hasParallax,
|
|
217
|
+
'is-repeated': isRepeated,
|
|
218
|
+
'has-custom-content-position': !(0, _shared.isContentPositionCenter)(contentPosition)
|
|
219
|
+
}, (0, _shared.getPositionClassName)(contentPosition));
|
|
220
|
+
const gradientValue = gradient || customGradient;
|
|
221
|
+
return (0, _element.createElement)("div", _blockEditor.useBlockProps.save({
|
|
222
|
+
className: classes,
|
|
223
|
+
style
|
|
224
|
+
}), (0, _element.createElement)("span", {
|
|
225
|
+
"aria-hidden": "true",
|
|
226
|
+
className: (0, _classnames.default)('wp-block-cover__background', overlayColorClass, (0, _shared.dimRatioToClass)(dimRatio), {
|
|
227
|
+
'has-background-dim': dimRatio !== undefined,
|
|
228
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
229
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
230
|
+
// media, a gradient and a dim.
|
|
231
|
+
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
|
|
232
|
+
'has-background-gradient': gradientValue,
|
|
233
|
+
[gradientClass]: gradientClass
|
|
234
|
+
}),
|
|
235
|
+
style: bgStyle
|
|
236
|
+
}), !useFeaturedImage && isImageBackground && isImgElement && url && (0, _element.createElement)("img", {
|
|
237
|
+
className: (0, _classnames.default)('wp-block-cover__image-background', id ? `wp-image-${id}` : null),
|
|
238
|
+
alt: alt,
|
|
239
|
+
src: url,
|
|
240
|
+
style: {
|
|
241
|
+
objectPosition
|
|
242
|
+
},
|
|
243
|
+
"data-object-fit": "cover",
|
|
244
|
+
"data-object-position": objectPosition
|
|
245
|
+
}), isVideoBackground && url && (0, _element.createElement)("video", {
|
|
246
|
+
className: (0, _classnames.default)('wp-block-cover__video-background', 'intrinsic-ignore'),
|
|
247
|
+
autoPlay: true,
|
|
248
|
+
muted: true,
|
|
249
|
+
loop: true,
|
|
250
|
+
playsInline: true,
|
|
251
|
+
src: url,
|
|
252
|
+
style: {
|
|
253
|
+
objectPosition
|
|
254
|
+
},
|
|
255
|
+
"data-object-fit": "cover",
|
|
256
|
+
"data-object-position": objectPosition
|
|
257
|
+
}), (0, _element.createElement)("div", _blockEditor.useInnerBlocksProps.save({
|
|
258
|
+
className: 'wp-block-cover__inner-container'
|
|
259
|
+
})));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
}; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`.
|
|
263
|
+
|
|
264
|
+
const v9 = {
|
|
265
|
+
attributes: v8ToV10BlockAttributes,
|
|
266
|
+
supports: v7toV10BlockSupports,
|
|
267
|
+
|
|
268
|
+
save(_ref2) {
|
|
269
|
+
let {
|
|
270
|
+
attributes
|
|
271
|
+
} = _ref2;
|
|
172
272
|
const {
|
|
173
273
|
backgroundType,
|
|
174
274
|
gradient,
|
|
@@ -193,7 +293,7 @@ const v9 = {
|
|
|
193
293
|
const isImageBackground = _shared.IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
194
294
|
const isVideoBackground = _shared.VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
195
295
|
const isImgElement = !(hasParallax || isRepeated);
|
|
196
|
-
const style = { ...(isImageBackground && !isImgElement ?
|
|
296
|
+
const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
|
|
197
297
|
minHeight: minHeight || undefined
|
|
198
298
|
};
|
|
199
299
|
const bgStyle = {
|
|
@@ -253,93 +353,13 @@ const v9 = {
|
|
|
253
353
|
}; // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`.
|
|
254
354
|
|
|
255
355
|
const v8 = {
|
|
256
|
-
attributes:
|
|
257
|
-
|
|
258
|
-
type: 'string'
|
|
259
|
-
},
|
|
260
|
-
id: {
|
|
261
|
-
type: 'number'
|
|
262
|
-
},
|
|
263
|
-
alt: {
|
|
264
|
-
type: 'string',
|
|
265
|
-
source: 'attribute',
|
|
266
|
-
selector: 'img',
|
|
267
|
-
attribute: 'alt',
|
|
268
|
-
default: ''
|
|
269
|
-
},
|
|
270
|
-
hasParallax: {
|
|
271
|
-
type: 'boolean',
|
|
272
|
-
default: false
|
|
273
|
-
},
|
|
274
|
-
isRepeated: {
|
|
275
|
-
type: 'boolean',
|
|
276
|
-
default: false
|
|
277
|
-
},
|
|
278
|
-
dimRatio: {
|
|
279
|
-
type: 'number',
|
|
280
|
-
default: 100
|
|
281
|
-
},
|
|
282
|
-
overlayColor: {
|
|
283
|
-
type: 'string'
|
|
284
|
-
},
|
|
285
|
-
customOverlayColor: {
|
|
286
|
-
type: 'string'
|
|
287
|
-
},
|
|
288
|
-
backgroundType: {
|
|
289
|
-
type: 'string',
|
|
290
|
-
default: 'image'
|
|
291
|
-
},
|
|
292
|
-
focalPoint: {
|
|
293
|
-
type: 'object'
|
|
294
|
-
},
|
|
295
|
-
minHeight: {
|
|
296
|
-
type: 'number'
|
|
297
|
-
},
|
|
298
|
-
minHeightUnit: {
|
|
299
|
-
type: 'string'
|
|
300
|
-
},
|
|
301
|
-
gradient: {
|
|
302
|
-
type: 'string'
|
|
303
|
-
},
|
|
304
|
-
customGradient: {
|
|
305
|
-
type: 'string'
|
|
306
|
-
},
|
|
307
|
-
contentPosition: {
|
|
308
|
-
type: 'string'
|
|
309
|
-
},
|
|
310
|
-
isDark: {
|
|
311
|
-
type: 'boolean',
|
|
312
|
-
default: true
|
|
313
|
-
},
|
|
314
|
-
allowedBlocks: {
|
|
315
|
-
type: 'array'
|
|
316
|
-
},
|
|
317
|
-
templateLock: {
|
|
318
|
-
type: ['string', 'boolean'],
|
|
319
|
-
enum: ['all', 'insert', false]
|
|
320
|
-
}
|
|
321
|
-
},
|
|
322
|
-
supports: {
|
|
323
|
-
anchor: true,
|
|
324
|
-
align: true,
|
|
325
|
-
html: false,
|
|
326
|
-
spacing: {
|
|
327
|
-
padding: true,
|
|
328
|
-
__experimentalDefaultControls: {
|
|
329
|
-
padding: true
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
color: {
|
|
333
|
-
__experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
|
|
334
|
-
text: false,
|
|
335
|
-
background: false
|
|
336
|
-
}
|
|
337
|
-
},
|
|
356
|
+
attributes: v8ToV10BlockAttributes,
|
|
357
|
+
supports: v7toV10BlockSupports,
|
|
338
358
|
|
|
339
|
-
save(
|
|
359
|
+
save(_ref3) {
|
|
340
360
|
let {
|
|
341
361
|
attributes
|
|
342
|
-
} =
|
|
362
|
+
} = _ref3;
|
|
343
363
|
const {
|
|
344
364
|
backgroundType,
|
|
345
365
|
gradient,
|
|
@@ -364,7 +384,7 @@ const v8 = {
|
|
|
364
384
|
const isImageBackground = _shared.IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
365
385
|
const isVideoBackground = _shared.VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
366
386
|
const isImgElement = !(hasParallax || isRepeated);
|
|
367
|
-
const style = { ...(isImageBackground && !isImgElement ?
|
|
387
|
+
const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
|
|
368
388
|
minHeight: minHeight || undefined
|
|
369
389
|
};
|
|
370
390
|
const bgStyle = {
|
|
@@ -446,27 +466,12 @@ const v7 = {
|
|
|
446
466
|
default: ''
|
|
447
467
|
}
|
|
448
468
|
},
|
|
449
|
-
supports:
|
|
450
|
-
anchor: true,
|
|
451
|
-
align: true,
|
|
452
|
-
html: false,
|
|
453
|
-
spacing: {
|
|
454
|
-
padding: true,
|
|
455
|
-
__experimentalDefaultControls: {
|
|
456
|
-
padding: true
|
|
457
|
-
}
|
|
458
|
-
},
|
|
459
|
-
color: {
|
|
460
|
-
__experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background',
|
|
461
|
-
text: false,
|
|
462
|
-
background: false
|
|
463
|
-
}
|
|
464
|
-
},
|
|
469
|
+
supports: v7toV10BlockSupports,
|
|
465
470
|
|
|
466
|
-
save(
|
|
471
|
+
save(_ref4) {
|
|
467
472
|
let {
|
|
468
473
|
attributes
|
|
469
|
-
} =
|
|
474
|
+
} = _ref4;
|
|
470
475
|
const {
|
|
471
476
|
backgroundType,
|
|
472
477
|
gradient,
|
|
@@ -490,7 +495,7 @@ const v7 = {
|
|
|
490
495
|
const isImageBackground = _shared.IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
491
496
|
const isVideoBackground = _shared.VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
492
497
|
const isImgElement = !(hasParallax || isRepeated);
|
|
493
|
-
const style = { ...(isImageBackground && !isImgElement ?
|
|
498
|
+
const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}),
|
|
494
499
|
backgroundColor: !overlayColorClass ? customOverlayColor : undefined,
|
|
495
500
|
background: customGradient && !url ? customGradient : undefined,
|
|
496
501
|
minHeight: minHeight || undefined
|
|
@@ -568,10 +573,10 @@ const v6 = {
|
|
|
568
573
|
align: true
|
|
569
574
|
},
|
|
570
575
|
|
|
571
|
-
save(
|
|
576
|
+
save(_ref5) {
|
|
572
577
|
let {
|
|
573
578
|
attributes
|
|
574
|
-
} =
|
|
579
|
+
} = _ref5;
|
|
575
580
|
const {
|
|
576
581
|
backgroundType,
|
|
577
582
|
gradient,
|
|
@@ -592,7 +597,7 @@ const v6 = {
|
|
|
592
597
|
const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp;
|
|
593
598
|
const isImageBackground = _shared.IMAGE_BACKGROUND_TYPE === backgroundType;
|
|
594
599
|
const isVideoBackground = _shared.VIDEO_BACKGROUND_TYPE === backgroundType;
|
|
595
|
-
const style = isImageBackground ?
|
|
600
|
+
const style = isImageBackground ? backgroundImageStyles(url) : {};
|
|
596
601
|
const videoStyle = {};
|
|
597
602
|
|
|
598
603
|
if (!overlayColorClass) {
|
|
@@ -666,10 +671,10 @@ const v5 = {
|
|
|
666
671
|
align: true
|
|
667
672
|
},
|
|
668
673
|
|
|
669
|
-
save(
|
|
674
|
+
save(_ref6) {
|
|
670
675
|
let {
|
|
671
676
|
attributes
|
|
672
|
-
} =
|
|
677
|
+
} = _ref6;
|
|
673
678
|
const {
|
|
674
679
|
backgroundType,
|
|
675
680
|
gradient,
|
|
@@ -684,7 +689,7 @@ const v5 = {
|
|
|
684
689
|
} = attributes;
|
|
685
690
|
const overlayColorClass = (0, _blockEditor.getColorClassName)('background-color', overlayColor);
|
|
686
691
|
const gradientClass = (0, _blockEditor.__experimentalGetGradientClass)(gradient);
|
|
687
|
-
const style = backgroundType === _shared.IMAGE_BACKGROUND_TYPE ?
|
|
692
|
+
const style = backgroundType === _shared.IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
|
|
688
693
|
|
|
689
694
|
if (!overlayColorClass) {
|
|
690
695
|
style.backgroundColor = customOverlayColor;
|
|
@@ -743,10 +748,10 @@ const v4 = {
|
|
|
743
748
|
align: true
|
|
744
749
|
},
|
|
745
750
|
|
|
746
|
-
save(
|
|
751
|
+
save(_ref7) {
|
|
747
752
|
let {
|
|
748
753
|
attributes
|
|
749
|
-
} =
|
|
754
|
+
} = _ref7;
|
|
750
755
|
const {
|
|
751
756
|
backgroundType,
|
|
752
757
|
gradient,
|
|
@@ -761,7 +766,7 @@ const v4 = {
|
|
|
761
766
|
} = attributes;
|
|
762
767
|
const overlayColorClass = (0, _blockEditor.getColorClassName)('background-color', overlayColor);
|
|
763
768
|
const gradientClass = (0, _blockEditor.__experimentalGetGradientClass)(gradient);
|
|
764
|
-
const style = backgroundType === _shared.IMAGE_BACKGROUND_TYPE ?
|
|
769
|
+
const style = backgroundType === _shared.IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
|
|
765
770
|
|
|
766
771
|
if (!overlayColorClass) {
|
|
767
772
|
style.backgroundColor = customOverlayColor;
|
|
@@ -820,10 +825,10 @@ const v3 = {
|
|
|
820
825
|
align: true
|
|
821
826
|
},
|
|
822
827
|
|
|
823
|
-
save(
|
|
828
|
+
save(_ref8) {
|
|
824
829
|
let {
|
|
825
830
|
attributes
|
|
826
|
-
} =
|
|
831
|
+
} = _ref8;
|
|
827
832
|
const {
|
|
828
833
|
backgroundType,
|
|
829
834
|
contentAlign,
|
|
@@ -836,7 +841,7 @@ const v3 = {
|
|
|
836
841
|
url
|
|
837
842
|
} = attributes;
|
|
838
843
|
const overlayColorClass = (0, _blockEditor.getColorClassName)('background-color', overlayColor);
|
|
839
|
-
const style = backgroundType === _shared.IMAGE_BACKGROUND_TYPE ?
|
|
844
|
+
const style = backgroundType === _shared.IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {};
|
|
840
845
|
|
|
841
846
|
if (!overlayColorClass) {
|
|
842
847
|
style.backgroundColor = customOverlayColor;
|
|
@@ -899,10 +904,10 @@ const v2 = {
|
|
|
899
904
|
className: false
|
|
900
905
|
},
|
|
901
906
|
|
|
902
|
-
save(
|
|
907
|
+
save(_ref9) {
|
|
903
908
|
let {
|
|
904
909
|
attributes
|
|
905
|
-
} =
|
|
910
|
+
} = _ref9;
|
|
906
911
|
const {
|
|
907
912
|
url,
|
|
908
913
|
title,
|
|
@@ -914,7 +919,7 @@ const v2 = {
|
|
|
914
919
|
customOverlayColor
|
|
915
920
|
} = attributes;
|
|
916
921
|
const overlayColorClass = (0, _blockEditor.getColorClassName)('background-color', overlayColor);
|
|
917
|
-
const style =
|
|
922
|
+
const style = backgroundImageStyles(url);
|
|
918
923
|
|
|
919
924
|
if (!overlayColorClass) {
|
|
920
925
|
style.backgroundColor = customOverlayColor;
|
|
@@ -967,10 +972,10 @@ const v1 = {
|
|
|
967
972
|
className: false
|
|
968
973
|
},
|
|
969
974
|
|
|
970
|
-
save(
|
|
975
|
+
save(_ref10) {
|
|
971
976
|
let {
|
|
972
977
|
attributes
|
|
973
|
-
} =
|
|
978
|
+
} = _ref10;
|
|
974
979
|
const {
|
|
975
980
|
url,
|
|
976
981
|
title,
|
|
@@ -978,7 +983,7 @@ const v1 = {
|
|
|
978
983
|
dimRatio,
|
|
979
984
|
align
|
|
980
985
|
} = attributes;
|
|
981
|
-
const style =
|
|
986
|
+
const style = backgroundImageStyles(url);
|
|
982
987
|
const classes = (0, _classnames.default)('wp-block-cover-image', dimRatioToClassV1(dimRatio), {
|
|
983
988
|
'has-background-dim': dimRatio !== 0,
|
|
984
989
|
'has-parallax': hasParallax
|
|
@@ -1005,6 +1010,6 @@ const v1 = {
|
|
|
1005
1010
|
}
|
|
1006
1011
|
|
|
1007
1012
|
};
|
|
1008
|
-
var _default = [v9, v8, v7, v6, v5, v4, v3, v2, v1];
|
|
1013
|
+
var _default = [v10, v9, v8, v7, v6, v5, v4, v3, v2, v1];
|
|
1009
1014
|
exports.default = _default;
|
|
1010
1015
|
//# sourceMappingURL=deprecated.js.map
|