@schalkneethling/miyagi-core 4.4.2 → 4.4.3
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.
- package/README.md +7 -2
- package/api/app.js +16 -16
- package/api/index.js +263 -262
- package/bin/miyagi.js +1 -1
- package/dist/css/iframe.css +6 -30
- package/frontend/assets/css/iframe/accordion-tabs.css +39 -39
- package/frontend/assets/css/iframe/jsontree.js.css +149 -149
- package/frontend/assets/css/iframe/prism.css +45 -45
- package/frontend/assets/css/iframe/styleguide/colors.css +27 -27
- package/frontend/assets/css/iframe/styleguide/fonts.css +23 -23
- package/frontend/assets/css/iframe/styleguide/index.css +58 -58
- package/frontend/assets/css/iframe/styleguide/spacings.css +10 -10
- package/frontend/assets/css/iframe.css +191 -191
- package/frontend/assets/css/main/menu/config-switcher.css +21 -21
- package/frontend/assets/css/main/menu/config-switchers.css +34 -34
- package/frontend/assets/css/main/menu/goto.css +16 -16
- package/frontend/assets/css/main/menu/nav.css +49 -49
- package/frontend/assets/css/main/menu/search.css +34 -34
- package/frontend/assets/css/main/menu/title.css +18 -18
- package/frontend/assets/css/main/menu.css +89 -89
- package/frontend/assets/css/main/reset.css +47 -47
- package/frontend/assets/css/main.css +41 -41
- package/frontend/assets/css/shared.css +16 -16
- package/frontend/assets/css/tokens.css +108 -107
- package/frontend/assets/js/_accordion-tabs.js +392 -392
- package/frontend/assets/js/_goto.js +59 -59
- package/frontend/assets/js/_iframe-links.js +14 -14
- package/frontend/assets/js/_is-triggered.js +3 -3
- package/frontend/assets/js/_main.js +369 -369
- package/frontend/assets/js/_mock-data.js +8 -8
- package/frontend/assets/js/_prism.js +1082 -1081
- package/frontend/assets/js/_search.js +186 -186
- package/frontend/assets/js/_socket.js +44 -44
- package/frontend/assets/js/config-switcher/development-mode.js +38 -38
- package/frontend/assets/js/config-switcher/index.js +55 -55
- package/frontend/assets/js/config-switcher/text-direction.js +22 -22
- package/frontend/assets/js/config-switcher/theme.js +68 -68
- package/frontend/assets/js/iframe.build.js +25 -25
- package/frontend/assets/js/iframe.js +38 -38
- package/frontend/assets/js/jsontree.js +979 -976
- package/frontend/assets/js/main.build.js +29 -29
- package/frontend/assets/js/main.js +31 -31
- package/frontend/assets/js/styleguide/color-converter.js +652 -652
- package/frontend/assets/js/styleguide/index.js +100 -100
- package/lib/build/index.js +1014 -1020
- package/lib/cli/app.js +16 -16
- package/lib/cli/component.js +50 -50
- package/lib/cli/doctor.js +130 -121
- package/lib/cli/drupal-assets.js +163 -157
- package/lib/cli/lint.js +196 -196
- package/lib/cli/run.js +150 -146
- package/lib/config.js +86 -86
- package/lib/constants/lint-log-levels.js +6 -6
- package/lib/drupal/load-assets-config.js +59 -60
- package/lib/drupal/resolve-library-assets.js +132 -141
- package/lib/errors.js +20 -20
- package/lib/generator/component.js +124 -124
- package/lib/generator/mocks.js +156 -156
- package/lib/helpers.js +68 -68
- package/lib/i18n/en.js +93 -93
- package/lib/i18n/index.js +8 -8
- package/lib/index.js +13 -13
- package/lib/init/args.js +153 -153
- package/lib/init/config.js +452 -438
- package/lib/init/engines.js +41 -41
- package/lib/init/index.js +83 -83
- package/lib/init/rendering.js +3 -3
- package/lib/init/static.js +90 -90
- package/lib/init/twing/cache.js +27 -27
- package/lib/init/twing/functions.js +37 -37
- package/lib/init/views.js +5 -5
- package/lib/logger.js +72 -72
- package/lib/mocks/get.js +88 -88
- package/lib/mocks/index.js +2 -2
- package/lib/mocks/resolve/ref.js +447 -447
- package/lib/mocks/resolve/tpl.js +218 -218
- package/lib/mocks/resolve.js +154 -154
- package/lib/render/helpers/resolve-assets.js +29 -39
- package/lib/render/helpers.js +27 -27
- package/lib/render/index.js +18 -18
- package/lib/render/views/iframe/component.docs.js +50 -50
- package/lib/render/views/iframe/component.js +249 -248
- package/lib/render/views/iframe/design-tokens/colors.js +38 -38
- package/lib/render/views/iframe/design-tokens/index.js +3 -3
- package/lib/render/views/iframe/design-tokens/sizes.js +35 -35
- package/lib/render/views/iframe/design-tokens/typography.js +37 -37
- package/lib/render/views/iframe/docs.js +42 -42
- package/lib/render/views/iframe/index.js +28 -28
- package/lib/render/views/iframe/variation.js +89 -89
- package/lib/render/views/iframe/variation.standalone.js +69 -68
- package/lib/render/views/main/component.docs.js +38 -38
- package/lib/render/views/main/component.js +55 -55
- package/lib/render/views/main/design-tokens.js +38 -38
- package/lib/render/views/main/docs.js +33 -33
- package/lib/render/views/main/index.js +33 -33
- package/lib/state/components.js +99 -99
- package/lib/state/css.js +33 -33
- package/lib/state/docs.js +72 -72
- package/lib/state/file-contents.js +154 -154
- package/lib/state/helpers.js +53 -53
- package/lib/state/index.js +39 -39
- package/lib/state/menu/index.js +202 -202
- package/lib/state/menu/structure.js +84 -84
- package/lib/state/partials.js +12 -12
- package/lib/state/source-tree.js +51 -51
- package/lib/styleguide/color-names.js +148 -148
- package/lib/styleguide/colors.js +113 -113
- package/lib/styleguide/helpers.js +33 -33
- package/lib/styleguide/index.js +4 -4
- package/lib/styleguide/media-queries.js +18 -18
- package/lib/styleguide/spacings.js +22 -22
- package/lib/styleguide/typography.js +46 -46
- package/lib/validator/mocks.js +110 -83
- package/lib/validator/schemas.js +236 -227
- package/package.json +118 -117
package/lib/styleguide/colors.js
CHANGED
|
@@ -7,129 +7,129 @@ import colorNames from "./color-names.js";
|
|
|
7
7
|
* @returns {Array}
|
|
8
8
|
*/
|
|
9
9
|
export default function getColors(obj, prefix) {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const types = ["typo", "decoration"];
|
|
11
|
+
const uppercasedPrefix = prefix.toUpperCase();
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
13
|
+
const colors = getCustomProperties(obj, prefix)
|
|
14
|
+
.filter(({ property, value }) => {
|
|
15
|
+
const lowerCasedValue = value.toLowerCase();
|
|
16
|
+
return (
|
|
17
|
+
property.match(`--${prefix}-(.)*`) &&
|
|
18
|
+
(lowerCasedValue.startsWith("rgb(") ||
|
|
19
|
+
lowerCasedValue.startsWith("rgba(") ||
|
|
20
|
+
(lowerCasedValue.startsWith("#") &&
|
|
21
|
+
Boolean(lowerCasedValue.match(new RegExp(/^#[a-f0-9]{3,8}$/)))) ||
|
|
22
|
+
lowerCasedValue.startsWith("hsl(") ||
|
|
23
|
+
lowerCasedValue.startsWith("hsla(") ||
|
|
24
|
+
(lowerCasedValue.startsWith("var(--") &&
|
|
25
|
+
lowerCasedValue.endsWith(")")) ||
|
|
26
|
+
colorNames.includes(value))
|
|
27
|
+
);
|
|
28
|
+
})
|
|
29
|
+
.map(({ property, value }) => {
|
|
30
|
+
const lowerCasedValue = value.toLowerCase();
|
|
31
|
+
const whitesArr = [
|
|
32
|
+
"#fff",
|
|
33
|
+
"#ffff",
|
|
34
|
+
"#ffffff",
|
|
35
|
+
"#ffffffff",
|
|
36
|
+
"hsl(0,0%,100%)",
|
|
37
|
+
"hsl(0, 0%,100%)",
|
|
38
|
+
"hsl(0,0%, 100%)",
|
|
39
|
+
"hsl(0, 0%, 100%)",
|
|
40
|
+
"rgb(255,255,255)",
|
|
41
|
+
"rgb(255, 255,255)",
|
|
42
|
+
"rgb(255,255, 255)",
|
|
43
|
+
"rgb(255, 255, 255)",
|
|
44
|
+
"rgba(255,255,255,1)",
|
|
45
|
+
"rgba(255, 255,255,1)",
|
|
46
|
+
"rgba(255, 255, 255,1)",
|
|
47
|
+
"rgba(255, 255,255, 1)",
|
|
48
|
+
"rgba(255,255, 255,1)",
|
|
49
|
+
"rgba(255,255, 255, 1)",
|
|
50
|
+
"rgba(255,255,255, 1)",
|
|
51
|
+
"rgba(255, 255, 255, 1)",
|
|
52
|
+
"white",
|
|
53
|
+
`var(--${uppercasedPrefix}-white)`,
|
|
54
|
+
];
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
types.forEach((type) => {
|
|
57
|
+
const uppercasedType = type.toUpperCase();
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
whitesArr.push(
|
|
60
|
+
`rgba(var(--${uppercasedPrefix}-${uppercasedType}-white-r),var(--${uppercasedPrefix}-${uppercasedType}-white-g),var(--${uppercasedPrefix}-${uppercasedType}-white-b))`,
|
|
61
|
+
`rgba(var(--${uppercasedPrefix}-${uppercasedType}-white-r), var(--${uppercasedPrefix}-${uppercasedType}-white-g), var(--${uppercasedPrefix}-${uppercasedType}-white-b))`,
|
|
62
|
+
`rgbaa(var(--${uppercasedPrefix}-${uppercasedType}-white-r),var(--${uppercasedPrefix}-${uppercasedType}-white-g),var(--${uppercasedPrefix}-${uppercasedType}-white-b),var(--${uppercasedPrefix}-${uppercasedType}-white-a))`,
|
|
63
|
+
`rgbaa(var(--${uppercasedPrefix}-${uppercasedType}-white-r), var(--${uppercasedPrefix}-${uppercasedType}-white-g), var(--${uppercasedPrefix}-${uppercasedType}-white-b), var(--${uppercasedPrefix}-${uppercasedType}-white-a))`,
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
const whites = new Set(whitesArr);
|
|
68
|
+
const customPropertyWithoutPrefix = property.replace(`--${prefix}-`, "");
|
|
69
|
+
const name = customPropertyWithoutPrefix
|
|
70
|
+
.replace(`${types[0]}-`, "")
|
|
71
|
+
.replace(`${types[1]}-`, "");
|
|
72
|
+
let type;
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
types.forEach((t) => {
|
|
75
|
+
if (
|
|
76
|
+
customPropertyWithoutPrefix.toUpperCase().startsWith(t.toUpperCase())
|
|
77
|
+
) {
|
|
78
|
+
type = t;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
return {
|
|
83
|
+
name,
|
|
84
|
+
type,
|
|
85
|
+
customProp: property,
|
|
86
|
+
values: ["RGB", "Hex", "HSL"],
|
|
87
|
+
isWhite: whites.has(lowerCasedValue),
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
const deduped = [
|
|
92
|
+
{
|
|
93
|
+
type: "all",
|
|
94
|
+
styles: [],
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
98
|
+
types.forEach((type) => {
|
|
99
|
+
deduped.push({
|
|
100
|
+
type,
|
|
101
|
+
styles: [],
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
colors.forEach((color) => {
|
|
106
|
+
const t = color.type || "all";
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
108
|
+
if (
|
|
109
|
+
!deduped
|
|
110
|
+
.find(({ type }) => type === t)
|
|
111
|
+
.styles.find(({ name }) => name === color.name)
|
|
112
|
+
) {
|
|
113
|
+
deduped
|
|
114
|
+
.find(({ type }) => type === t)
|
|
115
|
+
.styles.push({
|
|
116
|
+
name: color.name,
|
|
117
|
+
customProp: color.customProp,
|
|
118
|
+
values: color.values,
|
|
119
|
+
isWhite: color.isWhite,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
return deduped.map((entry) => {
|
|
125
|
+
entry.styles = entry.styles.sort((a, b) => {
|
|
126
|
+
const aUppercase = a.name.toUpperCase();
|
|
127
|
+
const bUppercase = b.name.toUpperCase();
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
if (aUppercase > bUppercase) return 1;
|
|
130
|
+
if (aUppercase < bUppercase) return -1;
|
|
131
|
+
return 0;
|
|
132
|
+
});
|
|
133
|
+
return entry;
|
|
134
|
+
});
|
|
135
135
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
export const getCustomProperties = function (obj, property, endsWith) {
|
|
2
|
-
|
|
2
|
+
var result = [];
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
4
|
+
if (obj instanceof Array) {
|
|
5
|
+
for (var i = 0; i < obj.length; i++) {
|
|
6
|
+
result = [...result, ...getCustomProperties(obj[i], property, endsWith)];
|
|
7
|
+
}
|
|
8
|
+
} else {
|
|
9
|
+
for (const prop in obj) {
|
|
10
|
+
if (prop == "property") {
|
|
11
|
+
if (endsWith) {
|
|
12
|
+
if (obj[prop].endsWith(`-${property}`)) {
|
|
13
|
+
result.push({
|
|
14
|
+
property: obj.property,
|
|
15
|
+
value: obj.value,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
if (obj[prop].startsWith(`--${property}-`)) {
|
|
20
|
+
result.push({
|
|
21
|
+
property: obj.property,
|
|
22
|
+
value: obj.value,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (obj[prop] instanceof Object || obj[prop] instanceof Array) {
|
|
28
|
+
result = [
|
|
29
|
+
...result,
|
|
30
|
+
...getCustomProperties(obj[prop], property, endsWith),
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
return result;
|
|
37
37
|
};
|
package/lib/styleguide/index.js
CHANGED
|
@@ -4,14 +4,14 @@ import spacings from "./spacings.js";
|
|
|
4
4
|
import mediaQueries from "./media-queries.js";
|
|
5
5
|
|
|
6
6
|
export const getColors = (obj, prefix) => {
|
|
7
|
-
|
|
7
|
+
return colors(obj, prefix);
|
|
8
8
|
};
|
|
9
9
|
export const getTypography = (obj, prefix) => {
|
|
10
|
-
|
|
10
|
+
return typography(obj, prefix);
|
|
11
11
|
};
|
|
12
12
|
export const getSpacings = (obj, prefix) => {
|
|
13
|
-
|
|
13
|
+
return spacings(obj, prefix);
|
|
14
14
|
};
|
|
15
15
|
export const getMediaQueries = (obj) => {
|
|
16
|
-
|
|
16
|
+
return mediaQueries(obj);
|
|
17
17
|
};
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
* @returns {Array}
|
|
4
4
|
*/
|
|
5
5
|
export default function getMediaQueries(obj) {
|
|
6
|
-
|
|
6
|
+
var result = [];
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
if (obj instanceof Array) {
|
|
9
|
+
for (var i = 0; i < obj.length; i++) {
|
|
10
|
+
result = [...result, ...getMediaQueries(obj[i])];
|
|
11
|
+
}
|
|
12
|
+
} else {
|
|
13
|
+
for (const prop in obj) {
|
|
14
|
+
if (prop == "type") {
|
|
15
|
+
if (obj[prop] === "media") {
|
|
16
|
+
result.push(obj.media);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (obj[prop] instanceof Object || obj[prop] instanceof Array) {
|
|
20
|
+
result = [...result, ...getMediaQueries(obj[prop])];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
return result.filter((v, i, a) => a.indexOf(v) === i);
|
|
26
26
|
}
|
|
@@ -6,30 +6,30 @@ import { getCustomProperties } from "./helpers.js";
|
|
|
6
6
|
* @returns {Array}
|
|
7
7
|
*/
|
|
8
8
|
export default function getSpacings(obj, prefix) {
|
|
9
|
-
|
|
9
|
+
const spacings = [];
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
getCustomProperties(obj, prefix).forEach(({ property, value, mq }) => {
|
|
12
|
+
// filter out negative spacings
|
|
13
|
+
if (property.startsWith(`--${prefix}-`) && !value.startsWith("-")) {
|
|
14
|
+
spacings.push({
|
|
15
|
+
name: property.replace(`--${prefix}-`, ""),
|
|
16
|
+
customProp: property,
|
|
17
|
+
value,
|
|
18
|
+
mq,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const deduped = {};
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
spacings.forEach((e) => {
|
|
26
|
+
if (!deduped[e.name]) {
|
|
27
|
+
deduped[e.name] = {
|
|
28
|
+
customProp: e.customProp,
|
|
29
|
+
value: e.value,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
return Object.entries(deduped);
|
|
35
35
|
}
|
|
@@ -6,56 +6,56 @@ import { getCustomProperties } from "./helpers.js";
|
|
|
6
6
|
* @returns {Array}
|
|
7
7
|
*/
|
|
8
8
|
export default function getTypography(obj, prefix) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
const props = [
|
|
10
|
+
"font-family",
|
|
11
|
+
"font-feature-settings",
|
|
12
|
+
"font-kerning",
|
|
13
|
+
"font-size-adjust",
|
|
14
|
+
"font-size",
|
|
15
|
+
"font-stretch",
|
|
16
|
+
"font-style",
|
|
17
|
+
"font-variant-caps",
|
|
18
|
+
"font-variant",
|
|
19
|
+
"font-weight",
|
|
20
|
+
"letter-spacing",
|
|
21
|
+
"line-height",
|
|
22
|
+
"text-shadow",
|
|
23
|
+
"text-transform",
|
|
24
|
+
];
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const deduped = {};
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
props.forEach((prop) => {
|
|
29
|
+
getCustomProperties(obj, prop, true).forEach(({ property }) => {
|
|
30
|
+
if (property.startsWith(`--${prefix}-`)) {
|
|
31
|
+
const name = property
|
|
32
|
+
.replace(`--${prefix}-`, "")
|
|
33
|
+
.replace(`-${prop}`, "");
|
|
34
|
+
const customPropName = property.replace(`-${prop}`, "");
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
if (!deduped[name]) {
|
|
37
|
+
deduped[name] = {
|
|
38
|
+
customProp: customPropName,
|
|
39
|
+
values: [],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
if (!deduped[name].values.find(({ value }) => value === property)) {
|
|
44
|
+
deduped[name].values.push({
|
|
45
|
+
label: prop,
|
|
46
|
+
value: property,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
return Object.entries(deduped).sort((a, b) => {
|
|
54
|
+
const aUppercase = a[0].toUpperCase();
|
|
55
|
+
const bUppercase = b[0].toUpperCase();
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
if (aUppercase > bUppercase) return 1;
|
|
58
|
+
if (aUppercase < bUppercase) return -1;
|
|
59
|
+
return 0;
|
|
60
|
+
});
|
|
61
61
|
}
|