@symbo.ls/scratch 2.10.223 → 2.10.225
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/defaultConfig/animation.js +3 -1
- package/dist/cjs/defaultConfig/cases.js +3 -1
- package/dist/cjs/defaultConfig/color.js +4 -8
- package/dist/cjs/defaultConfig/document.js +3 -1
- package/dist/cjs/defaultConfig/font-family.js +5 -9
- package/dist/cjs/defaultConfig/font.js +3 -10
- package/dist/cjs/defaultConfig/icons.js +3 -1
- package/dist/cjs/defaultConfig/index.js +184 -19
- package/dist/cjs/defaultConfig/media.js +3 -1
- package/dist/cjs/defaultConfig/responsive.js +4 -2
- package/dist/cjs/defaultConfig/sequence.js +3 -1
- package/dist/cjs/defaultConfig/spacing.js +53 -6
- package/dist/cjs/defaultConfig/svg.js +4 -2
- package/dist/cjs/defaultConfig/theme.js +3 -13
- package/dist/cjs/defaultConfig/timing.js +35 -4
- package/dist/cjs/defaultConfig/typography.js +35 -4
- package/dist/cjs/defaultConfig/unit.js +3 -1
- package/dist/cjs/factory.js +999 -10
- package/dist/cjs/index.js +2462 -6
- package/dist/cjs/set.js +2172 -46
- package/dist/cjs/system/color.js +1162 -44
- package/dist/cjs/system/document.js +1062 -11
- package/dist/cjs/system/font.js +1093 -17
- package/dist/cjs/system/index.js +2136 -10
- package/dist/cjs/system/reset.js +1131 -20
- package/dist/cjs/system/spacing.js +1274 -33
- package/dist/cjs/system/svg.js +1104 -25
- package/dist/cjs/system/theme.js +1187 -68
- package/dist/cjs/system/timing.js +1255 -19
- package/dist/cjs/system/typography.js +1270 -28
- package/dist/cjs/tests/index.js +4 -2
- package/dist/cjs/utils/color.js +68 -16
- package/dist/cjs/utils/font.js +11 -9
- package/dist/cjs/utils/index.js +1508 -7
- package/dist/cjs/utils/sequence.js +1051 -19
- package/dist/cjs/utils/sprite.js +815 -4
- package/dist/cjs/utils/theme.js +3 -1
- package/dist/cjs/utils/var.js +1044 -21
- package/package.json +3 -3
- package/src/index.js +4 -0
- package/src/set.js +0 -2
- package/src/utils/color.js +3 -0
package/dist/cjs/tests/index.js
CHANGED
|
@@ -16,13 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/tests/index.js
|
|
19
21
|
var tests_exports = {};
|
|
20
22
|
__export(tests_exports, {
|
|
21
23
|
testWCAGAA: () => testWCAGAA,
|
|
22
24
|
testWCAGAAA: () => testWCAGAAA
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(tests_exports);
|
|
25
|
-
|
|
27
|
+
var testWCAGAA = (colorA, colorB) => {
|
|
26
28
|
};
|
|
27
|
-
|
|
29
|
+
var testWCAGAAA = (colorA, colorB) => {
|
|
28
30
|
};
|
package/dist/cjs/utils/color.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
6
11
|
var __export = (target, all) => {
|
|
7
12
|
for (var name in all)
|
|
8
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -15,7 +20,53 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
20
|
}
|
|
16
21
|
return to;
|
|
17
22
|
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
18
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// ../../node_modules/@domql/globals/dist/cjs/index.js
|
|
34
|
+
var require_cjs = __commonJS({
|
|
35
|
+
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var __defProp2 = Object.defineProperty;
|
|
38
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
41
|
+
var __export2 = (target, all) => {
|
|
42
|
+
for (var name in all)
|
|
43
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
44
|
+
};
|
|
45
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
46
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
+
for (let key of __getOwnPropNames2(from))
|
|
48
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
49
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
|
+
}
|
|
51
|
+
return to;
|
|
52
|
+
};
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
54
|
+
var globals_exports = {};
|
|
55
|
+
__export2(globals_exports, {
|
|
56
|
+
document: () => document2,
|
|
57
|
+
global: () => global,
|
|
58
|
+
self: () => self,
|
|
59
|
+
window: () => window2
|
|
60
|
+
});
|
|
61
|
+
module2.exports = __toCommonJS2(globals_exports);
|
|
62
|
+
var global = globalThis;
|
|
63
|
+
var self = globalThis;
|
|
64
|
+
var window2 = globalThis;
|
|
65
|
+
var document2 = window2.document;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// src/utils/color.js
|
|
19
70
|
var color_exports = {};
|
|
20
71
|
__export(color_exports, {
|
|
21
72
|
changeLightness: () => changeLightness,
|
|
@@ -34,9 +85,9 @@ __export(color_exports, {
|
|
|
34
85
|
rgbToHex: () => rgbToHex
|
|
35
86
|
});
|
|
36
87
|
module.exports = __toCommonJS(color_exports);
|
|
37
|
-
var import_globals =
|
|
38
|
-
|
|
39
|
-
|
|
88
|
+
var import_globals = __toESM(require_cjs(), 1);
|
|
89
|
+
var ENV = "development";
|
|
90
|
+
var colorStringToRgbaArray = (color) => {
|
|
40
91
|
if (color === "")
|
|
41
92
|
return;
|
|
42
93
|
if (color.toLowerCase() === "transparent")
|
|
@@ -72,38 +123,39 @@ const colorStringToRgbaArray = (color) => {
|
|
|
72
123
|
color = `${color}, 1`;
|
|
73
124
|
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
74
125
|
}
|
|
126
|
+
return [];
|
|
75
127
|
};
|
|
76
|
-
|
|
128
|
+
var mixTwoColors = (colorA, colorB, range = 0.5) => {
|
|
77
129
|
colorA = colorStringToRgbaArray(colorA);
|
|
78
130
|
colorB = colorStringToRgbaArray(colorB);
|
|
79
131
|
return mixTwoRgba(colorA, colorB, range);
|
|
80
132
|
};
|
|
81
|
-
|
|
133
|
+
var hexToRgb = (hex, alpha = 1) => {
|
|
82
134
|
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
83
135
|
return `rgb(${r},${g},${b})`;
|
|
84
136
|
};
|
|
85
|
-
|
|
137
|
+
var hexToRgbArray = (hex, alpha = 1) => {
|
|
86
138
|
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
87
139
|
return [r, g, b];
|
|
88
140
|
};
|
|
89
|
-
|
|
141
|
+
var rgbToHex = (r, g, b) => {
|
|
90
142
|
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
91
143
|
};
|
|
92
|
-
|
|
144
|
+
var rgbArrayToHex = ([r, g, b]) => {
|
|
93
145
|
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
94
146
|
};
|
|
95
|
-
|
|
147
|
+
var hexToRgba = (hex, alpha = 1) => {
|
|
96
148
|
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
97
149
|
return `rgba(${r},${g},${b},${alpha})`;
|
|
98
150
|
};
|
|
99
|
-
|
|
151
|
+
var mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
100
152
|
const arr = [];
|
|
101
153
|
for (let i = 0; i < 3; i++) {
|
|
102
154
|
arr[i] = ~~(colorA[i] + (colorB[i] - colorA[i]) * range);
|
|
103
155
|
}
|
|
104
156
|
return `rgb(${arr})`;
|
|
105
157
|
};
|
|
106
|
-
|
|
158
|
+
var changeLightness = (delta, hsl) => {
|
|
107
159
|
const [hue, saturation, lightness] = hsl;
|
|
108
160
|
const newLightness = Math.max(
|
|
109
161
|
0,
|
|
@@ -111,18 +163,18 @@ const changeLightness = (delta, hsl) => {
|
|
|
111
163
|
);
|
|
112
164
|
return [hue, saturation, newLightness];
|
|
113
165
|
};
|
|
114
|
-
|
|
166
|
+
var rgbToHSL = (r, g, b) => {
|
|
115
167
|
const a = Math.max(r, g, b);
|
|
116
168
|
const n = a - Math.min(r, g, b);
|
|
117
169
|
const f = 1 - Math.abs(a + a - n - 1);
|
|
118
170
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
119
171
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
120
172
|
};
|
|
121
|
-
|
|
173
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
122
174
|
Math.min(k - 3, 9 - k, 1),
|
|
123
175
|
-1
|
|
124
176
|
)) => [f(0), f(8), f(4)];
|
|
125
|
-
|
|
177
|
+
var getColorShade = (col, amt) => {
|
|
126
178
|
const num = parseInt(col, 16);
|
|
127
179
|
let r = (num >> 16) + amt;
|
|
128
180
|
if (r > 255)
|
|
@@ -141,7 +193,7 @@ const getColorShade = (col, amt) => {
|
|
|
141
193
|
g = 0;
|
|
142
194
|
return (g | b << 8 | r << 16).toString(16);
|
|
143
195
|
};
|
|
144
|
-
|
|
196
|
+
var mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
145
197
|
const arr = [];
|
|
146
198
|
for (let i = 0; i < 4; i++) {
|
|
147
199
|
const round = i === 3 ? (x) => x : Math.round;
|
|
@@ -151,7 +203,7 @@ const mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
|
151
203
|
}
|
|
152
204
|
return `rgba(${arr})`;
|
|
153
205
|
};
|
|
154
|
-
|
|
206
|
+
var opacify = (color, opacity) => {
|
|
155
207
|
const arr = colorStringToRgbaArray(color);
|
|
156
208
|
if (!arr) {
|
|
157
209
|
if (ENV === "test" || ENV === "development")
|
package/dist/cjs/utils/font.js
CHANGED
|
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/font.js
|
|
19
21
|
var font_exports = {};
|
|
20
22
|
__export(font_exports, {
|
|
21
23
|
getDefaultOrFirstKey: () => getDefaultOrFirstKey,
|
|
@@ -29,7 +31,7 @@ __export(font_exports, {
|
|
|
29
31
|
setInCustomFontMedia: () => setInCustomFontMedia
|
|
30
32
|
});
|
|
31
33
|
module.exports = __toCommonJS(font_exports);
|
|
32
|
-
|
|
34
|
+
var getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
33
35
|
if (LIBRARY[key])
|
|
34
36
|
return LIBRARY[key].value;
|
|
35
37
|
if (LIBRARY.default)
|
|
@@ -37,34 +39,34 @@ const getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
|
37
39
|
const hasValue = Object.keys(LIBRARY)[0];
|
|
38
40
|
return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
|
|
39
41
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
|
|
43
|
+
var setInCustomFontMedia = (str) => `@font-face { ${str} }`;
|
|
44
|
+
var setCustomFont = (name, url, weight) => `
|
|
43
45
|
font-family: '${name}';
|
|
44
46
|
font-style: normal;
|
|
45
47
|
${weight && `font-weight: ${weight};`}
|
|
46
48
|
src: url('${url}') format('${getFontFormat(url)}');`;
|
|
47
|
-
|
|
49
|
+
var setCustomFontMedia = (name, url, weight) => `@font-face {
|
|
48
50
|
${setCustomFont(name, url, weight)}
|
|
49
51
|
}`;
|
|
50
|
-
|
|
52
|
+
var getFontFaceEach = (name, weights) => {
|
|
51
53
|
const keys = Object.keys(weights);
|
|
52
54
|
return keys.map((key) => {
|
|
53
55
|
const { url, fontWeight } = weights[key];
|
|
54
56
|
return setCustomFont(name, url, fontWeight);
|
|
55
57
|
});
|
|
56
58
|
};
|
|
57
|
-
|
|
59
|
+
var getFontFace = (LIBRARY) => {
|
|
58
60
|
const keys = Object.keys(LIBRARY);
|
|
59
61
|
return keys.map((key) => getFontFaceEach(key, LIBRARY[key].value));
|
|
60
62
|
};
|
|
61
|
-
|
|
63
|
+
var getFontFaceEachString = (name, weights) => {
|
|
62
64
|
const isArr = weights[0];
|
|
63
65
|
if (isArr)
|
|
64
66
|
return getFontFaceEach(name, weights).map(setInCustomFontMedia);
|
|
65
67
|
return setCustomFontMedia(name, weights.url);
|
|
66
68
|
};
|
|
67
|
-
|
|
69
|
+
var getFontFaceString = (LIBRARY) => {
|
|
68
70
|
const keys = Object.keys(LIBRARY);
|
|
69
71
|
return keys.map((key) => getFontFaceEachString(key, LIBRARY[key].value));
|
|
70
72
|
};
|