@lvce-editor/extension-search-view 7.1.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
@@ -1867,7 +1876,7 @@ const isEqual$2 = (oldState, newState) => {
1867
1876
  };
1868
1877
 
1869
1878
  const isEqual$1 = (oldState, newState) => {
1870
- return oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.deltaY === newState.deltaY && oldState.focusedIndex === newState.focusedIndex && oldState.message === newState.message && oldState.focus === newState.focus && oldState.inputActions === newState.inputActions && oldState.placeholder === newState.placeholder && oldState.scrollBarHeight === newState.scrollBarHeight;
1879
+ return oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.focusedIndex === newState.focusedIndex && oldState.message === newState.message && oldState.focus === newState.focus && oldState.inputActions === newState.inputActions && oldState.placeholder === newState.placeholder;
1871
1880
  };
1872
1881
 
1873
1882
  const User = 1;
@@ -2851,9 +2860,13 @@ const handleScrollBarMove = (state, eventY) => {
2851
2860
  handleOffset,
2852
2861
  headerHeight,
2853
2862
  height,
2863
+ scrollBarActive,
2854
2864
  scrollBarHeight,
2855
2865
  y
2856
2866
  } = state;
2867
+ if (!scrollBarActive) {
2868
+ return state;
2869
+ }
2857
2870
  const relativeY = eventY - y - headerHeight - handleOffset;
2858
2871
  const contentHeight = height - headerHeight;
2859
2872
  const newPercent = getNewPercent(contentHeight, scrollBarHeight, relativeY);
@@ -3130,14 +3143,15 @@ const getCss = state => {
3130
3143
  scrollBarHeight,
3131
3144
  scrollBarY
3132
3145
  } = state;
3133
- const relative = deltaY % itemHeight;
3146
+ const relative = -(deltaY % itemHeight);
3147
+ const roundedScrollBarY = Math.round(scrollBarY);
3134
3148
  return `.Extensions .ScrollBarThumb {
3135
3149
  height: ${scrollBarHeight}px;
3136
- top: ${scrollBarY}px;
3150
+ translate: 0 ${roundedScrollBarY}px;
3137
3151
  }
3138
3152
 
3139
3153
  .Extensions .ListItems {
3140
- top: -${relative}px;
3154
+ translate: 0 ${relative}px;
3141
3155
 
3142
3156
  .ExtensionListItem {
3143
3157
  position: relative !important;
@@ -3414,21 +3428,14 @@ const getNoExtensionsFoundVirtualDom = message => {
3414
3428
  }, text(message)];
3415
3429
  };
3416
3430
 
3417
- const px = value => {
3418
- return `${value}px`;
3419
- };
3420
- const position = (x, y) => {
3421
- return `${x}px ${y}px`;
3422
- };
3423
-
3424
3431
  const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
3425
3432
  const shouldShowScrollbar = scrollBarHeight > 0;
3426
3433
  if (!shouldShowScrollbar) {
3427
3434
  return [];
3428
3435
  }
3429
3436
  // TODO move the dynamic css into a css adopted stylesheet
3430
- const heightString = px(scrollBarHeight);
3431
- const translateString = position(0, scrollBarTop);
3437
+ // const heightString = Px.px(scrollBarHeight)
3438
+ // const translateString = Px.position(0, scrollBarTop)
3432
3439
  return [{
3433
3440
  childCount: 1,
3434
3441
  className: mergeClassNames(ScrollBar, ScrollBarSmall),
@@ -3438,8 +3445,8 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
3438
3445
  }, {
3439
3446
  childCount: 0,
3440
3447
  className: ScrollBarThumb,
3441
- height: heightString,
3442
- translate: translateString,
3448
+ // height: heightString,
3449
+ // translate: translateString,
3443
3450
  type: Div
3444
3451
  }];
3445
3452
  };
@@ -3493,7 +3500,7 @@ const getContentVirtualDom = (visibleExtensions, message, scrollBarHeight, scrol
3493
3500
  childCount: 2,
3494
3501
  className: mergeClassNames(Viewlet, List$1),
3495
3502
  type: Div
3496
- }, ...getExtensionsVirtualDom(visibleExtensions, focusOutline), ...getScrollBarVirtualDom(scrollBarHeight, scrollBarY)];
3503
+ }, ...getExtensionsVirtualDom(visibleExtensions, focusOutline), ...getScrollBarVirtualDom(scrollBarHeight)];
3497
3504
  };
3498
3505
  const getExtensionsViewVirtualDom = state => {
3499
3506
  const visibleExtensions = getVisible(state);
@@ -3543,6 +3550,13 @@ const renderMessage = newState => {
3543
3550
  return [/* method */SetMessage, /* message */newState.message];
3544
3551
  };
3545
3552
 
3553
+ const px = value => {
3554
+ return `${value}px`;
3555
+ };
3556
+ const position = (x, y) => {
3557
+ return `${x}px ${y}px`;
3558
+ };
3559
+
3546
3560
  const renderScrollBar = newState => {
3547
3561
  const listHeight = getListHeight(newState.items.length, newState.itemHeight, newState.height);
3548
3562
  const total = newState.items.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-search-view",
3
- "version": "7.1.0",
3
+ "version": "7.3.0",
4
4
  "description": "Extension Search View Worker",
5
5
  "repository": {
6
6
  "type": "git",