From dc58c344bbe449501fde918044352c78f11a64f6 Mon Sep 17 00:00:00 2001 From: Jane Chu <7559015+janechu@users.noreply.github.com> Date: Fri, 4 Dec 2020 12:48:51 -0800 Subject: [PATCH] feat: allow filtering MDN data by status (#4164) # Description This allows the filtering of MDN data by it's status, the default export of MDN data from the tooling is filtered to only include "standard" MDN CSS. ## Issue type checklist - [ ] **Chore**: A change that does not impact distributed packages. - [ ] **Bug fix**: A change that fixes an issue, link to the issue above. - [x] **New feature**: A change that adds functionality. **Is this a breaking change?** - [ ] This change causes current functionality to break. **Adding or modifying component(s) in `@microsoft/fast-components` checklist** - [ ] I have added a new component - [ ] I have modified an existing component - [ ] I have updated the [definition file](https://github.com/Microsoft/fast/blob/master/packages/web-components/fast-components/CONTRIBUTING.md#definition) - [ ] I have updated the [configuration file](https://github.com/Microsoft/fast/blob/master/packages/web-components/fast-components/CONTRIBUTING.md#configuration) ## Process & policy checklist - [x] I have added tests for my changes. - [x] I have tested my changes. - [ ] I have updated the project documentation to reflect my changes. - [x] I have read the [CONTRIBUTING](https://github.com/Microsoft/fast/blob/master/CONTRIBUTING.md) documentation and followed the [standards](https://www.fast.design/docs/community/code-of-conduct/#our-standards) for this project. --- .../build/generate-mdn-data-files.js | 30 +- packages/tooling/fast-tooling/src/css-data.js | 6671 ++--------------- .../fast-tooling/src/css-data.properties.ts | 2 +- .../fast-tooling/src/css-data.syntax.ts | 2 +- .../fast-tooling/src/css-data.types.ts | 2 +- .../data-utilities/mapping.mdn-data.spec.ts | 50 + .../src/data-utilities/mapping.mdn-data.ts | 74 +- .../data-utilities/mapping.mdn-data.types.ts | 2 +- 8 files changed, 714 insertions(+), 6119 deletions(-) diff --git a/packages/tooling/fast-tooling/build/generate-mdn-data-files.js b/packages/tooling/fast-tooling/build/generate-mdn-data-files.js index 04ba7d3749a..d65ead695c7 100644 --- a/packages/tooling/fast-tooling/build/generate-mdn-data-files.js +++ b/packages/tooling/fast-tooling/build/generate-mdn-data-files.js @@ -29,11 +29,16 @@ const comment = `/** (function () { if (yargs.argv.test) { - const updatedCSSProperties = mapCSSProperties({ - properties: mdnCSS.properties, - syntaxes: mdnCSS.syntaxes, - types: mdnCSS.types, - }); + const updatedCSSProperties = mapCSSProperties( + { + properties: mdnCSS.properties, + syntaxes: mdnCSS.syntaxes, + types: mdnCSS.types, + }, + { + status: "standard", + } + ); if (isEqual(updatedCSSProperties, properties)) { console.log( @@ -52,11 +57,16 @@ const comment = `/** fs.writeFile( outFilePath, `${comment}export const properties = ${JSON.stringify( - mapCSSProperties({ - properties: mdnCSS.properties, - syntaxes: mdnCSS.syntaxes, - types: mdnCSS.types, - }), + mapCSSProperties( + { + properties: mdnCSS.properties, + syntaxes: mdnCSS.syntaxes, + types: mdnCSS.types, + }, + { + status: "standard", + } + ), null, 4 )}\n\nexport const syntaxes = ${JSON.stringify( diff --git a/packages/tooling/fast-tooling/src/css-data.js b/packages/tooling/fast-tooling/src/css-data.js index 09d238bdec2..691d04a903d 100644 --- a/packages/tooling/fast-tooling/src/css-data.js +++ b/packages/tooling/fast-tooling/src/css-data.js @@ -2,39 +2,26 @@ * This file is generated from build/generate-mdn-data-files.js * any modifications will be overwritten. * - * Last modified: 11/20/2020 + * Last modified: 12/3/2020 */ export const properties = { - "--*": { - name: "--*", - appliesTo: "allElements", - syntax: { - mapsToProperty: "--*", - percentages: "no", - ref: "", - refCombinatorType: "none", - multiplier: null, - prepend: null, - type: "value", - }, - }, - "-ms-accelerator": { - name: "-ms-accelerator", + "-webkit-line-clamp": { + name: "-webkit-line-clamp", appliesTo: "allElements", syntax: { - mapsToProperty: "-ms-accelerator", + mapsToProperty: "-webkit-line-clamp", percentages: "no", ref: [ { type: "value", - ref: "false", + ref: "none", refCombinatorType: "none", prepend: null, multiplier: null, }, { - type: "value", - ref: "true", + type: "type", + ref: "", refCombinatorType: "none", prepend: null, multiplier: null, @@ -46,37 +33,46 @@ export const properties = { type: "mixed", }, }, - "-ms-block-progression": { - name: "-ms-block-progression", - appliesTo: "allElements", + "align-content": { + name: "align-content", + appliesTo: "multilineFlexContainers", syntax: { - mapsToProperty: "-ms-block-progression", + mapsToProperty: "align-content", percentages: "no", ref: [ { type: "value", - ref: "tb", + ref: "normal", refCombinatorType: "none", prepend: null, multiplier: null, }, { - type: "value", - ref: "rl", + type: "syntax", + ref: "", refCombinatorType: "none", prepend: null, multiplier: null, }, { - type: "value", - ref: "bt", + type: "syntax", + ref: "", refCombinatorType: "none", prepend: null, multiplier: null, }, { - type: "value", - ref: "lr", + type: "syntax", + ref: "", + refCombinatorType: "none", + prepend: null, + multiplier: { + type: "zeroOrOne", + }, + }, + { + type: "syntax", + ref: "", refCombinatorType: "none", prepend: null, multiplier: null, @@ -88,27 +84,58 @@ export const properties = { type: "mixed", }, }, - "-ms-content-zoom-chaining": { - name: "-ms-content-zoom-chaining", - appliesTo: "nonReplacedBlockAndInlineBlockElements", + "align-items": { + name: "align-items", + appliesTo: "allElements", syntax: { - mapsToProperty: "-ms-content-zoom-chaining", + mapsToProperty: "align-items", percentages: "no", ref: [ { type: "value", - ref: "none", + ref: "normal", refCombinatorType: "none", prepend: null, multiplier: null, }, { type: "value", - ref: "chained", + ref: "stretch", + refCombinatorType: "none", + prepend: null, + multiplier: null, + }, + { + type: "syntax", + ref: "", refCombinatorType: "none", prepend: null, multiplier: null, }, + { + type: "mixed", + ref: [ + { + type: "syntax", + ref: "", + refCombinatorType: "none", + prepend: null, + multiplier: { + type: "zeroOrOne", + }, + }, + { + type: "syntax", + ref: "", + refCombinatorType: "none", + prepend: null, + multiplier: null, + }, + ], + refCombinatorType: "juxtaposition", + prepend: null, + multiplier: null, + }, ], refCombinatorType: "exactlyOne", multiplier: null, @@ -116,153 +143,95 @@ export const properties = { type: "mixed", }, }, - "-ms-content-zooming": { - name: "-ms-content-zooming", - appliesTo: "nonReplacedBlockAndInlineBlockElements", + "align-self": { + name: "align-self", + appliesTo: "flexItemsGridItemsAndAbsolutelyPositionedBoxes", syntax: { - mapsToProperty: "-ms-content-zooming", + mapsToProperty: "align-self", percentages: "no", ref: [ { type: "value", - ref: "none", + ref: "auto", refCombinatorType: "none", prepend: null, multiplier: null, }, { type: "value", - ref: "zoom", + ref: "normal", refCombinatorType: "none", prepend: null, multiplier: null, }, - ], - refCombinatorType: "exactlyOne", - multiplier: null, - prepend: null, - type: "mixed", - }, - }, - "-ms-content-zoom-limit": { - name: "-ms-content-zoom-limit", - appliesTo: "nonReplacedBlockAndInlineBlockElements", - syntax: { - mapsToProperty: "-ms-content-zoom-limit", - percentages: ["-ms-content-zoom-limit-max", "-ms-content-zoom-limit-min"], - ref: [ { - type: "property", - ref: "<'-ms-content-zoom-limit-min'>", + type: "value", + ref: "stretch", refCombinatorType: "none", prepend: null, multiplier: null, }, { - type: "property", - ref: "<'-ms-content-zoom-limit-max'>", + type: "syntax", + ref: "", refCombinatorType: "none", prepend: null, multiplier: null, }, - ], - refCombinatorType: "juxtaposition", - multiplier: null, - prepend: null, - type: "mixed", - }, - }, - "-ms-content-zoom-limit-max": { - name: "-ms-content-zoom-limit-max", - appliesTo: "nonReplacedBlockAndInlineBlockElements", - syntax: { - mapsToProperty: "-ms-content-zoom-limit-max", - percentages: "maxZoomFactor", - ref: "", - refCombinatorType: "none", - multiplier: null, - prepend: null, - type: "type", - }, - }, - "-ms-content-zoom-limit-min": { - name: "-ms-content-zoom-limit-min", - appliesTo: "nonReplacedBlockAndInlineBlockElements", - syntax: { - mapsToProperty: "-ms-content-zoom-limit-min", - percentages: "minZoomFactor", - ref: "", - refCombinatorType: "none", - multiplier: null, - prepend: null, - type: "type", - }, - }, - "-ms-content-zoom-snap": { - name: "-ms-content-zoom-snap", - appliesTo: "nonReplacedBlockAndInlineBlockElements", - syntax: { - mapsToProperty: "-ms-content-zoom-snap", - percentages: "no", - ref: [ { - type: "property", - ref: "<'-ms-content-zoom-snap-type'>", + type: "syntax", + ref: "", refCombinatorType: "none", prepend: null, - multiplier: null, + multiplier: { + type: "zeroOrOne", + }, }, { - type: "property", - ref: "<'-ms-content-zoom-snap-points'>", + type: "syntax", + ref: "", refCombinatorType: "none", prepend: null, multiplier: null, }, ], - refCombinatorType: "atLeastOneInAnyOrder", + refCombinatorType: "exactlyOne", multiplier: null, prepend: null, type: "mixed", }, }, - "-ms-content-zoom-snap-points": { - name: "-ms-content-zoom-snap-points", - appliesTo: "nonReplacedBlockAndInlineBlockElements", - syntax: { - mapsToProperty: "-ms-content-zoom-snap-points", - percentages: "no", - ref: "snapInterval( , ) | snapList( # )", - refCombinatorType: "none", - multiplier: null, - prepend: null, - type: "value", - }, - }, - "-ms-content-zoom-snap-type": { - name: "-ms-content-zoom-snap-type", - appliesTo: "nonReplacedBlockAndInlineBlockElements", + all: { + name: "all", + appliesTo: "allElements", syntax: { - mapsToProperty: "-ms-content-zoom-snap-type", + mapsToProperty: "all", percentages: "no", ref: [ { type: "value", - ref: "none", + ref: "initial", + refCombinatorType: "none", + prepend: null, + multiplier: null, + }, + { + type: "value", + ref: "inherit", refCombinatorType: "none", prepend: null, multiplier: null, }, { type: "value", - ref: "proximity", + ref: "unset", refCombinatorType: "none", prepend: null, multiplier: null, }, { type: "value", - ref: "mandatory", + ref: "revert", refCombinatorType: "none", prepend: null, multiplier: null, @@ -274,214 +243,253 @@ export const properties = { type: "mixed", }, }, - "-ms-filter": { - name: "-ms-filter", - appliesTo: "allElements", - syntax: { - mapsToProperty: "-ms-filter", - percentages: "no", - ref: "", - refCombinatorType: "none", - multiplier: null, - prepend: null, - type: "type", - }, - }, - "-ms-flow-from": { - name: "-ms-flow-from", - appliesTo: "nonReplacedElements", + animation: { + name: "animation", + appliesTo: "allElementsAndPseudos", syntax: { - mapsToProperty: "-ms-flow-from", + mapsToProperty: "animation", percentages: "no", ref: [ { - type: "value", - ref: "none", - refCombinatorType: "none", - prepend: null, - multiplier: null, - }, - { - type: "type", - ref: "", + type: "syntax", + ref: "", refCombinatorType: "none", prepend: null, - multiplier: null, + multiplier: { + type: "oneOrMoreSeparatedByComma", + }, }, ], - refCombinatorType: "exactlyOne", + refCombinatorType: "none", multiplier: { type: "oneOrMoreSeparatedByComma", }, prepend: null, - type: "mixed", + type: "syntax", }, }, - "-ms-flow-into": { - name: "-ms-flow-into", - appliesTo: "iframeElements", + "animation-delay": { + name: "animation-delay", + appliesTo: "allElementsAndPseudos", syntax: { - mapsToProperty: "-ms-flow-into", + mapsToProperty: "animation-delay", percentages: "no", ref: [ - { - type: "value", - ref: "none", - refCombinatorType: "none", - prepend: null, - multiplier: null, - }, { type: "type", - ref: "", + ref: "