@unocss/core 0.62.0 → 0.62.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +29 -39
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -489,47 +489,29 @@ function resolvePresets(preset) {
|
|
|
489
489
|
return [root, ...nested];
|
|
490
490
|
}
|
|
491
491
|
function mergeContentOptions(optionsArray) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
},
|
|
499
|
-
plain: []
|
|
500
|
-
};
|
|
492
|
+
if (optionsArray.length === 0) {
|
|
493
|
+
return {};
|
|
494
|
+
}
|
|
495
|
+
const pipelineIncludes = [];
|
|
496
|
+
const pipelineExcludes = [];
|
|
497
|
+
let pipelineDisabled = false;
|
|
501
498
|
for (const options of optionsArray) {
|
|
502
|
-
if (options.
|
|
503
|
-
|
|
504
|
-
}
|
|
505
|
-
if (options.inline) {
|
|
506
|
-
mergedResult.inline.push(...options.inline);
|
|
507
|
-
}
|
|
508
|
-
if (options.plain) {
|
|
509
|
-
mergedResult.inline.push(...options.plain);
|
|
510
|
-
}
|
|
511
|
-
if (options.pipeline !== false) {
|
|
512
|
-
if (options.pipeline?.include) {
|
|
513
|
-
mergedResult.pipeline?.include?.push(...options.pipeline?.include);
|
|
514
|
-
}
|
|
515
|
-
if (options.pipeline?.exclude) {
|
|
516
|
-
mergedResult.pipeline?.exclude?.push(...options.pipeline?.exclude);
|
|
517
|
-
}
|
|
499
|
+
if (options.pipeline === false) {
|
|
500
|
+
pipelineDisabled = true;
|
|
518
501
|
} else {
|
|
519
|
-
|
|
502
|
+
pipelineIncludes.push(options.pipeline?.include ?? []);
|
|
503
|
+
pipelineExcludes.push(options.pipeline?.exclude ?? []);
|
|
520
504
|
}
|
|
521
505
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
}
|
|
532
|
-
return mergedResult;
|
|
506
|
+
return {
|
|
507
|
+
filesystem: uniq(optionsArray.flatMap((options) => options.filesystem ?? [])),
|
|
508
|
+
inline: uniq(optionsArray.flatMap((options) => options.inline ?? [])),
|
|
509
|
+
plain: uniq(optionsArray.flatMap((options) => options.plain ?? [])),
|
|
510
|
+
pipeline: pipelineDisabled ? false : {
|
|
511
|
+
include: uniq(mergeFilterPatterns(...pipelineIncludes)),
|
|
512
|
+
exclude: uniq(mergeFilterPatterns(...pipelineExcludes))
|
|
513
|
+
}
|
|
514
|
+
};
|
|
533
515
|
}
|
|
534
516
|
function resolveConfig(userConfig = {}, defaults = {}) {
|
|
535
517
|
const config = Object.assign({}, defaults, userConfig);
|
|
@@ -617,10 +599,12 @@ function mergeConfigs(configs) {
|
|
|
617
599
|
const config = configs.map((config2) => Object.entries(config2).reduce((acc, [key, value]) => ({
|
|
618
600
|
...acc,
|
|
619
601
|
[key]: maybeArrays.includes(key) ? toArray(value) : value
|
|
620
|
-
}), {})).reduce(({ theme: themeA, ...a }, { theme: themeB, ...b }) => {
|
|
602
|
+
}), {})).reduce(({ theme: themeA, content: contentA, ...a }, { theme: themeB, content: contentB, ...b }) => {
|
|
621
603
|
const c = mergeDeep(a, b, true);
|
|
622
604
|
if (themeA || themeB)
|
|
623
605
|
c.theme = mergeThemes([themeA, themeB]);
|
|
606
|
+
if (contentA || contentB)
|
|
607
|
+
c.content = mergeContentOptions([contentA || {}, contentB || {}]);
|
|
624
608
|
return c;
|
|
625
609
|
}, {});
|
|
626
610
|
return config;
|
|
@@ -644,11 +628,17 @@ function mergeAutocompleteShorthands(shorthands) {
|
|
|
644
628
|
};
|
|
645
629
|
}, {});
|
|
646
630
|
}
|
|
631
|
+
function mergeFilterPatterns(...filterPatterns) {
|
|
632
|
+
return filterPatterns.flatMap(flatternFilterPattern);
|
|
633
|
+
}
|
|
634
|
+
function flatternFilterPattern(pattern) {
|
|
635
|
+
return Array.isArray(pattern) ? pattern : pattern ? [pattern] : [];
|
|
636
|
+
}
|
|
647
637
|
function definePreset(preset) {
|
|
648
638
|
return preset;
|
|
649
639
|
}
|
|
650
640
|
|
|
651
|
-
const version = "0.62.
|
|
641
|
+
const version = "0.62.1";
|
|
652
642
|
|
|
653
643
|
var __defProp = Object.defineProperty;
|
|
654
644
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|