@symbo.ls/scratch 2.27.0 → 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 +5 -8
- package/dist/cjs/index.js +177 -345
- package/dist/cjs/set.js +126 -240
- package/dist/cjs/system/color.js +54 -87
- package/dist/cjs/system/document.js +26 -29
- package/dist/cjs/system/font.js +30 -37
- package/dist/cjs/system/index.js +126 -243
- package/dist/cjs/system/reset.js +33 -43
- package/dist/cjs/system/shadow.js +69 -117
- package/dist/cjs/system/spacing.js +41 -59
- package/dist/cjs/system/svg.js +31 -41
- package/dist/cjs/system/theme.js +67 -113
- package/dist/cjs/system/timing.js +34 -45
- package/dist/cjs/system/typography.js +43 -73
- package/dist/cjs/transforms/index.js +92 -163
- package/dist/cjs/utils/color.js +21 -35
- package/dist/cjs/utils/font.js +3 -6
- package/dist/cjs/utils/index.js +62 -108
- package/dist/cjs/utils/sequence.js +25 -45
- package/dist/cjs/utils/sprite.js +15 -12
- package/dist/cjs/utils/theme.js +3 -6
- package/dist/cjs/utils/var.js +19 -33
- package/package.json +7 -7
- package/src/system/typography.js +12 -20
- package/src/utils/color.js +42 -30
- package/src/utils/sprite.js +12 -7
package/dist/cjs/system/theme.js
CHANGED
|
@@ -51,8 +51,8 @@ var require_cjs = __commonJS({
|
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
53
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
|
-
var
|
|
55
|
-
__export2(
|
|
54
|
+
var index_exports = {};
|
|
55
|
+
__export2(index_exports, {
|
|
56
56
|
arrayzeValue: () => arrayzeValue,
|
|
57
57
|
copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
|
|
58
58
|
copyStringToClipboard: () => copyStringToClipboard,
|
|
@@ -73,12 +73,11 @@ var require_cjs = __commonJS({
|
|
|
73
73
|
toTitleCase: () => toTitleCase,
|
|
74
74
|
toggleFullscreen: () => toggleFullscreen
|
|
75
75
|
});
|
|
76
|
-
module2.exports = __toCommonJS2(
|
|
76
|
+
module2.exports = __toCommonJS2(index_exports);
|
|
77
77
|
var window22 = globalThis;
|
|
78
78
|
var document22 = window22.document;
|
|
79
79
|
var isObject2 = (arg) => {
|
|
80
|
-
if (arg === null)
|
|
81
|
-
return false;
|
|
80
|
+
if (arg === null) return false;
|
|
82
81
|
return typeof arg === "object" && arg.constructor === Object;
|
|
83
82
|
};
|
|
84
83
|
var isString2 = (arg) => typeof arg === "string";
|
|
@@ -103,13 +102,11 @@ var require_cjs = __commonJS({
|
|
|
103
102
|
};
|
|
104
103
|
var findClosestNumberInFactory = (val, factory) => {
|
|
105
104
|
val = parseFloat(val);
|
|
106
|
-
if (isObject2(factory))
|
|
107
|
-
factory = Object.values(factory);
|
|
105
|
+
if (isObject2(factory)) factory = Object.values(factory);
|
|
108
106
|
return findClosestNumber(val, factory);
|
|
109
107
|
};
|
|
110
108
|
var formatDate = (timestamp) => {
|
|
111
|
-
if (!timestamp)
|
|
112
|
-
return "";
|
|
109
|
+
if (!timestamp) return "";
|
|
113
110
|
const d = new Date(timestamp);
|
|
114
111
|
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
115
112
|
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
@@ -176,8 +173,7 @@ var require_cjs = __commonJS({
|
|
|
176
173
|
scriptEle.type = type;
|
|
177
174
|
scriptEle.text = xhr.responseText;
|
|
178
175
|
doc.body.appendChild(scriptEle);
|
|
179
|
-
if (typeof fallback === "function")
|
|
180
|
-
fallback();
|
|
176
|
+
if (typeof fallback === "function") fallback();
|
|
181
177
|
} else {
|
|
182
178
|
throw new Error(`Failed to load the script ${FILE_URL}`);
|
|
183
179
|
}
|
|
@@ -245,20 +241,15 @@ var require_cjs = __commonJS({
|
|
|
245
241
|
);
|
|
246
242
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
247
243
|
var toDescriptionCase = (str = "") => {
|
|
248
|
-
if (typeof str !== "string")
|
|
249
|
-
return;
|
|
244
|
+
if (typeof str !== "string") return;
|
|
250
245
|
const result = str.replace(/([A-Z])/g, " $1");
|
|
251
246
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
252
247
|
};
|
|
253
248
|
var arrayzeValue = (val) => {
|
|
254
|
-
if (isArray2(val))
|
|
255
|
-
|
|
256
|
-
if (
|
|
257
|
-
|
|
258
|
-
if (isObject2(val))
|
|
259
|
-
return Object.values(val);
|
|
260
|
-
if (isNumber2(val))
|
|
261
|
-
return [val];
|
|
249
|
+
if (isArray2(val)) return val;
|
|
250
|
+
if (isString2(val)) return val.split(" ");
|
|
251
|
+
if (isObject2(val)) return Object.values(val);
|
|
252
|
+
if (isNumber2(val)) return [val];
|
|
262
253
|
};
|
|
263
254
|
}
|
|
264
255
|
});
|
|
@@ -273,6 +264,11 @@ __export(theme_exports, {
|
|
|
273
264
|
});
|
|
274
265
|
module.exports = __toCommonJS(theme_exports);
|
|
275
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
|
+
|
|
276
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
277
273
|
var window2 = globalThis;
|
|
278
274
|
var document2 = window2.document;
|
|
@@ -284,8 +280,7 @@ var isDOMNode = (obj) => {
|
|
|
284
280
|
|
|
285
281
|
// ../../../domql/packages/utils/dist/esm/types.js
|
|
286
282
|
var isObject = (arg) => {
|
|
287
|
-
if (arg === null)
|
|
288
|
-
return false;
|
|
283
|
+
if (arg === null) return false;
|
|
289
284
|
return typeof arg === "object" && arg.constructor === Object;
|
|
290
285
|
};
|
|
291
286
|
var isString = (arg) => typeof arg === "string";
|
|
@@ -294,8 +289,7 @@ var isFunction = (arg) => typeof arg === "function";
|
|
|
294
289
|
var isNull = (arg) => arg === null;
|
|
295
290
|
var isArray = (arg) => Array.isArray(arg);
|
|
296
291
|
var isObjectLike = (arg) => {
|
|
297
|
-
if (arg === null)
|
|
298
|
-
return false;
|
|
292
|
+
if (arg === null) return false;
|
|
299
293
|
return typeof arg === "object";
|
|
300
294
|
};
|
|
301
295
|
var isUndefined = (arg) => {
|
|
@@ -363,8 +357,7 @@ var deepClone = (obj, options = {}) => {
|
|
|
363
357
|
const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
|
|
364
358
|
visited.set(obj, clone2);
|
|
365
359
|
for (const key in obj) {
|
|
366
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
367
|
-
continue;
|
|
360
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
368
361
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
369
362
|
continue;
|
|
370
363
|
const value = obj[key];
|
|
@@ -619,10 +612,8 @@ var getActiveConfig = (def) => {
|
|
|
619
612
|
|
|
620
613
|
// src/utils/color.js
|
|
621
614
|
var colorStringToRgbaArray = (color) => {
|
|
622
|
-
if (color === "")
|
|
623
|
-
|
|
624
|
-
if (color.toLowerCase() === "transparent")
|
|
625
|
-
return [0, 0, 0, 0];
|
|
615
|
+
if (color === "") return [0, 0, 0, 0];
|
|
616
|
+
if (color.toLowerCase() === "transparent") return [0, 0, 0, 0];
|
|
626
617
|
if (color[0] === "#") {
|
|
627
618
|
if (color.length < 7) {
|
|
628
619
|
color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
|
|
@@ -653,8 +644,7 @@ var colorStringToRgbaArray = (color) => {
|
|
|
653
644
|
}
|
|
654
645
|
}
|
|
655
646
|
if (color.indexOf("rgb") === 0) {
|
|
656
|
-
if (color.indexOf("rgba") === -1)
|
|
657
|
-
color = `${color}, 1`;
|
|
647
|
+
if (color.indexOf("rgba") === -1) color = `${color}, 1`;
|
|
658
648
|
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
659
649
|
}
|
|
660
650
|
return [0, 0, 0, 0];
|
|
@@ -673,36 +663,25 @@ var rgbToHSL = (r, g, b) => {
|
|
|
673
663
|
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
674
664
|
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
675
665
|
};
|
|
676
|
-
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
677
|
-
Math.min(k - 3, 9 - k, 1),
|
|
678
|
-
-1
|
|
679
|
-
)) => [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)];
|
|
680
667
|
var getColorShade = (col, amt) => {
|
|
681
668
|
const num = parseInt(col, 16);
|
|
682
669
|
let r = (num >> 16) + amt;
|
|
683
|
-
if (r > 255)
|
|
684
|
-
|
|
685
|
-
else if (r < 0)
|
|
686
|
-
r = 0;
|
|
670
|
+
if (r > 255) r = 255;
|
|
671
|
+
else if (r < 0) r = 0;
|
|
687
672
|
let b = (num >> 8 & 255) + amt;
|
|
688
|
-
if (b > 255)
|
|
689
|
-
|
|
690
|
-
else if (b < 0)
|
|
691
|
-
b = 0;
|
|
673
|
+
if (b > 255) b = 255;
|
|
674
|
+
else if (b < 0) b = 0;
|
|
692
675
|
let g = (num & 255) + amt;
|
|
693
|
-
if (g > 255)
|
|
694
|
-
|
|
695
|
-
else if (g < 0)
|
|
696
|
-
g = 0;
|
|
676
|
+
if (g > 255) g = 255;
|
|
677
|
+
else if (g < 0) g = 0;
|
|
697
678
|
return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
|
|
698
679
|
};
|
|
699
680
|
var getRgbTone = (rgb, tone) => {
|
|
700
681
|
if (isString(rgb) && rgb.includes("rgb"))
|
|
701
682
|
rgb = colorStringToRgbaArray(rgb).join(", ");
|
|
702
|
-
if (isString(rgb))
|
|
703
|
-
|
|
704
|
-
if (isNumber(tone))
|
|
705
|
-
tone += "";
|
|
683
|
+
if (isString(rgb)) rgb = rgb.split(",").map((v) => parseFloat(v.trim()));
|
|
684
|
+
if (isNumber(tone)) tone += "";
|
|
706
685
|
const toHex = rgbArrayToHex(rgb);
|
|
707
686
|
const abs = tone.slice(0, 1);
|
|
708
687
|
if (abs === "-" || abs === "+") {
|
|
@@ -720,31 +699,29 @@ var getRgbTone = (rgb, tone) => {
|
|
|
720
699
|
// src/utils/sequence.js
|
|
721
700
|
var import_utils4 = __toESM(require_cjs(), 1);
|
|
722
701
|
|
|
702
|
+
// src/utils/sprite.js
|
|
703
|
+
var ENV = "development";
|
|
704
|
+
var isDev = isNotProduction(ENV);
|
|
705
|
+
|
|
723
706
|
// src/system/color.js
|
|
724
707
|
var getColor = (value, key, config) => {
|
|
725
708
|
const CONFIG2 = config || getActiveConfig();
|
|
726
709
|
if (!isString(value)) {
|
|
727
|
-
if (CONFIG2.verbose)
|
|
728
|
-
console.warn(value, "- type for color is not valid");
|
|
710
|
+
if (CONFIG2.verbose) console.warn(value, "- type for color is not valid");
|
|
729
711
|
return;
|
|
730
712
|
}
|
|
731
|
-
if (value.slice(0, 2) === "--")
|
|
732
|
-
|
|
733
|
-
if (key && value[key])
|
|
734
|
-
value = value[key];
|
|
713
|
+
if (value.slice(0, 2) === "--") return `var(${value})`;
|
|
714
|
+
if (key && value[key]) value = value[key];
|
|
735
715
|
const [name, alpha, tone] = isArray(value) ? value : value.split(" ");
|
|
736
716
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
737
717
|
let val = COLOR2[name] || GRADIENT2[name];
|
|
738
718
|
if (!val) {
|
|
739
|
-
if (CONFIG2.verbose)
|
|
740
|
-
console.warn("Can't find color ", name);
|
|
719
|
+
if (CONFIG2.verbose) console.warn("Can't find color ", name);
|
|
741
720
|
return value;
|
|
742
721
|
}
|
|
743
722
|
if (key) {
|
|
744
|
-
if (val[key])
|
|
745
|
-
|
|
746
|
-
else if (CONFIG2.verbose)
|
|
747
|
-
console.warn(value, " - does not have ", key);
|
|
723
|
+
if (val[key]) val = val[key];
|
|
724
|
+
else if (CONFIG2.verbose) console.warn(value, " - does not have ", key);
|
|
748
725
|
}
|
|
749
726
|
let rgb = val.rgb;
|
|
750
727
|
if (!rgb) {
|
|
@@ -754,10 +731,8 @@ var getColor = (value, key, config) => {
|
|
|
754
731
|
rgb = getRgbTone(rgb, tone);
|
|
755
732
|
val[tone] = { rgb, var: `${val.var}-${tone}` };
|
|
756
733
|
}
|
|
757
|
-
if (val[tone])
|
|
758
|
-
|
|
759
|
-
if (alpha)
|
|
760
|
-
return `rgba(${rgb}, ${alpha})`;
|
|
734
|
+
if (val[tone]) rgb = val[tone].rgb;
|
|
735
|
+
if (alpha) return `rgba(${rgb}, ${alpha})`;
|
|
761
736
|
return CONFIG2.useVariable ? `var(${val.var})` : `rgb(${rgb})`;
|
|
762
737
|
};
|
|
763
738
|
|
|
@@ -774,22 +749,19 @@ var setThemeValue = (theme) => {
|
|
|
774
749
|
return value;
|
|
775
750
|
};
|
|
776
751
|
var getThemeValue = (theme) => {
|
|
777
|
-
if (theme.value)
|
|
778
|
-
return theme.value;
|
|
752
|
+
if (theme.value) return theme.value;
|
|
779
753
|
theme.value = setThemeValue(theme);
|
|
780
754
|
return theme.value;
|
|
781
755
|
};
|
|
782
756
|
var getTheme = (value, modifier) => {
|
|
783
757
|
const CONFIG2 = getActiveConfig();
|
|
784
|
-
if (CONFIG2.useVariable)
|
|
785
|
-
return getMediaTheme(value, modifier);
|
|
758
|
+
if (CONFIG2.useVariable) return getMediaTheme(value, modifier);
|
|
786
759
|
const { THEME: THEME2 } = CONFIG2;
|
|
787
760
|
if (isString(value)) {
|
|
788
761
|
const [theme, subtheme] = value.split(" ");
|
|
789
762
|
const isOurTheme = THEME2[theme];
|
|
790
763
|
if (isOurTheme) {
|
|
791
|
-
if (!subtheme && !modifier)
|
|
792
|
-
return getThemeValue(isOurTheme);
|
|
764
|
+
if (!subtheme && !modifier) return getThemeValue(isOurTheme);
|
|
793
765
|
value = [theme, subtheme || modifier];
|
|
794
766
|
}
|
|
795
767
|
}
|
|
@@ -797,14 +769,10 @@ var getTheme = (value, modifier) => {
|
|
|
797
769
|
const themeName = value[0];
|
|
798
770
|
const subThemeName = value[1];
|
|
799
771
|
const { helpers, media, state } = THEME2[themeName];
|
|
800
|
-
if (media && media[subThemeName])
|
|
801
|
-
|
|
802
|
-
if (
|
|
803
|
-
|
|
804
|
-
if (state && state[subThemeName])
|
|
805
|
-
return getThemeValue(state[subThemeName]);
|
|
806
|
-
} else if (isObject(value))
|
|
807
|
-
return setThemeValue(value);
|
|
772
|
+
if (media && media[subThemeName]) return getThemeValue(media[subThemeName]);
|
|
773
|
+
if (helpers && helpers[subThemeName]) return getThemeValue(helpers[subThemeName]);
|
|
774
|
+
if (state && state[subThemeName]) return getThemeValue(state[subThemeName]);
|
|
775
|
+
} else if (isObject(value)) return setThemeValue(value);
|
|
808
776
|
};
|
|
809
777
|
var setInverseTheme = (theme, variant, value) => {
|
|
810
778
|
if (isObject(variant)) {
|
|
@@ -822,13 +790,11 @@ var setInverseTheme = (theme, variant, value) => {
|
|
|
822
790
|
var setPseudo = (theme, key, variant, themeValue) => {
|
|
823
791
|
const result = getTheme(variant);
|
|
824
792
|
themeValue[`&:${key}`] = result;
|
|
825
|
-
if (isObject(variant) && !variant.value)
|
|
826
|
-
variant.value = result;
|
|
793
|
+
if (isObject(variant) && !variant.value) variant.value = result;
|
|
827
794
|
};
|
|
828
795
|
var setSelectors = (theme, value) => {
|
|
829
796
|
const { state } = theme;
|
|
830
|
-
if (!state)
|
|
831
|
-
return;
|
|
797
|
+
if (!state) return;
|
|
832
798
|
const keys = Object.keys(state);
|
|
833
799
|
keys.map((key) => {
|
|
834
800
|
const variant = state[key];
|
|
@@ -840,20 +806,16 @@ var setSelectors = (theme, value) => {
|
|
|
840
806
|
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
841
807
|
const result = getTheme(variant);
|
|
842
808
|
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
843
|
-
if (isObject(variant) && !variant.value)
|
|
844
|
-
variant.value = result;
|
|
809
|
+
if (isObject(variant) && !variant.value) variant.value = result;
|
|
845
810
|
};
|
|
846
811
|
var setMedia = (theme, value) => {
|
|
847
812
|
const { media } = theme;
|
|
848
|
-
if (!media)
|
|
849
|
-
return;
|
|
813
|
+
if (!media) return;
|
|
850
814
|
const keys = Object.keys(media);
|
|
851
815
|
keys.map((key) => {
|
|
852
816
|
const variant = media[key];
|
|
853
|
-
if (key === "dark" || key === "light")
|
|
854
|
-
|
|
855
|
-
if (key === "inverse")
|
|
856
|
-
setInverseTheme(theme, variant, value);
|
|
817
|
+
if (key === "dark" || key === "light") setPrefersScheme(theme, key, variant, value);
|
|
818
|
+
if (key === "inverse") setInverseTheme(theme, variant, value);
|
|
857
819
|
return theme;
|
|
858
820
|
});
|
|
859
821
|
return theme;
|
|
@@ -861,23 +823,19 @@ var setMedia = (theme, value) => {
|
|
|
861
823
|
var setHelpers = (theme, value) => {
|
|
862
824
|
const CONFIG2 = getActiveConfig();
|
|
863
825
|
const { helpers } = theme;
|
|
864
|
-
if (!helpers)
|
|
865
|
-
return;
|
|
826
|
+
if (!helpers) return;
|
|
866
827
|
const keys = Object.keys(helpers);
|
|
867
828
|
keys.map((key) => {
|
|
868
829
|
const helper = helpers[key];
|
|
869
|
-
if (isString(helper))
|
|
870
|
-
|
|
871
|
-
else
|
|
872
|
-
getThemeValue(helpers[key]);
|
|
830
|
+
if (isString(helper)) helpers[key] = CONFIG2.THEME[helper];
|
|
831
|
+
else getThemeValue(helpers[key]);
|
|
873
832
|
return theme;
|
|
874
833
|
});
|
|
875
834
|
return theme;
|
|
876
835
|
};
|
|
877
836
|
var setTheme = (val, key) => {
|
|
878
837
|
const CONFIG2 = getActiveConfig();
|
|
879
|
-
if (CONFIG2.useVariable)
|
|
880
|
-
return setMediaTheme(val, key);
|
|
838
|
+
if (CONFIG2.useVariable) return setMediaTheme(val, key);
|
|
881
839
|
const { state, media, helpers } = val;
|
|
882
840
|
const value = setThemeValue(val, key);
|
|
883
841
|
const CSSvar = `--theme-${key}`;
|
|
@@ -939,24 +897,19 @@ var recursiveTheme = (val) => {
|
|
|
939
897
|
} else if (symb === ":") {
|
|
940
898
|
obj[`&${param}`] = recursiveTheme(val[param]);
|
|
941
899
|
}
|
|
942
|
-
} else
|
|
943
|
-
obj[param] = val[param];
|
|
900
|
+
} else obj[param] = val[param];
|
|
944
901
|
}
|
|
945
902
|
return obj;
|
|
946
903
|
};
|
|
947
904
|
var findModifierFromArray = (val, modifierArray) => {
|
|
948
905
|
const currentMod = modifierArray.shift();
|
|
949
|
-
if (val[currentMod])
|
|
950
|
-
return findModifierFromArray(val[currentMod], modifierArray);
|
|
906
|
+
if (val[currentMod]) return findModifierFromArray(val[currentMod], modifierArray);
|
|
951
907
|
return val;
|
|
952
908
|
};
|
|
953
909
|
var findModifier = (val, modifier) => {
|
|
954
|
-
if (isArray(modifier))
|
|
955
|
-
|
|
956
|
-
else
|
|
957
|
-
return val[modifier];
|
|
958
|
-
else
|
|
959
|
-
return val;
|
|
910
|
+
if (isArray(modifier)) return findModifierFromArray(val, modifier);
|
|
911
|
+
else if (isString(modifier) && val[modifier]) return val[modifier];
|
|
912
|
+
else return val;
|
|
960
913
|
};
|
|
961
914
|
var getMediaTheme = (value, modifier) => {
|
|
962
915
|
const activeConfig = getActiveConfig();
|
|
@@ -977,3 +930,4 @@ var getMediaTheme = (value, modifier) => {
|
|
|
977
930
|
const resolvedTheme = recursiveTheme(themeValue);
|
|
978
931
|
return resolvedTheme;
|
|
979
932
|
};
|
|
933
|
+
// @preserve-env
|
|
@@ -51,8 +51,8 @@ var require_cjs = __commonJS({
|
|
|
51
51
|
return to;
|
|
52
52
|
};
|
|
53
53
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
|
-
var
|
|
55
|
-
__export2(
|
|
54
|
+
var index_exports = {};
|
|
55
|
+
__export2(index_exports, {
|
|
56
56
|
arrayzeValue: () => arrayzeValue,
|
|
57
57
|
copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
|
|
58
58
|
copyStringToClipboard: () => copyStringToClipboard,
|
|
@@ -73,12 +73,11 @@ var require_cjs = __commonJS({
|
|
|
73
73
|
toTitleCase: () => toTitleCase,
|
|
74
74
|
toggleFullscreen: () => toggleFullscreen
|
|
75
75
|
});
|
|
76
|
-
module2.exports = __toCommonJS2(
|
|
76
|
+
module2.exports = __toCommonJS2(index_exports);
|
|
77
77
|
var window22 = globalThis;
|
|
78
78
|
var document22 = window22.document;
|
|
79
79
|
var isObject2 = (arg) => {
|
|
80
|
-
if (arg === null)
|
|
81
|
-
return false;
|
|
80
|
+
if (arg === null) return false;
|
|
82
81
|
return typeof arg === "object" && arg.constructor === Object;
|
|
83
82
|
};
|
|
84
83
|
var isString2 = (arg) => typeof arg === "string";
|
|
@@ -103,13 +102,11 @@ var require_cjs = __commonJS({
|
|
|
103
102
|
};
|
|
104
103
|
var findClosestNumberInFactory = (val, factory) => {
|
|
105
104
|
val = parseFloat(val);
|
|
106
|
-
if (isObject2(factory))
|
|
107
|
-
factory = Object.values(factory);
|
|
105
|
+
if (isObject2(factory)) factory = Object.values(factory);
|
|
108
106
|
return findClosestNumber(val, factory);
|
|
109
107
|
};
|
|
110
108
|
var formatDate = (timestamp) => {
|
|
111
|
-
if (!timestamp)
|
|
112
|
-
return "";
|
|
109
|
+
if (!timestamp) return "";
|
|
113
110
|
const d = new Date(timestamp);
|
|
114
111
|
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
115
112
|
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
@@ -176,8 +173,7 @@ var require_cjs = __commonJS({
|
|
|
176
173
|
scriptEle.type = type;
|
|
177
174
|
scriptEle.text = xhr.responseText;
|
|
178
175
|
doc.body.appendChild(scriptEle);
|
|
179
|
-
if (typeof fallback === "function")
|
|
180
|
-
fallback();
|
|
176
|
+
if (typeof fallback === "function") fallback();
|
|
181
177
|
} else {
|
|
182
178
|
throw new Error(`Failed to load the script ${FILE_URL}`);
|
|
183
179
|
}
|
|
@@ -245,20 +241,15 @@ var require_cjs = __commonJS({
|
|
|
245
241
|
);
|
|
246
242
|
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
247
243
|
var toDescriptionCase = (str = "") => {
|
|
248
|
-
if (typeof str !== "string")
|
|
249
|
-
return;
|
|
244
|
+
if (typeof str !== "string") return;
|
|
250
245
|
const result = str.replace(/([A-Z])/g, " $1");
|
|
251
246
|
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
252
247
|
};
|
|
253
248
|
var arrayzeValue = (val) => {
|
|
254
|
-
if (isArray2(val))
|
|
255
|
-
|
|
256
|
-
if (
|
|
257
|
-
|
|
258
|
-
if (isObject2(val))
|
|
259
|
-
return Object.values(val);
|
|
260
|
-
if (isNumber2(val))
|
|
261
|
-
return [val];
|
|
249
|
+
if (isArray2(val)) return val;
|
|
250
|
+
if (isString2(val)) return val.split(" ");
|
|
251
|
+
if (isObject2(val)) return Object.values(val);
|
|
252
|
+
if (isNumber2(val)) return [val];
|
|
262
253
|
};
|
|
263
254
|
}
|
|
264
255
|
});
|
|
@@ -273,6 +264,11 @@ __export(timing_exports, {
|
|
|
273
264
|
module.exports = __toCommonJS(timing_exports);
|
|
274
265
|
var import_utils7 = __toESM(require_cjs(), 1);
|
|
275
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
|
+
|
|
276
272
|
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
277
273
|
var window2 = globalThis;
|
|
278
274
|
var document2 = window2.document;
|
|
@@ -288,8 +284,7 @@ var isFunction = (arg) => typeof arg === "function";
|
|
|
288
284
|
var isNull = (arg) => arg === null;
|
|
289
285
|
var isArray = (arg) => Array.isArray(arg);
|
|
290
286
|
var isObjectLike = (arg) => {
|
|
291
|
-
if (arg === null)
|
|
292
|
-
return false;
|
|
287
|
+
if (arg === null) return false;
|
|
293
288
|
return typeof arg === "object";
|
|
294
289
|
};
|
|
295
290
|
var isUndefined = (arg) => {
|
|
@@ -357,8 +352,7 @@ var deepClone = (obj, options = {}) => {
|
|
|
357
352
|
const clone2 = targetWindow ? isArray(obj) ? new targetWindow.Array() : new targetWindow.Object() : isArray(obj) ? [] : {};
|
|
358
353
|
visited.set(obj, clone2);
|
|
359
354
|
for (const key in obj) {
|
|
360
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key))
|
|
361
|
-
continue;
|
|
355
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
362
356
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
363
357
|
continue;
|
|
364
358
|
const value = obj[key];
|
|
@@ -663,8 +657,7 @@ var setSequenceValue = (props, sequenceProps) => {
|
|
|
663
657
|
var setScalingVar = (key, sequenceProps) => {
|
|
664
658
|
const { base, type, unit } = sequenceProps;
|
|
665
659
|
const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
|
|
666
|
-
if (key === 0)
|
|
667
|
-
return defaultVal;
|
|
660
|
+
if (key === 0) return defaultVal;
|
|
668
661
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
669
662
|
const ratioVar = `${prefix}-ratio`;
|
|
670
663
|
if (key > 0) {
|
|
@@ -701,10 +694,8 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
701
694
|
const diffRounded = ~~next - ~~value;
|
|
702
695
|
let arr;
|
|
703
696
|
const [first, middle, second] = getSubratioDifference(value, ratio);
|
|
704
|
-
if (diffRounded > 16)
|
|
705
|
-
|
|
706
|
-
else
|
|
707
|
-
arr = [first, second];
|
|
697
|
+
if (diffRounded > 16) arr = [first, middle, second];
|
|
698
|
+
else arr = [first, second];
|
|
708
699
|
arr.forEach((v, k) => {
|
|
709
700
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
710
701
|
const newVar = variable + (k + 1);
|
|
@@ -746,8 +737,7 @@ var generateSequence = (sequenceProps) => {
|
|
|
746
737
|
index: key
|
|
747
738
|
};
|
|
748
739
|
setSequenceValue(props, sequenceProps);
|
|
749
|
-
if (subSequence)
|
|
750
|
-
generateSubSequence(props, sequenceProps);
|
|
740
|
+
if (subSequence) generateSubSequence(props, sequenceProps);
|
|
751
741
|
}
|
|
752
742
|
return sequenceProps;
|
|
753
743
|
};
|
|
@@ -759,13 +749,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
759
749
|
unit = UNIT2.default,
|
|
760
750
|
useVariable
|
|
761
751
|
} = sequenceProps;
|
|
762
|
-
if (isString(value) && value.slice(0, 2) === "--")
|
|
763
|
-
return `var(${value})`;
|
|
752
|
+
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
764
753
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
765
754
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
766
755
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
767
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
768
|
-
return value;
|
|
756
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter) return value;
|
|
769
757
|
const letterVal = value.toUpperCase();
|
|
770
758
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
771
759
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -789,8 +777,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
789
777
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
790
778
|
}
|
|
791
779
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
792
|
-
if (CONFIG2.verbose)
|
|
793
|
-
console.warn(absValue, "- value is not found because `subSequence` is set to false");
|
|
780
|
+
if (CONFIG2.verbose) console.warn(absValue, "- value is not found because `subSequence` is set to false");
|
|
794
781
|
absValue = absValue.slice(0, 1);
|
|
795
782
|
}
|
|
796
783
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -798,8 +785,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
798
785
|
return isNegative ? `calc(${varValue2} * -1)` : varValue2;
|
|
799
786
|
}
|
|
800
787
|
const sequenceItem = sequence ? sequence[absValue] : null;
|
|
801
|
-
if (!sequenceItem)
|
|
802
|
-
return console.warn("can't find", sequence, absValue);
|
|
788
|
+
if (!sequenceItem) return console.warn("can't find", sequence, absValue);
|
|
803
789
|
if (unit === "ms" || unit === "s") {
|
|
804
790
|
return isNegative + sequenceItem.val + unit;
|
|
805
791
|
}
|
|
@@ -808,12 +794,10 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
808
794
|
var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
|
|
809
795
|
if (typeof value !== "string") {
|
|
810
796
|
const CONFIG2 = getActiveConfig();
|
|
811
|
-
if (CONFIG2.verbose)
|
|
812
|
-
console.warn(propertyName, value, "is not a string");
|
|
797
|
+
if (CONFIG2.verbose) console.warn(propertyName, value, "is not a string");
|
|
813
798
|
return { [propertyName]: value };
|
|
814
799
|
}
|
|
815
|
-
if (value === "-" || value === "")
|
|
816
|
-
return {};
|
|
800
|
+
if (value === "-" || value === "") return {};
|
|
817
801
|
return { [propertyName]: getSequenceValue(value, sequenceProps) };
|
|
818
802
|
};
|
|
819
803
|
|
|
@@ -858,6 +842,10 @@ var applySequenceVars = (FACTORY2, options = {}) => {
|
|
|
858
842
|
}
|
|
859
843
|
};
|
|
860
844
|
|
|
845
|
+
// src/utils/sprite.js
|
|
846
|
+
var ENV = "development";
|
|
847
|
+
var isDev = isNotProduction(ENV);
|
|
848
|
+
|
|
861
849
|
// src/system/timing.js
|
|
862
850
|
var applyTimingSequence = () => {
|
|
863
851
|
const CONFIG2 = getActiveConfig();
|
|
@@ -879,3 +867,4 @@ var getTimingByKey = (value, property = "timing") => {
|
|
|
879
867
|
TIMING2
|
|
880
868
|
);
|
|
881
869
|
};
|
|
870
|
+
// @preserve-env
|