block.json
134 lines
| 1 | { |
| 2 | "$schema": "https://schemas.wp.org/trunk/block.json", |
| 3 | "apiVersion": 3, |
| 4 | "name": "surecart/product-buy-button-old", |
| 5 | "title": "Product Cart Button", |
| 6 | "category": "surecart", |
| 7 | "description": "Add a buy now or add to cart button.", |
| 8 | "keywords": ["buy"], |
| 9 | "textdomain": "default", |
| 10 | "attributes": { |
| 11 | "add_to_cart": { |
| 12 | "type": "boolean", |
| 13 | "default": false |
| 14 | }, |
| 15 | "out_of_stock_text": { |
| 16 | "type": "string", |
| 17 | "default": "Sold out" |
| 18 | }, |
| 19 | "unavailable_text": { |
| 20 | "type": "string", |
| 21 | "default": "Unavailable" |
| 22 | }, |
| 23 | "textAlign": { |
| 24 | "type": "string" |
| 25 | }, |
| 26 | "type": { |
| 27 | "type": "string" |
| 28 | }, |
| 29 | "text": { |
| 30 | "type": "string" |
| 31 | }, |
| 32 | "placeholder": { |
| 33 | "type": "string" |
| 34 | }, |
| 35 | "backgroundColor": { |
| 36 | "type": "string" |
| 37 | }, |
| 38 | "textColor": { |
| 39 | "type": "string" |
| 40 | }, |
| 41 | "gradient": { |
| 42 | "type": "string" |
| 43 | }, |
| 44 | "width": { |
| 45 | "type": "number", |
| 46 | "default": 100 |
| 47 | }, |
| 48 | "id": { |
| 49 | "type": "string" |
| 50 | } |
| 51 | }, |
| 52 | "supports": { |
| 53 | "interactivity": true, |
| 54 | "anchor": true, |
| 55 | "align": false, |
| 56 | "alignWide": false, |
| 57 | "spacing": { |
| 58 | "__experimentalSkipSerialization": true, |
| 59 | "padding": ["horizontal", "vertical"], |
| 60 | "margin": ["top", "bottom"] |
| 61 | }, |
| 62 | "color": { |
| 63 | "__experimentalSkipSerialization": true, |
| 64 | "gradients": true, |
| 65 | "__experimentalDefaultControls": { |
| 66 | "background": true, |
| 67 | "text": true |
| 68 | } |
| 69 | }, |
| 70 | "__experimentalSelector": ".wp-block-button .wp-block-button__link", |
| 71 | "typography": { |
| 72 | "fontSize": true, |
| 73 | "__experimentalFontFamily": true, |
| 74 | "__experimentalFontWeight": true, |
| 75 | "__experimentalFontStyle": true, |
| 76 | "__experimentalTextTransform": true |
| 77 | }, |
| 78 | "reusable": false, |
| 79 | "shadow": true, |
| 80 | "__experimentalBorder": { |
| 81 | "color": true, |
| 82 | "radius": true, |
| 83 | "style": true, |
| 84 | "width": true, |
| 85 | "__experimentalSkipSerialization": true, |
| 86 | "__experimentalDefaultControls": { |
| 87 | "color": true, |
| 88 | "radius": true, |
| 89 | "style": true, |
| 90 | "width": true |
| 91 | } |
| 92 | } |
| 93 | }, |
| 94 | "variations": [ |
| 95 | { |
| 96 | "name": "cart", |
| 97 | "title": "Add To Cart Button", |
| 98 | "icon": "cart", |
| 99 | "description": "Add a button to add the product to the cart.", |
| 100 | "attributes": { |
| 101 | "add_to_cart": true, |
| 102 | "text": "Add To Cart" |
| 103 | }, |
| 104 | "isDefault": true, |
| 105 | "isActive": ["add_to_cart"], |
| 106 | "scope": ["inserter", "block", "transform"] |
| 107 | }, |
| 108 | { |
| 109 | "name": "buy", |
| 110 | "title": "Buy Now Button", |
| 111 | "icon": "store", |
| 112 | "description": "Add a button to buy the product.", |
| 113 | "attributes": { |
| 114 | "add_to_cart": false, |
| 115 | "text": "Buy Now" |
| 116 | }, |
| 117 | "isActive": ["add_to_cart"], |
| 118 | "scope": ["inserter", "block", "transform"] |
| 119 | } |
| 120 | ], |
| 121 | "styles": [ |
| 122 | { "name": "fill", "label": "Fill", "isDefault": true }, |
| 123 | { "name": "outline", "label": "Outline" } |
| 124 | ], |
| 125 | "script": "surecart-components", |
| 126 | "editorStyle": "wp-block-button-editor", |
| 127 | "style": ["file:./style.css", "surecart-themes-default", "wp-block-button"], |
| 128 | "viewScriptModule": [ |
| 129 | "@surecart/checkout", |
| 130 | "@surecart/cart", |
| 131 | "@surecart/product-page" |
| 132 | ] |
| 133 | } |
| 134 |