@stylexjs/babel-plugin 0.16.3 → 0.17.1
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/lib/index.js +994 -1837
- package/lib/index.js.flow +1 -0
- package/lib/shared/common-types.d.ts +1 -0
- package/lib/shared/common-types.js.flow +9 -0
- package/lib/shared/hash.d.ts +3 -0
- package/lib/shared/index.d.ts +13 -1
- package/lib/shared/index.js.flow +1 -1
- package/lib/shared/messages.d.ts +32 -0
- package/lib/shared/physical-rtl/generate-ltr.d.ts +1 -1
- package/lib/shared/physical-rtl/generate-ltr.js.flow +1 -1
- package/lib/shared/physical-rtl/generate-rtl.d.ts +1 -1
- package/lib/shared/physical-rtl/generate-rtl.js.flow +1 -1
- package/lib/shared/preprocess-rules/application-order.d.ts +35 -34
- package/lib/shared/preprocess-rules/application-order.js.flow +35 -29
- package/lib/shared/preprocess-rules/basic-validation.d.ts +1 -1
- package/lib/shared/preprocess-rules/basic-validation.js.flow +1 -1
- package/lib/shared/preprocess-rules/legacy-expand-shorthands.d.ts +26 -15
- package/lib/shared/preprocess-rules/legacy-expand-shorthands.js.flow +19 -14
- package/lib/shared/preprocess-rules/property-specificity.d.ts +12 -11
- package/lib/shared/preprocess-rules/property-specificity.js.flow +12 -6
- package/lib/shared/stylex-define-consts.d.ts +1 -1
- package/lib/shared/stylex-keyframes.d.ts +1 -1
- package/lib/shared/stylex-keyframes.js.flow +1 -1
- package/lib/shared/stylex-position-try.d.ts +1 -1
- package/lib/shared/stylex-position-try.js.flow +1 -1
- package/lib/shared/stylex-vars-utils.d.ts +2 -2
- package/lib/shared/stylex-vars-utils.js.flow +3 -3
- package/lib/shared/stylex-view-transition-class.d.ts +1 -1
- package/lib/shared/stylex-view-transition-class.js.flow +1 -1
- package/lib/shared/types/index.d.ts +14 -0
- package/lib/shared/types/index.js.flow +1 -1
- package/lib/shared/utils/convert-to-className.d.ts +1 -1
- package/lib/shared/utils/convert-to-className.js.flow +1 -1
- package/lib/shared/utils/default-options.d.ts +1 -0
- package/lib/shared/utils/file-based-identifier.js.flow +1 -1
- package/lib/shared/utils/generate-css-rule.d.ts +1 -1
- package/lib/shared/utils/generate-css-rule.js.flow +1 -1
- package/lib/shared/utils/normalize-value.js.flow +1 -1
- package/lib/shared/utils/object-utils.d.ts +10 -8
- package/lib/shared/utils/object-utils.js.flow +2 -2
- package/lib/shared/utils/rule-utils.d.ts +2 -0
- package/lib/shared/utils/transform-value.d.ts +2 -0
- package/lib/shared/validate.js.flow +3 -1
- package/lib/shared/when/when.d.ts +10 -10
- package/lib/shared/when/when.js.flow +10 -10
- package/lib/utils/evaluate-path.d.ts +3 -2
- package/lib/utils/evaluate-path.js.flow +3 -2
- package/lib/utils/evaluation-errors.d.ts +15 -0
- package/lib/utils/js-to-ast.d.ts +0 -4
- package/lib/utils/js-to-ast.js.flow +0 -6
- package/lib/utils/state-manager.d.ts +41 -35
- package/lib/utils/state-manager.js.flow +5 -0
- package/lib/utils/validate.d.ts +18 -3
- package/lib/utils/validate.js.flow +5 -3
- package/lib/visitors/parse-stylex-create-arg.d.ts +1 -1
- package/lib/visitors/parse-stylex-create-arg.js.flow +1 -1
- package/lib/visitors/stylex-default-target.d.ts +20 -0
- package/lib/visitors/stylex-default-target.js.flow +21 -0
- package/lib/visitors/stylex-define-marker.d.ts +22 -0
- package/lib/visitors/stylex-define-marker.js.flow +22 -0
- package/package.json +5 -4
package/lib/index.js
CHANGED
|
@@ -5,7 +5,8 @@ var path = require('node:path');
|
|
|
5
5
|
var fs = require('node:fs');
|
|
6
6
|
var url$1 = require('node:url');
|
|
7
7
|
var importMetaResolve = require('@dual-bundle/import-meta-resolve');
|
|
8
|
-
var
|
|
8
|
+
var helperModuleImports = require('@babel/helper-module-imports');
|
|
9
|
+
var parser = require('postcss-value-parser');
|
|
9
10
|
var core = require('@babel/core');
|
|
10
11
|
var traverse = require('@babel/traverse');
|
|
11
12
|
var stylex = require('@stylexjs/stylex');
|
|
@@ -42,6 +43,12 @@ const string = (message = defaultMessage('a string')) => (value, name) => {
|
|
|
42
43
|
return value;
|
|
43
44
|
};
|
|
44
45
|
const nullish = (message = defaultMessage('`null` or `undefined`')) => (value, name) => value == null ? value : new Error(message(value, name));
|
|
46
|
+
const optional = check => (value, name) => {
|
|
47
|
+
if (value === undefined) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
return check(value, name);
|
|
51
|
+
};
|
|
45
52
|
const boolean = (message = defaultMessage('a boolean')) => (value, name) => {
|
|
46
53
|
if (typeof value !== 'boolean') {
|
|
47
54
|
return new Error(message(value, name));
|
|
@@ -162,524 +169,6 @@ const logAndDefault = (check, value, def, name) => {
|
|
|
162
169
|
return result;
|
|
163
170
|
};
|
|
164
171
|
|
|
165
|
-
function getDefaultExportFromCjs (x) {
|
|
166
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
var lib$2 = {};
|
|
170
|
-
|
|
171
|
-
var importInjector = {};
|
|
172
|
-
|
|
173
|
-
var importBuilder = {};
|
|
174
|
-
|
|
175
|
-
var hasRequiredImportBuilder;
|
|
176
|
-
|
|
177
|
-
function requireImportBuilder () {
|
|
178
|
-
if (hasRequiredImportBuilder) return importBuilder;
|
|
179
|
-
hasRequiredImportBuilder = 1;
|
|
180
|
-
|
|
181
|
-
Object.defineProperty(importBuilder, "__esModule", {
|
|
182
|
-
value: true
|
|
183
|
-
});
|
|
184
|
-
importBuilder.default = void 0;
|
|
185
|
-
var _assert = require$$0;
|
|
186
|
-
var _t = t;
|
|
187
|
-
const {
|
|
188
|
-
callExpression,
|
|
189
|
-
cloneNode,
|
|
190
|
-
expressionStatement,
|
|
191
|
-
identifier,
|
|
192
|
-
importDeclaration,
|
|
193
|
-
importDefaultSpecifier,
|
|
194
|
-
importNamespaceSpecifier,
|
|
195
|
-
importSpecifier,
|
|
196
|
-
memberExpression,
|
|
197
|
-
stringLiteral,
|
|
198
|
-
variableDeclaration,
|
|
199
|
-
variableDeclarator
|
|
200
|
-
} = _t;
|
|
201
|
-
class ImportBuilder {
|
|
202
|
-
constructor(importedSource, scope, hub) {
|
|
203
|
-
this._statements = [];
|
|
204
|
-
this._resultName = null;
|
|
205
|
-
this._importedSource = void 0;
|
|
206
|
-
this._scope = scope;
|
|
207
|
-
this._hub = hub;
|
|
208
|
-
this._importedSource = importedSource;
|
|
209
|
-
}
|
|
210
|
-
done() {
|
|
211
|
-
return {
|
|
212
|
-
statements: this._statements,
|
|
213
|
-
resultName: this._resultName
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
import() {
|
|
217
|
-
this._statements.push(importDeclaration([], stringLiteral(this._importedSource)));
|
|
218
|
-
return this;
|
|
219
|
-
}
|
|
220
|
-
require() {
|
|
221
|
-
this._statements.push(expressionStatement(callExpression(identifier("require"), [stringLiteral(this._importedSource)])));
|
|
222
|
-
return this;
|
|
223
|
-
}
|
|
224
|
-
namespace(name = "namespace") {
|
|
225
|
-
const local = this._scope.generateUidIdentifier(name);
|
|
226
|
-
const statement = this._statements[this._statements.length - 1];
|
|
227
|
-
_assert(statement.type === "ImportDeclaration");
|
|
228
|
-
_assert(statement.specifiers.length === 0);
|
|
229
|
-
statement.specifiers = [importNamespaceSpecifier(local)];
|
|
230
|
-
this._resultName = cloneNode(local);
|
|
231
|
-
return this;
|
|
232
|
-
}
|
|
233
|
-
default(name) {
|
|
234
|
-
const id = this._scope.generateUidIdentifier(name);
|
|
235
|
-
const statement = this._statements[this._statements.length - 1];
|
|
236
|
-
_assert(statement.type === "ImportDeclaration");
|
|
237
|
-
_assert(statement.specifiers.length === 0);
|
|
238
|
-
statement.specifiers = [importDefaultSpecifier(id)];
|
|
239
|
-
this._resultName = cloneNode(id);
|
|
240
|
-
return this;
|
|
241
|
-
}
|
|
242
|
-
named(name, importName) {
|
|
243
|
-
if (importName === "default") return this.default(name);
|
|
244
|
-
const id = this._scope.generateUidIdentifier(name);
|
|
245
|
-
const statement = this._statements[this._statements.length - 1];
|
|
246
|
-
_assert(statement.type === "ImportDeclaration");
|
|
247
|
-
_assert(statement.specifiers.length === 0);
|
|
248
|
-
statement.specifiers = [importSpecifier(id, identifier(importName))];
|
|
249
|
-
this._resultName = cloneNode(id);
|
|
250
|
-
return this;
|
|
251
|
-
}
|
|
252
|
-
var(name) {
|
|
253
|
-
const id = this._scope.generateUidIdentifier(name);
|
|
254
|
-
let statement = this._statements[this._statements.length - 1];
|
|
255
|
-
if (statement.type !== "ExpressionStatement") {
|
|
256
|
-
_assert(this._resultName);
|
|
257
|
-
statement = expressionStatement(this._resultName);
|
|
258
|
-
this._statements.push(statement);
|
|
259
|
-
}
|
|
260
|
-
this._statements[this._statements.length - 1] = variableDeclaration("var", [variableDeclarator(id, statement.expression)]);
|
|
261
|
-
this._resultName = cloneNode(id);
|
|
262
|
-
return this;
|
|
263
|
-
}
|
|
264
|
-
defaultInterop() {
|
|
265
|
-
return this._interop(this._hub.addHelper("interopRequireDefault"));
|
|
266
|
-
}
|
|
267
|
-
wildcardInterop() {
|
|
268
|
-
return this._interop(this._hub.addHelper("interopRequireWildcard"));
|
|
269
|
-
}
|
|
270
|
-
_interop(callee) {
|
|
271
|
-
const statement = this._statements[this._statements.length - 1];
|
|
272
|
-
if (statement.type === "ExpressionStatement") {
|
|
273
|
-
statement.expression = callExpression(callee, [statement.expression]);
|
|
274
|
-
} else if (statement.type === "VariableDeclaration") {
|
|
275
|
-
_assert(statement.declarations.length === 1);
|
|
276
|
-
statement.declarations[0].init = callExpression(callee, [statement.declarations[0].init]);
|
|
277
|
-
} else {
|
|
278
|
-
_assert.fail("Unexpected type.");
|
|
279
|
-
}
|
|
280
|
-
return this;
|
|
281
|
-
}
|
|
282
|
-
prop(name) {
|
|
283
|
-
const statement = this._statements[this._statements.length - 1];
|
|
284
|
-
if (statement.type === "ExpressionStatement") {
|
|
285
|
-
statement.expression = memberExpression(statement.expression, identifier(name));
|
|
286
|
-
} else if (statement.type === "VariableDeclaration") {
|
|
287
|
-
_assert(statement.declarations.length === 1);
|
|
288
|
-
statement.declarations[0].init = memberExpression(statement.declarations[0].init, identifier(name));
|
|
289
|
-
} else {
|
|
290
|
-
_assert.fail("Unexpected type:" + statement.type);
|
|
291
|
-
}
|
|
292
|
-
return this;
|
|
293
|
-
}
|
|
294
|
-
read(name) {
|
|
295
|
-
this._resultName = memberExpression(this._resultName, identifier(name));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
importBuilder.default = ImportBuilder;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
return importBuilder;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
var isModule = {};
|
|
305
|
-
|
|
306
|
-
var hasRequiredIsModule;
|
|
307
|
-
|
|
308
|
-
function requireIsModule () {
|
|
309
|
-
if (hasRequiredIsModule) return isModule;
|
|
310
|
-
hasRequiredIsModule = 1;
|
|
311
|
-
|
|
312
|
-
Object.defineProperty(isModule, "__esModule", {
|
|
313
|
-
value: true
|
|
314
|
-
});
|
|
315
|
-
isModule.default = isModule$1;
|
|
316
|
-
function isModule$1(path) {
|
|
317
|
-
return path.node.sourceType === "module";
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return isModule;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
var hasRequiredImportInjector;
|
|
325
|
-
|
|
326
|
-
function requireImportInjector () {
|
|
327
|
-
if (hasRequiredImportInjector) return importInjector;
|
|
328
|
-
hasRequiredImportInjector = 1;
|
|
329
|
-
|
|
330
|
-
Object.defineProperty(importInjector, "__esModule", {
|
|
331
|
-
value: true
|
|
332
|
-
});
|
|
333
|
-
importInjector.default = void 0;
|
|
334
|
-
var _assert = require$$0;
|
|
335
|
-
var _t = t;
|
|
336
|
-
var _importBuilder = requireImportBuilder();
|
|
337
|
-
var _isModule = requireIsModule();
|
|
338
|
-
const {
|
|
339
|
-
identifier,
|
|
340
|
-
importSpecifier,
|
|
341
|
-
numericLiteral,
|
|
342
|
-
sequenceExpression,
|
|
343
|
-
isImportDeclaration
|
|
344
|
-
} = _t;
|
|
345
|
-
class ImportInjector {
|
|
346
|
-
constructor(path, importedSource, opts) {
|
|
347
|
-
this._defaultOpts = {
|
|
348
|
-
importedSource: null,
|
|
349
|
-
importedType: "commonjs",
|
|
350
|
-
importedInterop: "babel",
|
|
351
|
-
importingInterop: "babel",
|
|
352
|
-
ensureLiveReference: false,
|
|
353
|
-
ensureNoContext: false,
|
|
354
|
-
importPosition: "before"
|
|
355
|
-
};
|
|
356
|
-
const programPath = path.find(p => p.isProgram());
|
|
357
|
-
this._programPath = programPath;
|
|
358
|
-
this._programScope = programPath.scope;
|
|
359
|
-
this._hub = programPath.hub;
|
|
360
|
-
this._defaultOpts = this._applyDefaults(importedSource, opts, true);
|
|
361
|
-
}
|
|
362
|
-
addDefault(importedSourceIn, opts) {
|
|
363
|
-
return this.addNamed("default", importedSourceIn, opts);
|
|
364
|
-
}
|
|
365
|
-
addNamed(importName, importedSourceIn, opts) {
|
|
366
|
-
_assert(typeof importName === "string");
|
|
367
|
-
return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName);
|
|
368
|
-
}
|
|
369
|
-
addNamespace(importedSourceIn, opts) {
|
|
370
|
-
return this._generateImport(this._applyDefaults(importedSourceIn, opts), null);
|
|
371
|
-
}
|
|
372
|
-
addSideEffect(importedSourceIn, opts) {
|
|
373
|
-
return this._generateImport(this._applyDefaults(importedSourceIn, opts), void 0);
|
|
374
|
-
}
|
|
375
|
-
_applyDefaults(importedSource, opts, isInit = false) {
|
|
376
|
-
let newOpts;
|
|
377
|
-
if (typeof importedSource === "string") {
|
|
378
|
-
newOpts = Object.assign({}, this._defaultOpts, {
|
|
379
|
-
importedSource
|
|
380
|
-
}, opts);
|
|
381
|
-
} else {
|
|
382
|
-
_assert(!opts, "Unexpected secondary arguments.");
|
|
383
|
-
newOpts = Object.assign({}, this._defaultOpts, importedSource);
|
|
384
|
-
}
|
|
385
|
-
if (!isInit && opts) {
|
|
386
|
-
if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;
|
|
387
|
-
if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;
|
|
388
|
-
}
|
|
389
|
-
return newOpts;
|
|
390
|
-
}
|
|
391
|
-
_generateImport(opts, importName) {
|
|
392
|
-
const isDefault = importName === "default";
|
|
393
|
-
const isNamed = !!importName && !isDefault;
|
|
394
|
-
const isNamespace = importName === null;
|
|
395
|
-
const {
|
|
396
|
-
importedSource,
|
|
397
|
-
importedType,
|
|
398
|
-
importedInterop,
|
|
399
|
-
importingInterop,
|
|
400
|
-
ensureLiveReference,
|
|
401
|
-
ensureNoContext,
|
|
402
|
-
nameHint,
|
|
403
|
-
importPosition,
|
|
404
|
-
blockHoist
|
|
405
|
-
} = opts;
|
|
406
|
-
let name = nameHint || importName;
|
|
407
|
-
const isMod = (0, _isModule.default)(this._programPath);
|
|
408
|
-
const isModuleForNode = isMod && importingInterop === "node";
|
|
409
|
-
const isModuleForBabel = isMod && importingInterop === "babel";
|
|
410
|
-
if (importPosition === "after" && !isMod) {
|
|
411
|
-
throw new Error(`"importPosition": "after" is only supported in modules`);
|
|
412
|
-
}
|
|
413
|
-
const builder = new _importBuilder.default(importedSource, this._programScope, this._hub);
|
|
414
|
-
if (importedType === "es6") {
|
|
415
|
-
if (!isModuleForNode && !isModuleForBabel) {
|
|
416
|
-
throw new Error("Cannot import an ES6 module from CommonJS");
|
|
417
|
-
}
|
|
418
|
-
builder.import();
|
|
419
|
-
if (isNamespace) {
|
|
420
|
-
builder.namespace(nameHint || importedSource);
|
|
421
|
-
} else if (isDefault || isNamed) {
|
|
422
|
-
builder.named(name, importName);
|
|
423
|
-
}
|
|
424
|
-
} else if (importedType !== "commonjs") {
|
|
425
|
-
throw new Error(`Unexpected interopType "${importedType}"`);
|
|
426
|
-
} else if (importedInterop === "babel") {
|
|
427
|
-
if (isModuleForNode) {
|
|
428
|
-
name = name !== "default" ? name : importedSource;
|
|
429
|
-
const es6Default = `${importedSource}$es6Default`;
|
|
430
|
-
builder.import();
|
|
431
|
-
if (isNamespace) {
|
|
432
|
-
builder.default(es6Default).var(name || importedSource).wildcardInterop();
|
|
433
|
-
} else if (isDefault) {
|
|
434
|
-
if (ensureLiveReference) {
|
|
435
|
-
builder.default(es6Default).var(name || importedSource).defaultInterop().read("default");
|
|
436
|
-
} else {
|
|
437
|
-
builder.default(es6Default).var(name).defaultInterop().prop(importName);
|
|
438
|
-
}
|
|
439
|
-
} else if (isNamed) {
|
|
440
|
-
builder.default(es6Default).read(importName);
|
|
441
|
-
}
|
|
442
|
-
} else if (isModuleForBabel) {
|
|
443
|
-
builder.import();
|
|
444
|
-
if (isNamespace) {
|
|
445
|
-
builder.namespace(name || importedSource);
|
|
446
|
-
} else if (isDefault || isNamed) {
|
|
447
|
-
builder.named(name, importName);
|
|
448
|
-
}
|
|
449
|
-
} else {
|
|
450
|
-
builder.require();
|
|
451
|
-
if (isNamespace) {
|
|
452
|
-
builder.var(name || importedSource).wildcardInterop();
|
|
453
|
-
} else if ((isDefault || isNamed) && ensureLiveReference) {
|
|
454
|
-
if (isDefault) {
|
|
455
|
-
name = name !== "default" ? name : importedSource;
|
|
456
|
-
builder.var(name).read(importName);
|
|
457
|
-
builder.defaultInterop();
|
|
458
|
-
} else {
|
|
459
|
-
builder.var(importedSource).read(importName);
|
|
460
|
-
}
|
|
461
|
-
} else if (isDefault) {
|
|
462
|
-
builder.var(name).defaultInterop().prop(importName);
|
|
463
|
-
} else if (isNamed) {
|
|
464
|
-
builder.var(name).prop(importName);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
} else if (importedInterop === "compiled") {
|
|
468
|
-
if (isModuleForNode) {
|
|
469
|
-
builder.import();
|
|
470
|
-
if (isNamespace) {
|
|
471
|
-
builder.default(name || importedSource);
|
|
472
|
-
} else if (isDefault || isNamed) {
|
|
473
|
-
builder.default(importedSource).read(name);
|
|
474
|
-
}
|
|
475
|
-
} else if (isModuleForBabel) {
|
|
476
|
-
builder.import();
|
|
477
|
-
if (isNamespace) {
|
|
478
|
-
builder.namespace(name || importedSource);
|
|
479
|
-
} else if (isDefault || isNamed) {
|
|
480
|
-
builder.named(name, importName);
|
|
481
|
-
}
|
|
482
|
-
} else {
|
|
483
|
-
builder.require();
|
|
484
|
-
if (isNamespace) {
|
|
485
|
-
builder.var(name || importedSource);
|
|
486
|
-
} else if (isDefault || isNamed) {
|
|
487
|
-
if (ensureLiveReference) {
|
|
488
|
-
builder.var(importedSource).read(name);
|
|
489
|
-
} else {
|
|
490
|
-
builder.prop(importName).var(name);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
} else if (importedInterop === "uncompiled") {
|
|
495
|
-
if (isDefault && ensureLiveReference) {
|
|
496
|
-
throw new Error("No live reference for commonjs default");
|
|
497
|
-
}
|
|
498
|
-
if (isModuleForNode) {
|
|
499
|
-
builder.import();
|
|
500
|
-
if (isNamespace) {
|
|
501
|
-
builder.default(name || importedSource);
|
|
502
|
-
} else if (isDefault) {
|
|
503
|
-
builder.default(name);
|
|
504
|
-
} else if (isNamed) {
|
|
505
|
-
builder.default(importedSource).read(name);
|
|
506
|
-
}
|
|
507
|
-
} else if (isModuleForBabel) {
|
|
508
|
-
builder.import();
|
|
509
|
-
if (isNamespace) {
|
|
510
|
-
builder.default(name || importedSource);
|
|
511
|
-
} else if (isDefault) {
|
|
512
|
-
builder.default(name);
|
|
513
|
-
} else if (isNamed) {
|
|
514
|
-
builder.named(name, importName);
|
|
515
|
-
}
|
|
516
|
-
} else {
|
|
517
|
-
builder.require();
|
|
518
|
-
if (isNamespace) {
|
|
519
|
-
builder.var(name || importedSource);
|
|
520
|
-
} else if (isDefault) {
|
|
521
|
-
builder.var(name);
|
|
522
|
-
} else if (isNamed) {
|
|
523
|
-
if (ensureLiveReference) {
|
|
524
|
-
builder.var(importedSource).read(name);
|
|
525
|
-
} else {
|
|
526
|
-
builder.var(name).prop(importName);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
} else {
|
|
531
|
-
throw new Error(`Unknown importedInterop "${importedInterop}".`);
|
|
532
|
-
}
|
|
533
|
-
const {
|
|
534
|
-
statements,
|
|
535
|
-
resultName
|
|
536
|
-
} = builder.done();
|
|
537
|
-
this._insertStatements(statements, importPosition, blockHoist);
|
|
538
|
-
if ((isDefault || isNamed) && ensureNoContext && resultName.type !== "Identifier") {
|
|
539
|
-
return sequenceExpression([numericLiteral(0), resultName]);
|
|
540
|
-
}
|
|
541
|
-
return resultName;
|
|
542
|
-
}
|
|
543
|
-
_insertStatements(statements, importPosition = "before", blockHoist = 3) {
|
|
544
|
-
if (importPosition === "after") {
|
|
545
|
-
if (this._insertStatementsAfter(statements)) return;
|
|
546
|
-
} else {
|
|
547
|
-
if (this._insertStatementsBefore(statements, blockHoist)) return;
|
|
548
|
-
}
|
|
549
|
-
this._programPath.unshiftContainer("body", statements);
|
|
550
|
-
}
|
|
551
|
-
_insertStatementsBefore(statements, blockHoist) {
|
|
552
|
-
if (statements.length === 1 && isImportDeclaration(statements[0]) && isValueImport(statements[0])) {
|
|
553
|
-
const firstImportDecl = this._programPath.get("body").find(p => {
|
|
554
|
-
return p.isImportDeclaration() && isValueImport(p.node);
|
|
555
|
-
});
|
|
556
|
-
if ((firstImportDecl == null ? void 0 : firstImportDecl.node.source.value) === statements[0].source.value && maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])) {
|
|
557
|
-
return true;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
statements.forEach(node => {
|
|
561
|
-
node._blockHoist = blockHoist;
|
|
562
|
-
});
|
|
563
|
-
const targetPath = this._programPath.get("body").find(p => {
|
|
564
|
-
const val = p.node._blockHoist;
|
|
565
|
-
return Number.isFinite(val) && val < 4;
|
|
566
|
-
});
|
|
567
|
-
if (targetPath) {
|
|
568
|
-
targetPath.insertBefore(statements);
|
|
569
|
-
return true;
|
|
570
|
-
}
|
|
571
|
-
return false;
|
|
572
|
-
}
|
|
573
|
-
_insertStatementsAfter(statements) {
|
|
574
|
-
const statementsSet = new Set(statements);
|
|
575
|
-
const importDeclarations = new Map();
|
|
576
|
-
for (const statement of statements) {
|
|
577
|
-
if (isImportDeclaration(statement) && isValueImport(statement)) {
|
|
578
|
-
const source = statement.source.value;
|
|
579
|
-
if (!importDeclarations.has(source)) importDeclarations.set(source, []);
|
|
580
|
-
importDeclarations.get(source).push(statement);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
let lastImportPath = null;
|
|
584
|
-
for (const bodyStmt of this._programPath.get("body")) {
|
|
585
|
-
if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) {
|
|
586
|
-
lastImportPath = bodyStmt;
|
|
587
|
-
const source = bodyStmt.node.source.value;
|
|
588
|
-
const newImports = importDeclarations.get(source);
|
|
589
|
-
if (!newImports) continue;
|
|
590
|
-
for (const decl of newImports) {
|
|
591
|
-
if (!statementsSet.has(decl)) continue;
|
|
592
|
-
if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) {
|
|
593
|
-
statementsSet.delete(decl);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
if (statementsSet.size === 0) return true;
|
|
599
|
-
if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet));
|
|
600
|
-
return !!lastImportPath;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
importInjector.default = ImportInjector;
|
|
604
|
-
function isValueImport(node) {
|
|
605
|
-
return node.importKind !== "type" && node.importKind !== "typeof";
|
|
606
|
-
}
|
|
607
|
-
function hasNamespaceImport(node) {
|
|
608
|
-
return node.specifiers.length === 1 && node.specifiers[0].type === "ImportNamespaceSpecifier" || node.specifiers.length === 2 && node.specifiers[1].type === "ImportNamespaceSpecifier";
|
|
609
|
-
}
|
|
610
|
-
function hasDefaultImport(node) {
|
|
611
|
-
return node.specifiers.length > 0 && node.specifiers[0].type === "ImportDefaultSpecifier";
|
|
612
|
-
}
|
|
613
|
-
function maybeAppendImportSpecifiers(target, source) {
|
|
614
|
-
if (!target.specifiers.length) {
|
|
615
|
-
target.specifiers = source.specifiers;
|
|
616
|
-
return true;
|
|
617
|
-
}
|
|
618
|
-
if (!source.specifiers.length) return true;
|
|
619
|
-
if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false;
|
|
620
|
-
if (hasDefaultImport(source)) {
|
|
621
|
-
if (hasDefaultImport(target)) {
|
|
622
|
-
source.specifiers[0] = importSpecifier(source.specifiers[0].local, identifier("default"));
|
|
623
|
-
} else {
|
|
624
|
-
target.specifiers.unshift(source.specifiers.shift());
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
target.specifiers.push(...source.specifiers);
|
|
628
|
-
return true;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
return importInjector;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
var hasRequiredLib$2;
|
|
636
|
-
|
|
637
|
-
function requireLib$2 () {
|
|
638
|
-
if (hasRequiredLib$2) return lib$2;
|
|
639
|
-
hasRequiredLib$2 = 1;
|
|
640
|
-
(function (exports) {
|
|
641
|
-
|
|
642
|
-
Object.defineProperty(exports, "__esModule", {
|
|
643
|
-
value: true
|
|
644
|
-
});
|
|
645
|
-
Object.defineProperty(exports, "ImportInjector", {
|
|
646
|
-
enumerable: true,
|
|
647
|
-
get: function () {
|
|
648
|
-
return _importInjector.default;
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
exports.addDefault = addDefault;
|
|
652
|
-
exports.addNamed = addNamed;
|
|
653
|
-
exports.addNamespace = addNamespace;
|
|
654
|
-
exports.addSideEffect = addSideEffect;
|
|
655
|
-
Object.defineProperty(exports, "isModule", {
|
|
656
|
-
enumerable: true,
|
|
657
|
-
get: function () {
|
|
658
|
-
return _isModule.default;
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
var _importInjector = requireImportInjector();
|
|
662
|
-
var _isModule = requireIsModule();
|
|
663
|
-
function addDefault(path, importedSource, opts) {
|
|
664
|
-
return new _importInjector.default(path).addDefault(importedSource, opts);
|
|
665
|
-
}
|
|
666
|
-
function addNamed(path, name, importedSource, opts) {
|
|
667
|
-
return new _importInjector.default(path).addNamed(name, importedSource, opts);
|
|
668
|
-
}
|
|
669
|
-
function addNamespace(path, importedSource, opts) {
|
|
670
|
-
return new _importInjector.default(path).addNamespace(importedSource, opts);
|
|
671
|
-
}
|
|
672
|
-
function addSideEffect(path, importedSource, opts) {
|
|
673
|
-
return new _importInjector.default(path).addSideEffect(importedSource, opts);
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
} (lib$2));
|
|
678
|
-
return lib$2;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
var libExports$2 = requireLib$2();
|
|
682
|
-
|
|
683
172
|
function hoistExpression(path, astExpression) {
|
|
684
173
|
const programStatementPath = getProgramStatement(path);
|
|
685
174
|
if (programStatementPath == null) {
|
|
@@ -715,7 +204,7 @@ function getProgramPath(path) {
|
|
|
715
204
|
return programPath;
|
|
716
205
|
}
|
|
717
206
|
function addNamedImport(statementPath, as, from, options) {
|
|
718
|
-
const identifier =
|
|
207
|
+
const identifier = helperModuleImports.addNamed(statementPath, as, from, options);
|
|
719
208
|
const programPath = getProgramPath(statementPath);
|
|
720
209
|
if (programPath == null) {
|
|
721
210
|
return identifier;
|
|
@@ -743,7 +232,7 @@ function addNamedImport(statementPath, as, from, options) {
|
|
|
743
232
|
return importName;
|
|
744
233
|
}
|
|
745
234
|
function addDefaultImport(statementPath, from, options) {
|
|
746
|
-
const identifier =
|
|
235
|
+
const identifier = helperModuleImports.addDefault(statementPath, from, options);
|
|
747
236
|
const programPath = getProgramPath(statementPath);
|
|
748
237
|
if (programPath == null) {
|
|
749
238
|
return identifier;
|
|
@@ -795,6 +284,26 @@ function getProgramStatement(path) {
|
|
|
795
284
|
return programPath;
|
|
796
285
|
}
|
|
797
286
|
|
|
287
|
+
const defaultOptions = {
|
|
288
|
+
classNamePrefix: 'x',
|
|
289
|
+
dev: false,
|
|
290
|
+
debug: false,
|
|
291
|
+
enableDebugClassNames: false,
|
|
292
|
+
enableDevClassNames: false,
|
|
293
|
+
enableDebugDataProp: true,
|
|
294
|
+
enableFontSizePxToRem: false,
|
|
295
|
+
enableInlinedConditionalMerge: true,
|
|
296
|
+
enableMediaQueryOrder: true,
|
|
297
|
+
enableLegacyValueFlipping: false,
|
|
298
|
+
enableLogicalStylesPolyfill: false,
|
|
299
|
+
enableLTRRTLComments: false,
|
|
300
|
+
enableMinifiedKeys: true,
|
|
301
|
+
styleResolution: 'property-specificity',
|
|
302
|
+
importSources: [],
|
|
303
|
+
treeshakeCompensation: false,
|
|
304
|
+
test: false
|
|
305
|
+
};
|
|
306
|
+
|
|
798
307
|
const CheckModuleResolution = unionOf4(object({
|
|
799
308
|
type: literal('commonJS'),
|
|
800
309
|
rootDir: unionOf(nullish(), string()),
|
|
@@ -833,6 +342,7 @@ class StateManager {
|
|
|
833
342
|
stylexKeyframesImport = new Set();
|
|
834
343
|
stylexPositionTryImport = new Set();
|
|
835
344
|
stylexDefineVarsImport = new Set();
|
|
345
|
+
stylexDefineMarkerImport = new Set();
|
|
836
346
|
stylexDefineConstsImport = new Set();
|
|
837
347
|
stylexCreateThemeImport = new Set();
|
|
838
348
|
stylexTypesImport = new Set();
|
|
@@ -850,27 +360,27 @@ class StateManager {
|
|
|
850
360
|
this.options = this.setOptions(state.opts ?? {});
|
|
851
361
|
}
|
|
852
362
|
setOptions(options) {
|
|
853
|
-
const dev = logAndDefault(boolean(), options.dev ??
|
|
363
|
+
const dev = logAndDefault(boolean(), options.dev ?? defaultOptions.dev, false, 'options.dev');
|
|
854
364
|
const debug = logAndDefault(boolean(), options.debug ?? dev, false, 'options.debug');
|
|
855
|
-
const enableDebugClassNames = logAndDefault(boolean(), options.enableDebugClassNames ??
|
|
856
|
-
const enableDebugDataProp = logAndDefault(boolean(), options.enableDebugDataProp ??
|
|
857
|
-
const enableDevClassNames = logAndDefault(boolean(), options.enableDevClassNames ??
|
|
858
|
-
const enableFontSizePxToRem = logAndDefault(boolean(), options.enableFontSizePxToRem ??
|
|
859
|
-
const enableInlinedConditionalMerge = logAndDefault(boolean(), options.enableInlinedConditionalMerge ??
|
|
860
|
-
const enableMinifiedKeys = logAndDefault(boolean(), options.enableMinifiedKeys ??
|
|
861
|
-
const enableMediaQueryOrder = logAndDefault(boolean(), options.enableMediaQueryOrder ??
|
|
862
|
-
const enableLegacyValueFlipping = logAndDefault(boolean(), options.enableLegacyValueFlipping ??
|
|
863
|
-
const enableLogicalStylesPolyfill = logAndDefault(boolean(), options.enableLogicalStylesPolyfill ??
|
|
864
|
-
const enableLTRRTLComments = logAndDefault(boolean(), options.enableLTRRTLComments ??
|
|
865
|
-
const test = logAndDefault(boolean(), options.test ??
|
|
365
|
+
const enableDebugClassNames = logAndDefault(boolean(), options.enableDebugClassNames ?? defaultOptions.enableDebugClassNames, true, 'options.enableDebugClassNames');
|
|
366
|
+
const enableDebugDataProp = logAndDefault(boolean(), options.enableDebugDataProp ?? debug, false, 'options.enableDebugDataProp');
|
|
367
|
+
const enableDevClassNames = logAndDefault(boolean(), options.enableDevClassNames ?? dev, dev, 'options.enableDevClassNames');
|
|
368
|
+
const enableFontSizePxToRem = logAndDefault(boolean(), options.enableFontSizePxToRem ?? defaultOptions.enableFontSizePxToRem, false, 'options.enableFontSizePxToRem');
|
|
369
|
+
const enableInlinedConditionalMerge = logAndDefault(boolean(), options.enableInlinedConditionalMerge ?? defaultOptions.enableInlinedConditionalMerge, true, 'options.enableInlinedConditionalMerge');
|
|
370
|
+
const enableMinifiedKeys = logAndDefault(boolean(), options.enableMinifiedKeys ?? defaultOptions.enableMinifiedKeys, true, 'options.enableMinifiedKeys');
|
|
371
|
+
const enableMediaQueryOrder = logAndDefault(boolean(), options.enableMediaQueryOrder ?? defaultOptions.enableMediaQueryOrder, true, 'options.enableMediaQueryOrder');
|
|
372
|
+
const enableLegacyValueFlipping = logAndDefault(boolean(), options.enableLegacyValueFlipping ?? defaultOptions.enableLegacyValueFlipping, false, 'options.enableLegacyValueFlipping');
|
|
373
|
+
const enableLogicalStylesPolyfill = logAndDefault(boolean(), options.enableLogicalStylesPolyfill ?? defaultOptions.enableLogicalStylesPolyfill, false, 'options.enableLogicalStylesPolyfill');
|
|
374
|
+
const enableLTRRTLComments = logAndDefault(boolean(), options.enableLTRRTLComments ?? defaultOptions.enableLTRRTLComments, false, 'options.enableLTRRTLComments');
|
|
375
|
+
const test = logAndDefault(boolean(), options.test ?? defaultOptions.test, false, 'options.test');
|
|
866
376
|
const configRuntimeInjection = logAndDefault(checkRuntimeInjection, options.runtimeInjection ?? false, false, 'options.runtimeInjection');
|
|
867
377
|
const runtimeInjection = configRuntimeInjection === true ? DEFAULT_INJECT_PATH : configRuntimeInjection === false ? undefined : configRuntimeInjection;
|
|
868
|
-
const classNamePrefix = logAndDefault(string(), options.classNamePrefix ??
|
|
869
|
-
const configuredImportSources = logAndDefault(checkImportSources, options.importSources ??
|
|
378
|
+
const classNamePrefix = logAndDefault(string(), options.classNamePrefix ?? defaultOptions.classNamePrefix, 'x', 'options.classNamePrefix');
|
|
379
|
+
const configuredImportSources = logAndDefault(checkImportSources, options.importSources ?? defaultOptions.importSources, [], 'options.importSources');
|
|
870
380
|
const importSources = [name, 'stylex', ...configuredImportSources];
|
|
871
|
-
const styleResolution = logAndDefault(unionOf3(literal('application-order'), literal('property-specificity'), literal('legacy-expand-shorthands')), options.styleResolution ??
|
|
381
|
+
const styleResolution = logAndDefault(unionOf3(literal('application-order'), literal('property-specificity'), literal('legacy-expand-shorthands')), options.styleResolution ?? defaultOptions.styleResolution, 'property-specificity', 'options.styleResolution');
|
|
872
382
|
const unstable_moduleResolution = logAndDefault(unionOf(nullish(), CheckModuleResolution), options.unstable_moduleResolution, null, 'options.unstable_moduleResolution');
|
|
873
|
-
const treeshakeCompensation = logAndDefault(boolean(), options.treeshakeCompensation ??
|
|
383
|
+
const treeshakeCompensation = logAndDefault(boolean(), options.treeshakeCompensation ?? defaultOptions.treeshakeCompensation, false, 'options.treeshakeCompensation');
|
|
874
384
|
const aliasesOption = logAndDefault(unionOf(nullish(), objectOf(unionOf(string(), array(string())))), options.aliases, null, 'options.aliases');
|
|
875
385
|
const aliases = aliasesOption == null ? aliasesOption : Object.fromEntries(Object.entries(aliasesOption).map(([key, value]) => {
|
|
876
386
|
if (typeof value === 'string') {
|
|
@@ -878,6 +388,7 @@ class StateManager {
|
|
|
878
388
|
}
|
|
879
389
|
return [key, value];
|
|
880
390
|
}));
|
|
391
|
+
const debugFilePath = logAndDefault(optional(func()), options.debugFilePath, undefined, 'options.debugFilePath');
|
|
881
392
|
const opts = {
|
|
882
393
|
aliases,
|
|
883
394
|
classNamePrefix,
|
|
@@ -900,7 +411,8 @@ class StateManager {
|
|
|
900
411
|
styleResolution,
|
|
901
412
|
test,
|
|
902
413
|
treeshakeCompensation,
|
|
903
|
-
unstable_moduleResolution
|
|
414
|
+
unstable_moduleResolution,
|
|
415
|
+
debugFilePath
|
|
904
416
|
};
|
|
905
417
|
return opts;
|
|
906
418
|
}
|
|
@@ -1085,11 +597,20 @@ class StateManager {
|
|
|
1085
597
|
});
|
|
1086
598
|
this.injectImportInserted = injectName;
|
|
1087
599
|
}
|
|
1088
|
-
for (const [_key, {
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
600
|
+
for (const [_key, styleObj, priority] of styles) {
|
|
601
|
+
const {
|
|
602
|
+
ltr,
|
|
603
|
+
rtl
|
|
604
|
+
} = styleObj;
|
|
605
|
+
const args = [t__namespace.stringLiteral(ltr), t__namespace.numericLiteral(priority), ...(rtl != null ? [t__namespace.stringLiteral(rtl)] : [])];
|
|
606
|
+
if ('constKey' in styleObj && 'constVal' in styleObj) {
|
|
607
|
+
const {
|
|
608
|
+
constKey,
|
|
609
|
+
constVal
|
|
610
|
+
} = styleObj;
|
|
611
|
+
args.push(t__namespace.stringLiteral(constKey), typeof constVal === 'number' ? t__namespace.numericLiteral(constVal) : t__namespace.stringLiteral(String(constVal)));
|
|
612
|
+
}
|
|
613
|
+
statementPath.insertBefore(t__namespace.expressionStatement(t__namespace.callExpression(injectName, args)));
|
|
1093
614
|
}
|
|
1094
615
|
}
|
|
1095
616
|
markComposedNamespace(memberExpression) {
|
|
@@ -1216,6 +737,9 @@ function readImportDeclarations(path, state) {
|
|
|
1216
737
|
if (importedName === 'defineVars') {
|
|
1217
738
|
state.stylexDefineVarsImport.add(localName);
|
|
1218
739
|
}
|
|
740
|
+
if (importedName === 'defineMarker') {
|
|
741
|
+
state.stylexDefineMarkerImport.add(localName);
|
|
742
|
+
}
|
|
1219
743
|
if (importedName === 'defineConsts') {
|
|
1220
744
|
state.stylexDefineConstsImport.add(localName);
|
|
1221
745
|
}
|
|
@@ -1279,6 +803,9 @@ function readRequires(path, state) {
|
|
|
1279
803
|
if (prop.key.name === 'defineVars') {
|
|
1280
804
|
state.stylexDefineVarsImport.add(value.name);
|
|
1281
805
|
}
|
|
806
|
+
if (prop.key.name === 'defineMarker') {
|
|
807
|
+
state.stylexDefineMarkerImport.add(value.name);
|
|
808
|
+
}
|
|
1282
809
|
if (prop.key.name === 'defineConsts') {
|
|
1283
810
|
state.stylexDefineConstsImport.add(value.name);
|
|
1284
811
|
}
|
|
@@ -1342,23 +869,6 @@ function toBase62(num) {
|
|
|
1342
869
|
}
|
|
1343
870
|
const createShortHash = str => toBase62(murmurhash2_32_gc(str, 1) % 62 ** 5);
|
|
1344
871
|
|
|
1345
|
-
const defaultOptions = {
|
|
1346
|
-
classNamePrefix: 'x',
|
|
1347
|
-
dev: false,
|
|
1348
|
-
debug: false,
|
|
1349
|
-
enableDebugClassNames: true,
|
|
1350
|
-
enableDevClassNames: false,
|
|
1351
|
-
enableDebugDataProp: true,
|
|
1352
|
-
enableFontSizePxToRem: false,
|
|
1353
|
-
enableMediaQueryOrder: false,
|
|
1354
|
-
enableLegacyValueFlipping: false,
|
|
1355
|
-
enableLogicalStylesPolyfill: false,
|
|
1356
|
-
enableLTRRTLComments: false,
|
|
1357
|
-
enableMinifiedKeys: true,
|
|
1358
|
-
styleResolution: 'property-specificity',
|
|
1359
|
-
test: false
|
|
1360
|
-
};
|
|
1361
|
-
|
|
1362
872
|
const shorthands$2 = {
|
|
1363
873
|
all: _ => {
|
|
1364
874
|
throw new Error('all is not supported');
|
|
@@ -1539,604 +1049,24 @@ const expansions$3 = {
|
|
|
1539
1049
|
...aliases$2
|
|
1540
1050
|
};
|
|
1541
1051
|
|
|
1542
|
-
var parse;
|
|
1543
|
-
var hasRequiredParse;
|
|
1544
|
-
|
|
1545
|
-
function requireParse () {
|
|
1546
|
-
if (hasRequiredParse) return parse;
|
|
1547
|
-
hasRequiredParse = 1;
|
|
1548
|
-
var openParentheses = "(".charCodeAt(0);
|
|
1549
|
-
var closeParentheses = ")".charCodeAt(0);
|
|
1550
|
-
var singleQuote = "'".charCodeAt(0);
|
|
1551
|
-
var doubleQuote = '"'.charCodeAt(0);
|
|
1552
|
-
var backslash = "\\".charCodeAt(0);
|
|
1553
|
-
var slash = "/".charCodeAt(0);
|
|
1554
|
-
var comma = ",".charCodeAt(0);
|
|
1555
|
-
var colon = ":".charCodeAt(0);
|
|
1556
|
-
var star = "*".charCodeAt(0);
|
|
1557
|
-
var uLower = "u".charCodeAt(0);
|
|
1558
|
-
var uUpper = "U".charCodeAt(0);
|
|
1559
|
-
var plus = "+".charCodeAt(0);
|
|
1560
|
-
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
|
1561
|
-
|
|
1562
|
-
parse = function(input) {
|
|
1563
|
-
var tokens = [];
|
|
1564
|
-
var value = input;
|
|
1565
|
-
|
|
1566
|
-
var next,
|
|
1567
|
-
quote,
|
|
1568
|
-
prev,
|
|
1569
|
-
token,
|
|
1570
|
-
escape,
|
|
1571
|
-
escapePos,
|
|
1572
|
-
whitespacePos,
|
|
1573
|
-
parenthesesOpenPos;
|
|
1574
|
-
var pos = 0;
|
|
1575
|
-
var code = value.charCodeAt(pos);
|
|
1576
|
-
var max = value.length;
|
|
1577
|
-
var stack = [{ nodes: tokens }];
|
|
1578
|
-
var balanced = 0;
|
|
1579
|
-
var parent;
|
|
1580
|
-
|
|
1581
|
-
var name = "";
|
|
1582
|
-
var before = "";
|
|
1583
|
-
var after = "";
|
|
1584
|
-
|
|
1585
|
-
while (pos < max) {
|
|
1586
|
-
// Whitespaces
|
|
1587
|
-
if (code <= 32) {
|
|
1588
|
-
next = pos;
|
|
1589
|
-
do {
|
|
1590
|
-
next += 1;
|
|
1591
|
-
code = value.charCodeAt(next);
|
|
1592
|
-
} while (code <= 32);
|
|
1593
|
-
token = value.slice(pos, next);
|
|
1594
|
-
|
|
1595
|
-
prev = tokens[tokens.length - 1];
|
|
1596
|
-
if (code === closeParentheses && balanced) {
|
|
1597
|
-
after = token;
|
|
1598
|
-
} else if (prev && prev.type === "div") {
|
|
1599
|
-
prev.after = token;
|
|
1600
|
-
prev.sourceEndIndex += token.length;
|
|
1601
|
-
} else if (
|
|
1602
|
-
code === comma ||
|
|
1603
|
-
code === colon ||
|
|
1604
|
-
(code === slash &&
|
|
1605
|
-
value.charCodeAt(next + 1) !== star &&
|
|
1606
|
-
(!parent ||
|
|
1607
|
-
(parent && parent.type === "function" && parent.value !== "calc")))
|
|
1608
|
-
) {
|
|
1609
|
-
before = token;
|
|
1610
|
-
} else {
|
|
1611
|
-
tokens.push({
|
|
1612
|
-
type: "space",
|
|
1613
|
-
sourceIndex: pos,
|
|
1614
|
-
sourceEndIndex: next,
|
|
1615
|
-
value: token
|
|
1616
|
-
});
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1619
|
-
pos = next;
|
|
1620
|
-
|
|
1621
|
-
// Quotes
|
|
1622
|
-
} else if (code === singleQuote || code === doubleQuote) {
|
|
1623
|
-
next = pos;
|
|
1624
|
-
quote = code === singleQuote ? "'" : '"';
|
|
1625
|
-
token = {
|
|
1626
|
-
type: "string",
|
|
1627
|
-
sourceIndex: pos,
|
|
1628
|
-
quote: quote
|
|
1629
|
-
};
|
|
1630
|
-
do {
|
|
1631
|
-
escape = false;
|
|
1632
|
-
next = value.indexOf(quote, next + 1);
|
|
1633
|
-
if (~next) {
|
|
1634
|
-
escapePos = next;
|
|
1635
|
-
while (value.charCodeAt(escapePos - 1) === backslash) {
|
|
1636
|
-
escapePos -= 1;
|
|
1637
|
-
escape = !escape;
|
|
1638
|
-
}
|
|
1639
|
-
} else {
|
|
1640
|
-
value += quote;
|
|
1641
|
-
next = value.length - 1;
|
|
1642
|
-
token.unclosed = true;
|
|
1643
|
-
}
|
|
1644
|
-
} while (escape);
|
|
1645
|
-
token.value = value.slice(pos + 1, next);
|
|
1646
|
-
token.sourceEndIndex = token.unclosed ? next : next + 1;
|
|
1647
|
-
tokens.push(token);
|
|
1648
|
-
pos = next + 1;
|
|
1649
|
-
code = value.charCodeAt(pos);
|
|
1650
|
-
|
|
1651
|
-
// Comments
|
|
1652
|
-
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
|
1653
|
-
next = value.indexOf("*/", pos);
|
|
1654
|
-
|
|
1655
|
-
token = {
|
|
1656
|
-
type: "comment",
|
|
1657
|
-
sourceIndex: pos,
|
|
1658
|
-
sourceEndIndex: next + 2
|
|
1659
|
-
};
|
|
1660
|
-
|
|
1661
|
-
if (next === -1) {
|
|
1662
|
-
token.unclosed = true;
|
|
1663
|
-
next = value.length;
|
|
1664
|
-
token.sourceEndIndex = next;
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
|
-
token.value = value.slice(pos + 2, next);
|
|
1668
|
-
tokens.push(token);
|
|
1669
|
-
|
|
1670
|
-
pos = next + 2;
|
|
1671
|
-
code = value.charCodeAt(pos);
|
|
1672
|
-
|
|
1673
|
-
// Operation within calc
|
|
1674
|
-
} else if (
|
|
1675
|
-
(code === slash || code === star) &&
|
|
1676
|
-
parent &&
|
|
1677
|
-
parent.type === "function" &&
|
|
1678
|
-
parent.value === "calc"
|
|
1679
|
-
) {
|
|
1680
|
-
token = value[pos];
|
|
1681
|
-
tokens.push({
|
|
1682
|
-
type: "word",
|
|
1683
|
-
sourceIndex: pos - before.length,
|
|
1684
|
-
sourceEndIndex: pos + token.length,
|
|
1685
|
-
value: token
|
|
1686
|
-
});
|
|
1687
|
-
pos += 1;
|
|
1688
|
-
code = value.charCodeAt(pos);
|
|
1689
|
-
|
|
1690
|
-
// Dividers
|
|
1691
|
-
} else if (code === slash || code === comma || code === colon) {
|
|
1692
|
-
token = value[pos];
|
|
1693
|
-
|
|
1694
|
-
tokens.push({
|
|
1695
|
-
type: "div",
|
|
1696
|
-
sourceIndex: pos - before.length,
|
|
1697
|
-
sourceEndIndex: pos + token.length,
|
|
1698
|
-
value: token,
|
|
1699
|
-
before: before,
|
|
1700
|
-
after: ""
|
|
1701
|
-
});
|
|
1702
|
-
before = "";
|
|
1703
|
-
|
|
1704
|
-
pos += 1;
|
|
1705
|
-
code = value.charCodeAt(pos);
|
|
1706
|
-
|
|
1707
|
-
// Open parentheses
|
|
1708
|
-
} else if (openParentheses === code) {
|
|
1709
|
-
// Whitespaces after open parentheses
|
|
1710
|
-
next = pos;
|
|
1711
|
-
do {
|
|
1712
|
-
next += 1;
|
|
1713
|
-
code = value.charCodeAt(next);
|
|
1714
|
-
} while (code <= 32);
|
|
1715
|
-
parenthesesOpenPos = pos;
|
|
1716
|
-
token = {
|
|
1717
|
-
type: "function",
|
|
1718
|
-
sourceIndex: pos - name.length,
|
|
1719
|
-
value: name,
|
|
1720
|
-
before: value.slice(parenthesesOpenPos + 1, next)
|
|
1721
|
-
};
|
|
1722
|
-
pos = next;
|
|
1723
|
-
|
|
1724
|
-
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
|
1725
|
-
next -= 1;
|
|
1726
|
-
do {
|
|
1727
|
-
escape = false;
|
|
1728
|
-
next = value.indexOf(")", next + 1);
|
|
1729
|
-
if (~next) {
|
|
1730
|
-
escapePos = next;
|
|
1731
|
-
while (value.charCodeAt(escapePos - 1) === backslash) {
|
|
1732
|
-
escapePos -= 1;
|
|
1733
|
-
escape = !escape;
|
|
1734
|
-
}
|
|
1735
|
-
} else {
|
|
1736
|
-
value += ")";
|
|
1737
|
-
next = value.length - 1;
|
|
1738
|
-
token.unclosed = true;
|
|
1739
|
-
}
|
|
1740
|
-
} while (escape);
|
|
1741
|
-
// Whitespaces before closed
|
|
1742
|
-
whitespacePos = next;
|
|
1743
|
-
do {
|
|
1744
|
-
whitespacePos -= 1;
|
|
1745
|
-
code = value.charCodeAt(whitespacePos);
|
|
1746
|
-
} while (code <= 32);
|
|
1747
|
-
if (parenthesesOpenPos < whitespacePos) {
|
|
1748
|
-
if (pos !== whitespacePos + 1) {
|
|
1749
|
-
token.nodes = [
|
|
1750
|
-
{
|
|
1751
|
-
type: "word",
|
|
1752
|
-
sourceIndex: pos,
|
|
1753
|
-
sourceEndIndex: whitespacePos + 1,
|
|
1754
|
-
value: value.slice(pos, whitespacePos + 1)
|
|
1755
|
-
}
|
|
1756
|
-
];
|
|
1757
|
-
} else {
|
|
1758
|
-
token.nodes = [];
|
|
1759
|
-
}
|
|
1760
|
-
if (token.unclosed && whitespacePos + 1 !== next) {
|
|
1761
|
-
token.after = "";
|
|
1762
|
-
token.nodes.push({
|
|
1763
|
-
type: "space",
|
|
1764
|
-
sourceIndex: whitespacePos + 1,
|
|
1765
|
-
sourceEndIndex: next,
|
|
1766
|
-
value: value.slice(whitespacePos + 1, next)
|
|
1767
|
-
});
|
|
1768
|
-
} else {
|
|
1769
|
-
token.after = value.slice(whitespacePos + 1, next);
|
|
1770
|
-
token.sourceEndIndex = next;
|
|
1771
|
-
}
|
|
1772
|
-
} else {
|
|
1773
|
-
token.after = "";
|
|
1774
|
-
token.nodes = [];
|
|
1775
|
-
}
|
|
1776
|
-
pos = next + 1;
|
|
1777
|
-
token.sourceEndIndex = token.unclosed ? next : pos;
|
|
1778
|
-
code = value.charCodeAt(pos);
|
|
1779
|
-
tokens.push(token);
|
|
1780
|
-
} else {
|
|
1781
|
-
balanced += 1;
|
|
1782
|
-
token.after = "";
|
|
1783
|
-
token.sourceEndIndex = pos + 1;
|
|
1784
|
-
tokens.push(token);
|
|
1785
|
-
stack.push(token);
|
|
1786
|
-
tokens = token.nodes = [];
|
|
1787
|
-
parent = token;
|
|
1788
|
-
}
|
|
1789
|
-
name = "";
|
|
1790
|
-
|
|
1791
|
-
// Close parentheses
|
|
1792
|
-
} else if (closeParentheses === code && balanced) {
|
|
1793
|
-
pos += 1;
|
|
1794
|
-
code = value.charCodeAt(pos);
|
|
1795
|
-
|
|
1796
|
-
parent.after = after;
|
|
1797
|
-
parent.sourceEndIndex += after.length;
|
|
1798
|
-
after = "";
|
|
1799
|
-
balanced -= 1;
|
|
1800
|
-
stack[stack.length - 1].sourceEndIndex = pos;
|
|
1801
|
-
stack.pop();
|
|
1802
|
-
parent = stack[balanced];
|
|
1803
|
-
tokens = parent.nodes;
|
|
1804
|
-
|
|
1805
|
-
// Words
|
|
1806
|
-
} else {
|
|
1807
|
-
next = pos;
|
|
1808
|
-
do {
|
|
1809
|
-
if (code === backslash) {
|
|
1810
|
-
next += 1;
|
|
1811
|
-
}
|
|
1812
|
-
next += 1;
|
|
1813
|
-
code = value.charCodeAt(next);
|
|
1814
|
-
} while (
|
|
1815
|
-
next < max &&
|
|
1816
|
-
!(
|
|
1817
|
-
code <= 32 ||
|
|
1818
|
-
code === singleQuote ||
|
|
1819
|
-
code === doubleQuote ||
|
|
1820
|
-
code === comma ||
|
|
1821
|
-
code === colon ||
|
|
1822
|
-
code === slash ||
|
|
1823
|
-
code === openParentheses ||
|
|
1824
|
-
(code === star &&
|
|
1825
|
-
parent &&
|
|
1826
|
-
parent.type === "function" &&
|
|
1827
|
-
parent.value === "calc") ||
|
|
1828
|
-
(code === slash &&
|
|
1829
|
-
parent.type === "function" &&
|
|
1830
|
-
parent.value === "calc") ||
|
|
1831
|
-
(code === closeParentheses && balanced)
|
|
1832
|
-
)
|
|
1833
|
-
);
|
|
1834
|
-
token = value.slice(pos, next);
|
|
1835
|
-
|
|
1836
|
-
if (openParentheses === code) {
|
|
1837
|
-
name = token;
|
|
1838
|
-
} else if (
|
|
1839
|
-
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
|
|
1840
|
-
plus === token.charCodeAt(1) &&
|
|
1841
|
-
isUnicodeRange.test(token.slice(2))
|
|
1842
|
-
) {
|
|
1843
|
-
tokens.push({
|
|
1844
|
-
type: "unicode-range",
|
|
1845
|
-
sourceIndex: pos,
|
|
1846
|
-
sourceEndIndex: next,
|
|
1847
|
-
value: token
|
|
1848
|
-
});
|
|
1849
|
-
} else {
|
|
1850
|
-
tokens.push({
|
|
1851
|
-
type: "word",
|
|
1852
|
-
sourceIndex: pos,
|
|
1853
|
-
sourceEndIndex: next,
|
|
1854
|
-
value: token
|
|
1855
|
-
});
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
pos = next;
|
|
1859
|
-
}
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
for (pos = stack.length - 1; pos; pos -= 1) {
|
|
1863
|
-
stack[pos].unclosed = true;
|
|
1864
|
-
stack[pos].sourceEndIndex = value.length;
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
return stack[0].nodes;
|
|
1868
|
-
};
|
|
1869
|
-
return parse;
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
var walk;
|
|
1873
|
-
var hasRequiredWalk;
|
|
1874
|
-
|
|
1875
|
-
function requireWalk () {
|
|
1876
|
-
if (hasRequiredWalk) return walk;
|
|
1877
|
-
hasRequiredWalk = 1;
|
|
1878
|
-
walk = function walk(nodes, cb, bubble) {
|
|
1879
|
-
var i, max, node, result;
|
|
1880
|
-
|
|
1881
|
-
for (i = 0, max = nodes.length; i < max; i += 1) {
|
|
1882
|
-
node = nodes[i];
|
|
1883
|
-
if (!bubble) {
|
|
1884
|
-
result = cb(node, i, nodes);
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
if (
|
|
1888
|
-
result !== false &&
|
|
1889
|
-
node.type === "function" &&
|
|
1890
|
-
Array.isArray(node.nodes)
|
|
1891
|
-
) {
|
|
1892
|
-
walk(node.nodes, cb, bubble);
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
if (bubble) {
|
|
1896
|
-
cb(node, i, nodes);
|
|
1897
|
-
}
|
|
1898
|
-
}
|
|
1899
|
-
};
|
|
1900
|
-
return walk;
|
|
1901
|
-
}
|
|
1902
|
-
|
|
1903
|
-
var stringify_1;
|
|
1904
|
-
var hasRequiredStringify;
|
|
1905
|
-
|
|
1906
|
-
function requireStringify () {
|
|
1907
|
-
if (hasRequiredStringify) return stringify_1;
|
|
1908
|
-
hasRequiredStringify = 1;
|
|
1909
|
-
function stringifyNode(node, custom) {
|
|
1910
|
-
var type = node.type;
|
|
1911
|
-
var value = node.value;
|
|
1912
|
-
var buf;
|
|
1913
|
-
var customResult;
|
|
1914
|
-
|
|
1915
|
-
if (custom && (customResult = custom(node)) !== undefined) {
|
|
1916
|
-
return customResult;
|
|
1917
|
-
} else if (type === "word" || type === "space") {
|
|
1918
|
-
return value;
|
|
1919
|
-
} else if (type === "string") {
|
|
1920
|
-
buf = node.quote || "";
|
|
1921
|
-
return buf + value + (node.unclosed ? "" : buf);
|
|
1922
|
-
} else if (type === "comment") {
|
|
1923
|
-
return "/*" + value + (node.unclosed ? "" : "*/");
|
|
1924
|
-
} else if (type === "div") {
|
|
1925
|
-
return (node.before || "") + value + (node.after || "");
|
|
1926
|
-
} else if (Array.isArray(node.nodes)) {
|
|
1927
|
-
buf = stringify(node.nodes, custom);
|
|
1928
|
-
if (type !== "function") {
|
|
1929
|
-
return buf;
|
|
1930
|
-
}
|
|
1931
|
-
return (
|
|
1932
|
-
value +
|
|
1933
|
-
"(" +
|
|
1934
|
-
(node.before || "") +
|
|
1935
|
-
buf +
|
|
1936
|
-
(node.after || "") +
|
|
1937
|
-
(node.unclosed ? "" : ")")
|
|
1938
|
-
);
|
|
1939
|
-
}
|
|
1940
|
-
return value;
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
function stringify(nodes, custom) {
|
|
1944
|
-
var result, i;
|
|
1945
|
-
|
|
1946
|
-
if (Array.isArray(nodes)) {
|
|
1947
|
-
result = "";
|
|
1948
|
-
for (i = nodes.length - 1; ~i; i -= 1) {
|
|
1949
|
-
result = stringifyNode(nodes[i], custom) + result;
|
|
1950
|
-
}
|
|
1951
|
-
return result;
|
|
1952
|
-
}
|
|
1953
|
-
return stringifyNode(nodes, custom);
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
stringify_1 = stringify;
|
|
1957
|
-
return stringify_1;
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
var unit;
|
|
1961
|
-
var hasRequiredUnit;
|
|
1962
|
-
|
|
1963
|
-
function requireUnit () {
|
|
1964
|
-
if (hasRequiredUnit) return unit;
|
|
1965
|
-
hasRequiredUnit = 1;
|
|
1966
|
-
var minus = "-".charCodeAt(0);
|
|
1967
|
-
var plus = "+".charCodeAt(0);
|
|
1968
|
-
var dot = ".".charCodeAt(0);
|
|
1969
|
-
var exp = "e".charCodeAt(0);
|
|
1970
|
-
var EXP = "E".charCodeAt(0);
|
|
1971
|
-
|
|
1972
|
-
// Check if three code points would start a number
|
|
1973
|
-
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
|
|
1974
|
-
function likeNumber(value) {
|
|
1975
|
-
var code = value.charCodeAt(0);
|
|
1976
|
-
var nextCode;
|
|
1977
|
-
|
|
1978
|
-
if (code === plus || code === minus) {
|
|
1979
|
-
nextCode = value.charCodeAt(1);
|
|
1980
|
-
|
|
1981
|
-
if (nextCode >= 48 && nextCode <= 57) {
|
|
1982
|
-
return true;
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
var nextNextCode = value.charCodeAt(2);
|
|
1986
|
-
|
|
1987
|
-
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
|
|
1988
|
-
return true;
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
return false;
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
if (code === dot) {
|
|
1995
|
-
nextCode = value.charCodeAt(1);
|
|
1996
|
-
|
|
1997
|
-
if (nextCode >= 48 && nextCode <= 57) {
|
|
1998
|
-
return true;
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
return false;
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
if (code >= 48 && code <= 57) {
|
|
2005
|
-
return true;
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
return false;
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
// Consume a number
|
|
2012
|
-
// https://www.w3.org/TR/css-syntax-3/#consume-number
|
|
2013
|
-
unit = function(value) {
|
|
2014
|
-
var pos = 0;
|
|
2015
|
-
var length = value.length;
|
|
2016
|
-
var code;
|
|
2017
|
-
var nextCode;
|
|
2018
|
-
var nextNextCode;
|
|
2019
|
-
|
|
2020
|
-
if (length === 0 || !likeNumber(value)) {
|
|
2021
|
-
return false;
|
|
2022
|
-
}
|
|
2023
|
-
|
|
2024
|
-
code = value.charCodeAt(pos);
|
|
2025
|
-
|
|
2026
|
-
if (code === plus || code === minus) {
|
|
2027
|
-
pos++;
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
|
-
while (pos < length) {
|
|
2031
|
-
code = value.charCodeAt(pos);
|
|
2032
|
-
|
|
2033
|
-
if (code < 48 || code > 57) {
|
|
2034
|
-
break;
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
pos += 1;
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2040
|
-
code = value.charCodeAt(pos);
|
|
2041
|
-
nextCode = value.charCodeAt(pos + 1);
|
|
2042
|
-
|
|
2043
|
-
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
|
2044
|
-
pos += 2;
|
|
2045
|
-
|
|
2046
|
-
while (pos < length) {
|
|
2047
|
-
code = value.charCodeAt(pos);
|
|
2048
|
-
|
|
2049
|
-
if (code < 48 || code > 57) {
|
|
2050
|
-
break;
|
|
2051
|
-
}
|
|
2052
|
-
|
|
2053
|
-
pos += 1;
|
|
2054
|
-
}
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
code = value.charCodeAt(pos);
|
|
2058
|
-
nextCode = value.charCodeAt(pos + 1);
|
|
2059
|
-
nextNextCode = value.charCodeAt(pos + 2);
|
|
2060
|
-
|
|
2061
|
-
if (
|
|
2062
|
-
(code === exp || code === EXP) &&
|
|
2063
|
-
((nextCode >= 48 && nextCode <= 57) ||
|
|
2064
|
-
((nextCode === plus || nextCode === minus) &&
|
|
2065
|
-
nextNextCode >= 48 &&
|
|
2066
|
-
nextNextCode <= 57))
|
|
2067
|
-
) {
|
|
2068
|
-
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
|
2069
|
-
|
|
2070
|
-
while (pos < length) {
|
|
2071
|
-
code = value.charCodeAt(pos);
|
|
2072
|
-
|
|
2073
|
-
if (code < 48 || code > 57) {
|
|
2074
|
-
break;
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2077
|
-
pos += 1;
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
return {
|
|
2082
|
-
number: value.slice(0, pos),
|
|
2083
|
-
unit: value.slice(pos)
|
|
2084
|
-
};
|
|
2085
|
-
};
|
|
2086
|
-
return unit;
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
var lib$1;
|
|
2090
|
-
var hasRequiredLib$1;
|
|
2091
|
-
|
|
2092
|
-
function requireLib$1 () {
|
|
2093
|
-
if (hasRequiredLib$1) return lib$1;
|
|
2094
|
-
hasRequiredLib$1 = 1;
|
|
2095
|
-
var parse = requireParse();
|
|
2096
|
-
var walk = requireWalk();
|
|
2097
|
-
var stringify = requireStringify();
|
|
2098
|
-
|
|
2099
|
-
function ValueParser(value) {
|
|
2100
|
-
if (this instanceof ValueParser) {
|
|
2101
|
-
this.nodes = parse(value);
|
|
2102
|
-
return this;
|
|
2103
|
-
}
|
|
2104
|
-
return new ValueParser(value);
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
ValueParser.prototype.toString = function() {
|
|
2108
|
-
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
|
2109
|
-
};
|
|
2110
|
-
|
|
2111
|
-
ValueParser.prototype.walk = function(cb, bubble) {
|
|
2112
|
-
walk(this.nodes, cb, bubble);
|
|
2113
|
-
return this;
|
|
2114
|
-
};
|
|
2115
|
-
|
|
2116
|
-
ValueParser.unit = requireUnit();
|
|
2117
|
-
|
|
2118
|
-
ValueParser.walk = walk;
|
|
2119
|
-
|
|
2120
|
-
ValueParser.stringify = stringify;
|
|
2121
|
-
|
|
2122
|
-
lib$1 = ValueParser;
|
|
2123
|
-
return lib$1;
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
var libExports$1 = requireLib$1();
|
|
2127
|
-
var parser = /*@__PURE__*/getDefaultExportFromCjs(libExports$1);
|
|
2128
|
-
|
|
2129
1052
|
function printNode(node) {
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
return
|
|
2139
|
-
|
|
1053
|
+
return ($$gen$m0 => {
|
|
1054
|
+
if ((typeof $$gen$m0 === "object" && $$gen$m0 !== null || typeof $$gen$m0 === "function") && $$gen$m0.type === 'word' && "value" in $$gen$m0) {
|
|
1055
|
+
const value = $$gen$m0.value;
|
|
1056
|
+
return value;
|
|
1057
|
+
}
|
|
1058
|
+
if ((typeof $$gen$m0 === "object" && $$gen$m0 !== null || typeof $$gen$m0 === "function") && $$gen$m0.type === 'string' && "value" in $$gen$m0 && "quote" in $$gen$m0) {
|
|
1059
|
+
const value = $$gen$m0.value;
|
|
1060
|
+
const quote = $$gen$m0.quote;
|
|
1061
|
+
return `${quote}${value}${quote}`;
|
|
1062
|
+
}
|
|
1063
|
+
if ((typeof $$gen$m0 === "object" && $$gen$m0 !== null || typeof $$gen$m0 === "function") && $$gen$m0.type === 'function' && "value" in $$gen$m0 && "nodes" in $$gen$m0) {
|
|
1064
|
+
const value = $$gen$m0.value;
|
|
1065
|
+
const nodes = $$gen$m0.nodes;
|
|
1066
|
+
return `${value}(${nodes.map(printNode).join('')})`;
|
|
1067
|
+
}
|
|
1068
|
+
return node.value;
|
|
1069
|
+
})(node);
|
|
2140
1070
|
}
|
|
2141
1071
|
function splitValue(str) {
|
|
2142
1072
|
if (str == null || typeof str === 'number') {
|
|
@@ -2153,6 +1083,8 @@ function splitValue(str) {
|
|
|
2153
1083
|
return nodes;
|
|
2154
1084
|
}
|
|
2155
1085
|
|
|
1086
|
+
const LOGICAL_FLOAT_START_VAR = '--stylex-logical-start';
|
|
1087
|
+
const LOGICAL_FLOAT_END_VAR = '--stylex-logical-end';
|
|
2156
1088
|
const listStyleGlobalValues = new Set(['inherit', 'initial', 'revert', 'unset']);
|
|
2157
1089
|
const listStylePositionValues = new Set(['inside', 'outside']);
|
|
2158
1090
|
const listStyleTypeRegex = /^([a-z-]+|".*?"|'.*?')$/;
|
|
@@ -2342,7 +1274,23 @@ const aliases$1 = {
|
|
|
2342
1274
|
paddingBlockEnd: val => [['paddingBottom', val]],
|
|
2343
1275
|
paddingInline: shorthands$1.paddingHorizontal,
|
|
2344
1276
|
scrollMarginBlockStart: value => [['scrollMarginTop', value]],
|
|
2345
|
-
scrollMarginBlockEnd: value => [['scrollMarginBottom', value]]
|
|
1277
|
+
scrollMarginBlockEnd: value => [['scrollMarginBottom', value]],
|
|
1278
|
+
float: value => {
|
|
1279
|
+
if (value === 'inline-start' || value === 'start') {
|
|
1280
|
+
return [['float', `var(${LOGICAL_FLOAT_START_VAR})`]];
|
|
1281
|
+
} else if (value === 'inline-end' || value === 'end') {
|
|
1282
|
+
return [['float', `var(${LOGICAL_FLOAT_END_VAR})`]];
|
|
1283
|
+
}
|
|
1284
|
+
return [['float', value]];
|
|
1285
|
+
},
|
|
1286
|
+
clear: value => {
|
|
1287
|
+
if (value === 'inline-start' || value === 'start') {
|
|
1288
|
+
return [['clear', `var(${LOGICAL_FLOAT_START_VAR})`]];
|
|
1289
|
+
} else if (value === 'inline-end' || value === 'end') {
|
|
1290
|
+
return [['clear', `var(${LOGICAL_FLOAT_END_VAR})`]];
|
|
1291
|
+
}
|
|
1292
|
+
return [['clear', value]];
|
|
1293
|
+
}
|
|
2346
1294
|
};
|
|
2347
1295
|
const expansions$2 = {
|
|
2348
1296
|
...shorthands$1,
|
|
@@ -2470,7 +1418,7 @@ function flatMapExpandedShorthands(objEntry, options) {
|
|
|
2470
1418
|
return [[key, value]];
|
|
2471
1419
|
}
|
|
2472
1420
|
|
|
2473
|
-
var lib = {};
|
|
1421
|
+
var lib$1 = {};
|
|
2474
1422
|
|
|
2475
1423
|
var tokenParser = {};
|
|
2476
1424
|
|
|
@@ -4192,7 +3140,7 @@ function requireMediaQuery () {
|
|
|
4192
3140
|
case 'media-keyword':
|
|
4193
3141
|
{
|
|
4194
3142
|
const prefix = queries.not ? 'not ' : queries.only ? 'only ' : '';
|
|
4195
|
-
return prefix + queries.key;
|
|
3143
|
+
return prefix + (isTopLevel ? queries.key : `(${queries.key})`);
|
|
4196
3144
|
}
|
|
4197
3145
|
case 'word-rule':
|
|
4198
3146
|
return `(${queries.keyValue})`;
|
|
@@ -4218,7 +3166,7 @@ function requireMediaQuery () {
|
|
|
4218
3166
|
throw new Error(`cannot serialize media-pair value for key "${key}": ${String(value)}`);
|
|
4219
3167
|
}
|
|
4220
3168
|
case 'not':
|
|
4221
|
-
return queries.rule && (queries.rule.type === 'and' || queries.rule.type === 'or') ? `(not (${this.#toString(queries.rule)}))` : `(not ${this.#toString(queries.rule)})`;
|
|
3169
|
+
return queries.rule && (queries.rule.type === 'and' || queries.rule.type === 'or' || queries.rule.type === 'not') ? `(not (${this.#toString(queries.rule)}))` : `(not ${this.#toString(queries.rule)})`;
|
|
4222
3170
|
case 'and':
|
|
4223
3171
|
return queries.rules.map(rule => this.#toString(rule)).join(' and ');
|
|
4224
3172
|
case 'or':
|
|
@@ -4409,11 +3357,11 @@ function requireMediaQueryTransform () {
|
|
|
4409
3357
|
return mediaQueryTransform;
|
|
4410
3358
|
}
|
|
4411
3359
|
|
|
4412
|
-
var hasRequiredLib;
|
|
3360
|
+
var hasRequiredLib$1;
|
|
4413
3361
|
|
|
4414
|
-
function requireLib () {
|
|
4415
|
-
if (hasRequiredLib) return lib;
|
|
4416
|
-
hasRequiredLib = 1;
|
|
3362
|
+
function requireLib$1 () {
|
|
3363
|
+
if (hasRequiredLib$1) return lib$1;
|
|
3364
|
+
hasRequiredLib$1 = 1;
|
|
4417
3365
|
(function (exports) {
|
|
4418
3366
|
|
|
4419
3367
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4432,11 +3380,11 @@ function requireLib () {
|
|
|
4432
3380
|
exports.properties = _properties;
|
|
4433
3381
|
var _mediaQueryTransform = requireMediaQueryTransform();
|
|
4434
3382
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
4435
|
-
} (lib));
|
|
4436
|
-
return lib;
|
|
3383
|
+
} (lib$1));
|
|
3384
|
+
return lib$1;
|
|
4437
3385
|
}
|
|
4438
3386
|
|
|
4439
|
-
var libExports = requireLib();
|
|
3387
|
+
var libExports$1 = requireLib$1();
|
|
4440
3388
|
|
|
4441
3389
|
const illegalArgumentLength = (fn, argLength) => `${fn}() should have ${argLength} argument${argLength === 1 ? '' : 's'}.`;
|
|
4442
3390
|
const nonStaticValue = fn => `Only static values are allowed inside of a ${fn}() call.`;
|
|
@@ -4710,7 +3658,7 @@ function getNumberSuffix(key) {
|
|
|
4710
3658
|
return suffix;
|
|
4711
3659
|
}
|
|
4712
3660
|
}
|
|
4713
|
-
const unitlessNumberProperties = new Set(['WebkitLineClamp', 'animationIterationCount', 'aspectRatio', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'counterSet', 'counterReset', 'columnCount', 'flex', 'flexGrow', 'flexShrink', 'flexOrder', 'gridRow', 'gridRowStart', 'gridRowEnd', 'gridColumn', 'gridColumnStart', 'gridColumnEnd', 'gridArea', 'fontWeight', 'hyphenateLimitChars', 'lineClamp', 'lineHeight', 'maskBorderOutset', 'maskBorderSlice', 'maskBorderWidth', 'opacity', 'order', 'orphans', 'tabSize', 'widows', 'zIndex', 'fillOpacity', 'floodOpacity', 'rotate', 'scale', 'shapeImageThreshold', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'scale', 'mathDepth']);
|
|
3661
|
+
const unitlessNumberProperties = new Set(['WebkitLineClamp', 'animationIterationCount', 'aspectRatio', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'counterSet', 'counterReset', 'columnCount', 'flex', 'flexGrow', 'flexShrink', 'flexOrder', 'gridRow', 'gridRowStart', 'gridRowEnd', 'gridColumn', 'gridColumnStart', 'gridColumnEnd', 'gridArea', 'fontWeight', 'hyphenateLimitChars', 'lineClamp', 'lineHeight', 'maskBorderOutset', 'maskBorderSlice', 'maskBorderWidth', 'opacity', 'order', 'orphans', 'tabSize', 'widows', 'zIndex', 'fillOpacity', 'floodOpacity', 'rotate', 'scale', 'shapeImageThreshold', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'scale', 'mathDepth', 'zoom']);
|
|
4714
3662
|
const numberPropertySuffixes = {
|
|
4715
3663
|
animationDelay: 'ms',
|
|
4716
3664
|
animationDuration: 'ms',
|
|
@@ -4727,25 +3675,21 @@ const logicalToPhysical$1 = {
|
|
|
4727
3675
|
'inline-start': 'left',
|
|
4728
3676
|
'inline-end': 'right'
|
|
4729
3677
|
};
|
|
4730
|
-
const legacyValuesPolyfill$1 = {
|
|
4731
|
-
float: ([key, val]) => [key, logicalToPhysical$1[val] ?? val],
|
|
4732
|
-
clear: ([key, val]) => [key, logicalToPhysical$1[val] ?? val]
|
|
4733
|
-
};
|
|
4734
3678
|
const inlinePropertyToLTR = {
|
|
4735
|
-
'margin-inline-start': ([
|
|
4736
|
-
'margin-inline-end': ([
|
|
4737
|
-
'padding-inline-start': ([
|
|
4738
|
-
'padding-inline-end': ([
|
|
4739
|
-
'border-inline-start': ([
|
|
4740
|
-
'border-inline-end': ([
|
|
4741
|
-
'border-inline-start-width': ([
|
|
4742
|
-
'border-inline-end-width': ([
|
|
3679
|
+
'margin-inline-start': ([_k, val]) => ['margin-left', val],
|
|
3680
|
+
'margin-inline-end': ([_k, val]) => ['margin-right', val],
|
|
3681
|
+
'padding-inline-start': ([_k, val]) => ['padding-left', val],
|
|
3682
|
+
'padding-inline-end': ([_k, val]) => ['padding-right', val],
|
|
3683
|
+
'border-inline-start': ([_k, val]) => ['border-left', val],
|
|
3684
|
+
'border-inline-end': ([_k, val]) => ['border-right', val],
|
|
3685
|
+
'border-inline-start-width': ([_k, val]) => ['border-left-width', val],
|
|
3686
|
+
'border-inline-end-width': ([_k, val]) => ['border-right-width', val],
|
|
4743
3687
|
'border-inline-start-color': ([_key, val]) => ['border-left-color', val],
|
|
4744
3688
|
'border-inline-end-color': ([_key, val]) => ['border-right-color', val],
|
|
4745
3689
|
'border-inline-start-style': ([_key, val]) => ['border-left-style', val],
|
|
4746
3690
|
'border-inline-end-style': ([_key, val]) => ['border-right-style', val],
|
|
4747
3691
|
'border-start-start-radius': ([_key, val]) => ['border-top-left-radius', val],
|
|
4748
|
-
'border-end-start-radius': ([
|
|
3692
|
+
'border-end-start-radius': ([_k, val]) => ['border-bottom-left-radius', val],
|
|
4749
3693
|
'border-start-end-radius': ([_key, val]) => ['border-top-right-radius', val],
|
|
4750
3694
|
'border-end-end-radius': ([_key, val]) => ['border-bottom-right-radius', val],
|
|
4751
3695
|
'inset-inline-start': ([_key, val]) => ['left', val],
|
|
@@ -4765,13 +3709,13 @@ const propertyToLTR = {
|
|
|
4765
3709
|
'border-start-style': ([_key, val]) => ['border-left-style', val],
|
|
4766
3710
|
'border-end-style': ([_key, val]) => ['border-right-style', val],
|
|
4767
3711
|
'border-top-start-radius': ([_key, val]) => ['border-top-left-radius', val],
|
|
4768
|
-
'border-bottom-start-radius': ([
|
|
4769
|
-
'border-top-end-radius': ([_key,
|
|
4770
|
-
'border-bottom-end-radius': ([
|
|
3712
|
+
'border-bottom-start-radius': ([_k, v]) => ['border-bottom-left-radius', v],
|
|
3713
|
+
'border-top-end-radius': ([_key, v]) => ['border-top-right-radius', v],
|
|
3714
|
+
'border-bottom-end-radius': ([_k, v]) => ['border-bottom-right-radius', v],
|
|
4771
3715
|
float: ([key, val]) => [key, logicalToPhysical$1[val] ?? val],
|
|
4772
3716
|
clear: ([key, val]) => [key, logicalToPhysical$1[val] ?? val],
|
|
4773
|
-
start: ([
|
|
4774
|
-
end: ([
|
|
3717
|
+
start: ([_k, val]) => ['left', val],
|
|
3718
|
+
end: ([_k, val]) => ['right', val],
|
|
4775
3719
|
'background-position': ([key, val]) => [key, val.split(' ').map(word => word === 'start' || word === 'insetInlineStart' ? 'left' : word === 'end' || word === 'insetInlineEnd' ? 'right' : word).join(' ')]
|
|
4776
3720
|
};
|
|
4777
3721
|
function generateLTR(pair, options = defaultOptions) {
|
|
@@ -4782,9 +3726,6 @@ function generateLTR(pair, options = defaultOptions) {
|
|
|
4782
3726
|
const [key] = pair;
|
|
4783
3727
|
if (styleResolution === 'legacy-expand-shorthands') {
|
|
4784
3728
|
if (!enableLogicalStylesPolyfill) {
|
|
4785
|
-
if (legacyValuesPolyfill$1[key]) {
|
|
4786
|
-
return legacyValuesPolyfill$1[key](pair);
|
|
4787
|
-
}
|
|
4788
3729
|
return pair;
|
|
4789
3730
|
}
|
|
4790
3731
|
if (inlinePropertyToLTR[key]) {
|
|
@@ -4857,10 +3798,6 @@ const logicalToPhysical = {
|
|
|
4857
3798
|
'inline-start': 'right',
|
|
4858
3799
|
'inline-end': 'left'
|
|
4859
3800
|
};
|
|
4860
|
-
const legacyValuesPolyfill = {
|
|
4861
|
-
float: ([key, val]) => [key, logicalToPhysical[val] ?? val],
|
|
4862
|
-
clear: ([key, val]) => [key, logicalToPhysical[val] ?? val]
|
|
4863
|
-
};
|
|
4864
3801
|
const inlinePropertyToRTL = {
|
|
4865
3802
|
'margin-inline-start': ([_key, val]) => ['margin-right', val],
|
|
4866
3803
|
'margin-inline-end': ([_key, val]) => ['margin-left', val],
|
|
@@ -4874,8 +3811,8 @@ const inlinePropertyToRTL = {
|
|
|
4874
3811
|
'border-inline-end-color': ([_key, val]) => ['border-left-color', val],
|
|
4875
3812
|
'border-inline-start-style': ([_key, val]) => ['border-right-style', val],
|
|
4876
3813
|
'border-inline-end-style': ([_key, val]) => ['border-left-style', val],
|
|
4877
|
-
'border-start-start-radius': ([
|
|
4878
|
-
'border-end-start-radius': ([
|
|
3814
|
+
'border-start-start-radius': ([_k, val]) => ['border-top-right-radius', val],
|
|
3815
|
+
'border-end-start-radius': ([_k, val]) => ['border-bottom-right-radius', val],
|
|
4879
3816
|
'border-start-end-radius': ([_key, val]) => ['border-top-left-radius', val],
|
|
4880
3817
|
'border-end-end-radius': ([_key, val]) => ['border-bottom-left-radius', val],
|
|
4881
3818
|
'inset-inline-start': ([_key, val]) => ['right', val],
|
|
@@ -4895,9 +3832,9 @@ const propertyToRTL = {
|
|
|
4895
3832
|
'border-start-style': ([_key, val]) => ['border-right-style', val],
|
|
4896
3833
|
'border-end-style': ([_key, val]) => ['border-left-style', val],
|
|
4897
3834
|
'border-top-start-radius': ([_key, val]) => ['border-top-right-radius', val],
|
|
4898
|
-
'border-bottom-start-radius': ([
|
|
3835
|
+
'border-bottom-start-radius': ([_k, v]) => ['border-bottom-right-radius', v],
|
|
4899
3836
|
'border-top-end-radius': ([_key, val]) => ['border-top-left-radius', val],
|
|
4900
|
-
'border-bottom-end-radius': ([
|
|
3837
|
+
'border-bottom-end-radius': ([_k, val]) => ['border-bottom-left-radius', val],
|
|
4901
3838
|
float: ([key, val]) => logicalToPhysical[val] != null ? [key, logicalToPhysical[val]] : null,
|
|
4902
3839
|
clear: ([key, val]) => logicalToPhysical[val] != null ? [key, logicalToPhysical[val]] : null,
|
|
4903
3840
|
start: ([_key, val]) => ['right', val],
|
|
@@ -4938,9 +3875,6 @@ function generateRTL(pair, options = defaultOptions) {
|
|
|
4938
3875
|
const [key] = pair;
|
|
4939
3876
|
if (styleResolution === 'legacy-expand-shorthands') {
|
|
4940
3877
|
if (!enableLogicalStylesPolyfill) {
|
|
4941
|
-
if (legacyValuesPolyfill[key]) {
|
|
4942
|
-
return legacyValuesPolyfill[key](pair);
|
|
4943
|
-
}
|
|
4944
3878
|
return null;
|
|
4945
3879
|
}
|
|
4946
3880
|
if (inlinePropertyToRTL[key]) {
|
|
@@ -4953,569 +3887,633 @@ function generateRTL(pair, options = defaultOptions) {
|
|
|
4953
3887
|
return propertyToRTL[key](pair, options);
|
|
4954
3888
|
}
|
|
4955
3889
|
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
longHandLogical
|
|
4977
|
-
shorthandsOfLonghands
|
|
4978
|
-
|
|
4979
|
-
longHandLogical.add('
|
|
4980
|
-
longHandLogical.add('
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
longHandLogical.add('
|
|
4984
|
-
longHandLogical.add('
|
|
4985
|
-
|
|
4986
|
-
longHandLogical.add('
|
|
4987
|
-
longHandLogical.add('
|
|
4988
|
-
longHandLogical.add('
|
|
4989
|
-
longHandLogical.add('
|
|
4990
|
-
longHandLogical.add('
|
|
4991
|
-
|
|
4992
|
-
longHandLogical.add('
|
|
4993
|
-
|
|
4994
|
-
longHandLogical.add('
|
|
4995
|
-
longHandLogical.add('
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
longHandLogical.add('
|
|
5002
|
-
longHandLogical.add('
|
|
5003
|
-
longHandLogical.add('
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
longHandLogical.add('
|
|
5007
|
-
|
|
5008
|
-
longHandLogical.add('
|
|
5009
|
-
|
|
5010
|
-
longHandLogical.add('
|
|
5011
|
-
|
|
5012
|
-
shorthandsOfLonghands.add('
|
|
5013
|
-
|
|
5014
|
-
longHandLogical.add('
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
shorthandsOfLonghands.add('border-
|
|
5024
|
-
shorthandsOfLonghands.add('border-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
shorthandsOfLonghands.add('border-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
shorthandsOfLonghands.add('border-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
longHandLogical.add('border-
|
|
5046
|
-
|
|
5047
|
-
longHandLogical.add('border-start-
|
|
5048
|
-
|
|
5049
|
-
longHandLogical.add('border-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
longHandPhysical.add('border-
|
|
5055
|
-
longHandLogical.add('
|
|
5056
|
-
|
|
5057
|
-
longHandLogical.add('
|
|
5058
|
-
|
|
5059
|
-
shorthandsOfLonghands.add('
|
|
5060
|
-
longHandLogical.add('
|
|
5061
|
-
longHandLogical.add('
|
|
5062
|
-
longHandLogical.add('
|
|
5063
|
-
longHandLogical.add('
|
|
5064
|
-
longHandLogical.add('
|
|
5065
|
-
shorthandsOfLonghands.add('
|
|
5066
|
-
longHandLogical.add('
|
|
5067
|
-
longHandLogical.add('
|
|
5068
|
-
longHandLogical.add('
|
|
5069
|
-
longHandLogical.add('
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
longHandLogical.add('
|
|
5077
|
-
longHandLogical.add('
|
|
5078
|
-
|
|
5079
|
-
longHandLogical.add('
|
|
5080
|
-
|
|
5081
|
-
longHandLogical.add('
|
|
5082
|
-
longHandLogical.add('
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
longHandLogical.add('
|
|
5086
|
-
|
|
5087
|
-
longHandLogical.add('
|
|
5088
|
-
longHandLogical.add('
|
|
5089
|
-
longHandLogical.add('
|
|
5090
|
-
longHandLogical.add('
|
|
5091
|
-
|
|
5092
|
-
longHandLogical.add('
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
longHandLogical.add('
|
|
5097
|
-
|
|
5098
|
-
longHandLogical.add('
|
|
5099
|
-
|
|
5100
|
-
longHandLogical.add('
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
longHandLogical.add('
|
|
5105
|
-
|
|
5106
|
-
longHandLogical.add('
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
longHandLogical.add('
|
|
5110
|
-
longHandPhysical.add('
|
|
5111
|
-
longHandLogical.add('
|
|
5112
|
-
longHandPhysical.add('
|
|
5113
|
-
longHandLogical.add('
|
|
5114
|
-
|
|
5115
|
-
longHandLogical.add('
|
|
5116
|
-
longHandPhysical.add('
|
|
5117
|
-
longHandLogical.add('
|
|
5118
|
-
longHandPhysical.add('
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
longHandLogical.add('
|
|
5124
|
-
longHandPhysical.add('
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
longHandLogical.add('
|
|
5129
|
-
longHandPhysical.add('
|
|
5130
|
-
longHandLogical.add('
|
|
5131
|
-
|
|
5132
|
-
longHandLogical.add('
|
|
5133
|
-
|
|
5134
|
-
longHandLogical.add('
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
longHandLogical.add('
|
|
5141
|
-
|
|
5142
|
-
longHandLogical.add('
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
longHandLogical.add('
|
|
5146
|
-
|
|
5147
|
-
longHandLogical.add('
|
|
5148
|
-
|
|
5149
|
-
longHandLogical.add('
|
|
5150
|
-
longHandLogical.add('
|
|
5151
|
-
|
|
5152
|
-
longHandLogical.add('
|
|
5153
|
-
longHandLogical.add('
|
|
5154
|
-
longHandLogical.add('
|
|
5155
|
-
|
|
5156
|
-
longHandLogical.add('
|
|
5157
|
-
longHandLogical.add('
|
|
5158
|
-
longHandLogical.add('
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
longHandLogical.add('
|
|
5162
|
-
longHandLogical.add('
|
|
5163
|
-
|
|
5164
|
-
longHandLogical.add('
|
|
5165
|
-
|
|
5166
|
-
longHandLogical.add('
|
|
5167
|
-
|
|
5168
|
-
longHandLogical.add('
|
|
5169
|
-
longHandLogical.add('
|
|
5170
|
-
|
|
5171
|
-
longHandLogical.add('
|
|
5172
|
-
longHandLogical.add('
|
|
5173
|
-
longHandLogical.add('
|
|
5174
|
-
|
|
5175
|
-
longHandLogical.add('
|
|
5176
|
-
longHandLogical.add('
|
|
5177
|
-
longHandLogical.add('
|
|
5178
|
-
|
|
5179
|
-
longHandLogical.add('
|
|
5180
|
-
longHandLogical.add('
|
|
5181
|
-
longHandLogical.add('
|
|
5182
|
-
|
|
5183
|
-
longHandLogical.add('
|
|
5184
|
-
longHandLogical.add('
|
|
5185
|
-
longHandLogical.add('
|
|
5186
|
-
|
|
5187
|
-
longHandLogical.add('font-
|
|
5188
|
-
longHandLogical.add('font-size
|
|
5189
|
-
longHandLogical.add('font-
|
|
5190
|
-
longHandLogical.add('font-
|
|
5191
|
-
longHandLogical.add('font-
|
|
5192
|
-
longHandLogical.add('
|
|
5193
|
-
|
|
5194
|
-
longHandLogical.add('
|
|
5195
|
-
longHandLogical.add('
|
|
5196
|
-
longHandLogical.add('
|
|
5197
|
-
longHandLogical.add('
|
|
5198
|
-
longHandLogical.add('
|
|
5199
|
-
longHandLogical.add('
|
|
5200
|
-
longHandLogical.add('
|
|
5201
|
-
longHandLogical.add('
|
|
5202
|
-
longHandLogical.add('
|
|
5203
|
-
|
|
5204
|
-
longHandLogical.add('
|
|
5205
|
-
longHandLogical.add('
|
|
5206
|
-
longHandLogical.add('
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
longHandLogical.add('
|
|
5210
|
-
longHandLogical.add('
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
longHandLogical.add('
|
|
5214
|
-
longHandLogical.add('
|
|
5215
|
-
|
|
5216
|
-
longHandLogical.add('
|
|
5217
|
-
longHandLogical.add('
|
|
5218
|
-
longHandLogical.add('
|
|
5219
|
-
longHandLogical.add('
|
|
5220
|
-
longHandLogical.add('
|
|
5221
|
-
longHandLogical.add('
|
|
5222
|
-
|
|
5223
|
-
longHandLogical.add('
|
|
5224
|
-
longHandLogical.add('
|
|
5225
|
-
longHandLogical.add('
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
longHandLogical.add('
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
longHandLogical.add('
|
|
5233
|
-
longHandLogical.add('
|
|
5234
|
-
shorthandsOfLonghands.add('
|
|
5235
|
-
longHandLogical.add('
|
|
5236
|
-
longHandLogical.add('
|
|
5237
|
-
longHandLogical.add('
|
|
5238
|
-
longHandLogical.add('
|
|
5239
|
-
longHandLogical.add('
|
|
5240
|
-
longHandLogical.add('
|
|
5241
|
-
longHandLogical.add('
|
|
5242
|
-
longHandLogical.add('
|
|
5243
|
-
longHandLogical.add('
|
|
5244
|
-
|
|
5245
|
-
longHandLogical.add('
|
|
5246
|
-
longHandLogical.add('
|
|
5247
|
-
|
|
5248
|
-
longHandLogical.add('
|
|
5249
|
-
longHandLogical.add('
|
|
5250
|
-
longHandLogical.add('
|
|
5251
|
-
|
|
5252
|
-
longHandLogical.add('
|
|
5253
|
-
shorthandsOfLonghands.add('
|
|
5254
|
-
longHandLogical.add('
|
|
5255
|
-
longHandLogical.add('
|
|
5256
|
-
longHandLogical.add('
|
|
5257
|
-
longHandLogical.add('
|
|
5258
|
-
longHandLogical.add('
|
|
5259
|
-
longHandLogical.add('-
|
|
5260
|
-
longHandLogical.add('-
|
|
5261
|
-
|
|
5262
|
-
longHandLogical.add('
|
|
5263
|
-
|
|
5264
|
-
longHandLogical.add('
|
|
5265
|
-
|
|
5266
|
-
longHandLogical.add('
|
|
5267
|
-
longHandLogical.add('
|
|
5268
|
-
longHandLogical.add('
|
|
5269
|
-
longHandLogical.add('
|
|
5270
|
-
|
|
5271
|
-
longHandLogical.add('
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
longHandLogical.add('
|
|
5276
|
-
|
|
5277
|
-
longHandLogical.add('
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
longHandLogical.add('
|
|
5286
|
-
longHandLogical.add('
|
|
5287
|
-
longHandLogical.add('
|
|
5288
|
-
longHandLogical.add('
|
|
5289
|
-
longHandLogical.add('
|
|
5290
|
-
longHandLogical.add('
|
|
5291
|
-
longHandLogical.add('
|
|
5292
|
-
shorthandsOfShorthands.add('
|
|
5293
|
-
shorthandsOfLonghands.add('
|
|
5294
|
-
longHandLogical.add('
|
|
5295
|
-
longHandPhysical.add('
|
|
5296
|
-
longHandLogical.add('
|
|
5297
|
-
longHandPhysical.add('
|
|
5298
|
-
shorthandsOfLonghands.add('
|
|
5299
|
-
longHandLogical.add('
|
|
5300
|
-
longHandPhysical.add('
|
|
5301
|
-
longHandLogical.add('
|
|
5302
|
-
longHandPhysical.add('
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
longHandLogical.add('
|
|
5306
|
-
|
|
5307
|
-
longHandLogical.add('
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
longHandLogical.add('
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
longHandLogical.add('scroll-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
longHandLogical.add('
|
|
5319
|
-
|
|
5320
|
-
longHandLogical.add('
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
longHandLogical.add('
|
|
5325
|
-
|
|
5326
|
-
longHandLogical.add('
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
longHandLogical.add('
|
|
5332
|
-
|
|
5333
|
-
longHandLogical.add('
|
|
5334
|
-
longHandLogical.add('
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
longHandLogical.add('
|
|
5338
|
-
longHandLogical.add('
|
|
5339
|
-
longHandLogical.add('
|
|
5340
|
-
longHandLogical.add('
|
|
5341
|
-
longHandLogical.add('
|
|
5342
|
-
longHandLogical.add('
|
|
5343
|
-
longHandLogical.add('
|
|
5344
|
-
longHandLogical.add('
|
|
5345
|
-
longHandLogical.add('
|
|
5346
|
-
longHandLogical.add('
|
|
5347
|
-
longHandLogical.add('
|
|
5348
|
-
|
|
5349
|
-
longHandLogical.add('
|
|
5350
|
-
longHandLogical.add('
|
|
5351
|
-
longHandLogical.add('
|
|
5352
|
-
longHandLogical.add('text-
|
|
5353
|
-
longHandLogical.add('text-
|
|
5354
|
-
longHandLogical.add('text-
|
|
5355
|
-
|
|
5356
|
-
longHandLogical.add('text-
|
|
5357
|
-
longHandLogical.add('text-
|
|
5358
|
-
longHandLogical.add('text-
|
|
5359
|
-
longHandLogical.add('
|
|
5360
|
-
longHandLogical.add('
|
|
5361
|
-
longHandLogical.add('
|
|
5362
|
-
longHandLogical.add('
|
|
5363
|
-
longHandLogical.add('
|
|
5364
|
-
longHandLogical.add('
|
|
5365
|
-
longHandLogical.add('
|
|
5366
|
-
longHandLogical.add('
|
|
5367
|
-
longHandLogical.add('
|
|
5368
|
-
longHandLogical.add('
|
|
5369
|
-
longHandLogical.add('
|
|
5370
|
-
longHandLogical.add('
|
|
5371
|
-
longHandLogical.add('
|
|
5372
|
-
longHandLogical.add('
|
|
5373
|
-
longHandLogical.add('
|
|
5374
|
-
|
|
5375
|
-
longHandLogical.add('
|
|
5376
|
-
longHandLogical.add('
|
|
5377
|
-
longHandLogical.add('
|
|
5378
|
-
longHandLogical.add('
|
|
5379
|
-
longHandLogical.add('
|
|
5380
|
-
longHandLogical.add('
|
|
5381
|
-
longHandLogical.add('
|
|
5382
|
-
longHandLogical.add('
|
|
5383
|
-
longHandLogical.add('
|
|
5384
|
-
longHandLogical.add('
|
|
5385
|
-
longHandLogical.add('
|
|
5386
|
-
longHandLogical.add('
|
|
5387
|
-
longHandLogical.add('
|
|
5388
|
-
longHandLogical.add('
|
|
5389
|
-
longHandLogical.add('
|
|
5390
|
-
longHandLogical.add('
|
|
5391
|
-
longHandLogical.add('
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
3890
|
+
var lib = {};
|
|
3891
|
+
|
|
3892
|
+
var propertyPriorities = {};
|
|
3893
|
+
|
|
3894
|
+
var hasRequiredPropertyPriorities;
|
|
3895
|
+
|
|
3896
|
+
function requirePropertyPriorities () {
|
|
3897
|
+
if (hasRequiredPropertyPriorities) return propertyPriorities;
|
|
3898
|
+
hasRequiredPropertyPriorities = 1;
|
|
3899
|
+
|
|
3900
|
+
Object.defineProperty(propertyPriorities, "__esModule", {
|
|
3901
|
+
value: true
|
|
3902
|
+
});
|
|
3903
|
+
propertyPriorities.PSEUDO_ELEMENT_PRIORITY = propertyPriorities.PSEUDO_CLASS_PRIORITIES = propertyPriorities.AT_RULE_PRIORITIES = void 0;
|
|
3904
|
+
propertyPriorities.default = getPriority;
|
|
3905
|
+
propertyPriorities.getAtRulePriority = getAtRulePriority;
|
|
3906
|
+
propertyPriorities.getDefaultPriority = getDefaultPriority;
|
|
3907
|
+
propertyPriorities.getPseudoClassPriority = getPseudoClassPriority;
|
|
3908
|
+
propertyPriorities.getPseudoElementPriority = getPseudoElementPriority;
|
|
3909
|
+
const longHandPhysical = new Set();
|
|
3910
|
+
const longHandLogical = new Set();
|
|
3911
|
+
const shorthandsOfLonghands = new Set();
|
|
3912
|
+
const shorthandsOfShorthands = new Set();
|
|
3913
|
+
longHandLogical.add('background-blend-mode');
|
|
3914
|
+
longHandLogical.add('isolation');
|
|
3915
|
+
longHandLogical.add('mix-blend-mode');
|
|
3916
|
+
shorthandsOfShorthands.add('animation');
|
|
3917
|
+
longHandLogical.add('animation-composition');
|
|
3918
|
+
longHandLogical.add('animation-delay');
|
|
3919
|
+
longHandLogical.add('animation-direction');
|
|
3920
|
+
longHandLogical.add('animation-duration');
|
|
3921
|
+
longHandLogical.add('animation-fill-mode');
|
|
3922
|
+
longHandLogical.add('animation-iteration-count');
|
|
3923
|
+
longHandLogical.add('animation-name');
|
|
3924
|
+
longHandLogical.add('animation-play-state');
|
|
3925
|
+
shorthandsOfLonghands.add('animation-range');
|
|
3926
|
+
longHandLogical.add('animation-range-end');
|
|
3927
|
+
longHandLogical.add('animation-range-start');
|
|
3928
|
+
longHandLogical.add('animation-timing-function');
|
|
3929
|
+
longHandLogical.add('animation-timeline');
|
|
3930
|
+
shorthandsOfLonghands.add('scroll-timeline');
|
|
3931
|
+
longHandLogical.add('scroll-timeline-axis');
|
|
3932
|
+
longHandLogical.add('scroll-timeline-name');
|
|
3933
|
+
longHandLogical.add('timeline-scope');
|
|
3934
|
+
shorthandsOfLonghands.add('view-timeline');
|
|
3935
|
+
longHandLogical.add('view-timeline-axis');
|
|
3936
|
+
longHandLogical.add('view-timeline-inset');
|
|
3937
|
+
longHandLogical.add('view-timeline-name');
|
|
3938
|
+
shorthandsOfShorthands.add('background');
|
|
3939
|
+
longHandLogical.add('background-attachment');
|
|
3940
|
+
longHandLogical.add('background-clip');
|
|
3941
|
+
longHandLogical.add('background-color');
|
|
3942
|
+
longHandLogical.add('background-image');
|
|
3943
|
+
longHandLogical.add('background-origin');
|
|
3944
|
+
longHandLogical.add('background-repeat');
|
|
3945
|
+
longHandLogical.add('background-size');
|
|
3946
|
+
shorthandsOfLonghands.add('background-position');
|
|
3947
|
+
longHandLogical.add('background-position-x');
|
|
3948
|
+
longHandLogical.add('background-position-y');
|
|
3949
|
+
shorthandsOfShorthands.add('border');
|
|
3950
|
+
shorthandsOfLonghands.add('border-color');
|
|
3951
|
+
shorthandsOfLonghands.add('border-style');
|
|
3952
|
+
shorthandsOfLonghands.add('border-width');
|
|
3953
|
+
shorthandsOfShorthands.add('border-block');
|
|
3954
|
+
longHandLogical.add('border-block-color');
|
|
3955
|
+
longHandLogical.add('border-block-stylex');
|
|
3956
|
+
longHandLogical.add('border-block-width');
|
|
3957
|
+
shorthandsOfLonghands.add('border-block-start');
|
|
3958
|
+
shorthandsOfLonghands.add('border-top');
|
|
3959
|
+
longHandLogical.add('border-block-start-color');
|
|
3960
|
+
longHandPhysical.add('border-top-color');
|
|
3961
|
+
longHandLogical.add('border-block-start-style');
|
|
3962
|
+
longHandPhysical.add('border-top-style');
|
|
3963
|
+
longHandLogical.add('border-block-start-width');
|
|
3964
|
+
longHandPhysical.add('border-top-width');
|
|
3965
|
+
shorthandsOfLonghands.add('border-block-end');
|
|
3966
|
+
shorthandsOfLonghands.add('border-bottom');
|
|
3967
|
+
longHandLogical.add('border-block-end-color');
|
|
3968
|
+
longHandPhysical.add('border-bottom-color');
|
|
3969
|
+
longHandLogical.add('border-block-end-style');
|
|
3970
|
+
longHandPhysical.add('border-bottom-style');
|
|
3971
|
+
longHandLogical.add('border-block-end-width');
|
|
3972
|
+
longHandPhysical.add('border-bottom-width');
|
|
3973
|
+
shorthandsOfShorthands.add('border-inline');
|
|
3974
|
+
shorthandsOfLonghands.add('border-inline-color');
|
|
3975
|
+
shorthandsOfLonghands.add('border-inline-style');
|
|
3976
|
+
shorthandsOfLonghands.add('border-inline-width');
|
|
3977
|
+
shorthandsOfLonghands.add('border-inline-start');
|
|
3978
|
+
shorthandsOfLonghands.add('border-left');
|
|
3979
|
+
longHandLogical.add('border-inline-start-color');
|
|
3980
|
+
longHandPhysical.add('border-left-color');
|
|
3981
|
+
longHandLogical.add('border-inline-start-style');
|
|
3982
|
+
longHandPhysical.add('border-left-style');
|
|
3983
|
+
longHandLogical.add('border-inline-start-width');
|
|
3984
|
+
longHandPhysical.add('border-left-width');
|
|
3985
|
+
shorthandsOfLonghands.add('border-inline-end');
|
|
3986
|
+
shorthandsOfLonghands.add('border-right');
|
|
3987
|
+
longHandLogical.add('border-inline-end-color');
|
|
3988
|
+
longHandPhysical.add('border-right-color');
|
|
3989
|
+
longHandLogical.add('border-inline-end-style');
|
|
3990
|
+
longHandPhysical.add('border-right-style');
|
|
3991
|
+
longHandLogical.add('border-inline-end-width');
|
|
3992
|
+
longHandPhysical.add('border-right-width');
|
|
3993
|
+
shorthandsOfLonghands.add('border-image');
|
|
3994
|
+
longHandLogical.add('border-image-outset');
|
|
3995
|
+
longHandLogical.add('border-image-repeat');
|
|
3996
|
+
longHandLogical.add('border-image-slice');
|
|
3997
|
+
longHandLogical.add('border-image-source');
|
|
3998
|
+
longHandLogical.add('border-image-width');
|
|
3999
|
+
shorthandsOfLonghands.add('border-radius');
|
|
4000
|
+
longHandLogical.add('border-start-end-radius');
|
|
4001
|
+
longHandLogical.add('border-start-start-radius');
|
|
4002
|
+
longHandLogical.add('border-end-end-radius');
|
|
4003
|
+
longHandLogical.add('border-end-start-radius');
|
|
4004
|
+
longHandPhysical.add('border-top-left-radius');
|
|
4005
|
+
longHandPhysical.add('border-top-right-radius');
|
|
4006
|
+
longHandPhysical.add('border-bottom-left-radius');
|
|
4007
|
+
longHandPhysical.add('border-bottom-right-radius');
|
|
4008
|
+
longHandLogical.add('box-shadow');
|
|
4009
|
+
longHandLogical.add('accent-color');
|
|
4010
|
+
longHandLogical.add('appearance');
|
|
4011
|
+
longHandLogical.add('aspect-ratio');
|
|
4012
|
+
shorthandsOfLonghands.add('caret');
|
|
4013
|
+
longHandLogical.add('caret-color');
|
|
4014
|
+
longHandLogical.add('caret-shape');
|
|
4015
|
+
longHandLogical.add('cursor');
|
|
4016
|
+
longHandLogical.add('ime-mode');
|
|
4017
|
+
longHandLogical.add('input-security');
|
|
4018
|
+
shorthandsOfLonghands.add('outline');
|
|
4019
|
+
longHandLogical.add('outline-color');
|
|
4020
|
+
longHandLogical.add('outline-offset');
|
|
4021
|
+
longHandLogical.add('outline-style');
|
|
4022
|
+
longHandLogical.add('outline-width');
|
|
4023
|
+
longHandLogical.add('pointer-events');
|
|
4024
|
+
longHandLogical.add('resize');
|
|
4025
|
+
longHandLogical.add('text-overflow');
|
|
4026
|
+
longHandLogical.add('user-select');
|
|
4027
|
+
shorthandsOfLonghands.add('grid-gap');
|
|
4028
|
+
shorthandsOfLonghands.add('gap');
|
|
4029
|
+
longHandLogical.add('grid-row-gap');
|
|
4030
|
+
longHandLogical.add('row-gap');
|
|
4031
|
+
longHandLogical.add('grid-column-gap');
|
|
4032
|
+
longHandLogical.add('column-gap');
|
|
4033
|
+
shorthandsOfLonghands.add('place-content');
|
|
4034
|
+
longHandLogical.add('align-content');
|
|
4035
|
+
longHandLogical.add('justify-content');
|
|
4036
|
+
shorthandsOfLonghands.add('place-items');
|
|
4037
|
+
longHandLogical.add('align-items');
|
|
4038
|
+
longHandLogical.add('justify-items');
|
|
4039
|
+
shorthandsOfLonghands.add('place-self');
|
|
4040
|
+
longHandLogical.add('align-self');
|
|
4041
|
+
longHandLogical.add('justify-self');
|
|
4042
|
+
longHandLogical.add('box-sizing');
|
|
4043
|
+
longHandLogical.add('block-size');
|
|
4044
|
+
longHandPhysical.add('height');
|
|
4045
|
+
longHandLogical.add('inline-size');
|
|
4046
|
+
longHandPhysical.add('width');
|
|
4047
|
+
longHandLogical.add('max-block-size');
|
|
4048
|
+
longHandPhysical.add('max-height');
|
|
4049
|
+
longHandLogical.add('max-inline-size');
|
|
4050
|
+
longHandPhysical.add('max-width');
|
|
4051
|
+
longHandLogical.add('min-block-size');
|
|
4052
|
+
longHandPhysical.add('min-height');
|
|
4053
|
+
longHandLogical.add('min-inline-size');
|
|
4054
|
+
longHandPhysical.add('min-width');
|
|
4055
|
+
shorthandsOfShorthands.add('margin');
|
|
4056
|
+
shorthandsOfLonghands.add('margin-block');
|
|
4057
|
+
longHandLogical.add('margin-block-start');
|
|
4058
|
+
longHandPhysical.add('margin-top');
|
|
4059
|
+
longHandLogical.add('margin-block-end');
|
|
4060
|
+
longHandPhysical.add('margin-bottom');
|
|
4061
|
+
shorthandsOfLonghands.add('margin-inline');
|
|
4062
|
+
longHandLogical.add('margin-inline-start');
|
|
4063
|
+
longHandPhysical.add('margin-left');
|
|
4064
|
+
longHandLogical.add('margin-inline-end');
|
|
4065
|
+
longHandPhysical.add('margin-right');
|
|
4066
|
+
longHandLogical.add('margin-trim');
|
|
4067
|
+
shorthandsOfLonghands.add('overscroll-behavior');
|
|
4068
|
+
longHandLogical.add('overscroll-behavior-block');
|
|
4069
|
+
longHandPhysical.add('overscroll-behavior-y');
|
|
4070
|
+
longHandLogical.add('overscroll-behavior-inline');
|
|
4071
|
+
longHandPhysical.add('overscroll-behavior-x');
|
|
4072
|
+
shorthandsOfShorthands.add('padding');
|
|
4073
|
+
shorthandsOfLonghands.add('padding-block');
|
|
4074
|
+
longHandLogical.add('padding-block-start');
|
|
4075
|
+
longHandPhysical.add('padding-top');
|
|
4076
|
+
longHandLogical.add('padding-block-end');
|
|
4077
|
+
longHandPhysical.add('padding-bottom');
|
|
4078
|
+
shorthandsOfLonghands.add('padding-inline');
|
|
4079
|
+
longHandLogical.add('padding-inline-start');
|
|
4080
|
+
longHandPhysical.add('padding-left');
|
|
4081
|
+
longHandLogical.add('padding-inline-end');
|
|
4082
|
+
longHandPhysical.add('padding-right');
|
|
4083
|
+
longHandLogical.add('visibility');
|
|
4084
|
+
longHandLogical.add('color');
|
|
4085
|
+
longHandLogical.add('color-scheme');
|
|
4086
|
+
longHandLogical.add('forced-color-adjust');
|
|
4087
|
+
longHandLogical.add('opacity');
|
|
4088
|
+
longHandLogical.add('print-color-adjust');
|
|
4089
|
+
shorthandsOfLonghands.add('columns');
|
|
4090
|
+
longHandLogical.add('column-count');
|
|
4091
|
+
longHandLogical.add('column-width');
|
|
4092
|
+
longHandLogical.add('column-fill');
|
|
4093
|
+
longHandLogical.add('column-span');
|
|
4094
|
+
shorthandsOfLonghands.add('column-rule');
|
|
4095
|
+
longHandLogical.add('column-rule-color');
|
|
4096
|
+
longHandLogical.add('column-rule-style');
|
|
4097
|
+
longHandLogical.add('column-rule-width');
|
|
4098
|
+
longHandLogical.add('contain');
|
|
4099
|
+
shorthandsOfLonghands.add('contain-intrinsic-size');
|
|
4100
|
+
longHandLogical.add('contain-intrinsic-block-size');
|
|
4101
|
+
longHandLogical.add('contain-intrinsic-width');
|
|
4102
|
+
longHandLogical.add('contain-intrinsic-height');
|
|
4103
|
+
longHandLogical.add('contain-intrinsic-inline-size');
|
|
4104
|
+
shorthandsOfLonghands.add('container');
|
|
4105
|
+
longHandLogical.add('container-name');
|
|
4106
|
+
longHandLogical.add('container-type');
|
|
4107
|
+
longHandLogical.add('content-visibility');
|
|
4108
|
+
longHandLogical.add('counter-increment');
|
|
4109
|
+
longHandLogical.add('counter-reset');
|
|
4110
|
+
longHandLogical.add('counter-set');
|
|
4111
|
+
longHandLogical.add('display');
|
|
4112
|
+
shorthandsOfLonghands.add('flex');
|
|
4113
|
+
longHandLogical.add('flex-basis');
|
|
4114
|
+
longHandLogical.add('flex-grow');
|
|
4115
|
+
longHandLogical.add('flex-shrink');
|
|
4116
|
+
shorthandsOfLonghands.add('flex-flow');
|
|
4117
|
+
longHandLogical.add('flex-direction');
|
|
4118
|
+
longHandLogical.add('flex-wrap');
|
|
4119
|
+
longHandLogical.add('order');
|
|
4120
|
+
shorthandsOfShorthands.add('font');
|
|
4121
|
+
longHandLogical.add('font-family');
|
|
4122
|
+
longHandLogical.add('font-size');
|
|
4123
|
+
longHandLogical.add('font-stretch');
|
|
4124
|
+
longHandLogical.add('font-style');
|
|
4125
|
+
longHandLogical.add('font-weight');
|
|
4126
|
+
longHandLogical.add('line-height');
|
|
4127
|
+
shorthandsOfLonghands.add('font-variant');
|
|
4128
|
+
longHandLogical.add('font-variant-alternates');
|
|
4129
|
+
longHandLogical.add('font-variant-caps');
|
|
4130
|
+
longHandLogical.add('font-variant-east-asian');
|
|
4131
|
+
longHandLogical.add('font-variant-emoji');
|
|
4132
|
+
longHandLogical.add('font-variant-ligatures');
|
|
4133
|
+
longHandLogical.add('font-variant-numeric');
|
|
4134
|
+
longHandLogical.add('font-variant-position');
|
|
4135
|
+
longHandLogical.add('font-feature-settings');
|
|
4136
|
+
longHandLogical.add('font-kerning');
|
|
4137
|
+
longHandLogical.add('font-language-override');
|
|
4138
|
+
longHandLogical.add('font-optical-sizing');
|
|
4139
|
+
longHandLogical.add('font-palette');
|
|
4140
|
+
longHandLogical.add('font-variation-settings');
|
|
4141
|
+
longHandLogical.add('font-size-adjust');
|
|
4142
|
+
longHandLogical.add('font-smooth');
|
|
4143
|
+
longHandLogical.add('font-synthesis-position');
|
|
4144
|
+
longHandLogical.add('font-synthesis-small-caps');
|
|
4145
|
+
longHandLogical.add('font-synthesis-style');
|
|
4146
|
+
longHandLogical.add('font-synthesis-weight');
|
|
4147
|
+
longHandLogical.add('line-height-step');
|
|
4148
|
+
longHandLogical.add('box-decoration-break');
|
|
4149
|
+
longHandLogical.add('break-after');
|
|
4150
|
+
longHandLogical.add('break-before');
|
|
4151
|
+
longHandLogical.add('break-inside');
|
|
4152
|
+
longHandLogical.add('orphans');
|
|
4153
|
+
longHandLogical.add('widows');
|
|
4154
|
+
longHandLogical.add('content');
|
|
4155
|
+
longHandLogical.add('quotes');
|
|
4156
|
+
shorthandsOfShorthands.add('grid');
|
|
4157
|
+
longHandLogical.add('grid-auto-flow');
|
|
4158
|
+
longHandLogical.add('grid-auto-rows');
|
|
4159
|
+
longHandLogical.add('grid-auto-columns');
|
|
4160
|
+
shorthandsOfShorthands.add('grid-template');
|
|
4161
|
+
shorthandsOfLonghands.add('grid-template-areas');
|
|
4162
|
+
longHandLogical.add('grid-template-columns');
|
|
4163
|
+
longHandLogical.add('grid-template-rows');
|
|
4164
|
+
shorthandsOfShorthands.add('grid-area');
|
|
4165
|
+
shorthandsOfLonghands.add('grid-row');
|
|
4166
|
+
longHandLogical.add('grid-row-start');
|
|
4167
|
+
longHandLogical.add('grid-row-end');
|
|
4168
|
+
shorthandsOfLonghands.add('grid-column');
|
|
4169
|
+
longHandLogical.add('grid-column-start');
|
|
4170
|
+
longHandLogical.add('grid-column-end');
|
|
4171
|
+
longHandLogical.add('align-tracks');
|
|
4172
|
+
longHandLogical.add('justify-tracks');
|
|
4173
|
+
longHandLogical.add('masonry-auto-flow');
|
|
4174
|
+
longHandLogical.add('image-orientation');
|
|
4175
|
+
longHandLogical.add('image-rendering');
|
|
4176
|
+
longHandLogical.add('image-resolution');
|
|
4177
|
+
longHandLogical.add('object-fit');
|
|
4178
|
+
longHandLogical.add('object-position');
|
|
4179
|
+
longHandLogical.add('initial-letter');
|
|
4180
|
+
longHandLogical.add('initial-letter-align');
|
|
4181
|
+
shorthandsOfLonghands.add('list-style');
|
|
4182
|
+
longHandLogical.add('list-style-image');
|
|
4183
|
+
longHandLogical.add('list-style-position');
|
|
4184
|
+
longHandLogical.add('list-style-type');
|
|
4185
|
+
longHandLogical.add('clip');
|
|
4186
|
+
longHandLogical.add('clip-path');
|
|
4187
|
+
shorthandsOfLonghands.add('mask');
|
|
4188
|
+
longHandLogical.add('mask-clip');
|
|
4189
|
+
longHandLogical.add('mask-composite');
|
|
4190
|
+
longHandLogical.add('mask-image');
|
|
4191
|
+
longHandLogical.add('mask-mode');
|
|
4192
|
+
longHandLogical.add('mask-origin');
|
|
4193
|
+
longHandLogical.add('mask-position');
|
|
4194
|
+
longHandLogical.add('mask-repeat');
|
|
4195
|
+
longHandLogical.add('mask-size');
|
|
4196
|
+
longHandLogical.add('mask-type');
|
|
4197
|
+
shorthandsOfLonghands.add('mask-border');
|
|
4198
|
+
longHandLogical.add('mask-border-mode');
|
|
4199
|
+
longHandLogical.add('mask-border-outset');
|
|
4200
|
+
longHandLogical.add('mask-border-repeat');
|
|
4201
|
+
longHandLogical.add('mask-border-slice');
|
|
4202
|
+
longHandLogical.add('mask-border-source');
|
|
4203
|
+
longHandLogical.add('mask-border-width');
|
|
4204
|
+
shorthandsOfShorthands.add('all');
|
|
4205
|
+
longHandLogical.add('text-rendering');
|
|
4206
|
+
shorthandsOfLonghands.add('offset');
|
|
4207
|
+
longHandLogical.add('offset-anchor');
|
|
4208
|
+
longHandLogical.add('offset-distance');
|
|
4209
|
+
longHandLogical.add('offset-path');
|
|
4210
|
+
longHandLogical.add('offset-position');
|
|
4211
|
+
longHandLogical.add('offset-rotate');
|
|
4212
|
+
longHandLogical.add('-webkit-box-orient');
|
|
4213
|
+
longHandLogical.add('-webkit-line-clamp');
|
|
4214
|
+
shorthandsOfLonghands.add('overflow');
|
|
4215
|
+
longHandLogical.add('overflow-block');
|
|
4216
|
+
longHandPhysical.add('overflow-y');
|
|
4217
|
+
longHandLogical.add('overflow-inline');
|
|
4218
|
+
longHandPhysical.add('overflow-x');
|
|
4219
|
+
longHandLogical.add('overflow-clip-margin');
|
|
4220
|
+
longHandLogical.add('scroll-gutter');
|
|
4221
|
+
longHandLogical.add('scroll-behavior');
|
|
4222
|
+
longHandLogical.add('page');
|
|
4223
|
+
longHandLogical.add('page-break-after');
|
|
4224
|
+
longHandLogical.add('page-break-before');
|
|
4225
|
+
longHandLogical.add('page-break-inside');
|
|
4226
|
+
shorthandsOfShorthands.add('inset');
|
|
4227
|
+
shorthandsOfLonghands.add('inset-block');
|
|
4228
|
+
longHandLogical.add('inset-block-start');
|
|
4229
|
+
longHandPhysical.add('top');
|
|
4230
|
+
longHandLogical.add('inset-block-end');
|
|
4231
|
+
longHandPhysical.add('bottom');
|
|
4232
|
+
shorthandsOfLonghands.add('inset-inline');
|
|
4233
|
+
longHandLogical.add('inset-inline-start');
|
|
4234
|
+
longHandPhysical.add('left');
|
|
4235
|
+
longHandLogical.add('inset-inline-end');
|
|
4236
|
+
longHandPhysical.add('right');
|
|
4237
|
+
longHandLogical.add('clear');
|
|
4238
|
+
longHandLogical.add('float');
|
|
4239
|
+
longHandLogical.add('position');
|
|
4240
|
+
longHandLogical.add('z-index');
|
|
4241
|
+
longHandLogical.add('ruby-align');
|
|
4242
|
+
longHandLogical.add('ruby-merge');
|
|
4243
|
+
longHandLogical.add('ruby-position');
|
|
4244
|
+
longHandLogical.add('overflow-anchor');
|
|
4245
|
+
shorthandsOfShorthands.add('scroll-margin');
|
|
4246
|
+
shorthandsOfLonghands.add('scroll-margin-block');
|
|
4247
|
+
longHandLogical.add('scroll-margin-block-start');
|
|
4248
|
+
longHandPhysical.add('scroll-margin-top');
|
|
4249
|
+
longHandLogical.add('scroll-margin-block-end');
|
|
4250
|
+
longHandPhysical.add('scroll-margin-bottom');
|
|
4251
|
+
shorthandsOfLonghands.add('scroll-margin-inline');
|
|
4252
|
+
longHandLogical.add('scroll-margin-inline-start');
|
|
4253
|
+
longHandPhysical.add('scroll-margin-left');
|
|
4254
|
+
longHandLogical.add('scroll-margin-inline-end');
|
|
4255
|
+
longHandPhysical.add('scroll-margin-right');
|
|
4256
|
+
shorthandsOfShorthands.add('scroll-padding');
|
|
4257
|
+
shorthandsOfLonghands.add('scroll-padding-block');
|
|
4258
|
+
longHandLogical.add('scroll-padding-block-start');
|
|
4259
|
+
longHandPhysical.add('scroll-padding-top');
|
|
4260
|
+
longHandLogical.add('scroll-padding-block-end');
|
|
4261
|
+
longHandPhysical.add('scroll-padding-bottom');
|
|
4262
|
+
shorthandsOfLonghands.add('scroll-padding-inline');
|
|
4263
|
+
longHandLogical.add('scroll-padding-inline-start');
|
|
4264
|
+
longHandPhysical.add('scroll-padding-left');
|
|
4265
|
+
longHandLogical.add('scroll-padding-inline-end');
|
|
4266
|
+
longHandPhysical.add('scroll-padding-right');
|
|
4267
|
+
longHandLogical.add('scroll-snap-align');
|
|
4268
|
+
longHandLogical.add('scroll-snap-stop');
|
|
4269
|
+
shorthandsOfLonghands.add('scroll-snap-type');
|
|
4270
|
+
longHandLogical.add('scrollbar-color');
|
|
4271
|
+
longHandLogical.add('scrollbar-width');
|
|
4272
|
+
longHandLogical.add('shape-image-threshold');
|
|
4273
|
+
longHandLogical.add('shape-margin');
|
|
4274
|
+
longHandLogical.add('shape-outside');
|
|
4275
|
+
longHandLogical.add('azimuth');
|
|
4276
|
+
longHandLogical.add('border-collapse');
|
|
4277
|
+
longHandLogical.add('border-spacing');
|
|
4278
|
+
longHandLogical.add('caption-side');
|
|
4279
|
+
longHandLogical.add('empty-cells');
|
|
4280
|
+
longHandLogical.add('table-layout');
|
|
4281
|
+
longHandLogical.add('vertical-align');
|
|
4282
|
+
shorthandsOfLonghands.add('text-decoration');
|
|
4283
|
+
longHandLogical.add('text-decoration-color');
|
|
4284
|
+
longHandLogical.add('text-decoration-line');
|
|
4285
|
+
longHandLogical.add('text-decoration-skip');
|
|
4286
|
+
longHandLogical.add('text-decoration-skip-ink');
|
|
4287
|
+
longHandLogical.add('text-decoration-style');
|
|
4288
|
+
longHandLogical.add('text-decoration-thickness');
|
|
4289
|
+
shorthandsOfLonghands.add('text-emphasis');
|
|
4290
|
+
longHandLogical.add('text-emphasis-color');
|
|
4291
|
+
longHandLogical.add('text-emphasis-position');
|
|
4292
|
+
longHandLogical.add('text-emphasis-style');
|
|
4293
|
+
longHandLogical.add('text-shadow');
|
|
4294
|
+
longHandLogical.add('text-underline-offset');
|
|
4295
|
+
longHandLogical.add('text-underline-position');
|
|
4296
|
+
longHandLogical.add('hanging-punctuation');
|
|
4297
|
+
longHandLogical.add('hyphenate-character');
|
|
4298
|
+
longHandLogical.add('hyphenate-limit-chars');
|
|
4299
|
+
longHandLogical.add('hyphens');
|
|
4300
|
+
longHandLogical.add('letter-spacing');
|
|
4301
|
+
longHandLogical.add('line-break');
|
|
4302
|
+
longHandLogical.add('overflow-wrap');
|
|
4303
|
+
longHandLogical.add('paint-order');
|
|
4304
|
+
longHandLogical.add('tab-size');
|
|
4305
|
+
longHandLogical.add('text-align');
|
|
4306
|
+
longHandLogical.add('text-align-last');
|
|
4307
|
+
longHandLogical.add('text-indent');
|
|
4308
|
+
longHandLogical.add('text-justify');
|
|
4309
|
+
longHandLogical.add('text-size-adjust');
|
|
4310
|
+
longHandLogical.add('text-transform');
|
|
4311
|
+
longHandLogical.add('text-wrap');
|
|
4312
|
+
longHandLogical.add('white-space');
|
|
4313
|
+
longHandLogical.add('white-space-collapse');
|
|
4314
|
+
longHandLogical.add('word-break');
|
|
4315
|
+
longHandLogical.add('word-spacing');
|
|
4316
|
+
longHandLogical.add('word-wrap');
|
|
4317
|
+
longHandLogical.add('backface-visibility');
|
|
4318
|
+
longHandLogical.add('perspective');
|
|
4319
|
+
longHandLogical.add('perspective-origin');
|
|
4320
|
+
longHandLogical.add('rotate');
|
|
4321
|
+
longHandLogical.add('scale');
|
|
4322
|
+
longHandLogical.add('transform');
|
|
4323
|
+
longHandLogical.add('transform-box');
|
|
4324
|
+
longHandLogical.add('transform-origin');
|
|
4325
|
+
longHandLogical.add('transform-style');
|
|
4326
|
+
longHandLogical.add('translate');
|
|
4327
|
+
shorthandsOfLonghands.add('transition');
|
|
4328
|
+
longHandLogical.add('transition-delay');
|
|
4329
|
+
longHandLogical.add('transition-duration');
|
|
4330
|
+
longHandLogical.add('transition-property');
|
|
4331
|
+
longHandLogical.add('transition-timing-function');
|
|
4332
|
+
longHandLogical.add('view-transition-name');
|
|
4333
|
+
longHandLogical.add('will-change');
|
|
4334
|
+
longHandLogical.add('direction');
|
|
4335
|
+
longHandLogical.add('text-combine-upright');
|
|
4336
|
+
longHandLogical.add('text-orientation');
|
|
4337
|
+
longHandLogical.add('unicode-bidi');
|
|
4338
|
+
longHandLogical.add('writing-mode');
|
|
4339
|
+
longHandLogical.add('backdrop-filter');
|
|
4340
|
+
longHandLogical.add('filter');
|
|
4341
|
+
longHandLogical.add('math-depth');
|
|
4342
|
+
longHandLogical.add('math-shift');
|
|
4343
|
+
longHandLogical.add('math-style');
|
|
4344
|
+
longHandLogical.add('touch-action');
|
|
4345
|
+
const PSEUDO_CLASS_PRIORITIES = propertyPriorities.PSEUDO_CLASS_PRIORITIES = {
|
|
4346
|
+
':is': 40,
|
|
4347
|
+
':where': 40,
|
|
4348
|
+
':not': 40,
|
|
4349
|
+
':has': 45,
|
|
4350
|
+
':dir': 50,
|
|
4351
|
+
':lang': 51,
|
|
4352
|
+
':first-child': 52,
|
|
4353
|
+
':first-of-type': 53,
|
|
4354
|
+
':last-child': 54,
|
|
4355
|
+
':last-of-type': 55,
|
|
4356
|
+
':only-child': 56,
|
|
4357
|
+
':only-of-type': 57,
|
|
4358
|
+
':nth-child': 60,
|
|
4359
|
+
':nth-last-child': 61,
|
|
4360
|
+
':nth-of-type': 62,
|
|
4361
|
+
':nth-last-of-type': 63,
|
|
4362
|
+
':empty': 70,
|
|
4363
|
+
':link': 80,
|
|
4364
|
+
':any-link': 81,
|
|
4365
|
+
':local-link': 82,
|
|
4366
|
+
':target-within': 83,
|
|
4367
|
+
':target': 84,
|
|
4368
|
+
':visited': 85,
|
|
4369
|
+
':enabled': 91,
|
|
4370
|
+
':disabled': 92,
|
|
4371
|
+
':required': 93,
|
|
4372
|
+
':optional': 94,
|
|
4373
|
+
':read-only': 95,
|
|
4374
|
+
':read-write': 96,
|
|
4375
|
+
':placeholder-shown': 97,
|
|
4376
|
+
':in-range': 98,
|
|
4377
|
+
':out-of-range': 99,
|
|
4378
|
+
':default': 100,
|
|
4379
|
+
':checked': 101,
|
|
4380
|
+
':indeterminate': 101,
|
|
4381
|
+
':blank': 102,
|
|
4382
|
+
':valid': 103,
|
|
4383
|
+
':invalid': 104,
|
|
4384
|
+
':user-invalid': 105,
|
|
4385
|
+
':autofill': 110,
|
|
4386
|
+
':picture-in-picture': 120,
|
|
4387
|
+
':modal': 121,
|
|
4388
|
+
':fullscreen': 122,
|
|
4389
|
+
':paused': 123,
|
|
4390
|
+
':playing': 124,
|
|
4391
|
+
':current': 125,
|
|
4392
|
+
':past': 126,
|
|
4393
|
+
':future': 127,
|
|
4394
|
+
':hover': 130,
|
|
4395
|
+
':focusWithin': 140,
|
|
4396
|
+
':focus': 150,
|
|
4397
|
+
':focusVisible': 160,
|
|
4398
|
+
':active': 170
|
|
4399
|
+
};
|
|
4400
|
+
const AT_RULE_PRIORITIES = propertyPriorities.AT_RULE_PRIORITIES = {
|
|
4401
|
+
'@supports': 30,
|
|
4402
|
+
'@media': 200,
|
|
4403
|
+
'@container': 300
|
|
4404
|
+
};
|
|
4405
|
+
const PSEUDO_ELEMENT_PRIORITY = propertyPriorities.PSEUDO_ELEMENT_PRIORITY = 5000;
|
|
4406
|
+
const RELATIONAL_SELECTORS = {
|
|
4407
|
+
ANCESTOR: /^:where\(\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\s+\*\)$/,
|
|
4408
|
+
DESCENDANT: /^:where\(:has\(\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\)\)$/,
|
|
4409
|
+
SIBLING_BEFORE: /^:where\(\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\s+~\s+\*\)$/,
|
|
4410
|
+
SIBLING_AFTER: /^:where\(:has\(~\s\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\)\)$/,
|
|
4411
|
+
ANY_SIBLING: /^:where\(\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\s+~\s+\*,\s+:has\(~\s\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\)\)$/
|
|
4412
|
+
};
|
|
4413
|
+
function getAtRulePriority(key) {
|
|
4414
|
+
if (key.startsWith('--')) {
|
|
4415
|
+
return 1;
|
|
4416
|
+
}
|
|
4417
|
+
if (key.startsWith('@supports')) {
|
|
4418
|
+
return AT_RULE_PRIORITIES['@supports'];
|
|
4419
|
+
}
|
|
4420
|
+
if (key.startsWith('@media')) {
|
|
4421
|
+
return AT_RULE_PRIORITIES['@media'];
|
|
4422
|
+
}
|
|
4423
|
+
if (key.startsWith('@container')) {
|
|
4424
|
+
return AT_RULE_PRIORITIES['@container'];
|
|
4425
|
+
}
|
|
4426
|
+
}
|
|
4427
|
+
function getPseudoElementPriority(key) {
|
|
4428
|
+
if (key.startsWith('::')) {
|
|
4429
|
+
return PSEUDO_ELEMENT_PRIORITY;
|
|
4430
|
+
}
|
|
4431
|
+
}
|
|
4432
|
+
function getPseudoClassPriority(key) {
|
|
4433
|
+
const pseudoBase = p => (PSEUDO_CLASS_PRIORITIES[p] ?? 40) / 100;
|
|
4434
|
+
const ancestorMatch = RELATIONAL_SELECTORS.ANCESTOR.exec(key);
|
|
4435
|
+
if (ancestorMatch) {
|
|
4436
|
+
return 10 + pseudoBase(ancestorMatch[1]);
|
|
4437
|
+
}
|
|
4438
|
+
const descendantMatch = RELATIONAL_SELECTORS.DESCENDANT.exec(key);
|
|
4439
|
+
if (descendantMatch) {
|
|
4440
|
+
return 15 + pseudoBase(descendantMatch[1]);
|
|
4441
|
+
}
|
|
4442
|
+
const anySiblingMatch = RELATIONAL_SELECTORS.ANY_SIBLING.exec(key);
|
|
4443
|
+
if (anySiblingMatch) return 20 + Math.max(pseudoBase(anySiblingMatch[1]), pseudoBase(anySiblingMatch[2]));
|
|
4444
|
+
const siblingBeforeMatch = RELATIONAL_SELECTORS.SIBLING_BEFORE.exec(key);
|
|
4445
|
+
if (siblingBeforeMatch) {
|
|
4446
|
+
return 30 + pseudoBase(siblingBeforeMatch[1]);
|
|
4447
|
+
}
|
|
4448
|
+
const siblingAfterMatch = RELATIONAL_SELECTORS.SIBLING_AFTER.exec(key);
|
|
4449
|
+
if (siblingAfterMatch) {
|
|
4450
|
+
return 40 + pseudoBase(siblingAfterMatch[1]);
|
|
4451
|
+
}
|
|
4452
|
+
if (key.startsWith(':')) {
|
|
4453
|
+
const prop = key.startsWith(':') && key.includes('(') ? key.slice(0, key.indexOf('(')) : key;
|
|
4454
|
+
return PSEUDO_CLASS_PRIORITIES[prop] ?? 40;
|
|
4455
|
+
}
|
|
4456
|
+
}
|
|
4457
|
+
function getDefaultPriority(key) {
|
|
4458
|
+
if (shorthandsOfShorthands.has(key)) {
|
|
4459
|
+
return 1000;
|
|
4460
|
+
}
|
|
4461
|
+
if (shorthandsOfLonghands.has(key)) {
|
|
4462
|
+
return 2000;
|
|
4463
|
+
}
|
|
4464
|
+
if (longHandLogical.has(key)) {
|
|
4465
|
+
return 3000;
|
|
4466
|
+
}
|
|
4467
|
+
if (longHandPhysical.has(key)) {
|
|
4468
|
+
return 4000;
|
|
4469
|
+
}
|
|
4470
|
+
}
|
|
4471
|
+
function getPriority(key) {
|
|
4472
|
+
const atRulePriority = getAtRulePriority(key);
|
|
4473
|
+
if (atRulePriority) return atRulePriority;
|
|
4474
|
+
const pseudoElementPriority = getPseudoElementPriority(key);
|
|
4475
|
+
if (pseudoElementPriority) return pseudoElementPriority;
|
|
4476
|
+
const pseudoClassPriority = getPseudoClassPriority(key);
|
|
4477
|
+
if (pseudoClassPriority) return pseudoClassPriority;
|
|
4478
|
+
const defaultPriority = getDefaultPriority(key);
|
|
4479
|
+
if (defaultPriority) return defaultPriority;
|
|
4480
|
+
return 3000;
|
|
4481
|
+
}
|
|
4482
|
+
return propertyPriorities;
|
|
5512
4483
|
}
|
|
5513
4484
|
|
|
4485
|
+
var hasRequiredLib;
|
|
4486
|
+
|
|
4487
|
+
function requireLib () {
|
|
4488
|
+
if (hasRequiredLib) return lib;
|
|
4489
|
+
hasRequiredLib = 1;
|
|
4490
|
+
|
|
4491
|
+
Object.defineProperty(lib, "__esModule", {
|
|
4492
|
+
value: true
|
|
4493
|
+
});
|
|
4494
|
+
lib.getPseudoElementPriority = lib.getPseudoClassPriority = lib.getPriority = lib.getDefaultPriority = lib.getAtRulePriority = lib.PSEUDO_ELEMENT_PRIORITY = lib.PSEUDO_CLASS_PRIORITIES = lib.AT_RULE_PRIORITIES = void 0;
|
|
4495
|
+
var _propertyPriorities = _interopRequireWildcard(requirePropertyPriorities());
|
|
4496
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
4497
|
+
lib.getAtRulePriority = _propertyPriorities.getAtRulePriority;
|
|
4498
|
+
lib.getPseudoElementPriority = _propertyPriorities.getPseudoElementPriority;
|
|
4499
|
+
lib.getPseudoClassPriority = _propertyPriorities.getPseudoClassPriority;
|
|
4500
|
+
lib.getDefaultPriority = _propertyPriorities.getDefaultPriority;
|
|
4501
|
+
lib.getPriority = _propertyPriorities.default;
|
|
4502
|
+
lib.PSEUDO_CLASS_PRIORITIES = _propertyPriorities.PSEUDO_CLASS_PRIORITIES;
|
|
4503
|
+
lib.AT_RULE_PRIORITIES = _propertyPriorities.AT_RULE_PRIORITIES;
|
|
4504
|
+
lib.PSEUDO_ELEMENT_PRIORITY = _propertyPriorities.PSEUDO_ELEMENT_PRIORITY;
|
|
4505
|
+
return lib;
|
|
4506
|
+
}
|
|
4507
|
+
|
|
4508
|
+
var libExports = requireLib();
|
|
4509
|
+
|
|
5514
4510
|
const THUMB_VARIANTS = ['::-webkit-slider-thumb', '::-moz-range-thumb', '::-ms-thumb'];
|
|
5515
4511
|
function buildNestedCSSRule(className, decls, pseudos, atRules, constRules) {
|
|
5516
4512
|
const pseudo = pseudos.filter(p => p !== '::thumb').join('');
|
|
5517
4513
|
const combinedAtRules = atRules.concat(constRules);
|
|
5518
|
-
|
|
4514
|
+
const hasWhere = pseudo.includes(':where(');
|
|
4515
|
+
const extraClassForWhere = hasWhere ? `.${className}` : '';
|
|
4516
|
+
let selectorForAtRules = `.${className}` + extraClassForWhere + combinedAtRules.map(() => `.${className}`).join('') + pseudo;
|
|
5519
4517
|
if (pseudos.includes('::thumb')) {
|
|
5520
4518
|
selectorForAtRules = THUMB_VARIANTS.map(suffix => selectorForAtRules + suffix).join(', ');
|
|
5521
4519
|
}
|
|
@@ -5528,7 +4526,7 @@ function generateCSSRule(className, key, value, pseudos, atRules, constRules, op
|
|
|
5528
4526
|
const rtlDecls = pairs.map(pair => generateRTL(pair, options)).filter(Boolean).map(pair => pair.join(':')).join(';');
|
|
5529
4527
|
const ltrRule = buildNestedCSSRule(className, ltrDecls, pseudos, atRules, constRules);
|
|
5530
4528
|
const rtlRule = !rtlDecls ? null : buildNestedCSSRule(className, rtlDecls, pseudos, atRules, constRules);
|
|
5531
|
-
const priority = getPriority(key) + pseudos.map(getPriority).reduce((a, b) => a + b, 0) + atRules.map(getPriority).reduce((a, b) => a + b, 0) + constRules.map(getPriority).reduce((a, b) => a + b, 0);
|
|
4529
|
+
const priority = libExports.getPriority(key) + pseudos.map(libExports.getPriority).reduce((a, b) => a + b, 0) + atRules.map(libExports.getPriority).reduce((a, b) => a + b, 0) + constRules.map(libExports.getPriority).reduce((a, b) => a + b, 0);
|
|
5532
4530
|
return {
|
|
5533
4531
|
priority,
|
|
5534
4532
|
ltr: ltrRule,
|
|
@@ -5739,7 +4737,7 @@ class PreRuleSet {
|
|
|
5739
4737
|
function flattenRawStyleObject(style, options) {
|
|
5740
4738
|
let processedStyle = style;
|
|
5741
4739
|
try {
|
|
5742
|
-
processedStyle = options.enableMediaQueryOrder ? libExports.lastMediaQueryWinsTransform(style) : style;
|
|
4740
|
+
processedStyle = options.enableMediaQueryOrder ? libExports$1.lastMediaQueryWinsTransform(style) : style;
|
|
5743
4741
|
} catch (error) {
|
|
5744
4742
|
throw new Error(INVALID_MEDIA_QUERY_SYNTAX);
|
|
5745
4743
|
}
|
|
@@ -6397,7 +5395,27 @@ function genFileBasedIdentifier({
|
|
|
6397
5395
|
return `${fileName}//${exportName}${key != null ? `.${key}` : ''}`;
|
|
6398
5396
|
}
|
|
6399
5397
|
|
|
5398
|
+
function fromProxy(value) {
|
|
5399
|
+
if (typeof value === 'object' && value != null && value.__IS_PROXY === true && typeof value.toString === 'function') {
|
|
5400
|
+
return value.toString();
|
|
5401
|
+
}
|
|
5402
|
+
return null;
|
|
5403
|
+
}
|
|
5404
|
+
function fromStyleXStyle(value) {
|
|
5405
|
+
if (typeof value === 'object' && value != null && value.$$css === true) {
|
|
5406
|
+
return Object.keys(value).find(key => key !== '$$css');
|
|
5407
|
+
}
|
|
5408
|
+
return null;
|
|
5409
|
+
}
|
|
6400
5410
|
function getDefaultMarkerClassName(options = defaultOptions) {
|
|
5411
|
+
const valueFromProxy = fromProxy(options);
|
|
5412
|
+
if (valueFromProxy != null) {
|
|
5413
|
+
return valueFromProxy;
|
|
5414
|
+
}
|
|
5415
|
+
const valueFromStyleXStyle = fromStyleXStyle(options);
|
|
5416
|
+
if (valueFromStyleXStyle != null) {
|
|
5417
|
+
return valueFromStyleXStyle;
|
|
5418
|
+
}
|
|
6401
5419
|
const prefix = options.classNamePrefix != null ? `${options.classNamePrefix}-` : '';
|
|
6402
5420
|
return `${prefix}default-marker`;
|
|
6403
5421
|
}
|
|
@@ -6473,21 +5491,37 @@ function getPackagePrefix(absolutePath) {
|
|
|
6473
5491
|
}
|
|
6474
5492
|
return undefined;
|
|
6475
5493
|
}
|
|
6476
|
-
function getShortPath(relativePath) {
|
|
5494
|
+
function getShortPath(relativePath, state) {
|
|
5495
|
+
if (state.options.unstable_moduleResolution?.type === 'commonJS' && state.options.unstable_moduleResolution?.rootDir) {
|
|
5496
|
+
const appRootPath = state.options.unstable_moduleResolution?.rootDir;
|
|
5497
|
+
return path.relative(appRootPath, relativePath);
|
|
5498
|
+
}
|
|
6477
5499
|
return relativePath.split(path.sep).slice(-2).join('/');
|
|
6478
5500
|
}
|
|
6479
5501
|
function createShortFilename(absolutePath, state) {
|
|
6480
|
-
|
|
6481
|
-
|
|
5502
|
+
if (typeof state.options.debugFilePath === 'function') {
|
|
5503
|
+
return state.options.debugFilePath(absolutePath);
|
|
5504
|
+
}
|
|
5505
|
+
const cwdPackage = state.getPackageNameAndPath(process.cwd());
|
|
5506
|
+
const packageDetails = state.getPackageNameAndPath(absolutePath);
|
|
5507
|
+
if (packageDetails) {
|
|
5508
|
+
const [packageName, packageRootPath] = packageDetails;
|
|
5509
|
+
const relativePath = path.relative(packageRootPath, absolutePath);
|
|
5510
|
+
if (cwdPackage && cwdPackage[0] === packageName) {
|
|
5511
|
+
return relativePath;
|
|
5512
|
+
}
|
|
5513
|
+
return `${packageName}:${relativePath}`;
|
|
5514
|
+
}
|
|
6482
5515
|
const packagePrefix = getPackagePrefix(absolutePath);
|
|
6483
5516
|
if (packagePrefix) {
|
|
6484
|
-
const shortPath = getShortPath(
|
|
5517
|
+
const shortPath = getShortPath(absolutePath, state);
|
|
6485
5518
|
return `${packagePrefix}:${shortPath}`;
|
|
6486
5519
|
} else {
|
|
5520
|
+
const isHaste = state.options.unstable_moduleResolution?.type === 'haste';
|
|
6487
5521
|
if (isHaste) {
|
|
6488
5522
|
return path.basename(absolutePath);
|
|
6489
5523
|
}
|
|
6490
|
-
return getShortPath(
|
|
5524
|
+
return getShortPath(absolutePath, state);
|
|
6491
5525
|
}
|
|
6492
5526
|
}
|
|
6493
5527
|
function addSourceMapData(obj, babelPath, state) {
|
|
@@ -6556,9 +5590,6 @@ function convertToTestStyles(obj, varName, state) {
|
|
|
6556
5590
|
function convertObjectToAST(obj) {
|
|
6557
5591
|
return t__namespace.objectExpression(Object.entries(obj).map(([key, value]) => t__namespace.objectProperty(t__namespace.isValidIdentifier(key, false) ? t__namespace.identifier(key) : t__namespace.stringLiteral(key), typeof value === 'string' ? t__namespace.stringLiteral(value) : typeof value === 'number' ? t__namespace.numericLiteral(value) : typeof value === 'boolean' ? t__namespace.booleanLiteral(value) : value === null ? t__namespace.nullLiteral() : convertObjectToAST(value))));
|
|
6558
5592
|
}
|
|
6559
|
-
function removeObjectsWithSpreads(obj) {
|
|
6560
|
-
return Object.fromEntries(Object.entries(obj).filter(Boolean));
|
|
6561
|
-
}
|
|
6562
5593
|
|
|
6563
5594
|
const IMPORT_FILE_PARSING_ERROR = `There was error when attempting to parse the imported file.
|
|
6564
5595
|
Please ensure that the 'babelrc' file is configured to be able to parse this file.
|
|
@@ -6594,6 +5625,43 @@ function isValidCallee(val) {
|
|
|
6594
5625
|
function isInvalidMethod(val) {
|
|
6595
5626
|
return INVALID_METHODS.includes(val);
|
|
6596
5627
|
}
|
|
5628
|
+
const MUTATING_ARRAY_METHODS = new Set(['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse', 'fill', 'copyWithin']);
|
|
5629
|
+
function isMutated(binding) {
|
|
5630
|
+
for (const path of binding.referencePaths) {
|
|
5631
|
+
const parentPath = path.parentPath;
|
|
5632
|
+
if (!parentPath) continue;
|
|
5633
|
+
if (parentPath.isMemberExpression() && parentPath.node.object === path.node) {
|
|
5634
|
+
const memberExpr = parentPath;
|
|
5635
|
+
const parent = memberExpr.parentPath;
|
|
5636
|
+
if (!parent) continue;
|
|
5637
|
+
if (parent.isAssignmentExpression() && parent.node.left === memberExpr.node) {
|
|
5638
|
+
return true;
|
|
5639
|
+
}
|
|
5640
|
+
if (parent.isUpdateExpression()) {
|
|
5641
|
+
return true;
|
|
5642
|
+
}
|
|
5643
|
+
if (parent.isUnaryExpression({
|
|
5644
|
+
operator: 'delete'
|
|
5645
|
+
})) {
|
|
5646
|
+
return true;
|
|
5647
|
+
}
|
|
5648
|
+
if (parent.isCallExpression() && parent.node.callee === memberExpr.node) {
|
|
5649
|
+
const property = memberExpr.node.property;
|
|
5650
|
+
if (t__namespace.isIdentifier(property) && MUTATING_ARRAY_METHODS.has(property.name)) {
|
|
5651
|
+
return true;
|
|
5652
|
+
}
|
|
5653
|
+
}
|
|
5654
|
+
}
|
|
5655
|
+
if (parentPath?.isCallExpression() && path.listKey === 'arguments' && path.key === 0) {
|
|
5656
|
+
const callExpr = parentPath;
|
|
5657
|
+
const callee = callExpr.get('callee');
|
|
5658
|
+
if (callee.matchesPattern('Object.assign') || callee.matchesPattern('Object.defineProperty') || callee.matchesPattern('Object.defineProperties') || callee.matchesPattern('Object.setPrototypeOf')) {
|
|
5659
|
+
return true;
|
|
5660
|
+
}
|
|
5661
|
+
}
|
|
5662
|
+
}
|
|
5663
|
+
return false;
|
|
5664
|
+
}
|
|
6597
5665
|
function deopt(path, state, reason) {
|
|
6598
5666
|
if (!state.confident) return;
|
|
6599
5667
|
state.deoptPath = path;
|
|
@@ -6667,6 +5735,15 @@ function evaluateThemeRef(fileName, exportName, state) {
|
|
|
6667
5735
|
};
|
|
6668
5736
|
const proxy = new Proxy({}, {
|
|
6669
5737
|
get(_, key) {
|
|
5738
|
+
if (key === '__IS_PROXY') {
|
|
5739
|
+
return true;
|
|
5740
|
+
}
|
|
5741
|
+
if (key === 'toString') {
|
|
5742
|
+
return () => state.traversalState.options.classNamePrefix + utils.hash(utils.genFileBasedIdentifier({
|
|
5743
|
+
fileName,
|
|
5744
|
+
exportName
|
|
5745
|
+
}));
|
|
5746
|
+
}
|
|
6670
5747
|
return resolveKey(key);
|
|
6671
5748
|
},
|
|
6672
5749
|
set(_, key, value) {
|
|
@@ -6815,7 +5892,7 @@ function _evaluate(path, state) {
|
|
|
6815
5892
|
const imported = importSpecifierNode.imported;
|
|
6816
5893
|
const importedName = imported.type === 'Identifier' ? imported.name : imported.value;
|
|
6817
5894
|
const importPath = binding.path.parentPath;
|
|
6818
|
-
if (importPath && importPath.isImportDeclaration()) {
|
|
5895
|
+
if (importPath && importPath.isImportDeclaration() && !state.functions.disableImports) {
|
|
6819
5896
|
const absPath = state.traversalState.importPathResolver(importPath.node.source.value);
|
|
6820
5897
|
if (!absPath) {
|
|
6821
5898
|
return deopt(binding.path, state, IMPORT_PATH_RESOLUTION_ERROR);
|
|
@@ -6839,6 +5916,9 @@ function _evaluate(path, state) {
|
|
|
6839
5916
|
if (binding && binding.constantViolations.length > 0) {
|
|
6840
5917
|
return deopt(binding.path, state, NON_CONSTANT);
|
|
6841
5918
|
}
|
|
5919
|
+
if (binding && isMutated(binding)) {
|
|
5920
|
+
return deopt(binding.path, state, NON_CONSTANT);
|
|
5921
|
+
}
|
|
6842
5922
|
if (binding && path.node.start < binding.path.node.end) {
|
|
6843
5923
|
return deopt(binding.path, state, USED_BEFORE_DECLARATION);
|
|
6844
5924
|
}
|
|
@@ -7159,7 +6239,8 @@ function evaluateQuasis(path, quasis, state, raw = false) {
|
|
|
7159
6239
|
const importsForState = new WeakMap();
|
|
7160
6240
|
function evaluate(path, traversalState, functions = {
|
|
7161
6241
|
identifiers: {},
|
|
7162
|
-
memberExpressions: {}
|
|
6242
|
+
memberExpressions: {},
|
|
6243
|
+
disableImports: false
|
|
7163
6244
|
}, seen = new Map()) {
|
|
7164
6245
|
const addedImports = importsForState.get(traversalState) ?? new Set();
|
|
7165
6246
|
importsForState.set(traversalState, addedImports);
|
|
@@ -7508,7 +6589,7 @@ function transformStyleXCreate(path, state) {
|
|
|
7508
6589
|
};
|
|
7509
6590
|
}
|
|
7510
6591
|
if (varName != null && isTopLevel(path)) {
|
|
7511
|
-
const stylesToRemember =
|
|
6592
|
+
const stylesToRemember = Object.fromEntries(Object.entries(compiledStyles));
|
|
7512
6593
|
state.styleMap.set(varName, stylesToRemember);
|
|
7513
6594
|
state.styleVars.set(varName, path.parentPath);
|
|
7514
6595
|
}
|
|
@@ -7924,7 +7005,7 @@ function transformStyleXDefineConsts(callExpressionPath, state) {
|
|
|
7924
7005
|
ltr: obj.ltr,
|
|
7925
7006
|
rtl: obj.rtl ?? null
|
|
7926
7007
|
}, obj.priority]);
|
|
7927
|
-
state.registerStyles(styles);
|
|
7008
|
+
state.registerStyles(styles, variableDeclaratorPath);
|
|
7928
7009
|
}
|
|
7929
7010
|
}
|
|
7930
7011
|
function validateStyleXDefineConsts(callExpressionPath) {
|
|
@@ -8313,6 +7394,13 @@ function genBitwiseOrOfConditions$1(conditions) {
|
|
|
8313
7394
|
});
|
|
8314
7395
|
}
|
|
8315
7396
|
|
|
7397
|
+
class ConditionalStyle {
|
|
7398
|
+
constructor(test, primary, fallback) {
|
|
7399
|
+
this.test = test;
|
|
7400
|
+
this.primary = primary;
|
|
7401
|
+
this.fallback = fallback;
|
|
7402
|
+
}
|
|
7403
|
+
}
|
|
8316
7404
|
function skipStylexPropsChildren(path, state) {
|
|
8317
7405
|
if (!isCalleeIdentifier(path, state) && !isCalleeMemberExpression(path, state)) {
|
|
8318
7406
|
return;
|
|
@@ -8320,15 +7408,12 @@ function skipStylexPropsChildren(path, state) {
|
|
|
8320
7408
|
path.skip();
|
|
8321
7409
|
}
|
|
8322
7410
|
function transformStylexProps(path, state) {
|
|
8323
|
-
const {
|
|
8324
|
-
node
|
|
8325
|
-
} = path;
|
|
8326
7411
|
if (!isCalleeIdentifier(path, state) && !isCalleeMemberExpression(path, state)) {
|
|
8327
7412
|
return;
|
|
8328
7413
|
}
|
|
8329
7414
|
let bailOut = false;
|
|
8330
7415
|
let conditional = 0;
|
|
8331
|
-
const
|
|
7416
|
+
const argsPath = path.get('arguments').flatMap(argPath => argPath.isArrayExpression() ? argPath.get('elements') : [argPath]);
|
|
8332
7417
|
let currentIndex = -1;
|
|
8333
7418
|
let bailOutIndex = null;
|
|
8334
7419
|
const identifiers = {};
|
|
@@ -8345,67 +7430,57 @@ function transformStylexProps(path, state) {
|
|
|
8345
7430
|
});
|
|
8346
7431
|
const evaluatePathFnConfig = {
|
|
8347
7432
|
identifiers,
|
|
8348
|
-
memberExpressions
|
|
7433
|
+
memberExpressions,
|
|
7434
|
+
disableImports: true
|
|
8349
7435
|
};
|
|
8350
7436
|
const resolvedArgs = [];
|
|
8351
|
-
for (const
|
|
7437
|
+
for (const argPath of argsPath) {
|
|
8352
7438
|
currentIndex++;
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
}
|
|
8381
|
-
break;
|
|
8382
|
-
}
|
|
8383
|
-
case 'LogicalExpression':
|
|
8384
|
-
{
|
|
8385
|
-
if (arg.operator !== '&&') {
|
|
8386
|
-
bailOutIndex = currentIndex;
|
|
8387
|
-
bailOut = true;
|
|
8388
|
-
break;
|
|
8389
|
-
}
|
|
8390
|
-
const {
|
|
8391
|
-
left,
|
|
8392
|
-
right
|
|
8393
|
-
} = arg;
|
|
8394
|
-
const leftResolved = parseNullableStyle(left, state);
|
|
8395
|
-
const rightResolved = parseNullableStyle(right, state);
|
|
8396
|
-
if (leftResolved !== 'other' || rightResolved === 'other') {
|
|
8397
|
-
bailOutIndex = currentIndex;
|
|
8398
|
-
bailOut = true;
|
|
8399
|
-
} else {
|
|
8400
|
-
resolvedArgs.push([left, rightResolved, null]);
|
|
8401
|
-
conditional++;
|
|
8402
|
-
}
|
|
8403
|
-
break;
|
|
8404
|
-
}
|
|
8405
|
-
default:
|
|
7439
|
+
if (argPath.isObjectExpression() || argPath.isIdentifier() || argPath.isMemberExpression()) {
|
|
7440
|
+
const resolved = parseNullableStyle(argPath, state, evaluatePathFnConfig);
|
|
7441
|
+
if (resolved === 'other') {
|
|
7442
|
+
bailOutIndex = currentIndex;
|
|
7443
|
+
bailOut = true;
|
|
7444
|
+
} else {
|
|
7445
|
+
resolvedArgs.push(resolved);
|
|
7446
|
+
}
|
|
7447
|
+
} else if (argPath.isConditionalExpression()) {
|
|
7448
|
+
const arg = argPath.node;
|
|
7449
|
+
const {
|
|
7450
|
+
test
|
|
7451
|
+
} = arg;
|
|
7452
|
+
const consequentPath = argPath.get('consequent');
|
|
7453
|
+
const alternatePath = argPath.get('alternate');
|
|
7454
|
+
const primary = parseNullableStyle(consequentPath, state, evaluatePathFnConfig);
|
|
7455
|
+
const fallback = parseNullableStyle(alternatePath, state, evaluatePathFnConfig);
|
|
7456
|
+
if (primary === 'other' || fallback === 'other') {
|
|
7457
|
+
bailOutIndex = currentIndex;
|
|
7458
|
+
bailOut = true;
|
|
7459
|
+
} else {
|
|
7460
|
+
resolvedArgs.push(new ConditionalStyle(test, primary, fallback));
|
|
7461
|
+
conditional++;
|
|
7462
|
+
}
|
|
7463
|
+
} else if (argPath.isLogicalExpression()) {
|
|
7464
|
+
const arg = argPath.node;
|
|
7465
|
+
if (arg.operator !== '&&') {
|
|
8406
7466
|
bailOutIndex = currentIndex;
|
|
8407
7467
|
bailOut = true;
|
|
8408
7468
|
break;
|
|
7469
|
+
}
|
|
7470
|
+
const leftPath = argPath.get('left');
|
|
7471
|
+
const rightPath = argPath.get('right');
|
|
7472
|
+
const leftResolved = parseNullableStyle(leftPath, state, evaluatePathFnConfig);
|
|
7473
|
+
const rightResolved = parseNullableStyle(rightPath, state, evaluatePathFnConfig);
|
|
7474
|
+
if (leftResolved !== 'other' || rightResolved === 'other') {
|
|
7475
|
+
bailOutIndex = currentIndex;
|
|
7476
|
+
bailOut = true;
|
|
7477
|
+
} else {
|
|
7478
|
+
resolvedArgs.push(new ConditionalStyle(leftPath.node, rightResolved, null));
|
|
7479
|
+
conditional++;
|
|
7480
|
+
}
|
|
7481
|
+
} else {
|
|
7482
|
+
bailOutIndex = currentIndex;
|
|
7483
|
+
bailOut = true;
|
|
8409
7484
|
}
|
|
8410
7485
|
if (conditional > 4) {
|
|
8411
7486
|
bailOut = true;
|
|
@@ -8450,7 +7525,7 @@ function transformStylexProps(path, state) {
|
|
|
8450
7525
|
confident,
|
|
8451
7526
|
value: styleValue
|
|
8452
7527
|
} = evaluate(path, state, evaluatePathFnConfig);
|
|
8453
|
-
if (!confident || styleValue == null) {
|
|
7528
|
+
if (!confident || styleValue == null || styleValue.__IS_PROXY === true) {
|
|
8454
7529
|
nonNullProps = true;
|
|
8455
7530
|
styleNonNullProps = true;
|
|
8456
7531
|
} else {
|
|
@@ -8501,7 +7576,8 @@ function transformStylexProps(path, state) {
|
|
|
8501
7576
|
path.replaceWith(stringExpression);
|
|
8502
7577
|
}
|
|
8503
7578
|
}
|
|
8504
|
-
function parseNullableStyle(
|
|
7579
|
+
function parseNullableStyle(path, state, evaluatePathFnConfig) {
|
|
7580
|
+
const node = path.node;
|
|
8505
7581
|
if (t__namespace.isNullLiteral(node) || t__namespace.isIdentifier(node) && node.name === 'undefined') {
|
|
8506
7582
|
return null;
|
|
8507
7583
|
}
|
|
@@ -8528,10 +7604,17 @@ function parseNullableStyle(node, state) {
|
|
|
8528
7604
|
}
|
|
8529
7605
|
}
|
|
8530
7606
|
}
|
|
7607
|
+
const parsedObj = evaluate(path, state, evaluatePathFnConfig);
|
|
7608
|
+
if (parsedObj.confident && parsedObj.value != null && typeof parsedObj.value === 'object') {
|
|
7609
|
+
if (parsedObj.value.__IS_PROXY === true) {
|
|
7610
|
+
return 'other';
|
|
7611
|
+
}
|
|
7612
|
+
return parsedObj.value;
|
|
7613
|
+
}
|
|
8531
7614
|
return 'other';
|
|
8532
7615
|
}
|
|
8533
7616
|
function makeStringExpression(values) {
|
|
8534
|
-
const conditions = values.filter(v =>
|
|
7617
|
+
const conditions = values.filter(v => v instanceof ConditionalStyle).map(v => v.test);
|
|
8535
7618
|
if (conditions.length === 0) {
|
|
8536
7619
|
const result = stylex.props(values);
|
|
8537
7620
|
return convertObjectToAST(result);
|
|
@@ -8540,8 +7623,11 @@ function makeStringExpression(values) {
|
|
|
8540
7623
|
const objEntries = conditionPermutations.map(permutation => {
|
|
8541
7624
|
let i = 0;
|
|
8542
7625
|
const args = values.map(v => {
|
|
8543
|
-
if (
|
|
8544
|
-
const
|
|
7626
|
+
if (v instanceof ConditionalStyle) {
|
|
7627
|
+
const {
|
|
7628
|
+
primary,
|
|
7629
|
+
fallback
|
|
7630
|
+
} = v;
|
|
8545
7631
|
return permutation[i++] ? primary : fallback;
|
|
8546
7632
|
} else {
|
|
8547
7633
|
return v;
|
|
@@ -8730,6 +7816,56 @@ function transformStyleXDefaultMarker(path, state) {
|
|
|
8730
7816
|
}
|
|
8731
7817
|
}
|
|
8732
7818
|
|
|
7819
|
+
function transformStyleXDefineMarker(path, state) {
|
|
7820
|
+
const {
|
|
7821
|
+
node
|
|
7822
|
+
} = path;
|
|
7823
|
+
if (node.type !== 'CallExpression') {
|
|
7824
|
+
return;
|
|
7825
|
+
}
|
|
7826
|
+
const isDefineMarkerCall = node.callee.type === 'Identifier' && state.stylexDefineMarkerImport.has(node.callee.name) || node.callee.type === 'MemberExpression' && node.callee.object.type === 'Identifier' && node.callee.property.type === 'Identifier' && node.callee.property.name === 'defineMarker' && state.stylexImport.has(node.callee.object.name);
|
|
7827
|
+
if (!isDefineMarkerCall) {
|
|
7828
|
+
return;
|
|
7829
|
+
}
|
|
7830
|
+
validateStyleXDefineMarker(path);
|
|
7831
|
+
const variableDeclaratorPath = path.parentPath;
|
|
7832
|
+
if (!variableDeclaratorPath.isVariableDeclarator()) {
|
|
7833
|
+
return;
|
|
7834
|
+
}
|
|
7835
|
+
const variableDeclaratorNode = variableDeclaratorPath.node;
|
|
7836
|
+
if (variableDeclaratorNode.id.type !== 'Identifier') {
|
|
7837
|
+
return;
|
|
7838
|
+
}
|
|
7839
|
+
if (node.arguments.length !== 0) {
|
|
7840
|
+
throw path.buildCodeFrameError(illegalArgumentLength('defineMarker', 0), SyntaxError);
|
|
7841
|
+
}
|
|
7842
|
+
const fileName = state.fileNameForHashing;
|
|
7843
|
+
if (fileName == null) {
|
|
7844
|
+
throw new Error(cannotGenerateHash('defineMarker'));
|
|
7845
|
+
}
|
|
7846
|
+
const exportName = variableDeclaratorNode.id.name;
|
|
7847
|
+
const exportId = utils.genFileBasedIdentifier({
|
|
7848
|
+
fileName,
|
|
7849
|
+
exportName
|
|
7850
|
+
});
|
|
7851
|
+
const id = state.options.classNamePrefix + utils.hash(exportId);
|
|
7852
|
+
const markerObj = {
|
|
7853
|
+
[id]: id,
|
|
7854
|
+
$$css: true
|
|
7855
|
+
};
|
|
7856
|
+
path.replaceWith(convertObjectToAST(markerObj));
|
|
7857
|
+
}
|
|
7858
|
+
function validateStyleXDefineMarker(path) {
|
|
7859
|
+
const variableDeclaratorPath = path.parentPath;
|
|
7860
|
+
const exportNamedDeclarationPath = variableDeclaratorPath.parentPath?.parentPath;
|
|
7861
|
+
if (variableDeclaratorPath == null || variableDeclaratorPath.isExpressionStatement() || !variableDeclaratorPath.isVariableDeclarator() || variableDeclaratorPath.node.id.type !== 'Identifier') {
|
|
7862
|
+
throw path.buildCodeFrameError(unboundCallValue('defineMarker'), SyntaxError);
|
|
7863
|
+
}
|
|
7864
|
+
if (exportNamedDeclarationPath == null || !exportNamedDeclarationPath.isExportNamedDeclaration()) {
|
|
7865
|
+
throw path.buildCodeFrameError(nonExportNamedDeclaration('defineMarker'), SyntaxError);
|
|
7866
|
+
}
|
|
7867
|
+
}
|
|
7868
|
+
|
|
8733
7869
|
const NAME = 'stylex';
|
|
8734
7870
|
function styleXTransform() {
|
|
8735
7871
|
let state;
|
|
@@ -8887,6 +8023,7 @@ function styleXTransform() {
|
|
|
8887
8023
|
transformStyleXPositionTry(parentPath, state);
|
|
8888
8024
|
}
|
|
8889
8025
|
transformStyleXDefaultMarker(path, state);
|
|
8026
|
+
transformStyleXDefineMarker(path, state);
|
|
8890
8027
|
transformStyleXDefineVars(path, state);
|
|
8891
8028
|
transformStyleXDefineConsts(path, state);
|
|
8892
8029
|
transformStyleXCreateTheme(path, state);
|
|
@@ -8908,6 +8045,25 @@ function isExported(path) {
|
|
|
8908
8045
|
}
|
|
8909
8046
|
return isExported(path.parentPath);
|
|
8910
8047
|
}
|
|
8048
|
+
function getLogicalFloatVars(rules) {
|
|
8049
|
+
const hasLogicalFloat = rules.some(([, {
|
|
8050
|
+
ltr,
|
|
8051
|
+
rtl
|
|
8052
|
+
}]) => {
|
|
8053
|
+
const ltrStr = String(ltr);
|
|
8054
|
+
const rtlStr = rtl ? String(rtl) : '';
|
|
8055
|
+
return ltrStr.includes(LOGICAL_FLOAT_START_VAR) || ltrStr.includes(LOGICAL_FLOAT_END_VAR) || rtlStr.includes(LOGICAL_FLOAT_START_VAR) || rtlStr.includes(LOGICAL_FLOAT_END_VAR);
|
|
8056
|
+
});
|
|
8057
|
+
return hasLogicalFloat ? `:root, [dir="ltr"] {
|
|
8058
|
+
${LOGICAL_FLOAT_START_VAR}: left;
|
|
8059
|
+
${LOGICAL_FLOAT_END_VAR}: right;
|
|
8060
|
+
}
|
|
8061
|
+
[dir="rtl"] {
|
|
8062
|
+
${LOGICAL_FLOAT_START_VAR}: right;
|
|
8063
|
+
${LOGICAL_FLOAT_END_VAR}: left;
|
|
8064
|
+
}
|
|
8065
|
+
` : '';
|
|
8066
|
+
}
|
|
8911
8067
|
function processStylexRules(rules, config) {
|
|
8912
8068
|
const {
|
|
8913
8069
|
useLayers = false,
|
|
@@ -9005,6 +8161,7 @@ function processStylexRules(rules, config) {
|
|
|
9005
8161
|
acc.push([[key, styleObj, priority]]);
|
|
9006
8162
|
return acc;
|
|
9007
8163
|
}, []);
|
|
8164
|
+
const logicalFloatVars = getLogicalFloatVars(nonConstantRules);
|
|
9008
8165
|
const header = useLayers ? '\n@layer ' + grouped.map((_, index) => `priority${index + 1}`).join(', ') + ';\n' : '';
|
|
9009
8166
|
const collectedCSS = grouped.map((group, index) => {
|
|
9010
8167
|
const pri = group[0][2];
|
|
@@ -9027,7 +8184,7 @@ function processStylexRules(rules, config) {
|
|
|
9027
8184
|
}).join('\n');
|
|
9028
8185
|
return useLayers && pri > 0 ? `@layer priority${index + 1}{\n${collectedCSS}\n}` : collectedCSS;
|
|
9029
8186
|
}).join('\n');
|
|
9030
|
-
return header + collectedCSS;
|
|
8187
|
+
return logicalFloatVars + header + collectedCSS;
|
|
9031
8188
|
}
|
|
9032
8189
|
styleXTransform.processStylexRules = processStylexRules;
|
|
9033
8190
|
function addAncestorSelector(selector, ancestorSelector) {
|