block.json 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. {
  2. "$schema": "https://schemas.wp.org/trunk/block.json",
  3. "apiVersion": 2,
  4. "name": "core/gallery",
  5. "title": "Gallery",
  6. "category": "media",
  7. "description": "Display multiple images in a rich gallery.",
  8. "keywords": [ "images", "photos" ],
  9. "textdomain": "default",
  10. "attributes": {
  11. "images": {
  12. "type": "array",
  13. "default": [],
  14. "source": "query",
  15. "selector": ".blocks-gallery-item",
  16. "query": {
  17. "url": {
  18. "type": "string",
  19. "source": "attribute",
  20. "selector": "img",
  21. "attribute": "src"
  22. },
  23. "fullUrl": {
  24. "type": "string",
  25. "source": "attribute",
  26. "selector": "img",
  27. "attribute": "data-full-url"
  28. },
  29. "link": {
  30. "type": "string",
  31. "source": "attribute",
  32. "selector": "img",
  33. "attribute": "data-link"
  34. },
  35. "alt": {
  36. "type": "string",
  37. "source": "attribute",
  38. "selector": "img",
  39. "attribute": "alt",
  40. "default": ""
  41. },
  42. "id": {
  43. "type": "string",
  44. "source": "attribute",
  45. "selector": "img",
  46. "attribute": "data-id"
  47. },
  48. "caption": {
  49. "type": "string",
  50. "source": "html",
  51. "selector": ".blocks-gallery-item__caption"
  52. }
  53. }
  54. },
  55. "ids": {
  56. "type": "array",
  57. "items": {
  58. "type": "number"
  59. },
  60. "default": []
  61. },
  62. "shortCodeTransforms": {
  63. "type": "array",
  64. "default": [],
  65. "items": {
  66. "type": "object"
  67. }
  68. },
  69. "columns": {
  70. "type": "number",
  71. "minimum": 1,
  72. "maximum": 8
  73. },
  74. "caption": {
  75. "type": "string",
  76. "source": "html",
  77. "selector": ".blocks-gallery-caption"
  78. },
  79. "imageCrop": {
  80. "type": "boolean",
  81. "default": true
  82. },
  83. "fixedHeight": {
  84. "type": "boolean",
  85. "default": true
  86. },
  87. "linkTarget": {
  88. "type": "string"
  89. },
  90. "linkTo": {
  91. "type": "string"
  92. },
  93. "sizeSlug": {
  94. "type": "string",
  95. "default": "large"
  96. },
  97. "allowResize": {
  98. "type": "boolean",
  99. "default": false
  100. }
  101. },
  102. "providesContext": {
  103. "allowResize": "allowResize",
  104. "imageCrop": "imageCrop",
  105. "fixedHeight": "fixedHeight"
  106. },
  107. "supports": {
  108. "anchor": true,
  109. "align": true,
  110. "html": false,
  111. "units": [ "px", "em", "rem", "vh", "vw" ],
  112. "spacing": {
  113. "margin": true,
  114. "padding": true,
  115. "blockGap": [ "horizontal", "vertical" ],
  116. "__experimentalSkipSerialization": [ "blockGap" ],
  117. "__experimentalDefaultControls": {
  118. "blockGap": true
  119. }
  120. },
  121. "color": {
  122. "text": false,
  123. "background": true,
  124. "gradients": true
  125. },
  126. "__experimentalLayout": {
  127. "allowSwitching": false,
  128. "allowInheriting": false,
  129. "allowEditing": false,
  130. "default": {
  131. "type": "flex"
  132. }
  133. }
  134. },
  135. "editorStyle": "wp-block-gallery-editor",
  136. "style": "wp-block-gallery"
  137. }