@symbo.ls/scratch 2.10.121 → 2.10.122
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/index.cjs.js +286 -749
- package/dist/index.cjs.js.map +4 -4
- package/package.json +2 -2
- package/src/defaultConfig/index.js +16 -16
- package/src/defaultConfig/typography.js +1 -1
- package/src/index.js +2 -2
- package/src/set.js +1 -1
- package/src/system/document.js +1 -1
- package/src/system/index.js +9 -9
- package/src/system/reset.js +1 -1
- package/src/system/svg.js +1 -1
- package/src/system/timing.js +1 -1
- package/src/utils/index.js +6 -6
- package/src/utils/var.js +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3,9 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __esm = (fn, res) => function __init() {
|
|
7
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
-
};
|
|
9
6
|
var __export = (target, all) => {
|
|
10
7
|
for (var name in all)
|
|
11
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -20,693 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
20
17
|
};
|
|
21
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
19
|
|
|
23
|
-
// ../../node_modules/@domql/globals/index.js
|
|
24
|
-
var globals_exports = {};
|
|
25
|
-
__export(globals_exports, {
|
|
26
|
-
document: () => document2,
|
|
27
|
-
global: () => global,
|
|
28
|
-
self: () => self,
|
|
29
|
-
window: () => window2
|
|
30
|
-
});
|
|
31
|
-
var global, self, window2, document2;
|
|
32
|
-
var init_globals = __esm({
|
|
33
|
-
"../../node_modules/@domql/globals/index.js"() {
|
|
34
|
-
"use strict";
|
|
35
|
-
global = globalThis;
|
|
36
|
-
self = globalThis;
|
|
37
|
-
window2 = globalThis;
|
|
38
|
-
document2 = window2.document;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// ../../node_modules/@domql/tags/htmlTags.js
|
|
43
|
-
var HTML_TAGS;
|
|
44
|
-
var init_htmlTags = __esm({
|
|
45
|
-
"../../node_modules/@domql/tags/htmlTags.js"() {
|
|
46
|
-
"use strict";
|
|
47
|
-
HTML_TAGS = {
|
|
48
|
-
root: [
|
|
49
|
-
"body",
|
|
50
|
-
"html"
|
|
51
|
-
],
|
|
52
|
-
head: [
|
|
53
|
-
"title",
|
|
54
|
-
"base",
|
|
55
|
-
"meta",
|
|
56
|
-
"style"
|
|
57
|
-
],
|
|
58
|
-
body: [
|
|
59
|
-
"string",
|
|
60
|
-
"fragment",
|
|
61
|
-
"a",
|
|
62
|
-
"abbr",
|
|
63
|
-
"acronym",
|
|
64
|
-
"address",
|
|
65
|
-
"applet",
|
|
66
|
-
"area",
|
|
67
|
-
"article",
|
|
68
|
-
"aside",
|
|
69
|
-
"audio",
|
|
70
|
-
"b",
|
|
71
|
-
"basefont",
|
|
72
|
-
"bdi",
|
|
73
|
-
"bdo",
|
|
74
|
-
"big",
|
|
75
|
-
"blockquote",
|
|
76
|
-
"br",
|
|
77
|
-
"button",
|
|
78
|
-
"canvas",
|
|
79
|
-
"caption",
|
|
80
|
-
"center",
|
|
81
|
-
"cite",
|
|
82
|
-
"code",
|
|
83
|
-
"col",
|
|
84
|
-
"colgroup",
|
|
85
|
-
"data",
|
|
86
|
-
"datalist",
|
|
87
|
-
"dd",
|
|
88
|
-
"del",
|
|
89
|
-
"details",
|
|
90
|
-
"dfn",
|
|
91
|
-
"dialog",
|
|
92
|
-
"dir",
|
|
93
|
-
"div",
|
|
94
|
-
"dl",
|
|
95
|
-
"dt",
|
|
96
|
-
"em",
|
|
97
|
-
"embed",
|
|
98
|
-
"fieldset",
|
|
99
|
-
"figcaption",
|
|
100
|
-
"figure",
|
|
101
|
-
"font",
|
|
102
|
-
"footer",
|
|
103
|
-
"form",
|
|
104
|
-
"frame",
|
|
105
|
-
"frameset",
|
|
106
|
-
"h1",
|
|
107
|
-
"h2",
|
|
108
|
-
"h3",
|
|
109
|
-
"h4",
|
|
110
|
-
"h5",
|
|
111
|
-
"h6",
|
|
112
|
-
"head",
|
|
113
|
-
"header",
|
|
114
|
-
"hr",
|
|
115
|
-
"i",
|
|
116
|
-
"iframe",
|
|
117
|
-
"img",
|
|
118
|
-
"input",
|
|
119
|
-
"ins",
|
|
120
|
-
"kbd",
|
|
121
|
-
"label",
|
|
122
|
-
"legend",
|
|
123
|
-
"li",
|
|
124
|
-
"link",
|
|
125
|
-
"main",
|
|
126
|
-
"map",
|
|
127
|
-
"mark",
|
|
128
|
-
"meter",
|
|
129
|
-
"nav",
|
|
130
|
-
"noframes",
|
|
131
|
-
"noscript",
|
|
132
|
-
"object",
|
|
133
|
-
"ol",
|
|
134
|
-
"optgroup",
|
|
135
|
-
"option",
|
|
136
|
-
"output",
|
|
137
|
-
"p",
|
|
138
|
-
"param",
|
|
139
|
-
"picture",
|
|
140
|
-
"pre",
|
|
141
|
-
"progress",
|
|
142
|
-
"q",
|
|
143
|
-
"rp",
|
|
144
|
-
"rt",
|
|
145
|
-
"ruby",
|
|
146
|
-
"s",
|
|
147
|
-
"samp",
|
|
148
|
-
"script",
|
|
149
|
-
"section",
|
|
150
|
-
"select",
|
|
151
|
-
"small",
|
|
152
|
-
"source",
|
|
153
|
-
"span",
|
|
154
|
-
"strike",
|
|
155
|
-
"strong",
|
|
156
|
-
"sub",
|
|
157
|
-
"summary",
|
|
158
|
-
"sup",
|
|
159
|
-
"table",
|
|
160
|
-
"tbody",
|
|
161
|
-
"td",
|
|
162
|
-
"template",
|
|
163
|
-
"textarea",
|
|
164
|
-
"tfoot",
|
|
165
|
-
"th",
|
|
166
|
-
"thead",
|
|
167
|
-
"time",
|
|
168
|
-
"tr",
|
|
169
|
-
"track",
|
|
170
|
-
"tt",
|
|
171
|
-
"u",
|
|
172
|
-
"ul",
|
|
173
|
-
"var",
|
|
174
|
-
"video",
|
|
175
|
-
"wbr",
|
|
176
|
-
// SVG
|
|
177
|
-
"svg",
|
|
178
|
-
"path"
|
|
179
|
-
]
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
// ../../node_modules/@domql/tags/index.js
|
|
185
|
-
var tags_exports = {};
|
|
186
|
-
__export(tags_exports, {
|
|
187
|
-
HTML_TAGS: () => HTML_TAGS
|
|
188
|
-
});
|
|
189
|
-
var init_tags = __esm({
|
|
190
|
-
"../../node_modules/@domql/tags/index.js"() {
|
|
191
|
-
"use strict";
|
|
192
|
-
init_htmlTags();
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
// ../../node_modules/@domql/utils/dist/types.js
|
|
197
|
-
var types_exports = {};
|
|
198
|
-
var __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __export2, __copyProps2, __toCommonJS2, types_exports2, import_globals, import_tags, isValidHtmlTag, isObject, isString, isNumber, isFunction, isBoolean, isNull, isArray, isObjectLike, isNode, isHtmlElement, isDefined, isUndefined, TYPES, is, isNot;
|
|
199
|
-
var init_types = __esm({
|
|
200
|
-
"../../node_modules/@domql/utils/dist/types.js"() {
|
|
201
|
-
"use strict";
|
|
202
|
-
__defProp2 = Object.defineProperty;
|
|
203
|
-
__getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
204
|
-
__getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
205
|
-
__hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
206
|
-
__export2 = (target, all) => {
|
|
207
|
-
for (var name in all)
|
|
208
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
209
|
-
};
|
|
210
|
-
__copyProps2 = (to, from, except, desc) => {
|
|
211
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
212
|
-
for (let key of __getOwnPropNames2(from))
|
|
213
|
-
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
214
|
-
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
215
|
-
}
|
|
216
|
-
return to;
|
|
217
|
-
};
|
|
218
|
-
__toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
219
|
-
types_exports2 = {};
|
|
220
|
-
__export2(types_exports2, {
|
|
221
|
-
TYPES: () => TYPES,
|
|
222
|
-
is: () => is,
|
|
223
|
-
isArray: () => isArray,
|
|
224
|
-
isBoolean: () => isBoolean,
|
|
225
|
-
isDefined: () => isDefined,
|
|
226
|
-
isFunction: () => isFunction,
|
|
227
|
-
isHtmlElement: () => isHtmlElement,
|
|
228
|
-
isNode: () => isNode,
|
|
229
|
-
isNot: () => isNot,
|
|
230
|
-
isNull: () => isNull,
|
|
231
|
-
isNumber: () => isNumber,
|
|
232
|
-
isObject: () => isObject,
|
|
233
|
-
isObjectLike: () => isObjectLike,
|
|
234
|
-
isString: () => isString,
|
|
235
|
-
isUndefined: () => isUndefined,
|
|
236
|
-
isValidHtmlTag: () => isValidHtmlTag
|
|
237
|
-
});
|
|
238
|
-
module.exports = __toCommonJS2(types_exports2);
|
|
239
|
-
import_globals = (init_globals(), __toCommonJS(globals_exports));
|
|
240
|
-
import_tags = (init_tags(), __toCommonJS(tags_exports));
|
|
241
|
-
isValidHtmlTag = (arg) => import_tags.HTML_TAGS.body.indexOf(arg);
|
|
242
|
-
isObject = (arg) => {
|
|
243
|
-
if (arg === null)
|
|
244
|
-
return false;
|
|
245
|
-
return typeof arg === "object" && arg.constructor === Object;
|
|
246
|
-
};
|
|
247
|
-
isString = (arg) => typeof arg === "string";
|
|
248
|
-
isNumber = (arg) => typeof arg === "number";
|
|
249
|
-
isFunction = (arg) => typeof arg === "function";
|
|
250
|
-
isBoolean = (arg) => arg === true || arg === false;
|
|
251
|
-
isNull = (arg) => arg === null;
|
|
252
|
-
isArray = (arg) => Array.isArray(arg);
|
|
253
|
-
isObjectLike = (arg) => {
|
|
254
|
-
if (arg === null)
|
|
255
|
-
return false;
|
|
256
|
-
return typeof arg === "object";
|
|
257
|
-
};
|
|
258
|
-
isNode = (obj2) => {
|
|
259
|
-
return typeof import_globals.window.Node === "object" ? obj2 instanceof import_globals.window.Node : obj2 && typeof obj2 === "object" && typeof obj2.nodeType === "number" && typeof obj2.nodeName === "string";
|
|
260
|
-
};
|
|
261
|
-
isHtmlElement = (obj2) => {
|
|
262
|
-
return typeof import_globals.window.HTMLElement === "object" ? obj2 instanceof import_globals.window.HTMLElement : obj2 && typeof obj2 === "object" && obj2 !== null && obj2.nodeType === 1 && typeof obj2.nodeName === "string";
|
|
263
|
-
};
|
|
264
|
-
isDefined = (arg) => {
|
|
265
|
-
return isObject(arg) || isObjectLike(arg) || isString(arg) || isNumber(arg) || isFunction(arg) || isArray(arg) || isObjectLike(arg) || isBoolean(arg) || isNull(arg);
|
|
266
|
-
};
|
|
267
|
-
isUndefined = (arg) => {
|
|
268
|
-
return arg === void 0;
|
|
269
|
-
};
|
|
270
|
-
TYPES = {
|
|
271
|
-
boolean: isBoolean,
|
|
272
|
-
array: isArray,
|
|
273
|
-
object: isObject,
|
|
274
|
-
string: isString,
|
|
275
|
-
number: isNumber,
|
|
276
|
-
null: isNull,
|
|
277
|
-
function: isFunction,
|
|
278
|
-
objectLike: isObjectLike,
|
|
279
|
-
node: isNode,
|
|
280
|
-
htmlElement: isHtmlElement,
|
|
281
|
-
defined: isDefined
|
|
282
|
-
};
|
|
283
|
-
is = (arg) => {
|
|
284
|
-
return (...args) => {
|
|
285
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length > 0;
|
|
286
|
-
};
|
|
287
|
-
};
|
|
288
|
-
isNot = (arg) => {
|
|
289
|
-
return (...args) => {
|
|
290
|
-
return args.map((val) => TYPES[val](arg)).filter((v) => v).length === 0;
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
// ../../node_modules/@domql/utils/dist/object.js
|
|
297
|
-
var object_exports = {};
|
|
298
|
-
var __defProp3, __getOwnPropDesc3, __getOwnPropNames3, __hasOwnProp3, __export3, __copyProps3, __toCommonJS3, object_exports2, import_types, exec, map, merge, deepMerge, clone, deepCloneExclude, mergeArrayExclude, deepClone, deepStringify, deepDestringify, overwrite, diff, overwriteObj, overwriteDeep, mergeIfExisted, mergeArray, mergeAndCloneIfArray, flattenRecursive, isEqualDeep;
|
|
299
|
-
var init_object = __esm({
|
|
300
|
-
"../../node_modules/@domql/utils/dist/object.js"() {
|
|
301
|
-
"use strict";
|
|
302
|
-
__defProp3 = Object.defineProperty;
|
|
303
|
-
__getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
|
304
|
-
__getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
305
|
-
__hasOwnProp3 = Object.prototype.hasOwnProperty;
|
|
306
|
-
__export3 = (target, all) => {
|
|
307
|
-
for (var name in all)
|
|
308
|
-
__defProp3(target, name, { get: all[name], enumerable: true });
|
|
309
|
-
};
|
|
310
|
-
__copyProps3 = (to, from, except, desc) => {
|
|
311
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
312
|
-
for (let key of __getOwnPropNames3(from))
|
|
313
|
-
if (!__hasOwnProp3.call(to, key) && key !== except)
|
|
314
|
-
__defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc3(from, key)) || desc.enumerable });
|
|
315
|
-
}
|
|
316
|
-
return to;
|
|
317
|
-
};
|
|
318
|
-
__toCommonJS3 = (mod) => __copyProps3(__defProp3({}, "__esModule", { value: true }), mod);
|
|
319
|
-
object_exports2 = {};
|
|
320
|
-
__export3(object_exports2, {
|
|
321
|
-
clone: () => clone,
|
|
322
|
-
deepClone: () => deepClone,
|
|
323
|
-
deepCloneExclude: () => deepCloneExclude,
|
|
324
|
-
deepDestringify: () => deepDestringify,
|
|
325
|
-
deepMerge: () => deepMerge,
|
|
326
|
-
deepStringify: () => deepStringify,
|
|
327
|
-
diff: () => diff,
|
|
328
|
-
exec: () => exec,
|
|
329
|
-
flattenRecursive: () => flattenRecursive,
|
|
330
|
-
isEqualDeep: () => isEqualDeep,
|
|
331
|
-
map: () => map,
|
|
332
|
-
merge: () => merge,
|
|
333
|
-
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
334
|
-
mergeArray: () => mergeArray,
|
|
335
|
-
mergeArrayExclude: () => mergeArrayExclude,
|
|
336
|
-
mergeIfExisted: () => mergeIfExisted,
|
|
337
|
-
overwrite: () => overwrite,
|
|
338
|
-
overwriteDeep: () => overwriteDeep,
|
|
339
|
-
overwriteObj: () => overwriteObj
|
|
340
|
-
});
|
|
341
|
-
module.exports = __toCommonJS3(object_exports2);
|
|
342
|
-
import_types = (init_types(), __toCommonJS(types_exports));
|
|
343
|
-
exec = (param, element, state) => {
|
|
344
|
-
if ((0, import_types.isFunction)(param))
|
|
345
|
-
return param(element, state || element.state);
|
|
346
|
-
return param;
|
|
347
|
-
};
|
|
348
|
-
map = (obj2, extention, element) => {
|
|
349
|
-
for (const e in extention) {
|
|
350
|
-
obj2[e] = exec(extention[e], element);
|
|
351
|
-
}
|
|
352
|
-
};
|
|
353
|
-
merge = (element, obj2) => {
|
|
354
|
-
for (const e in obj2) {
|
|
355
|
-
const elementProp = element[e];
|
|
356
|
-
const objProp2 = obj2[e];
|
|
357
|
-
if (elementProp === void 0) {
|
|
358
|
-
element[e] = objProp2;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
return element;
|
|
362
|
-
};
|
|
363
|
-
deepMerge = (element, extend) => {
|
|
364
|
-
for (const e in extend) {
|
|
365
|
-
const elementProp = element[e];
|
|
366
|
-
const extendProp = extend[e];
|
|
367
|
-
if (e === "parent" || e === "props")
|
|
368
|
-
continue;
|
|
369
|
-
if (elementProp === void 0) {
|
|
370
|
-
element[e] = extendProp;
|
|
371
|
-
} else if ((0, import_types.isObjectLike)(elementProp) && (0, import_types.isObject)(extendProp)) {
|
|
372
|
-
deepMerge(elementProp, extendProp);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return element;
|
|
376
|
-
};
|
|
377
|
-
clone = (obj2) => {
|
|
378
|
-
const o = {};
|
|
379
|
-
for (const prop2 in obj2) {
|
|
380
|
-
if (prop2 === "node")
|
|
381
|
-
continue;
|
|
382
|
-
o[prop2] = obj2[prop2];
|
|
383
|
-
}
|
|
384
|
-
return o;
|
|
385
|
-
};
|
|
386
|
-
deepCloneExclude = (obj2, exclude = []) => {
|
|
387
|
-
if ((0, import_types.isArray)(obj2)) {
|
|
388
|
-
return obj2.map((x) => deepCloneExclude(x, exclude));
|
|
389
|
-
}
|
|
390
|
-
const o = {};
|
|
391
|
-
for (const k in obj2) {
|
|
392
|
-
if (exclude.indexOf(k) > -1)
|
|
393
|
-
continue;
|
|
394
|
-
let v = obj2[k];
|
|
395
|
-
if (k === "extend" && (0, import_types.isArray)(v)) {
|
|
396
|
-
v = mergeArrayExclude(v, exclude);
|
|
397
|
-
}
|
|
398
|
-
if ((0, import_types.isArray)(v)) {
|
|
399
|
-
o[k] = v.map((x) => deepCloneExclude(x, exclude));
|
|
400
|
-
} else if ((0, import_types.isObject)(v)) {
|
|
401
|
-
o[k] = deepCloneExclude(v, exclude);
|
|
402
|
-
} else
|
|
403
|
-
o[k] = v;
|
|
404
|
-
}
|
|
405
|
-
return o;
|
|
406
|
-
};
|
|
407
|
-
mergeArrayExclude = (arr, excl = []) => {
|
|
408
|
-
return arr.reduce((acc, curr) => deepMerge(acc, deepCloneExclude(curr, excl)), {});
|
|
409
|
-
};
|
|
410
|
-
deepClone = (obj2) => {
|
|
411
|
-
if ((0, import_types.isArray)(obj2)) {
|
|
412
|
-
return obj2.map(deepClone);
|
|
413
|
-
}
|
|
414
|
-
const o = {};
|
|
415
|
-
for (const prop2 in obj2) {
|
|
416
|
-
let objProp2 = obj2[prop2];
|
|
417
|
-
if (prop2 === "extend" && (0, import_types.isArray)(objProp2)) {
|
|
418
|
-
objProp2 = mergeArray(objProp2);
|
|
419
|
-
}
|
|
420
|
-
if ((0, import_types.isArray)(objProp2)) {
|
|
421
|
-
o[prop2] = objProp2.map((v) => (0, import_types.isObject)(v) ? deepClone(v) : v);
|
|
422
|
-
} else if ((0, import_types.isObject)(objProp2)) {
|
|
423
|
-
o[prop2] = deepClone(objProp2);
|
|
424
|
-
} else
|
|
425
|
-
o[prop2] = objProp2;
|
|
426
|
-
}
|
|
427
|
-
return o;
|
|
428
|
-
};
|
|
429
|
-
deepStringify = (obj2, stringified2 = {}) => {
|
|
430
|
-
for (const prop2 in obj2) {
|
|
431
|
-
const objProp2 = obj2[prop2];
|
|
432
|
-
if ((0, import_types.isFunction)(objProp2)) {
|
|
433
|
-
stringified2[prop2] = objProp2.toString();
|
|
434
|
-
} else if ((0, import_types.isObject)(objProp2)) {
|
|
435
|
-
stringified2[prop2] = {};
|
|
436
|
-
deepStringify(objProp2[prop2], stringified2[prop2]);
|
|
437
|
-
} else if ((0, import_types.isArray)(objProp2)) {
|
|
438
|
-
stringified2[prop2] = [];
|
|
439
|
-
objProp2.map((v, i) => deepStringify(v, stringified2[prop2][i]));
|
|
440
|
-
} else
|
|
441
|
-
stringified2[prop2] = objProp2;
|
|
442
|
-
}
|
|
443
|
-
return stringified2;
|
|
444
|
-
};
|
|
445
|
-
deepDestringify = (obj, stringified = {}) => {
|
|
446
|
-
for (const prop in obj) {
|
|
447
|
-
const objProp = obj[prop];
|
|
448
|
-
if ((0, import_types.isString)(objProp)) {
|
|
449
|
-
if (objProp.includes("=>") || objProp.includes("function") || objProp[0] === "(") {
|
|
450
|
-
try {
|
|
451
|
-
const evalProp = eval(objProp);
|
|
452
|
-
stringified[prop] = evalProp;
|
|
453
|
-
} catch (e) {
|
|
454
|
-
if (e)
|
|
455
|
-
stringified[prop] = objProp;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
} else
|
|
459
|
-
stringified[prop] = objProp;
|
|
460
|
-
if ((0, import_types.isObject)(objProp))
|
|
461
|
-
deepDestringify(stringified[prop], stringified[prop]);
|
|
462
|
-
}
|
|
463
|
-
return stringified;
|
|
464
|
-
};
|
|
465
|
-
overwrite = (element, params, options) => {
|
|
466
|
-
const { ref } = element;
|
|
467
|
-
const changes = {};
|
|
468
|
-
for (const e in params) {
|
|
469
|
-
if (e === "props")
|
|
470
|
-
continue;
|
|
471
|
-
const elementProp = element[e];
|
|
472
|
-
const paramsProp = params[e];
|
|
473
|
-
if (paramsProp) {
|
|
474
|
-
ref.__cache[e] = changes[e] = elementProp;
|
|
475
|
-
ref[e] = paramsProp;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
return changes;
|
|
479
|
-
};
|
|
480
|
-
diff = (obj2, original, cache) => {
|
|
481
|
-
const changes = cache || {};
|
|
482
|
-
for (const e in obj2) {
|
|
483
|
-
if (e === "ref")
|
|
484
|
-
continue;
|
|
485
|
-
const originalProp = original[e];
|
|
486
|
-
const objProp2 = obj2[e];
|
|
487
|
-
if ((0, import_types.isObjectLike)(originalProp) && (0, import_types.isObjectLike)(objProp2)) {
|
|
488
|
-
changes[e] = {};
|
|
489
|
-
diff(originalProp, objProp2, changes[e]);
|
|
490
|
-
} else if (objProp2 !== void 0) {
|
|
491
|
-
changes[e] = objProp2;
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
return changes;
|
|
495
|
-
};
|
|
496
|
-
overwriteObj = (params, obj2) => {
|
|
497
|
-
const changes = {};
|
|
498
|
-
for (const e in params) {
|
|
499
|
-
const objProp2 = obj2[e];
|
|
500
|
-
const paramsProp = params[e];
|
|
501
|
-
if (paramsProp) {
|
|
502
|
-
obj2[e] = changes[e] = objProp2;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
return changes;
|
|
506
|
-
};
|
|
507
|
-
overwriteDeep = (params, obj2) => {
|
|
508
|
-
for (const e in params) {
|
|
509
|
-
const objProp2 = obj2[e];
|
|
510
|
-
const paramsProp = params[e];
|
|
511
|
-
if ((0, import_types.isObjectLike)(objProp2) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
512
|
-
overwriteDeep(objProp2, paramsProp);
|
|
513
|
-
} else if (paramsProp !== void 0) {
|
|
514
|
-
obj2[e] = paramsProp;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
return obj2;
|
|
518
|
-
};
|
|
519
|
-
mergeIfExisted = (a, b) => {
|
|
520
|
-
if ((0, import_types.isObjectLike)(a) && (0, import_types.isObjectLike)(b))
|
|
521
|
-
return deepMerge(a, b);
|
|
522
|
-
return a || b;
|
|
523
|
-
};
|
|
524
|
-
mergeArray = (arr) => {
|
|
525
|
-
return arr.reduce((a, c) => deepMerge(a, deepClone(c)), {});
|
|
526
|
-
};
|
|
527
|
-
mergeAndCloneIfArray = (obj2) => {
|
|
528
|
-
return (0, import_types.isArray)(obj2) ? mergeArray(obj2) : deepClone(obj2);
|
|
529
|
-
};
|
|
530
|
-
flattenRecursive = (param, prop2, stack = []) => {
|
|
531
|
-
const objectized = mergeAndCloneIfArray(param);
|
|
532
|
-
stack.push(objectized);
|
|
533
|
-
const extendOfExtend = objectized[prop2];
|
|
534
|
-
if (extendOfExtend)
|
|
535
|
-
flattenRecursive(extendOfExtend, prop2, stack);
|
|
536
|
-
delete objectized[prop2];
|
|
537
|
-
return stack;
|
|
538
|
-
};
|
|
539
|
-
isEqualDeep = (param, element) => {
|
|
540
|
-
if (param === element)
|
|
541
|
-
return true;
|
|
542
|
-
if (!param || !element)
|
|
543
|
-
return false;
|
|
544
|
-
for (const prop2 in param) {
|
|
545
|
-
const paramProp = param[prop2];
|
|
546
|
-
const elementProp = element[prop2];
|
|
547
|
-
if ((0, import_types.isObjectLike)(paramProp)) {
|
|
548
|
-
const isEqual = isEqualDeep(paramProp, elementProp);
|
|
549
|
-
if (!isEqual)
|
|
550
|
-
return false;
|
|
551
|
-
} else {
|
|
552
|
-
const isEqual = paramProp === elementProp;
|
|
553
|
-
if (!isEqual)
|
|
554
|
-
return false;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
return true;
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
|
|
562
|
-
// ../../node_modules/@domql/utils/dist/function.js
|
|
563
|
-
var function_exports = {};
|
|
564
|
-
var __defProp4, __getOwnPropDesc4, __getOwnPropNames4, __hasOwnProp4, __export4, __copyProps4, __toCommonJS4, function_exports2, debounce, memoize;
|
|
565
|
-
var init_function = __esm({
|
|
566
|
-
"../../node_modules/@domql/utils/dist/function.js"() {
|
|
567
|
-
"use strict";
|
|
568
|
-
__defProp4 = Object.defineProperty;
|
|
569
|
-
__getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
|
|
570
|
-
__getOwnPropNames4 = Object.getOwnPropertyNames;
|
|
571
|
-
__hasOwnProp4 = Object.prototype.hasOwnProperty;
|
|
572
|
-
__export4 = (target, all) => {
|
|
573
|
-
for (var name in all)
|
|
574
|
-
__defProp4(target, name, { get: all[name], enumerable: true });
|
|
575
|
-
};
|
|
576
|
-
__copyProps4 = (to, from, except, desc) => {
|
|
577
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
578
|
-
for (let key of __getOwnPropNames4(from))
|
|
579
|
-
if (!__hasOwnProp4.call(to, key) && key !== except)
|
|
580
|
-
__defProp4(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc4(from, key)) || desc.enumerable });
|
|
581
|
-
}
|
|
582
|
-
return to;
|
|
583
|
-
};
|
|
584
|
-
__toCommonJS4 = (mod) => __copyProps4(__defProp4({}, "__esModule", { value: true }), mod);
|
|
585
|
-
function_exports2 = {};
|
|
586
|
-
__export4(function_exports2, {
|
|
587
|
-
debounce: () => debounce,
|
|
588
|
-
memoize: () => memoize
|
|
589
|
-
});
|
|
590
|
-
module.exports = __toCommonJS4(function_exports2);
|
|
591
|
-
debounce = (element, func, timeout = 300) => {
|
|
592
|
-
let timer;
|
|
593
|
-
return (...args) => {
|
|
594
|
-
clearTimeout(timer);
|
|
595
|
-
timer = setTimeout(() => {
|
|
596
|
-
func.apply(element, args);
|
|
597
|
-
}, timeout);
|
|
598
|
-
};
|
|
599
|
-
};
|
|
600
|
-
memoize = (fn) => {
|
|
601
|
-
const cache = {};
|
|
602
|
-
return (...args) => {
|
|
603
|
-
const n = args[0];
|
|
604
|
-
if (n in cache) {
|
|
605
|
-
return cache[n];
|
|
606
|
-
} else {
|
|
607
|
-
const result = fn(n);
|
|
608
|
-
cache[n] = result;
|
|
609
|
-
return result;
|
|
610
|
-
}
|
|
611
|
-
};
|
|
612
|
-
};
|
|
613
|
-
}
|
|
614
|
-
});
|
|
615
|
-
|
|
616
|
-
// ../../node_modules/@domql/utils/dist/array.js
|
|
617
|
-
var array_exports = {};
|
|
618
|
-
var init_array = __esm({
|
|
619
|
-
"../../node_modules/@domql/utils/dist/array.js"() {
|
|
620
|
-
"use strict";
|
|
621
|
-
}
|
|
622
|
-
});
|
|
623
|
-
|
|
624
|
-
// ../../node_modules/@domql/utils/dist/node.js
|
|
625
|
-
var node_exports = {};
|
|
626
|
-
var __defProp5, __getOwnPropDesc5, __getOwnPropNames5, __hasOwnProp5, __export5, __copyProps5, __toCommonJS5, node_exports2, cleanWithNode, createID, createSnapshotId;
|
|
627
|
-
var init_node = __esm({
|
|
628
|
-
"../../node_modules/@domql/utils/dist/node.js"() {
|
|
629
|
-
"use strict";
|
|
630
|
-
__defProp5 = Object.defineProperty;
|
|
631
|
-
__getOwnPropDesc5 = Object.getOwnPropertyDescriptor;
|
|
632
|
-
__getOwnPropNames5 = Object.getOwnPropertyNames;
|
|
633
|
-
__hasOwnProp5 = Object.prototype.hasOwnProperty;
|
|
634
|
-
__export5 = (target, all) => {
|
|
635
|
-
for (var name in all)
|
|
636
|
-
__defProp5(target, name, { get: all[name], enumerable: true });
|
|
637
|
-
};
|
|
638
|
-
__copyProps5 = (to, from, except, desc) => {
|
|
639
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
640
|
-
for (let key of __getOwnPropNames5(from))
|
|
641
|
-
if (!__hasOwnProp5.call(to, key) && key !== except)
|
|
642
|
-
__defProp5(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc5(from, key)) || desc.enumerable });
|
|
643
|
-
}
|
|
644
|
-
return to;
|
|
645
|
-
};
|
|
646
|
-
__toCommonJS5 = (mod) => __copyProps5(__defProp5({}, "__esModule", { value: true }), mod);
|
|
647
|
-
node_exports2 = {};
|
|
648
|
-
__export5(node_exports2, {
|
|
649
|
-
cleanWithNode: () => cleanWithNode,
|
|
650
|
-
createID: () => createID,
|
|
651
|
-
createSnapshotId: () => createSnapshotId
|
|
652
|
-
});
|
|
653
|
-
module.exports = __toCommonJS5(node_exports2);
|
|
654
|
-
cleanWithNode = (extend) => delete extend.node && extend;
|
|
655
|
-
createID = function() {
|
|
656
|
-
let index = 0;
|
|
657
|
-
function newId() {
|
|
658
|
-
index++;
|
|
659
|
-
return index;
|
|
660
|
-
}
|
|
661
|
-
return newId;
|
|
662
|
-
}();
|
|
663
|
-
createSnapshotId = createID;
|
|
664
|
-
}
|
|
665
|
-
});
|
|
666
|
-
|
|
667
|
-
// ../../node_modules/@domql/utils/dist/log.js
|
|
668
|
-
var log_exports = {};
|
|
669
|
-
var __defProp6, __getOwnPropDesc6, __getOwnPropNames6, __hasOwnProp6, __export6, __copyProps6, __toCommonJS6, log_exports2, logIf, logGroupIf;
|
|
670
|
-
var init_log = __esm({
|
|
671
|
-
"../../node_modules/@domql/utils/dist/log.js"() {
|
|
672
|
-
"use strict";
|
|
673
|
-
__defProp6 = Object.defineProperty;
|
|
674
|
-
__getOwnPropDesc6 = Object.getOwnPropertyDescriptor;
|
|
675
|
-
__getOwnPropNames6 = Object.getOwnPropertyNames;
|
|
676
|
-
__hasOwnProp6 = Object.prototype.hasOwnProperty;
|
|
677
|
-
__export6 = (target, all) => {
|
|
678
|
-
for (var name in all)
|
|
679
|
-
__defProp6(target, name, { get: all[name], enumerable: true });
|
|
680
|
-
};
|
|
681
|
-
__copyProps6 = (to, from, except, desc) => {
|
|
682
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
683
|
-
for (let key of __getOwnPropNames6(from))
|
|
684
|
-
if (!__hasOwnProp6.call(to, key) && key !== except)
|
|
685
|
-
__defProp6(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc6(from, key)) || desc.enumerable });
|
|
686
|
-
}
|
|
687
|
-
return to;
|
|
688
|
-
};
|
|
689
|
-
__toCommonJS6 = (mod) => __copyProps6(__defProp6({}, "__esModule", { value: true }), mod);
|
|
690
|
-
log_exports2 = {};
|
|
691
|
-
__export6(log_exports2, {
|
|
692
|
-
logGroupIf: () => logGroupIf,
|
|
693
|
-
logIf: () => logIf
|
|
694
|
-
});
|
|
695
|
-
module.exports = __toCommonJS6(log_exports2);
|
|
696
|
-
logIf = (bool, ...arg) => {
|
|
697
|
-
if (bool)
|
|
698
|
-
arg.map((v) => console.log(v));
|
|
699
|
-
};
|
|
700
|
-
logGroupIf = (bool, key, ...arg) => {
|
|
701
|
-
if (bool) {
|
|
702
|
-
console.group(key);
|
|
703
|
-
arg.map((v) => console.log(v));
|
|
704
|
-
console.groupEnd(key);
|
|
705
|
-
}
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
});
|
|
709
|
-
|
|
710
20
|
// src/index.js
|
|
711
21
|
var src_exports = {};
|
|
712
22
|
__export(src_exports, {
|
|
@@ -814,29 +124,258 @@ __export(src_exports, {
|
|
|
814
124
|
});
|
|
815
125
|
module.exports = __toCommonJS(src_exports);
|
|
816
126
|
|
|
817
|
-
//
|
|
818
|
-
var
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
var
|
|
823
|
-
if (
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
127
|
+
// ../../../domql/packages/globals/index.js
|
|
128
|
+
var window2 = globalThis;
|
|
129
|
+
var document2 = window2.document;
|
|
130
|
+
|
|
131
|
+
// ../../../domql/packages/utils/types.js
|
|
132
|
+
var isObject = (arg) => {
|
|
133
|
+
if (arg === null)
|
|
134
|
+
return false;
|
|
135
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
136
|
+
};
|
|
137
|
+
var isString = (arg) => typeof arg === "string";
|
|
138
|
+
var isNumber = (arg) => typeof arg === "number";
|
|
139
|
+
var isFunction = (arg) => typeof arg === "function";
|
|
140
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
141
|
+
var isNull = (arg) => arg === null;
|
|
142
|
+
var isArray = (arg) => Array.isArray(arg);
|
|
143
|
+
var isObjectLike = (arg) => {
|
|
144
|
+
if (arg === null)
|
|
145
|
+
return false;
|
|
146
|
+
return typeof arg === "object";
|
|
147
|
+
};
|
|
148
|
+
var isDefined = (arg) => {
|
|
149
|
+
return isObject(arg) || isObjectLike(arg) || isString(arg) || isNumber(arg) || isFunction(arg) || isArray(arg) || isObjectLike(arg) || isBoolean(arg) || isNull(arg);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// ../../../domql/packages/utils/object.js
|
|
153
|
+
var exec = (param, element, state) => {
|
|
154
|
+
if (isFunction(param))
|
|
155
|
+
return param(element, state || element.state);
|
|
156
|
+
return param;
|
|
157
|
+
};
|
|
158
|
+
var map = (obj2, extention, element) => {
|
|
159
|
+
for (const e in extention) {
|
|
160
|
+
obj2[e] = exec(extention[e], element);
|
|
827
161
|
}
|
|
828
|
-
return to;
|
|
829
162
|
};
|
|
830
|
-
var
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
163
|
+
var merge = (element, obj2) => {
|
|
164
|
+
for (const e in obj2) {
|
|
165
|
+
const elementProp = element[e];
|
|
166
|
+
const objProp2 = obj2[e];
|
|
167
|
+
if (elementProp === void 0) {
|
|
168
|
+
element[e] = objProp2;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return element;
|
|
172
|
+
};
|
|
173
|
+
var deepMerge = (element, extend) => {
|
|
174
|
+
for (const e in extend) {
|
|
175
|
+
const elementProp = element[e];
|
|
176
|
+
const extendProp = extend[e];
|
|
177
|
+
if (e === "parent" || e === "props")
|
|
178
|
+
continue;
|
|
179
|
+
if (elementProp === void 0) {
|
|
180
|
+
element[e] = extendProp;
|
|
181
|
+
} else if (isObjectLike(elementProp) && isObject(extendProp)) {
|
|
182
|
+
deepMerge(elementProp, extendProp);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return element;
|
|
186
|
+
};
|
|
187
|
+
var clone = (obj2) => {
|
|
188
|
+
const o = {};
|
|
189
|
+
for (const prop2 in obj2) {
|
|
190
|
+
if (prop2 === "node")
|
|
191
|
+
continue;
|
|
192
|
+
o[prop2] = obj2[prop2];
|
|
193
|
+
}
|
|
194
|
+
return o;
|
|
195
|
+
};
|
|
196
|
+
var deepCloneExclude = (obj2, exclude = []) => {
|
|
197
|
+
if (isArray(obj2)) {
|
|
198
|
+
return obj2.map((x) => deepCloneExclude(x, exclude));
|
|
199
|
+
}
|
|
200
|
+
const o = {};
|
|
201
|
+
for (const k in obj2) {
|
|
202
|
+
if (exclude.indexOf(k) > -1)
|
|
203
|
+
continue;
|
|
204
|
+
let v = obj2[k];
|
|
205
|
+
if (k === "extend" && isArray(v)) {
|
|
206
|
+
v = mergeArrayExclude(v, exclude);
|
|
207
|
+
}
|
|
208
|
+
if (isArray(v)) {
|
|
209
|
+
o[k] = v.map((x) => deepCloneExclude(x, exclude));
|
|
210
|
+
} else if (isObject(v)) {
|
|
211
|
+
o[k] = deepCloneExclude(v, exclude);
|
|
212
|
+
} else
|
|
213
|
+
o[k] = v;
|
|
214
|
+
}
|
|
215
|
+
return o;
|
|
216
|
+
};
|
|
217
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
218
|
+
return arr.reduce((acc, curr) => deepMerge(acc, deepCloneExclude(curr, excl)), {});
|
|
219
|
+
};
|
|
220
|
+
var deepClone = (obj2) => {
|
|
221
|
+
if (isArray(obj2)) {
|
|
222
|
+
return obj2.map(deepClone);
|
|
223
|
+
}
|
|
224
|
+
const o = {};
|
|
225
|
+
for (const prop2 in obj2) {
|
|
226
|
+
let objProp2 = obj2[prop2];
|
|
227
|
+
if (prop2 === "extend" && isArray(objProp2)) {
|
|
228
|
+
objProp2 = mergeArray(objProp2);
|
|
229
|
+
}
|
|
230
|
+
if (isArray(objProp2)) {
|
|
231
|
+
o[prop2] = objProp2.map((v) => isObject(v) ? deepClone(v) : v);
|
|
232
|
+
} else if (isObject(objProp2)) {
|
|
233
|
+
o[prop2] = deepClone(objProp2);
|
|
234
|
+
} else
|
|
235
|
+
o[prop2] = objProp2;
|
|
236
|
+
}
|
|
237
|
+
return o;
|
|
238
|
+
};
|
|
239
|
+
var deepStringify = (obj2, stringified2 = {}) => {
|
|
240
|
+
for (const prop2 in obj2) {
|
|
241
|
+
const objProp2 = obj2[prop2];
|
|
242
|
+
if (isFunction(objProp2)) {
|
|
243
|
+
stringified2[prop2] = objProp2.toString();
|
|
244
|
+
} else if (isObject(objProp2)) {
|
|
245
|
+
stringified2[prop2] = {};
|
|
246
|
+
deepStringify(objProp2[prop2], stringified2[prop2]);
|
|
247
|
+
} else if (isArray(objProp2)) {
|
|
248
|
+
stringified2[prop2] = [];
|
|
249
|
+
objProp2.map((v, i) => deepStringify(v, stringified2[prop2][i]));
|
|
250
|
+
} else
|
|
251
|
+
stringified2[prop2] = objProp2;
|
|
252
|
+
}
|
|
253
|
+
return stringified2;
|
|
254
|
+
};
|
|
255
|
+
var deepDestringify = (obj, stringified = {}) => {
|
|
256
|
+
for (const prop in obj) {
|
|
257
|
+
const objProp = obj[prop];
|
|
258
|
+
if (isString(objProp)) {
|
|
259
|
+
if (objProp.includes("=>") || objProp.includes("function") || objProp[0] === "(") {
|
|
260
|
+
try {
|
|
261
|
+
const evalProp = eval(objProp);
|
|
262
|
+
stringified[prop] = evalProp;
|
|
263
|
+
} catch (e) {
|
|
264
|
+
if (e)
|
|
265
|
+
stringified[prop] = objProp;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
} else
|
|
269
|
+
stringified[prop] = objProp;
|
|
270
|
+
if (isObject(objProp))
|
|
271
|
+
deepDestringify(stringified[prop], stringified[prop]);
|
|
272
|
+
}
|
|
273
|
+
return stringified;
|
|
274
|
+
};
|
|
275
|
+
var overwrite = (element, params, options) => {
|
|
276
|
+
const { ref } = element;
|
|
277
|
+
const changes = {};
|
|
278
|
+
for (const e in params) {
|
|
279
|
+
if (e === "props")
|
|
280
|
+
continue;
|
|
281
|
+
const elementProp = element[e];
|
|
282
|
+
const paramsProp = params[e];
|
|
283
|
+
if (paramsProp) {
|
|
284
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
285
|
+
ref[e] = paramsProp;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return changes;
|
|
289
|
+
};
|
|
290
|
+
var diff = (obj2, original, cache) => {
|
|
291
|
+
const changes = cache || {};
|
|
292
|
+
for (const e in obj2) {
|
|
293
|
+
if (e === "ref")
|
|
294
|
+
continue;
|
|
295
|
+
const originalProp = original[e];
|
|
296
|
+
const objProp2 = obj2[e];
|
|
297
|
+
if (isObjectLike(originalProp) && isObjectLike(objProp2)) {
|
|
298
|
+
changes[e] = {};
|
|
299
|
+
diff(originalProp, objProp2, changes[e]);
|
|
300
|
+
} else if (objProp2 !== void 0) {
|
|
301
|
+
changes[e] = objProp2;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return changes;
|
|
305
|
+
};
|
|
306
|
+
var overwriteObj = (params, obj2) => {
|
|
307
|
+
const changes = {};
|
|
308
|
+
for (const e in params) {
|
|
309
|
+
const objProp2 = obj2[e];
|
|
310
|
+
const paramsProp = params[e];
|
|
311
|
+
if (paramsProp) {
|
|
312
|
+
obj2[e] = changes[e] = objProp2;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return changes;
|
|
316
|
+
};
|
|
317
|
+
var overwriteDeep = (params, obj2) => {
|
|
318
|
+
for (const e in params) {
|
|
319
|
+
const objProp2 = obj2[e];
|
|
320
|
+
const paramsProp = params[e];
|
|
321
|
+
if (isObjectLike(objProp2) && isObjectLike(paramsProp)) {
|
|
322
|
+
overwriteDeep(objProp2, paramsProp);
|
|
323
|
+
} else if (paramsProp !== void 0) {
|
|
324
|
+
obj2[e] = paramsProp;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return obj2;
|
|
328
|
+
};
|
|
329
|
+
var mergeIfExisted = (a, b) => {
|
|
330
|
+
if (isObjectLike(a) && isObjectLike(b))
|
|
331
|
+
return deepMerge(a, b);
|
|
332
|
+
return a || b;
|
|
333
|
+
};
|
|
334
|
+
var mergeArray = (arr) => {
|
|
335
|
+
return arr.reduce((a, c) => deepMerge(a, deepClone(c)), {});
|
|
336
|
+
};
|
|
337
|
+
var mergeAndCloneIfArray = (obj2) => {
|
|
338
|
+
return isArray(obj2) ? mergeArray(obj2) : deepClone(obj2);
|
|
339
|
+
};
|
|
340
|
+
var flattenRecursive = (param, prop2, stack = []) => {
|
|
341
|
+
const objectized = mergeAndCloneIfArray(param);
|
|
342
|
+
stack.push(objectized);
|
|
343
|
+
const extendOfExtend = objectized[prop2];
|
|
344
|
+
if (extendOfExtend)
|
|
345
|
+
flattenRecursive(extendOfExtend, prop2, stack);
|
|
346
|
+
delete objectized[prop2];
|
|
347
|
+
return stack;
|
|
348
|
+
};
|
|
349
|
+
var isEqualDeep = (param, element) => {
|
|
350
|
+
if (param === element)
|
|
351
|
+
return true;
|
|
352
|
+
if (!param || !element)
|
|
353
|
+
return false;
|
|
354
|
+
for (const prop2 in param) {
|
|
355
|
+
const paramProp = param[prop2];
|
|
356
|
+
const elementProp = element[prop2];
|
|
357
|
+
if (isObjectLike(paramProp)) {
|
|
358
|
+
const isEqual = isEqualDeep(paramProp, elementProp);
|
|
359
|
+
if (!isEqual)
|
|
360
|
+
return false;
|
|
361
|
+
} else {
|
|
362
|
+
const isEqual = paramProp === elementProp;
|
|
363
|
+
if (!isEqual)
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return true;
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
// ../../../domql/packages/utils/node.js
|
|
371
|
+
var createID = function() {
|
|
372
|
+
let index = 0;
|
|
373
|
+
function newId() {
|
|
374
|
+
index++;
|
|
375
|
+
return index;
|
|
376
|
+
}
|
|
377
|
+
return newId;
|
|
378
|
+
}();
|
|
840
379
|
|
|
841
380
|
// src/defaultConfig/index.js
|
|
842
381
|
var defaultConfig_exports = {};
|
|
@@ -964,7 +503,6 @@ var arrayze = (val) => {
|
|
|
964
503
|
var isFunction2 = (arg) => typeof arg === "function";
|
|
965
504
|
|
|
966
505
|
// src/utils/color.js
|
|
967
|
-
init_globals();
|
|
968
506
|
var ENV = "development";
|
|
969
507
|
var colorStringToRgbaArray = (color) => {
|
|
970
508
|
if (color === "")
|
|
@@ -1248,7 +786,7 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
1248
786
|
unit = UNIT2.default,
|
|
1249
787
|
useVariable
|
|
1250
788
|
} = sequenceProps;
|
|
1251
|
-
if ((
|
|
789
|
+
if (isString(value) && value.slice(0, 2) === "--")
|
|
1252
790
|
return `var(${value})`;
|
|
1253
791
|
const prefix = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
|
|
1254
792
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
@@ -1314,7 +852,7 @@ var findHeadings = (propertyNames) => {
|
|
|
1314
852
|
var setVariables = (result, key) => {
|
|
1315
853
|
const CONFIG2 = getActiveConfig();
|
|
1316
854
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
1317
|
-
if ((
|
|
855
|
+
if (isObjectLike(result.value)) {
|
|
1318
856
|
} else {
|
|
1319
857
|
CSS_VARS2[result.var] = result.value;
|
|
1320
858
|
}
|
|
@@ -1359,7 +897,7 @@ var generateSprite = (icons) => {
|
|
|
1359
897
|
return sprite;
|
|
1360
898
|
};
|
|
1361
899
|
var parseRootAttributes = (htmlString) => {
|
|
1362
|
-
if (!(
|
|
900
|
+
if (!isString(htmlString)) {
|
|
1363
901
|
return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
|
|
1364
902
|
}
|
|
1365
903
|
let match = htmlString.match(/<svg\s+(.*?)>/);
|
|
@@ -1505,20 +1043,20 @@ var CONFIG = {
|
|
|
1505
1043
|
CSS_VARS,
|
|
1506
1044
|
...defaultConfig_exports
|
|
1507
1045
|
};
|
|
1508
|
-
var cachedConfig = (
|
|
1046
|
+
var cachedConfig = deepClone(CONFIG);
|
|
1509
1047
|
var FACTORY = {
|
|
1510
1048
|
active: "0",
|
|
1511
1049
|
0: CONFIG
|
|
1512
1050
|
};
|
|
1513
1051
|
var activateConfig = (def) => {
|
|
1514
|
-
if ((
|
|
1052
|
+
if (isDefined(def)) {
|
|
1515
1053
|
FACTORY.active = def;
|
|
1516
1054
|
}
|
|
1517
1055
|
return FACTORY[def || FACTORY.active];
|
|
1518
1056
|
};
|
|
1519
1057
|
var getActiveConfig = (def) => {
|
|
1520
|
-
if ((
|
|
1521
|
-
FACTORY[def] = (
|
|
1058
|
+
if (isDefined(def) && !FACTORY[def]) {
|
|
1059
|
+
FACTORY[def] = deepClone(cachedConfig);
|
|
1522
1060
|
return FACTORY[def];
|
|
1523
1061
|
}
|
|
1524
1062
|
return FACTORY[def || FACTORY.active];
|
|
@@ -1530,7 +1068,7 @@ var setActiveConfig = (def) => {
|
|
|
1530
1068
|
// src/system/color.js
|
|
1531
1069
|
var getColor = (value, key) => {
|
|
1532
1070
|
const CONFIG2 = getActiveConfig();
|
|
1533
|
-
if (!(
|
|
1071
|
+
if (!isString(value)) {
|
|
1534
1072
|
if (CONFIG2.verbose)
|
|
1535
1073
|
console.warn(value, "- type for color is not valid");
|
|
1536
1074
|
return;
|
|
@@ -1539,7 +1077,7 @@ var getColor = (value, key) => {
|
|
|
1539
1077
|
return `var(${value})`;
|
|
1540
1078
|
if (key && value[key])
|
|
1541
1079
|
value = value[key];
|
|
1542
|
-
const [name, alpha, tone] = (
|
|
1080
|
+
const [name, alpha, tone] = isArray(value) ? value : value.split(" ");
|
|
1543
1081
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
1544
1082
|
let val = COLOR2[name] || GRADIENT2[name];
|
|
1545
1083
|
if (!val) {
|
|
@@ -1581,17 +1119,17 @@ var getMediaColor = (value, property, globalTheme) => {
|
|
|
1581
1119
|
const CONFIG2 = getActiveConfig();
|
|
1582
1120
|
if (!globalTheme)
|
|
1583
1121
|
globalTheme = CONFIG2.globalTheme;
|
|
1584
|
-
if (!(
|
|
1122
|
+
if (!isString(value)) {
|
|
1585
1123
|
if (CONFIG2.verbose)
|
|
1586
1124
|
console.warn(value, "- type for color is not valid");
|
|
1587
1125
|
return;
|
|
1588
1126
|
}
|
|
1589
1127
|
if (value.slice(0, 2) === "--")
|
|
1590
1128
|
return { [property]: `var(${value})` };
|
|
1591
|
-
const [name] = (
|
|
1129
|
+
const [name] = isArray(value) ? value : value.split(" ");
|
|
1592
1130
|
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
1593
1131
|
const val = COLOR2[name] || GRADIENT2[name];
|
|
1594
|
-
const isObj = (
|
|
1132
|
+
const isObj = isObject(val);
|
|
1595
1133
|
if (isObj && val.value)
|
|
1596
1134
|
return { [property]: getColor(value, globalTheme) };
|
|
1597
1135
|
else if (isObj) {
|
|
@@ -1614,15 +1152,15 @@ var getMediaColor = (value, property, globalTheme) => {
|
|
|
1614
1152
|
};
|
|
1615
1153
|
var setColor = (val, key, suffix) => {
|
|
1616
1154
|
const CONFIG2 = getActiveConfig();
|
|
1617
|
-
if ((
|
|
1155
|
+
if (isString(val) && val.slice(0, 2) === "--")
|
|
1618
1156
|
val = getColor(val.slice(2));
|
|
1619
|
-
if ((
|
|
1157
|
+
if (isArray(val)) {
|
|
1620
1158
|
return {
|
|
1621
1159
|
"@light": setColor(val[0], key, "light"),
|
|
1622
1160
|
"@dark": setColor(val[1], key, "dark")
|
|
1623
1161
|
};
|
|
1624
1162
|
}
|
|
1625
|
-
if ((
|
|
1163
|
+
if (isObject(val)) {
|
|
1626
1164
|
const obj2 = {};
|
|
1627
1165
|
for (const variant in val)
|
|
1628
1166
|
obj2[variant] = setColor(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
@@ -1645,15 +1183,15 @@ var setColor = (val, key, suffix) => {
|
|
|
1645
1183
|
};
|
|
1646
1184
|
var setGradient = (val, key, suffix) => {
|
|
1647
1185
|
const CONFIG2 = getActiveConfig();
|
|
1648
|
-
if ((
|
|
1186
|
+
if (isString(val) && val.slice(0, 2) === "--")
|
|
1649
1187
|
val = getColor(val.slice(2));
|
|
1650
|
-
if ((
|
|
1188
|
+
if (isArray(val)) {
|
|
1651
1189
|
return {
|
|
1652
1190
|
"@light": setGradient(val[0], key, "light"),
|
|
1653
1191
|
"@dark": setGradient(val[0], key, "dark")
|
|
1654
1192
|
};
|
|
1655
1193
|
}
|
|
1656
|
-
if ((
|
|
1194
|
+
if (isObject(val)) {
|
|
1657
1195
|
const obj2 = {};
|
|
1658
1196
|
for (const variant in val)
|
|
1659
1197
|
obj2[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
@@ -1692,7 +1230,7 @@ var getTheme = (value, modifier) => {
|
|
|
1692
1230
|
if (CONFIG2.useVariable)
|
|
1693
1231
|
return getMediaTheme(value, modifier);
|
|
1694
1232
|
const { THEME: THEME2 } = CONFIG2;
|
|
1695
|
-
if ((
|
|
1233
|
+
if (isString(value)) {
|
|
1696
1234
|
const [theme, subtheme] = value.split(" ");
|
|
1697
1235
|
const isOurTheme = THEME2[theme];
|
|
1698
1236
|
if (isOurTheme) {
|
|
@@ -1701,7 +1239,7 @@ var getTheme = (value, modifier) => {
|
|
|
1701
1239
|
value = [theme, subtheme || modifier];
|
|
1702
1240
|
}
|
|
1703
1241
|
}
|
|
1704
|
-
if ((
|
|
1242
|
+
if (isObjectLike(value) && value[1]) {
|
|
1705
1243
|
const themeName = value[0];
|
|
1706
1244
|
const subThemeName = value[1];
|
|
1707
1245
|
const { helpers, media, state } = THEME2[themeName];
|
|
@@ -1711,11 +1249,11 @@ var getTheme = (value, modifier) => {
|
|
|
1711
1249
|
return getThemeValue(helpers[subThemeName]);
|
|
1712
1250
|
if (state && state[subThemeName])
|
|
1713
1251
|
return getThemeValue(state[subThemeName]);
|
|
1714
|
-
} else if ((
|
|
1252
|
+
} else if (isObject(value))
|
|
1715
1253
|
return setThemeValue(value);
|
|
1716
1254
|
};
|
|
1717
1255
|
var setInverseTheme = (theme, variant, value) => {
|
|
1718
|
-
if ((
|
|
1256
|
+
if (isObject(variant)) {
|
|
1719
1257
|
theme.variants.inverse.value = setThemeValue(variant);
|
|
1720
1258
|
} else if (variant === true) {
|
|
1721
1259
|
const { color, background } = value;
|
|
@@ -1730,7 +1268,7 @@ var setInverseTheme = (theme, variant, value) => {
|
|
|
1730
1268
|
var setPseudo = (theme, key, variant, themeValue) => {
|
|
1731
1269
|
const result = getTheme(variant);
|
|
1732
1270
|
themeValue[`&:${key}`] = result;
|
|
1733
|
-
if ((
|
|
1271
|
+
if (isObject(variant) && !variant.value)
|
|
1734
1272
|
variant.value = result;
|
|
1735
1273
|
};
|
|
1736
1274
|
var setSelectors = (theme, value) => {
|
|
@@ -1748,7 +1286,7 @@ var setSelectors = (theme, value) => {
|
|
|
1748
1286
|
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
1749
1287
|
const result = getTheme(variant);
|
|
1750
1288
|
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
1751
|
-
if ((
|
|
1289
|
+
if (isObject(variant) && !variant.value)
|
|
1752
1290
|
variant.value = result;
|
|
1753
1291
|
};
|
|
1754
1292
|
var setMedia = (theme, value) => {
|
|
@@ -1774,7 +1312,7 @@ var setHelpers = (theme, value) => {
|
|
|
1774
1312
|
const keys = Object.keys(helpers);
|
|
1775
1313
|
keys.map((key) => {
|
|
1776
1314
|
const helper = helpers[key];
|
|
1777
|
-
if ((
|
|
1315
|
+
if (isString(helper))
|
|
1778
1316
|
helpers[key] = CONFIG2.THEME[helper];
|
|
1779
1317
|
else
|
|
1780
1318
|
getThemeValue(helpers[key]);
|
|
@@ -1798,7 +1336,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
1798
1336
|
const CONFIG2 = getActiveConfig();
|
|
1799
1337
|
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
1800
1338
|
const theme = { value: val };
|
|
1801
|
-
if ((
|
|
1339
|
+
if (isObjectLike(val)) {
|
|
1802
1340
|
for (const param in val) {
|
|
1803
1341
|
const symb = param.slice(0, 1);
|
|
1804
1342
|
const value = val[param];
|
|
@@ -1826,7 +1364,7 @@ var setMediaTheme = (val, key, suffix, prefers) => {
|
|
|
1826
1364
|
};
|
|
1827
1365
|
}
|
|
1828
1366
|
}
|
|
1829
|
-
if ((
|
|
1367
|
+
if (isString(val) && val.slice(0, 2) === "--") {
|
|
1830
1368
|
const { THEME: THEME2 } = CONFIG2;
|
|
1831
1369
|
const value = THEME2[val.slice(2)];
|
|
1832
1370
|
const getReferenced = getMediaTheme(value, prefers);
|
|
@@ -1839,7 +1377,7 @@ var recursiveTheme = (val) => {
|
|
|
1839
1377
|
const obj2 = {};
|
|
1840
1378
|
for (const param in val) {
|
|
1841
1379
|
const symb = param.slice(0, 1);
|
|
1842
|
-
if ((
|
|
1380
|
+
if (isObjectLike(val[param])) {
|
|
1843
1381
|
if (symb === "@") {
|
|
1844
1382
|
const query = CONFIG2.MEDIA[param.slice(1)];
|
|
1845
1383
|
const media = `@media screen and ${query}`;
|
|
@@ -1859,23 +1397,23 @@ var findModifierFromArray = (val, modifierArray) => {
|
|
|
1859
1397
|
return val;
|
|
1860
1398
|
};
|
|
1861
1399
|
var findModifier = (val, modifier) => {
|
|
1862
|
-
if ((
|
|
1400
|
+
if (isArray(modifier))
|
|
1863
1401
|
return findModifierFromArray(val, modifier);
|
|
1864
|
-
else if ((
|
|
1402
|
+
else if (isString(modifier) && val[modifier])
|
|
1865
1403
|
return val[modifier];
|
|
1866
1404
|
else
|
|
1867
1405
|
return val;
|
|
1868
1406
|
};
|
|
1869
1407
|
var getMediaTheme = (val, mod) => {
|
|
1870
1408
|
const CONFIG2 = getActiveConfig();
|
|
1871
|
-
if ((
|
|
1409
|
+
if (isString(val) && val.slice(0, 2) === "--")
|
|
1872
1410
|
val = getMediaTheme(val.slice(2));
|
|
1873
|
-
if (!val || !(
|
|
1411
|
+
if (!val || !isString(val)) {
|
|
1874
1412
|
if (CONFIG2.verbose)
|
|
1875
1413
|
console.warn(val, "- theme is not string");
|
|
1876
1414
|
return;
|
|
1877
1415
|
}
|
|
1878
|
-
const [name, ...modifier] = (
|
|
1416
|
+
const [name, ...modifier] = isArray(val) ? val : val.split(" ");
|
|
1879
1417
|
let value = CONFIG2.THEME[name];
|
|
1880
1418
|
if (value && (modifier || mod)) {
|
|
1881
1419
|
value = findModifier(value, modifier.length ? modifier : mod);
|
|
@@ -1901,7 +1439,7 @@ var setFontFamily = (val, key) => {
|
|
|
1901
1439
|
let { value, type } = val;
|
|
1902
1440
|
if (val.isDefault)
|
|
1903
1441
|
FONT_FAMILY2.default = key;
|
|
1904
|
-
if ((
|
|
1442
|
+
if (isObject(value))
|
|
1905
1443
|
value = arrayze(value);
|
|
1906
1444
|
const CSSvar = `--font-family-${key}`;
|
|
1907
1445
|
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
@@ -2021,7 +1559,7 @@ var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
|
2021
1559
|
const stack = arrayze(value);
|
|
2022
1560
|
if (!stack)
|
|
2023
1561
|
return;
|
|
2024
|
-
if ((
|
|
1562
|
+
if (isString(value) && value.includes("calc")) {
|
|
2025
1563
|
return { [propertyName]: value };
|
|
2026
1564
|
}
|
|
2027
1565
|
if (stack.length > 1) {
|
|
@@ -2114,7 +1652,6 @@ var applyDocument = () => {
|
|
|
2114
1652
|
};
|
|
2115
1653
|
|
|
2116
1654
|
// src/system/svg.js
|
|
2117
|
-
init_globals();
|
|
2118
1655
|
var DEF_OPTIONS = {
|
|
2119
1656
|
document: document2
|
|
2120
1657
|
};
|
|
@@ -2183,7 +1720,7 @@ var applyReset = (reset = {}) => {
|
|
|
2183
1720
|
configReset.h6 = configTemplates.h6;
|
|
2184
1721
|
}
|
|
2185
1722
|
const { body, ...templates } = TYPOGRAPHY2.templates;
|
|
2186
|
-
return (
|
|
1723
|
+
return deepMerge(merge(RESET2, reset), {
|
|
2187
1724
|
html: {
|
|
2188
1725
|
position: "absolute",
|
|
2189
1726
|
overflow: "hidden",
|