dpub-roles.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. // Source https://www.w3.org/TR/dpub-aria-1.0/
  2. const dpubRoles = {
  3. 'doc-abstract': {
  4. type: 'section',
  5. allowedAttrs: ['aria-expanded'],
  6. superclassRole: ['section']
  7. },
  8. 'doc-acknowledgments': {
  9. type: 'landmark',
  10. allowedAttrs: ['aria-expanded'],
  11. superclassRole: ['landmark']
  12. },
  13. 'doc-afterword': {
  14. type: 'landmark',
  15. allowedAttrs: ['aria-expanded'],
  16. superclassRole: ['landmark']
  17. },
  18. 'doc-appendix': {
  19. type: 'landmark',
  20. allowedAttrs: ['aria-expanded'],
  21. superclassRole: ['landmark']
  22. },
  23. 'doc-backlink': {
  24. type: 'link',
  25. allowedAttrs: ['aria-expanded'],
  26. nameFromContent: true,
  27. superclassRole: ['link']
  28. },
  29. 'doc-biblioentry': {
  30. type: 'listitem',
  31. requiredContext: ['doc-bibliography'],
  32. allowedAttrs: [
  33. 'aria-expanded',
  34. 'aria-level',
  35. 'aria-posinset',
  36. 'aria-setsize'
  37. ],
  38. superclassRole: ['listitem']
  39. },
  40. 'doc-bibliography': {
  41. type: 'landmark',
  42. requiredOwned: ['doc-biblioentry'],
  43. allowedAttrs: ['aria-expanded'],
  44. superclassRole: ['landmark']
  45. },
  46. 'doc-biblioref': {
  47. type: 'link',
  48. allowedAttrs: ['aria-expanded'],
  49. nameFromContent: true,
  50. superclassRole: ['link']
  51. },
  52. 'doc-chapter': {
  53. type: 'landmark',
  54. allowedAttrs: ['aria-expanded'],
  55. superclassRole: ['landmark']
  56. },
  57. 'doc-colophon': {
  58. type: 'section',
  59. allowedAttrs: ['aria-expanded'],
  60. superclassRole: ['section']
  61. },
  62. 'doc-conclusion': {
  63. type: 'landmark',
  64. allowedAttrs: ['aria-expanded'],
  65. superclassRole: ['landmark']
  66. },
  67. 'doc-cover': {
  68. type: 'img',
  69. allowedAttrs: ['aria-expanded'],
  70. superclassRole: ['img']
  71. },
  72. 'doc-credit': {
  73. type: 'section',
  74. allowedAttrs: ['aria-expanded'],
  75. superclassRole: ['section']
  76. },
  77. 'doc-credits': {
  78. type: 'landmark',
  79. allowedAttrs: ['aria-expanded'],
  80. superclassRole: ['landmark']
  81. },
  82. 'doc-dedication': {
  83. type: 'section',
  84. allowedAttrs: ['aria-expanded'],
  85. superclassRole: ['section']
  86. },
  87. 'doc-endnote': {
  88. type: 'listitem',
  89. requiredContext: ['doc-endnotes'],
  90. allowedAttrs: [
  91. 'aria-expanded',
  92. 'aria-level',
  93. 'aria-posinset',
  94. 'aria-setsize'
  95. ],
  96. superclassRole: ['listitem']
  97. },
  98. 'doc-endnotes': {
  99. type: 'landmark',
  100. requiredOwned: ['doc-endnote'],
  101. allowedAttrs: ['aria-expanded'],
  102. superclassRole: ['landmark']
  103. },
  104. 'doc-epigraph': {
  105. type: 'section',
  106. allowedAttrs: ['aria-expanded'],
  107. superclassRole: ['section']
  108. },
  109. 'doc-epilogue': {
  110. type: 'landmark',
  111. allowedAttrs: ['aria-expanded'],
  112. superclassRole: ['landmark']
  113. },
  114. 'doc-errata': {
  115. type: 'landmark',
  116. allowedAttrs: ['aria-expanded'],
  117. superclassRole: ['landmark']
  118. },
  119. 'doc-example': {
  120. type: 'section',
  121. allowedAttrs: ['aria-expanded'],
  122. superclassRole: ['section']
  123. },
  124. 'doc-footnote': {
  125. type: 'section',
  126. allowedAttrs: ['aria-expanded'],
  127. superclassRole: ['section']
  128. },
  129. 'doc-foreword': {
  130. type: 'landmark',
  131. allowedAttrs: ['aria-expanded'],
  132. superclassRole: ['landmark']
  133. },
  134. 'doc-glossary': {
  135. type: 'landmark',
  136. requiredOwned: ['definition', 'term'],
  137. allowedAttrs: ['aria-expanded'],
  138. superclassRole: ['landmark']
  139. },
  140. 'doc-glossref': {
  141. type: 'link',
  142. allowedAttrs: ['aria-expanded'],
  143. nameFromContent: true,
  144. superclassRole: ['link']
  145. },
  146. 'doc-index': {
  147. type: 'navigation',
  148. allowedAttrs: ['aria-expanded'],
  149. superclassRole: ['navigation']
  150. },
  151. 'doc-introduction': {
  152. type: 'landmark',
  153. allowedAttrs: ['aria-expanded'],
  154. superclassRole: ['landmark']
  155. },
  156. 'doc-noteref': {
  157. type: 'link',
  158. allowedAttrs: ['aria-expanded'],
  159. nameFromContent: true,
  160. superclassRole: ['link']
  161. },
  162. 'doc-notice': {
  163. type: 'note',
  164. allowedAttrs: ['aria-expanded'],
  165. superclassRole: ['note']
  166. },
  167. 'doc-pagebreak': {
  168. type: 'separator',
  169. allowedAttrs: ['aria-expanded', 'aria-orientation'],
  170. superclassRole: ['separator'],
  171. childrenPresentational: true
  172. },
  173. 'doc-pagelist': {
  174. type: 'navigation',
  175. allowedAttrs: ['aria-expanded'],
  176. superclassRole: ['navigation']
  177. },
  178. 'doc-part': {
  179. type: 'landmark',
  180. allowedAttrs: ['aria-expanded'],
  181. superclassRole: ['landmark']
  182. },
  183. 'doc-preface': {
  184. type: 'landmark',
  185. allowedAttrs: ['aria-expanded'],
  186. superclassRole: ['landmark']
  187. },
  188. 'doc-prologue': {
  189. type: 'landmark',
  190. allowedAttrs: ['aria-expanded'],
  191. superclassRole: ['landmark']
  192. },
  193. 'doc-pullquote': {
  194. type: 'none',
  195. superclassRole: ['none']
  196. },
  197. 'doc-qna': {
  198. type: 'section',
  199. allowedAttrs: ['aria-expanded'],
  200. superclassRole: ['section']
  201. },
  202. 'doc-subtitle': {
  203. type: 'sectionhead',
  204. allowedAttrs: ['aria-expanded'],
  205. superclassRole: ['sectionhead']
  206. },
  207. 'doc-tip': {
  208. type: 'note',
  209. allowedAttrs: ['aria-expanded'],
  210. superclassRole: ['note']
  211. },
  212. 'doc-toc': {
  213. type: 'navigation',
  214. allowedAttrs: ['aria-expanded'],
  215. superclassRole: ['navigation']
  216. }
  217. };
  218. export default dpubRoles;