You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
2.7 KiB

1 year ago
  1. {
  2. "$schema": "https://schemas.wp.org/trunk/block.json",
  3. "apiVersion": 3,
  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. "lightbox": {
  37. "type": "object",
  38. "enabled": {
  39. "type": "boolean"
  40. }
  41. },
  42. "title": {
  43. "type": "string",
  44. "source": "attribute",
  45. "selector": "img",
  46. "attribute": "title",
  47. "__experimentalRole": "content"
  48. },
  49. "href": {
  50. "type": "string",
  51. "source": "attribute",
  52. "selector": "figure > a",
  53. "attribute": "href",
  54. "__experimentalRole": "content"
  55. },
  56. "rel": {
  57. "type": "string",
  58. "source": "attribute",
  59. "selector": "figure > a",
  60. "attribute": "rel"
  61. },
  62. "linkClass": {
  63. "type": "string",
  64. "source": "attribute",
  65. "selector": "figure > a",
  66. "attribute": "class"
  67. },
  68. "id": {
  69. "type": "number",
  70. "__experimentalRole": "content"
  71. },
  72. "width": {
  73. "type": "string"
  74. },
  75. "height": {
  76. "type": "string"
  77. },
  78. "aspectRatio": {
  79. "type": "string"
  80. },
  81. "scale": {
  82. "type": "string"
  83. },
  84. "sizeSlug": {
  85. "type": "string"
  86. },
  87. "linkDestination": {
  88. "type": "string"
  89. },
  90. "linkTarget": {
  91. "type": "string",
  92. "source": "attribute",
  93. "selector": "figure > a",
  94. "attribute": "target"
  95. }
  96. },
  97. "supports": {
  98. "anchor": true,
  99. "color": {
  100. "text": false,
  101. "background": false
  102. },
  103. "filter": {
  104. "duotone": true
  105. },
  106. "__experimentalBorder": {
  107. "color": true,
  108. "radius": true,
  109. "width": true,
  110. "__experimentalSkipSerialization": true,
  111. "__experimentalDefaultControls": {
  112. "color": true,
  113. "radius": true,
  114. "width": true
  115. }
  116. }
  117. },
  118. "selectors": {
  119. "border": ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",
  120. "filter": {
  121. "duotone": ".wp-block-image img, .wp-block-image .components-placeholder"
  122. }
  123. },
  124. "styles": [
  125. {
  126. "name": "default",
  127. "label": "Default",
  128. "isDefault": true
  129. },
  130. { "name": "rounded", "label": "Rounded" }
  131. ],
  132. "editorStyle": "wp-block-image-editor",
  133. "style": "wp-block-image",
  134. "viewScript": "file:./view.min.js"
  135. }