update and add simple value sets (fixes #55) (#56)

This commit is contained in:
Martin Aeschlimann 2022-11-01 17:24:10 +01:00 коммит произвёл GitHub
Родитель 73007065a0
Коммит 88bffcd8b6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
7 изменённых файлов: 2144 добавлений и 1399 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -295,40 +295,6 @@ function getValues(valArr, restriction, ruleName) {
return vals
}
function internalizeDescriptions(entries) {
var descriptions = {}
var conflicts = {}
entries.forEach(function(e) {
if (e.values) {
e.values.forEach(function(d) {
if (!d.desc) {
conflicts[d.name] = true
return
}
var existing = descriptions[d.name]
if (existing) {
if (existing !== d.desc) {
conflicts[d.name] = true
}
}
descriptions[d.name] = d.desc
})
}
})
entries.forEach(function(e) {
if (e.values) {
e.values.forEach(function(d) {
if (!conflicts[d.name]) {
delete d.desc
} else {
delete descriptions[d.name]
}
})
}
})
return descriptions
}
function toSource(object, keyName) {
if (!object.css[keyName]) {
return []

Просмотреть файл

@ -53,11 +53,17 @@ function addMDNProperties(vscProperties) {
* 1. Go through VSC properties. For each entry that has a matching entry in MDN, merge both entry.
*/
vscProperties.forEach(p => {
if (p.name) {
if (allMDNProperties[p.name]) {
const name = p.name;
if (name) {
const mdnProperty = allMDNProperties[name];
if (mdnProperty) {
if (p.values) {
// use the handcrafted values, if available
mdnProperty.values = p.values;
}
propertyMap[p.name] = {
...p,
...allMDNProperties[p.name]
...mdnProperty
}
} else {
propertyMap[p.name] = p
@ -112,10 +118,19 @@ function addMDNProperties(vscProperties) {
function extractMDNProperties(name, mdnEntry, mdCompatEntry) {
return {
status: abbreviateStatus(mdnEntry, mdCompatEntry),
syntax: mdnEntry.syntax
syntax: mdnEntry.syntax,
values: getValuesFromSytax(mdnEntry.syntax)
}
}
function getValuesFromSytax(syntax) {
// collect the values if the syntax is simple (a | b | c)
if (/^[\w-]+(?:\s*\|\s*[\w-]+)*$/.test(syntax)) {
return syntax.split('|').map(e => e.trim()).map(name => ({ name }));
}
return undefined;
}
/**
* Make syntax as small as possible for browser usage
*/

Просмотреть файл

@ -198,7 +198,20 @@ module.exports = {
'input-security': 'Enables or disables the obscuring a sensitive test input.',
'animation-timeline': 'Specifies the names of one or more @scroll-timeline at-rules to describe the element\'s scroll animations.',
'print-color-adjust': 'Defines what optimization the user agent is allowed to do when adjusting the appearance for an output device.',
'white-space': `Specifies how whitespace is handled in an element.`
'white-space': `Specifies how whitespace is handled in an element.`,
'animation-composition': 'The composite operation to use when multiple animations affect the same property.',
'caret': 'Shorthand for setting caret-color and caret-shape.',
'caret-shape': 'Specifies the desired shape of the text insertion caret.',
'contain-intrinsic-size': 'Size of an element when the element is subject to size containment.',
'contain-intrinsic-block-size': 'Block size of an element when the element is subject to size containment.',
'contain-intrinsic-height': 'Height of an element when the element is subject to size containment.',
'contain-intrinsic-inline-size': 'Inline size of an element when the element is subject to size containment.',
'contain-intrinsic-width': 'Width of an element when the element is subject to size containment.',
'math-depth': 'Describe a notion of "depth" for each element of a mathematical formula, with respect to the top-level container of that formula.',
'math-shift': 'Used for positioning superscript during the layout of MathML scripted elements.',
'scroll-timeline': 'Defines a name that can be used to identify the source element of a scroll timeline, along with the scrollbar axis that should provide the timeline.',
'scroll-timeline-axis': 'Specifies the scrollbar that will be used to provide the timeline for a scroll-timeline animation',
'scroll-timeline-name': 'Defines a name that can be used to identify an element as the source of a scroll-timeline.',
},
pseudoSelectorDescriptions: {
':defined': 'The :defined CSS pseudo-class represents any element that has been defined. This includes any standard element built in to the browser, and custom elements that have been successfully defined (i.e. with the CustomElementRegistry.define() method).',

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -19,8 +19,8 @@
"data/*"
],
"devDependencies": {
"@mdn/browser-compat-data": "^5.2.6",
"mdn-data": "^2.0.29",
"@mdn/browser-compat-data": "^5.2.12",
"mdn-data": "^2.0.30",
"xml2js": "^0.4.23"
}
}

Просмотреть файл

@ -2,15 +2,15 @@
# yarn lockfile v1
"@mdn/browser-compat-data@^5.2.6":
version "5.2.6"
resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.2.6.tgz#a1c277f964fcf2892d059ea34e171fb76992acac"
integrity sha512-KJfP6iTcVX+R5OSC4NOIF4V9fTyifcjwmdkOk7UzsaWxkF21rc6KhGlohqiSRVEynidGO1EEyyYf/PD3jsM1gA==
"@mdn/browser-compat-data@^5.2.12":
version "5.2.12"
resolved "https://registry.yarnpkg.com/@mdn/browser-compat-data/-/browser-compat-data-5.2.12.tgz#840eb59ae8e2887657b64f02fabcf92f83af44c5"
integrity sha512-lyEya27qBCLUWFRIG2hSmvaChE+sCxgpg+8OyZba089hzJ30MhKmbJKhwwDKiFV/7NlizMT/9uPmkJ7p1iNByg==
mdn-data@^2.0.29:
version "2.0.29"
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.29.tgz#cbe9b6a7d29d1d38ed414f3c2678cac1d92e9ba0"
integrity sha512-7n1iU+/dq8AGSgYv/ZOagoaugnJQooGMTr/O29TTHDWV3gnz5gN4bTyhI2zCQH/P6hSDqzqCxJ2xMa2BFG/zlQ==
mdn-data@^2.0.30:
version "2.0.30"
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.30.tgz#ce4df6f80af6cfbe218ecd5c552ba13c4dfa08cc"
integrity sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==
sax@>=0.6.0:
version "1.2.4"