@symbo.ls/scratch 2.11.429 → 2.11.430
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/defaultConfig/index.js +3 -1
- package/dist/cjs/defaultConfig/responsive.js +3 -1
- package/dist/cjs/factory.js +58 -40
- package/dist/cjs/index.js +84 -50
- package/dist/cjs/set.js +84 -50
- package/dist/cjs/system/color.js +84 -50
- package/dist/cjs/system/document.js +84 -50
- package/dist/cjs/system/font.js +84 -50
- package/dist/cjs/system/index.js +84 -50
- package/dist/cjs/system/reset.js +84 -50
- package/dist/cjs/system/shadow.js +84 -50
- package/dist/cjs/system/spacing.js +84 -50
- package/dist/cjs/system/svg.js +84 -50
- package/dist/cjs/system/theme.js +84 -50
- package/dist/cjs/system/timing.js +84 -50
- package/dist/cjs/system/typography.js +84 -50
- package/dist/cjs/transforms/index.js +84 -50
- package/dist/cjs/utils/color.js +57 -41
- package/dist/cjs/utils/index.js +84 -50
- package/dist/cjs/utils/sequence.js +84 -50
- package/dist/cjs/utils/sprite.js +58 -40
- package/dist/cjs/utils/var.js +84 -50
- package/package.json +2 -2
- package/src/defaultConfig/responsive.js +3 -1
package/dist/cjs/utils/var.js
CHANGED
|
@@ -166,6 +166,7 @@ var require_node = __commonJS({
|
|
|
166
166
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
167
167
|
var node_exports = {};
|
|
168
168
|
__export2(node_exports, {
|
|
169
|
+
isDOMNode: () => isDOMNode,
|
|
169
170
|
isHtmlElement: () => isHtmlElement,
|
|
170
171
|
isNode: () => isNode
|
|
171
172
|
});
|
|
@@ -177,6 +178,9 @@ var require_node = __commonJS({
|
|
|
177
178
|
var isHtmlElement = (obj) => {
|
|
178
179
|
return (typeof HTMLElement === "object" ? obj instanceof import_globals.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string") || false;
|
|
179
180
|
};
|
|
181
|
+
var isDOMNode = (obj) => {
|
|
182
|
+
return typeof import_globals.window !== "undefined" && (obj instanceof import_globals.window.Node || obj instanceof import_globals.window.Window || obj === import_globals.window || obj === document);
|
|
183
|
+
};
|
|
180
184
|
}
|
|
181
185
|
});
|
|
182
186
|
|
|
@@ -639,6 +643,7 @@ var require_object = __commonJS({
|
|
|
639
643
|
var import_types = require_types();
|
|
640
644
|
var import_array = require_array();
|
|
641
645
|
var import_string = require_string();
|
|
646
|
+
var import_node = require_node();
|
|
642
647
|
var exec = (param, element, state, context) => {
|
|
643
648
|
if ((0, import_types.isFunction)(param)) {
|
|
644
649
|
return param(
|
|
@@ -717,27 +722,28 @@ var require_object = __commonJS({
|
|
|
717
722
|
var mergeArrayExclude = (arr, excl = []) => {
|
|
718
723
|
return arr.reduce((acc, curr) => deepMerge2(acc, deepCloneExclude(curr, excl)), {});
|
|
719
724
|
};
|
|
720
|
-
var deepClone2 = (obj,
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
725
|
+
var deepClone2 = (obj, exclude = [], cleanUndefined = false, visited = /* @__PURE__ */ new WeakMap()) => {
|
|
726
|
+
if (!(0, import_types.isObjectLike)(obj) || (0, import_node.isDOMNode)(obj))
|
|
727
|
+
return obj;
|
|
728
|
+
if (visited.has(obj))
|
|
729
|
+
return visited.get(obj);
|
|
730
|
+
const clone2 = (0, import_types.isArray)(obj) ? [] : {};
|
|
731
|
+
visited.set(obj, clone2);
|
|
732
|
+
for (const key in obj) {
|
|
733
|
+
if (Object.prototype.hasOwnProperty.call(obj, key) && !exclude.includes(key)) {
|
|
734
|
+
const value = obj[key];
|
|
735
|
+
if ((0, import_node.isDOMNode)(value)) {
|
|
736
|
+
clone2[key] = value;
|
|
737
|
+
} else if (key === "extend" && (0, import_types.isArray)(value)) {
|
|
738
|
+
clone2[key] = (0, import_array.mergeArray)(value, exclude);
|
|
739
|
+
} else if ((0, import_types.isObjectLike)(value)) {
|
|
740
|
+
clone2[key] = deepClone2(value, exclude, cleanUndefined, visited);
|
|
741
|
+
} else {
|
|
742
|
+
clone2[key] = value;
|
|
743
|
+
}
|
|
734
744
|
}
|
|
735
|
-
if ((0, import_types.isObjectLike)(objProp)) {
|
|
736
|
-
o[prop] = deepClone2(objProp, excludeFrom, cleanUndefined);
|
|
737
|
-
} else
|
|
738
|
-
o[prop] = objProp;
|
|
739
745
|
}
|
|
740
|
-
return
|
|
746
|
+
return clone2;
|
|
741
747
|
};
|
|
742
748
|
var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
743
749
|
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
@@ -1048,30 +1054,40 @@ var require_object = __commonJS({
|
|
|
1048
1054
|
}
|
|
1049
1055
|
return true;
|
|
1050
1056
|
};
|
|
1051
|
-
var deepContains = (obj1, obj2) => {
|
|
1052
|
-
if (
|
|
1057
|
+
var deepContains = (obj1, obj2, ignoredKeys = ["node", "__ref"]) => {
|
|
1058
|
+
if (obj1 === obj2)
|
|
1059
|
+
return true;
|
|
1060
|
+
if (!(0, import_types.isObjectLike)(obj1) || !(0, import_types.isObjectLike)(obj2))
|
|
1053
1061
|
return false;
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1062
|
+
if ((0, import_node.isDOMNode)(obj1) || (0, import_node.isDOMNode)(obj2))
|
|
1063
|
+
return obj1 === obj2;
|
|
1064
|
+
const stack = [[obj1, obj2]];
|
|
1065
|
+
const visited = /* @__PURE__ */ new WeakSet();
|
|
1066
|
+
while (stack.length > 0) {
|
|
1067
|
+
const [current1, current2] = stack.pop();
|
|
1068
|
+
if (visited.has(current1))
|
|
1069
|
+
continue;
|
|
1070
|
+
visited.add(current1);
|
|
1071
|
+
const keys1 = Object.keys(current1).filter((key) => !ignoredKeys.includes(key));
|
|
1072
|
+
const keys2 = Object.keys(current2).filter((key) => !ignoredKeys.includes(key));
|
|
1073
|
+
if (keys1.length !== keys2.length)
|
|
1074
|
+
return false;
|
|
1075
|
+
for (const key of keys1) {
|
|
1076
|
+
if (!Object.prototype.hasOwnProperty.call(current2, key))
|
|
1058
1077
|
return false;
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
} else if ((0, import_types.isObjectLike)(obj1) && obj2 !== null) {
|
|
1066
|
-
for (const key in obj1) {
|
|
1067
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(obj2, key);
|
|
1068
|
-
if (!hasOwnProperty2 || !deepContains(obj1[key], obj2[key])) {
|
|
1078
|
+
const value1 = current1[key];
|
|
1079
|
+
const value2 = current2[key];
|
|
1080
|
+
if ((0, import_node.isDOMNode)(value1) || (0, import_node.isDOMNode)(value2)) {
|
|
1081
|
+
if (value1 !== value2)
|
|
1069
1082
|
return false;
|
|
1083
|
+
} else if ((0, import_types.isObjectLike)(value1) && (0, import_types.isObjectLike)(value2)) {
|
|
1084
|
+
if (value1 !== value2) {
|
|
1085
|
+
stack.push([value1, value2]);
|
|
1070
1086
|
}
|
|
1087
|
+
} else if (value1 !== value2) {
|
|
1088
|
+
return false;
|
|
1071
1089
|
}
|
|
1072
1090
|
}
|
|
1073
|
-
} else {
|
|
1074
|
-
return obj2 === obj1;
|
|
1075
1091
|
}
|
|
1076
1092
|
return true;
|
|
1077
1093
|
};
|
|
@@ -1861,10 +1877,10 @@ var require_cjs2 = __commonJS({
|
|
|
1861
1877
|
return [].concat(...arrays);
|
|
1862
1878
|
};
|
|
1863
1879
|
var mergeArray = (arr, excludeFrom = []) => {
|
|
1864
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.
|
|
1880
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
|
|
1865
1881
|
};
|
|
1866
1882
|
var mergeAndCloneIfArray = (obj) => {
|
|
1867
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.
|
|
1883
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
|
|
1868
1884
|
};
|
|
1869
1885
|
var cutArrayBeforeValue = (arr, value) => {
|
|
1870
1886
|
const index = arr.indexOf(value);
|
|
@@ -1968,6 +1984,8 @@ var require_cjs2 = __commonJS({
|
|
|
1968
1984
|
__export22(string_exports, {
|
|
1969
1985
|
customDecodeURIComponent: () => customDecodeURIComponent,
|
|
1970
1986
|
customEncodeURIComponent: () => customEncodeURIComponent,
|
|
1987
|
+
decodeNewlines: () => decodeNewlines,
|
|
1988
|
+
encodeNewlines: () => encodeNewlines,
|
|
1971
1989
|
findKeyPosition: () => findKeyPosition,
|
|
1972
1990
|
lowercaseFirstLetter: () => lowercaseFirstLetter,
|
|
1973
1991
|
replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields,
|
|
@@ -2071,6 +2089,12 @@ var require_cjs2 = __commonJS({
|
|
|
2071
2089
|
return char;
|
|
2072
2090
|
});
|
|
2073
2091
|
};
|
|
2092
|
+
var encodeNewlines = (str) => {
|
|
2093
|
+
return str.split("\n").join("/////n").split("`").join("/////tilde").split("$").join("/////dlrsgn");
|
|
2094
|
+
};
|
|
2095
|
+
var decodeNewlines = (encodedStr) => {
|
|
2096
|
+
return encodedStr.split("/////n").join("\n").split("/////tilde").join("`").split("/////dlrsgn").join("$");
|
|
2097
|
+
};
|
|
2074
2098
|
var customEncodeURIComponent = (str) => {
|
|
2075
2099
|
return str.split("").map((char) => {
|
|
2076
2100
|
if (/[^a-zA-Z0-9\s]/.test(char)) {
|
|
@@ -2501,7 +2525,7 @@ var require_cjs2 = __commonJS({
|
|
|
2501
2525
|
};
|
|
2502
2526
|
var overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
2503
2527
|
for (const e in params) {
|
|
2504
|
-
if (e === "
|
|
2528
|
+
if (e === "__ref")
|
|
2505
2529
|
continue;
|
|
2506
2530
|
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
2507
2531
|
continue;
|
|
@@ -3025,6 +3049,7 @@ var require_cjs2 = __commonJS({
|
|
|
3025
3049
|
var src_exports = {};
|
|
3026
3050
|
__export2(src_exports, {
|
|
3027
3051
|
arrayzeValue: () => arrayzeValue,
|
|
3052
|
+
copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
|
|
3028
3053
|
copyStringToClipboard: () => copyStringToClipboard,
|
|
3029
3054
|
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
3030
3055
|
findClosestNumber: () => findClosestNumber,
|
|
@@ -3152,15 +3177,22 @@ var require_cjs2 = __commonJS({
|
|
|
3152
3177
|
}
|
|
3153
3178
|
};
|
|
3154
3179
|
var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
|
|
3155
|
-
var copyStringToClipboard = (str) => {
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3180
|
+
var copyStringToClipboard = async (str) => {
|
|
3181
|
+
try {
|
|
3182
|
+
await navigator.clipboard.writeText(str);
|
|
3183
|
+
} catch (err) {
|
|
3184
|
+
console.warn("Failed to copy text: ", err);
|
|
3185
|
+
}
|
|
3186
|
+
};
|
|
3187
|
+
var copyJavaScriptToClipboard = async (jsCode) => {
|
|
3188
|
+
try {
|
|
3189
|
+
const blob = new Blob([jsCode], { type: "text/javascript" });
|
|
3190
|
+
const clipboardItem = new window.ClipboardItem({ "text/plain": blob });
|
|
3191
|
+
await navigator.clipboard.write([clipboardItem]);
|
|
3192
|
+
console.log("JavaScript code copied to clipboard as text/javascript");
|
|
3193
|
+
} catch (err) {
|
|
3194
|
+
console.error("Failed to copy JavaScript code: ", err);
|
|
3195
|
+
}
|
|
3164
3196
|
};
|
|
3165
3197
|
var removeChars = (str) => {
|
|
3166
3198
|
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
@@ -3374,9 +3406,11 @@ var BREAKPOINTS = {
|
|
|
3374
3406
|
mobileXS: 375
|
|
3375
3407
|
};
|
|
3376
3408
|
var DEVICES = {
|
|
3409
|
+
screenXXL: [2560, 1440],
|
|
3410
|
+
screenXL: [2240, 1260],
|
|
3377
3411
|
screenL: [1920, 1024],
|
|
3378
3412
|
screenM: [1680, 1024],
|
|
3379
|
-
screenS: [1440,
|
|
3413
|
+
screenS: [1440, 720],
|
|
3380
3414
|
tabletL: [1366, 926],
|
|
3381
3415
|
tabletM: [1280, 768],
|
|
3382
3416
|
tabletS: [1024, 768],
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@symbo.ls/scratch",
|
|
3
3
|
"description": "Φ / CSS framework and methodology.",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
|
-
"version": "2.11.
|
|
5
|
+
"version": "2.11.430",
|
|
6
6
|
"files": [
|
|
7
7
|
"src",
|
|
8
8
|
"dist"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"@symbo.ls/utils": "latest",
|
|
31
31
|
"color-contrast-checker": "^1.5.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "340f3f6f7aa8ebd812340008730e4490a607be19"
|
|
34
34
|
}
|
|
@@ -14,9 +14,11 @@ export const BREAKPOINTS = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const DEVICES = {
|
|
17
|
+
screenXXL: [2560, 1440],
|
|
18
|
+
screenXL: [2240, 1260],
|
|
17
19
|
screenL: [1920, 1024],
|
|
18
20
|
screenM: [1680, 1024],
|
|
19
|
-
screenS: [1440,
|
|
21
|
+
screenS: [1440, 720],
|
|
20
22
|
tabletL: [1366, 926],
|
|
21
23
|
tabletM: [1280, 768],
|
|
22
24
|
tabletS: [1024, 768],
|