@lvce-editor/quick-pick-worker 3.1.0 → 3.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.
@@ -1593,7 +1593,7 @@ const updateIconCache = (iconCache, missingRequests, newIcons) => {
1593
1593
  return newFileIconCache;
1594
1594
  };
1595
1595
 
1596
- const getPath = dirent => {
1596
+ const getPath$1 = dirent => {
1597
1597
  return dirent.path;
1598
1598
  };
1599
1599
  const toDirent = pick => {
@@ -1609,7 +1609,7 @@ const getQuickPickFileIcons = async (items, fileIconCache) => {
1609
1609
  const missingRequests = getMissingIconRequests(dirents, fileIconCache);
1610
1610
  const newIcons = await requestFileIcons(missingRequests);
1611
1611
  const newFileIconCache = updateIconCache(fileIconCache, missingRequests, newIcons);
1612
- const paths = dirents.map(getPath);
1612
+ const paths = dirents.map(getPath$1);
1613
1613
  const icons = getIconsCached(paths, newFileIconCache);
1614
1614
  return {
1615
1615
  icons,
@@ -2618,15 +2618,29 @@ const getRecentlyOpened = () => {
2618
2618
  return invoke(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
2619
2619
  };
2620
2620
 
2621
- const getLabel = uri => {
2621
+ const getPath = uri => {
2622
2622
  if (uri.startsWith('file://')) {
2623
2623
  return uri.slice('file://'.length);
2624
2624
  }
2625
2625
  return uri;
2626
2626
  };
2627
+ const getLabel = uri => {
2628
+ const path = getPath(uri);
2629
+ if (path.startsWith('/')) {
2630
+ return pathBaseName(path);
2631
+ }
2632
+ return path;
2633
+ };
2634
+ const getDescription = uri => {
2635
+ const path = getPath(uri);
2636
+ if (path.startsWith('/')) {
2637
+ return pathDirName(path);
2638
+ }
2639
+ return '';
2640
+ };
2627
2641
  const toProtoVisibleItem = uri => {
2628
2642
  return {
2629
- description: '',
2643
+ description: getDescription(uri),
2630
2644
  direntType: Directory,
2631
2645
  fileIcon: '',
2632
2646
  icon: '',
@@ -3445,7 +3459,6 @@ const diffChildren = (oldChildren, newChildren, patches) => {
3445
3459
  patches.push({
3446
3460
  type: NavigateParent
3447
3461
  });
3448
- currentChildIndex = -1;
3449
3462
  }
3450
3463
  // Add remove patches in reverse order (highest index first)
3451
3464
  // This ensures indices remain valid as we remove
@@ -3580,6 +3593,9 @@ const getVisible = (setSize, protoVisibleItems, minLineY, focusedIndex) => {
3580
3593
  };
3581
3594
 
3582
3595
  const getScrollBarOffset = (delta, finalDelta, size, scrollBarSize) => {
3596
+ if (finalDelta <= 0) {
3597
+ return 0;
3598
+ }
3583
3599
  const scrollBarOffset = delta / finalDelta * (size - scrollBarSize);
3584
3600
  return scrollBarOffset;
3585
3601
  };
@@ -3659,6 +3675,9 @@ const HandleBeforeInput = 'handleBeforeInput';
3659
3675
  const HandleBlur = 'handleBlur';
3660
3676
  const HandleFocus = 'handleFocus';
3661
3677
  const HandleInput = 'handleInput';
3678
+ const HandleScrollbarPointerDown = 'handleScrollbarPointerDown';
3679
+ const HandleScrollbarPointerMove = 'handleScrollbarPointerMove';
3680
+ const HandleScrollbarPointerUp = 'handleScrollbarPointerUp';
3662
3681
 
3663
3682
  const QuickPick = 'QuickPick';
3664
3683
  const QuickPickItems = 'QuickPickItems';
@@ -3953,6 +3972,18 @@ const renderEventListeners = () => {
3953
3972
  name: HandleWheel,
3954
3973
  params: ['handleWheel', 'event.deltaMode', 'event.deltaY'],
3955
3974
  passive: true
3975
+ }, {
3976
+ name: HandleScrollbarPointerDown,
3977
+ params: ['handleScrollBarPointerDown', 'event.clientY', 'event.pointerId'],
3978
+ preventDefault: true
3979
+ }, {
3980
+ name: HandleScrollbarPointerMove,
3981
+ params: ['handleScrollBarPointerMove', 'event.clientY', 'event.pointerId'],
3982
+ preventDefault: true
3983
+ }, {
3984
+ name: HandleScrollbarPointerUp,
3985
+ params: ['handleScrollBarPointerUp', 'event.pointerId'],
3986
+ preventDefault: true
3956
3987
  }, {
3957
3988
  name: HandleBlur,
3958
3989
  params: ['handleBlur']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/quick-pick-worker",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lvce-editor/quick-pick-worker.git"