@symbo.ls/scratch 3.2.3 → 3.2.7
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 +23 -494
- package/dist/cjs/index.js +11 -2742
- package/dist/cjs/set.js +66 -2060
- package/dist/esm/factory.js +43 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/set.js +148 -0
- package/dist/iife/index.js +2580 -0
- package/package.json +25 -15
- package/src/set.js +22 -7
- package/src/system/color.js +48 -11
- package/src/system/font.js +19 -5
- package/src/system/reset.js +12 -3
- package/src/system/shadow.js +20 -13
- package/src/system/spacing.js +63 -56
- package/src/system/theme.js +4 -3
- package/src/system/timing.js +1 -1
- package/src/transforms/index.js +212 -95
- package/src/utils/color.js +79 -0
- package/src/utils/font.js +54 -14
- package/src/utils/sequence.js +94 -39
- package/src/utils/sprite.js +2 -2
- package/src/utils/unit.js +69 -2
- package/src/utils/var.js +1 -2
- package/dist/cjs/defaultConfig/animation.js +0 -26
- package/dist/cjs/defaultConfig/cases.js +0 -26
- package/dist/cjs/defaultConfig/class.js +0 -27
- package/dist/cjs/defaultConfig/color.js +0 -28
- package/dist/cjs/defaultConfig/document.js +0 -26
- package/dist/cjs/defaultConfig/font-family.js +0 -34
- package/dist/cjs/defaultConfig/font.js +0 -26
- package/dist/cjs/defaultConfig/grid.js +0 -27
- package/dist/cjs/defaultConfig/icons.js +0 -28
- package/dist/cjs/defaultConfig/index.js +0 -222
- package/dist/cjs/defaultConfig/media.js +0 -31
- package/dist/cjs/defaultConfig/responsive.js +0 -52
- package/dist/cjs/defaultConfig/sequence.js +0 -51
- package/dist/cjs/defaultConfig/shadow.js +0 -26
- package/dist/cjs/defaultConfig/spacing.js +0 -87
- package/dist/cjs/defaultConfig/svg.js +0 -28
- package/dist/cjs/defaultConfig/templates.js +0 -26
- package/dist/cjs/defaultConfig/theme.js +0 -26
- package/dist/cjs/defaultConfig/timing.js +0 -68
- package/dist/cjs/defaultConfig/typography.js +0 -72
- package/dist/cjs/defaultConfig/unit.js +0 -28
- package/dist/cjs/package.json +0 -4
- package/dist/cjs/system/color.js +0 -1175
- package/dist/cjs/system/document.js +0 -987
- package/dist/cjs/system/font.js +0 -1009
- package/dist/cjs/system/index.js +0 -2227
- package/dist/cjs/system/reset.js +0 -1099
- package/dist/cjs/system/shadow.js +0 -1384
- package/dist/cjs/system/spacing.js +0 -1338
- package/dist/cjs/system/svg.js +0 -1086
- package/dist/cjs/system/theme.js +0 -1276
- package/dist/cjs/system/timing.js +0 -1213
- package/dist/cjs/system/typography.js +0 -1311
- package/dist/cjs/tests/index.js +0 -30
- package/dist/cjs/transforms/index.js +0 -1613
- package/dist/cjs/utils/color.js +0 -333
- package/dist/cjs/utils/font.js +0 -69
- package/dist/cjs/utils/index.js +0 -1548
- package/dist/cjs/utils/sequence.js +0 -1198
- package/dist/cjs/utils/sprite.js +0 -579
- package/dist/cjs/utils/theme.js +0 -31
- package/dist/cjs/utils/unit.js +0 -28
- package/dist/cjs/utils/var.js +0 -1040
package/dist/cjs/utils/var.js
DELETED
|
@@ -1,1040 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from))
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
-
|
|
33
|
-
// ../utils/dist/cjs/index.js
|
|
34
|
-
var require_cjs = __commonJS({
|
|
35
|
-
"../utils/dist/cjs/index.js"(exports, module2) {
|
|
36
|
-
"use strict";
|
|
37
|
-
var __defProp3 = Object.defineProperty;
|
|
38
|
-
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
|
-
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
-
var __hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
41
|
-
var __export2 = (target, all) => {
|
|
42
|
-
for (var name in all)
|
|
43
|
-
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
44
|
-
};
|
|
45
|
-
var __copyProps2 = (to, from, except, desc) => {
|
|
46
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
-
for (let key of __getOwnPropNames2(from))
|
|
48
|
-
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
49
|
-
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
|
-
}
|
|
51
|
-
return to;
|
|
52
|
-
};
|
|
53
|
-
var __toCommonJS2 = (mod) => __copyProps2(__defProp3({}, "__esModule", { value: true }), mod);
|
|
54
|
-
var index_exports = {};
|
|
55
|
-
__export2(index_exports, {
|
|
56
|
-
arrayzeValue: () => arrayzeValue,
|
|
57
|
-
copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
|
|
58
|
-
copyStringToClipboard: () => copyStringToClipboard,
|
|
59
|
-
fibonacciNumberByIndex: () => fibonacciNumberByIndex,
|
|
60
|
-
findClosestNumber: () => findClosestNumber,
|
|
61
|
-
findClosestNumberInFactory: () => findClosestNumberInFactory,
|
|
62
|
-
formatDate: () => formatDate,
|
|
63
|
-
isPhoto: () => isPhoto,
|
|
64
|
-
loadCssFile: () => loadCssFile,
|
|
65
|
-
loadJavascript: () => loadJavascript,
|
|
66
|
-
loadJavascriptFile: () => loadJavascriptFile,
|
|
67
|
-
loadJavascriptFileEmbedSync: () => loadJavascriptFileEmbedSync,
|
|
68
|
-
loadJavascriptFileSync: () => loadJavascriptFileSync,
|
|
69
|
-
loadRemoteCSS: () => loadRemoteCSS,
|
|
70
|
-
loadRemoteScript: () => loadRemoteScript,
|
|
71
|
-
removeChars: () => removeChars,
|
|
72
|
-
toCamelCase: () => toCamelCase,
|
|
73
|
-
toDashCase: () => toDashCase2,
|
|
74
|
-
toDescriptionCase: () => toDescriptionCase,
|
|
75
|
-
toTitleCase: () => toTitleCase,
|
|
76
|
-
toggleFullscreen: () => toggleFullscreen
|
|
77
|
-
});
|
|
78
|
-
module2.exports = __toCommonJS2(index_exports);
|
|
79
|
-
var window22 = globalThis;
|
|
80
|
-
var document22 = window22.document;
|
|
81
|
-
var isObject2 = (arg) => {
|
|
82
|
-
if (arg === null) return false;
|
|
83
|
-
return typeof arg === "object" && arg.constructor === Object;
|
|
84
|
-
};
|
|
85
|
-
var isString2 = (arg) => typeof arg === "string";
|
|
86
|
-
var isNumber2 = (arg) => typeof arg === "number";
|
|
87
|
-
var isArray2 = (arg) => Array.isArray(arg);
|
|
88
|
-
var STATE_METHODS3 = [
|
|
89
|
-
"update",
|
|
90
|
-
"parse",
|
|
91
|
-
"clean",
|
|
92
|
-
"create",
|
|
93
|
-
"destroy",
|
|
94
|
-
"add",
|
|
95
|
-
"toggle",
|
|
96
|
-
"remove",
|
|
97
|
-
"apply",
|
|
98
|
-
"set",
|
|
99
|
-
"reset",
|
|
100
|
-
"replace",
|
|
101
|
-
"quietReplace",
|
|
102
|
-
"quietUpdate",
|
|
103
|
-
"applyReplace",
|
|
104
|
-
"applyFunction",
|
|
105
|
-
"keys",
|
|
106
|
-
"values",
|
|
107
|
-
"ref",
|
|
108
|
-
"rootUpdate",
|
|
109
|
-
"parentUpdate",
|
|
110
|
-
"parent",
|
|
111
|
-
"__element",
|
|
112
|
-
"__depends",
|
|
113
|
-
"__ref",
|
|
114
|
-
"__children",
|
|
115
|
-
"root",
|
|
116
|
-
"setByPath",
|
|
117
|
-
"setPathCollection",
|
|
118
|
-
"removeByPath",
|
|
119
|
-
"removePathCollection",
|
|
120
|
-
"getByPath"
|
|
121
|
-
];
|
|
122
|
-
var PROPS_METHODS3 = ["update", "__element"];
|
|
123
|
-
var METHODS3 = [
|
|
124
|
-
"set",
|
|
125
|
-
"reset",
|
|
126
|
-
"update",
|
|
127
|
-
"remove",
|
|
128
|
-
"updateContent",
|
|
129
|
-
"removeContent",
|
|
130
|
-
"lookup",
|
|
131
|
-
"lookdown",
|
|
132
|
-
"lookdownAll",
|
|
133
|
-
"getRef",
|
|
134
|
-
"getPath",
|
|
135
|
-
"setNodeStyles",
|
|
136
|
-
"spotByPath",
|
|
137
|
-
"keys",
|
|
138
|
-
"parse",
|
|
139
|
-
"setProps",
|
|
140
|
-
"parseDeep",
|
|
141
|
-
"variables",
|
|
142
|
-
"if",
|
|
143
|
-
"log",
|
|
144
|
-
"verbose",
|
|
145
|
-
"warn",
|
|
146
|
-
"error",
|
|
147
|
-
"call",
|
|
148
|
-
"nextElement",
|
|
149
|
-
"previousElement"
|
|
150
|
-
];
|
|
151
|
-
var METHODS_EXL3 = [
|
|
152
|
-
...["node", "context", "extends", "__element", "__ref"],
|
|
153
|
-
...METHODS3,
|
|
154
|
-
...STATE_METHODS3,
|
|
155
|
-
...PROPS_METHODS3
|
|
156
|
-
];
|
|
157
|
-
var isMobile2 = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
158
|
-
var STATE_METHODS22 = [
|
|
159
|
-
"update",
|
|
160
|
-
"parse",
|
|
161
|
-
"clean",
|
|
162
|
-
"create",
|
|
163
|
-
"destroy",
|
|
164
|
-
"add",
|
|
165
|
-
"toggle",
|
|
166
|
-
"remove",
|
|
167
|
-
"apply",
|
|
168
|
-
"set",
|
|
169
|
-
"reset",
|
|
170
|
-
"replace",
|
|
171
|
-
"quietReplace",
|
|
172
|
-
"quietUpdate",
|
|
173
|
-
"applyReplace",
|
|
174
|
-
"applyFunction",
|
|
175
|
-
"keys",
|
|
176
|
-
"values",
|
|
177
|
-
"ref",
|
|
178
|
-
"rootUpdate",
|
|
179
|
-
"parentUpdate",
|
|
180
|
-
"parent",
|
|
181
|
-
"__element",
|
|
182
|
-
"__depends",
|
|
183
|
-
"__ref",
|
|
184
|
-
"__children",
|
|
185
|
-
"root",
|
|
186
|
-
"setByPath",
|
|
187
|
-
"setPathCollection",
|
|
188
|
-
"removeByPath",
|
|
189
|
-
"removePathCollection",
|
|
190
|
-
"getByPath"
|
|
191
|
-
];
|
|
192
|
-
var PROPS_METHODS22 = ["update", "__element"];
|
|
193
|
-
var METHODS22 = [
|
|
194
|
-
"set",
|
|
195
|
-
"reset",
|
|
196
|
-
"update",
|
|
197
|
-
"remove",
|
|
198
|
-
"updateContent",
|
|
199
|
-
"removeContent",
|
|
200
|
-
"lookup",
|
|
201
|
-
"lookdown",
|
|
202
|
-
"lookdownAll",
|
|
203
|
-
"getRef",
|
|
204
|
-
"getPath",
|
|
205
|
-
"setNodeStyles",
|
|
206
|
-
"spotByPath",
|
|
207
|
-
"keys",
|
|
208
|
-
"parse",
|
|
209
|
-
"setProps",
|
|
210
|
-
"parseDeep",
|
|
211
|
-
"variables",
|
|
212
|
-
"if",
|
|
213
|
-
"log",
|
|
214
|
-
"verbose",
|
|
215
|
-
"warn",
|
|
216
|
-
"error",
|
|
217
|
-
"call",
|
|
218
|
-
"nextElement",
|
|
219
|
-
"previousElement"
|
|
220
|
-
];
|
|
221
|
-
var METHODS_EXL22 = [
|
|
222
|
-
...["node", "context", "extends", "__element", "__ref"],
|
|
223
|
-
...METHODS22,
|
|
224
|
-
...STATE_METHODS22,
|
|
225
|
-
...PROPS_METHODS22
|
|
226
|
-
];
|
|
227
|
-
var window32 = globalThis;
|
|
228
|
-
var document32 = window32.document;
|
|
229
|
-
async function toggleFullscreen(opts) {
|
|
230
|
-
if (!document.fullscreenElement) {
|
|
231
|
-
try {
|
|
232
|
-
await (this.node || document).requestFullscreen();
|
|
233
|
-
} catch (err) {
|
|
234
|
-
console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`);
|
|
235
|
-
}
|
|
236
|
-
} else {
|
|
237
|
-
await document.exitFullscreen();
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
var findClosestNumber = (number, arr) => {
|
|
241
|
-
return (isArray2(arr) ? arr : Object.values(arr)).reduce((prev, curr) => {
|
|
242
|
-
return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
var findClosestNumberInFactory = (val, factory) => {
|
|
246
|
-
val = parseFloat(val);
|
|
247
|
-
if (isObject2(factory)) factory = Object.values(factory);
|
|
248
|
-
return findClosestNumber(val, factory);
|
|
249
|
-
};
|
|
250
|
-
var formatDate = (timestamp) => {
|
|
251
|
-
if (!timestamp) return "";
|
|
252
|
-
const d = new Date(timestamp);
|
|
253
|
-
const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
|
|
254
|
-
const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
|
|
255
|
-
const da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(d);
|
|
256
|
-
return `${da} ${mo}, ${ye}`;
|
|
257
|
-
};
|
|
258
|
-
var fibonacciNumberByIndex = function fibonacciNumberByIndex2(n) {
|
|
259
|
-
const fib = [0, 1];
|
|
260
|
-
for (let i = 2; i <= n; i++) {
|
|
261
|
-
fib[i] = fib[i - 1] + fib[i - 2];
|
|
262
|
-
}
|
|
263
|
-
return fib[n];
|
|
264
|
-
};
|
|
265
|
-
var loadJavascriptFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
|
|
266
|
-
return new Promise((resolve, reject) => {
|
|
267
|
-
try {
|
|
268
|
-
const scriptEle = doc.createElement("script");
|
|
269
|
-
scriptEle.type = type;
|
|
270
|
-
scriptEle.async = async;
|
|
271
|
-
scriptEle.src = FILE_URL;
|
|
272
|
-
scriptEle.addEventListener("load", (ev) => {
|
|
273
|
-
resolve({
|
|
274
|
-
status: true
|
|
275
|
-
});
|
|
276
|
-
});
|
|
277
|
-
scriptEle.addEventListener("error", (ev) => {
|
|
278
|
-
reject(
|
|
279
|
-
new Error({
|
|
280
|
-
status: false,
|
|
281
|
-
message: `Failed to load the script ${FILE_URL}`
|
|
282
|
-
})
|
|
283
|
-
);
|
|
284
|
-
});
|
|
285
|
-
doc.body.appendChild(scriptEle);
|
|
286
|
-
} catch (error) {
|
|
287
|
-
reject(error);
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
};
|
|
291
|
-
var loadJavascriptFileSync = (fileUrl, doc = document, type = "text/javascript") => {
|
|
292
|
-
return new Promise((resolve, reject) => {
|
|
293
|
-
const scriptEle = doc.createElement("script");
|
|
294
|
-
scriptEle.type = type;
|
|
295
|
-
scriptEle.src = fileUrl;
|
|
296
|
-
const blocker = doc.createElement("div");
|
|
297
|
-
blocker.style.cssText = "position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,0.8);z-index:9999;";
|
|
298
|
-
doc.body.appendChild(blocker);
|
|
299
|
-
scriptEle.onload = () => {
|
|
300
|
-
console.log(`Successfully loaded: ${fileUrl}`);
|
|
301
|
-
doc.body.removeChild(blocker);
|
|
302
|
-
resolve();
|
|
303
|
-
};
|
|
304
|
-
scriptEle.onerror = () => {
|
|
305
|
-
doc.body.removeChild(blocker);
|
|
306
|
-
reject(new Error(`Failed to load: ${fileUrl}`));
|
|
307
|
-
};
|
|
308
|
-
doc.body.appendChild(scriptEle);
|
|
309
|
-
});
|
|
310
|
-
};
|
|
311
|
-
var loadJavascriptFileEmbedSync = (FILE_URL, doc = document, fallback, type = "text/javascript") => {
|
|
312
|
-
const xhr = new window.XMLHttpRequest();
|
|
313
|
-
xhr.open("GET", FILE_URL, false);
|
|
314
|
-
xhr.send();
|
|
315
|
-
if (xhr.status === 200) {
|
|
316
|
-
const scriptEle = doc.createElement("script");
|
|
317
|
-
scriptEle.type = type;
|
|
318
|
-
scriptEle.text = xhr.responseText;
|
|
319
|
-
doc.body.appendChild(scriptEle);
|
|
320
|
-
if (typeof fallback === "function") fallback();
|
|
321
|
-
} else {
|
|
322
|
-
throw new Error(`Failed to load the script ${FILE_URL}`);
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
var loadCssFile = (FILE_URL, async = false, doc = document, type = "text/javascript") => {
|
|
326
|
-
return new Promise((resolve, reject) => {
|
|
327
|
-
try {
|
|
328
|
-
const linkElem = doc.createElement("link");
|
|
329
|
-
linkElem.rel = "stylesheet";
|
|
330
|
-
linkElem.href = FILE_URL;
|
|
331
|
-
linkElem.addEventListener("load", (ev) => {
|
|
332
|
-
resolve({
|
|
333
|
-
status: true
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
doc.head.appendChild(linkElem);
|
|
337
|
-
} catch (error) {
|
|
338
|
-
reject(error);
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
};
|
|
342
|
-
var loadJavascript = (body, async = false, doc = document, type = "text/javascript", id = "smbls-script") => {
|
|
343
|
-
try {
|
|
344
|
-
const scriptEle = doc.createElement("script");
|
|
345
|
-
scriptEle.type = type;
|
|
346
|
-
scriptEle.async = async;
|
|
347
|
-
scriptEle.id = id;
|
|
348
|
-
scriptEle.innerHTML = body;
|
|
349
|
-
doc.body.appendChild(scriptEle);
|
|
350
|
-
} catch (error) {
|
|
351
|
-
console.warn(error);
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
function loadRemoteScript(url, options = {}) {
|
|
355
|
-
const { window: window4 = globalThis } = options;
|
|
356
|
-
const { document: document4 = window4.document } = options;
|
|
357
|
-
return new Promise((resolve, reject) => {
|
|
358
|
-
const existingScript = document4.querySelector(`script[src="${url}"]`);
|
|
359
|
-
if (existingScript) {
|
|
360
|
-
return resolve(existingScript);
|
|
361
|
-
}
|
|
362
|
-
const script = document4.createElement("script");
|
|
363
|
-
script.src = url;
|
|
364
|
-
script.async = options.async === true;
|
|
365
|
-
script.type = options.type || "text/javascript";
|
|
366
|
-
if (options.id) script.id = options.id;
|
|
367
|
-
if (options.integrity) script.integrity = options.integrity;
|
|
368
|
-
if (options.crossOrigin) script.crossOrigin = options.crossOrigin;
|
|
369
|
-
script.onload = () => {
|
|
370
|
-
script.onerror = script.onload = null;
|
|
371
|
-
resolve(script);
|
|
372
|
-
};
|
|
373
|
-
script.onerror = () => {
|
|
374
|
-
script.onerror = script.onload = null;
|
|
375
|
-
reject(new Error(`Failed to load script: ${url}`));
|
|
376
|
-
};
|
|
377
|
-
document4.head.appendChild(script);
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
async function loadRemoteCSS(url, options = {}) {
|
|
381
|
-
const { window: window4 = globalThis } = options;
|
|
382
|
-
const { document: document4 = window4.document } = options;
|
|
383
|
-
return new Promise((resolve, reject) => {
|
|
384
|
-
const existingLink = document4.querySelector(`link[href="${url}"]`);
|
|
385
|
-
if (existingLink) {
|
|
386
|
-
return resolve(existingLink);
|
|
387
|
-
}
|
|
388
|
-
const link = document4.createElement("link");
|
|
389
|
-
link.href = url;
|
|
390
|
-
link.rel = options.rel || "stylesheet";
|
|
391
|
-
link.type = "text/css";
|
|
392
|
-
link.media = options.media || "all";
|
|
393
|
-
if (options.id) link.id = options.id;
|
|
394
|
-
if (options.integrity) link.integrity = options.integrity;
|
|
395
|
-
if (options.crossOrigin) link.crossOrigin = options.crossOrigin;
|
|
396
|
-
link.onload = () => {
|
|
397
|
-
link.onerror = link.onload = null;
|
|
398
|
-
resolve(link);
|
|
399
|
-
};
|
|
400
|
-
link.onerror = () => {
|
|
401
|
-
link.onerror = link.onload = null;
|
|
402
|
-
reject(new Error(`Failed to load stylesheet: ${url}`));
|
|
403
|
-
};
|
|
404
|
-
document4.head.appendChild(link);
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
var isPhoto = (format) => ["jpeg", "gif", "jpg", "png", "tiff", "woff"].includes(format);
|
|
408
|
-
var copyStringToClipboard = async (str) => {
|
|
409
|
-
try {
|
|
410
|
-
await navigator.clipboard.writeText(str);
|
|
411
|
-
} catch (err) {
|
|
412
|
-
console.warn("Failed to copy text: ", err);
|
|
413
|
-
}
|
|
414
|
-
};
|
|
415
|
-
var copyJavaScriptToClipboard = async (jsCode) => {
|
|
416
|
-
try {
|
|
417
|
-
const blob = new Blob([jsCode], { type: "text/javascript" });
|
|
418
|
-
const clipboardItem = new window.ClipboardItem({ "text/plain": blob });
|
|
419
|
-
await navigator.clipboard.write([clipboardItem]);
|
|
420
|
-
console.log("JavaScript code copied to clipboard as text/javascript");
|
|
421
|
-
} catch (err) {
|
|
422
|
-
console.error("Failed to copy JavaScript code: ", err);
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
var removeChars = (str) => {
|
|
426
|
-
return str.replace(/[^a-zA-Z0-9_]/g, "");
|
|
427
|
-
};
|
|
428
|
-
var toCamelCase = (str) => {
|
|
429
|
-
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
430
|
-
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
431
|
-
}).replaceAll(/\s+/g, "");
|
|
432
|
-
};
|
|
433
|
-
var toTitleCase = (str) => str && str.replace(/\w\S*/g, (txt) => {
|
|
434
|
-
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
435
|
-
});
|
|
436
|
-
var toDashCase2 = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
437
|
-
var toDescriptionCase = (str = "") => {
|
|
438
|
-
if (typeof str !== "string") return;
|
|
439
|
-
const result = str.replace(/([A-Z])/g, " $1");
|
|
440
|
-
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
441
|
-
};
|
|
442
|
-
var arrayzeValue = (val) => {
|
|
443
|
-
if (isArray2(val)) return val;
|
|
444
|
-
if (isString2(val)) return val.split(" ");
|
|
445
|
-
if (isObject2(val)) return Object.values(val);
|
|
446
|
-
if (isNumber2(val)) return [val];
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
// src/utils/var.js
|
|
452
|
-
var var_exports = {};
|
|
453
|
-
__export(var_exports, {
|
|
454
|
-
applyMediaSequenceVars: () => applyMediaSequenceVars,
|
|
455
|
-
applySequenceGlobalVars: () => applySequenceGlobalVars,
|
|
456
|
-
applySequenceVars: () => applySequenceVars,
|
|
457
|
-
setVariables: () => setVariables
|
|
458
|
-
});
|
|
459
|
-
module.exports = __toCommonJS(var_exports);
|
|
460
|
-
|
|
461
|
-
// ../../../domql/packages/utils/dist/esm/globals.js
|
|
462
|
-
var window2 = globalThis;
|
|
463
|
-
var document2 = window2.document;
|
|
464
|
-
|
|
465
|
-
// ../../../domql/packages/utils/dist/esm/node.js
|
|
466
|
-
var isDOMNode = (obj) => {
|
|
467
|
-
return typeof window2 !== "undefined" && (obj instanceof window2.Node || obj instanceof window2.Window || obj === window2 || obj === document);
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
// ../../../domql/packages/utils/dist/esm/types.js
|
|
471
|
-
var isFunction = (arg) => typeof arg === "function";
|
|
472
|
-
var isNull = (arg) => arg === null;
|
|
473
|
-
var isArray = (arg) => Array.isArray(arg);
|
|
474
|
-
var isObjectLike = (arg) => {
|
|
475
|
-
if (arg === null) return false;
|
|
476
|
-
return typeof arg === "object";
|
|
477
|
-
};
|
|
478
|
-
var isUndefined = (arg) => {
|
|
479
|
-
return arg === void 0;
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
// ../../../domql/packages/utils/dist/esm/array.js
|
|
483
|
-
var unstackArrayOfObjects = (arr, exclude = []) => {
|
|
484
|
-
return arr.reduce(
|
|
485
|
-
(a, c) => deepMerge(a, deepClone(c, { exclude }), exclude),
|
|
486
|
-
{}
|
|
487
|
-
);
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
// ../../../domql/packages/utils/dist/esm/keys.js
|
|
491
|
-
var STATE_METHODS = [
|
|
492
|
-
"update",
|
|
493
|
-
"parse",
|
|
494
|
-
"clean",
|
|
495
|
-
"create",
|
|
496
|
-
"destroy",
|
|
497
|
-
"add",
|
|
498
|
-
"toggle",
|
|
499
|
-
"remove",
|
|
500
|
-
"apply",
|
|
501
|
-
"set",
|
|
502
|
-
"reset",
|
|
503
|
-
"replace",
|
|
504
|
-
"quietReplace",
|
|
505
|
-
"quietUpdate",
|
|
506
|
-
"applyReplace",
|
|
507
|
-
"applyFunction",
|
|
508
|
-
"keys",
|
|
509
|
-
"values",
|
|
510
|
-
"ref",
|
|
511
|
-
"rootUpdate",
|
|
512
|
-
"parentUpdate",
|
|
513
|
-
"parent",
|
|
514
|
-
"__element",
|
|
515
|
-
"__depends",
|
|
516
|
-
"__ref",
|
|
517
|
-
"__children",
|
|
518
|
-
"root",
|
|
519
|
-
"setByPath",
|
|
520
|
-
"setPathCollection",
|
|
521
|
-
"removeByPath",
|
|
522
|
-
"removePathCollection",
|
|
523
|
-
"getByPath"
|
|
524
|
-
];
|
|
525
|
-
var PROPS_METHODS = ["update", "__element"];
|
|
526
|
-
var METHODS = [
|
|
527
|
-
"set",
|
|
528
|
-
"reset",
|
|
529
|
-
"update",
|
|
530
|
-
"remove",
|
|
531
|
-
"updateContent",
|
|
532
|
-
"removeContent",
|
|
533
|
-
"lookup",
|
|
534
|
-
"lookdown",
|
|
535
|
-
"lookdownAll",
|
|
536
|
-
"getRef",
|
|
537
|
-
"getPath",
|
|
538
|
-
"setNodeStyles",
|
|
539
|
-
"spotByPath",
|
|
540
|
-
"keys",
|
|
541
|
-
"parse",
|
|
542
|
-
"setProps",
|
|
543
|
-
"parseDeep",
|
|
544
|
-
"variables",
|
|
545
|
-
"if",
|
|
546
|
-
"log",
|
|
547
|
-
"verbose",
|
|
548
|
-
"warn",
|
|
549
|
-
"error",
|
|
550
|
-
"call",
|
|
551
|
-
"nextElement",
|
|
552
|
-
"previousElement"
|
|
553
|
-
];
|
|
554
|
-
var METHODS_EXL = [
|
|
555
|
-
...["node", "context", "extends", "__element", "__ref"],
|
|
556
|
-
...METHODS,
|
|
557
|
-
...STATE_METHODS,
|
|
558
|
-
...PROPS_METHODS
|
|
559
|
-
];
|
|
560
|
-
|
|
561
|
-
// ../../../domql/packages/utils/dist/esm/object.js
|
|
562
|
-
var __defProp2 = Object.defineProperty;
|
|
563
|
-
var __defProps = Object.defineProperties;
|
|
564
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
565
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
566
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
567
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
568
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
569
|
-
var __spreadValues = (a, b) => {
|
|
570
|
-
for (var prop in b || (b = {}))
|
|
571
|
-
if (__hasOwnProp2.call(b, prop))
|
|
572
|
-
__defNormalProp(a, prop, b[prop]);
|
|
573
|
-
if (__getOwnPropSymbols)
|
|
574
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
575
|
-
if (__propIsEnum.call(b, prop))
|
|
576
|
-
__defNormalProp(a, prop, b[prop]);
|
|
577
|
-
}
|
|
578
|
-
return a;
|
|
579
|
-
};
|
|
580
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
581
|
-
var deepMerge = (element, extend, excludeFrom = METHODS_EXL) => {
|
|
582
|
-
for (const e in extend) {
|
|
583
|
-
const hasOwnProperty2 = Object.prototype.hasOwnProperty.call(extend, e);
|
|
584
|
-
if (!hasOwnProperty2 || excludeFrom.includes(e) || e.startsWith("__")) {
|
|
585
|
-
continue;
|
|
586
|
-
}
|
|
587
|
-
const elementProp = element[e];
|
|
588
|
-
const extendProp = extend[e];
|
|
589
|
-
if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
|
|
590
|
-
deepMerge(elementProp, extendProp, excludeFrom);
|
|
591
|
-
} else if (elementProp === void 0) {
|
|
592
|
-
element[e] = extendProp;
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
return element;
|
|
596
|
-
};
|
|
597
|
-
var deepClone = (obj, options = {}) => {
|
|
598
|
-
const {
|
|
599
|
-
exclude = [],
|
|
600
|
-
cleanUndefined = false,
|
|
601
|
-
cleanNull = false,
|
|
602
|
-
window: targetWindow,
|
|
603
|
-
visited = /* @__PURE__ */ new WeakMap(),
|
|
604
|
-
handleExtends = false
|
|
605
|
-
} = options;
|
|
606
|
-
const contentWindow = targetWindow || window2 || globalThis;
|
|
607
|
-
if (!isObjectLike(obj) || isDOMNode(obj)) {
|
|
608
|
-
return obj;
|
|
609
|
-
}
|
|
610
|
-
if (visited.has(obj)) {
|
|
611
|
-
return visited.get(obj);
|
|
612
|
-
}
|
|
613
|
-
const clone2 = contentWindow ? isArray(obj) ? new contentWindow.Array() : new contentWindow.Object() : isArray(obj) ? [] : {};
|
|
614
|
-
visited.set(obj, clone2);
|
|
615
|
-
for (const key in obj) {
|
|
616
|
-
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
617
|
-
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__") {
|
|
618
|
-
continue;
|
|
619
|
-
}
|
|
620
|
-
const value = obj[key];
|
|
621
|
-
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value)) {
|
|
622
|
-
continue;
|
|
623
|
-
}
|
|
624
|
-
if (isDOMNode(value)) {
|
|
625
|
-
clone2[key] = value;
|
|
626
|
-
continue;
|
|
627
|
-
}
|
|
628
|
-
if (handleExtends && key === "extends" && isArray(value)) {
|
|
629
|
-
clone2[key] = unstackArrayOfObjects(value, exclude);
|
|
630
|
-
continue;
|
|
631
|
-
}
|
|
632
|
-
if (isFunction(value) && options.window) {
|
|
633
|
-
clone2[key] = contentWindow.eval("(" + value.toString() + ")");
|
|
634
|
-
continue;
|
|
635
|
-
}
|
|
636
|
-
if (isObjectLike(value)) {
|
|
637
|
-
clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
|
|
638
|
-
visited
|
|
639
|
-
}));
|
|
640
|
-
} else {
|
|
641
|
-
clone2[key] = value;
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
return clone2;
|
|
645
|
-
};
|
|
646
|
-
|
|
647
|
-
// ../../../domql/packages/utils/dist/esm/cookie.js
|
|
648
|
-
var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
|
|
649
|
-
|
|
650
|
-
// ../../../domql/packages/event/dist/esm/keys.js
|
|
651
|
-
var STATE_METHODS2 = [
|
|
652
|
-
"update",
|
|
653
|
-
"parse",
|
|
654
|
-
"clean",
|
|
655
|
-
"create",
|
|
656
|
-
"destroy",
|
|
657
|
-
"add",
|
|
658
|
-
"toggle",
|
|
659
|
-
"remove",
|
|
660
|
-
"apply",
|
|
661
|
-
"set",
|
|
662
|
-
"reset",
|
|
663
|
-
"replace",
|
|
664
|
-
"quietReplace",
|
|
665
|
-
"quietUpdate",
|
|
666
|
-
"applyReplace",
|
|
667
|
-
"applyFunction",
|
|
668
|
-
"keys",
|
|
669
|
-
"values",
|
|
670
|
-
"ref",
|
|
671
|
-
"rootUpdate",
|
|
672
|
-
"parentUpdate",
|
|
673
|
-
"parent",
|
|
674
|
-
"__element",
|
|
675
|
-
"__depends",
|
|
676
|
-
"__ref",
|
|
677
|
-
"__children",
|
|
678
|
-
"root",
|
|
679
|
-
"setByPath",
|
|
680
|
-
"setPathCollection",
|
|
681
|
-
"removeByPath",
|
|
682
|
-
"removePathCollection",
|
|
683
|
-
"getByPath"
|
|
684
|
-
];
|
|
685
|
-
var PROPS_METHODS2 = ["update", "__element"];
|
|
686
|
-
var METHODS2 = [
|
|
687
|
-
"set",
|
|
688
|
-
"reset",
|
|
689
|
-
"update",
|
|
690
|
-
"remove",
|
|
691
|
-
"updateContent",
|
|
692
|
-
"removeContent",
|
|
693
|
-
"lookup",
|
|
694
|
-
"lookdown",
|
|
695
|
-
"lookdownAll",
|
|
696
|
-
"getRef",
|
|
697
|
-
"getPath",
|
|
698
|
-
"setNodeStyles",
|
|
699
|
-
"spotByPath",
|
|
700
|
-
"keys",
|
|
701
|
-
"parse",
|
|
702
|
-
"setProps",
|
|
703
|
-
"parseDeep",
|
|
704
|
-
"variables",
|
|
705
|
-
"if",
|
|
706
|
-
"log",
|
|
707
|
-
"verbose",
|
|
708
|
-
"warn",
|
|
709
|
-
"error",
|
|
710
|
-
"call",
|
|
711
|
-
"nextElement",
|
|
712
|
-
"previousElement"
|
|
713
|
-
];
|
|
714
|
-
var METHODS_EXL2 = [
|
|
715
|
-
...["node", "context", "extends", "__element", "__ref"],
|
|
716
|
-
...METHODS2,
|
|
717
|
-
...STATE_METHODS2,
|
|
718
|
-
...PROPS_METHODS2
|
|
719
|
-
];
|
|
720
|
-
|
|
721
|
-
// ../../../domql/packages/event/dist/esm/globals.js
|
|
722
|
-
var window3 = globalThis;
|
|
723
|
-
var document3 = window3.document;
|
|
724
|
-
|
|
725
|
-
// src/defaultConfig/index.js
|
|
726
|
-
var defaultConfig_exports = {};
|
|
727
|
-
__export(defaultConfig_exports, {
|
|
728
|
-
ANIMATION: () => ANIMATION,
|
|
729
|
-
BREAKPOINTS: () => BREAKPOINTS,
|
|
730
|
-
CASES: () => CASES,
|
|
731
|
-
CLASS: () => CLASS,
|
|
732
|
-
COLOR: () => COLOR,
|
|
733
|
-
DEVICES: () => DEVICES,
|
|
734
|
-
DOCUMENT: () => DOCUMENT,
|
|
735
|
-
FONT: () => FONT,
|
|
736
|
-
FONT_FACE: () => FONT_FACE,
|
|
737
|
-
FONT_FAMILY: () => FONT_FAMILY,
|
|
738
|
-
FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
|
|
739
|
-
GRADIENT: () => GRADIENT,
|
|
740
|
-
GRID: () => GRID,
|
|
741
|
-
ICONS: () => ICONS,
|
|
742
|
-
MEDIA: () => MEDIA,
|
|
743
|
-
RESET: () => RESET,
|
|
744
|
-
SEMANTIC_ICONS: () => SEMANTIC_ICONS,
|
|
745
|
-
SEQUENCE: () => SEQUENCE,
|
|
746
|
-
SHADOW: () => SHADOW,
|
|
747
|
-
SPACING: () => SPACING,
|
|
748
|
-
SVG: () => SVG,
|
|
749
|
-
SVG_DATA: () => SVG_DATA,
|
|
750
|
-
TEMPLATES: () => TEMPLATES,
|
|
751
|
-
THEME: () => THEME,
|
|
752
|
-
TIMING: () => TIMING,
|
|
753
|
-
TYPOGRAPHY: () => TYPOGRAPHY,
|
|
754
|
-
UNIT: () => UNIT
|
|
755
|
-
});
|
|
756
|
-
|
|
757
|
-
// src/defaultConfig/sequence.js
|
|
758
|
-
var SEQUENCE = {
|
|
759
|
-
"minor-second": 1.067,
|
|
760
|
-
"major-second": 1.125,
|
|
761
|
-
"minor-third": 1.2,
|
|
762
|
-
"major-third": 1.25,
|
|
763
|
-
"perfect-fourth": 1.333,
|
|
764
|
-
"augmented-fourth": 1.414,
|
|
765
|
-
"perfect-fifth": 1.5,
|
|
766
|
-
"minor-sixth": 1.6,
|
|
767
|
-
phi: 1.618,
|
|
768
|
-
// golden-ratio
|
|
769
|
-
"major-sixth": 1.667,
|
|
770
|
-
"square-root-3": 1.732,
|
|
771
|
-
// theodorus
|
|
772
|
-
"minor-seventh": 1.778,
|
|
773
|
-
"major-seventh": 1.875,
|
|
774
|
-
octave: 2,
|
|
775
|
-
"square-root-5": 2.23,
|
|
776
|
-
// pythagoras
|
|
777
|
-
"major-tenth": 2.5,
|
|
778
|
-
"major-eleventh": 2.667,
|
|
779
|
-
"major-twelfth": 3,
|
|
780
|
-
pi: 3.14,
|
|
781
|
-
// archimedes
|
|
782
|
-
"double-octave": 4
|
|
783
|
-
};
|
|
784
|
-
|
|
785
|
-
// src/defaultConfig/unit.js
|
|
786
|
-
var UNIT = {
|
|
787
|
-
default: "em"
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
// src/defaultConfig/typography.js
|
|
791
|
-
var defaultProps = {
|
|
792
|
-
browserDefault: 16,
|
|
793
|
-
base: 16,
|
|
794
|
-
type: "font-size",
|
|
795
|
-
ratio: SEQUENCE["minor-third"],
|
|
796
|
-
range: [-3, 12],
|
|
797
|
-
h1Matches: 6,
|
|
798
|
-
lineHeight: 1.5,
|
|
799
|
-
subSequence: true,
|
|
800
|
-
mediaRegenerate: false,
|
|
801
|
-
unit: "em",
|
|
802
|
-
templates: {},
|
|
803
|
-
sequence: {},
|
|
804
|
-
scales: {},
|
|
805
|
-
vars: {}
|
|
806
|
-
};
|
|
807
|
-
var TYPOGRAPHY = defaultProps;
|
|
808
|
-
|
|
809
|
-
// src/defaultConfig/font.js
|
|
810
|
-
var FONT = {};
|
|
811
|
-
|
|
812
|
-
// src/defaultConfig/font-family.js
|
|
813
|
-
var FONT_FAMILY = {};
|
|
814
|
-
var FONT_FAMILY_TYPES = {
|
|
815
|
-
"sans-serif": "Helvetica, Arial, sans-serif, --system-default",
|
|
816
|
-
serif: "Times New Roman, Georgia, serif, --system-default",
|
|
817
|
-
monospace: "Courier New, monospace, --system-default"
|
|
818
|
-
};
|
|
819
|
-
var FONT_FACE = {};
|
|
820
|
-
|
|
821
|
-
// src/defaultConfig/media.js
|
|
822
|
-
var MEDIA = {
|
|
823
|
-
tv: "(min-width: 2780px)",
|
|
824
|
-
light: "(prefers-color-scheme: light)",
|
|
825
|
-
dark: "(prefers-color-scheme: dark)",
|
|
826
|
-
print: "print"
|
|
827
|
-
};
|
|
828
|
-
|
|
829
|
-
// src/defaultConfig/spacing.js
|
|
830
|
-
var defaultProps2 = {
|
|
831
|
-
base: TYPOGRAPHY.base,
|
|
832
|
-
type: "spacing",
|
|
833
|
-
ratio: SEQUENCE.phi,
|
|
834
|
-
range: [-5, 15],
|
|
835
|
-
subSequence: true,
|
|
836
|
-
mediaRegenerate: false,
|
|
837
|
-
unit: "em",
|
|
838
|
-
sequence: {},
|
|
839
|
-
scales: {},
|
|
840
|
-
vars: {}
|
|
841
|
-
};
|
|
842
|
-
var SPACING = defaultProps2;
|
|
843
|
-
|
|
844
|
-
// src/defaultConfig/color.js
|
|
845
|
-
var COLOR = {};
|
|
846
|
-
var GRADIENT = {};
|
|
847
|
-
|
|
848
|
-
// src/defaultConfig/theme.js
|
|
849
|
-
var THEME = {};
|
|
850
|
-
|
|
851
|
-
// src/defaultConfig/shadow.js
|
|
852
|
-
var SHADOW = {};
|
|
853
|
-
|
|
854
|
-
// src/defaultConfig/icons.js
|
|
855
|
-
var ICONS = {};
|
|
856
|
-
var SEMANTIC_ICONS = {};
|
|
857
|
-
|
|
858
|
-
// src/defaultConfig/timing.js
|
|
859
|
-
var defaultProps3 = {
|
|
860
|
-
default: 150,
|
|
861
|
-
base: 150,
|
|
862
|
-
type: "timing",
|
|
863
|
-
ratio: SEQUENCE["perfect-fourth"],
|
|
864
|
-
range: [-3, 12],
|
|
865
|
-
mediaRegenerate: false,
|
|
866
|
-
unit: "ms",
|
|
867
|
-
sequence: {},
|
|
868
|
-
scales: {},
|
|
869
|
-
vars: {}
|
|
870
|
-
};
|
|
871
|
-
var TIMING = defaultProps3;
|
|
872
|
-
|
|
873
|
-
// src/defaultConfig/document.js
|
|
874
|
-
var DOCUMENT = {};
|
|
875
|
-
|
|
876
|
-
// src/defaultConfig/responsive.js
|
|
877
|
-
var BREAKPOINTS = {
|
|
878
|
-
screenL: 1920,
|
|
879
|
-
screenM: 1680,
|
|
880
|
-
screenS: 1440,
|
|
881
|
-
tabletL: 1366,
|
|
882
|
-
tabletM: 1280,
|
|
883
|
-
tabletS: 1024,
|
|
884
|
-
mobileL: 768,
|
|
885
|
-
mobileM: 560,
|
|
886
|
-
mobileS: 480,
|
|
887
|
-
mobileXS: 375
|
|
888
|
-
};
|
|
889
|
-
var DEVICES = {
|
|
890
|
-
screenXXL: [2560, 1440],
|
|
891
|
-
screenXL: [2240, 1260],
|
|
892
|
-
screenL: [1920, 1024],
|
|
893
|
-
screenM: [1680, 1024],
|
|
894
|
-
screenS: [1440, 720],
|
|
895
|
-
tabletL: [1366, 926],
|
|
896
|
-
tabletM: [1280, 768],
|
|
897
|
-
tabletS: [1024, 768],
|
|
898
|
-
mobileL: [768, 375],
|
|
899
|
-
mobileM: [560, 768],
|
|
900
|
-
mobileS: [480, 768],
|
|
901
|
-
mobileXS: [375, 768]
|
|
902
|
-
};
|
|
903
|
-
|
|
904
|
-
// src/defaultConfig/cases.js
|
|
905
|
-
var CASES = {};
|
|
906
|
-
|
|
907
|
-
// src/defaultConfig/animation.js
|
|
908
|
-
var ANIMATION = {};
|
|
909
|
-
|
|
910
|
-
// src/defaultConfig/svg.js
|
|
911
|
-
var SVG = {};
|
|
912
|
-
var SVG_DATA = {};
|
|
913
|
-
|
|
914
|
-
// src/defaultConfig/templates.js
|
|
915
|
-
var TEMPLATES = {};
|
|
916
|
-
|
|
917
|
-
// src/defaultConfig/grid.js
|
|
918
|
-
var defaultProps4 = {};
|
|
919
|
-
var GRID = defaultProps4;
|
|
920
|
-
|
|
921
|
-
// src/defaultConfig/class.js
|
|
922
|
-
var defaultProps5 = {};
|
|
923
|
-
var CLASS = defaultProps5;
|
|
924
|
-
|
|
925
|
-
// src/defaultConfig/index.js
|
|
926
|
-
var RESET = {};
|
|
927
|
-
|
|
928
|
-
// src/factory.js
|
|
929
|
-
var CSS_VARS = {};
|
|
930
|
-
var CONFIG = {
|
|
931
|
-
verbose: false,
|
|
932
|
-
useVariable: true,
|
|
933
|
-
useReset: true,
|
|
934
|
-
CSS_VARS,
|
|
935
|
-
...void 0 || defaultConfig_exports
|
|
936
|
-
};
|
|
937
|
-
var cachedConfig = deepClone(CONFIG);
|
|
938
|
-
var FACTORY = {
|
|
939
|
-
active: "0",
|
|
940
|
-
0: CONFIG
|
|
941
|
-
};
|
|
942
|
-
var getActiveConfig = (def) => {
|
|
943
|
-
return FACTORY[def || FACTORY.active] || CONFIG;
|
|
944
|
-
};
|
|
945
|
-
|
|
946
|
-
// src/utils/sequence.js
|
|
947
|
-
var import_utils4 = __toESM(require_cjs(), 1);
|
|
948
|
-
|
|
949
|
-
// src/utils/unit.js
|
|
950
|
-
var isScalingUnit = (unit) => {
|
|
951
|
-
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
952
|
-
};
|
|
953
|
-
|
|
954
|
-
// src/utils/sequence.js
|
|
955
|
-
var getSubratioDifference = (base, ratio) => {
|
|
956
|
-
const diff = base * ratio - base;
|
|
957
|
-
const subRatio = diff / 1.618;
|
|
958
|
-
const first = base * ratio - subRatio;
|
|
959
|
-
const second = base + subRatio;
|
|
960
|
-
const middle = (first + second) / 2;
|
|
961
|
-
return [first, middle, second];
|
|
962
|
-
};
|
|
963
|
-
var getSubratio = (base, ratio) => {
|
|
964
|
-
return getSubratioDifference(base, ratio).map((v) => v / base);
|
|
965
|
-
};
|
|
966
|
-
|
|
967
|
-
// src/utils/var.js
|
|
968
|
-
var setVariables = (result, key) => {
|
|
969
|
-
const CONFIG2 = getActiveConfig();
|
|
970
|
-
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
971
|
-
if (isObjectLike(result.value)) {
|
|
972
|
-
} else {
|
|
973
|
-
CSS_VARS2[result.var] = result.value;
|
|
974
|
-
}
|
|
975
|
-
};
|
|
976
|
-
var applySequenceGlobalVars = (vars, obj, options) => {
|
|
977
|
-
const CONFIG2 = getActiveConfig();
|
|
978
|
-
const { UNIT: UNIT2 } = CONFIG2;
|
|
979
|
-
const unit = obj.unit || UNIT2.default;
|
|
980
|
-
const { base, ratio, type } = obj;
|
|
981
|
-
const prefix = "--" + (type && type.replace(".", "-"));
|
|
982
|
-
vars[`${prefix}-base`] = base;
|
|
983
|
-
vars[`${prefix}-unit`] = unit;
|
|
984
|
-
const ratioVar = `${prefix}-ratio`;
|
|
985
|
-
vars[ratioVar] = ratio;
|
|
986
|
-
const [first, middle, second] = getSubratio(base, ratio);
|
|
987
|
-
vars[`${prefix}-sub-ratio-1`] = `calc(var(${prefix}-ratio) * ${first / ratio})`;
|
|
988
|
-
vars[`${prefix}-sub-ratio-2`] = `calc(var(${prefix}-ratio) * ${middle / ratio})`;
|
|
989
|
-
vars[`${prefix}-sub-ratio-3`] = `calc(var(${prefix}-ratio) * ${second / ratio})`;
|
|
990
|
-
};
|
|
991
|
-
var applySequenceVars = (FACTORY2, options = {}) => {
|
|
992
|
-
const CONFIG2 = getActiveConfig();
|
|
993
|
-
const { UNIT: UNIT2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
994
|
-
const unit = FACTORY2.unit || UNIT2.default;
|
|
995
|
-
const { mediaRegenerate, sequence, scales } = FACTORY2;
|
|
996
|
-
if (!mediaRegenerate) {
|
|
997
|
-
applySequenceGlobalVars(CSS_VARS2, FACTORY2, options);
|
|
998
|
-
}
|
|
999
|
-
for (const key in sequence) {
|
|
1000
|
-
const item = sequence[key];
|
|
1001
|
-
const value = (FACTORY2.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
|
|
1002
|
-
if (!mediaRegenerate) {
|
|
1003
|
-
CSS_VARS2[item.variable + "_default"] = value;
|
|
1004
|
-
CSS_VARS2[item.variable] = item.scalingVariable;
|
|
1005
|
-
continue;
|
|
1006
|
-
}
|
|
1007
|
-
if (options.useDefault === false) {
|
|
1008
|
-
CSS_VARS2[item.variable] = value;
|
|
1009
|
-
} else {
|
|
1010
|
-
CSS_VARS2[item.variable + "_default"] = value;
|
|
1011
|
-
CSS_VARS2[item.variable] = `var(${item.variable + "_default"})`;
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
};
|
|
1015
|
-
var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
1016
|
-
const CONFIG2 = getActiveConfig();
|
|
1017
|
-
const { UNIT: UNIT2, MEDIA: MEDIA2, CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
1018
|
-
const mediaName = media.slice(1);
|
|
1019
|
-
const unit = FACTORY2.unit || UNIT2.default;
|
|
1020
|
-
const { mediaRegenerate } = FACTORY2;
|
|
1021
|
-
const { sequence, scales } = FACTORY2[media];
|
|
1022
|
-
const query = MEDIA2[mediaName];
|
|
1023
|
-
if (!query && CONFIG2.verbose) console.warn("Can't find media query ", query);
|
|
1024
|
-
if (!mediaRegenerate) {
|
|
1025
|
-
let underMediaQuery = CSS_VARS2[`@media ${query}`];
|
|
1026
|
-
if (!underMediaQuery) underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
|
|
1027
|
-
applySequenceGlobalVars(underMediaQuery, FACTORY2[media], options);
|
|
1028
|
-
return;
|
|
1029
|
-
}
|
|
1030
|
-
for (const key in sequence) {
|
|
1031
|
-
const item = sequence[key];
|
|
1032
|
-
const value = (isScalingUnit(unit) ? scales[key] : sequence[key].val) + unit;
|
|
1033
|
-
if (!query && CONFIG2.verbose) console.warn("Can't find query ", query);
|
|
1034
|
-
let underMediaQuery = CSS_VARS2[`@media ${query}`];
|
|
1035
|
-
if (!underMediaQuery) underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
|
|
1036
|
-
underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
|
|
1037
|
-
CSS_VARS2[item.variable + "_" + mediaName] = value;
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
// @preserve-env
|