block.json 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {
  2. "$schema": "https://schemas.wp.org/trunk/block.json",
  3. "apiVersion": 2,
  4. "name": "core/file",
  5. "title": "File",
  6. "category": "media",
  7. "description": "Add a link to a downloadable file.",
  8. "keywords": [ "document", "pdf", "download" ],
  9. "textdomain": "default",
  10. "attributes": {
  11. "id": {
  12. "type": "number"
  13. },
  14. "href": {
  15. "type": "string"
  16. },
  17. "fileId": {
  18. "type": "string",
  19. "source": "attribute",
  20. "selector": "a:not([download])",
  21. "attribute": "id"
  22. },
  23. "fileName": {
  24. "type": "string",
  25. "source": "html",
  26. "selector": "a:not([download])"
  27. },
  28. "textLinkHref": {
  29. "type": "string",
  30. "source": "attribute",
  31. "selector": "a:not([download])",
  32. "attribute": "href"
  33. },
  34. "textLinkTarget": {
  35. "type": "string",
  36. "source": "attribute",
  37. "selector": "a:not([download])",
  38. "attribute": "target"
  39. },
  40. "showDownloadButton": {
  41. "type": "boolean",
  42. "default": true
  43. },
  44. "downloadButtonText": {
  45. "type": "string",
  46. "source": "html",
  47. "selector": "a[download]"
  48. },
  49. "displayPreview": {
  50. "type": "boolean"
  51. },
  52. "previewHeight": {
  53. "type": "number",
  54. "default": 600
  55. }
  56. },
  57. "supports": {
  58. "anchor": true,
  59. "align": true
  60. },
  61. "viewScript": "file:./view.min.js",
  62. "editorStyle": "wp-block-file-editor",
  63. "style": "wp-block-file"
  64. }