block.json 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {
  2. "$schema": "https://schemas.wp.org/trunk/block.json",
  3. "apiVersion": 2,
  4. "name": "core/image",
  5. "title": "Image",
  6. "category": "media",
  7. "usesContext": [ "allowResize", "imageCrop", "fixedHeight" ],
  8. "description": "Insert an image to make a visual statement.",
  9. "keywords": [ "img", "photo", "picture" ],
  10. "textdomain": "default",
  11. "attributes": {
  12. "align": {
  13. "type": "string"
  14. },
  15. "url": {
  16. "type": "string",
  17. "source": "attribute",
  18. "selector": "img",
  19. "attribute": "src",
  20. "__experimentalRole": "content"
  21. },
  22. "alt": {
  23. "type": "string",
  24. "source": "attribute",
  25. "selector": "img",
  26. "attribute": "alt",
  27. "default": "",
  28. "__experimentalRole": "content"
  29. },
  30. "caption": {
  31. "type": "string",
  32. "source": "html",
  33. "selector": "figcaption",
  34. "__experimentalRole": "content"
  35. },
  36. "title": {
  37. "type": "string",
  38. "source": "attribute",
  39. "selector": "img",
  40. "attribute": "title",
  41. "__experimentalRole": "content"
  42. },
  43. "href": {
  44. "type": "string",
  45. "source": "attribute",
  46. "selector": "figure > a",
  47. "attribute": "href",
  48. "__experimentalRole": "content"
  49. },
  50. "rel": {
  51. "type": "string",
  52. "source": "attribute",
  53. "selector": "figure > a",
  54. "attribute": "rel"
  55. },
  56. "linkClass": {
  57. "type": "string",
  58. "source": "attribute",
  59. "selector": "figure > a",
  60. "attribute": "class"
  61. },
  62. "id": {
  63. "type": "number",
  64. "__experimentalRole": "content"
  65. },
  66. "width": {
  67. "type": "number"
  68. },
  69. "height": {
  70. "type": "number"
  71. },
  72. "sizeSlug": {
  73. "type": "string"
  74. },
  75. "linkDestination": {
  76. "type": "string"
  77. },
  78. "linkTarget": {
  79. "type": "string",
  80. "source": "attribute",
  81. "selector": "figure > a",
  82. "attribute": "target"
  83. }
  84. },
  85. "supports": {
  86. "anchor": true,
  87. "color": {
  88. "__experimentalDuotone": "img, .components-placeholder",
  89. "text": false,
  90. "background": false
  91. },
  92. "__experimentalBorder": {
  93. "color": true,
  94. "radius": true,
  95. "width": true,
  96. "__experimentalSelector": "img, .wp-block-image__crop-area",
  97. "__experimentalSkipSerialization": true,
  98. "__experimentalDefaultControls": {
  99. "color": true,
  100. "radius": true,
  101. "width": true
  102. }
  103. }
  104. },
  105. "styles": [
  106. {
  107. "name": "default",
  108. "label": "Default",
  109. "isDefault": true
  110. },
  111. { "name": "rounded", "label": "Rounded" }
  112. ],
  113. "editorStyle": "wp-block-image-editor",
  114. "style": "wp-block-image"
  115. }