@lvce-editor/extension-search-view 7.1.0 → 7.2.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.
@@ -1867,7 +1867,7 @@ const isEqual$2 = (oldState, newState) => {
1867
1867
  };
1868
1868
 
1869
1869
  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;
1870
+ 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
1871
  };
1872
1872
 
1873
1873
  const User = 1;
@@ -2851,9 +2851,13 @@ const handleScrollBarMove = (state, eventY) => {
2851
2851
  handleOffset,
2852
2852
  headerHeight,
2853
2853
  height,
2854
+ scrollBarActive,
2854
2855
  scrollBarHeight,
2855
2856
  y
2856
2857
  } = state;
2858
+ if (!scrollBarActive) {
2859
+ return state;
2860
+ }
2857
2861
  const relativeY = eventY - y - headerHeight - handleOffset;
2858
2862
  const contentHeight = height - headerHeight;
2859
2863
  const newPercent = getNewPercent(contentHeight, scrollBarHeight, relativeY);
@@ -3130,14 +3134,15 @@ const getCss = state => {
3130
3134
  scrollBarHeight,
3131
3135
  scrollBarY
3132
3136
  } = state;
3133
- const relative = deltaY % itemHeight;
3137
+ const relative = -(deltaY % itemHeight);
3138
+ const roundedScrollBarY = Math.round(scrollBarY);
3134
3139
  return `.Extensions .ScrollBarThumb {
3135
3140
  height: ${scrollBarHeight}px;
3136
- top: ${scrollBarY}px;
3141
+ translate: 0 ${roundedScrollBarY}px;
3137
3142
  }
3138
3143
 
3139
3144
  .Extensions .ListItems {
3140
- top: -${relative}px;
3145
+ translate: 0 ${relative}px;
3141
3146
 
3142
3147
  .ExtensionListItem {
3143
3148
  position: relative !important;
@@ -3414,21 +3419,14 @@ const getNoExtensionsFoundVirtualDom = message => {
3414
3419
  }, text(message)];
3415
3420
  };
3416
3421
 
3417
- const px = value => {
3418
- return `${value}px`;
3419
- };
3420
- const position = (x, y) => {
3421
- return `${x}px ${y}px`;
3422
- };
3423
-
3424
3422
  const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
3425
3423
  const shouldShowScrollbar = scrollBarHeight > 0;
3426
3424
  if (!shouldShowScrollbar) {
3427
3425
  return [];
3428
3426
  }
3429
3427
  // TODO move the dynamic css into a css adopted stylesheet
3430
- const heightString = px(scrollBarHeight);
3431
- const translateString = position(0, scrollBarTop);
3428
+ // const heightString = Px.px(scrollBarHeight)
3429
+ // const translateString = Px.position(0, scrollBarTop)
3432
3430
  return [{
3433
3431
  childCount: 1,
3434
3432
  className: mergeClassNames(ScrollBar, ScrollBarSmall),
@@ -3438,8 +3436,8 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
3438
3436
  }, {
3439
3437
  childCount: 0,
3440
3438
  className: ScrollBarThumb,
3441
- height: heightString,
3442
- translate: translateString,
3439
+ // height: heightString,
3440
+ // translate: translateString,
3443
3441
  type: Div
3444
3442
  }];
3445
3443
  };
@@ -3493,7 +3491,7 @@ const getContentVirtualDom = (visibleExtensions, message, scrollBarHeight, scrol
3493
3491
  childCount: 2,
3494
3492
  className: mergeClassNames(Viewlet, List$1),
3495
3493
  type: Div
3496
- }, ...getExtensionsVirtualDom(visibleExtensions, focusOutline), ...getScrollBarVirtualDom(scrollBarHeight, scrollBarY)];
3494
+ }, ...getExtensionsVirtualDom(visibleExtensions, focusOutline), ...getScrollBarVirtualDom(scrollBarHeight)];
3497
3495
  };
3498
3496
  const getExtensionsViewVirtualDom = state => {
3499
3497
  const visibleExtensions = getVisible(state);
@@ -3543,6 +3541,13 @@ const renderMessage = newState => {
3543
3541
  return [/* method */SetMessage, /* message */newState.message];
3544
3542
  };
3545
3543
 
3544
+ const px = value => {
3545
+ return `${value}px`;
3546
+ };
3547
+ const position = (x, y) => {
3548
+ return `${x}px ${y}px`;
3549
+ };
3550
+
3546
3551
  const renderScrollBar = newState => {
3547
3552
  const listHeight = getListHeight(newState.items.length, newState.itemHeight, newState.height);
3548
3553
  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.2.0",
4
4
  "description": "Extension Search View Worker",
5
5
  "repository": {
6
6
  "type": "git",