@stylexjs/babel-plugin 0.16.3 → 0.17.0
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 +835 -1761
- package/lib/index.js.flow +1 -0
- package/lib/shared/index.d.ts +1 -1
- package/lib/shared/index.js.flow +1 -1
- package/lib/shared/preprocess-rules/legacy-expand-shorthands.d.ts +4 -0
- package/lib/shared/preprocess-rules/legacy-expand-shorthands.js.flow +5 -0
- package/lib/shared/types/index.js.flow +1 -1
- package/lib/shared/utils/object-utils.js.flow +1 -1
- package/lib/shared/when/when.d.ts +5 -5
- package/lib/shared/when/when.js.flow +5 -5
- package/lib/utils/evaluate-path.d.ts +1 -0
- package/lib/utils/evaluate-path.js.flow +1 -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 +1 -0
- package/lib/utils/state-manager.js.flow +1 -0
- package/lib/visitors/stylex-define-marker.d.ts +22 -0
- package/lib/visitors/stylex-define-marker.js.flow +22 -0
- package/package.json +4 -3
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');
|
|
@@ -162,524 +163,6 @@ const logAndDefault = (check, value, def, name) => {
|
|
|
162
163
|
return result;
|
|
163
164
|
};
|
|
164
165
|
|
|
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
166
|
function hoistExpression(path, astExpression) {
|
|
684
167
|
const programStatementPath = getProgramStatement(path);
|
|
685
168
|
if (programStatementPath == null) {
|
|
@@ -715,7 +198,7 @@ function getProgramPath(path) {
|
|
|
715
198
|
return programPath;
|
|
716
199
|
}
|
|
717
200
|
function addNamedImport(statementPath, as, from, options) {
|
|
718
|
-
const identifier =
|
|
201
|
+
const identifier = helperModuleImports.addNamed(statementPath, as, from, options);
|
|
719
202
|
const programPath = getProgramPath(statementPath);
|
|
720
203
|
if (programPath == null) {
|
|
721
204
|
return identifier;
|
|
@@ -743,7 +226,7 @@ function addNamedImport(statementPath, as, from, options) {
|
|
|
743
226
|
return importName;
|
|
744
227
|
}
|
|
745
228
|
function addDefaultImport(statementPath, from, options) {
|
|
746
|
-
const identifier =
|
|
229
|
+
const identifier = helperModuleImports.addDefault(statementPath, from, options);
|
|
747
230
|
const programPath = getProgramPath(statementPath);
|
|
748
231
|
if (programPath == null) {
|
|
749
232
|
return identifier;
|
|
@@ -833,6 +316,7 @@ class StateManager {
|
|
|
833
316
|
stylexKeyframesImport = new Set();
|
|
834
317
|
stylexPositionTryImport = new Set();
|
|
835
318
|
stylexDefineVarsImport = new Set();
|
|
319
|
+
stylexDefineMarkerImport = new Set();
|
|
836
320
|
stylexDefineConstsImport = new Set();
|
|
837
321
|
stylexCreateThemeImport = new Set();
|
|
838
322
|
stylexTypesImport = new Set();
|
|
@@ -1216,6 +700,9 @@ function readImportDeclarations(path, state) {
|
|
|
1216
700
|
if (importedName === 'defineVars') {
|
|
1217
701
|
state.stylexDefineVarsImport.add(localName);
|
|
1218
702
|
}
|
|
703
|
+
if (importedName === 'defineMarker') {
|
|
704
|
+
state.stylexDefineMarkerImport.add(localName);
|
|
705
|
+
}
|
|
1219
706
|
if (importedName === 'defineConsts') {
|
|
1220
707
|
state.stylexDefineConstsImport.add(localName);
|
|
1221
708
|
}
|
|
@@ -1279,6 +766,9 @@ function readRequires(path, state) {
|
|
|
1279
766
|
if (prop.key.name === 'defineVars') {
|
|
1280
767
|
state.stylexDefineVarsImport.add(value.name);
|
|
1281
768
|
}
|
|
769
|
+
if (prop.key.name === 'defineMarker') {
|
|
770
|
+
state.stylexDefineMarkerImport.add(value.name);
|
|
771
|
+
}
|
|
1282
772
|
if (prop.key.name === 'defineConsts') {
|
|
1283
773
|
state.stylexDefineConstsImport.add(value.name);
|
|
1284
774
|
}
|
|
@@ -1539,593 +1029,6 @@ const expansions$3 = {
|
|
|
1539
1029
|
...aliases$2
|
|
1540
1030
|
};
|
|
1541
1031
|
|
|
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
1032
|
function printNode(node) {
|
|
2130
1033
|
switch (node.type) {
|
|
2131
1034
|
case 'word':
|
|
@@ -2153,6 +1056,8 @@ function splitValue(str) {
|
|
|
2153
1056
|
return nodes;
|
|
2154
1057
|
}
|
|
2155
1058
|
|
|
1059
|
+
const LOGICAL_FLOAT_START_VAR = '--stylex-logical-start';
|
|
1060
|
+
const LOGICAL_FLOAT_END_VAR = '--stylex-logical-end';
|
|
2156
1061
|
const listStyleGlobalValues = new Set(['inherit', 'initial', 'revert', 'unset']);
|
|
2157
1062
|
const listStylePositionValues = new Set(['inside', 'outside']);
|
|
2158
1063
|
const listStyleTypeRegex = /^([a-z-]+|".*?"|'.*?')$/;
|
|
@@ -2342,7 +1247,23 @@ const aliases$1 = {
|
|
|
2342
1247
|
paddingBlockEnd: val => [['paddingBottom', val]],
|
|
2343
1248
|
paddingInline: shorthands$1.paddingHorizontal,
|
|
2344
1249
|
scrollMarginBlockStart: value => [['scrollMarginTop', value]],
|
|
2345
|
-
scrollMarginBlockEnd: value => [['scrollMarginBottom', value]]
|
|
1250
|
+
scrollMarginBlockEnd: value => [['scrollMarginBottom', value]],
|
|
1251
|
+
float: value => {
|
|
1252
|
+
if (value === 'inline-start' || value === 'start') {
|
|
1253
|
+
return [['float', `var(${LOGICAL_FLOAT_START_VAR})`]];
|
|
1254
|
+
} else if (value === 'inline-end' || value === 'end') {
|
|
1255
|
+
return [['float', `var(${LOGICAL_FLOAT_END_VAR})`]];
|
|
1256
|
+
}
|
|
1257
|
+
return [['float', value]];
|
|
1258
|
+
},
|
|
1259
|
+
clear: value => {
|
|
1260
|
+
if (value === 'inline-start' || value === 'start') {
|
|
1261
|
+
return [['clear', `var(${LOGICAL_FLOAT_START_VAR})`]];
|
|
1262
|
+
} else if (value === 'inline-end' || value === 'end') {
|
|
1263
|
+
return [['clear', `var(${LOGICAL_FLOAT_END_VAR})`]];
|
|
1264
|
+
}
|
|
1265
|
+
return [['clear', value]];
|
|
1266
|
+
}
|
|
2346
1267
|
};
|
|
2347
1268
|
const expansions$2 = {
|
|
2348
1269
|
...shorthands$1,
|
|
@@ -2470,7 +1391,7 @@ function flatMapExpandedShorthands(objEntry, options) {
|
|
|
2470
1391
|
return [[key, value]];
|
|
2471
1392
|
}
|
|
2472
1393
|
|
|
2473
|
-
var lib = {};
|
|
1394
|
+
var lib$1 = {};
|
|
2474
1395
|
|
|
2475
1396
|
var tokenParser = {};
|
|
2476
1397
|
|
|
@@ -4409,11 +3330,11 @@ function requireMediaQueryTransform () {
|
|
|
4409
3330
|
return mediaQueryTransform;
|
|
4410
3331
|
}
|
|
4411
3332
|
|
|
4412
|
-
var hasRequiredLib;
|
|
3333
|
+
var hasRequiredLib$1;
|
|
4413
3334
|
|
|
4414
|
-
function requireLib () {
|
|
4415
|
-
if (hasRequiredLib) return lib;
|
|
4416
|
-
hasRequiredLib = 1;
|
|
3335
|
+
function requireLib$1 () {
|
|
3336
|
+
if (hasRequiredLib$1) return lib$1;
|
|
3337
|
+
hasRequiredLib$1 = 1;
|
|
4417
3338
|
(function (exports) {
|
|
4418
3339
|
|
|
4419
3340
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -4432,11 +3353,11 @@ function requireLib () {
|
|
|
4432
3353
|
exports.properties = _properties;
|
|
4433
3354
|
var _mediaQueryTransform = requireMediaQueryTransform();
|
|
4434
3355
|
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;
|
|
3356
|
+
} (lib$1));
|
|
3357
|
+
return lib$1;
|
|
4437
3358
|
}
|
|
4438
3359
|
|
|
4439
|
-
var libExports = requireLib();
|
|
3360
|
+
var libExports$1 = requireLib$1();
|
|
4440
3361
|
|
|
4441
3362
|
const illegalArgumentLength = (fn, argLength) => `${fn}() should have ${argLength} argument${argLength === 1 ? '' : 's'}.`;
|
|
4442
3363
|
const nonStaticValue = fn => `Only static values are allowed inside of a ${fn}() call.`;
|
|
@@ -4727,10 +3648,6 @@ const logicalToPhysical$1 = {
|
|
|
4727
3648
|
'inline-start': 'left',
|
|
4728
3649
|
'inline-end': 'right'
|
|
4729
3650
|
};
|
|
4730
|
-
const legacyValuesPolyfill$1 = {
|
|
4731
|
-
float: ([key, val]) => [key, logicalToPhysical$1[val] ?? val],
|
|
4732
|
-
clear: ([key, val]) => [key, logicalToPhysical$1[val] ?? val]
|
|
4733
|
-
};
|
|
4734
3651
|
const inlinePropertyToLTR = {
|
|
4735
3652
|
'margin-inline-start': ([_key, val]) => ['margin-left', val],
|
|
4736
3653
|
'margin-inline-end': ([_key, val]) => ['margin-right', val],
|
|
@@ -4782,9 +3699,6 @@ function generateLTR(pair, options = defaultOptions) {
|
|
|
4782
3699
|
const [key] = pair;
|
|
4783
3700
|
if (styleResolution === 'legacy-expand-shorthands') {
|
|
4784
3701
|
if (!enableLogicalStylesPolyfill) {
|
|
4785
|
-
if (legacyValuesPolyfill$1[key]) {
|
|
4786
|
-
return legacyValuesPolyfill$1[key](pair);
|
|
4787
|
-
}
|
|
4788
3702
|
return pair;
|
|
4789
3703
|
}
|
|
4790
3704
|
if (inlinePropertyToLTR[key]) {
|
|
@@ -4857,10 +3771,6 @@ const logicalToPhysical = {
|
|
|
4857
3771
|
'inline-start': 'right',
|
|
4858
3772
|
'inline-end': 'left'
|
|
4859
3773
|
};
|
|
4860
|
-
const legacyValuesPolyfill = {
|
|
4861
|
-
float: ([key, val]) => [key, logicalToPhysical[val] ?? val],
|
|
4862
|
-
clear: ([key, val]) => [key, logicalToPhysical[val] ?? val]
|
|
4863
|
-
};
|
|
4864
3774
|
const inlinePropertyToRTL = {
|
|
4865
3775
|
'margin-inline-start': ([_key, val]) => ['margin-right', val],
|
|
4866
3776
|
'margin-inline-end': ([_key, val]) => ['margin-left', val],
|
|
@@ -4938,9 +3848,6 @@ function generateRTL(pair, options = defaultOptions) {
|
|
|
4938
3848
|
const [key] = pair;
|
|
4939
3849
|
if (styleResolution === 'legacy-expand-shorthands') {
|
|
4940
3850
|
if (!enableLogicalStylesPolyfill) {
|
|
4941
|
-
if (legacyValuesPolyfill[key]) {
|
|
4942
|
-
return legacyValuesPolyfill[key](pair);
|
|
4943
|
-
}
|
|
4944
3851
|
return null;
|
|
4945
3852
|
}
|
|
4946
3853
|
if (inlinePropertyToRTL[key]) {
|
|
@@ -4953,569 +3860,633 @@ function generateRTL(pair, options = defaultOptions) {
|
|
|
4953
3860
|
return propertyToRTL[key](pair, options);
|
|
4954
3861
|
}
|
|
4955
3862
|
|
|
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
|
-
|
|
3863
|
+
var lib = {};
|
|
3864
|
+
|
|
3865
|
+
var propertyPriorities = {};
|
|
3866
|
+
|
|
3867
|
+
var hasRequiredPropertyPriorities;
|
|
3868
|
+
|
|
3869
|
+
function requirePropertyPriorities () {
|
|
3870
|
+
if (hasRequiredPropertyPriorities) return propertyPriorities;
|
|
3871
|
+
hasRequiredPropertyPriorities = 1;
|
|
3872
|
+
|
|
3873
|
+
Object.defineProperty(propertyPriorities, "__esModule", {
|
|
3874
|
+
value: true
|
|
3875
|
+
});
|
|
3876
|
+
propertyPriorities.PSEUDO_ELEMENT_PRIORITY = propertyPriorities.PSEUDO_CLASS_PRIORITIES = propertyPriorities.AT_RULE_PRIORITIES = void 0;
|
|
3877
|
+
propertyPriorities.default = getPriority;
|
|
3878
|
+
propertyPriorities.getAtRulePriority = getAtRulePriority;
|
|
3879
|
+
propertyPriorities.getDefaultPriority = getDefaultPriority;
|
|
3880
|
+
propertyPriorities.getPseudoClassPriority = getPseudoClassPriority;
|
|
3881
|
+
propertyPriorities.getPseudoElementPriority = getPseudoElementPriority;
|
|
3882
|
+
const longHandPhysical = new Set();
|
|
3883
|
+
const longHandLogical = new Set();
|
|
3884
|
+
const shorthandsOfLonghands = new Set();
|
|
3885
|
+
const shorthandsOfShorthands = new Set();
|
|
3886
|
+
longHandLogical.add('background-blend-mode');
|
|
3887
|
+
longHandLogical.add('isolation');
|
|
3888
|
+
longHandLogical.add('mix-blend-mode');
|
|
3889
|
+
shorthandsOfShorthands.add('animation');
|
|
3890
|
+
longHandLogical.add('animation-composition');
|
|
3891
|
+
longHandLogical.add('animation-delay');
|
|
3892
|
+
longHandLogical.add('animation-direction');
|
|
3893
|
+
longHandLogical.add('animation-duration');
|
|
3894
|
+
longHandLogical.add('animation-fill-mode');
|
|
3895
|
+
longHandLogical.add('animation-iteration-count');
|
|
3896
|
+
longHandLogical.add('animation-name');
|
|
3897
|
+
longHandLogical.add('animation-play-state');
|
|
3898
|
+
shorthandsOfLonghands.add('animation-range');
|
|
3899
|
+
longHandLogical.add('animation-range-end');
|
|
3900
|
+
longHandLogical.add('animation-range-start');
|
|
3901
|
+
longHandLogical.add('animation-timing-function');
|
|
3902
|
+
longHandLogical.add('animation-timeline');
|
|
3903
|
+
shorthandsOfLonghands.add('scroll-timeline');
|
|
3904
|
+
longHandLogical.add('scroll-timeline-axis');
|
|
3905
|
+
longHandLogical.add('scroll-timeline-name');
|
|
3906
|
+
longHandLogical.add('timeline-scope');
|
|
3907
|
+
shorthandsOfLonghands.add('view-timeline');
|
|
3908
|
+
longHandLogical.add('view-timeline-axis');
|
|
3909
|
+
longHandLogical.add('view-timeline-inset');
|
|
3910
|
+
longHandLogical.add('view-timeline-name');
|
|
3911
|
+
shorthandsOfShorthands.add('background');
|
|
3912
|
+
longHandLogical.add('background-attachment');
|
|
3913
|
+
longHandLogical.add('background-clip');
|
|
3914
|
+
longHandLogical.add('background-color');
|
|
3915
|
+
longHandLogical.add('background-image');
|
|
3916
|
+
longHandLogical.add('background-origin');
|
|
3917
|
+
longHandLogical.add('background-repeat');
|
|
3918
|
+
longHandLogical.add('background-size');
|
|
3919
|
+
shorthandsOfLonghands.add('background-position');
|
|
3920
|
+
longHandLogical.add('background-position-x');
|
|
3921
|
+
longHandLogical.add('background-position-y');
|
|
3922
|
+
shorthandsOfShorthands.add('border');
|
|
3923
|
+
shorthandsOfLonghands.add('border-color');
|
|
3924
|
+
shorthandsOfLonghands.add('border-style');
|
|
3925
|
+
shorthandsOfLonghands.add('border-width');
|
|
3926
|
+
shorthandsOfShorthands.add('border-block');
|
|
3927
|
+
longHandLogical.add('border-block-color');
|
|
3928
|
+
longHandLogical.add('border-block-stylex');
|
|
3929
|
+
longHandLogical.add('border-block-width');
|
|
3930
|
+
shorthandsOfLonghands.add('border-block-start');
|
|
3931
|
+
shorthandsOfLonghands.add('border-top');
|
|
3932
|
+
longHandLogical.add('border-block-start-color');
|
|
3933
|
+
longHandPhysical.add('border-top-color');
|
|
3934
|
+
longHandLogical.add('border-block-start-style');
|
|
3935
|
+
longHandPhysical.add('border-top-style');
|
|
3936
|
+
longHandLogical.add('border-block-start-width');
|
|
3937
|
+
longHandPhysical.add('border-top-width');
|
|
3938
|
+
shorthandsOfLonghands.add('border-block-end');
|
|
3939
|
+
shorthandsOfLonghands.add('border-bottom');
|
|
3940
|
+
longHandLogical.add('border-block-end-color');
|
|
3941
|
+
longHandPhysical.add('border-bottom-color');
|
|
3942
|
+
longHandLogical.add('border-block-end-style');
|
|
3943
|
+
longHandPhysical.add('border-bottom-style');
|
|
3944
|
+
longHandLogical.add('border-block-end-width');
|
|
3945
|
+
longHandPhysical.add('border-bottom-width');
|
|
3946
|
+
shorthandsOfShorthands.add('border-inline');
|
|
3947
|
+
shorthandsOfLonghands.add('border-inline-color');
|
|
3948
|
+
shorthandsOfLonghands.add('border-inline-style');
|
|
3949
|
+
shorthandsOfLonghands.add('border-inline-width');
|
|
3950
|
+
shorthandsOfLonghands.add('border-inline-start');
|
|
3951
|
+
shorthandsOfLonghands.add('border-left');
|
|
3952
|
+
longHandLogical.add('border-inline-start-color');
|
|
3953
|
+
longHandPhysical.add('border-left-color');
|
|
3954
|
+
longHandLogical.add('border-inline-start-style');
|
|
3955
|
+
longHandPhysical.add('border-left-style');
|
|
3956
|
+
longHandLogical.add('border-inline-start-width');
|
|
3957
|
+
longHandPhysical.add('border-left-width');
|
|
3958
|
+
shorthandsOfLonghands.add('border-inline-end');
|
|
3959
|
+
shorthandsOfLonghands.add('border-right');
|
|
3960
|
+
longHandLogical.add('border-inline-end-color');
|
|
3961
|
+
longHandPhysical.add('border-right-color');
|
|
3962
|
+
longHandLogical.add('border-inline-end-style');
|
|
3963
|
+
longHandPhysical.add('border-right-style');
|
|
3964
|
+
longHandLogical.add('border-inline-end-width');
|
|
3965
|
+
longHandPhysical.add('border-right-width');
|
|
3966
|
+
shorthandsOfLonghands.add('border-image');
|
|
3967
|
+
longHandLogical.add('border-image-outset');
|
|
3968
|
+
longHandLogical.add('border-image-repeat');
|
|
3969
|
+
longHandLogical.add('border-image-slice');
|
|
3970
|
+
longHandLogical.add('border-image-source');
|
|
3971
|
+
longHandLogical.add('border-image-width');
|
|
3972
|
+
shorthandsOfLonghands.add('border-radius');
|
|
3973
|
+
longHandLogical.add('border-start-end-radius');
|
|
3974
|
+
longHandLogical.add('border-start-start-radius');
|
|
3975
|
+
longHandLogical.add('border-end-end-radius');
|
|
3976
|
+
longHandLogical.add('border-end-start-radius');
|
|
3977
|
+
longHandPhysical.add('border-top-left-radius');
|
|
3978
|
+
longHandPhysical.add('border-top-right-radius');
|
|
3979
|
+
longHandPhysical.add('border-bottom-left-radius');
|
|
3980
|
+
longHandPhysical.add('border-bottom-right-radius');
|
|
3981
|
+
longHandLogical.add('box-shadow');
|
|
3982
|
+
longHandLogical.add('accent-color');
|
|
3983
|
+
longHandLogical.add('appearance');
|
|
3984
|
+
longHandLogical.add('aspect-ratio');
|
|
3985
|
+
shorthandsOfLonghands.add('caret');
|
|
3986
|
+
longHandLogical.add('caret-color');
|
|
3987
|
+
longHandLogical.add('caret-shape');
|
|
3988
|
+
longHandLogical.add('cursor');
|
|
3989
|
+
longHandLogical.add('ime-mode');
|
|
3990
|
+
longHandLogical.add('input-security');
|
|
3991
|
+
shorthandsOfLonghands.add('outline');
|
|
3992
|
+
longHandLogical.add('outline-color');
|
|
3993
|
+
longHandLogical.add('outline-offset');
|
|
3994
|
+
longHandLogical.add('outline-style');
|
|
3995
|
+
longHandLogical.add('outline-width');
|
|
3996
|
+
longHandLogical.add('pointer-events');
|
|
3997
|
+
longHandLogical.add('resize');
|
|
3998
|
+
longHandLogical.add('text-overflow');
|
|
3999
|
+
longHandLogical.add('user-select');
|
|
4000
|
+
shorthandsOfLonghands.add('grid-gap');
|
|
4001
|
+
shorthandsOfLonghands.add('gap');
|
|
4002
|
+
longHandLogical.add('grid-row-gap');
|
|
4003
|
+
longHandLogical.add('row-gap');
|
|
4004
|
+
longHandLogical.add('grid-column-gap');
|
|
4005
|
+
longHandLogical.add('column-gap');
|
|
4006
|
+
shorthandsOfLonghands.add('place-content');
|
|
4007
|
+
longHandLogical.add('align-content');
|
|
4008
|
+
longHandLogical.add('justify-content');
|
|
4009
|
+
shorthandsOfLonghands.add('place-items');
|
|
4010
|
+
longHandLogical.add('align-items');
|
|
4011
|
+
longHandLogical.add('justify-items');
|
|
4012
|
+
shorthandsOfLonghands.add('place-self');
|
|
4013
|
+
longHandLogical.add('align-self');
|
|
4014
|
+
longHandLogical.add('justify-self');
|
|
4015
|
+
longHandLogical.add('box-sizing');
|
|
4016
|
+
longHandLogical.add('block-size');
|
|
4017
|
+
longHandPhysical.add('height');
|
|
4018
|
+
longHandLogical.add('inline-size');
|
|
4019
|
+
longHandPhysical.add('width');
|
|
4020
|
+
longHandLogical.add('max-block-size');
|
|
4021
|
+
longHandPhysical.add('max-height');
|
|
4022
|
+
longHandLogical.add('max-inline-size');
|
|
4023
|
+
longHandPhysical.add('max-width');
|
|
4024
|
+
longHandLogical.add('min-block-size');
|
|
4025
|
+
longHandPhysical.add('min-height');
|
|
4026
|
+
longHandLogical.add('min-inline-size');
|
|
4027
|
+
longHandPhysical.add('min-width');
|
|
4028
|
+
shorthandsOfShorthands.add('margin');
|
|
4029
|
+
shorthandsOfLonghands.add('margin-block');
|
|
4030
|
+
longHandLogical.add('margin-block-start');
|
|
4031
|
+
longHandPhysical.add('margin-top');
|
|
4032
|
+
longHandLogical.add('margin-block-end');
|
|
4033
|
+
longHandPhysical.add('margin-bottom');
|
|
4034
|
+
shorthandsOfLonghands.add('margin-inline');
|
|
4035
|
+
longHandLogical.add('margin-inline-start');
|
|
4036
|
+
longHandPhysical.add('margin-left');
|
|
4037
|
+
longHandLogical.add('margin-inline-end');
|
|
4038
|
+
longHandPhysical.add('margin-right');
|
|
4039
|
+
longHandLogical.add('margin-trim');
|
|
4040
|
+
shorthandsOfLonghands.add('overscroll-behavior');
|
|
4041
|
+
longHandLogical.add('overscroll-behavior-block');
|
|
4042
|
+
longHandPhysical.add('overscroll-behavior-y');
|
|
4043
|
+
longHandLogical.add('overscroll-behavior-inline');
|
|
4044
|
+
longHandPhysical.add('overscroll-behavior-x');
|
|
4045
|
+
shorthandsOfShorthands.add('padding');
|
|
4046
|
+
shorthandsOfLonghands.add('padding-block');
|
|
4047
|
+
longHandLogical.add('padding-block-start');
|
|
4048
|
+
longHandPhysical.add('padding-top');
|
|
4049
|
+
longHandLogical.add('padding-block-end');
|
|
4050
|
+
longHandPhysical.add('padding-bottom');
|
|
4051
|
+
shorthandsOfLonghands.add('padding-inline');
|
|
4052
|
+
longHandLogical.add('padding-inline-start');
|
|
4053
|
+
longHandPhysical.add('padding-left');
|
|
4054
|
+
longHandLogical.add('padding-inline-end');
|
|
4055
|
+
longHandPhysical.add('padding-right');
|
|
4056
|
+
longHandLogical.add('visibility');
|
|
4057
|
+
longHandLogical.add('color');
|
|
4058
|
+
longHandLogical.add('color-scheme');
|
|
4059
|
+
longHandLogical.add('forced-color-adjust');
|
|
4060
|
+
longHandLogical.add('opacity');
|
|
4061
|
+
longHandLogical.add('print-color-adjust');
|
|
4062
|
+
shorthandsOfLonghands.add('columns');
|
|
4063
|
+
longHandLogical.add('column-count');
|
|
4064
|
+
longHandLogical.add('column-width');
|
|
4065
|
+
longHandLogical.add('column-fill');
|
|
4066
|
+
longHandLogical.add('column-span');
|
|
4067
|
+
shorthandsOfLonghands.add('column-rule');
|
|
4068
|
+
longHandLogical.add('column-rule-color');
|
|
4069
|
+
longHandLogical.add('column-rule-style');
|
|
4070
|
+
longHandLogical.add('column-rule-width');
|
|
4071
|
+
longHandLogical.add('contain');
|
|
4072
|
+
shorthandsOfLonghands.add('contain-intrinsic-size');
|
|
4073
|
+
longHandLogical.add('contain-intrinsic-block-size');
|
|
4074
|
+
longHandLogical.add('contain-intrinsic-width');
|
|
4075
|
+
longHandLogical.add('contain-intrinsic-height');
|
|
4076
|
+
longHandLogical.add('contain-intrinsic-inline-size');
|
|
4077
|
+
shorthandsOfLonghands.add('container');
|
|
4078
|
+
longHandLogical.add('container-name');
|
|
4079
|
+
longHandLogical.add('container-type');
|
|
4080
|
+
longHandLogical.add('content-visibility');
|
|
4081
|
+
longHandLogical.add('counter-increment');
|
|
4082
|
+
longHandLogical.add('counter-reset');
|
|
4083
|
+
longHandLogical.add('counter-set');
|
|
4084
|
+
longHandLogical.add('display');
|
|
4085
|
+
shorthandsOfLonghands.add('flex');
|
|
4086
|
+
longHandLogical.add('flex-basis');
|
|
4087
|
+
longHandLogical.add('flex-grow');
|
|
4088
|
+
longHandLogical.add('flex-shrink');
|
|
4089
|
+
shorthandsOfLonghands.add('flex-flow');
|
|
4090
|
+
longHandLogical.add('flex-direction');
|
|
4091
|
+
longHandLogical.add('flex-wrap');
|
|
4092
|
+
longHandLogical.add('order');
|
|
4093
|
+
shorthandsOfShorthands.add('font');
|
|
4094
|
+
longHandLogical.add('font-family');
|
|
4095
|
+
longHandLogical.add('font-size');
|
|
4096
|
+
longHandLogical.add('font-stretch');
|
|
4097
|
+
longHandLogical.add('font-style');
|
|
4098
|
+
longHandLogical.add('font-weight');
|
|
4099
|
+
longHandLogical.add('line-height');
|
|
4100
|
+
shorthandsOfLonghands.add('font-variant');
|
|
4101
|
+
longHandLogical.add('font-variant-alternates');
|
|
4102
|
+
longHandLogical.add('font-variant-caps');
|
|
4103
|
+
longHandLogical.add('font-variant-east-asian');
|
|
4104
|
+
longHandLogical.add('font-variant-emoji');
|
|
4105
|
+
longHandLogical.add('font-variant-ligatures');
|
|
4106
|
+
longHandLogical.add('font-variant-numeric');
|
|
4107
|
+
longHandLogical.add('font-variant-position');
|
|
4108
|
+
longHandLogical.add('font-feature-settings');
|
|
4109
|
+
longHandLogical.add('font-kerning');
|
|
4110
|
+
longHandLogical.add('font-language-override');
|
|
4111
|
+
longHandLogical.add('font-optical-sizing');
|
|
4112
|
+
longHandLogical.add('font-palette');
|
|
4113
|
+
longHandLogical.add('font-variation-settings');
|
|
4114
|
+
longHandLogical.add('font-size-adjust');
|
|
4115
|
+
longHandLogical.add('font-smooth');
|
|
4116
|
+
longHandLogical.add('font-synthesis-position');
|
|
4117
|
+
longHandLogical.add('font-synthesis-small-caps');
|
|
4118
|
+
longHandLogical.add('font-synthesis-style');
|
|
4119
|
+
longHandLogical.add('font-synthesis-weight');
|
|
4120
|
+
longHandLogical.add('line-height-step');
|
|
4121
|
+
longHandLogical.add('box-decoration-break');
|
|
4122
|
+
longHandLogical.add('break-after');
|
|
4123
|
+
longHandLogical.add('break-before');
|
|
4124
|
+
longHandLogical.add('break-inside');
|
|
4125
|
+
longHandLogical.add('orphans');
|
|
4126
|
+
longHandLogical.add('widows');
|
|
4127
|
+
longHandLogical.add('content');
|
|
4128
|
+
longHandLogical.add('quotes');
|
|
4129
|
+
shorthandsOfShorthands.add('grid');
|
|
4130
|
+
longHandLogical.add('grid-auto-flow');
|
|
4131
|
+
longHandLogical.add('grid-auto-rows');
|
|
4132
|
+
longHandLogical.add('grid-auto-columns');
|
|
4133
|
+
shorthandsOfShorthands.add('grid-template');
|
|
4134
|
+
shorthandsOfLonghands.add('grid-template-areas');
|
|
4135
|
+
longHandLogical.add('grid-template-columns');
|
|
4136
|
+
longHandLogical.add('grid-template-rows');
|
|
4137
|
+
shorthandsOfShorthands.add('grid-area');
|
|
4138
|
+
shorthandsOfLonghands.add('grid-row');
|
|
4139
|
+
longHandLogical.add('grid-row-start');
|
|
4140
|
+
longHandLogical.add('grid-row-end');
|
|
4141
|
+
shorthandsOfLonghands.add('grid-column');
|
|
4142
|
+
longHandLogical.add('grid-column-start');
|
|
4143
|
+
longHandLogical.add('grid-column-end');
|
|
4144
|
+
longHandLogical.add('align-tracks');
|
|
4145
|
+
longHandLogical.add('justify-tracks');
|
|
4146
|
+
longHandLogical.add('masonry-auto-flow');
|
|
4147
|
+
longHandLogical.add('image-orientation');
|
|
4148
|
+
longHandLogical.add('image-rendering');
|
|
4149
|
+
longHandLogical.add('image-resolution');
|
|
4150
|
+
longHandLogical.add('object-fit');
|
|
4151
|
+
longHandLogical.add('object-position');
|
|
4152
|
+
longHandLogical.add('initial-letter');
|
|
4153
|
+
longHandLogical.add('initial-letter-align');
|
|
4154
|
+
shorthandsOfLonghands.add('list-style');
|
|
4155
|
+
longHandLogical.add('list-style-image');
|
|
4156
|
+
longHandLogical.add('list-style-position');
|
|
4157
|
+
longHandLogical.add('list-style-type');
|
|
4158
|
+
longHandLogical.add('clip');
|
|
4159
|
+
longHandLogical.add('clip-path');
|
|
4160
|
+
shorthandsOfLonghands.add('mask');
|
|
4161
|
+
longHandLogical.add('mask-clip');
|
|
4162
|
+
longHandLogical.add('mask-composite');
|
|
4163
|
+
longHandLogical.add('mask-image');
|
|
4164
|
+
longHandLogical.add('mask-mode');
|
|
4165
|
+
longHandLogical.add('mask-origin');
|
|
4166
|
+
longHandLogical.add('mask-position');
|
|
4167
|
+
longHandLogical.add('mask-repeat');
|
|
4168
|
+
longHandLogical.add('mask-size');
|
|
4169
|
+
longHandLogical.add('mask-type');
|
|
4170
|
+
shorthandsOfLonghands.add('mask-border');
|
|
4171
|
+
longHandLogical.add('mask-border-mode');
|
|
4172
|
+
longHandLogical.add('mask-border-outset');
|
|
4173
|
+
longHandLogical.add('mask-border-repeat');
|
|
4174
|
+
longHandLogical.add('mask-border-slice');
|
|
4175
|
+
longHandLogical.add('mask-border-source');
|
|
4176
|
+
longHandLogical.add('mask-border-width');
|
|
4177
|
+
shorthandsOfShorthands.add('all');
|
|
4178
|
+
longHandLogical.add('text-rendering');
|
|
4179
|
+
shorthandsOfLonghands.add('offset');
|
|
4180
|
+
longHandLogical.add('offset-anchor');
|
|
4181
|
+
longHandLogical.add('offset-distance');
|
|
4182
|
+
longHandLogical.add('offset-path');
|
|
4183
|
+
longHandLogical.add('offset-position');
|
|
4184
|
+
longHandLogical.add('offset-rotate');
|
|
4185
|
+
longHandLogical.add('-webkit-box-orient');
|
|
4186
|
+
longHandLogical.add('-webkit-line-clamp');
|
|
4187
|
+
shorthandsOfLonghands.add('overflow');
|
|
4188
|
+
longHandLogical.add('overflow-block');
|
|
4189
|
+
longHandPhysical.add('overflow-y');
|
|
4190
|
+
longHandLogical.add('overflow-inline');
|
|
4191
|
+
longHandPhysical.add('overflow-x');
|
|
4192
|
+
longHandLogical.add('overflow-clip-margin');
|
|
4193
|
+
longHandLogical.add('scroll-gutter');
|
|
4194
|
+
longHandLogical.add('scroll-behavior');
|
|
4195
|
+
longHandLogical.add('page');
|
|
4196
|
+
longHandLogical.add('page-break-after');
|
|
4197
|
+
longHandLogical.add('page-break-before');
|
|
4198
|
+
longHandLogical.add('page-break-inside');
|
|
4199
|
+
shorthandsOfShorthands.add('inset');
|
|
4200
|
+
shorthandsOfLonghands.add('inset-block');
|
|
4201
|
+
longHandLogical.add('inset-block-start');
|
|
4202
|
+
longHandPhysical.add('top');
|
|
4203
|
+
longHandLogical.add('inset-block-end');
|
|
4204
|
+
longHandPhysical.add('bottom');
|
|
4205
|
+
shorthandsOfLonghands.add('inset-inline');
|
|
4206
|
+
longHandLogical.add('inset-inline-start');
|
|
4207
|
+
longHandPhysical.add('left');
|
|
4208
|
+
longHandLogical.add('inset-inline-end');
|
|
4209
|
+
longHandPhysical.add('right');
|
|
4210
|
+
longHandLogical.add('clear');
|
|
4211
|
+
longHandLogical.add('float');
|
|
4212
|
+
longHandLogical.add('position');
|
|
4213
|
+
longHandLogical.add('z-index');
|
|
4214
|
+
longHandLogical.add('ruby-align');
|
|
4215
|
+
longHandLogical.add('ruby-merge');
|
|
4216
|
+
longHandLogical.add('ruby-position');
|
|
4217
|
+
longHandLogical.add('overflow-anchor');
|
|
4218
|
+
shorthandsOfShorthands.add('scroll-margin');
|
|
4219
|
+
shorthandsOfLonghands.add('scroll-margin-block');
|
|
4220
|
+
longHandLogical.add('scroll-margin-block-start');
|
|
4221
|
+
longHandPhysical.add('scroll-margin-top');
|
|
4222
|
+
longHandLogical.add('scroll-margin-block-end');
|
|
4223
|
+
longHandPhysical.add('scroll-margin-bottom');
|
|
4224
|
+
shorthandsOfLonghands.add('scroll-margin-inline');
|
|
4225
|
+
longHandLogical.add('scroll-margin-inline-start');
|
|
4226
|
+
longHandPhysical.add('scroll-margin-left');
|
|
4227
|
+
longHandLogical.add('scroll-margin-inline-end');
|
|
4228
|
+
longHandPhysical.add('scroll-margin-right');
|
|
4229
|
+
shorthandsOfShorthands.add('scroll-padding');
|
|
4230
|
+
shorthandsOfLonghands.add('scroll-padding-block');
|
|
4231
|
+
longHandLogical.add('scroll-padding-block-start');
|
|
4232
|
+
longHandPhysical.add('scroll-padding-top');
|
|
4233
|
+
longHandLogical.add('scroll-padding-block-end');
|
|
4234
|
+
longHandPhysical.add('scroll-padding-bottom');
|
|
4235
|
+
shorthandsOfLonghands.add('scroll-padding-inline');
|
|
4236
|
+
longHandLogical.add('scroll-padding-inline-start');
|
|
4237
|
+
longHandPhysical.add('scroll-padding-left');
|
|
4238
|
+
longHandLogical.add('scroll-padding-inline-end');
|
|
4239
|
+
longHandPhysical.add('scroll-padding-right');
|
|
4240
|
+
longHandLogical.add('scroll-snap-align');
|
|
4241
|
+
longHandLogical.add('scroll-snap-stop');
|
|
4242
|
+
shorthandsOfLonghands.add('scroll-snap-type');
|
|
4243
|
+
longHandLogical.add('scrollbar-color');
|
|
4244
|
+
longHandLogical.add('scrollbar-width');
|
|
4245
|
+
longHandLogical.add('shape-image-threshold');
|
|
4246
|
+
longHandLogical.add('shape-margin');
|
|
4247
|
+
longHandLogical.add('shape-outside');
|
|
4248
|
+
longHandLogical.add('azimuth');
|
|
4249
|
+
longHandLogical.add('border-collapse');
|
|
4250
|
+
longHandLogical.add('border-spacing');
|
|
4251
|
+
longHandLogical.add('caption-side');
|
|
4252
|
+
longHandLogical.add('empty-cells');
|
|
4253
|
+
longHandLogical.add('table-layout');
|
|
4254
|
+
longHandLogical.add('vertical-align');
|
|
4255
|
+
shorthandsOfLonghands.add('text-decoration');
|
|
4256
|
+
longHandLogical.add('text-decoration-color');
|
|
4257
|
+
longHandLogical.add('text-decoration-line');
|
|
4258
|
+
longHandLogical.add('text-decoration-skip');
|
|
4259
|
+
longHandLogical.add('text-decoration-skip-ink');
|
|
4260
|
+
longHandLogical.add('text-decoration-style');
|
|
4261
|
+
longHandLogical.add('text-decoration-thickness');
|
|
4262
|
+
shorthandsOfLonghands.add('text-emphasis');
|
|
4263
|
+
longHandLogical.add('text-emphasis-color');
|
|
4264
|
+
longHandLogical.add('text-emphasis-position');
|
|
4265
|
+
longHandLogical.add('text-emphasis-style');
|
|
4266
|
+
longHandLogical.add('text-shadow');
|
|
4267
|
+
longHandLogical.add('text-underline-offset');
|
|
4268
|
+
longHandLogical.add('text-underline-position');
|
|
4269
|
+
longHandLogical.add('hanging-punctuation');
|
|
4270
|
+
longHandLogical.add('hyphenate-character');
|
|
4271
|
+
longHandLogical.add('hyphenate-limit-chars');
|
|
4272
|
+
longHandLogical.add('hyphens');
|
|
4273
|
+
longHandLogical.add('letter-spacing');
|
|
4274
|
+
longHandLogical.add('line-break');
|
|
4275
|
+
longHandLogical.add('overflow-wrap');
|
|
4276
|
+
longHandLogical.add('paint-order');
|
|
4277
|
+
longHandLogical.add('tab-size');
|
|
4278
|
+
longHandLogical.add('text-align');
|
|
4279
|
+
longHandLogical.add('text-align-last');
|
|
4280
|
+
longHandLogical.add('text-indent');
|
|
4281
|
+
longHandLogical.add('text-justify');
|
|
4282
|
+
longHandLogical.add('text-size-adjust');
|
|
4283
|
+
longHandLogical.add('text-transform');
|
|
4284
|
+
longHandLogical.add('text-wrap');
|
|
4285
|
+
longHandLogical.add('white-space');
|
|
4286
|
+
longHandLogical.add('white-space-collapse');
|
|
4287
|
+
longHandLogical.add('word-break');
|
|
4288
|
+
longHandLogical.add('word-spacing');
|
|
4289
|
+
longHandLogical.add('word-wrap');
|
|
4290
|
+
longHandLogical.add('backface-visibility');
|
|
4291
|
+
longHandLogical.add('perspective');
|
|
4292
|
+
longHandLogical.add('perspective-origin');
|
|
4293
|
+
longHandLogical.add('rotate');
|
|
4294
|
+
longHandLogical.add('scale');
|
|
4295
|
+
longHandLogical.add('transform');
|
|
4296
|
+
longHandLogical.add('transform-box');
|
|
4297
|
+
longHandLogical.add('transform-origin');
|
|
4298
|
+
longHandLogical.add('transform-style');
|
|
4299
|
+
longHandLogical.add('translate');
|
|
4300
|
+
shorthandsOfLonghands.add('transition');
|
|
4301
|
+
longHandLogical.add('transition-delay');
|
|
4302
|
+
longHandLogical.add('transition-duration');
|
|
4303
|
+
longHandLogical.add('transition-property');
|
|
4304
|
+
longHandLogical.add('transition-timing-function');
|
|
4305
|
+
longHandLogical.add('view-transition-name');
|
|
4306
|
+
longHandLogical.add('will-change');
|
|
4307
|
+
longHandLogical.add('direction');
|
|
4308
|
+
longHandLogical.add('text-combine-upright');
|
|
4309
|
+
longHandLogical.add('text-orientation');
|
|
4310
|
+
longHandLogical.add('unicode-bidi');
|
|
4311
|
+
longHandLogical.add('writing-mode');
|
|
4312
|
+
longHandLogical.add('backdrop-filter');
|
|
4313
|
+
longHandLogical.add('filter');
|
|
4314
|
+
longHandLogical.add('math-depth');
|
|
4315
|
+
longHandLogical.add('math-shift');
|
|
4316
|
+
longHandLogical.add('math-style');
|
|
4317
|
+
longHandLogical.add('touch-action');
|
|
4318
|
+
const PSEUDO_CLASS_PRIORITIES = propertyPriorities.PSEUDO_CLASS_PRIORITIES = {
|
|
4319
|
+
':is': 40,
|
|
4320
|
+
':where': 40,
|
|
4321
|
+
':not': 40,
|
|
4322
|
+
':has': 45,
|
|
4323
|
+
':dir': 50,
|
|
4324
|
+
':lang': 51,
|
|
4325
|
+
':first-child': 52,
|
|
4326
|
+
':first-of-type': 53,
|
|
4327
|
+
':last-child': 54,
|
|
4328
|
+
':last-of-type': 55,
|
|
4329
|
+
':only-child': 56,
|
|
4330
|
+
':only-of-type': 57,
|
|
4331
|
+
':nth-child': 60,
|
|
4332
|
+
':nth-last-child': 61,
|
|
4333
|
+
':nth-of-type': 62,
|
|
4334
|
+
':nth-last-of-type': 63,
|
|
4335
|
+
':empty': 70,
|
|
4336
|
+
':link': 80,
|
|
4337
|
+
':any-link': 81,
|
|
4338
|
+
':local-link': 82,
|
|
4339
|
+
':target-within': 83,
|
|
4340
|
+
':target': 84,
|
|
4341
|
+
':visited': 85,
|
|
4342
|
+
':enabled': 91,
|
|
4343
|
+
':disabled': 92,
|
|
4344
|
+
':required': 93,
|
|
4345
|
+
':optional': 94,
|
|
4346
|
+
':read-only': 95,
|
|
4347
|
+
':read-write': 96,
|
|
4348
|
+
':placeholder-shown': 97,
|
|
4349
|
+
':in-range': 98,
|
|
4350
|
+
':out-of-range': 99,
|
|
4351
|
+
':default': 100,
|
|
4352
|
+
':checked': 101,
|
|
4353
|
+
':indeterminate': 101,
|
|
4354
|
+
':blank': 102,
|
|
4355
|
+
':valid': 103,
|
|
4356
|
+
':invalid': 104,
|
|
4357
|
+
':user-invalid': 105,
|
|
4358
|
+
':autofill': 110,
|
|
4359
|
+
':picture-in-picture': 120,
|
|
4360
|
+
':modal': 121,
|
|
4361
|
+
':fullscreen': 122,
|
|
4362
|
+
':paused': 123,
|
|
4363
|
+
':playing': 124,
|
|
4364
|
+
':current': 125,
|
|
4365
|
+
':past': 126,
|
|
4366
|
+
':future': 127,
|
|
4367
|
+
':hover': 130,
|
|
4368
|
+
':focusWithin': 140,
|
|
4369
|
+
':focus': 150,
|
|
4370
|
+
':focusVisible': 160,
|
|
4371
|
+
':active': 170
|
|
4372
|
+
};
|
|
4373
|
+
const AT_RULE_PRIORITIES = propertyPriorities.AT_RULE_PRIORITIES = {
|
|
4374
|
+
'@supports': 30,
|
|
4375
|
+
'@media': 200,
|
|
4376
|
+
'@container': 300
|
|
4377
|
+
};
|
|
4378
|
+
const PSEUDO_ELEMENT_PRIORITY = propertyPriorities.PSEUDO_ELEMENT_PRIORITY = 5000;
|
|
4379
|
+
const RELATIONAL_SELECTORS = {
|
|
4380
|
+
ANCESTOR: /^:where\(\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\s+\*\)$/,
|
|
4381
|
+
DESCENDANT: /^:where\(:has\(\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\)\)$/,
|
|
4382
|
+
SIBLING_BEFORE: /^:where\(\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\s+~\s+\*\)$/,
|
|
4383
|
+
SIBLING_AFTER: /^:where\(:has\(~\s\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\)\)$/,
|
|
4384
|
+
ANY_SIBLING: /^:where\(\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\s+~\s+\*,\s+:has\(~\s\.[0-9a-zA-Z_-]+(:[a-zA-Z-]+)\)\)$/
|
|
4385
|
+
};
|
|
4386
|
+
function getAtRulePriority(key) {
|
|
4387
|
+
if (key.startsWith('--')) {
|
|
4388
|
+
return 1;
|
|
4389
|
+
}
|
|
4390
|
+
if (key.startsWith('@supports')) {
|
|
4391
|
+
return AT_RULE_PRIORITIES['@supports'];
|
|
4392
|
+
}
|
|
4393
|
+
if (key.startsWith('@media')) {
|
|
4394
|
+
return AT_RULE_PRIORITIES['@media'];
|
|
4395
|
+
}
|
|
4396
|
+
if (key.startsWith('@container')) {
|
|
4397
|
+
return AT_RULE_PRIORITIES['@container'];
|
|
4398
|
+
}
|
|
4399
|
+
}
|
|
4400
|
+
function getPseudoElementPriority(key) {
|
|
4401
|
+
if (key.startsWith('::')) {
|
|
4402
|
+
return PSEUDO_ELEMENT_PRIORITY;
|
|
4403
|
+
}
|
|
4404
|
+
}
|
|
4405
|
+
function getPseudoClassPriority(key) {
|
|
4406
|
+
const pseudoBase = p => (PSEUDO_CLASS_PRIORITIES[p] ?? 40) / 100;
|
|
4407
|
+
const ancestorMatch = RELATIONAL_SELECTORS.ANCESTOR.exec(key);
|
|
4408
|
+
if (ancestorMatch) {
|
|
4409
|
+
return 10 + pseudoBase(ancestorMatch[1]);
|
|
4410
|
+
}
|
|
4411
|
+
const descendantMatch = RELATIONAL_SELECTORS.DESCENDANT.exec(key);
|
|
4412
|
+
if (descendantMatch) {
|
|
4413
|
+
return 15 + pseudoBase(descendantMatch[1]);
|
|
4414
|
+
}
|
|
4415
|
+
const anySiblingMatch = RELATIONAL_SELECTORS.ANY_SIBLING.exec(key);
|
|
4416
|
+
if (anySiblingMatch) return 20 + Math.max(pseudoBase(anySiblingMatch[1]), pseudoBase(anySiblingMatch[2]));
|
|
4417
|
+
const siblingBeforeMatch = RELATIONAL_SELECTORS.SIBLING_BEFORE.exec(key);
|
|
4418
|
+
if (siblingBeforeMatch) {
|
|
4419
|
+
return 30 + pseudoBase(siblingBeforeMatch[1]);
|
|
4420
|
+
}
|
|
4421
|
+
const siblingAfterMatch = RELATIONAL_SELECTORS.SIBLING_AFTER.exec(key);
|
|
4422
|
+
if (siblingAfterMatch) {
|
|
4423
|
+
return 40 + pseudoBase(siblingAfterMatch[1]);
|
|
4424
|
+
}
|
|
4425
|
+
if (key.startsWith(':')) {
|
|
4426
|
+
const prop = key.startsWith(':') && key.includes('(') ? key.slice(0, key.indexOf('(')) : key;
|
|
4427
|
+
return PSEUDO_CLASS_PRIORITIES[prop] ?? 40;
|
|
4428
|
+
}
|
|
4429
|
+
}
|
|
4430
|
+
function getDefaultPriority(key) {
|
|
4431
|
+
if (shorthandsOfShorthands.has(key)) {
|
|
4432
|
+
return 1000;
|
|
4433
|
+
}
|
|
4434
|
+
if (shorthandsOfLonghands.has(key)) {
|
|
4435
|
+
return 2000;
|
|
4436
|
+
}
|
|
4437
|
+
if (longHandLogical.has(key)) {
|
|
4438
|
+
return 3000;
|
|
4439
|
+
}
|
|
4440
|
+
if (longHandPhysical.has(key)) {
|
|
4441
|
+
return 4000;
|
|
4442
|
+
}
|
|
4443
|
+
}
|
|
4444
|
+
function getPriority(key) {
|
|
4445
|
+
const atRulePriority = getAtRulePriority(key);
|
|
4446
|
+
if (atRulePriority) return atRulePriority;
|
|
4447
|
+
const pseudoElementPriority = getPseudoElementPriority(key);
|
|
4448
|
+
if (pseudoElementPriority) return pseudoElementPriority;
|
|
4449
|
+
const pseudoClassPriority = getPseudoClassPriority(key);
|
|
4450
|
+
if (pseudoClassPriority) return pseudoClassPriority;
|
|
4451
|
+
const defaultPriority = getDefaultPriority(key);
|
|
4452
|
+
if (defaultPriority) return defaultPriority;
|
|
4453
|
+
return 3000;
|
|
4454
|
+
}
|
|
4455
|
+
return propertyPriorities;
|
|
5512
4456
|
}
|
|
5513
4457
|
|
|
4458
|
+
var hasRequiredLib;
|
|
4459
|
+
|
|
4460
|
+
function requireLib () {
|
|
4461
|
+
if (hasRequiredLib) return lib;
|
|
4462
|
+
hasRequiredLib = 1;
|
|
4463
|
+
|
|
4464
|
+
Object.defineProperty(lib, "__esModule", {
|
|
4465
|
+
value: true
|
|
4466
|
+
});
|
|
4467
|
+
lib.getPseudoElementPriority = lib.getPseudoClassPriority = lib.getPriority = lib.getDefaultPriority = lib.getAtRulePriority = lib.PSEUDO_ELEMENT_PRIORITY = lib.PSEUDO_CLASS_PRIORITIES = lib.AT_RULE_PRIORITIES = void 0;
|
|
4468
|
+
var _propertyPriorities = _interopRequireWildcard(requirePropertyPriorities());
|
|
4469
|
+
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); }
|
|
4470
|
+
lib.getAtRulePriority = _propertyPriorities.getAtRulePriority;
|
|
4471
|
+
lib.getPseudoElementPriority = _propertyPriorities.getPseudoElementPriority;
|
|
4472
|
+
lib.getPseudoClassPriority = _propertyPriorities.getPseudoClassPriority;
|
|
4473
|
+
lib.getDefaultPriority = _propertyPriorities.getDefaultPriority;
|
|
4474
|
+
lib.getPriority = _propertyPriorities.default;
|
|
4475
|
+
lib.PSEUDO_CLASS_PRIORITIES = _propertyPriorities.PSEUDO_CLASS_PRIORITIES;
|
|
4476
|
+
lib.AT_RULE_PRIORITIES = _propertyPriorities.AT_RULE_PRIORITIES;
|
|
4477
|
+
lib.PSEUDO_ELEMENT_PRIORITY = _propertyPriorities.PSEUDO_ELEMENT_PRIORITY;
|
|
4478
|
+
return lib;
|
|
4479
|
+
}
|
|
4480
|
+
|
|
4481
|
+
var libExports = requireLib();
|
|
4482
|
+
|
|
5514
4483
|
const THUMB_VARIANTS = ['::-webkit-slider-thumb', '::-moz-range-thumb', '::-ms-thumb'];
|
|
5515
4484
|
function buildNestedCSSRule(className, decls, pseudos, atRules, constRules) {
|
|
5516
4485
|
const pseudo = pseudos.filter(p => p !== '::thumb').join('');
|
|
5517
4486
|
const combinedAtRules = atRules.concat(constRules);
|
|
5518
|
-
|
|
4487
|
+
const hasWhere = pseudo.includes(':where(');
|
|
4488
|
+
const extraClassForWhere = hasWhere ? `.${className}` : '';
|
|
4489
|
+
let selectorForAtRules = `.${className}` + extraClassForWhere + combinedAtRules.map(() => `.${className}`).join('') + pseudo;
|
|
5519
4490
|
if (pseudos.includes('::thumb')) {
|
|
5520
4491
|
selectorForAtRules = THUMB_VARIANTS.map(suffix => selectorForAtRules + suffix).join(', ');
|
|
5521
4492
|
}
|
|
@@ -5528,7 +4499,7 @@ function generateCSSRule(className, key, value, pseudos, atRules, constRules, op
|
|
|
5528
4499
|
const rtlDecls = pairs.map(pair => generateRTL(pair, options)).filter(Boolean).map(pair => pair.join(':')).join(';');
|
|
5529
4500
|
const ltrRule = buildNestedCSSRule(className, ltrDecls, pseudos, atRules, constRules);
|
|
5530
4501
|
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);
|
|
4502
|
+
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
4503
|
return {
|
|
5533
4504
|
priority,
|
|
5534
4505
|
ltr: ltrRule,
|
|
@@ -5739,7 +4710,7 @@ class PreRuleSet {
|
|
|
5739
4710
|
function flattenRawStyleObject(style, options) {
|
|
5740
4711
|
let processedStyle = style;
|
|
5741
4712
|
try {
|
|
5742
|
-
processedStyle = options.enableMediaQueryOrder ? libExports.lastMediaQueryWinsTransform(style) : style;
|
|
4713
|
+
processedStyle = options.enableMediaQueryOrder ? libExports$1.lastMediaQueryWinsTransform(style) : style;
|
|
5743
4714
|
} catch (error) {
|
|
5744
4715
|
throw new Error(INVALID_MEDIA_QUERY_SYNTAX);
|
|
5745
4716
|
}
|
|
@@ -6397,7 +5368,27 @@ function genFileBasedIdentifier({
|
|
|
6397
5368
|
return `${fileName}//${exportName}${key != null ? `.${key}` : ''}`;
|
|
6398
5369
|
}
|
|
6399
5370
|
|
|
5371
|
+
function fromProxy(value) {
|
|
5372
|
+
if (typeof value === 'object' && value != null && value.__IS_PROXY === true && typeof value.toString === 'function') {
|
|
5373
|
+
return value.toString();
|
|
5374
|
+
}
|
|
5375
|
+
return null;
|
|
5376
|
+
}
|
|
5377
|
+
function fromStyleXStyle(value) {
|
|
5378
|
+
if (typeof value === 'object' && value != null && value.$$css === true) {
|
|
5379
|
+
return Object.keys(value).find(key => key !== '$$css');
|
|
5380
|
+
}
|
|
5381
|
+
return null;
|
|
5382
|
+
}
|
|
6400
5383
|
function getDefaultMarkerClassName(options = defaultOptions) {
|
|
5384
|
+
const valueFromProxy = fromProxy(options);
|
|
5385
|
+
if (valueFromProxy != null) {
|
|
5386
|
+
return valueFromProxy;
|
|
5387
|
+
}
|
|
5388
|
+
const valueFromStyleXStyle = fromStyleXStyle(options);
|
|
5389
|
+
if (valueFromStyleXStyle != null) {
|
|
5390
|
+
return valueFromStyleXStyle;
|
|
5391
|
+
}
|
|
6401
5392
|
const prefix = options.classNamePrefix != null ? `${options.classNamePrefix}-` : '';
|
|
6402
5393
|
return `${prefix}default-marker`;
|
|
6403
5394
|
}
|
|
@@ -6556,9 +5547,6 @@ function convertToTestStyles(obj, varName, state) {
|
|
|
6556
5547
|
function convertObjectToAST(obj) {
|
|
6557
5548
|
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
5549
|
}
|
|
6559
|
-
function removeObjectsWithSpreads(obj) {
|
|
6560
|
-
return Object.fromEntries(Object.entries(obj).filter(Boolean));
|
|
6561
|
-
}
|
|
6562
5550
|
|
|
6563
5551
|
const IMPORT_FILE_PARSING_ERROR = `There was error when attempting to parse the imported file.
|
|
6564
5552
|
Please ensure that the 'babelrc' file is configured to be able to parse this file.
|
|
@@ -6667,6 +5655,15 @@ function evaluateThemeRef(fileName, exportName, state) {
|
|
|
6667
5655
|
};
|
|
6668
5656
|
const proxy = new Proxy({}, {
|
|
6669
5657
|
get(_, key) {
|
|
5658
|
+
if (key === '__IS_PROXY') {
|
|
5659
|
+
return true;
|
|
5660
|
+
}
|
|
5661
|
+
if (key === 'toString') {
|
|
5662
|
+
return () => state.traversalState.options.classNamePrefix + utils.hash(utils.genFileBasedIdentifier({
|
|
5663
|
+
fileName,
|
|
5664
|
+
exportName
|
|
5665
|
+
}));
|
|
5666
|
+
}
|
|
6670
5667
|
return resolveKey(key);
|
|
6671
5668
|
},
|
|
6672
5669
|
set(_, key, value) {
|
|
@@ -6815,7 +5812,7 @@ function _evaluate(path, state) {
|
|
|
6815
5812
|
const imported = importSpecifierNode.imported;
|
|
6816
5813
|
const importedName = imported.type === 'Identifier' ? imported.name : imported.value;
|
|
6817
5814
|
const importPath = binding.path.parentPath;
|
|
6818
|
-
if (importPath && importPath.isImportDeclaration()) {
|
|
5815
|
+
if (importPath && importPath.isImportDeclaration() && !state.functions.disableImports) {
|
|
6819
5816
|
const absPath = state.traversalState.importPathResolver(importPath.node.source.value);
|
|
6820
5817
|
if (!absPath) {
|
|
6821
5818
|
return deopt(binding.path, state, IMPORT_PATH_RESOLUTION_ERROR);
|
|
@@ -7159,7 +6156,8 @@ function evaluateQuasis(path, quasis, state, raw = false) {
|
|
|
7159
6156
|
const importsForState = new WeakMap();
|
|
7160
6157
|
function evaluate(path, traversalState, functions = {
|
|
7161
6158
|
identifiers: {},
|
|
7162
|
-
memberExpressions: {}
|
|
6159
|
+
memberExpressions: {},
|
|
6160
|
+
disableImports: false
|
|
7163
6161
|
}, seen = new Map()) {
|
|
7164
6162
|
const addedImports = importsForState.get(traversalState) ?? new Set();
|
|
7165
6163
|
importsForState.set(traversalState, addedImports);
|
|
@@ -7508,7 +6506,7 @@ function transformStyleXCreate(path, state) {
|
|
|
7508
6506
|
};
|
|
7509
6507
|
}
|
|
7510
6508
|
if (varName != null && isTopLevel(path)) {
|
|
7511
|
-
const stylesToRemember =
|
|
6509
|
+
const stylesToRemember = Object.fromEntries(Object.entries(compiledStyles));
|
|
7512
6510
|
state.styleMap.set(varName, stylesToRemember);
|
|
7513
6511
|
state.styleVars.set(varName, path.parentPath);
|
|
7514
6512
|
}
|
|
@@ -8313,6 +7311,13 @@ function genBitwiseOrOfConditions$1(conditions) {
|
|
|
8313
7311
|
});
|
|
8314
7312
|
}
|
|
8315
7313
|
|
|
7314
|
+
class ConditionalStyle {
|
|
7315
|
+
constructor(test, primary, fallback) {
|
|
7316
|
+
this.test = test;
|
|
7317
|
+
this.primary = primary;
|
|
7318
|
+
this.fallback = fallback;
|
|
7319
|
+
}
|
|
7320
|
+
}
|
|
8316
7321
|
function skipStylexPropsChildren(path, state) {
|
|
8317
7322
|
if (!isCalleeIdentifier(path, state) && !isCalleeMemberExpression(path, state)) {
|
|
8318
7323
|
return;
|
|
@@ -8320,15 +7325,12 @@ function skipStylexPropsChildren(path, state) {
|
|
|
8320
7325
|
path.skip();
|
|
8321
7326
|
}
|
|
8322
7327
|
function transformStylexProps(path, state) {
|
|
8323
|
-
const {
|
|
8324
|
-
node
|
|
8325
|
-
} = path;
|
|
8326
7328
|
if (!isCalleeIdentifier(path, state) && !isCalleeMemberExpression(path, state)) {
|
|
8327
7329
|
return;
|
|
8328
7330
|
}
|
|
8329
7331
|
let bailOut = false;
|
|
8330
7332
|
let conditional = 0;
|
|
8331
|
-
const
|
|
7333
|
+
const argsPath = path.get('arguments').flatMap(argPath => argPath.isArrayExpression() ? argPath.get('elements') : [argPath]);
|
|
8332
7334
|
let currentIndex = -1;
|
|
8333
7335
|
let bailOutIndex = null;
|
|
8334
7336
|
const identifiers = {};
|
|
@@ -8345,67 +7347,57 @@ function transformStylexProps(path, state) {
|
|
|
8345
7347
|
});
|
|
8346
7348
|
const evaluatePathFnConfig = {
|
|
8347
7349
|
identifiers,
|
|
8348
|
-
memberExpressions
|
|
7350
|
+
memberExpressions,
|
|
7351
|
+
disableImports: true
|
|
8349
7352
|
};
|
|
8350
7353
|
const resolvedArgs = [];
|
|
8351
|
-
for (const
|
|
7354
|
+
for (const argPath of argsPath) {
|
|
8352
7355
|
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:
|
|
7356
|
+
if (argPath.isObjectExpression() || argPath.isIdentifier() || argPath.isMemberExpression()) {
|
|
7357
|
+
const resolved = parseNullableStyle(argPath, state, evaluatePathFnConfig);
|
|
7358
|
+
if (resolved === 'other') {
|
|
7359
|
+
bailOutIndex = currentIndex;
|
|
7360
|
+
bailOut = true;
|
|
7361
|
+
} else {
|
|
7362
|
+
resolvedArgs.push(resolved);
|
|
7363
|
+
}
|
|
7364
|
+
} else if (argPath.isConditionalExpression()) {
|
|
7365
|
+
const arg = argPath.node;
|
|
7366
|
+
const {
|
|
7367
|
+
test
|
|
7368
|
+
} = arg;
|
|
7369
|
+
const consequentPath = argPath.get('consequent');
|
|
7370
|
+
const alternatePath = argPath.get('alternate');
|
|
7371
|
+
const primary = parseNullableStyle(consequentPath, state, evaluatePathFnConfig);
|
|
7372
|
+
const fallback = parseNullableStyle(alternatePath, state, evaluatePathFnConfig);
|
|
7373
|
+
if (primary === 'other' || fallback === 'other') {
|
|
7374
|
+
bailOutIndex = currentIndex;
|
|
7375
|
+
bailOut = true;
|
|
7376
|
+
} else {
|
|
7377
|
+
resolvedArgs.push(new ConditionalStyle(test, primary, fallback));
|
|
7378
|
+
conditional++;
|
|
7379
|
+
}
|
|
7380
|
+
} else if (argPath.isLogicalExpression()) {
|
|
7381
|
+
const arg = argPath.node;
|
|
7382
|
+
if (arg.operator !== '&&') {
|
|
8406
7383
|
bailOutIndex = currentIndex;
|
|
8407
7384
|
bailOut = true;
|
|
8408
7385
|
break;
|
|
7386
|
+
}
|
|
7387
|
+
const leftPath = argPath.get('left');
|
|
7388
|
+
const rightPath = argPath.get('right');
|
|
7389
|
+
const leftResolved = parseNullableStyle(leftPath, state, evaluatePathFnConfig);
|
|
7390
|
+
const rightResolved = parseNullableStyle(rightPath, state, evaluatePathFnConfig);
|
|
7391
|
+
if (leftResolved !== 'other' || rightResolved === 'other') {
|
|
7392
|
+
bailOutIndex = currentIndex;
|
|
7393
|
+
bailOut = true;
|
|
7394
|
+
} else {
|
|
7395
|
+
resolvedArgs.push(new ConditionalStyle(leftPath.node, rightResolved, null));
|
|
7396
|
+
conditional++;
|
|
7397
|
+
}
|
|
7398
|
+
} else {
|
|
7399
|
+
bailOutIndex = currentIndex;
|
|
7400
|
+
bailOut = true;
|
|
8409
7401
|
}
|
|
8410
7402
|
if (conditional > 4) {
|
|
8411
7403
|
bailOut = true;
|
|
@@ -8450,7 +7442,7 @@ function transformStylexProps(path, state) {
|
|
|
8450
7442
|
confident,
|
|
8451
7443
|
value: styleValue
|
|
8452
7444
|
} = evaluate(path, state, evaluatePathFnConfig);
|
|
8453
|
-
if (!confident || styleValue == null) {
|
|
7445
|
+
if (!confident || styleValue == null || styleValue.__IS_PROXY === true) {
|
|
8454
7446
|
nonNullProps = true;
|
|
8455
7447
|
styleNonNullProps = true;
|
|
8456
7448
|
} else {
|
|
@@ -8501,7 +7493,8 @@ function transformStylexProps(path, state) {
|
|
|
8501
7493
|
path.replaceWith(stringExpression);
|
|
8502
7494
|
}
|
|
8503
7495
|
}
|
|
8504
|
-
function parseNullableStyle(
|
|
7496
|
+
function parseNullableStyle(path, state, evaluatePathFnConfig) {
|
|
7497
|
+
const node = path.node;
|
|
8505
7498
|
if (t__namespace.isNullLiteral(node) || t__namespace.isIdentifier(node) && node.name === 'undefined') {
|
|
8506
7499
|
return null;
|
|
8507
7500
|
}
|
|
@@ -8528,10 +7521,17 @@ function parseNullableStyle(node, state) {
|
|
|
8528
7521
|
}
|
|
8529
7522
|
}
|
|
8530
7523
|
}
|
|
7524
|
+
const parsedObj = evaluate(path, state, evaluatePathFnConfig);
|
|
7525
|
+
if (parsedObj.confident && parsedObj.value != null && typeof parsedObj.value === 'object') {
|
|
7526
|
+
if (parsedObj.value.__IS_PROXY === true) {
|
|
7527
|
+
return 'other';
|
|
7528
|
+
}
|
|
7529
|
+
return parsedObj.value;
|
|
7530
|
+
}
|
|
8531
7531
|
return 'other';
|
|
8532
7532
|
}
|
|
8533
7533
|
function makeStringExpression(values) {
|
|
8534
|
-
const conditions = values.filter(v =>
|
|
7534
|
+
const conditions = values.filter(v => v instanceof ConditionalStyle).map(v => v.test);
|
|
8535
7535
|
if (conditions.length === 0) {
|
|
8536
7536
|
const result = stylex.props(values);
|
|
8537
7537
|
return convertObjectToAST(result);
|
|
@@ -8540,8 +7540,11 @@ function makeStringExpression(values) {
|
|
|
8540
7540
|
const objEntries = conditionPermutations.map(permutation => {
|
|
8541
7541
|
let i = 0;
|
|
8542
7542
|
const args = values.map(v => {
|
|
8543
|
-
if (
|
|
8544
|
-
const
|
|
7543
|
+
if (v instanceof ConditionalStyle) {
|
|
7544
|
+
const {
|
|
7545
|
+
primary,
|
|
7546
|
+
fallback
|
|
7547
|
+
} = v;
|
|
8545
7548
|
return permutation[i++] ? primary : fallback;
|
|
8546
7549
|
} else {
|
|
8547
7550
|
return v;
|
|
@@ -8730,6 +7733,56 @@ function transformStyleXDefaultMarker(path, state) {
|
|
|
8730
7733
|
}
|
|
8731
7734
|
}
|
|
8732
7735
|
|
|
7736
|
+
function transformStyleXDefineMarker(path, state) {
|
|
7737
|
+
const {
|
|
7738
|
+
node
|
|
7739
|
+
} = path;
|
|
7740
|
+
if (node.type !== 'CallExpression') {
|
|
7741
|
+
return;
|
|
7742
|
+
}
|
|
7743
|
+
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);
|
|
7744
|
+
if (!isDefineMarkerCall) {
|
|
7745
|
+
return;
|
|
7746
|
+
}
|
|
7747
|
+
validateStyleXDefineMarker(path);
|
|
7748
|
+
const variableDeclaratorPath = path.parentPath;
|
|
7749
|
+
if (!variableDeclaratorPath.isVariableDeclarator()) {
|
|
7750
|
+
return;
|
|
7751
|
+
}
|
|
7752
|
+
const variableDeclaratorNode = variableDeclaratorPath.node;
|
|
7753
|
+
if (variableDeclaratorNode.id.type !== 'Identifier') {
|
|
7754
|
+
return;
|
|
7755
|
+
}
|
|
7756
|
+
if (node.arguments.length !== 0) {
|
|
7757
|
+
throw path.buildCodeFrameError(illegalArgumentLength('defineMarker', 0), SyntaxError);
|
|
7758
|
+
}
|
|
7759
|
+
const fileName = state.fileNameForHashing;
|
|
7760
|
+
if (fileName == null) {
|
|
7761
|
+
throw new Error(cannotGenerateHash('defineMarker'));
|
|
7762
|
+
}
|
|
7763
|
+
const exportName = variableDeclaratorNode.id.name;
|
|
7764
|
+
const exportId = utils.genFileBasedIdentifier({
|
|
7765
|
+
fileName,
|
|
7766
|
+
exportName
|
|
7767
|
+
});
|
|
7768
|
+
const id = state.options.classNamePrefix + utils.hash(exportId);
|
|
7769
|
+
const markerObj = {
|
|
7770
|
+
[id]: id,
|
|
7771
|
+
$$css: true
|
|
7772
|
+
};
|
|
7773
|
+
path.replaceWith(convertObjectToAST(markerObj));
|
|
7774
|
+
}
|
|
7775
|
+
function validateStyleXDefineMarker(path) {
|
|
7776
|
+
const variableDeclaratorPath = path.parentPath;
|
|
7777
|
+
const exportNamedDeclarationPath = variableDeclaratorPath.parentPath?.parentPath;
|
|
7778
|
+
if (variableDeclaratorPath == null || variableDeclaratorPath.isExpressionStatement() || !variableDeclaratorPath.isVariableDeclarator() || variableDeclaratorPath.node.id.type !== 'Identifier') {
|
|
7779
|
+
throw path.buildCodeFrameError(unboundCallValue('defineMarker'), SyntaxError);
|
|
7780
|
+
}
|
|
7781
|
+
if (exportNamedDeclarationPath == null || !exportNamedDeclarationPath.isExportNamedDeclaration()) {
|
|
7782
|
+
throw path.buildCodeFrameError(nonExportNamedDeclaration('defineMarker'), SyntaxError);
|
|
7783
|
+
}
|
|
7784
|
+
}
|
|
7785
|
+
|
|
8733
7786
|
const NAME = 'stylex';
|
|
8734
7787
|
function styleXTransform() {
|
|
8735
7788
|
let state;
|
|
@@ -8887,6 +7940,7 @@ function styleXTransform() {
|
|
|
8887
7940
|
transformStyleXPositionTry(parentPath, state);
|
|
8888
7941
|
}
|
|
8889
7942
|
transformStyleXDefaultMarker(path, state);
|
|
7943
|
+
transformStyleXDefineMarker(path, state);
|
|
8890
7944
|
transformStyleXDefineVars(path, state);
|
|
8891
7945
|
transformStyleXDefineConsts(path, state);
|
|
8892
7946
|
transformStyleXCreateTheme(path, state);
|
|
@@ -8908,6 +7962,25 @@ function isExported(path) {
|
|
|
8908
7962
|
}
|
|
8909
7963
|
return isExported(path.parentPath);
|
|
8910
7964
|
}
|
|
7965
|
+
function getLogicalFloatVars(rules) {
|
|
7966
|
+
const hasLogicalFloat = rules.some(([, {
|
|
7967
|
+
ltr,
|
|
7968
|
+
rtl
|
|
7969
|
+
}]) => {
|
|
7970
|
+
const ltrStr = String(ltr);
|
|
7971
|
+
const rtlStr = rtl ? String(rtl) : '';
|
|
7972
|
+
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);
|
|
7973
|
+
});
|
|
7974
|
+
return hasLogicalFloat ? `:root, [dir="ltr"] {
|
|
7975
|
+
${LOGICAL_FLOAT_START_VAR}: left;
|
|
7976
|
+
${LOGICAL_FLOAT_END_VAR}: right;
|
|
7977
|
+
}
|
|
7978
|
+
[dir="rtl"] {
|
|
7979
|
+
${LOGICAL_FLOAT_START_VAR}: right;
|
|
7980
|
+
${LOGICAL_FLOAT_END_VAR}: left;
|
|
7981
|
+
}
|
|
7982
|
+
` : '';
|
|
7983
|
+
}
|
|
8911
7984
|
function processStylexRules(rules, config) {
|
|
8912
7985
|
const {
|
|
8913
7986
|
useLayers = false,
|
|
@@ -9005,6 +8078,7 @@ function processStylexRules(rules, config) {
|
|
|
9005
8078
|
acc.push([[key, styleObj, priority]]);
|
|
9006
8079
|
return acc;
|
|
9007
8080
|
}, []);
|
|
8081
|
+
const logicalFloatVars = getLogicalFloatVars(nonConstantRules);
|
|
9008
8082
|
const header = useLayers ? '\n@layer ' + grouped.map((_, index) => `priority${index + 1}`).join(', ') + ';\n' : '';
|
|
9009
8083
|
const collectedCSS = grouped.map((group, index) => {
|
|
9010
8084
|
const pri = group[0][2];
|
|
@@ -9027,7 +8101,7 @@ function processStylexRules(rules, config) {
|
|
|
9027
8101
|
}).join('\n');
|
|
9028
8102
|
return useLayers && pri > 0 ? `@layer priority${index + 1}{\n${collectedCSS}\n}` : collectedCSS;
|
|
9029
8103
|
}).join('\n');
|
|
9030
|
-
return header + collectedCSS;
|
|
8104
|
+
return logicalFloatVars + header + collectedCSS;
|
|
9031
8105
|
}
|
|
9032
8106
|
styleXTransform.processStylexRules = processStylexRules;
|
|
9033
8107
|
function addAncestorSelector(selector, ancestorSelector) {
|