diff --git a/wp-includes/blocks/audio/block.json b/wp-includes/blocks/audio/block.json new file mode 100644 index 0000000000..31c6c8f9ef --- /dev/null +++ b/wp-includes/blocks/audio/block.json @@ -0,0 +1,42 @@ +{ + "name": "core/audio", + "category": "media", + "attributes": { + "src": { + "type": "string", + "source": "attribute", + "selector": "audio", + "attribute": "src" + }, + "caption": { + "type": "string", + "source": "html", + "selector": "figcaption" + }, + "id": { + "type": "number" + }, + "autoplay": { + "type": "boolean", + "source": "attribute", + "selector": "audio", + "attribute": "autoplay" + }, + "loop": { + "type": "boolean", + "source": "attribute", + "selector": "audio", + "attribute": "loop" + }, + "preload": { + "type": "string", + "source": "attribute", + "selector": "audio", + "attribute": "preload" + } + }, + "supports": { + "align": true, + "lightBlockWrapper": true + } +} diff --git a/wp-includes/blocks/button/block.json b/wp-includes/blocks/button/block.json new file mode 100644 index 0000000000..b2af0f5a4c --- /dev/null +++ b/wp-includes/blocks/button/block.json @@ -0,0 +1,62 @@ +{ + "name": "core/button", + "category": "design", + "parent": [ + "core/buttons" + ], + "attributes": { + "url": { + "type": "string", + "source": "attribute", + "selector": "a", + "attribute": "href" + }, + "title": { + "type": "string", + "source": "attribute", + "selector": "a", + "attribute": "title" + }, + "text": { + "type": "string", + "source": "html", + "selector": "a" + }, + "linkTarget": { + "type": "string", + "source": "attribute", + "selector": "a", + "attribute": "target" + }, + "rel": { + "type": "string", + "source": "attribute", + "selector": "a", + "attribute": "rel" + }, + "placeholder": { + "type": "string" + }, + "borderRadius": { + "type": "number" + }, + "style": { + "type": "object" + }, + "backgroundColor": { + "type": "string" + }, + "textColor": { + "type": "string" + }, + "gradient": { + "type": "string" + } + }, + "supports": { + "align": true, + "alignWide": false, + "reusable": false, + "lightBlockWrapper": true + } +} diff --git a/wp-includes/blocks/buttons/block.json b/wp-includes/blocks/buttons/block.json new file mode 100644 index 0000000000..4004a9591a --- /dev/null +++ b/wp-includes/blocks/buttons/block.json @@ -0,0 +1,9 @@ +{ + "name": "core/buttons", + "category": "design", + "supports": { + "align": true, + "alignWide": false, + "lightBlockWrapper": true + } +} diff --git a/wp-includes/blocks/classic/block.json b/wp-includes/blocks/classic/block.json new file mode 100644 index 0000000000..63d2c9f37e --- /dev/null +++ b/wp-includes/blocks/classic/block.json @@ -0,0 +1,15 @@ +{ + "name": "core/freeform", + "category": "text", + "attributes": { + "content": { + "type": "string", + "source": "html" + } + }, + "supports": { + "className": false, + "customClassName": false, + "reusable": false + } +} diff --git a/wp-includes/blocks/code/block.json b/wp-includes/blocks/code/block.json new file mode 100644 index 0000000000..d7cab6cf34 --- /dev/null +++ b/wp-includes/blocks/code/block.json @@ -0,0 +1,15 @@ +{ + "name": "core/code", + "category": "text", + "attributes": { + "content": { + "type": "string", + "source": "text", + "selector": "code" + } + }, + "supports": { + "html": false, + "lightBlockWrapper": true + } +} diff --git a/wp-includes/blocks/column/block.json b/wp-includes/blocks/column/block.json new file mode 100644 index 0000000000..328dbb6201 --- /dev/null +++ b/wp-includes/blocks/column/block.json @@ -0,0 +1,22 @@ +{ + "name": "core/column", + "category": "text", + "parent": [ + "core/columns" + ], + "attributes": { + "verticalAlignment": { + "type": "string" + }, + "width": { + "type": "number", + "min": 0, + "max": 100 + } + }, + "supports": { + "reusable": false, + "html": false, + "lightBlockWrapper": true + } +} diff --git a/wp-includes/blocks/columns/block.json b/wp-includes/blocks/columns/block.json new file mode 100644 index 0000000000..352b1e5caa --- /dev/null +++ b/wp-includes/blocks/columns/block.json @@ -0,0 +1,21 @@ +{ + "name": "core/columns", + "category": "design", + "attributes": { + "verticalAlignment": { + "type": "string" + } + }, + "supports": { + "align": [ + "wide", + "full" + ], + "html": false, + "lightBlockWrapper": true, + "__experimentalColor": { + "gradients": true, + "linkColor": true + } + } +} diff --git a/wp-includes/blocks/file/block.json b/wp-includes/blocks/file/block.json new file mode 100644 index 0000000000..664ec1154a --- /dev/null +++ b/wp-includes/blocks/file/block.json @@ -0,0 +1,41 @@ +{ + "name": "core/file", + "category": "media", + "attributes": { + "id": { + "type": "number" + }, + "href": { + "type": "string" + }, + "fileName": { + "type": "string", + "source": "html", + "selector": "a:not([download])" + }, + "textLinkHref": { + "type": "string", + "source": "attribute", + "selector": "a:not([download])", + "attribute": "href" + }, + "textLinkTarget": { + "type": "string", + "source": "attribute", + "selector": "a:not([download])", + "attribute": "target" + }, + "showDownloadButton": { + "type": "boolean", + "default": true + }, + "downloadButtonText": { + "type": "string", + "source": "html", + "selector": "a[download]" + } + }, + "supports": { + "align": true + } +} diff --git a/wp-includes/blocks/gallery/block.json b/wp-includes/blocks/gallery/block.json new file mode 100644 index 0000000000..c16a21e734 --- /dev/null +++ b/wp-includes/blocks/gallery/block.json @@ -0,0 +1,82 @@ +{ + "name": "core/gallery", + "category": "media", + "attributes": { + "images": { + "type": "array", + "default": [], + "source": "query", + "selector": ".blocks-gallery-item", + "query": { + "url": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "src" + }, + "fullUrl": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "data-full-url" + }, + "link": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "data-link" + }, + "alt": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "alt", + "default": "" + }, + "id": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "data-id" + }, + "caption": { + "type": "string", + "source": "html", + "selector": ".blocks-gallery-item__caption" + } + } + }, + "ids": { + "type": "array", + "items": { + "type": "number" + }, + "default": [] + }, + "columns": { + "type": "number", + "minimum": 1, + "maximum": 8 + }, + "caption": { + "type": "string", + "source": "html", + "selector": ".blocks-gallery-caption" + }, + "imageCrop": { + "type": "boolean", + "default": true + }, + "linkTo": { + "type": "string", + "default": "none" + }, + "sizeSlug": { + "type": "string", + "default": "large" + } + }, + "supports": { + "align": true + } +} diff --git a/wp-includes/blocks/group/block.json b/wp-includes/blocks/group/block.json new file mode 100644 index 0000000000..1e32b1443c --- /dev/null +++ b/wp-includes/blocks/group/block.json @@ -0,0 +1,23 @@ +{ + "name": "core/group", + "category": "design", + "attributes": { + "tagName": { + "type": "string", + "default": "div" + } + }, + "supports": { + "align": [ + "wide", + "full" + ], + "anchor": true, + "html": false, + "lightBlockWrapper": true, + "__experimentalColor": { + "gradients": true, + "linkColor": true + } + } +} diff --git a/wp-includes/blocks/heading/block.json b/wp-includes/blocks/heading/block.json new file mode 100644 index 0000000000..fd03a4487e --- /dev/null +++ b/wp-includes/blocks/heading/block.json @@ -0,0 +1,41 @@ +{ + "name": "core/heading", + "category": "text", + "attributes": { + "align": { + "type": "string" + }, + "content": { + "type": "string", + "source": "html", + "selector": "h1,h2,h3,h4,h5,h6", + "default": "" + }, + "level": { + "type": "number", + "default": 2 + }, + "placeholder": { + "type": "string" + } + }, + "supports": { + "anchor": true, + "className": false, + "lightBlockWrapper": true, + "__experimentalColor": { + "linkColor": true + }, + "__experimentalFontSize": true, + "__experimentalLineHeight": true, + "__experimentalSelector": { + "core/heading/h1": "h1", + "core/heading/h2": "h2", + "core/heading/h3": "h3", + "core/heading/h4": "h4", + "core/heading/h5": "h5", + "core/heading/h6": "h6" + }, + "__unstablePasteTextInline": true + } +} diff --git a/wp-includes/blocks/html/block.json b/wp-includes/blocks/html/block.json new file mode 100644 index 0000000000..b9624b4b3e --- /dev/null +++ b/wp-includes/blocks/html/block.json @@ -0,0 +1,15 @@ +{ + "name": "core/html", + "category": "widgets", + "attributes": { + "content": { + "type": "string", + "source": "html" + } + }, + "supports": { + "customClassName": false, + "className": false, + "html": false + } +} diff --git a/wp-includes/blocks/image/block.json b/wp-includes/blocks/image/block.json new file mode 100644 index 0000000000..d403ec3827 --- /dev/null +++ b/wp-includes/blocks/image/block.json @@ -0,0 +1,76 @@ +{ + "name": "core/image", + "category": "media", + "attributes": { + "align": { + "type": "string" + }, + "url": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "src" + }, + "alt": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "alt", + "default": "" + }, + "caption": { + "type": "string", + "source": "html", + "selector": "figcaption" + }, + "title": { + "type": "string", + "source": "attribute", + "selector": "img", + "attribute": "title" + }, + "href": { + "type": "string", + "source": "attribute", + "selector": "figure > a", + "attribute": "href" + }, + "rel": { + "type": "string", + "source": "attribute", + "selector": "figure > a", + "attribute": "rel" + }, + "linkClass": { + "type": "string", + "source": "attribute", + "selector": "figure > a", + "attribute": "class" + }, + "id": { + "type": "number" + }, + "width": { + "type": "number" + }, + "height": { + "type": "number" + }, + "sizeSlug": { + "type": "string" + }, + "linkDestination": { + "type": "string", + "default": "none" + }, + "linkTarget": { + "type": "string", + "source": "attribute", + "selector": "figure > a", + "attribute": "target" + } + }, + "supports": { + "lightBlockWrapper": true + } +} diff --git a/wp-includes/blocks/index.php b/wp-includes/blocks/index.php new file mode 100644 index 0000000000..53aaf2756a --- /dev/null +++ b/wp-includes/blocks/index.php @@ -0,0 +1,58 @@ +