Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

keywordSets.js 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. 'use strict';
  2. const keywordSets = {};
  3. keywordSets.nonLengthUnits = new Set([
  4. // Relative length units
  5. '%',
  6. // Time length units
  7. 's',
  8. 'ms',
  9. // Angle
  10. 'deg',
  11. 'grad',
  12. 'turn',
  13. 'rad',
  14. // Frequency
  15. 'Hz',
  16. 'kHz',
  17. // Resolution
  18. 'dpi',
  19. 'dpcm',
  20. 'dppx',
  21. ]);
  22. keywordSets.lengthUnits = new Set([
  23. // Relative length units
  24. 'em',
  25. 'ex',
  26. 'ch',
  27. 'rem',
  28. 'rlh',
  29. 'lh',
  30. // Viewport-percentage lengths
  31. 'vh',
  32. 'vw',
  33. 'vmin',
  34. 'vmax',
  35. 'vm',
  36. // Absolute length units
  37. 'px',
  38. 'mm',
  39. 'cm',
  40. 'in',
  41. 'pt',
  42. 'pc',
  43. 'q',
  44. 'mozmm',
  45. // Flexible length units
  46. 'fr',
  47. ]);
  48. keywordSets.units = uniteSets(keywordSets.nonLengthUnits, keywordSets.lengthUnits);
  49. keywordSets.colorFunctionNames = new Set(['rgb', 'rgba', 'hsl', 'hsla', 'hwb', 'gray']);
  50. keywordSets.camelCaseFunctionNames = new Set([
  51. 'translateX',
  52. 'translateY',
  53. 'translateZ',
  54. 'scaleX',
  55. 'scaleY',
  56. 'scaleZ',
  57. 'rotateX',
  58. 'rotateY',
  59. 'rotateZ',
  60. 'skewX',
  61. 'skewY',
  62. ]);
  63. keywordSets.basicKeywords = new Set(['initial', 'inherit', 'unset']);
  64. keywordSets.systemFontValues = uniteSets(keywordSets.basicKeywords, [
  65. 'caption',
  66. 'icon',
  67. 'menu',
  68. 'message-box',
  69. 'small-caption',
  70. 'status-bar',
  71. ]);
  72. keywordSets.fontFamilyKeywords = uniteSets(keywordSets.basicKeywords, [
  73. 'serif',
  74. 'sans-serif',
  75. 'cursive',
  76. 'fantasy',
  77. 'monospace',
  78. 'system-ui',
  79. ]);
  80. keywordSets.fontWeightRelativeKeywords = new Set(['bolder', 'lighter']);
  81. keywordSets.fontWeightAbsoluteKeywords = new Set(['bold']);
  82. keywordSets.fontWeightNumericKeywords = new Set([
  83. '100',
  84. '200',
  85. '300',
  86. '400',
  87. '500',
  88. '600',
  89. '700',
  90. '800',
  91. '900',
  92. ]);
  93. keywordSets.fontWeightKeywords = uniteSets(
  94. keywordSets.basicKeywords,
  95. keywordSets.fontWeightRelativeKeywords,
  96. keywordSets.fontWeightAbsoluteKeywords,
  97. keywordSets.fontWeightNumericKeywords,
  98. );
  99. keywordSets.animationNameKeywords = uniteSets(keywordSets.basicKeywords, ['none']);
  100. keywordSets.animationTimingFunctionKeywords = uniteSets(keywordSets.basicKeywords, [
  101. 'linear',
  102. 'ease',
  103. 'ease-in',
  104. 'ease-in-out',
  105. 'ease-out',
  106. 'step-start',
  107. 'step-end',
  108. 'steps',
  109. 'cubic-bezier',
  110. ]);
  111. keywordSets.animationIterationCountKeywords = new Set(['infinite']);
  112. keywordSets.animationDirectionKeywords = uniteSets(keywordSets.basicKeywords, [
  113. 'normal',
  114. 'reverse',
  115. 'alternate',
  116. 'alternate-reverse',
  117. ]);
  118. keywordSets.animationFillModeKeywords = new Set(['none', 'forwards', 'backwards', 'both']);
  119. keywordSets.animationPlayStateKeywords = uniteSets(keywordSets.basicKeywords, [
  120. 'running',
  121. 'paused',
  122. ]);
  123. // cf. https://developer.mozilla.org/en-US/docs/Web/CSS/animation
  124. keywordSets.animationShorthandKeywords = uniteSets(
  125. keywordSets.basicKeywords,
  126. keywordSets.animationNameKeywords,
  127. keywordSets.animationTimingFunctionKeywords,
  128. keywordSets.animationIterationCountKeywords,
  129. keywordSets.animationDirectionKeywords,
  130. keywordSets.animationFillModeKeywords,
  131. keywordSets.animationPlayStateKeywords,
  132. );
  133. // These are the ones that can have single-colon notation
  134. keywordSets.levelOneAndTwoPseudoElements = new Set([
  135. 'before',
  136. 'after',
  137. 'first-line',
  138. 'first-letter',
  139. ]);
  140. // These are the ones that require double-colon notation
  141. keywordSets.levelThreeAndUpPseudoElements = new Set([
  142. 'before',
  143. 'after',
  144. 'first-line',
  145. 'first-letter',
  146. 'selection',
  147. 'spelling-error',
  148. 'grammar-error',
  149. 'backdrop',
  150. 'marker',
  151. 'placeholder',
  152. 'shadow',
  153. 'slotted',
  154. 'content',
  155. 'file-selector-button',
  156. ]);
  157. keywordSets.shadowTreePseudoElements = new Set(['part']);
  158. keywordSets.vendorSpecificPseudoElements = new Set([
  159. '-moz-progress-bar',
  160. '-moz-range-progress',
  161. '-moz-range-thumb',
  162. '-moz-range-track',
  163. '-ms-browse',
  164. '-ms-check',
  165. '-ms-clear',
  166. '-ms-expand',
  167. '-ms-fill',
  168. '-ms-fill-lower',
  169. '-ms-fill-upper',
  170. '-ms-reveal',
  171. '-ms-thumb',
  172. '-ms-ticks-after',
  173. '-ms-ticks-before',
  174. '-ms-tooltip',
  175. '-ms-track',
  176. '-ms-value',
  177. '-webkit-progress-bar',
  178. '-webkit-progress-value',
  179. '-webkit-slider-runnable-track',
  180. '-webkit-slider-thumb',
  181. ]);
  182. keywordSets.pseudoElements = uniteSets(
  183. keywordSets.levelOneAndTwoPseudoElements,
  184. keywordSets.levelThreeAndUpPseudoElements,
  185. keywordSets.vendorSpecificPseudoElements,
  186. keywordSets.shadowTreePseudoElements,
  187. );
  188. keywordSets.aNPlusBNotationPseudoClasses = new Set([
  189. 'nth-column',
  190. 'nth-last-column',
  191. 'nth-last-of-type',
  192. 'nth-of-type',
  193. ]);
  194. keywordSets.linguisticPseudoClasses = new Set(['dir', 'lang']);
  195. keywordSets.atRulePagePseudoClasses = new Set(['first', 'right', 'left', 'blank']);
  196. keywordSets.logicalCombinationsPseudoClasses = new Set(['has', 'is', 'matches', 'not', 'where']);
  197. keywordSets.aNPlusBOfSNotationPseudoClasses = new Set(['nth-child', 'nth-last-child']);
  198. keywordSets.otherPseudoClasses = new Set([
  199. 'active',
  200. 'any-link',
  201. 'autofill',
  202. 'blank',
  203. 'checked',
  204. /*
  205. https://www.w3.org/Style/CSS/Test/CSS3/Selectors/20011105/html/tests/css3-modsel-85.html
  206. https://www.w3.org/Style/CSS/Test/CSS3/Selectors/20011105/html/tests/css3-modsel-84.html
  207. */
  208. 'contains',
  209. 'current',
  210. 'default',
  211. 'defined',
  212. 'disabled',
  213. 'drop',
  214. 'empty',
  215. 'enabled',
  216. 'first-child',
  217. 'first-of-type',
  218. 'focus',
  219. 'focus-ring',
  220. 'focus-within',
  221. 'focus-visible',
  222. 'fullscreen',
  223. 'future',
  224. 'host',
  225. 'host-context',
  226. 'hover',
  227. 'indeterminate',
  228. 'in-range',
  229. 'invalid',
  230. 'last-child',
  231. 'last-of-type',
  232. 'link',
  233. 'only-child',
  234. 'only-of-type',
  235. 'optional',
  236. 'out-of-range',
  237. 'past',
  238. 'placeholder-shown',
  239. 'playing',
  240. 'paused',
  241. 'read-only',
  242. 'read-write',
  243. 'required',
  244. 'root',
  245. 'scope',
  246. 'state',
  247. 'target',
  248. 'user-error',
  249. 'user-invalid',
  250. 'valid',
  251. 'visited',
  252. ]);
  253. keywordSets.webkitProprietaryPseudoElements = new Set([
  254. 'scrollbar',
  255. 'scrollbar-button',
  256. 'scrollbar-track',
  257. 'scrollbar-track-piece',
  258. 'scrollbar-thumb',
  259. 'scrollbar-corner',
  260. 'resize',
  261. ]);
  262. keywordSets.webkitProprietaryPseudoClasses = new Set([
  263. 'horizontal',
  264. 'vertical',
  265. 'decrement',
  266. 'increment',
  267. 'start',
  268. 'end',
  269. 'double-button',
  270. 'single-button',
  271. 'no-button',
  272. 'corner-present',
  273. 'window-inactive',
  274. ]);
  275. keywordSets.pseudoClasses = uniteSets(
  276. keywordSets.aNPlusBNotationPseudoClasses,
  277. keywordSets.linguisticPseudoClasses,
  278. keywordSets.logicalCombinationsPseudoClasses,
  279. keywordSets.aNPlusBOfSNotationPseudoClasses,
  280. keywordSets.otherPseudoClasses,
  281. );
  282. keywordSets.shorthandTimeProperties = new Set(['transition', 'animation']);
  283. keywordSets.longhandTimeProperties = new Set([
  284. 'transition-duration',
  285. 'transition-delay',
  286. 'animation-duration',
  287. 'animation-delay',
  288. ]);
  289. keywordSets.timeProperties = uniteSets(
  290. keywordSets.shorthandTimeProperties,
  291. keywordSets.longhandTimeProperties,
  292. );
  293. keywordSets.camelCaseKeywords = new Set([
  294. 'optimizeSpeed',
  295. 'optimizeQuality',
  296. 'optimizeLegibility',
  297. 'geometricPrecision',
  298. 'currentColor',
  299. 'crispEdges',
  300. 'visiblePainted',
  301. 'visibleFill',
  302. 'visibleStroke',
  303. 'sRGB',
  304. 'linearRGB',
  305. ]);
  306. // https://developer.mozilla.org/docs/Web/CSS/counter-increment
  307. keywordSets.counterIncrementKeywords = uniteSets(keywordSets.basicKeywords, ['none']);
  308. keywordSets.counterResetKeywords = uniteSets(keywordSets.basicKeywords, ['none']);
  309. keywordSets.gridRowKeywords = uniteSets(keywordSets.basicKeywords, ['auto', 'span']);
  310. keywordSets.gridColumnKeywords = uniteSets(keywordSets.basicKeywords, ['auto', 'span']);
  311. keywordSets.gridAreaKeywords = uniteSets(keywordSets.basicKeywords, ['auto', 'span']);
  312. // https://developer.mozilla.org/ru/docs/Web/CSS/list-style-type
  313. keywordSets.listStyleTypeKeywords = uniteSets(keywordSets.basicKeywords, [
  314. 'none',
  315. 'disc',
  316. 'circle',
  317. 'square',
  318. 'decimal',
  319. 'cjk-decimal',
  320. 'decimal-leading-zero',
  321. 'lower-roman',
  322. 'upper-roman',
  323. 'lower-greek',
  324. 'lower-alpha',
  325. 'lower-latin',
  326. 'upper-alpha',
  327. 'upper-latin',
  328. 'arabic-indic',
  329. 'armenian',
  330. 'bengali',
  331. 'cambodian',
  332. 'cjk-earthly-branch',
  333. 'cjk-ideographic',
  334. 'devanagari',
  335. 'ethiopic-numeric',
  336. 'georgian',
  337. 'gujarati',
  338. 'gurmukhi',
  339. 'hebrew',
  340. 'hiragana',
  341. 'hiragana-iroha',
  342. 'japanese-formal',
  343. 'japanese-informal',
  344. 'kannada',
  345. 'katakana',
  346. 'katakana-iroha',
  347. 'khmer',
  348. 'korean-hangul-formal',
  349. 'korean-hanja-formal',
  350. 'korean-hanja-informal',
  351. 'lao',
  352. 'lower-armenian',
  353. 'malayalam',
  354. 'mongolian',
  355. 'myanmar',
  356. 'oriya',
  357. 'persian',
  358. 'simp-chinese-formal',
  359. 'simp-chinese-informal',
  360. 'tamil',
  361. 'telugu',
  362. 'thai',
  363. 'tibetan',
  364. 'trad-chinese-formal',
  365. 'trad-chinese-informal',
  366. 'upper-armenian',
  367. 'disclosure-open',
  368. 'disclosure-closed',
  369. // Non-standard extensions (without prefixe)
  370. 'ethiopic-halehame',
  371. 'ethiopic-halehame-am',
  372. 'ethiopic-halehame-ti-er',
  373. 'ethiopic-halehame-ti-et',
  374. 'hangul',
  375. 'hangul-consonant',
  376. 'urdu',
  377. ]);
  378. keywordSets.listStylePositionKeywords = uniteSets(keywordSets.basicKeywords, ['inside', 'outside']);
  379. keywordSets.listStyleImageKeywords = uniteSets(keywordSets.basicKeywords, ['none']);
  380. keywordSets.listStyleShorthandKeywords = uniteSets(
  381. keywordSets.basicKeywords,
  382. keywordSets.listStyleTypeKeywords,
  383. keywordSets.listStylePositionKeywords,
  384. keywordSets.listStyleImageKeywords,
  385. );
  386. keywordSets.fontStyleKeywords = uniteSets(keywordSets.basicKeywords, [
  387. 'normal',
  388. 'italic',
  389. 'oblique',
  390. ]);
  391. keywordSets.fontVariantKeywords = uniteSets(keywordSets.basicKeywords, [
  392. 'normal',
  393. 'none',
  394. 'historical-forms',
  395. 'none',
  396. 'common-ligatures',
  397. 'no-common-ligatures',
  398. 'discretionary-ligatures',
  399. 'no-discretionary-ligatures',
  400. 'historical-ligatures',
  401. 'no-historical-ligatures',
  402. 'contextual',
  403. 'no-contextual',
  404. 'small-caps',
  405. 'small-caps',
  406. 'all-small-caps',
  407. 'petite-caps',
  408. 'all-petite-caps',
  409. 'unicase',
  410. 'titling-caps',
  411. 'lining-nums',
  412. 'oldstyle-nums',
  413. 'proportional-nums',
  414. 'tabular-nums',
  415. 'diagonal-fractions',
  416. 'stacked-fractions',
  417. 'ordinal',
  418. 'slashed-zero',
  419. 'jis78',
  420. 'jis83',
  421. 'jis90',
  422. 'jis04',
  423. 'simplified',
  424. 'traditional',
  425. 'full-width',
  426. 'proportional-width',
  427. 'ruby',
  428. ]);
  429. keywordSets.fontStretchKeywords = uniteSets(keywordSets.basicKeywords, [
  430. 'semi-condensed',
  431. 'condensed',
  432. 'extra-condensed',
  433. 'ultra-condensed',
  434. 'semi-expanded',
  435. 'expanded',
  436. 'extra-expanded',
  437. 'ultra-expanded',
  438. ]);
  439. keywordSets.fontSizeKeywords = uniteSets(keywordSets.basicKeywords, [
  440. 'xx-small',
  441. 'x-small',
  442. 'small',
  443. 'medium',
  444. 'large',
  445. 'x-large',
  446. 'xx-large',
  447. 'larger',
  448. 'smaller',
  449. ]);
  450. keywordSets.lineHeightKeywords = uniteSets(keywordSets.basicKeywords, ['normal']);
  451. keywordSets.fontShorthandKeywords = uniteSets(
  452. keywordSets.basicKeywords,
  453. keywordSets.fontStyleKeywords,
  454. keywordSets.fontVariantKeywords,
  455. keywordSets.fontWeightKeywords,
  456. keywordSets.fontStretchKeywords,
  457. keywordSets.fontSizeKeywords,
  458. keywordSets.lineHeightKeywords,
  459. keywordSets.fontFamilyKeywords,
  460. );
  461. keywordSets.keyframeSelectorKeywords = new Set(['from', 'to']);
  462. // https://www.w3.org/TR/css-page-3/#syntax-page-selector
  463. keywordSets.pageMarginAtRules = new Set([
  464. 'top-left-corner',
  465. 'top-left',
  466. 'top-center',
  467. 'top-right',
  468. 'top-right-corner',
  469. 'bottom-left-corner',
  470. 'bottom-left',
  471. 'bottom-center',
  472. 'bottom-right',
  473. 'bottom-right-corner',
  474. 'left-top',
  475. 'left-middle',
  476. 'left-bottom',
  477. 'right-top',
  478. 'right-middle',
  479. 'right-bottom',
  480. ]);
  481. // https://developer.mozilla.org/en/docs/Web/CSS/At-rule
  482. keywordSets.atRules = uniteSets(keywordSets.pageMarginAtRules, [
  483. 'annotation',
  484. 'apply',
  485. 'character-variant',
  486. 'charset',
  487. 'counter-style',
  488. 'custom-media',
  489. 'custom-selector',
  490. 'document',
  491. 'font-face',
  492. 'font-feature-values',
  493. 'import',
  494. 'keyframes',
  495. 'media',
  496. 'namespace',
  497. 'nest',
  498. 'ornaments',
  499. 'page',
  500. 'property',
  501. 'styleset',
  502. 'stylistic',
  503. 'supports',
  504. 'swash',
  505. 'viewport',
  506. ]);
  507. // https://drafts.csswg.org/mediaqueries/#descdef-media-update
  508. keywordSets.deprecatedMediaFeatureNames = new Set([
  509. 'device-aspect-ratio',
  510. 'device-height',
  511. 'device-width',
  512. 'max-device-aspect-ratio',
  513. 'max-device-height',
  514. 'max-device-width',
  515. 'min-device-aspect-ratio',
  516. 'min-device-height',
  517. 'min-device-width',
  518. ]);
  519. // https://drafts.csswg.org/mediaqueries/#descdef-media-update
  520. keywordSets.mediaFeatureNames = uniteSets(keywordSets.deprecatedMediaFeatureNames, [
  521. 'any-hover',
  522. 'any-pointer',
  523. 'aspect-ratio',
  524. 'color',
  525. 'color-gamut',
  526. 'color-index',
  527. 'forced-colors',
  528. 'grid',
  529. 'height',
  530. 'hover',
  531. 'inverted-colors',
  532. 'light-level',
  533. 'max-aspect-ratio',
  534. 'max-color',
  535. 'max-color-index',
  536. 'max-height',
  537. 'max-monochrome',
  538. 'max-resolution',
  539. 'max-width',
  540. 'min-aspect-ratio',
  541. 'min-color',
  542. 'min-color-index',
  543. 'min-height',
  544. 'min-monochrome',
  545. 'min-resolution',
  546. 'min-width',
  547. 'monochrome',
  548. 'orientation',
  549. 'overflow-block',
  550. 'overflow-inline',
  551. 'pointer',
  552. 'prefers-color-scheme',
  553. 'prefers-reduced-motion',
  554. 'prefers-reduced-transparency',
  555. 'resolution',
  556. 'scan',
  557. 'scripting',
  558. 'update',
  559. 'width',
  560. ]);
  561. // https://www.w3.org/TR/CSS22/ui.html#system-colors
  562. keywordSets.systemColors = new Set([
  563. 'activeborder',
  564. 'activecaption',
  565. 'appworkspace',
  566. 'background',
  567. 'buttonface',
  568. 'buttonhighlight',
  569. 'buttonshadow',
  570. 'buttontext',
  571. 'captiontext',
  572. 'graytext',
  573. 'highlight',
  574. 'highlighttext',
  575. 'inactiveborder',
  576. 'inactivecaption',
  577. 'inactivecaptiontext',
  578. 'infobackground',
  579. 'infotext',
  580. 'menu',
  581. 'menutext',
  582. 'scrollbar',
  583. 'threeddarkshadow',
  584. 'threedface',
  585. 'threedhighlight',
  586. 'threedlightshadow',
  587. 'threedshadow',
  588. 'window',
  589. 'windowframe',
  590. 'windowtext',
  591. ]);
  592. // htmlTags includes only "standard" tags. So we augment it with older tags etc.
  593. keywordSets.nonStandardHtmlTags = new Set([
  594. 'acronym',
  595. 'applet',
  596. 'basefont',
  597. 'big',
  598. 'blink',
  599. 'center',
  600. 'content',
  601. 'dir',
  602. 'font',
  603. 'frame',
  604. 'frameset',
  605. 'hgroup',
  606. 'isindex',
  607. 'keygen',
  608. 'listing',
  609. 'marquee',
  610. 'nobr',
  611. 'noembed',
  612. 'plaintext',
  613. 'spacer',
  614. 'strike',
  615. 'tt',
  616. 'xmp',
  617. ]);
  618. /**
  619. * @param {(string[] | Set<string>)[]} args
  620. */
  621. function uniteSets(...args) {
  622. return new Set(
  623. [...args].reduce((/** @type {string[]} */ result, set) => {
  624. return result.concat([...set]);
  625. }, []),
  626. );
  627. }
  628. module.exports = keywordSets;