@symbo.ls/scratch 2.11.438 → 2.11.442
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 +13 -9
- package/dist/cjs/transforms/index.js +13 -9
- package/package.json +2 -2
- package/src/transforms/index.js +9 -5
package/dist/cjs/index.js
CHANGED
|
@@ -253,14 +253,14 @@ var require_types = __commonJS({
|
|
|
253
253
|
isNot: () => isNot,
|
|
254
254
|
isNull: () => isNull2,
|
|
255
255
|
isNumber: () => isNumber2,
|
|
256
|
-
isObject: () =>
|
|
256
|
+
isObject: () => isObject7,
|
|
257
257
|
isObjectLike: () => isObjectLike3,
|
|
258
258
|
isString: () => isString9,
|
|
259
259
|
isUndefined: () => isUndefined2
|
|
260
260
|
});
|
|
261
261
|
module2.exports = __toCommonJS2(types_exports);
|
|
262
262
|
var import_node = require_node();
|
|
263
|
-
var
|
|
263
|
+
var isObject7 = (arg) => {
|
|
264
264
|
if (arg === null)
|
|
265
265
|
return false;
|
|
266
266
|
return typeof arg === "object" && arg.constructor === Object;
|
|
@@ -278,7 +278,7 @@ var require_types = __commonJS({
|
|
|
278
278
|
return typeof arg === "object";
|
|
279
279
|
};
|
|
280
280
|
var isDefined2 = (arg) => {
|
|
281
|
-
return
|
|
281
|
+
return isObject7(arg) || isObjectLike3(arg) || isString9(arg) || isNumber2(arg) || isFunction2(arg) || isArray7(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull2(arg);
|
|
282
282
|
};
|
|
283
283
|
var isUndefined2 = (arg) => {
|
|
284
284
|
return arg === void 0;
|
|
@@ -286,7 +286,7 @@ var require_types = __commonJS({
|
|
|
286
286
|
var TYPES = {
|
|
287
287
|
boolean: isBoolean,
|
|
288
288
|
array: isArray7,
|
|
289
|
-
object:
|
|
289
|
+
object: isObject7,
|
|
290
290
|
string: isString9,
|
|
291
291
|
date: isDate,
|
|
292
292
|
number: isNumber2,
|
|
@@ -5561,13 +5561,17 @@ var transformTextStroke = (stroke) => {
|
|
|
5561
5561
|
}).join(" ");
|
|
5562
5562
|
};
|
|
5563
5563
|
var transformShadow = (sh, globalTheme) => getShadow(sh, globalTheme);
|
|
5564
|
-
var transformBoxShadow = (shadows) => shadows.split("|").map((shadow) => {
|
|
5565
|
-
return shadow.split(",
|
|
5564
|
+
var transformBoxShadow = (shadows, globalTheme) => shadows.split("|").map((shadow) => {
|
|
5565
|
+
return shadow.split(",").map((v) => {
|
|
5566
5566
|
v = v.trim();
|
|
5567
5567
|
if (v.slice(0, 2) === "--")
|
|
5568
5568
|
return `var(${v})`;
|
|
5569
|
-
if (getColor(v).length > 2)
|
|
5570
|
-
|
|
5569
|
+
if (getColor(v).length > 2) {
|
|
5570
|
+
const color = getMediaColor(v, globalTheme);
|
|
5571
|
+
if ((0, import_utils25.isObject)(color))
|
|
5572
|
+
return Object.values(color).filter((v2) => v2.includes(": " + globalTheme))[0];
|
|
5573
|
+
return color;
|
|
5574
|
+
}
|
|
5571
5575
|
if (v.includes("px") || v.slice(-2) === "em")
|
|
5572
5576
|
return v;
|
|
5573
5577
|
const arr = v.split(" ");
|
|
@@ -5587,7 +5591,7 @@ var transformBackgroundImage = (backgroundImage, globalTheme) => {
|
|
|
5587
5591
|
return {
|
|
5588
5592
|
backgroundImage: getMediaColor(backgroundImage, globalTheme || CONFIG2.globalTheme)
|
|
5589
5593
|
};
|
|
5590
|
-
} else if (v.includes("/") || v.
|
|
5594
|
+
} else if (v.includes("/") || v.startsWith("http") || v.includes("."))
|
|
5591
5595
|
return `url(${v})`;
|
|
5592
5596
|
return v;
|
|
5593
5597
|
}).join(" ");
|
|
@@ -217,14 +217,14 @@ var require_types = __commonJS({
|
|
|
217
217
|
isNot: () => isNot,
|
|
218
218
|
isNull: () => isNull2,
|
|
219
219
|
isNumber: () => isNumber2,
|
|
220
|
-
isObject: () =>
|
|
220
|
+
isObject: () => isObject7,
|
|
221
221
|
isObjectLike: () => isObjectLike3,
|
|
222
222
|
isString: () => isString9,
|
|
223
223
|
isUndefined: () => isUndefined2
|
|
224
224
|
});
|
|
225
225
|
module2.exports = __toCommonJS2(types_exports);
|
|
226
226
|
var import_node = require_node();
|
|
227
|
-
var
|
|
227
|
+
var isObject7 = (arg) => {
|
|
228
228
|
if (arg === null)
|
|
229
229
|
return false;
|
|
230
230
|
return typeof arg === "object" && arg.constructor === Object;
|
|
@@ -242,7 +242,7 @@ var require_types = __commonJS({
|
|
|
242
242
|
return typeof arg === "object";
|
|
243
243
|
};
|
|
244
244
|
var isDefined2 = (arg) => {
|
|
245
|
-
return
|
|
245
|
+
return isObject7(arg) || isObjectLike3(arg) || isString9(arg) || isNumber2(arg) || isFunction(arg) || isArray7(arg) || isObjectLike3(arg) || isBoolean(arg) || isDate(arg) || isNull2(arg);
|
|
246
246
|
};
|
|
247
247
|
var isUndefined2 = (arg) => {
|
|
248
248
|
return arg === void 0;
|
|
@@ -250,7 +250,7 @@ var require_types = __commonJS({
|
|
|
250
250
|
var TYPES = {
|
|
251
251
|
boolean: isBoolean,
|
|
252
252
|
array: isArray7,
|
|
253
|
-
object:
|
|
253
|
+
object: isObject7,
|
|
254
254
|
string: isString9,
|
|
255
255
|
date: isDate,
|
|
256
256
|
number: isNumber2,
|
|
@@ -4531,13 +4531,17 @@ var transformTextStroke = (stroke) => {
|
|
|
4531
4531
|
}).join(" ");
|
|
4532
4532
|
};
|
|
4533
4533
|
var transformShadow = (sh, globalTheme) => getShadow(sh, globalTheme);
|
|
4534
|
-
var transformBoxShadow = (shadows) => shadows.split("|").map((shadow) => {
|
|
4535
|
-
return shadow.split(",
|
|
4534
|
+
var transformBoxShadow = (shadows, globalTheme) => shadows.split("|").map((shadow) => {
|
|
4535
|
+
return shadow.split(",").map((v) => {
|
|
4536
4536
|
v = v.trim();
|
|
4537
4537
|
if (v.slice(0, 2) === "--")
|
|
4538
4538
|
return `var(${v})`;
|
|
4539
|
-
if (getColor(v).length > 2)
|
|
4540
|
-
|
|
4539
|
+
if (getColor(v).length > 2) {
|
|
4540
|
+
const color = getMediaColor(v, globalTheme);
|
|
4541
|
+
if ((0, import_utils25.isObject)(color))
|
|
4542
|
+
return Object.values(color).filter((v2) => v2.includes(": " + globalTheme))[0];
|
|
4543
|
+
return color;
|
|
4544
|
+
}
|
|
4541
4545
|
if (v.includes("px") || v.slice(-2) === "em")
|
|
4542
4546
|
return v;
|
|
4543
4547
|
const arr = v.split(" ");
|
|
@@ -4557,7 +4561,7 @@ var transformBackgroundImage = (backgroundImage, globalTheme) => {
|
|
|
4557
4561
|
return {
|
|
4558
4562
|
backgroundImage: getMediaColor(backgroundImage, globalTheme || CONFIG2.globalTheme)
|
|
4559
4563
|
};
|
|
4560
|
-
} else if (v.includes("/") || v.
|
|
4564
|
+
} else if (v.includes("/") || v.startsWith("http") || v.includes("."))
|
|
4561
4565
|
return `url(${v})`;
|
|
4562
4566
|
return v;
|
|
4563
4567
|
}).join(" ");
|
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.11.
|
|
5
|
+
"version": "2.11.442",
|
|
6
6
|
"files": [
|
|
7
7
|
"src",
|
|
8
8
|
"dist"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"@symbo.ls/utils": "latest",
|
|
31
31
|
"color-contrast-checker": "^1.5.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "60703b95e42c583fd5cdae32cf3484197e9ccd69"
|
|
34
34
|
}
|
package/src/transforms/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { isNull, isString, isUndefined } from '@domql/utils'
|
|
3
|
+
import { isNull, isString, isObject, isUndefined } from '@domql/utils'
|
|
4
4
|
import { getActiveConfig } from '../factory'
|
|
5
5
|
import {
|
|
6
6
|
getSpacingByKey,
|
|
@@ -49,11 +49,15 @@ export const transformTextStroke = stroke => {
|
|
|
49
49
|
|
|
50
50
|
export const transformShadow = (sh, globalTheme) => getShadow(sh, globalTheme)
|
|
51
51
|
|
|
52
|
-
export const transformBoxShadow = shadows => shadows.split('|').map(shadow => {
|
|
53
|
-
return shadow.split(',
|
|
52
|
+
export const transformBoxShadow = (shadows, globalTheme) => shadows.split('|').map(shadow => {
|
|
53
|
+
return shadow.split(',').map(v => {
|
|
54
54
|
v = v.trim()
|
|
55
55
|
if (v.slice(0, 2) === '--') return `var(${v})`
|
|
56
|
-
if (getColor(v).length > 2)
|
|
56
|
+
if (getColor(v).length > 2) {
|
|
57
|
+
const color = getMediaColor(v, globalTheme)
|
|
58
|
+
if (isObject(color)) return Object.values(color).filter(v => v.includes(': ' + globalTheme))[0]
|
|
59
|
+
return color
|
|
60
|
+
}
|
|
57
61
|
if (v.includes('px') || v.slice(-2) === 'em') return v
|
|
58
62
|
const arr = v.split(' ')
|
|
59
63
|
if (!arr.length) return v
|
|
@@ -70,7 +74,7 @@ export const transformBackgroundImage = (backgroundImage, globalTheme) => {
|
|
|
70
74
|
return {
|
|
71
75
|
backgroundImage: getMediaColor(backgroundImage, globalTheme || CONFIG.globalTheme)
|
|
72
76
|
}
|
|
73
|
-
} else if (v.includes('/') || v.
|
|
77
|
+
} else if (v.includes('/') || v.startsWith('http') || v.includes('.')) return `url(${v})`
|
|
74
78
|
return v
|
|
75
79
|
}).join(' ')
|
|
76
80
|
}
|