@symbo.ls/scratch 2.10.224 → 2.10.225
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/animation.js +3 -1
- package/dist/cjs/defaultConfig/cases.js +3 -1
- package/dist/cjs/defaultConfig/color.js +4 -8
- package/dist/cjs/defaultConfig/document.js +3 -1
- package/dist/cjs/defaultConfig/font-family.js +5 -9
- package/dist/cjs/defaultConfig/font.js +3 -10
- package/dist/cjs/defaultConfig/icons.js +3 -1
- package/dist/cjs/defaultConfig/index.js +184 -19
- package/dist/cjs/defaultConfig/media.js +3 -1
- package/dist/cjs/defaultConfig/responsive.js +4 -2
- package/dist/cjs/defaultConfig/sequence.js +3 -1
- package/dist/cjs/defaultConfig/spacing.js +53 -6
- package/dist/cjs/defaultConfig/svg.js +4 -2
- package/dist/cjs/defaultConfig/theme.js +3 -13
- package/dist/cjs/defaultConfig/timing.js +35 -4
- package/dist/cjs/defaultConfig/typography.js +35 -4
- package/dist/cjs/defaultConfig/unit.js +3 -1
- package/dist/cjs/factory.js +999 -10
- package/dist/cjs/index.js +2462 -6
- package/dist/cjs/set.js +2172 -45
- package/dist/cjs/system/color.js +1162 -44
- package/dist/cjs/system/document.js +1062 -11
- package/dist/cjs/system/font.js +1093 -17
- package/dist/cjs/system/index.js +2136 -10
- package/dist/cjs/system/reset.js +1131 -20
- package/dist/cjs/system/spacing.js +1274 -33
- package/dist/cjs/system/svg.js +1104 -25
- package/dist/cjs/system/theme.js +1187 -68
- package/dist/cjs/system/timing.js +1255 -19
- package/dist/cjs/system/typography.js +1270 -28
- package/dist/cjs/tests/index.js +4 -2
- package/dist/cjs/utils/color.js +68 -16
- package/dist/cjs/utils/font.js +11 -9
- package/dist/cjs/utils/index.js +1508 -7
- package/dist/cjs/utils/sequence.js +1051 -19
- package/dist/cjs/utils/sprite.js +815 -4
- package/dist/cjs/utils/theme.js +3 -1
- package/dist/cjs/utils/var.js +1044 -21
- package/package.json +3 -3
- package/src/index.js +4 -0
- package/src/utils/color.js +3 -0
package/dist/cjs/system/theme.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
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
|
+
};
|
|
6
11
|
var __export = (target, all) => {
|
|
7
12
|
for (var name in all)
|
|
8
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -15,7 +20,813 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
20
|
}
|
|
16
21
|
return to;
|
|
17
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
|
+
));
|
|
18
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// ../../node_modules/@domql/globals/dist/cjs/index.js
|
|
34
|
+
var require_cjs = __commonJS({
|
|
35
|
+
"../../node_modules/@domql/globals/dist/cjs/index.js"(exports, module2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var __defProp2 = Object.defineProperty;
|
|
38
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
39
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
40
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
41
|
+
var __export2 = (target, all) => {
|
|
42
|
+
for (var name in all)
|
|
43
|
+
__defProp2(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 (!__hasOwnProp2.call(to, key) && key !== except)
|
|
49
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
50
|
+
}
|
|
51
|
+
return to;
|
|
52
|
+
};
|
|
53
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
54
|
+
var globals_exports = {};
|
|
55
|
+
__export2(globals_exports, {
|
|
56
|
+
document: () => document3,
|
|
57
|
+
global: () => global,
|
|
58
|
+
self: () => self,
|
|
59
|
+
window: () => window3
|
|
60
|
+
});
|
|
61
|
+
module2.exports = __toCommonJS2(globals_exports);
|
|
62
|
+
var global = globalThis;
|
|
63
|
+
var self = globalThis;
|
|
64
|
+
var window3 = globalThis;
|
|
65
|
+
var document3 = window3.document;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// ../../node_modules/@domql/tags/dist/cjs/htmlTags.js
|
|
70
|
+
var require_htmlTags = __commonJS({
|
|
71
|
+
"../../node_modules/@domql/tags/dist/cjs/htmlTags.js"(exports, module2) {
|
|
72
|
+
"use strict";
|
|
73
|
+
var __defProp2 = Object.defineProperty;
|
|
74
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
75
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
76
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
77
|
+
var __export2 = (target, all) => {
|
|
78
|
+
for (var name in all)
|
|
79
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
80
|
+
};
|
|
81
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
82
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
83
|
+
for (let key of __getOwnPropNames2(from))
|
|
84
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
85
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
86
|
+
}
|
|
87
|
+
return to;
|
|
88
|
+
};
|
|
89
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
90
|
+
var htmlTags_exports = {};
|
|
91
|
+
__export2(htmlTags_exports, {
|
|
92
|
+
HTML_TAGS: () => HTML_TAGS
|
|
93
|
+
});
|
|
94
|
+
module2.exports = __toCommonJS2(htmlTags_exports);
|
|
95
|
+
var HTML_TAGS = {
|
|
96
|
+
root: [
|
|
97
|
+
"body",
|
|
98
|
+
"html"
|
|
99
|
+
],
|
|
100
|
+
head: [
|
|
101
|
+
"title",
|
|
102
|
+
"base",
|
|
103
|
+
"meta",
|
|
104
|
+
"style"
|
|
105
|
+
],
|
|
106
|
+
body: [
|
|
107
|
+
"string",
|
|
108
|
+
"fragment",
|
|
109
|
+
"a",
|
|
110
|
+
"abbr",
|
|
111
|
+
"acronym",
|
|
112
|
+
"address",
|
|
113
|
+
"applet",
|
|
114
|
+
"area",
|
|
115
|
+
"article",
|
|
116
|
+
"aside",
|
|
117
|
+
"audio",
|
|
118
|
+
"b",
|
|
119
|
+
"basefont",
|
|
120
|
+
"bdi",
|
|
121
|
+
"bdo",
|
|
122
|
+
"big",
|
|
123
|
+
"blockquote",
|
|
124
|
+
"br",
|
|
125
|
+
"button",
|
|
126
|
+
"canvas",
|
|
127
|
+
"caption",
|
|
128
|
+
"center",
|
|
129
|
+
"cite",
|
|
130
|
+
"code",
|
|
131
|
+
"col",
|
|
132
|
+
"colgroup",
|
|
133
|
+
"data",
|
|
134
|
+
"datalist",
|
|
135
|
+
"dd",
|
|
136
|
+
"del",
|
|
137
|
+
"details",
|
|
138
|
+
"dfn",
|
|
139
|
+
"dialog",
|
|
140
|
+
"dir",
|
|
141
|
+
"div",
|
|
142
|
+
"dl",
|
|
143
|
+
"dt",
|
|
144
|
+
"em",
|
|
145
|
+
"embed",
|
|
146
|
+
"fieldset",
|
|
147
|
+
"figcaption",
|
|
148
|
+
"figure",
|
|
149
|
+
"font",
|
|
150
|
+
"footer",
|
|
151
|
+
"form",
|
|
152
|
+
"frame",
|
|
153
|
+
"frameset",
|
|
154
|
+
"h1",
|
|
155
|
+
"h2",
|
|
156
|
+
"h3",
|
|
157
|
+
"h4",
|
|
158
|
+
"h5",
|
|
159
|
+
"h6",
|
|
160
|
+
"head",
|
|
161
|
+
"header",
|
|
162
|
+
"hr",
|
|
163
|
+
"i",
|
|
164
|
+
"iframe",
|
|
165
|
+
"img",
|
|
166
|
+
"input",
|
|
167
|
+
"ins",
|
|
168
|
+
"kbd",
|
|
169
|
+
"label",
|
|
170
|
+
"legend",
|
|
171
|
+
"li",
|
|
172
|
+
"link",
|
|
173
|
+
"main",
|
|
174
|
+
"map",
|
|
175
|
+
"mark",
|
|
176
|
+
"meter",
|
|
177
|
+
"nav",
|
|
178
|
+
"noframes",
|
|
179
|
+
"noscript",
|
|
180
|
+
"object",
|
|
181
|
+
"ol",
|
|
182
|
+
"optgroup",
|
|
183
|
+
"option",
|
|
184
|
+
"output",
|
|
185
|
+
"p",
|
|
186
|
+
"param",
|
|
187
|
+
"picture",
|
|
188
|
+
"pre",
|
|
189
|
+
"progress",
|
|
190
|
+
"q",
|
|
191
|
+
"rp",
|
|
192
|
+
"rt",
|
|
193
|
+
"ruby",
|
|
194
|
+
"s",
|
|
195
|
+
"samp",
|
|
196
|
+
"script",
|
|
197
|
+
"section",
|
|
198
|
+
"select",
|
|
199
|
+
"small",
|
|
200
|
+
"source",
|
|
201
|
+
"span",
|
|
202
|
+
"strike",
|
|
203
|
+
"strong",
|
|
204
|
+
"sub",
|
|
205
|
+
"summary",
|
|
206
|
+
"sup",
|
|
207
|
+
"table",
|
|
208
|
+
"tbody",
|
|
209
|
+
"td",
|
|
210
|
+
"template",
|
|
211
|
+
"textarea",
|
|
212
|
+
"tfoot",
|
|
213
|
+
"th",
|
|
214
|
+
"thead",
|
|
215
|
+
"time",
|
|
216
|
+
"tr",
|
|
217
|
+
"track",
|
|
218
|
+
"tt",
|
|
219
|
+
"u",
|
|
220
|
+
"ul",
|
|
221
|
+
"var",
|
|
222
|
+
"video",
|
|
223
|
+
"wbr",
|
|
224
|
+
// SVG
|
|
225
|
+
"svg",
|
|
226
|
+
"path"
|
|
227
|
+
]
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// ../../node_modules/@domql/tags/dist/cjs/index.js
|
|
233
|
+
var require_cjs2 = __commonJS({
|
|
234
|
+
"../../node_modules/@domql/tags/dist/cjs/index.js"(exports, module2) {
|
|
235
|
+
"use strict";
|
|
236
|
+
var __defProp2 = Object.defineProperty;
|
|
237
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
238
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
239
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
240
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
241
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
242
|
+
for (let key of __getOwnPropNames2(from))
|
|
243
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
244
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
245
|
+
}
|
|
246
|
+
return to;
|
|
247
|
+
};
|
|
248
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
|
|
249
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
250
|
+
var tags_exports = {};
|
|
251
|
+
module2.exports = __toCommonJS2(tags_exports);
|
|
252
|
+
__reExport(tags_exports, require_htmlTags(), module2.exports);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
// ../../node_modules/@domql/utils/dist/cjs/types.js
|
|
257
|
+
var require_types = __commonJS({
|
|
258
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
|
|
259
|
+
"use strict";
|
|
260
|
+
var __defProp2 = Object.defineProperty;
|
|
261
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
262
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
263
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
264
|
+
var __export2 = (target, all) => {
|
|
265
|
+
for (var name in all)
|
|
266
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
267
|
+
};
|
|
268
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
269
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
270
|
+
for (let key of __getOwnPropNames2(from))
|
|
271
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
272
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
273
|
+
}
|
|
274
|
+
return to;
|
|
275
|
+
};
|
|
276
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
277
|
+
var types_exports = {};
|
|
278
|
+
__export2(types_exports, {
|
|
279
|
+
TYPES: () => TYPES,
|
|
280
|
+
is: () => is,
|
|
281
|
+
isArray: () => isArray5,
|
|
282
|
+
isBoolean: () => isBoolean,
|
|
283
|
+
isDefined: () => isDefined2,
|
|
284
|
+
isFunction: () => isFunction,
|
|
285
|
+
isHtmlElement: () => isHtmlElement,
|
|
286
|
+
isNode: () => isNode,
|
|
287
|
+
isNot: () => isNot,
|
|
288
|
+
isNull: () => isNull,
|
|
289
|
+
isNumber: () => isNumber,
|
|
290
|
+
isObject: () => isObject5,
|
|
291
|
+
isObjectLike: () => isObjectLike3,
|
|
292
|
+
isString: () => isString6,
|
|
293
|
+
isUndefined: () => isUndefined,
|
|
294
|
+
isValidHtmlTag: () => isValidHtmlTag
|
|
295
|
+
});
|
|
296
|
+
module2.exports = __toCommonJS2(types_exports);
|
|
297
|
+
var import_globals2 = require_cjs();
|
|
298
|
+
var import_tags = require_cjs2();
|
|
299
|
+
var isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.indexOf(arg);
|
|
300
|
+
var isObject5 = (arg) => {
|
|
301
|
+
if (arg === null)
|
|
302
|
+
return false;
|
|
303
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
304
|
+
};
|
|
305
|
+
var isString6 = (arg) => typeof arg === "string";
|
|
306
|
+
var isNumber = (arg) => typeof arg === "number";
|
|
307
|
+
var isFunction = (arg) => typeof arg === "function";
|
|
308
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
309
|
+
var isNull = (arg) => arg === null;
|
|
310
|
+
var isArray5 = (arg) => Array.isArray(arg);
|
|
311
|
+
var isObjectLike3 = (arg) => {
|
|
312
|
+
if (arg === null)
|
|
313
|
+
return false;
|
|
314
|
+
return typeof arg === "object";
|
|
315
|
+
};
|
|
316
|
+
var isNode = (obj) => {
|
|
317
|
+
return typeof import_globals2.window.Node === "object" ? obj instanceof import_globals2.window.Node : obj && typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string";
|
|
318
|
+
};
|
|
319
|
+
var isHtmlElement = (obj) => {
|
|
320
|
+
return typeof import_globals2.window.HTMLElement === "object" ? obj instanceof import_globals2.window.HTMLElement : obj && typeof obj === "object" && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === "string";
|
|
321
|
+
};
|
|
322
|
+
var isDefined2 = (arg) => {
|
|
323
|
+
return isObject5(arg) || isObjectLike3(arg) || isString6(arg) || isNumber(arg) || isFunction(arg) || isArray5(arg) || isObjectLike3(arg) || isBoolean(arg) || isNull(arg);
|
|
324
|
+
};
|
|
325
|
+
var isUndefined = (arg) => {
|
|
326
|
+
return arg === void 0;
|
|
327
|
+
};
|
|
328
|
+
var TYPES = {
|
|
329
|
+
boolean: isBoolean,
|
|
330
|
+
array: isArray5,
|
|
331
|
+
object: isObject5,
|
|
332
|
+
string: isString6,
|
|
333
|
+
number: isNumber,
|
|
334
|
+
null: isNull,
|
|
335
|
+
function: isFunction,
|
|
336
|
+
objectLike: isObjectLike3,
|
|
337
|
+
node: isNode,
|
|
338
|
+
htmlElement: isHtmlElement,
|
|
339
|
+
defined: isDefined2
|
|
340
|
+
};
|
|
341
|
+
var is = (arg) => {
|
|
342
|
+
return (...args) => {
|
|
343
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
var isNot = (arg) => {
|
|
347
|
+
return (...args) => {
|
|
348
|
+
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
355
|
+
var require_object = __commonJS({
|
|
356
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
357
|
+
"use strict";
|
|
358
|
+
var __defProp2 = Object.defineProperty;
|
|
359
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
360
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
361
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
362
|
+
var __export2 = (target, all) => {
|
|
363
|
+
for (var name in all)
|
|
364
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
365
|
+
};
|
|
366
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
367
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
368
|
+
for (let key of __getOwnPropNames2(from))
|
|
369
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
370
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
371
|
+
}
|
|
372
|
+
return to;
|
|
373
|
+
};
|
|
374
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
375
|
+
var object_exports = {};
|
|
376
|
+
__export2(object_exports, {
|
|
377
|
+
clone: () => clone,
|
|
378
|
+
deepClone: () => deepClone2,
|
|
379
|
+
deepCloneExclude: () => deepCloneExclude,
|
|
380
|
+
deepDestringify: () => deepDestringify,
|
|
381
|
+
deepMerge: () => deepMerge,
|
|
382
|
+
deepStringify: () => deepStringify,
|
|
383
|
+
diff: () => diff,
|
|
384
|
+
exec: () => exec,
|
|
385
|
+
flattenRecursive: () => flattenRecursive,
|
|
386
|
+
isEqualDeep: () => isEqualDeep,
|
|
387
|
+
map: () => map,
|
|
388
|
+
merge: () => merge,
|
|
389
|
+
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
390
|
+
mergeArray: () => mergeArray,
|
|
391
|
+
mergeArrayExclude: () => mergeArrayExclude,
|
|
392
|
+
mergeIfExisted: () => mergeIfExisted,
|
|
393
|
+
overwrite: () => overwrite,
|
|
394
|
+
overwriteDeep: () => overwriteDeep,
|
|
395
|
+
overwriteObj: () => overwriteObj
|
|
396
|
+
});
|
|
397
|
+
module2.exports = __toCommonJS2(object_exports);
|
|
398
|
+
var import_globals2 = require_cjs();
|
|
399
|
+
var import_types = require_types();
|
|
400
|
+
var exec = (param, element, state, context) => {
|
|
401
|
+
if ((0, import_types.isFunction)(param)) {
|
|
402
|
+
return param(
|
|
403
|
+
element,
|
|
404
|
+
state || element.state,
|
|
405
|
+
context || element.context
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
return param;
|
|
409
|
+
};
|
|
410
|
+
var map = (obj, extention, element) => {
|
|
411
|
+
for (const e in extention) {
|
|
412
|
+
obj[e] = exec(extention[e], element);
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
var merge = (element, obj) => {
|
|
416
|
+
for (const e in obj) {
|
|
417
|
+
const elementProp = element[e];
|
|
418
|
+
const objProp = obj[e];
|
|
419
|
+
if (elementProp === void 0) {
|
|
420
|
+
element[e] = objProp;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return element;
|
|
424
|
+
};
|
|
425
|
+
var deepMerge = (element, extend) => {
|
|
426
|
+
for (const e in extend) {
|
|
427
|
+
const extendProp = extend[e];
|
|
428
|
+
if (e === "parent" || e === "props")
|
|
429
|
+
continue;
|
|
430
|
+
if (element[e] === void 0) {
|
|
431
|
+
element[e] = extendProp;
|
|
432
|
+
} else if ((0, import_types.isObjectLike)(element[e]) && (0, import_types.isObjectLike)(extendProp)) {
|
|
433
|
+
deepMerge(element[e], extendProp);
|
|
434
|
+
} else {
|
|
435
|
+
element[e] = extendProp;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return element;
|
|
439
|
+
};
|
|
440
|
+
var clone = (obj) => {
|
|
441
|
+
const o = {};
|
|
442
|
+
for (const prop in obj) {
|
|
443
|
+
if (prop === "node")
|
|
444
|
+
continue;
|
|
445
|
+
o[prop] = obj[prop];
|
|
446
|
+
}
|
|
447
|
+
return o;
|
|
448
|
+
};
|
|
449
|
+
var deepCloneExclude = (obj, exclude = []) => {
|
|
450
|
+
if ((0, import_types.isArray)(obj)) {
|
|
451
|
+
return obj.map((x) => deepCloneExclude(x, exclude));
|
|
452
|
+
}
|
|
453
|
+
const o = {};
|
|
454
|
+
for (const k in obj) {
|
|
455
|
+
if (exclude.indexOf(k) > -1)
|
|
456
|
+
continue;
|
|
457
|
+
let v = obj[k];
|
|
458
|
+
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
459
|
+
v = mergeArrayExclude(v, exclude);
|
|
460
|
+
}
|
|
461
|
+
if ((0, import_types.isArray)(v)) {
|
|
462
|
+
o[k] = v.map((x) => deepCloneExclude(x, exclude));
|
|
463
|
+
} else if ((0, import_types.isObject)(v)) {
|
|
464
|
+
o[k] = deepCloneExclude(v, exclude);
|
|
465
|
+
} else
|
|
466
|
+
o[k] = v;
|
|
467
|
+
}
|
|
468
|
+
return o;
|
|
469
|
+
};
|
|
470
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
471
|
+
return arr.reduce((acc, curr) => deepMerge(acc, deepCloneExclude(curr, excl)), {});
|
|
472
|
+
};
|
|
473
|
+
var deepClone2 = (obj) => {
|
|
474
|
+
if ((0, import_types.isArray)(obj)) {
|
|
475
|
+
return obj.map(deepClone2);
|
|
476
|
+
}
|
|
477
|
+
const o = {};
|
|
478
|
+
for (const prop in obj) {
|
|
479
|
+
let objProp = obj[prop];
|
|
480
|
+
if (prop === "extend" && (0, import_types.isArray)(objProp)) {
|
|
481
|
+
objProp = mergeArray(objProp);
|
|
482
|
+
}
|
|
483
|
+
if ((0, import_types.isArray)(objProp)) {
|
|
484
|
+
o[prop] = objProp.map((v) => (0, import_types.isObject)(v) ? deepClone2(v) : v);
|
|
485
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
486
|
+
o[prop] = deepClone2(objProp);
|
|
487
|
+
} else
|
|
488
|
+
o[prop] = objProp;
|
|
489
|
+
}
|
|
490
|
+
return o;
|
|
491
|
+
};
|
|
492
|
+
var deepStringify = (obj, stringified = {}) => {
|
|
493
|
+
for (const prop in obj) {
|
|
494
|
+
const objProp = obj[prop];
|
|
495
|
+
if ((0, import_types.isFunction)(objProp)) {
|
|
496
|
+
stringified[prop] = objProp.toString();
|
|
497
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
498
|
+
stringified[prop] = {};
|
|
499
|
+
deepStringify(objProp, stringified[prop]);
|
|
500
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
501
|
+
stringified[prop] = [];
|
|
502
|
+
objProp.forEach((v, i) => {
|
|
503
|
+
if ((0, import_types.isObject)(v)) {
|
|
504
|
+
stringified[prop][i] = {};
|
|
505
|
+
deepStringify(v, stringified[prop][i]);
|
|
506
|
+
} else if ((0, import_types.isFunction)(v)) {
|
|
507
|
+
stringified[prop][i] = v.toString();
|
|
508
|
+
} else {
|
|
509
|
+
stringified[prop][i] = v;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
} else {
|
|
513
|
+
stringified[prop] = objProp;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return stringified;
|
|
517
|
+
};
|
|
518
|
+
var deepDestringify = (obj, stringified = {}) => {
|
|
519
|
+
for (const prop in obj) {
|
|
520
|
+
const objProp = obj[prop];
|
|
521
|
+
if ((0, import_types.isString)(objProp)) {
|
|
522
|
+
if (objProp.includes("=>") || objProp.includes("function") || objProp.startsWith("(")) {
|
|
523
|
+
try {
|
|
524
|
+
const evalProp = import_globals2.window.eval(`(${objProp})`);
|
|
525
|
+
stringified[prop] = evalProp;
|
|
526
|
+
} catch (e) {
|
|
527
|
+
if (e)
|
|
528
|
+
stringified[prop] = objProp;
|
|
529
|
+
}
|
|
530
|
+
} else {
|
|
531
|
+
stringified[prop] = objProp;
|
|
532
|
+
}
|
|
533
|
+
} else if ((0, import_types.isArray)(objProp)) {
|
|
534
|
+
stringified[prop] = [];
|
|
535
|
+
objProp.forEach((arrProp) => {
|
|
536
|
+
if ((0, import_types.isString)(arrProp)) {
|
|
537
|
+
if (arrProp.includes("=>") || arrProp.includes("function") || arrProp.startsWith("(")) {
|
|
538
|
+
try {
|
|
539
|
+
const evalProp = import_globals2.window.eval(`(${arrProp})`);
|
|
540
|
+
stringified[prop].push(evalProp);
|
|
541
|
+
} catch (e) {
|
|
542
|
+
if (e)
|
|
543
|
+
stringified[prop].push(arrProp);
|
|
544
|
+
}
|
|
545
|
+
} else {
|
|
546
|
+
stringified[prop].push(arrProp);
|
|
547
|
+
}
|
|
548
|
+
} else if ((0, import_types.isObject)(arrProp)) {
|
|
549
|
+
stringified[prop].push(deepDestringify(arrProp));
|
|
550
|
+
} else {
|
|
551
|
+
stringified[prop].push(arrProp);
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
} else if ((0, import_types.isObject)(objProp)) {
|
|
555
|
+
stringified[prop] = deepDestringify(objProp, stringified[prop]);
|
|
556
|
+
} else {
|
|
557
|
+
stringified[prop] = objProp;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return stringified;
|
|
561
|
+
};
|
|
562
|
+
var overwrite = (element, params, options) => {
|
|
563
|
+
const { ref } = element;
|
|
564
|
+
const changes = {};
|
|
565
|
+
for (const e in params) {
|
|
566
|
+
if (e === "props")
|
|
567
|
+
continue;
|
|
568
|
+
const elementProp = element[e];
|
|
569
|
+
const paramsProp = params[e];
|
|
570
|
+
if (paramsProp) {
|
|
571
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
572
|
+
ref[e] = paramsProp;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
return changes;
|
|
576
|
+
};
|
|
577
|
+
var diff = (obj, original, cache) => {
|
|
578
|
+
const changes = cache || {};
|
|
579
|
+
for (const e in obj) {
|
|
580
|
+
if (e === "ref")
|
|
581
|
+
continue;
|
|
582
|
+
const originalProp = original[e];
|
|
583
|
+
const objProp = obj[e];
|
|
584
|
+
if ((0, import_types.isObjectLike)(originalProp) && (0, import_types.isObjectLike)(objProp)) {
|
|
585
|
+
changes[e] = {};
|
|
586
|
+
diff(originalProp, objProp, changes[e]);
|
|
587
|
+
} else if (objProp !== void 0) {
|
|
588
|
+
changes[e] = objProp;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
return changes;
|
|
592
|
+
};
|
|
593
|
+
var overwriteObj = (params, obj) => {
|
|
594
|
+
const changes = {};
|
|
595
|
+
for (const e in params) {
|
|
596
|
+
const objProp = obj[e];
|
|
597
|
+
const paramsProp = params[e];
|
|
598
|
+
if (paramsProp) {
|
|
599
|
+
obj[e] = changes[e] = objProp;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
return changes;
|
|
603
|
+
};
|
|
604
|
+
var overwriteDeep = (params, obj) => {
|
|
605
|
+
for (const e in params) {
|
|
606
|
+
const objProp = obj[e];
|
|
607
|
+
const paramsProp = params[e];
|
|
608
|
+
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
609
|
+
overwriteDeep(paramsProp, objProp);
|
|
610
|
+
} else if (paramsProp !== void 0) {
|
|
611
|
+
obj[e] = paramsProp;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return obj;
|
|
615
|
+
};
|
|
616
|
+
var mergeIfExisted = (a, b) => {
|
|
617
|
+
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
618
|
+
return deepMerge(a, b);
|
|
619
|
+
return a || b;
|
|
620
|
+
};
|
|
621
|
+
var mergeArray = (arr) => {
|
|
622
|
+
return arr.reduce((a, c) => deepMerge(a, deepClone2(c)), {});
|
|
623
|
+
};
|
|
624
|
+
var mergeAndCloneIfArray = (obj) => {
|
|
625
|
+
return (0, import_types.isArray)(obj) ? mergeArray(obj) : deepClone2(obj);
|
|
626
|
+
};
|
|
627
|
+
var flattenRecursive = (param, prop, stack = []) => {
|
|
628
|
+
const objectized = mergeAndCloneIfArray(param);
|
|
629
|
+
stack.push(objectized);
|
|
630
|
+
const extendOfExtend = objectized[prop];
|
|
631
|
+
if (extendOfExtend)
|
|
632
|
+
flattenRecursive(extendOfExtend, prop, stack);
|
|
633
|
+
delete objectized[prop];
|
|
634
|
+
return stack;
|
|
635
|
+
};
|
|
636
|
+
var isEqualDeep = (param, element) => {
|
|
637
|
+
if (param === element)
|
|
638
|
+
return true;
|
|
639
|
+
if (!param || !element)
|
|
640
|
+
return false;
|
|
641
|
+
for (const prop in param) {
|
|
642
|
+
const paramProp = param[prop];
|
|
643
|
+
const elementProp = element[prop];
|
|
644
|
+
if ((0, import_types.isObjectLike)(paramProp)) {
|
|
645
|
+
const isEqual = isEqualDeep(paramProp, elementProp);
|
|
646
|
+
if (!isEqual)
|
|
647
|
+
return false;
|
|
648
|
+
} else {
|
|
649
|
+
const isEqual = paramProp === elementProp;
|
|
650
|
+
if (!isEqual)
|
|
651
|
+
return false;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
return true;
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
660
|
+
var require_function = __commonJS({
|
|
661
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
662
|
+
"use strict";
|
|
663
|
+
var __defProp2 = Object.defineProperty;
|
|
664
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
665
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
666
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
667
|
+
var __export2 = (target, all) => {
|
|
668
|
+
for (var name in all)
|
|
669
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
670
|
+
};
|
|
671
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
672
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
673
|
+
for (let key of __getOwnPropNames2(from))
|
|
674
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
675
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
676
|
+
}
|
|
677
|
+
return to;
|
|
678
|
+
};
|
|
679
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
680
|
+
var function_exports = {};
|
|
681
|
+
__export2(function_exports, {
|
|
682
|
+
debounce: () => debounce,
|
|
683
|
+
memoize: () => memoize
|
|
684
|
+
});
|
|
685
|
+
module2.exports = __toCommonJS2(function_exports);
|
|
686
|
+
var debounce = (element, func, timeout = 300) => {
|
|
687
|
+
let timer;
|
|
688
|
+
return (...args) => {
|
|
689
|
+
clearTimeout(timer);
|
|
690
|
+
timer = setTimeout(() => {
|
|
691
|
+
func.apply(element, args);
|
|
692
|
+
}, timeout);
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
var memoize = (fn) => {
|
|
696
|
+
const cache = {};
|
|
697
|
+
return (...args) => {
|
|
698
|
+
const n = args[0];
|
|
699
|
+
if (n in cache) {
|
|
700
|
+
return cache[n];
|
|
701
|
+
} else {
|
|
702
|
+
const result = fn(n);
|
|
703
|
+
cache[n] = result;
|
|
704
|
+
return result;
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
|
|
711
|
+
// ../../node_modules/@domql/utils/dist/cjs/array.js
|
|
712
|
+
var require_array = __commonJS({
|
|
713
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"() {
|
|
714
|
+
"use strict";
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
// ../../node_modules/@domql/utils/dist/cjs/node.js
|
|
719
|
+
var require_node = __commonJS({
|
|
720
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
|
|
721
|
+
"use strict";
|
|
722
|
+
var __defProp2 = Object.defineProperty;
|
|
723
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
724
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
725
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
726
|
+
var __export2 = (target, all) => {
|
|
727
|
+
for (var name in all)
|
|
728
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
729
|
+
};
|
|
730
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
731
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
732
|
+
for (let key of __getOwnPropNames2(from))
|
|
733
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
734
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
735
|
+
}
|
|
736
|
+
return to;
|
|
737
|
+
};
|
|
738
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
739
|
+
var node_exports = {};
|
|
740
|
+
__export2(node_exports, {
|
|
741
|
+
cleanWithNode: () => cleanWithNode,
|
|
742
|
+
createID: () => createID,
|
|
743
|
+
createSnapshotId: () => createSnapshotId
|
|
744
|
+
});
|
|
745
|
+
module2.exports = __toCommonJS2(node_exports);
|
|
746
|
+
var cleanWithNode = (extend) => delete extend.node && extend;
|
|
747
|
+
var createID = function() {
|
|
748
|
+
let index = 0;
|
|
749
|
+
function newId() {
|
|
750
|
+
index++;
|
|
751
|
+
return index;
|
|
752
|
+
}
|
|
753
|
+
return newId;
|
|
754
|
+
}();
|
|
755
|
+
var createSnapshotId = createID;
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
|
|
759
|
+
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
760
|
+
var require_log = __commonJS({
|
|
761
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
762
|
+
"use strict";
|
|
763
|
+
var __defProp2 = Object.defineProperty;
|
|
764
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
765
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
766
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
767
|
+
var __export2 = (target, all) => {
|
|
768
|
+
for (var name in all)
|
|
769
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
770
|
+
};
|
|
771
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
772
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
773
|
+
for (let key of __getOwnPropNames2(from))
|
|
774
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
775
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
776
|
+
}
|
|
777
|
+
return to;
|
|
778
|
+
};
|
|
779
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
780
|
+
var log_exports = {};
|
|
781
|
+
__export2(log_exports, {
|
|
782
|
+
logGroupIf: () => logGroupIf,
|
|
783
|
+
logIf: () => logIf
|
|
784
|
+
});
|
|
785
|
+
module2.exports = __toCommonJS2(log_exports);
|
|
786
|
+
var logIf = (bool, ...arg) => {
|
|
787
|
+
if (bool)
|
|
788
|
+
arg.map((v) => console.log(v));
|
|
789
|
+
};
|
|
790
|
+
var logGroupIf = (bool, key, ...arg) => {
|
|
791
|
+
if (bool) {
|
|
792
|
+
console.group(key);
|
|
793
|
+
arg.map((v) => console.log(v));
|
|
794
|
+
console.groupEnd(key);
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
|
|
800
|
+
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
801
|
+
var require_cjs3 = __commonJS({
|
|
802
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
803
|
+
"use strict";
|
|
804
|
+
var __defProp2 = Object.defineProperty;
|
|
805
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
806
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
807
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
808
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
809
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
810
|
+
for (let key of __getOwnPropNames2(from))
|
|
811
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
812
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
813
|
+
}
|
|
814
|
+
return to;
|
|
815
|
+
};
|
|
816
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps2(target, mod, "default"), secondTarget && __copyProps2(secondTarget, mod, "default"));
|
|
817
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
818
|
+
var utils_exports = {};
|
|
819
|
+
module2.exports = __toCommonJS2(utils_exports);
|
|
820
|
+
__reExport(utils_exports, require_types(), module2.exports);
|
|
821
|
+
__reExport(utils_exports, require_object(), module2.exports);
|
|
822
|
+
__reExport(utils_exports, require_function(), module2.exports);
|
|
823
|
+
__reExport(utils_exports, require_array(), module2.exports);
|
|
824
|
+
__reExport(utils_exports, require_node(), module2.exports);
|
|
825
|
+
__reExport(utils_exports, require_log(), module2.exports);
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
|
|
829
|
+
// src/system/theme.js
|
|
19
830
|
var theme_exports = {};
|
|
20
831
|
__export(theme_exports, {
|
|
21
832
|
getMediaTheme: () => getMediaTheme,
|
|
@@ -24,56 +835,376 @@ __export(theme_exports, {
|
|
|
24
835
|
setTheme: () => setTheme
|
|
25
836
|
});
|
|
26
837
|
module.exports = __toCommonJS(theme_exports);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var import_utils =
|
|
30
|
-
|
|
31
|
-
|
|
838
|
+
|
|
839
|
+
// src/factory.js
|
|
840
|
+
var import_utils = __toESM(require_cjs3(), 1);
|
|
841
|
+
|
|
842
|
+
// src/defaultConfig/index.js
|
|
843
|
+
var defaultConfig_exports = {};
|
|
844
|
+
__export(defaultConfig_exports, {
|
|
845
|
+
ANIMATION: () => ANIMATION,
|
|
846
|
+
BREAKPOINTS: () => BREAKPOINTS,
|
|
847
|
+
CASES: () => CASES,
|
|
848
|
+
COLOR: () => COLOR,
|
|
849
|
+
DEVICES: () => DEVICES,
|
|
850
|
+
DOCUMENT: () => DOCUMENT,
|
|
851
|
+
FONT: () => FONT,
|
|
852
|
+
FONT_FACE: () => FONT_FACE,
|
|
853
|
+
FONT_FAMILY: () => FONT_FAMILY,
|
|
854
|
+
FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
|
|
855
|
+
GRADIENT: () => GRADIENT,
|
|
856
|
+
ICONS: () => ICONS,
|
|
857
|
+
MEDIA: () => MEDIA,
|
|
858
|
+
RESET: () => RESET,
|
|
859
|
+
SEQUENCE: () => SEQUENCE,
|
|
860
|
+
SPACING: () => SPACING,
|
|
861
|
+
SVG: () => SVG,
|
|
862
|
+
SVG_DATA: () => SVG_DATA,
|
|
863
|
+
THEME: () => THEME,
|
|
864
|
+
TIMING: () => TIMING,
|
|
865
|
+
TYPOGRAPHY: () => TYPOGRAPHY,
|
|
866
|
+
UNIT: () => UNIT
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
// src/defaultConfig/sequence.js
|
|
870
|
+
var SEQUENCE = {
|
|
871
|
+
"minor-second": 1.067,
|
|
872
|
+
"major-second": 1.125,
|
|
873
|
+
"minor-third": 1.2,
|
|
874
|
+
"major-third": 1.25,
|
|
875
|
+
"perfect-fourth": 1.333,
|
|
876
|
+
"augmented-fourth": 1.414,
|
|
877
|
+
"perfect-fifth": 1.5,
|
|
878
|
+
"minor-sixth": 1.6,
|
|
879
|
+
phi: 1.618,
|
|
880
|
+
// golden-ratio
|
|
881
|
+
"major-sixth": 1.667,
|
|
882
|
+
"square-root-3": 1.732,
|
|
883
|
+
// theodorus
|
|
884
|
+
"minor-seventh": 1.778,
|
|
885
|
+
"major-seventh": 1.875,
|
|
886
|
+
octave: 2,
|
|
887
|
+
"square-root-5": 2.23,
|
|
888
|
+
// pythagoras
|
|
889
|
+
"major-tenth": 2.5,
|
|
890
|
+
"major-eleventh": 2.667,
|
|
891
|
+
"major-twelfth": 3,
|
|
892
|
+
pi: 3.14,
|
|
893
|
+
// archimedes
|
|
894
|
+
"double-octave": 4
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
// src/defaultConfig/unit.js
|
|
898
|
+
var UNIT = {
|
|
899
|
+
default: "em"
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
// src/defaultConfig/typography.js
|
|
903
|
+
var defaultProps = {
|
|
904
|
+
browserDefault: 16,
|
|
905
|
+
base: 16,
|
|
906
|
+
type: "font-size",
|
|
907
|
+
ratio: SEQUENCE["minor-third"],
|
|
908
|
+
range: [-3, 12],
|
|
909
|
+
h1Matches: 6,
|
|
910
|
+
lineHeight: 1.5,
|
|
911
|
+
unit: "em",
|
|
912
|
+
templates: {},
|
|
913
|
+
sequence: {},
|
|
914
|
+
scales: {},
|
|
915
|
+
vars: {}
|
|
916
|
+
};
|
|
917
|
+
var TYPOGRAPHY = defaultProps;
|
|
918
|
+
|
|
919
|
+
// src/defaultConfig/font.js
|
|
920
|
+
var FONT = {};
|
|
921
|
+
|
|
922
|
+
// src/defaultConfig/font-family.js
|
|
923
|
+
var FONT_FAMILY = {};
|
|
924
|
+
var FONT_FAMILY_TYPES = {
|
|
925
|
+
"sans-serif": "Helvetica, Arial, sans-serif, --system-default",
|
|
926
|
+
serif: "Times New Roman, Georgia, serif, --system-default",
|
|
927
|
+
monospace: "Courier New, monospace, --system-default"
|
|
928
|
+
};
|
|
929
|
+
var FONT_FACE = {};
|
|
930
|
+
|
|
931
|
+
// src/defaultConfig/media.js
|
|
932
|
+
var MEDIA = {
|
|
933
|
+
tv: "(min-width: 2780px)",
|
|
934
|
+
screenL: "(max-width: 1920px)",
|
|
935
|
+
screenM: "(max-width: 1680px)",
|
|
936
|
+
screenS: "(max-width: 1440px)",
|
|
937
|
+
tabletL: "(max-width: 1366px)",
|
|
938
|
+
tabletM: "(max-width: 1280px)",
|
|
939
|
+
tabletS: "(max-width: 1024px)",
|
|
940
|
+
mobileL: "(max-width: 768px)",
|
|
941
|
+
mobileM: "(max-width: 560px)",
|
|
942
|
+
mobileS: "(max-width: 480px)",
|
|
943
|
+
mobileXS: "(max-width: 375px)",
|
|
944
|
+
light: "(prefers-color-scheme: light)",
|
|
945
|
+
dark: "(prefers-color-scheme: dark)",
|
|
946
|
+
print: "print"
|
|
947
|
+
};
|
|
948
|
+
|
|
949
|
+
// src/defaultConfig/spacing.js
|
|
950
|
+
var defaultProps2 = {
|
|
951
|
+
base: TYPOGRAPHY.base,
|
|
952
|
+
type: "spacing",
|
|
953
|
+
ratio: SEQUENCE.phi,
|
|
954
|
+
range: [-5, 15],
|
|
955
|
+
subSequence: true,
|
|
956
|
+
unit: "em",
|
|
957
|
+
sequence: {},
|
|
958
|
+
scales: {},
|
|
959
|
+
vars: {}
|
|
960
|
+
};
|
|
961
|
+
var SPACING = defaultProps2;
|
|
962
|
+
|
|
963
|
+
// src/defaultConfig/color.js
|
|
964
|
+
var COLOR = {};
|
|
965
|
+
var GRADIENT = {};
|
|
966
|
+
|
|
967
|
+
// src/defaultConfig/theme.js
|
|
968
|
+
var THEME = {};
|
|
969
|
+
|
|
970
|
+
// src/defaultConfig/icons.js
|
|
971
|
+
var ICONS = {};
|
|
972
|
+
|
|
973
|
+
// src/defaultConfig/timing.js
|
|
974
|
+
var defaultProps3 = {
|
|
975
|
+
default: 150,
|
|
976
|
+
base: 150,
|
|
977
|
+
type: "timing",
|
|
978
|
+
ratio: SEQUENCE["perfect-fourth"],
|
|
979
|
+
range: [-3, 12],
|
|
980
|
+
unit: "ms",
|
|
981
|
+
sequence: {},
|
|
982
|
+
scales: {},
|
|
983
|
+
vars: {}
|
|
984
|
+
};
|
|
985
|
+
var TIMING = defaultProps3;
|
|
986
|
+
|
|
987
|
+
// src/defaultConfig/document.js
|
|
988
|
+
var DOCUMENT = {};
|
|
989
|
+
|
|
990
|
+
// src/defaultConfig/responsive.js
|
|
991
|
+
var BREAKPOINTS = {
|
|
992
|
+
screenL: 1920,
|
|
993
|
+
screenM: 1680,
|
|
994
|
+
screenS: 1440,
|
|
995
|
+
tabletL: 1366,
|
|
996
|
+
tabletM: 1280,
|
|
997
|
+
tabletS: 1024,
|
|
998
|
+
mobileL: 768,
|
|
999
|
+
mobileM: 560,
|
|
1000
|
+
mobileS: 480,
|
|
1001
|
+
mobileXS: 375
|
|
1002
|
+
};
|
|
1003
|
+
var DEVICES = {
|
|
1004
|
+
screenL: [1920, 1024],
|
|
1005
|
+
screenM: [1680, 1024],
|
|
1006
|
+
screenS: [1440, 978],
|
|
1007
|
+
tabletL: [1366, 926],
|
|
1008
|
+
tabletM: [1280, 768],
|
|
1009
|
+
tabletS: [1024, 768],
|
|
1010
|
+
mobileL: [768, 375],
|
|
1011
|
+
mobileM: [560, 768],
|
|
1012
|
+
mobileS: [480, 768],
|
|
1013
|
+
mobileXS: [375, 768]
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1016
|
+
// src/defaultConfig/cases.js
|
|
1017
|
+
var CASES = {};
|
|
1018
|
+
|
|
1019
|
+
// src/defaultConfig/animation.js
|
|
1020
|
+
var ANIMATION = {};
|
|
1021
|
+
|
|
1022
|
+
// src/defaultConfig/svg.js
|
|
1023
|
+
var SVG = {};
|
|
1024
|
+
var SVG_DATA = {};
|
|
1025
|
+
|
|
1026
|
+
// src/defaultConfig/index.js
|
|
1027
|
+
var RESET = {};
|
|
1028
|
+
|
|
1029
|
+
// src/factory.js
|
|
1030
|
+
var CSS_VARS = {};
|
|
1031
|
+
var CONFIG = {
|
|
1032
|
+
verbose: false,
|
|
1033
|
+
useVariable: true,
|
|
1034
|
+
useReset: true,
|
|
1035
|
+
CSS_VARS,
|
|
1036
|
+
...defaultConfig_exports
|
|
1037
|
+
};
|
|
1038
|
+
var cachedConfig = (0, import_utils.deepClone)(CONFIG);
|
|
1039
|
+
var FACTORY = {
|
|
1040
|
+
active: "0",
|
|
1041
|
+
0: CONFIG
|
|
1042
|
+
};
|
|
1043
|
+
var getActiveConfig = (def) => {
|
|
1044
|
+
if ((0, import_utils.isDefined)(def) && !FACTORY[def]) {
|
|
1045
|
+
FACTORY[def] = (0, import_utils.deepClone)(cachedConfig);
|
|
1046
|
+
return FACTORY[def];
|
|
1047
|
+
}
|
|
1048
|
+
return FACTORY[def || FACTORY.active];
|
|
1049
|
+
};
|
|
1050
|
+
|
|
1051
|
+
// src/system/color.js
|
|
1052
|
+
var import_utils8 = __toESM(require_cjs3(), 1);
|
|
1053
|
+
|
|
1054
|
+
// src/utils/color.js
|
|
1055
|
+
var import_globals = __toESM(require_cjs(), 1);
|
|
1056
|
+
var hexToRgbArray = (hex, alpha = 1) => {
|
|
1057
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
1058
|
+
return [r, g, b];
|
|
1059
|
+
};
|
|
1060
|
+
var rgbArrayToHex = ([r, g, b]) => {
|
|
1061
|
+
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
1062
|
+
};
|
|
1063
|
+
var rgbToHSL = (r, g, b) => {
|
|
1064
|
+
const a = Math.max(r, g, b);
|
|
1065
|
+
const n = a - Math.min(r, g, b);
|
|
1066
|
+
const f = 1 - Math.abs(a + a - n - 1);
|
|
1067
|
+
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
1068
|
+
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
1069
|
+
};
|
|
1070
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
1071
|
+
Math.min(k - 3, 9 - k, 1),
|
|
1072
|
+
-1
|
|
1073
|
+
)) => [f(0), f(8), f(4)];
|
|
1074
|
+
var getColorShade = (col, amt) => {
|
|
1075
|
+
const num = parseInt(col, 16);
|
|
1076
|
+
let r = (num >> 16) + amt;
|
|
1077
|
+
if (r > 255)
|
|
1078
|
+
r = 255;
|
|
1079
|
+
else if (r < 0)
|
|
1080
|
+
r = 0;
|
|
1081
|
+
let b = (num >> 8 & 255) + amt;
|
|
1082
|
+
if (b > 255)
|
|
1083
|
+
b = 255;
|
|
1084
|
+
else if (b < 0)
|
|
1085
|
+
b = 0;
|
|
1086
|
+
let g = (num & 255) + amt;
|
|
1087
|
+
if (g > 255)
|
|
1088
|
+
g = 255;
|
|
1089
|
+
else if (g < 0)
|
|
1090
|
+
g = 0;
|
|
1091
|
+
return (g | b << 8 | r << 16).toString(16);
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
// src/utils/sequence.js
|
|
1095
|
+
var import_utils4 = __toESM(require_cjs3(), 1);
|
|
1096
|
+
|
|
1097
|
+
// ../utils/src/index.js
|
|
1098
|
+
var import_utils3 = __toESM(require_cjs3());
|
|
1099
|
+
|
|
1100
|
+
// ../utils/src/scaling.js
|
|
1101
|
+
var import_utils2 = __toESM(require_cjs3());
|
|
1102
|
+
|
|
1103
|
+
// src/utils/var.js
|
|
1104
|
+
var import_utils6 = __toESM(require_cjs3(), 1);
|
|
1105
|
+
|
|
1106
|
+
// src/utils/sprite.js
|
|
1107
|
+
var import_utils7 = __toESM(require_cjs3(), 1);
|
|
1108
|
+
|
|
1109
|
+
// src/system/color.js
|
|
1110
|
+
var getColor = (value, key) => {
|
|
1111
|
+
const CONFIG2 = getActiveConfig();
|
|
1112
|
+
if (!(0, import_utils8.isString)(value)) {
|
|
1113
|
+
if (CONFIG2.verbose)
|
|
1114
|
+
console.warn(value, "- type for color is not valid");
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
if (value.slice(0, 2) === "--")
|
|
1118
|
+
return `var(${value})`;
|
|
1119
|
+
if (key && value[key])
|
|
1120
|
+
value = value[key];
|
|
1121
|
+
const [name, alpha, tone] = (0, import_utils8.isArray)(value) ? value : value.split(" ");
|
|
1122
|
+
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
1123
|
+
let val = COLOR2[name] || GRADIENT2[name];
|
|
1124
|
+
if (!val) {
|
|
1125
|
+
if (CONFIG2.verbose)
|
|
1126
|
+
console.warn("Can't find color ", name);
|
|
1127
|
+
return value;
|
|
1128
|
+
}
|
|
1129
|
+
if (key) {
|
|
1130
|
+
if (val[key])
|
|
1131
|
+
val = val[key];
|
|
1132
|
+
else if (CONFIG2.verbose)
|
|
1133
|
+
console.warn(value, " - does not have ", key);
|
|
1134
|
+
}
|
|
1135
|
+
let rgb = val.rgb;
|
|
1136
|
+
if (rgb) {
|
|
1137
|
+
if (tone) {
|
|
1138
|
+
if (!val[tone]) {
|
|
1139
|
+
const toHex = rgbArrayToHex(rgb.split(", ").map((v) => parseFloat(v)));
|
|
1140
|
+
if (tone.slice(0, 1) === "-" || tone.slice(0, 1) === "+") {
|
|
1141
|
+
rgb = hexToRgbArray(getColorShade(toHex, parseFloat(tone))).join(", ");
|
|
1142
|
+
} else {
|
|
1143
|
+
const [r, g, b] = [...rgb.split(", ").map((v) => parseInt(v))];
|
|
1144
|
+
const hsl = rgbToHSL(r, g, b);
|
|
1145
|
+
const [h, s, l] = hsl;
|
|
1146
|
+
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
|
|
1147
|
+
rgb = newRgb;
|
|
1148
|
+
}
|
|
1149
|
+
val[tone] = { rgb, var: `${val.var}-${tone}` };
|
|
1150
|
+
} else
|
|
1151
|
+
rgb = val[tone].rgb;
|
|
1152
|
+
}
|
|
1153
|
+
if (alpha)
|
|
1154
|
+
return `rgba(${rgb}, ${alpha})`;
|
|
1155
|
+
return CONFIG2.useVariable ? `var(${val.var})` : `rgb(${rgb})`;
|
|
1156
|
+
} else
|
|
1157
|
+
return CONFIG2.useVariable ? `var(${val.var})` : val.value;
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
// src/system/theme.js
|
|
1161
|
+
var import_utils10 = __toESM(require_cjs3(), 1);
|
|
1162
|
+
var setThemeValue = (theme) => {
|
|
32
1163
|
const value = {};
|
|
33
1164
|
const { state, media, helpers, ...rest } = theme;
|
|
34
1165
|
const keys = Object.keys(rest);
|
|
35
1166
|
keys.map((key) => {
|
|
36
1167
|
const conditions = ["color", "Color", "background", "border"];
|
|
37
1168
|
const isColor = conditions.some((k) => key.includes(k));
|
|
38
|
-
return value[key] = isColor ?
|
|
1169
|
+
return value[key] = isColor ? getColor(theme[key]) : theme[key];
|
|
39
1170
|
});
|
|
40
1171
|
return value;
|
|
41
1172
|
};
|
|
42
|
-
|
|
1173
|
+
var getThemeValue = (theme) => {
|
|
43
1174
|
if (theme.value)
|
|
44
1175
|
return theme.value;
|
|
45
1176
|
theme.value = setThemeValue(theme);
|
|
46
1177
|
return theme.value;
|
|
47
1178
|
};
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
1179
|
+
var getTheme = (value, modifier) => {
|
|
1180
|
+
const CONFIG2 = getActiveConfig();
|
|
1181
|
+
if (CONFIG2.useVariable)
|
|
51
1182
|
return getMediaTheme(value, modifier);
|
|
52
|
-
const { THEME } =
|
|
53
|
-
if ((0,
|
|
1183
|
+
const { THEME: THEME2 } = CONFIG2;
|
|
1184
|
+
if ((0, import_utils10.isString)(value)) {
|
|
54
1185
|
const [theme, subtheme] = value.split(" ");
|
|
55
|
-
const isOurTheme =
|
|
1186
|
+
const isOurTheme = THEME2[theme];
|
|
56
1187
|
if (isOurTheme) {
|
|
57
1188
|
if (!subtheme && !modifier)
|
|
58
1189
|
return getThemeValue(isOurTheme);
|
|
59
1190
|
value = [theme, subtheme || modifier];
|
|
60
1191
|
}
|
|
61
1192
|
}
|
|
62
|
-
if ((0,
|
|
1193
|
+
if ((0, import_utils10.isObjectLike)(value) && value[1]) {
|
|
63
1194
|
const themeName = value[0];
|
|
64
1195
|
const subThemeName = value[1];
|
|
65
|
-
const { helpers, media, state } =
|
|
1196
|
+
const { helpers, media, state } = THEME2[themeName];
|
|
66
1197
|
if (media && media[subThemeName])
|
|
67
1198
|
return getThemeValue(media[subThemeName]);
|
|
68
1199
|
if (helpers && helpers[subThemeName])
|
|
69
1200
|
return getThemeValue(helpers[subThemeName]);
|
|
70
1201
|
if (state && state[subThemeName])
|
|
71
1202
|
return getThemeValue(state[subThemeName]);
|
|
72
|
-
} else if ((0,
|
|
1203
|
+
} else if ((0, import_utils10.isObject)(value))
|
|
73
1204
|
return setThemeValue(value);
|
|
74
1205
|
};
|
|
75
|
-
|
|
76
|
-
if ((0,
|
|
1206
|
+
var setInverseTheme = (theme, variant, value) => {
|
|
1207
|
+
if ((0, import_utils10.isObject)(variant)) {
|
|
77
1208
|
theme.variants.inverse.value = setThemeValue(variant);
|
|
78
1209
|
} else if (variant === true) {
|
|
79
1210
|
const { color, background } = value;
|
|
@@ -85,13 +1216,13 @@ const setInverseTheme = (theme, variant, value) => {
|
|
|
85
1216
|
};
|
|
86
1217
|
}
|
|
87
1218
|
};
|
|
88
|
-
|
|
1219
|
+
var setPseudo = (theme, key, variant, themeValue) => {
|
|
89
1220
|
const result = getTheme(variant);
|
|
90
1221
|
themeValue[`&:${key}`] = result;
|
|
91
|
-
if ((0,
|
|
1222
|
+
if ((0, import_utils10.isObject)(variant) && !variant.value)
|
|
92
1223
|
variant.value = result;
|
|
93
1224
|
};
|
|
94
|
-
|
|
1225
|
+
var setSelectors = (theme, value) => {
|
|
95
1226
|
const { state } = theme;
|
|
96
1227
|
if (!state)
|
|
97
1228
|
return;
|
|
@@ -103,13 +1234,13 @@ const setSelectors = (theme, value) => {
|
|
|
103
1234
|
});
|
|
104
1235
|
return theme;
|
|
105
1236
|
};
|
|
106
|
-
|
|
1237
|
+
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
107
1238
|
const result = getTheme(variant);
|
|
108
1239
|
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
109
|
-
if ((0,
|
|
1240
|
+
if ((0, import_utils10.isObject)(variant) && !variant.value)
|
|
110
1241
|
variant.value = result;
|
|
111
1242
|
};
|
|
112
|
-
|
|
1243
|
+
var setMedia = (theme, value) => {
|
|
113
1244
|
const { media } = theme;
|
|
114
1245
|
if (!media)
|
|
115
1246
|
return;
|
|
@@ -124,25 +1255,25 @@ const setMedia = (theme, value) => {
|
|
|
124
1255
|
});
|
|
125
1256
|
return theme;
|
|
126
1257
|
};
|
|
127
|
-
|
|
128
|
-
const
|
|
1258
|
+
var setHelpers = (theme, value) => {
|
|
1259
|
+
const CONFIG2 = getActiveConfig();
|
|
129
1260
|
const { helpers } = theme;
|
|
130
1261
|
if (!helpers)
|
|
131
1262
|
return;
|
|
132
1263
|
const keys = Object.keys(helpers);
|
|
133
1264
|
keys.map((key) => {
|
|
134
1265
|
const helper = helpers[key];
|
|
135
|
-
if ((0,
|
|
136
|
-
helpers[key] =
|
|
1266
|
+
if ((0, import_utils10.isString)(helper))
|
|
1267
|
+
helpers[key] = CONFIG2.THEME[helper];
|
|
137
1268
|
else
|
|
138
1269
|
getThemeValue(helpers[key]);
|
|
139
1270
|
return theme;
|
|
140
1271
|
});
|
|
141
1272
|
return theme;
|
|
142
1273
|
};
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
1274
|
+
var setTheme = (val, key) => {
|
|
1275
|
+
const CONFIG2 = getActiveConfig();
|
|
1276
|
+
if (CONFIG2.useVariable)
|
|
146
1277
|
return setMediaTheme(val, key);
|
|
147
1278
|
const { state, media, helpers } = val;
|
|
148
1279
|
const value = setThemeValue(val, key);
|
|
@@ -152,17 +1283,11 @@ const setTheme = (val, key) => {
|
|
|
152
1283
|
setHelpers(val, value);
|
|
153
1284
|
return { var: CSSvar, value, state, media, helpers };
|
|
154
1285
|
};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
":": (theme, value) => setSelectors(theme, value),
|
|
159
|
-
".": (theme, value) => setHelpers(theme, value)
|
|
160
|
-
};
|
|
161
|
-
const setMediaTheme = (val, key, suffix, prefers) => {
|
|
162
|
-
const CONFIG = (0, import_factory.getActiveConfig)();
|
|
163
|
-
const { CSS_VARS } = CONFIG;
|
|
1286
|
+
var setMediaTheme = (val, key, suffix, prefers) => {
|
|
1287
|
+
const CONFIG2 = getActiveConfig();
|
|
1288
|
+
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
164
1289
|
const theme = { value: val };
|
|
165
|
-
if ((0,
|
|
1290
|
+
if ((0, import_utils10.isObjectLike)(val)) {
|
|
166
1291
|
for (const param in val) {
|
|
167
1292
|
const symb = param.slice(0, 1);
|
|
168
1293
|
const value = val[param];
|
|
@@ -170,12 +1295,12 @@ const setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
170
1295
|
const hasPrefers = symb === "@" && param;
|
|
171
1296
|
theme[param] = setMediaTheme(value, key, param, prefers || hasPrefers);
|
|
172
1297
|
} else {
|
|
173
|
-
const color =
|
|
1298
|
+
const color = getColor(value, prefers);
|
|
174
1299
|
const metaSuffixes = [...new Set([prefers, suffix].filter((v) => v).map((v) => v.slice(1)))];
|
|
175
1300
|
const varmetaSuffixName = metaSuffixes.length ? "-" + metaSuffixes.join("-") : "";
|
|
176
1301
|
const CSSVar = `--theme-${key}${varmetaSuffixName}-${param}`;
|
|
177
|
-
if (
|
|
178
|
-
|
|
1302
|
+
if (CONFIG2.useVariable) {
|
|
1303
|
+
CSS_VARS2[CSSVar] = color;
|
|
179
1304
|
theme[param] = `var(${CSSVar})`;
|
|
180
1305
|
} else {
|
|
181
1306
|
theme[param] = color;
|
|
@@ -190,22 +1315,22 @@ const setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
190
1315
|
};
|
|
191
1316
|
}
|
|
192
1317
|
}
|
|
193
|
-
if ((0,
|
|
194
|
-
const { THEME } =
|
|
195
|
-
const value =
|
|
1318
|
+
if ((0, import_utils10.isString)(val) && val.slice(0, 2) === "--") {
|
|
1319
|
+
const { THEME: THEME2 } = CONFIG2;
|
|
1320
|
+
const value = THEME2[val.slice(2)];
|
|
196
1321
|
const getReferenced = getMediaTheme(value, prefers);
|
|
197
1322
|
return getReferenced;
|
|
198
1323
|
}
|
|
199
1324
|
return theme;
|
|
200
1325
|
};
|
|
201
|
-
|
|
202
|
-
const
|
|
1326
|
+
var recursiveTheme = (val) => {
|
|
1327
|
+
const CONFIG2 = getActiveConfig();
|
|
203
1328
|
const obj = {};
|
|
204
1329
|
for (const param in val) {
|
|
205
1330
|
const symb = param.slice(0, 1);
|
|
206
|
-
if ((0,
|
|
1331
|
+
if ((0, import_utils10.isObjectLike)(val[param])) {
|
|
207
1332
|
if (symb === "@") {
|
|
208
|
-
const query =
|
|
1333
|
+
const query = CONFIG2.MEDIA[param.slice(1)];
|
|
209
1334
|
const media = `@media screen and ${query}`;
|
|
210
1335
|
obj[media] = recursiveTheme(val[param]);
|
|
211
1336
|
} else if (symb === ":") {
|
|
@@ -216,37 +1341,31 @@ const recursiveTheme = (val) => {
|
|
|
216
1341
|
}
|
|
217
1342
|
return obj;
|
|
218
1343
|
};
|
|
219
|
-
|
|
1344
|
+
var findModifierFromArray = (val, modifierArray) => {
|
|
220
1345
|
const currentMod = modifierArray.shift();
|
|
221
1346
|
if (val[currentMod])
|
|
222
1347
|
return findModifierFromArray(val[currentMod], modifierArray);
|
|
223
1348
|
return val;
|
|
224
1349
|
};
|
|
225
|
-
|
|
226
|
-
if ((0,
|
|
1350
|
+
var findModifier = (val, modifier) => {
|
|
1351
|
+
if ((0, import_utils10.isArray)(modifier))
|
|
227
1352
|
return findModifierFromArray(val, modifier);
|
|
228
|
-
else if ((0,
|
|
1353
|
+
else if ((0, import_utils10.isString)(modifier) && val[modifier])
|
|
229
1354
|
return val[modifier];
|
|
230
1355
|
else
|
|
231
1356
|
return val;
|
|
232
1357
|
};
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return val;
|
|
237
|
-
};
|
|
238
|
-
const checkThemeReference = (val) => checkForReference(val, checkThemeReference);
|
|
239
|
-
const getMediaTheme = (val, mod) => {
|
|
240
|
-
const CONFIG = (0, import_factory.getActiveConfig)();
|
|
241
|
-
if ((0, import_utils.isString)(val) && val.slice(0, 2) === "--")
|
|
1358
|
+
var getMediaTheme = (val, mod) => {
|
|
1359
|
+
const CONFIG2 = getActiveConfig();
|
|
1360
|
+
if ((0, import_utils10.isString)(val) && val.slice(0, 2) === "--")
|
|
242
1361
|
val = getMediaTheme(val.slice(2));
|
|
243
|
-
if (!val || !(0,
|
|
244
|
-
if (
|
|
1362
|
+
if (!val || !(0, import_utils10.isString)(val)) {
|
|
1363
|
+
if (CONFIG2.verbose)
|
|
245
1364
|
console.warn(val, "- theme is not string");
|
|
246
1365
|
return;
|
|
247
1366
|
}
|
|
248
|
-
const [name, ...modifier] = (0,
|
|
249
|
-
let value =
|
|
1367
|
+
const [name, ...modifier] = (0, import_utils10.isArray)(val) ? val : val.split(" ");
|
|
1368
|
+
let value = CONFIG2.THEME[name];
|
|
250
1369
|
if (value && (modifier || mod)) {
|
|
251
1370
|
value = findModifier(value, modifier.length ? modifier : mod);
|
|
252
1371
|
}
|