block.json
11 months ago
controller.php
1 year ago
index.asset.php
6 months ago
index.js
6 months ago
view.php
4 months ago
block.json
171 lines
| 1 | { |
| 2 | "$schema": "https://schemas.wp.org/trunk/block.json", |
| 3 | "apiVersion": 3, |
| 4 | "name": "surecart/product-buy-button", |
| 5 | "title": "Product Buy Button", |
| 6 | "description": "Display the product buy button.", |
| 7 | "version": "1.0.0", |
| 8 | "category": "surecart-product-page", |
| 9 | "icon": "media-interactive", |
| 10 | "example": {}, |
| 11 | "ancestor": [ |
| 12 | "surecart/product-buy-buttons" |
| 13 | ], |
| 14 | "usesContext": [ |
| 15 | "surecart/product", |
| 16 | "postId", |
| 17 | "providerBlock" |
| 18 | ], |
| 19 | "attributes": { |
| 20 | "add_to_cart": { |
| 21 | "type": "boolean", |
| 22 | "default": false |
| 23 | }, |
| 24 | "show_sticky_purchase_button": { |
| 25 | "type": "string", |
| 26 | "enum": [ |
| 27 | "never", |
| 28 | "in_stock", |
| 29 | "always" |
| 30 | ], |
| 31 | "default": "never" |
| 32 | }, |
| 33 | "text": { |
| 34 | "type": "string" |
| 35 | }, |
| 36 | "out_of_stock_text": { |
| 37 | "type": "string" |
| 38 | }, |
| 39 | "unavailable_text": { |
| 40 | "type": "string" |
| 41 | }, |
| 42 | "width": { |
| 43 | "type": "number", |
| 44 | "default": 100 |
| 45 | } |
| 46 | }, |
| 47 | "supports": { |
| 48 | "interactivity": true, |
| 49 | "anchor": true, |
| 50 | "spacing": { |
| 51 | "__experimentalSkipSerialization": true, |
| 52 | "padding": [ |
| 53 | "horizontal", |
| 54 | "vertical" |
| 55 | ], |
| 56 | "margin": [ |
| 57 | "top", |
| 58 | "bottom" |
| 59 | ] |
| 60 | }, |
| 61 | "color": { |
| 62 | "__experimentalSkipSerialization": true, |
| 63 | "gradients": true, |
| 64 | "__experimentalDefaultControls": { |
| 65 | "background": true, |
| 66 | "text": true |
| 67 | } |
| 68 | }, |
| 69 | "__experimentalSelector": ".wp-block-button .wp-block-button__link", |
| 70 | "typography": { |
| 71 | "fontSize": true, |
| 72 | "__experimentalFontFamily": true, |
| 73 | "__experimentalFontWeight": true, |
| 74 | "__experimentalFontStyle": true, |
| 75 | "__experimentalTextTransform": true |
| 76 | }, |
| 77 | "reusable": false, |
| 78 | "__experimentalBorder": { |
| 79 | "color": true, |
| 80 | "radius": true, |
| 81 | "style": true, |
| 82 | "width": true, |
| 83 | "__experimentalSkipSerialization": true, |
| 84 | "__experimentalDefaultControls": { |
| 85 | "color": true, |
| 86 | "radius": true, |
| 87 | "style": true, |
| 88 | "width": true |
| 89 | } |
| 90 | }, |
| 91 | "__experimentalStyle": { |
| 92 | "variations": { |
| 93 | "outline": { |
| 94 | "border": { |
| 95 | "color": "currentColor", |
| 96 | "width": "2px", |
| 97 | "style": "solid" |
| 98 | }, |
| 99 | "color": { |
| 100 | "text": "currentColor", |
| 101 | "gradient": "transparent none" |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | }, |
| 107 | "variations": [ |
| 108 | { |
| 109 | "name": "cart", |
| 110 | "title": "Add To Cart Button", |
| 111 | "icon": "cart", |
| 112 | "description": "Add a button to add the product to the cart.", |
| 113 | "attributes": { |
| 114 | "add_to_cart": true, |
| 115 | "text": "Add To Cart" |
| 116 | }, |
| 117 | "isDefault": true, |
| 118 | "isActive": [ |
| 119 | "add_to_cart" |
| 120 | ], |
| 121 | "scope": [ |
| 122 | "inserter", |
| 123 | "block", |
| 124 | "transform" |
| 125 | ] |
| 126 | }, |
| 127 | { |
| 128 | "name": "buy", |
| 129 | "title": "Buy Now Button", |
| 130 | "icon": "store", |
| 131 | "description": "Add a button to buy the product.", |
| 132 | "attributes": { |
| 133 | "add_to_cart": false, |
| 134 | "text": "Buy Now" |
| 135 | }, |
| 136 | "isActive": [ |
| 137 | "add_to_cart" |
| 138 | ], |
| 139 | "scope": [ |
| 140 | "inserter", |
| 141 | "block", |
| 142 | "transform" |
| 143 | ] |
| 144 | } |
| 145 | ], |
| 146 | "styles": [ |
| 147 | { |
| 148 | "name": "fill", |
| 149 | "label": "Fill", |
| 150 | "isDefault": true |
| 151 | }, |
| 152 | { |
| 153 | "name": "outline", |
| 154 | "label": "Outline" |
| 155 | } |
| 156 | ], |
| 157 | "textdomain": "surecart", |
| 158 | "render": "file:./view.php", |
| 159 | "editorScript": "file:./index.js", |
| 160 | "editorStyle": [ |
| 161 | "surecart-wp-button" |
| 162 | ], |
| 163 | "style": [ |
| 164 | "surecart-wp-button", |
| 165 | "surecart-spinner" |
| 166 | ], |
| 167 | "viewScriptModule": [ |
| 168 | "@surecart/checkout", |
| 169 | "@surecart/cart" |
| 170 | ] |
| 171 | } |