@lwc/style-compiler 2.7.0 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const selectors_scoping_1 = require("../utils/selectors-scoping");
|
|
4
|
+
// Subset of prefixes for animation-related names that we expect people might be using.
|
|
5
|
+
// The most important is -webkit, which is actually part of the spec now. All -webkit prefixes
|
|
6
|
+
// are listed here: https://developer.mozilla.org/en-US/docs/Web/CSS/Webkit_Extensions
|
|
7
|
+
// -moz is also still supported as of Firefox 95.
|
|
8
|
+
// We could probably get away with just doing -webkit and -moz (since -ms never seems
|
|
9
|
+
// to have existed for keyframes/animations, and Opera has used Blink since 2013), but
|
|
10
|
+
// covering all the popular ones will at least make the compiled code more consistent
|
|
11
|
+
// for developers who are using all the variants.
|
|
12
|
+
// List based on a subset from https://github.com/wooorm/vendors/blob/2f489ad/index.js
|
|
13
|
+
const VENDOR_PREFIXES = ['moz', 'ms', 'o', 'webkit'];
|
|
14
|
+
// create a list like ['animation', '-webkit-animation', ...]
|
|
15
|
+
function getAllNames(name) {
|
|
16
|
+
return new Set([name, ...VENDOR_PREFIXES.map((prefix) => `-${prefix}-${name}`)]);
|
|
17
|
+
}
|
|
18
|
+
const ANIMATION = getAllNames('animation');
|
|
19
|
+
const ANIMATION_NAME = getAllNames('animation-name');
|
|
4
20
|
function process(root) {
|
|
5
21
|
const knownNames = new Set();
|
|
6
22
|
root.walkAtRules((atRule) => {
|
|
23
|
+
// Note that @-webkit-keyframes, @-moz-keyframes, etc. are not actually a thing supported
|
|
24
|
+
// in any browser, even though you'll see it on some StackOverflow answers.
|
|
7
25
|
if (atRule.name === 'keyframes') {
|
|
8
26
|
const { params } = atRule;
|
|
9
27
|
knownNames.add(params);
|
|
@@ -12,7 +30,7 @@ function process(root) {
|
|
|
12
30
|
});
|
|
13
31
|
root.walkRules((rule) => {
|
|
14
32
|
rule.walkDecls((decl) => {
|
|
15
|
-
if (decl.prop
|
|
33
|
+
if (ANIMATION.has(decl.prop)) {
|
|
16
34
|
// Use a simple heuristic of breaking up the tokens by whitespace. We could use
|
|
17
35
|
// a dedicated animation prop parser (e.g.
|
|
18
36
|
// https://github.com/hookhookun/parse-animation-shorthand) but it's
|
|
@@ -23,7 +41,7 @@ function process(root) {
|
|
|
23
41
|
.map((token) => knownNames.has(token) ? `${token}-${selectors_scoping_1.SHADOW_ATTRIBUTE}` : token);
|
|
24
42
|
decl.value = tokens.join(' ');
|
|
25
43
|
}
|
|
26
|
-
else if (decl.prop
|
|
44
|
+
else if (ANIMATION_NAME.has(decl.prop)) {
|
|
27
45
|
if (knownNames.has(decl.value)) {
|
|
28
46
|
decl.value = `${decl.value}-${selectors_scoping_1.SHADOW_ATTRIBUTE}`;
|
|
29
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/scope-at-rules/transform.ts"],"names":[],"mappings":";;AAOA,kEAA8D;AAE9D,SAAwB,OAAO,CAAC,IAAU;IACtC,MAAM,UAAU,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC1C,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,EAAE;QACxB,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE;YAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;YAC1B,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACvB,MAAM,CAAC,MAAM,GAAG,GAAG,MAAM,IAAI,oCAAgB,EAAE,CAAC;SACnD;IACL,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;QACpB,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YACpB,IAAI,IAAI,CAAC,IAAI,
|
|
1
|
+
{"version":3,"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C/E,0CAA0C;gBAC1C,oEAAoE;gBACpE,qBAAqB;gBACrB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK;qBACpB,IAAI,EAAE;qBACN,KAAK,CAAC,MAAM,CAAC;qBACb,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACX,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,oCAAgB,EAAE,CAAC,CAAC,CAAC,KAAK,CACjE,CAAC;gBACN,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACjC;iBAAM,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBACtC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBAC5B,IAAI,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,KAAK,IAAI,oCAAgB,EAAE,CAAC;iBACpD;aACJ;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAhCD,0BAgCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lwc/style-compiler",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.4",
|
|
4
4
|
"description": "Transform style sheet to be consumed by the LWC engine",
|
|
5
5
|
"homepage": "https://lwc.dev/",
|
|
6
6
|
"repository": {
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"dist/"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@lwc/shared": "2.7.
|
|
26
|
-
"postcss": "~8.
|
|
27
|
-
"postcss-selector-parser": "~6.0.
|
|
28
|
-
"postcss-value-parser": "~4.
|
|
25
|
+
"@lwc/shared": "2.7.4",
|
|
26
|
+
"postcss": "~8.4.5",
|
|
27
|
+
"postcss-selector-parser": "~6.0.9",
|
|
28
|
+
"postcss-value-parser": "~4.2.0",
|
|
29
29
|
"string.prototype.matchall": "^4.0.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "df4eda8be794fa5f7a01148c137eea4e546a0844"
|
|
38
38
|
}
|