@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+/g;
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
- // TODO correcly parse sort order
1554
- sort = 'installs';
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-search-view",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "Extension Search View Worker",
5
5
  "repository": {
6
6
  "type": "git",