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