| 1 |
{ |
| 2 |
"apiVersion": 3, |
| 3 |
"$schema": "https://schemas.wp.org/trunk/block.json", |
| 4 |
"name": "blockenberg/code-playground", |
| 5 |
"title": "Code Playground", |
| 6 |
"category": "bkbg-dev", |
| 7 |
"icon": "editor-code", |
| 8 |
"description": "Interactive HTML/CSS/JS editor with live preview. Let visitors experiment with code directly on the page.", |
| 9 |
"keywords": [ |
| 10 |
"code", |
| 11 |
"editor", |
| 12 |
"html", |
| 13 |
"css", |
| 14 |
"javascript", |
| 15 |
"playground", |
| 16 |
"sandbox", |
| 17 |
"live" |
| 18 |
], |
| 19 |
"textdomain": "blockenberg", |
| 20 |
"editorScript": "bkbg-code-playground-editor", |
| 21 |
"style": "bkbg-code-playground-style", |
| 22 |
"viewScript": "bkbg-code-playground-frontend", |
| 23 |
"supports": { |
| 24 |
"html": false, |
| 25 |
"anchor": true, |
| 26 |
"className": true, |
| 27 |
"align": [ |
| 28 |
"wide", |
| 29 |
"full" |
| 30 |
] |
| 31 |
}, |
| 32 |
"attributes": { |
| 33 |
"title": { |
| 34 |
"type": "string", |
| 35 |
"default": "Code Playground" |
| 36 |
}, |
| 37 |
"subtitle": { |
| 38 |
"type": "string", |
| 39 |
"default": "" |
| 40 |
}, |
| 41 |
"fontSize": { |
| 42 |
"type": "number", |
| 43 |
"default": 22 |
| 44 |
}, |
| 45 |
"subtitleSize": { |
| 46 |
"type": "number", |
| 47 |
"default": 15 |
| 48 |
}, |
| 49 |
"typoTitle": { |
| 50 |
"type": "object", |
| 51 |
"default": {} |
| 52 |
}, |
| 53 |
"typoSubtitle": { |
| 54 |
"type": "object", |
| 55 |
"default": {} |
| 56 |
}, |
| 57 |
"defaultHtml": { |
| 58 |
"type": "string", |
| 59 |
"default": "<h1>Hello World!</h1>\n<p>Edit the code panels and see the result live.</p>\n<button id=\"btn\">Click me</button>" |
| 60 |
}, |
| 61 |
"defaultCss": { |
| 62 |
"type": "string", |
| 63 |
"default": "body {\n font-family: system-ui, sans-serif;\n padding: 20px;\n background: #f0f4ff;\n color: #1e1b4b;\n}\nh1 { color: #6366f1; }\nbutton {\n background: #6366f1;\n color: #fff;\n border: none;\n padding: 8px 18px;\n border-radius: 6px;\n cursor: pointer;\n font-size: 15px;\n}" |
| 64 |
}, |
| 65 |
"defaultJs": { |
| 66 |
"type": "string", |
| 67 |
"default": "document.getElementById('btn').addEventListener('click', function() {\n alert('Hello from JavaScript!');\n});" |
| 68 |
}, |
| 69 |
"autoRun": { |
| 70 |
"type": "boolean", |
| 71 |
"default": true |
| 72 |
}, |
| 73 |
"layout": { |
| 74 |
"type": "string", |
| 75 |
"default": "horizontal" |
| 76 |
}, |
| 77 |
"editorHeight": { |
| 78 |
"type": "number", |
| 79 |
"default": 180 |
| 80 |
}, |
| 81 |
"previewHeight": { |
| 82 |
"type": "number", |
| 83 |
"default": 260 |
| 84 |
}, |
| 85 |
"activeTab": { |
| 86 |
"type": "string", |
| 87 |
"default": "html" |
| 88 |
}, |
| 89 |
"accentColor": { |
| 90 |
"type": "string", |
| 91 |
"default": "#6366f1" |
| 92 |
}, |
| 93 |
"editorBg": { |
| 94 |
"type": "string", |
| 95 |
"default": "#1e1b4b" |
| 96 |
}, |
| 97 |
"editorText": { |
| 98 |
"type": "string", |
| 99 |
"default": "#e2e8f0" |
| 100 |
}, |
| 101 |
"headerBg": { |
| 102 |
"type": "string", |
| 103 |
"default": "#312e81" |
| 104 |
}, |
| 105 |
"previewBg": { |
| 106 |
"type": "string", |
| 107 |
"default": "#ffffff" |
| 108 |
}, |
| 109 |
"sectionBg": { |
| 110 |
"type": "string", |
| 111 |
"default": "#f8fafc" |
| 112 |
}, |
| 113 |
"titleColor": { |
| 114 |
"type": "string", |
| 115 |
"default": "#1e1b4b" |
| 116 |
} |
| 117 |
} |
| 118 |
} |
| 119 |
|