@symbo.ls/scratch 2.34.33 → 2.34.35
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/dist/cjs/index.js +18 -1
- package/dist/cjs/transforms/index.js +18 -1
- package/package.json +4 -4
- package/src/transforms/index.js +23 -2
package/dist/cjs/index.js
CHANGED
|
@@ -6127,6 +6127,23 @@ var isBorderStyle = (str) => [
|
|
|
6127
6127
|
"outset",
|
|
6128
6128
|
"initial"
|
|
6129
6129
|
].some((v) => str.includes(v));
|
|
6130
|
+
var splitTopLevelCommas = (value) => {
|
|
6131
|
+
const result = [];
|
|
6132
|
+
let current = "";
|
|
6133
|
+
let depth = 0;
|
|
6134
|
+
for (const char of value) {
|
|
6135
|
+
if (char === "(") depth += 1;
|
|
6136
|
+
else if (char === ")" && depth > 0) depth -= 1;
|
|
6137
|
+
if (char === "," && depth === 0) {
|
|
6138
|
+
result.push(current);
|
|
6139
|
+
current = "";
|
|
6140
|
+
continue;
|
|
6141
|
+
}
|
|
6142
|
+
current += char;
|
|
6143
|
+
}
|
|
6144
|
+
if (current.length || !result.length) result.push(current);
|
|
6145
|
+
return result;
|
|
6146
|
+
};
|
|
6130
6147
|
var transformBorder = (border) => {
|
|
6131
6148
|
const arr = (border + "").split(", ");
|
|
6132
6149
|
return arr.map((v) => {
|
|
@@ -6149,7 +6166,7 @@ var transformTextStroke = (stroke) => {
|
|
|
6149
6166
|
};
|
|
6150
6167
|
var transformShadow = (sh, globalTheme) => getShadow(sh, globalTheme);
|
|
6151
6168
|
var transformBoxShadow = (shadows, globalTheme) => shadows.split("|").map((shadow) => {
|
|
6152
|
-
return shadow
|
|
6169
|
+
return splitTopLevelCommas(shadow).map((v) => {
|
|
6153
6170
|
v = v.trim();
|
|
6154
6171
|
if (v.slice(0, 2) === "--") return `var(${v})`;
|
|
6155
6172
|
if (getColor(v).length > 2) {
|
|
@@ -4982,6 +4982,23 @@ var isBorderStyle = (str) => [
|
|
|
4982
4982
|
"outset",
|
|
4983
4983
|
"initial"
|
|
4984
4984
|
].some((v) => str.includes(v));
|
|
4985
|
+
var splitTopLevelCommas = (value) => {
|
|
4986
|
+
const result = [];
|
|
4987
|
+
let current = "";
|
|
4988
|
+
let depth = 0;
|
|
4989
|
+
for (const char of value) {
|
|
4990
|
+
if (char === "(") depth += 1;
|
|
4991
|
+
else if (char === ")" && depth > 0) depth -= 1;
|
|
4992
|
+
if (char === "," && depth === 0) {
|
|
4993
|
+
result.push(current);
|
|
4994
|
+
current = "";
|
|
4995
|
+
continue;
|
|
4996
|
+
}
|
|
4997
|
+
current += char;
|
|
4998
|
+
}
|
|
4999
|
+
if (current.length || !result.length) result.push(current);
|
|
5000
|
+
return result;
|
|
5001
|
+
};
|
|
4985
5002
|
var transformBorder = (border) => {
|
|
4986
5003
|
const arr = (border + "").split(", ");
|
|
4987
5004
|
return arr.map((v) => {
|
|
@@ -5004,7 +5021,7 @@ var transformTextStroke = (stroke) => {
|
|
|
5004
5021
|
};
|
|
5005
5022
|
var transformShadow = (sh, globalTheme) => getShadow(sh, globalTheme);
|
|
5006
5023
|
var transformBoxShadow = (shadows, globalTheme) => shadows.split("|").map((shadow) => {
|
|
5007
|
-
return shadow
|
|
5024
|
+
return splitTopLevelCommas(shadow).map((v) => {
|
|
5008
5025
|
v = v.trim();
|
|
5009
5026
|
if (v.slice(0, 2) === "--") return `var(${v})`;
|
|
5010
5027
|
if (getColor(v).length > 2) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@symbo.ls/scratch",
|
|
3
3
|
"description": "Φ / CSS framework and methodology.",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
|
-
"version": "2.34.
|
|
5
|
+
"version": "2.34.35",
|
|
6
6
|
"files": [
|
|
7
7
|
"src",
|
|
8
8
|
"dist"
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@domql/utils": "^2.34.
|
|
29
|
-
"@symbo.ls/utils": "^2.34.
|
|
28
|
+
"@domql/utils": "^2.34.35",
|
|
29
|
+
"@symbo.ls/utils": "^2.34.35",
|
|
30
30
|
"color-contrast-checker": "^1.5.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "0be12bcdd99c265fdeded6d756a1a3616a943ffc"
|
|
33
33
|
}
|
package/src/transforms/index.js
CHANGED
|
@@ -30,6 +30,28 @@ const isBorderStyle = (str) =>
|
|
|
30
30
|
'initial'
|
|
31
31
|
].some((v) => str.includes(v))
|
|
32
32
|
|
|
33
|
+
const splitTopLevelCommas = (value) => {
|
|
34
|
+
const result = []
|
|
35
|
+
let current = ''
|
|
36
|
+
let depth = 0
|
|
37
|
+
|
|
38
|
+
for (const char of value) {
|
|
39
|
+
if (char === '(') depth += 1
|
|
40
|
+
else if (char === ')' && depth > 0) depth -= 1
|
|
41
|
+
|
|
42
|
+
if (char === ',' && depth === 0) {
|
|
43
|
+
result.push(current)
|
|
44
|
+
current = ''
|
|
45
|
+
continue
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
current += char
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (current.length || !result.length) result.push(current)
|
|
52
|
+
return result
|
|
53
|
+
}
|
|
54
|
+
|
|
33
55
|
export const transformBorder = (border) => {
|
|
34
56
|
const arr = (border + '').split(', ')
|
|
35
57
|
return arr
|
|
@@ -63,8 +85,7 @@ export const transformBoxShadow = (shadows, globalTheme) =>
|
|
|
63
85
|
shadows
|
|
64
86
|
.split('|')
|
|
65
87
|
.map((shadow) => {
|
|
66
|
-
return shadow
|
|
67
|
-
.split(',')
|
|
88
|
+
return splitTopLevelCommas(shadow)
|
|
68
89
|
.map((v) => {
|
|
69
90
|
v = v.trim()
|
|
70
91
|
if (v.slice(0, 2) === '--') return `var(${v})`
|