block.json
119 lines
| 1 | { |
| 2 | "name": "kubio/post-featured-image", |
| 3 | "category": "kubio-blog-components", |
| 4 | "attributes": { |
| 5 | "kubio": { |
| 6 | "type": "object" |
| 7 | }, |
| 8 | "showPlaceholder": { |
| 9 | "type": "boolean", |
| 10 | "default": false |
| 11 | }, |
| 12 | "imageSize": { |
| 13 | "type": "string", |
| 14 | "default": "cover" |
| 15 | }, |
| 16 | "addLink": { |
| 17 | "type": "boolean", |
| 18 | "default": false |
| 19 | } |
| 20 | }, |
| 21 | "usesContext": [ |
| 22 | "postId", |
| 23 | "postType" |
| 24 | ], |
| 25 | "supports": { |
| 26 | "kubio": { |
| 27 | "appearanceEffect": true, |
| 28 | "default": { |
| 29 | "style": { |
| 30 | "descendants": { |
| 31 | "container": { |
| 32 | "background": { |
| 33 | "color": "#F79007" |
| 34 | }, |
| 35 | "textAlign": "center", |
| 36 | "height": { |
| 37 | "value": 300, |
| 38 | "unit": "px" |
| 39 | } |
| 40 | }, |
| 41 | "image": { |
| 42 | "object": { |
| 43 | "position": "center center", |
| 44 | "fit": "cover" |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | }, |
| 49 | "props": { |
| 50 | "aspectRatio": "16-9", |
| 51 | "verticalAlign": "center" |
| 52 | } |
| 53 | }, |
| 54 | "elementsEnum": { |
| 55 | "INNER": "inner", |
| 56 | "CONTAINER": "container", |
| 57 | "IMAGE": "image", |
| 58 | "ALIGN": "align" |
| 59 | }, |
| 60 | "elementsByName": { |
| 61 | "container": { |
| 62 | "default": true, |
| 63 | "wrapper": true, |
| 64 | "props": { |
| 65 | "tag": "figure" |
| 66 | } |
| 67 | }, |
| 68 | "inner": {}, |
| 69 | "image": { |
| 70 | "props": { |
| 71 | "tag": "img" |
| 72 | } |
| 73 | }, |
| 74 | "align": { |
| 75 | "props": { |
| 76 | "className": [ |
| 77 | "h-y-container" |
| 78 | ] |
| 79 | } |
| 80 | } |
| 81 | }, |
| 82 | "template": { |
| 83 | "type": "element", |
| 84 | "props": { |
| 85 | "name": "container" |
| 86 | }, |
| 87 | "children": [ |
| 88 | { |
| 89 | "type": "element", |
| 90 | "props": { |
| 91 | "shouldRender": "computed.showImage", |
| 92 | "name": "image" |
| 93 | } |
| 94 | }, |
| 95 | { |
| 96 | "type": "element", |
| 97 | "props": { |
| 98 | "name": "inner" |
| 99 | }, |
| 100 | "children": [ |
| 101 | { |
| 102 | "type": "element", |
| 103 | "props": { |
| 104 | "name": "align" |
| 105 | }, |
| 106 | "children": [ |
| 107 | { |
| 108 | "type": "wp:InnerBlocks" |
| 109 | } |
| 110 | ] |
| 111 | } |
| 112 | ] |
| 113 | } |
| 114 | ] |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 |