@symbo.ls/scratch 2.27.8 → 2.27.11
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 +1 -0
- package/dist/cjs/index.js +16 -15
- package/dist/cjs/set.js +13 -7
- package/dist/cjs/system/color.js +13 -5
- package/dist/cjs/system/document.js +10 -0
- package/dist/cjs/system/font.js +10 -0
- package/dist/cjs/system/index.js +13 -7
- package/dist/cjs/system/reset.js +10 -0
- package/dist/cjs/system/shadow.js +13 -5
- package/dist/cjs/system/spacing.js +10 -0
- package/dist/cjs/system/svg.js +10 -2
- package/dist/cjs/system/theme.js +13 -5
- package/dist/cjs/system/timing.js +10 -0
- package/dist/cjs/system/typography.js +10 -0
- package/dist/cjs/transforms/index.js +13 -5
- package/dist/cjs/utils/color.js +12 -13
- package/dist/cjs/utils/index.js +16 -15
- package/dist/cjs/utils/sequence.js +1 -0
- package/dist/cjs/utils/sprite.js +10 -2
- package/dist/cjs/utils/var.js +1 -0
- package/package.json +4 -4
- package/src/utils/color.js +42 -30
- package/src/utils/sprite.js +12 -7
package/dist/cjs/factory.js
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -438,6 +438,11 @@ var isScalingUnit = (unit) => {
|
|
|
438
438
|
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
439
439
|
};
|
|
440
440
|
|
|
441
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
442
|
+
var NODE_ENV = "development";
|
|
443
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
444
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
445
|
+
|
|
441
446
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
442
447
|
var window2 = globalThis;
|
|
443
448
|
var document2 = window2.document;
|
|
@@ -671,10 +676,7 @@ var mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
|
671
676
|
};
|
|
672
677
|
var changeLightness = (delta, hsl) => {
|
|
673
678
|
const [hue, saturation, lightness] = hsl;
|
|
674
|
-
const newLightness = Math.max(
|
|
675
|
-
0,
|
|
676
|
-
Math.min(100, lightness + parseFloat(delta))
|
|
677
|
-
);
|
|
679
|
+
const newLightness = Math.max(0, Math.min(100, lightness + parseFloat(delta)));
|
|
678
680
|
return [hue, saturation, newLightness];
|
|
679
681
|
};
|
|
680
682
|
var rgbToHSL = (r, g, b) => {
|
|
@@ -684,10 +686,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
684
686
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
685
687
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
686
688
|
};
|
|
687
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
688
|
-
Math.min(k - 3, 9 - k, 1),
|
|
689
|
-
-1
|
|
690
|
-
)) => [f(0), f(8), f(4)];
|
|
689
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
691
690
|
var getColorShade = (col, amt) => {
|
|
692
691
|
const num = parseInt(col, 16);
|
|
693
692
|
let r = (num >> 16) + amt;
|
|
@@ -705,23 +704,22 @@ var mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
|
705
704
|
const arr = [];
|
|
706
705
|
for (let i = 0; i < 4; i++) {
|
|
707
706
|
const round = i === 3 ? (x) => x : Math.round;
|
|
708
|
-
arr[i] = round(
|
|
709
|
-
colorA[i] + (colorB[i] - colorA[i]) * range
|
|
710
|
-
);
|
|
707
|
+
arr[i] = round(colorA[i] + (colorB[i] - colorA[i]) * range);
|
|
711
708
|
}
|
|
712
709
|
return `rgba(${arr})`;
|
|
713
710
|
};
|
|
714
711
|
var opacify = (color, opacity) => {
|
|
715
712
|
const arr = colorStringToRgbaArray(color);
|
|
716
713
|
if (!arr) {
|
|
717
|
-
if (ENV
|
|
714
|
+
if (isNotProduction(ENV)) console.warn(color + " color is not rgba");
|
|
718
715
|
return;
|
|
719
716
|
}
|
|
720
717
|
arr[3] = opacity;
|
|
721
718
|
return `rgba(${arr})`;
|
|
722
719
|
};
|
|
723
720
|
var getRgbTone = (rgb, tone) => {
|
|
724
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
721
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
722
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
725
723
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
726
724
|
if (isNumber(tone)) tone += "";
|
|
727
725
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -1332,7 +1330,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1332
1330
|
|
|
1333
1331
|
// src/utils/sprite.js
|
|
1334
1332
|
var ENV2 = "development";
|
|
1335
|
-
var isDev = ENV2
|
|
1333
|
+
var isDev = isNotProduction(ENV2);
|
|
1336
1334
|
var generateSprite = (icons) => {
|
|
1337
1335
|
const CONFIG2 = getActiveConfig();
|
|
1338
1336
|
let sprite = "";
|
|
@@ -1354,7 +1352,9 @@ var parseRootAttributes = (htmlString) => {
|
|
|
1354
1352
|
return {};
|
|
1355
1353
|
}
|
|
1356
1354
|
const attrString = match[1];
|
|
1357
|
-
const attrs = attrString.match(
|
|
1355
|
+
const attrs = attrString.match(
|
|
1356
|
+
/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
|
|
1357
|
+
);
|
|
1358
1358
|
return attrs.reduce((acc, attr) => {
|
|
1359
1359
|
const [key, value] = attr.split("=");
|
|
1360
1360
|
acc[key] = value.replace(/['"]/g, "");
|
|
@@ -2421,3 +2421,4 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
|
|
|
2421
2421
|
applyReset();
|
|
2422
2422
|
return CONFIG2;
|
|
2423
2423
|
};
|
|
2424
|
+
// @preserve-env
|
package/dist/cjs/set.js
CHANGED
|
@@ -264,6 +264,11 @@ __export(set_exports, {
|
|
|
264
264
|
});
|
|
265
265
|
module.exports = __toCommonJS(set_exports);
|
|
266
266
|
|
|
267
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
268
|
+
var NODE_ENV = "development";
|
|
269
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
270
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
271
|
+
|
|
267
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
268
273
|
var window2 = globalThis;
|
|
269
274
|
var document2 = window2.document;
|
|
@@ -705,10 +710,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
705
710
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
706
711
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
707
712
|
};
|
|
708
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
709
|
-
Math.min(k - 3, 9 - k, 1),
|
|
710
|
-
-1
|
|
711
|
-
)) => [f(0), f(8), f(4)];
|
|
713
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
712
714
|
var getColorShade = (col, amt) => {
|
|
713
715
|
const num = parseInt(col, 16);
|
|
714
716
|
let r = (num >> 16) + amt;
|
|
@@ -723,7 +725,8 @@ var getColorShade = (col, amt) => {
|
|
|
723
725
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
724
726
|
};
|
|
725
727
|
var getRgbTone = (rgb, tone) => {
|
|
726
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
728
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
729
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
727
730
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
728
731
|
if (isNumber(tone)) tone += "";
|
|
729
732
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -1031,7 +1034,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1031
1034
|
|
|
1032
1035
|
// src/utils/sprite.js
|
|
1033
1036
|
var ENV = "development";
|
|
1034
|
-
var isDev = ENV
|
|
1037
|
+
var isDev = isNotProduction(ENV);
|
|
1035
1038
|
var parseRootAttributes = (htmlString) => {
|
|
1036
1039
|
const val = htmlString.default || htmlString;
|
|
1037
1040
|
if (!isString(val)) {
|
|
@@ -1043,7 +1046,9 @@ var parseRootAttributes = (htmlString) => {
|
|
|
1043
1046
|
return {};
|
|
1044
1047
|
}
|
|
1045
1048
|
const attrString = match[1];
|
|
1046
|
-
const attrs = attrString.match(
|
|
1049
|
+
const attrs = attrString.match(
|
|
1050
|
+
/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
|
|
1051
|
+
);
|
|
1047
1052
|
return attrs.reduce((acc, attr) => {
|
|
1048
1053
|
const [key, value] = attr.split("=");
|
|
1049
1054
|
acc[key] = value.replace(/['"]/g, "");
|
|
@@ -1796,3 +1801,4 @@ var set = (recivedConfig, options = SET_OPTIONS) => {
|
|
|
1796
1801
|
applyReset();
|
|
1797
1802
|
return CONFIG2;
|
|
1798
1803
|
};
|
|
1804
|
+
// @preserve-env
|
package/dist/cjs/system/color.js
CHANGED
|
@@ -264,6 +264,11 @@ __export(color_exports, {
|
|
|
264
264
|
});
|
|
265
265
|
module.exports = __toCommonJS(color_exports);
|
|
266
266
|
|
|
267
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
268
|
+
var NODE_ENV = "development";
|
|
269
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
270
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
271
|
+
|
|
267
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
268
273
|
var window2 = globalThis;
|
|
269
274
|
var document2 = window2.document;
|
|
@@ -658,10 +663,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
658
663
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
659
664
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
660
665
|
};
|
|
661
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
662
|
-
Math.min(k - 3, 9 - k, 1),
|
|
663
|
-
-1
|
|
664
|
-
)) => [f(0), f(8), f(4)];
|
|
666
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
665
667
|
var getColorShade = (col, amt) => {
|
|
666
668
|
const num = parseInt(col, 16);
|
|
667
669
|
let r = (num >> 16) + amt;
|
|
@@ -676,7 +678,8 @@ var getColorShade = (col, amt) => {
|
|
|
676
678
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
677
679
|
};
|
|
678
680
|
var getRgbTone = (rgb, tone) => {
|
|
679
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
681
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
682
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
680
683
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
681
684
|
if (isNumber(tone)) tone += "";
|
|
682
685
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -696,6 +699,10 @@ var getRgbTone = (rgb, tone) => {
|
|
|
696
699
|
// src/utils/sequence.js
|
|
697
700
|
var import_utils4 = __toESM(require_cjs(), 1);
|
|
698
701
|
|
|
702
|
+
// src/utils/sprite.js
|
|
703
|
+
var ENV = "development";
|
|
704
|
+
var isDev = isNotProduction(ENV);
|
|
705
|
+
|
|
699
706
|
// src/system/color.js
|
|
700
707
|
var getColor = (value, key, config) => {
|
|
701
708
|
const CONFIG2 = config || getActiveConfig();
|
|
@@ -822,3 +829,4 @@ var setGradient = (val, key, suffix) => {
|
|
|
822
829
|
value: val.value || val
|
|
823
830
|
};
|
|
824
831
|
};
|
|
832
|
+
// @preserve-env
|
|
@@ -261,6 +261,11 @@ __export(document_exports, {
|
|
|
261
261
|
});
|
|
262
262
|
module.exports = __toCommonJS(document_exports);
|
|
263
263
|
|
|
264
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
265
|
+
var NODE_ENV = "development";
|
|
266
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
267
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
268
|
+
|
|
264
269
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
265
270
|
var window2 = globalThis;
|
|
266
271
|
var document2 = window2.document;
|
|
@@ -620,6 +625,10 @@ var getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
|
620
625
|
// src/utils/sequence.js
|
|
621
626
|
var import_utils4 = __toESM(require_cjs(), 1);
|
|
622
627
|
|
|
628
|
+
// src/utils/sprite.js
|
|
629
|
+
var ENV = "development";
|
|
630
|
+
var isDev = isNotProduction(ENV);
|
|
631
|
+
|
|
623
632
|
// src/system/document.js
|
|
624
633
|
var applyDocument = () => {
|
|
625
634
|
const CONFIG2 = getActiveConfig();
|
|
@@ -631,3 +640,4 @@ var applyDocument = () => {
|
|
|
631
640
|
lineHeight: TYPOGRAPHY2.lineHeight
|
|
632
641
|
});
|
|
633
642
|
};
|
|
643
|
+
// @preserve-env
|
package/dist/cjs/system/font.js
CHANGED
|
@@ -263,6 +263,11 @@ __export(font_exports, {
|
|
|
263
263
|
});
|
|
264
264
|
module.exports = __toCommonJS(font_exports);
|
|
265
265
|
|
|
266
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
267
|
+
var NODE_ENV = "development";
|
|
268
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
269
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
270
|
+
|
|
266
271
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
267
272
|
var window2 = globalThis;
|
|
268
273
|
var document2 = window2.document;
|
|
@@ -632,6 +637,10 @@ var getFontFaceEach = (name, weights) => {
|
|
|
632
637
|
// src/utils/sequence.js
|
|
633
638
|
var import_utils4 = __toESM(require_cjs(), 1);
|
|
634
639
|
|
|
640
|
+
// src/utils/sprite.js
|
|
641
|
+
var ENV = "development";
|
|
642
|
+
var isDev = isNotProduction(ENV);
|
|
643
|
+
|
|
635
644
|
// src/system/font.js
|
|
636
645
|
var setFont = (val, key) => {
|
|
637
646
|
const CSSvar = `--font-${key}`;
|
|
@@ -654,3 +663,4 @@ var setFontFamily = (val, key) => {
|
|
|
654
663
|
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
655
664
|
return { var: CSSvar, value: str, arr: value, type };
|
|
656
665
|
};
|
|
666
|
+
// @preserve-env
|
package/dist/cjs/system/index.js
CHANGED
|
@@ -289,6 +289,11 @@ __export(system_exports, {
|
|
|
289
289
|
});
|
|
290
290
|
module.exports = __toCommonJS(system_exports);
|
|
291
291
|
|
|
292
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
293
|
+
var NODE_ENV = "development";
|
|
294
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
295
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
296
|
+
|
|
292
297
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
293
298
|
var window2 = globalThis;
|
|
294
299
|
var document2 = window2.document;
|
|
@@ -724,10 +729,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
724
729
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
725
730
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
726
731
|
};
|
|
727
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
728
|
-
Math.min(k - 3, 9 - k, 1),
|
|
729
|
-
-1
|
|
730
|
-
)) => [f(0), f(8), f(4)];
|
|
732
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
731
733
|
var getColorShade = (col, amt) => {
|
|
732
734
|
const num = parseInt(col, 16);
|
|
733
735
|
let r = (num >> 16) + amt;
|
|
@@ -742,7 +744,8 @@ var getColorShade = (col, amt) => {
|
|
|
742
744
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
743
745
|
};
|
|
744
746
|
var getRgbTone = (rgb, tone) => {
|
|
745
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
747
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
748
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
746
749
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
747
750
|
if (isNumber(tone)) tone += "";
|
|
748
751
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -1050,7 +1053,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1050
1053
|
|
|
1051
1054
|
// src/utils/sprite.js
|
|
1052
1055
|
var ENV = "development";
|
|
1053
|
-
var isDev = ENV
|
|
1056
|
+
var isDev = isNotProduction(ENV);
|
|
1054
1057
|
var generateSprite = (icons) => {
|
|
1055
1058
|
const CONFIG2 = getActiveConfig();
|
|
1056
1059
|
let sprite = "";
|
|
@@ -1072,7 +1075,9 @@ var parseRootAttributes = (htmlString) => {
|
|
|
1072
1075
|
return {};
|
|
1073
1076
|
}
|
|
1074
1077
|
const attrString = match[1];
|
|
1075
|
-
const attrs = attrString.match(
|
|
1078
|
+
const attrs = attrString.match(
|
|
1079
|
+
/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
|
|
1080
|
+
);
|
|
1076
1081
|
return attrs.reduce((acc, attr) => {
|
|
1077
1082
|
const [key, value] = attr.split("=");
|
|
1078
1083
|
acc[key] = value.replace(/['"]/g, "");
|
|
@@ -1875,3 +1880,4 @@ var applyReset = (reset = {}) => {
|
|
|
1875
1880
|
});
|
|
1876
1881
|
}
|
|
1877
1882
|
};
|
|
1883
|
+
// @preserve-env
|
package/dist/cjs/system/reset.js
CHANGED
|
@@ -261,6 +261,11 @@ __export(reset_exports, {
|
|
|
261
261
|
});
|
|
262
262
|
module.exports = __toCommonJS(reset_exports);
|
|
263
263
|
|
|
264
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
265
|
+
var NODE_ENV = "development";
|
|
266
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
267
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
268
|
+
|
|
264
269
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
265
270
|
var window2 = globalThis;
|
|
266
271
|
var document2 = window2.document;
|
|
@@ -636,6 +641,10 @@ var getActiveConfig = (def) => {
|
|
|
636
641
|
// src/utils/sequence.js
|
|
637
642
|
var import_utils4 = __toESM(require_cjs(), 1);
|
|
638
643
|
|
|
644
|
+
// src/utils/sprite.js
|
|
645
|
+
var ENV = "development";
|
|
646
|
+
var isDev = isNotProduction(ENV);
|
|
647
|
+
|
|
639
648
|
// src/system/theme.js
|
|
640
649
|
var recursiveTheme = (val) => {
|
|
641
650
|
const CONFIG2 = getActiveConfig();
|
|
@@ -743,3 +752,4 @@ var applyReset = (reset = {}) => {
|
|
|
743
752
|
});
|
|
744
753
|
}
|
|
745
754
|
};
|
|
755
|
+
// @preserve-env
|
|
@@ -262,6 +262,11 @@ __export(shadow_exports, {
|
|
|
262
262
|
});
|
|
263
263
|
module.exports = __toCommonJS(shadow_exports);
|
|
264
264
|
|
|
265
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
266
|
+
var NODE_ENV = "development";
|
|
267
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
268
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
269
|
+
|
|
265
270
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
266
271
|
var window2 = globalThis;
|
|
267
272
|
var document2 = window2.document;
|
|
@@ -661,10 +666,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
661
666
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
662
667
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
663
668
|
};
|
|
664
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
665
|
-
Math.min(k - 3, 9 - k, 1),
|
|
666
|
-
-1
|
|
667
|
-
)) => [f(0), f(8), f(4)];
|
|
669
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
668
670
|
var getColorShade = (col, amt) => {
|
|
669
671
|
const num = parseInt(col, 16);
|
|
670
672
|
let r = (num >> 16) + amt;
|
|
@@ -679,7 +681,8 @@ var getColorShade = (col, amt) => {
|
|
|
679
681
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
680
682
|
};
|
|
681
683
|
var getRgbTone = (rgb, tone) => {
|
|
682
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
684
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
685
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
683
686
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
684
687
|
if (isNumber(tone)) tone += "";
|
|
685
688
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -884,6 +887,10 @@ var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
|
|
|
884
887
|
return { [propertyName]: getSequenceValue(value, sequenceProps) };
|
|
885
888
|
};
|
|
886
889
|
|
|
890
|
+
// src/utils/sprite.js
|
|
891
|
+
var ENV = "development";
|
|
892
|
+
var isDev = isNotProduction(ENV);
|
|
893
|
+
|
|
887
894
|
// src/system/color.js
|
|
888
895
|
var getColor = (value, key, config) => {
|
|
889
896
|
const CONFIG2 = config || getActiveConfig();
|
|
@@ -1031,3 +1038,4 @@ var getShadow = (value, globalTheme) => {
|
|
|
1031
1038
|
if (CONFIG2.verbose) console.warn("Can't find color", value);
|
|
1032
1039
|
return value;
|
|
1033
1040
|
};
|
|
1041
|
+
// @preserve-env
|
|
@@ -264,6 +264,11 @@ __export(spacing_exports, {
|
|
|
264
264
|
module.exports = __toCommonJS(spacing_exports);
|
|
265
265
|
var import_utils7 = __toESM(require_cjs(), 1);
|
|
266
266
|
|
|
267
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
268
|
+
var NODE_ENV = "development";
|
|
269
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
270
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
271
|
+
|
|
267
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
268
273
|
var window2 = globalThis;
|
|
269
274
|
var document2 = window2.document;
|
|
@@ -875,6 +880,10 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
875
880
|
}
|
|
876
881
|
};
|
|
877
882
|
|
|
883
|
+
// src/utils/sprite.js
|
|
884
|
+
var ENV = "development";
|
|
885
|
+
var isDev = isNotProduction(ENV);
|
|
886
|
+
|
|
878
887
|
// src/system/spacing.js
|
|
879
888
|
var runThroughMedia = (FACTORY2) => {
|
|
880
889
|
for (const prop in FACTORY2) {
|
|
@@ -982,3 +991,4 @@ var getSpacingBasedOnRatio = (props, propertyName, val) => {
|
|
|
982
991
|
}
|
|
983
992
|
return getSpacingByKey(value, propertyName);
|
|
984
993
|
};
|
|
994
|
+
// @preserve-env
|
package/dist/cjs/system/svg.js
CHANGED
|
@@ -264,6 +264,11 @@ __export(svg_exports, {
|
|
|
264
264
|
});
|
|
265
265
|
module.exports = __toCommonJS(svg_exports);
|
|
266
266
|
|
|
267
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
268
|
+
var NODE_ENV = "development";
|
|
269
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
270
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
271
|
+
|
|
267
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
268
273
|
var window2 = globalThis;
|
|
269
274
|
var document2 = window2.document;
|
|
@@ -605,7 +610,7 @@ var getActiveConfig = (def) => {
|
|
|
605
610
|
|
|
606
611
|
// src/utils/sprite.js
|
|
607
612
|
var ENV = "development";
|
|
608
|
-
var isDev = ENV
|
|
613
|
+
var isDev = isNotProduction(ENV);
|
|
609
614
|
var generateSprite = (icons) => {
|
|
610
615
|
const CONFIG2 = getActiveConfig();
|
|
611
616
|
let sprite = "";
|
|
@@ -627,7 +632,9 @@ var parseRootAttributes = (htmlString) => {
|
|
|
627
632
|
return {};
|
|
628
633
|
}
|
|
629
634
|
const attrString = match[1];
|
|
630
|
-
const attrs = attrString.match(
|
|
635
|
+
const attrs = attrString.match(
|
|
636
|
+
/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
|
|
637
|
+
);
|
|
631
638
|
return attrs.reduce((acc, attr) => {
|
|
632
639
|
const [key, value] = attr.split("=");
|
|
633
640
|
acc[key] = value.replace(/['"]/g, "");
|
|
@@ -733,3 +740,4 @@ var appendSVG = (lib, options = DEF_OPTIONS) => {
|
|
|
733
740
|
}
|
|
734
741
|
}
|
|
735
742
|
};
|
|
743
|
+
// @preserve-env
|
package/dist/cjs/system/theme.js
CHANGED
|
@@ -264,6 +264,11 @@ __export(theme_exports, {
|
|
|
264
264
|
});
|
|
265
265
|
module.exports = __toCommonJS(theme_exports);
|
|
266
266
|
|
|
267
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
268
|
+
var NODE_ENV = "development";
|
|
269
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
270
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
271
|
+
|
|
267
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
268
273
|
var window2 = globalThis;
|
|
269
274
|
var document2 = window2.document;
|
|
@@ -658,10 +663,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
658
663
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
659
664
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
660
665
|
};
|
|
661
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
662
|
-
Math.min(k - 3, 9 - k, 1),
|
|
663
|
-
-1
|
|
664
|
-
)) => [f(0), f(8), f(4)];
|
|
666
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
665
667
|
var getColorShade = (col, amt) => {
|
|
666
668
|
const num = parseInt(col, 16);
|
|
667
669
|
let r = (num >> 16) + amt;
|
|
@@ -676,7 +678,8 @@ var getColorShade = (col, amt) => {
|
|
|
676
678
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
677
679
|
};
|
|
678
680
|
var getRgbTone = (rgb, tone) => {
|
|
679
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
681
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
682
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
680
683
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
681
684
|
if (isNumber(tone)) tone += "";
|
|
682
685
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -696,6 +699,10 @@ var getRgbTone = (rgb, tone) => {
|
|
|
696
699
|
// src/utils/sequence.js
|
|
697
700
|
var import_utils4 = __toESM(require_cjs(), 1);
|
|
698
701
|
|
|
702
|
+
// src/utils/sprite.js
|
|
703
|
+
var ENV = "development";
|
|
704
|
+
var isDev = isNotProduction(ENV);
|
|
705
|
+
|
|
699
706
|
// src/system/color.js
|
|
700
707
|
var getColor = (value, key, config) => {
|
|
701
708
|
const CONFIG2 = config || getActiveConfig();
|
|
@@ -923,3 +930,4 @@ var getMediaTheme = (value, modifier) => {
|
|
|
923
930
|
const resolvedTheme = recursiveTheme(themeValue);
|
|
924
931
|
return resolvedTheme;
|
|
925
932
|
};
|
|
933
|
+
// @preserve-env
|
|
@@ -264,6 +264,11 @@ __export(timing_exports, {
|
|
|
264
264
|
module.exports = __toCommonJS(timing_exports);
|
|
265
265
|
var import_utils7 = __toESM(require_cjs(), 1);
|
|
266
266
|
|
|
267
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
268
|
+
var NODE_ENV = "development";
|
|
269
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
270
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
271
|
+
|
|
267
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
268
273
|
var window2 = globalThis;
|
|
269
274
|
var document2 = window2.document;
|
|
@@ -837,6 +842,10 @@ var applySequenceVars = (FACTORY2, options = {}) => {
|
|
|
837
842
|
}
|
|
838
843
|
};
|
|
839
844
|
|
|
845
|
+
// src/utils/sprite.js
|
|
846
|
+
var ENV = "development";
|
|
847
|
+
var isDev = isNotProduction(ENV);
|
|
848
|
+
|
|
840
849
|
// src/system/timing.js
|
|
841
850
|
var applyTimingSequence = () => {
|
|
842
851
|
const CONFIG2 = getActiveConfig();
|
|
@@ -858,3 +867,4 @@ var getTimingByKey = (value, property = "timing") => {
|
|
|
858
867
|
TIMING2
|
|
859
868
|
);
|
|
860
869
|
};
|
|
870
|
+
// @preserve-env
|
|
@@ -264,6 +264,11 @@ __export(typography_exports, {
|
|
|
264
264
|
});
|
|
265
265
|
module.exports = __toCommonJS(typography_exports);
|
|
266
266
|
|
|
267
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
268
|
+
var NODE_ENV = "development";
|
|
269
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
270
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
271
|
+
|
|
267
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
268
273
|
var window2 = globalThis;
|
|
269
274
|
var document2 = window2.document;
|
|
@@ -883,6 +888,10 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
883
888
|
}
|
|
884
889
|
};
|
|
885
890
|
|
|
891
|
+
// src/utils/sprite.js
|
|
892
|
+
var ENV = "development";
|
|
893
|
+
var isDev = isNotProduction(ENV);
|
|
894
|
+
|
|
886
895
|
// src/system/typography.js
|
|
887
896
|
var runThroughMedia = (FACTORY2) => {
|
|
888
897
|
const CONFIG2 = getActiveConfig();
|
|
@@ -955,3 +964,4 @@ var getFontSizeByKey = (value) => {
|
|
|
955
964
|
const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
956
965
|
return getSequenceValuePropertyPair(value, "fontSize", TYPOGRAPHY2);
|
|
957
966
|
};
|
|
967
|
+
// @preserve-env
|
|
@@ -272,6 +272,11 @@ __export(transforms_exports, {
|
|
|
272
272
|
});
|
|
273
273
|
module.exports = __toCommonJS(transforms_exports);
|
|
274
274
|
|
|
275
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
276
|
+
var NODE_ENV = "development";
|
|
277
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
278
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
279
|
+
|
|
275
280
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
276
281
|
var window2 = globalThis;
|
|
277
282
|
var document2 = window2.document;
|
|
@@ -684,10 +689,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
684
689
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
685
690
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
686
691
|
};
|
|
687
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
688
|
-
Math.min(k - 3, 9 - k, 1),
|
|
689
|
-
-1
|
|
690
|
-
)) => [f(0), f(8), f(4)];
|
|
692
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
691
693
|
var getColorShade = (col, amt) => {
|
|
692
694
|
const num = parseInt(col, 16);
|
|
693
695
|
let r = (num >> 16) + amt;
|
|
@@ -702,7 +704,8 @@ var getColorShade = (col, amt) => {
|
|
|
702
704
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
703
705
|
};
|
|
704
706
|
var getRgbTone = (rgb, tone) => {
|
|
705
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
707
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
708
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
706
709
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
707
710
|
if (isNumber(tone)) tone += "";
|
|
708
711
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -951,6 +954,10 @@ var applySequenceVars = (FACTORY2, options = {}) => {
|
|
|
951
954
|
}
|
|
952
955
|
};
|
|
953
956
|
|
|
957
|
+
// src/utils/sprite.js
|
|
958
|
+
var ENV = "development";
|
|
959
|
+
var isDev = isNotProduction(ENV);
|
|
960
|
+
|
|
954
961
|
// src/system/color.js
|
|
955
962
|
var getColor = (value, key, config) => {
|
|
956
963
|
const CONFIG2 = config || getActiveConfig();
|
|
@@ -1252,3 +1259,4 @@ var transformSizeRatio = (propertyName, props) => {
|
|
|
1252
1259
|
ratio: true
|
|
1253
1260
|
});
|
|
1254
1261
|
};
|
|
1262
|
+
// @preserve-env
|
package/dist/cjs/utils/color.js
CHANGED
|
@@ -38,6 +38,11 @@ __export(color_exports, {
|
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(color_exports);
|
|
40
40
|
|
|
41
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
42
|
+
var NODE_ENV = "development";
|
|
43
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
44
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
45
|
+
|
|
41
46
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
42
47
|
var window2 = globalThis;
|
|
43
48
|
var document2 = window2.document;
|
|
@@ -121,10 +126,7 @@ var mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
|
121
126
|
};
|
|
122
127
|
var changeLightness = (delta, hsl) => {
|
|
123
128
|
const [hue, saturation, lightness] = hsl;
|
|
124
|
-
const newLightness = Math.max(
|
|
125
|
-
0,
|
|
126
|
-
Math.min(100, lightness + parseFloat(delta))
|
|
127
|
-
);
|
|
129
|
+
const newLightness = Math.max(0, Math.min(100, lightness + parseFloat(delta)));
|
|
128
130
|
return [hue, saturation, newLightness];
|
|
129
131
|
};
|
|
130
132
|
var rgbToHSL = (r, g, b) => {
|
|
@@ -134,10 +136,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
134
136
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
135
137
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
136
138
|
};
|
|
137
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
138
|
-
Math.min(k - 3, 9 - k, 1),
|
|
139
|
-
-1
|
|
140
|
-
)) => [f(0), f(8), f(4)];
|
|
139
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
141
140
|
var getColorShade = (col, amt) => {
|
|
142
141
|
const num = parseInt(col, 16);
|
|
143
142
|
let r = (num >> 16) + amt;
|
|
@@ -155,23 +154,22 @@ var mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
|
155
154
|
const arr = [];
|
|
156
155
|
for (let i = 0; i < 4; i++) {
|
|
157
156
|
const round = i === 3 ? (x) => x : Math.round;
|
|
158
|
-
arr[i] = round(
|
|
159
|
-
colorA[i] + (colorB[i] - colorA[i]) * range
|
|
160
|
-
);
|
|
157
|
+
arr[i] = round(colorA[i] + (colorB[i] - colorA[i]) * range);
|
|
161
158
|
}
|
|
162
159
|
return `rgba(${arr})`;
|
|
163
160
|
};
|
|
164
161
|
var opacify = (color, opacity) => {
|
|
165
162
|
const arr = colorStringToRgbaArray(color);
|
|
166
163
|
if (!arr) {
|
|
167
|
-
if (ENV
|
|
164
|
+
if (isNotProduction(ENV)) console.warn(color + " color is not rgba");
|
|
168
165
|
return;
|
|
169
166
|
}
|
|
170
167
|
arr[3] = opacity;
|
|
171
168
|
return `rgba(${arr})`;
|
|
172
169
|
};
|
|
173
170
|
var getRgbTone = (rgb, tone) => {
|
|
174
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
171
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
172
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
175
173
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
176
174
|
if (isNumber(tone)) tone += "";
|
|
177
175
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -187,3 +185,4 @@ var getRgbTone = (rgb, tone) => {
|
|
|
187
185
|
return newRgb;
|
|
188
186
|
}
|
|
189
187
|
};
|
|
188
|
+
// @preserve-env
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -309,6 +309,11 @@ var isScalingUnit = (unit) => {
|
|
|
309
309
|
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
310
310
|
};
|
|
311
311
|
|
|
312
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
313
|
+
var NODE_ENV = "development";
|
|
314
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
315
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
316
|
+
|
|
312
317
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
313
318
|
var window2 = globalThis;
|
|
314
319
|
var document2 = window2.document;
|
|
@@ -497,10 +502,7 @@ var mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
|
497
502
|
};
|
|
498
503
|
var changeLightness = (delta, hsl) => {
|
|
499
504
|
const [hue, saturation, lightness] = hsl;
|
|
500
|
-
const newLightness = Math.max(
|
|
501
|
-
0,
|
|
502
|
-
Math.min(100, lightness + parseFloat(delta))
|
|
503
|
-
);
|
|
505
|
+
const newLightness = Math.max(0, Math.min(100, lightness + parseFloat(delta)));
|
|
504
506
|
return [hue, saturation, newLightness];
|
|
505
507
|
};
|
|
506
508
|
var rgbToHSL = (r, g, b) => {
|
|
@@ -510,10 +512,7 @@ var rgbToHSL = (r, g, b) => {
|
|
|
510
512
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
511
513
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
512
514
|
};
|
|
513
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
514
|
-
Math.min(k - 3, 9 - k, 1),
|
|
515
|
-
-1
|
|
516
|
-
)) => [f(0), f(8), f(4)];
|
|
515
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)) => [f(0), f(8), f(4)];
|
|
517
516
|
var getColorShade = (col, amt) => {
|
|
518
517
|
const num = parseInt(col, 16);
|
|
519
518
|
let r = (num >> 16) + amt;
|
|
@@ -531,23 +530,22 @@ var mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
|
531
530
|
const arr = [];
|
|
532
531
|
for (let i = 0; i < 4; i++) {
|
|
533
532
|
const round = i === 3 ? (x) => x : Math.round;
|
|
534
|
-
arr[i] = round(
|
|
535
|
-
colorA[i] + (colorB[i] - colorA[i]) * range
|
|
536
|
-
);
|
|
533
|
+
arr[i] = round(colorA[i] + (colorB[i] - colorA[i]) * range);
|
|
537
534
|
}
|
|
538
535
|
return `rgba(${arr})`;
|
|
539
536
|
};
|
|
540
537
|
var opacify = (color, opacity) => {
|
|
541
538
|
const arr = colorStringToRgbaArray(color);
|
|
542
539
|
if (!arr) {
|
|
543
|
-
if (ENV
|
|
540
|
+
if (isNotProduction(ENV)) console.warn(color + " color is not rgba");
|
|
544
541
|
return;
|
|
545
542
|
}
|
|
546
543
|
arr[3] = opacity;
|
|
547
544
|
return `rgba(${arr})`;
|
|
548
545
|
};
|
|
549
546
|
var getRgbTone = (rgb, tone) => {
|
|
550
|
-
if (isString(rgb) && rgb.includes("rgb"))
|
|
547
|
+
if (isString(rgb) && rgb.includes("rgb"))
|
|
548
|
+
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
551
549
|
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
552
550
|
if (isNumber(tone)) tone += "";
|
|
553
551
|
const toHex = rgbArrayToHex(rgb);
|
|
@@ -1146,7 +1144,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1146
1144
|
|
|
1147
1145
|
// src/utils/sprite.js
|
|
1148
1146
|
var ENV2 = "development";
|
|
1149
|
-
var isDev = ENV2
|
|
1147
|
+
var isDev = isNotProduction(ENV2);
|
|
1150
1148
|
var generateSprite = (icons) => {
|
|
1151
1149
|
const CONFIG2 = getActiveConfig();
|
|
1152
1150
|
let sprite = "";
|
|
@@ -1168,7 +1166,9 @@ var parseRootAttributes = (htmlString) => {
|
|
|
1168
1166
|
return {};
|
|
1169
1167
|
}
|
|
1170
1168
|
const attrString = match[1];
|
|
1171
|
-
const attrs = attrString.match(
|
|
1169
|
+
const attrs = attrString.match(
|
|
1170
|
+
/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
|
|
1171
|
+
);
|
|
1172
1172
|
return attrs.reduce((acc, attr) => {
|
|
1173
1173
|
const [key, value] = attr.split("=");
|
|
1174
1174
|
acc[key] = value.replace(/['"]/g, "");
|
|
@@ -1203,3 +1203,4 @@ var convertSvgToSymbol = (key, code) => {
|
|
|
1203
1203
|
symbol = symbol.replace("</svg", "</symbol");
|
|
1204
1204
|
return symbol;
|
|
1205
1205
|
};
|
|
1206
|
+
// @preserve-env
|
package/dist/cjs/utils/sprite.js
CHANGED
|
@@ -25,6 +25,11 @@ __export(sprite_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(sprite_exports);
|
|
27
27
|
|
|
28
|
+
// ../../../domql/packages/utils/dist/esm/env.js
|
|
29
|
+
var NODE_ENV = "development";
|
|
30
|
+
var isProduction = (env = NODE_ENV) => env === "production";
|
|
31
|
+
var isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
32
|
+
|
|
28
33
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
29
34
|
var window2 = globalThis;
|
|
30
35
|
var document2 = window2.document;
|
|
@@ -363,7 +368,7 @@ var getActiveConfig = (def) => {
|
|
|
363
368
|
|
|
364
369
|
// src/utils/sprite.js
|
|
365
370
|
var ENV = "development";
|
|
366
|
-
var isDev = ENV
|
|
371
|
+
var isDev = isNotProduction(ENV);
|
|
367
372
|
var generateSprite = (icons) => {
|
|
368
373
|
const CONFIG2 = getActiveConfig();
|
|
369
374
|
let sprite = "";
|
|
@@ -385,7 +390,9 @@ var parseRootAttributes = (htmlString) => {
|
|
|
385
390
|
return {};
|
|
386
391
|
}
|
|
387
392
|
const attrString = match[1];
|
|
388
|
-
const attrs = attrString.match(
|
|
393
|
+
const attrs = attrString.match(
|
|
394
|
+
/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
|
|
395
|
+
);
|
|
389
396
|
return attrs.reduce((acc, attr) => {
|
|
390
397
|
const [key, value] = attr.split("=");
|
|
391
398
|
acc[key] = value.replace(/['"]/g, "");
|
|
@@ -420,3 +427,4 @@ var convertSvgToSymbol = (key, code) => {
|
|
|
420
427
|
symbol = symbol.replace("</svg", "</symbol");
|
|
421
428
|
return symbol;
|
|
422
429
|
};
|
|
430
|
+
// @preserve-env
|
package/dist/cjs/utils/var.js
CHANGED
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.27.
|
|
5
|
+
"version": "2.27.11",
|
|
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.27.
|
|
29
|
-
"@symbo.ls/utils": "^2.27.
|
|
28
|
+
"@domql/utils": "^2.27.11",
|
|
29
|
+
"@symbo.ls/utils": "^2.27.11",
|
|
30
30
|
"color-contrast-checker": "^1.5.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "0189e4620f901c763754d06de65bcf6075c05618"
|
|
33
33
|
}
|
package/src/utils/color.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
document,
|
|
5
|
+
window,
|
|
6
|
+
isString,
|
|
7
|
+
isNumber,
|
|
8
|
+
isNotProduction
|
|
9
|
+
} from '@domql/utils'
|
|
4
10
|
const ENV = process.env.NODE_ENV
|
|
5
11
|
|
|
6
12
|
export const colorStringToRgbaArray = color => {
|
|
@@ -10,11 +16,22 @@ export const colorStringToRgbaArray = color => {
|
|
|
10
16
|
// convert #RGB and #RGBA to #RRGGBB and #RRGGBBAA
|
|
11
17
|
if (color[0] === '#') {
|
|
12
18
|
if (color.length < 7) {
|
|
13
|
-
color =
|
|
14
|
-
|
|
19
|
+
color =
|
|
20
|
+
'#' +
|
|
21
|
+
color[1] +
|
|
22
|
+
color[1] +
|
|
23
|
+
color[2] +
|
|
24
|
+
color[2] +
|
|
25
|
+
color[3] +
|
|
26
|
+
color[3] +
|
|
27
|
+
(color.length > 4 ? color[4] + color[4] : '')
|
|
28
|
+
}
|
|
29
|
+
return [
|
|
30
|
+
parseInt(color.substr(1, 2), 16),
|
|
15
31
|
parseInt(color.substr(3, 2), 16),
|
|
16
32
|
parseInt(color.substr(5, 2), 16),
|
|
17
|
-
color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
|
|
33
|
+
color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
|
|
34
|
+
]
|
|
18
35
|
}
|
|
19
36
|
|
|
20
37
|
// convert named colors
|
|
@@ -81,11 +98,7 @@ export const hexToRgba = (hex, alpha = 1) => {
|
|
|
81
98
|
export const mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
82
99
|
const arr = []
|
|
83
100
|
for (let i = 0; i < 3; i++) {
|
|
84
|
-
arr[i] = ~~(
|
|
85
|
-
colorA[i] + (
|
|
86
|
-
(colorB[i] - colorA[i]) * range
|
|
87
|
-
)
|
|
88
|
-
)
|
|
101
|
+
arr[i] = ~~(colorA[i] + (colorB[i] - colorA[i]) * range)
|
|
89
102
|
}
|
|
90
103
|
return `rgb(${arr})`
|
|
91
104
|
}
|
|
@@ -93,25 +106,27 @@ export const mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
|
93
106
|
export const changeLightness = (delta, hsl) => {
|
|
94
107
|
const [hue, saturation, lightness] = hsl
|
|
95
108
|
|
|
96
|
-
const newLightness = Math.max(
|
|
97
|
-
0,
|
|
98
|
-
Math.min(100, lightness + parseFloat(delta))
|
|
99
|
-
)
|
|
109
|
+
const newLightness = Math.max(0, Math.min(100, lightness + parseFloat(delta)))
|
|
100
110
|
|
|
101
111
|
return [hue, saturation, newLightness]
|
|
102
112
|
}
|
|
103
113
|
|
|
104
114
|
export const rgbToHSL = (r, g, b) => {
|
|
105
|
-
const a = Math.max(r, g, b)
|
|
106
|
-
const
|
|
115
|
+
const a = Math.max(r, g, b)
|
|
116
|
+
const n = a - Math.min(r, g, b)
|
|
117
|
+
const f = 1 - Math.abs(a + a - n - 1)
|
|
118
|
+
const h =
|
|
119
|
+
n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n) //eslint-disable-line
|
|
107
120
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2]
|
|
108
121
|
}
|
|
109
122
|
|
|
110
|
-
export const hslToRgb = (
|
|
123
|
+
export const hslToRgb = (
|
|
124
|
+
h,
|
|
125
|
+
s,
|
|
126
|
+
l,
|
|
111
127
|
a = s * Math.min(l, 1 - l),
|
|
112
|
-
f = (n, k = (n + h / 30) % 12) =>
|
|
113
|
-
Math.min(k - 3, 9 - k, 1), -1
|
|
114
|
-
)
|
|
128
|
+
f = (n, k = (n + h / 30) % 12) =>
|
|
129
|
+
l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)
|
|
115
130
|
) => [f(0), f(8), f(4)]
|
|
116
131
|
|
|
117
132
|
export const getColorShade = (col, amt) => {
|
|
@@ -122,12 +137,12 @@ export const getColorShade = (col, amt) => {
|
|
|
122
137
|
if (r > 255) r = 255
|
|
123
138
|
else if (r < 0) r = 0
|
|
124
139
|
|
|
125
|
-
let b = ((num >> 8) &
|
|
140
|
+
let b = ((num >> 8) & 0x00ff) + amt
|
|
126
141
|
|
|
127
142
|
if (b > 255) b = 255
|
|
128
143
|
else if (b < 0) b = 0
|
|
129
144
|
|
|
130
|
-
let g = (num &
|
|
145
|
+
let g = (num & 0x0000ff) + amt
|
|
131
146
|
|
|
132
147
|
if (g > 255) g = 255
|
|
133
148
|
else if (g < 0) g = 0
|
|
@@ -138,12 +153,8 @@ export const getColorShade = (col, amt) => {
|
|
|
138
153
|
export const mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
139
154
|
const arr = []
|
|
140
155
|
for (let i = 0; i < 4; i++) {
|
|
141
|
-
const round =
|
|
142
|
-
arr[i] = round(
|
|
143
|
-
(colorA[i] + (
|
|
144
|
-
(colorB[i] - colorA[i]) * range
|
|
145
|
-
))
|
|
146
|
-
)
|
|
156
|
+
const round = i === 3 ? x => x : Math.round
|
|
157
|
+
arr[i] = round(colorA[i] + (colorB[i] - colorA[i]) * range)
|
|
147
158
|
}
|
|
148
159
|
return `rgba(${arr})`
|
|
149
160
|
}
|
|
@@ -151,7 +162,7 @@ export const mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
|
151
162
|
export const opacify = (color, opacity) => {
|
|
152
163
|
const arr = colorStringToRgbaArray(color)
|
|
153
164
|
if (!arr) {
|
|
154
|
-
if (ENV
|
|
165
|
+
if (isNotProduction(ENV)) console.warn(color + ' color is not rgba')
|
|
155
166
|
return
|
|
156
167
|
}
|
|
157
168
|
arr[3] = opacity
|
|
@@ -159,7 +170,8 @@ export const opacify = (color, opacity) => {
|
|
|
159
170
|
}
|
|
160
171
|
|
|
161
172
|
export const getRgbTone = (rgb, tone) => {
|
|
162
|
-
if (isString(rgb) && rgb.includes('rgb'))
|
|
173
|
+
if (isString(rgb) && rgb.includes('rgb'))
|
|
174
|
+
rgb = colorStringToRgbaArray(rgb).join(', ')
|
|
163
175
|
if (isString(rgb)) rgb = rgb.split(',').map(v => parseFloat(v.trim()))
|
|
164
176
|
if (isNumber(tone)) tone += ''
|
|
165
177
|
const toHex = rgbArrayToHex(rgb)
|
|
@@ -172,7 +184,7 @@ export const getRgbTone = (rgb, tone) => {
|
|
|
172
184
|
const [r, g, b] = rgb
|
|
173
185
|
const hsl = rgbToHSL(r, g, b)
|
|
174
186
|
const [h, s, l] = hsl // eslint-disable-line
|
|
175
|
-
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255)
|
|
187
|
+
const newRgb = hslToRgb(h, s, (parseFloat(tone) / 100) * 255)
|
|
176
188
|
return newRgb
|
|
177
189
|
}
|
|
178
190
|
}
|
package/src/utils/sprite.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { isArray, isString } from '@domql/utils'
|
|
3
|
+
import { isArray, isNotProduction, isString } from '@domql/utils'
|
|
4
4
|
import { getActiveConfig } from '../factory'
|
|
5
5
|
|
|
6
6
|
const ENV = process.env.NODE_ENV || 'development'
|
|
7
|
-
const isDev = ENV
|
|
7
|
+
const isDev = isNotProduction(ENV)
|
|
8
8
|
|
|
9
|
-
export const generateSprite =
|
|
9
|
+
export const generateSprite = icons => {
|
|
10
10
|
const CONFIG = getActiveConfig()
|
|
11
11
|
|
|
12
12
|
let sprite = ''
|
|
@@ -20,7 +20,7 @@ export const generateSprite = (icons) => {
|
|
|
20
20
|
return sprite
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
const parseRootAttributes =
|
|
23
|
+
const parseRootAttributes = htmlString => {
|
|
24
24
|
const val = htmlString.default || htmlString
|
|
25
25
|
if (!isString(val)) {
|
|
26
26
|
if (isDev) console.warn('parseRootAttributes:', val, 'is not a string')
|
|
@@ -33,7 +33,9 @@ const parseRootAttributes = (htmlString) => {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const attrString = match[1]
|
|
36
|
-
const attrs = attrString.match(
|
|
36
|
+
const attrs = attrString.match(
|
|
37
|
+
/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm
|
|
38
|
+
)
|
|
37
39
|
return attrs.reduce((acc, attr) => {
|
|
38
40
|
const [key, value] = attr.split('=')
|
|
39
41
|
acc[key] = value.replace(/['"]/g, '')
|
|
@@ -49,7 +51,9 @@ const replaceIdsAndUrls = (code, key) => {
|
|
|
49
51
|
if (isArray(matches)) {
|
|
50
52
|
matches.forEach(() => {
|
|
51
53
|
const randomKey = Math.floor(Math.random() * 100000)
|
|
52
|
-
replacedCode = code
|
|
54
|
+
replacedCode = code
|
|
55
|
+
.replace(idRegex, `id="${key}-${randomKey}"`)
|
|
56
|
+
.replace(urlRegex, `url(#${key}-${randomKey})`)
|
|
53
57
|
})
|
|
54
58
|
}
|
|
55
59
|
return replacedCode
|
|
@@ -64,7 +68,8 @@ export const convertSvgToSymbol = (key, code) => {
|
|
|
64
68
|
|
|
65
69
|
const replacedCode = replaceIdsAndUrls(code, key)
|
|
66
70
|
|
|
67
|
-
let symbol = replacedCode.replace(
|
|
71
|
+
let symbol = replacedCode.replace(
|
|
72
|
+
'<svg',
|
|
68
73
|
`<symbol id="${key}" xmlns="${xmlns}" viewBox="${viewBox}"`
|
|
69
74
|
)
|
|
70
75
|
|