index.js 831 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import ariaAttrs from './aria-attrs';
  2. import ariaRoles from './aria-roles';
  3. import dpubRoles from './dpub-roles';
  4. import graphicsRoles from './graphics-roles';
  5. import htmlElms from './html-elms';
  6. import { deepMerge } from '../core/utils';
  7. import cssColors from './css-colors';
  8. const originals = {
  9. ariaAttrs,
  10. ariaRoles: {
  11. ...ariaRoles,
  12. ...dpubRoles,
  13. ...graphicsRoles
  14. },
  15. htmlElms,
  16. cssColors
  17. };
  18. const standards = {
  19. ...originals
  20. };
  21. export function configureStandards(config) {
  22. Object.keys(standards).forEach(propName => {
  23. if (config[propName]) {
  24. standards[propName] = deepMerge(standards[propName], config[propName]);
  25. }
  26. });
  27. }
  28. export function resetStandards() {
  29. Object.keys(standards).forEach(propName => {
  30. standards[propName] = originals[propName];
  31. });
  32. }
  33. export default standards;