block.json 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {
  2. "$schema": "https://schemas.wp.org/trunk/block.json",
  3. "apiVersion": 2,
  4. "name": "core/cover",
  5. "title": "Cover",
  6. "category": "media",
  7. "description": "Add an image or video with a text overlay — great for headers.",
  8. "textdomain": "default",
  9. "attributes": {
  10. "url": {
  11. "type": "string"
  12. },
  13. "useFeaturedImage": {
  14. "type": "boolean",
  15. "default": false
  16. },
  17. "id": {
  18. "type": "number"
  19. },
  20. "alt": {
  21. "type": "string",
  22. "source": "attribute",
  23. "selector": "img",
  24. "attribute": "alt",
  25. "default": ""
  26. },
  27. "hasParallax": {
  28. "type": "boolean",
  29. "default": false
  30. },
  31. "isRepeated": {
  32. "type": "boolean",
  33. "default": false
  34. },
  35. "dimRatio": {
  36. "type": "number",
  37. "default": 100
  38. },
  39. "overlayColor": {
  40. "type": "string"
  41. },
  42. "customOverlayColor": {
  43. "type": "string"
  44. },
  45. "backgroundType": {
  46. "type": "string",
  47. "default": "image"
  48. },
  49. "focalPoint": {
  50. "type": "object"
  51. },
  52. "minHeight": {
  53. "type": "number"
  54. },
  55. "minHeightUnit": {
  56. "type": "string"
  57. },
  58. "gradient": {
  59. "type": "string"
  60. },
  61. "customGradient": {
  62. "type": "string"
  63. },
  64. "contentPosition": {
  65. "type": "string"
  66. },
  67. "isDark": {
  68. "type": "boolean",
  69. "default": true
  70. },
  71. "allowedBlocks": {
  72. "type": "array"
  73. },
  74. "templateLock": {
  75. "type": [ "string", "boolean" ],
  76. "enum": [ "all", "insert", "contentOnly", false ]
  77. }
  78. },
  79. "usesContext": [ "postId", "postType" ],
  80. "supports": {
  81. "anchor": true,
  82. "align": true,
  83. "html": false,
  84. "spacing": {
  85. "padding": true,
  86. "margin": [ "top", "bottom" ],
  87. "__experimentalDefaultControls": {
  88. "padding": true
  89. }
  90. },
  91. "color": {
  92. "__experimentalDuotone": "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
  93. "text": false,
  94. "background": false
  95. },
  96. "typography": {
  97. "fontSize": true,
  98. "lineHeight": true,
  99. "__experimentalFontFamily": true,
  100. "__experimentalFontWeight": true,
  101. "__experimentalFontStyle": true,
  102. "__experimentalTextTransform": true,
  103. "__experimentalTextDecoration": true,
  104. "__experimentalLetterSpacing": true,
  105. "__experimentalDefaultControls": {
  106. "fontSize": true
  107. }
  108. }
  109. },
  110. "editorStyle": "wp-block-cover-editor",
  111. "style": "wp-block-cover"
  112. }