resizer-image-block 5.18.1-arc-themes-release-version-1.24.3531
Install from the command line:
Learn more about npm packages
$ npm install @wpmedia/resizer-image-block@5.18.1-arc-themes-release-version-1.24.3531
Install via package.json:
"@wpmedia/resizer-image-block": "5.18.1-arc-themes-release-version-1.24.3531"
About this version
This is a helper to transform the return value of the content sources. This is specifically to make sure that resized image urls are available at themes' blocks.json
widths.
- Add AC relevant to the block
Prop | Required | Type | Description |
---|---|---|---|
required prop | yes | ||
optional prop | no | ||
contentConfig example | Please specify which content sources are compatible |
Outline any schema information requirements necessary to know for this block
- n/a
Phrase key | Default (English) |
---|---|
key |
english translation |
Blocks can emit events. The following is a list of events that are emitted by this block.
Event Name | Description |
---|---|
eventName | Describe the event |
Include block specific instructions for event listening.
import getResizedImageData from '@wpmedia/resizer-image-block';
const params = {
_id: 'text',
website_url: 'text',
};
const resolve = (key = {}) => {
const site = key['arc-site'];
const { website_url: websiteUrl, _id: id } = key;
return `/content/v4/?${id ? `_id=${id}` : `website_url=${websiteUrl}`}${site ? `&website=${site}` : ''}`;
};
const transform = (data, query) => (
getResizedImageData(
data,
null,
null,
null,
query['arc-site'],
)
);
export default {
schemaName: 'ans-item',
params,
resolve,
transform,
};
blocks.json:
"values": {
"default": {
"siteProperties": {
...
"imageWidths": [
158,
274
],
"aspectRatios": [
"1.85:1",
"3:2",
"4:3"
],
...
Details
- resizer-image-block
- WPMedia
- over 2 years ago
- CC-BY-NC-ND-4.0
- 3 dependencies
Assets
- resizer-image-block-5.18.1-arc-themes-release-version-1.24.3531.tgz
Download activity
- Total downloads 17,846
- Last 30 days 9
- Last week 3
- Today 0