@symbo.ls/scratch 2.11.94 → 2.11.131

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