@lvce-editor/extension-search-view 7.2.0 → 7.3.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.
|
@@ -1511,7 +1511,7 @@ const Id = '@id';
|
|
|
1511
1511
|
const Category = '@category';
|
|
1512
1512
|
const Outdated = '@outdated';
|
|
1513
1513
|
|
|
1514
|
-
const RE_PARAM = /@\w
|
|
1514
|
+
const RE_PARAM = /@\w+(?::\w+)?/g;
|
|
1515
1515
|
const deserializeCategory = value => {
|
|
1516
1516
|
if (value.startsWith(':"') && value.endsWith('"')) {
|
|
1517
1517
|
return value.slice(2, -1);
|
|
@@ -1550,8 +1550,17 @@ const parseValue = value => {
|
|
|
1550
1550
|
builtin = true;
|
|
1551
1551
|
}
|
|
1552
1552
|
if (match.startsWith(Sort)) {
|
|
1553
|
-
//
|
|
1554
|
-
|
|
1553
|
+
// Parse sort value after @sort:
|
|
1554
|
+
const sortValue = match.slice(Sort.length);
|
|
1555
|
+
if (sortValue.startsWith(':')) {
|
|
1556
|
+
sort = sortValue.slice(1);
|
|
1557
|
+
} else if (sortValue === '') {
|
|
1558
|
+
// Default sort if no value specified
|
|
1559
|
+
sort = 'installs';
|
|
1560
|
+
} else {
|
|
1561
|
+
// Handle cases like @sort:installs or @sortsize (without colon)
|
|
1562
|
+
sort = sortValue.replace(/^:/, '');
|
|
1563
|
+
}
|
|
1555
1564
|
}
|
|
1556
1565
|
if (match.startsWith(Id)) {
|
|
1557
1566
|
// TODO improve parsing
|