@symbo.ls/scratch 2.11.228 → 2.11.234
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/factory.js +26 -26
- package/dist/cjs/index.js +41 -34
- package/dist/cjs/set.js +39 -34
- package/dist/cjs/system/color.js +26 -26
- package/dist/cjs/system/document.js +26 -26
- package/dist/cjs/system/font.js +26 -26
- package/dist/cjs/system/index.js +39 -34
- package/dist/cjs/system/reset.js +26 -26
- package/dist/cjs/system/shadow.js +34 -28
- package/dist/cjs/system/spacing.js +39 -34
- package/dist/cjs/system/svg.js +26 -26
- package/dist/cjs/system/theme.js +26 -26
- package/dist/cjs/system/timing.js +37 -31
- package/dist/cjs/system/typography.js +39 -34
- package/dist/cjs/transforms/index.js +34 -28
- package/dist/cjs/utils/color.js +26 -26
- package/dist/cjs/utils/index.js +40 -34
- package/dist/cjs/utils/sequence.js +34 -28
- package/dist/cjs/utils/sprite.js +26 -26
- package/dist/cjs/utils/unit.js +28 -0
- package/dist/cjs/utils/var.js +36 -32
- package/package.json +2 -2
- package/src/utils/index.js +1 -0
- package/src/utils/sequence.js +6 -2
- package/src/utils/unit.js +5 -0
- package/src/utils/var.js +11 -9
package/dist/cjs/factory.js
CHANGED
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// ../../node_modules/@domql/utils/dist/cjs/key.js
|
|
34
34
|
var require_key = __commonJS({
|
|
35
|
-
"
|
|
35
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -69,9 +69,9 @@ var require_key = __commonJS({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// ../../node_modules/@domql/utils/dist/cjs/env.js
|
|
73
73
|
var require_env = __commonJS({
|
|
74
|
-
"
|
|
74
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
|
|
75
75
|
"use strict";
|
|
76
76
|
var __defProp2 = Object.defineProperty;
|
|
77
77
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -107,9 +107,9 @@ var require_env = __commonJS({
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// ../../node_modules/@domql/utils/dist/cjs/globals.js
|
|
111
111
|
var require_globals = __commonJS({
|
|
112
|
-
"
|
|
112
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
|
|
113
113
|
"use strict";
|
|
114
114
|
var __defProp2 = Object.defineProperty;
|
|
115
115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -143,9 +143,9 @@ var require_globals = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../node_modules/@domql/utils/dist/cjs/node.js
|
|
147
147
|
var require_node = __commonJS({
|
|
148
|
-
"
|
|
148
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
150
|
var __defProp2 = Object.defineProperty;
|
|
151
151
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -180,9 +180,9 @@ var require_node = __commonJS({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
//
|
|
183
|
+
// ../../node_modules/@domql/utils/dist/cjs/types.js
|
|
184
184
|
var require_types = __commonJS({
|
|
185
|
-
"
|
|
185
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
|
|
186
186
|
"use strict";
|
|
187
187
|
var __defProp2 = Object.defineProperty;
|
|
188
188
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -270,9 +270,9 @@ var require_types = __commonJS({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// ../../node_modules/@domql/utils/dist/cjs/array.js
|
|
274
274
|
var require_array = __commonJS({
|
|
275
|
-
"
|
|
275
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
|
|
276
276
|
"use strict";
|
|
277
277
|
var __defProp2 = Object.defineProperty;
|
|
278
278
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -383,9 +383,9 @@ var require_array = __commonJS({
|
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
385
|
|
|
386
|
-
//
|
|
386
|
+
// ../../node_modules/@domql/utils/dist/cjs/string.js
|
|
387
387
|
var require_string = __commonJS({
|
|
388
|
-
"
|
|
388
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
|
|
389
389
|
"use strict";
|
|
390
390
|
var __defProp2 = Object.defineProperty;
|
|
391
391
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -443,9 +443,9 @@ var require_string = __commonJS({
|
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
//
|
|
446
|
+
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
447
447
|
var require_object = __commonJS({
|
|
448
|
-
"
|
|
448
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
449
449
|
"use strict";
|
|
450
450
|
var __defProp2 = Object.defineProperty;
|
|
451
451
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -935,9 +935,9 @@ var require_object = __commonJS({
|
|
|
935
935
|
}
|
|
936
936
|
});
|
|
937
937
|
|
|
938
|
-
//
|
|
938
|
+
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
939
939
|
var require_function = __commonJS({
|
|
940
|
-
"
|
|
940
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
941
941
|
"use strict";
|
|
942
942
|
var __defProp2 = Object.defineProperty;
|
|
943
943
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1010,9 +1010,9 @@ var require_function = __commonJS({
|
|
|
1010
1010
|
}
|
|
1011
1011
|
});
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1013
|
+
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
1014
1014
|
var require_log = __commonJS({
|
|
1015
|
-
"
|
|
1015
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
1016
1016
|
"use strict";
|
|
1017
1017
|
var __defProp2 = Object.defineProperty;
|
|
1018
1018
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1051,9 +1051,9 @@ var require_log = __commonJS({
|
|
|
1051
1051
|
}
|
|
1052
1052
|
});
|
|
1053
1053
|
|
|
1054
|
-
//
|
|
1054
|
+
// ../../node_modules/@domql/utils/dist/cjs/cookie.js
|
|
1055
1055
|
var require_cookie = __commonJS({
|
|
1056
|
-
"
|
|
1056
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1057
1057
|
"use strict";
|
|
1058
1058
|
var __defProp2 = Object.defineProperty;
|
|
1059
1059
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1107,9 +1107,9 @@ var require_cookie = __commonJS({
|
|
|
1107
1107
|
}
|
|
1108
1108
|
});
|
|
1109
1109
|
|
|
1110
|
-
//
|
|
1110
|
+
// ../../node_modules/@domql/utils/dist/cjs/tags.js
|
|
1111
1111
|
var require_tags = __commonJS({
|
|
1112
|
-
"
|
|
1112
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1113
1113
|
"use strict";
|
|
1114
1114
|
var __defProp2 = Object.defineProperty;
|
|
1115
1115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1272,9 +1272,9 @@ var require_tags = __commonJS({
|
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
1274
|
|
|
1275
|
-
//
|
|
1275
|
+
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1276
1276
|
var require_cjs = __commonJS({
|
|
1277
|
-
"
|
|
1277
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1278
1278
|
"use strict";
|
|
1279
1279
|
var __defProp2 = Object.defineProperty;
|
|
1280
1280
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
package/dist/cjs/index.js
CHANGED
|
@@ -66,9 +66,9 @@ var require_cjs = __commonJS({
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
//
|
|
69
|
+
// ../../node_modules/@domql/utils/dist/cjs/key.js
|
|
70
70
|
var require_key = __commonJS({
|
|
71
|
-
"
|
|
71
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
|
|
72
72
|
"use strict";
|
|
73
73
|
var __defProp2 = Object.defineProperty;
|
|
74
74
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -105,9 +105,9 @@ var require_key = __commonJS({
|
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
//
|
|
108
|
+
// ../../node_modules/@domql/utils/dist/cjs/env.js
|
|
109
109
|
var require_env = __commonJS({
|
|
110
|
-
"
|
|
110
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
|
|
111
111
|
"use strict";
|
|
112
112
|
var __defProp2 = Object.defineProperty;
|
|
113
113
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -143,9 +143,9 @@ var require_env = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../node_modules/@domql/utils/dist/cjs/globals.js
|
|
147
147
|
var require_globals = __commonJS({
|
|
148
|
-
"
|
|
148
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
150
|
var __defProp2 = Object.defineProperty;
|
|
151
151
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -179,9 +179,9 @@ var require_globals = __commonJS({
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
//
|
|
182
|
+
// ../../node_modules/@domql/utils/dist/cjs/node.js
|
|
183
183
|
var require_node = __commonJS({
|
|
184
|
-
"
|
|
184
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
|
|
185
185
|
"use strict";
|
|
186
186
|
var __defProp2 = Object.defineProperty;
|
|
187
187
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -216,9 +216,9 @@ var require_node = __commonJS({
|
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
218
|
|
|
219
|
-
//
|
|
219
|
+
// ../../node_modules/@domql/utils/dist/cjs/types.js
|
|
220
220
|
var require_types = __commonJS({
|
|
221
|
-
"
|
|
221
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
|
|
222
222
|
"use strict";
|
|
223
223
|
var __defProp2 = Object.defineProperty;
|
|
224
224
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -306,9 +306,9 @@ var require_types = __commonJS({
|
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
308
|
|
|
309
|
-
//
|
|
309
|
+
// ../../node_modules/@domql/utils/dist/cjs/array.js
|
|
310
310
|
var require_array = __commonJS({
|
|
311
|
-
"
|
|
311
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
|
|
312
312
|
"use strict";
|
|
313
313
|
var __defProp2 = Object.defineProperty;
|
|
314
314
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -419,9 +419,9 @@ var require_array = __commonJS({
|
|
|
419
419
|
}
|
|
420
420
|
});
|
|
421
421
|
|
|
422
|
-
//
|
|
422
|
+
// ../../node_modules/@domql/utils/dist/cjs/string.js
|
|
423
423
|
var require_string = __commonJS({
|
|
424
|
-
"
|
|
424
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
|
|
425
425
|
"use strict";
|
|
426
426
|
var __defProp2 = Object.defineProperty;
|
|
427
427
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -479,9 +479,9 @@ var require_string = __commonJS({
|
|
|
479
479
|
}
|
|
480
480
|
});
|
|
481
481
|
|
|
482
|
-
//
|
|
482
|
+
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
483
483
|
var require_object = __commonJS({
|
|
484
|
-
"
|
|
484
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
485
485
|
"use strict";
|
|
486
486
|
var __defProp2 = Object.defineProperty;
|
|
487
487
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -971,9 +971,9 @@ var require_object = __commonJS({
|
|
|
971
971
|
}
|
|
972
972
|
});
|
|
973
973
|
|
|
974
|
-
//
|
|
974
|
+
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
975
975
|
var require_function = __commonJS({
|
|
976
|
-
"
|
|
976
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
977
977
|
"use strict";
|
|
978
978
|
var __defProp2 = Object.defineProperty;
|
|
979
979
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1046,9 +1046,9 @@ var require_function = __commonJS({
|
|
|
1046
1046
|
}
|
|
1047
1047
|
});
|
|
1048
1048
|
|
|
1049
|
-
//
|
|
1049
|
+
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
1050
1050
|
var require_log = __commonJS({
|
|
1051
|
-
"
|
|
1051
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
1052
1052
|
"use strict";
|
|
1053
1053
|
var __defProp2 = Object.defineProperty;
|
|
1054
1054
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1087,9 +1087,9 @@ var require_log = __commonJS({
|
|
|
1087
1087
|
}
|
|
1088
1088
|
});
|
|
1089
1089
|
|
|
1090
|
-
//
|
|
1090
|
+
// ../../node_modules/@domql/utils/dist/cjs/cookie.js
|
|
1091
1091
|
var require_cookie = __commonJS({
|
|
1092
|
-
"
|
|
1092
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1093
1093
|
"use strict";
|
|
1094
1094
|
var __defProp2 = Object.defineProperty;
|
|
1095
1095
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1143,9 +1143,9 @@ var require_cookie = __commonJS({
|
|
|
1143
1143
|
}
|
|
1144
1144
|
});
|
|
1145
1145
|
|
|
1146
|
-
//
|
|
1146
|
+
// ../../node_modules/@domql/utils/dist/cjs/tags.js
|
|
1147
1147
|
var require_tags = __commonJS({
|
|
1148
|
-
"
|
|
1148
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1149
1149
|
"use strict";
|
|
1150
1150
|
var __defProp2 = Object.defineProperty;
|
|
1151
1151
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1308,9 +1308,9 @@ var require_tags = __commonJS({
|
|
|
1308
1308
|
}
|
|
1309
1309
|
});
|
|
1310
1310
|
|
|
1311
|
-
//
|
|
1311
|
+
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1312
1312
|
var require_cjs2 = __commonJS({
|
|
1313
|
-
"
|
|
1313
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1314
1314
|
"use strict";
|
|
1315
1315
|
var __defProp2 = Object.defineProperty;
|
|
1316
1316
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1422,6 +1422,7 @@ __export(src_exports, {
|
|
|
1422
1422
|
hexToRgbArray: () => hexToRgbArray,
|
|
1423
1423
|
hexToRgba: () => hexToRgba,
|
|
1424
1424
|
hslToRgb: () => hslToRgb,
|
|
1425
|
+
isScalingUnit: () => isScalingUnit,
|
|
1425
1426
|
mixTwoColors: () => mixTwoColors,
|
|
1426
1427
|
mixTwoRgb: () => mixTwoRgb,
|
|
1427
1428
|
mixTwoRgba: () => mixTwoRgba,
|
|
@@ -1495,6 +1496,7 @@ __export(utils_exports, {
|
|
|
1495
1496
|
hexToRgbArray: () => hexToRgbArray,
|
|
1496
1497
|
hexToRgba: () => hexToRgba,
|
|
1497
1498
|
hslToRgb: () => hslToRgb,
|
|
1499
|
+
isScalingUnit: () => isScalingUnit,
|
|
1498
1500
|
mixTwoColors: () => mixTwoColors,
|
|
1499
1501
|
mixTwoRgb: () => mixTwoRgb,
|
|
1500
1502
|
mixTwoRgba: () => mixTwoRgba,
|
|
@@ -1512,6 +1514,11 @@ __export(utils_exports, {
|
|
|
1512
1514
|
setVariables: () => setVariables
|
|
1513
1515
|
});
|
|
1514
1516
|
|
|
1517
|
+
// src/utils/unit.js
|
|
1518
|
+
var isScalingUnit = (unit) => {
|
|
1519
|
+
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1515
1522
|
// src/utils/color.js
|
|
1516
1523
|
var import_globals = __toESM(require_cjs(), 1);
|
|
1517
1524
|
var import_utils = __toESM(require_cjs2(), 1);
|
|
@@ -2026,9 +2033,10 @@ var setSequenceValue = (props, sequenceProps) => {
|
|
|
2026
2033
|
sequenceProps.vars[variable] = scaling + sequenceProps.unit;
|
|
2027
2034
|
};
|
|
2028
2035
|
var setScalingVar = (key, sequenceProps) => {
|
|
2029
|
-
const { type } = sequenceProps;
|
|
2036
|
+
const { base, type, unit } = sequenceProps;
|
|
2037
|
+
const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
|
|
2030
2038
|
if (key === 0)
|
|
2031
|
-
return
|
|
2039
|
+
return defaultVal;
|
|
2032
2040
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
2033
2041
|
const ratioVar = `${prefix}-ratio`;
|
|
2034
2042
|
if (key > 0) {
|
|
@@ -2208,9 +2216,9 @@ var applyGlobalVars = (vars, obj, options) => {
|
|
|
2208
2216
|
const ratioVar = `${prefix}-ratio`;
|
|
2209
2217
|
vars[ratioVar] = ratio;
|
|
2210
2218
|
const [first, middle, second] = getSubratio(base, ratio);
|
|
2211
|
-
vars[`${prefix}-sub-ratio-1`] = first
|
|
2212
|
-
vars[`${prefix}-sub-ratio-2`] = middle
|
|
2213
|
-
vars[`${prefix}-sub-ratio-3`] = second
|
|
2219
|
+
vars[`${prefix}-sub-ratio-1`] = `calc(var(${prefix}-ratio) * ${first / ratio})`;
|
|
2220
|
+
vars[`${prefix}-sub-ratio-2`] = `calc(var(${prefix}-ratio) * ${middle / ratio})`;
|
|
2221
|
+
vars[`${prefix}-sub-ratio-3`] = `calc(var(${prefix}-ratio) * ${second / ratio})`;
|
|
2214
2222
|
};
|
|
2215
2223
|
var applySequenceVars = (FACTORY2, options = {}) => {
|
|
2216
2224
|
const CONFIG2 = getActiveConfig();
|
|
@@ -2238,7 +2246,7 @@ var applySequenceVars = (FACTORY2, options = {}) => {
|
|
|
2238
2246
|
};
|
|
2239
2247
|
var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
2240
2248
|
const CONFIG2 = getActiveConfig();
|
|
2241
|
-
const { UNIT: UNIT2, MEDIA: MEDIA2,
|
|
2249
|
+
const { UNIT: UNIT2, MEDIA: MEDIA2, CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
2242
2250
|
const mediaName = media.slice(1);
|
|
2243
2251
|
const unit = FACTORY2.unit || UNIT2.default;
|
|
2244
2252
|
const { mediaRegenerate } = FACTORY2;
|
|
@@ -2255,7 +2263,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
2255
2263
|
}
|
|
2256
2264
|
for (const key in sequence) {
|
|
2257
2265
|
const item = sequence[key];
|
|
2258
|
-
const value = (
|
|
2266
|
+
const value = (isScalingUnit(unit) ? scales[key] : sequence[key].val) + unit;
|
|
2259
2267
|
if (!query && CONFIG2.verbose)
|
|
2260
2268
|
console.warn("Can't find query ", query);
|
|
2261
2269
|
let underMediaQuery = CSS_VARS2[`@media ${query}`];
|
|
@@ -2264,7 +2272,6 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
2264
2272
|
underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
|
|
2265
2273
|
CSS_VARS2[item.variable + "_" + mediaName] = value;
|
|
2266
2274
|
}
|
|
2267
|
-
console.log(CSS_VARS2);
|
|
2268
2275
|
};
|
|
2269
2276
|
|
|
2270
2277
|
// src/utils/sprite.js
|
package/dist/cjs/set.js
CHANGED
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// ../../node_modules/@domql/utils/dist/cjs/key.js
|
|
34
34
|
var require_key = __commonJS({
|
|
35
|
-
"
|
|
35
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -69,9 +69,9 @@ var require_key = __commonJS({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// ../../node_modules/@domql/utils/dist/cjs/env.js
|
|
73
73
|
var require_env = __commonJS({
|
|
74
|
-
"
|
|
74
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
|
|
75
75
|
"use strict";
|
|
76
76
|
var __defProp2 = Object.defineProperty;
|
|
77
77
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -107,9 +107,9 @@ var require_env = __commonJS({
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// ../../node_modules/@domql/utils/dist/cjs/globals.js
|
|
111
111
|
var require_globals = __commonJS({
|
|
112
|
-
"
|
|
112
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
|
|
113
113
|
"use strict";
|
|
114
114
|
var __defProp2 = Object.defineProperty;
|
|
115
115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -143,9 +143,9 @@ var require_globals = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../node_modules/@domql/utils/dist/cjs/node.js
|
|
147
147
|
var require_node = __commonJS({
|
|
148
|
-
"
|
|
148
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
150
|
var __defProp2 = Object.defineProperty;
|
|
151
151
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -180,9 +180,9 @@ var require_node = __commonJS({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
//
|
|
183
|
+
// ../../node_modules/@domql/utils/dist/cjs/types.js
|
|
184
184
|
var require_types = __commonJS({
|
|
185
|
-
"
|
|
185
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
|
|
186
186
|
"use strict";
|
|
187
187
|
var __defProp2 = Object.defineProperty;
|
|
188
188
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -270,9 +270,9 @@ var require_types = __commonJS({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// ../../node_modules/@domql/utils/dist/cjs/array.js
|
|
274
274
|
var require_array = __commonJS({
|
|
275
|
-
"
|
|
275
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
|
|
276
276
|
"use strict";
|
|
277
277
|
var __defProp2 = Object.defineProperty;
|
|
278
278
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -383,9 +383,9 @@ var require_array = __commonJS({
|
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
385
|
|
|
386
|
-
//
|
|
386
|
+
// ../../node_modules/@domql/utils/dist/cjs/string.js
|
|
387
387
|
var require_string = __commonJS({
|
|
388
|
-
"
|
|
388
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
|
|
389
389
|
"use strict";
|
|
390
390
|
var __defProp2 = Object.defineProperty;
|
|
391
391
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -443,9 +443,9 @@ var require_string = __commonJS({
|
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
//
|
|
446
|
+
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
447
447
|
var require_object = __commonJS({
|
|
448
|
-
"
|
|
448
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
449
449
|
"use strict";
|
|
450
450
|
var __defProp2 = Object.defineProperty;
|
|
451
451
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -935,9 +935,9 @@ var require_object = __commonJS({
|
|
|
935
935
|
}
|
|
936
936
|
});
|
|
937
937
|
|
|
938
|
-
//
|
|
938
|
+
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
939
939
|
var require_function = __commonJS({
|
|
940
|
-
"
|
|
940
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
941
941
|
"use strict";
|
|
942
942
|
var __defProp2 = Object.defineProperty;
|
|
943
943
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1010,9 +1010,9 @@ var require_function = __commonJS({
|
|
|
1010
1010
|
}
|
|
1011
1011
|
});
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1013
|
+
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
1014
1014
|
var require_log = __commonJS({
|
|
1015
|
-
"
|
|
1015
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
1016
1016
|
"use strict";
|
|
1017
1017
|
var __defProp2 = Object.defineProperty;
|
|
1018
1018
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1051,9 +1051,9 @@ var require_log = __commonJS({
|
|
|
1051
1051
|
}
|
|
1052
1052
|
});
|
|
1053
1053
|
|
|
1054
|
-
//
|
|
1054
|
+
// ../../node_modules/@domql/utils/dist/cjs/cookie.js
|
|
1055
1055
|
var require_cookie = __commonJS({
|
|
1056
|
-
"
|
|
1056
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1057
1057
|
"use strict";
|
|
1058
1058
|
var __defProp2 = Object.defineProperty;
|
|
1059
1059
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1107,9 +1107,9 @@ var require_cookie = __commonJS({
|
|
|
1107
1107
|
}
|
|
1108
1108
|
});
|
|
1109
1109
|
|
|
1110
|
-
//
|
|
1110
|
+
// ../../node_modules/@domql/utils/dist/cjs/tags.js
|
|
1111
1111
|
var require_tags = __commonJS({
|
|
1112
|
-
"
|
|
1112
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1113
1113
|
"use strict";
|
|
1114
1114
|
var __defProp2 = Object.defineProperty;
|
|
1115
1115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1272,9 +1272,9 @@ var require_tags = __commonJS({
|
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
1274
|
|
|
1275
|
-
//
|
|
1275
|
+
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1276
1276
|
var require_cjs = __commonJS({
|
|
1277
|
-
"
|
|
1277
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1278
1278
|
"use strict";
|
|
1279
1279
|
var __defProp2 = Object.defineProperty;
|
|
1280
1280
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1593,6 +1593,11 @@ var setActiveConfig = (newConfig) => {
|
|
|
1593
1593
|
// src/system/color.js
|
|
1594
1594
|
var import_utils9 = __toESM(require_cjs(), 1);
|
|
1595
1595
|
|
|
1596
|
+
// src/utils/unit.js
|
|
1597
|
+
var isScalingUnit = (unit) => {
|
|
1598
|
+
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
1599
|
+
};
|
|
1600
|
+
|
|
1596
1601
|
// src/utils/color.js
|
|
1597
1602
|
var import_globals = __toESM(require_cjs2(), 1);
|
|
1598
1603
|
var import_utils2 = __toESM(require_cjs(), 1);
|
|
@@ -1781,9 +1786,10 @@ var setSequenceValue = (props, sequenceProps) => {
|
|
|
1781
1786
|
sequenceProps.vars[variable] = scaling + sequenceProps.unit;
|
|
1782
1787
|
};
|
|
1783
1788
|
var setScalingVar = (key, sequenceProps) => {
|
|
1784
|
-
const { type } = sequenceProps;
|
|
1789
|
+
const { base, type, unit } = sequenceProps;
|
|
1790
|
+
const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
|
|
1785
1791
|
if (key === 0)
|
|
1786
|
-
return
|
|
1792
|
+
return defaultVal;
|
|
1787
1793
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
1788
1794
|
const ratioVar = `${prefix}-ratio`;
|
|
1789
1795
|
if (key > 0) {
|
|
@@ -1955,9 +1961,9 @@ var applyGlobalVars = (vars, obj, options) => {
|
|
|
1955
1961
|
const ratioVar = `${prefix}-ratio`;
|
|
1956
1962
|
vars[ratioVar] = ratio;
|
|
1957
1963
|
const [first, middle, second] = getSubratio(base, ratio);
|
|
1958
|
-
vars[`${prefix}-sub-ratio-1`] = first
|
|
1959
|
-
vars[`${prefix}-sub-ratio-2`] = middle
|
|
1960
|
-
vars[`${prefix}-sub-ratio-3`] = second
|
|
1964
|
+
vars[`${prefix}-sub-ratio-1`] = `calc(var(${prefix}-ratio) * ${first / ratio})`;
|
|
1965
|
+
vars[`${prefix}-sub-ratio-2`] = `calc(var(${prefix}-ratio) * ${middle / ratio})`;
|
|
1966
|
+
vars[`${prefix}-sub-ratio-3`] = `calc(var(${prefix}-ratio) * ${second / ratio})`;
|
|
1961
1967
|
};
|
|
1962
1968
|
var applySequenceVars = (FACTORY2, options = {}) => {
|
|
1963
1969
|
const CONFIG2 = getActiveConfig();
|
|
@@ -1985,7 +1991,7 @@ var applySequenceVars = (FACTORY2, options = {}) => {
|
|
|
1985
1991
|
};
|
|
1986
1992
|
var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
1987
1993
|
const CONFIG2 = getActiveConfig();
|
|
1988
|
-
const { UNIT: UNIT2, MEDIA: MEDIA2,
|
|
1994
|
+
const { UNIT: UNIT2, MEDIA: MEDIA2, CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
1989
1995
|
const mediaName = media.slice(1);
|
|
1990
1996
|
const unit = FACTORY2.unit || UNIT2.default;
|
|
1991
1997
|
const { mediaRegenerate } = FACTORY2;
|
|
@@ -2002,7 +2008,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
2002
2008
|
}
|
|
2003
2009
|
for (const key in sequence) {
|
|
2004
2010
|
const item = sequence[key];
|
|
2005
|
-
const value = (
|
|
2011
|
+
const value = (isScalingUnit(unit) ? scales[key] : sequence[key].val) + unit;
|
|
2006
2012
|
if (!query && CONFIG2.verbose)
|
|
2007
2013
|
console.warn("Can't find query ", query);
|
|
2008
2014
|
let underMediaQuery = CSS_VARS2[`@media ${query}`];
|
|
@@ -2011,7 +2017,6 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
2011
2017
|
underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
|
|
2012
2018
|
CSS_VARS2[item.variable + "_" + mediaName] = value;
|
|
2013
2019
|
}
|
|
2014
|
-
console.log(CSS_VARS2);
|
|
2015
2020
|
};
|
|
2016
2021
|
|
|
2017
2022
|
// src/utils/sprite.js
|