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.

139 lines
2.6 KiB

1 year ago
  1. {
  2. "$schema": "https://schemas.wp.org/trunk/block.json",
  3. "apiVersion": 3,
  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. "items": {
  65. "type": "object"
  66. },
  67. "default": []
  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. "margin": false,
  120. "padding": false
  121. }
  122. },
  123. "color": {
  124. "text": false,
  125. "background": true,
  126. "gradients": true
  127. },
  128. "layout": {
  129. "allowSwitching": false,
  130. "allowInheriting": false,
  131. "allowEditing": false,
  132. "default": {
  133. "type": "flex"
  134. }
  135. }
  136. },
  137. "editorStyle": "wp-block-gallery-editor",
  138. "style": "wp-block-gallery"
  139. }