@lvce-editor/settings-view 2.5.0 → 2.7.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.
@@ -2901,11 +2901,6 @@ const getMenuEntries = () => {
2901
2901
  }];
2902
2902
  };
2903
2903
 
2904
- const getName = () => {
2905
- // TODO i18n string
2906
- return 'Settings';
2907
- };
2908
-
2909
2904
  const ClientX = 'event.clientX';
2910
2905
  const ClientY = 'event.clientY';
2911
2906
  const DeltaY = 'event.deltaY';
@@ -2921,6 +2916,15 @@ const RendererWorker$1 = 1;
2921
2916
 
2922
2917
  const SetCss = 'Viewlet.setCss';
2923
2918
 
2919
+ const getMenuIds = () => {
2920
+ return [SettingsFilter];
2921
+ };
2922
+
2923
+ const getName = () => {
2924
+ // TODO i18n string
2925
+ return 'Settings';
2926
+ };
2927
+
2924
2928
  const rpcs = Object.create(null);
2925
2929
  const set$2 = (id, rpc) => {
2926
2930
  rpcs[id] = rpc;
@@ -4936,9 +4940,6 @@ const getCss = (sideBarWidth, scrollBarThumbHeight, scrollBarThumbTop) => {
4936
4940
  --ScrollBarThumbHeight: ${scrollBarThumbHeight}px;
4937
4941
  --ScrollBarThumbTop: ${scrollBarThumbTop}px;
4938
4942
  }
4939
- .SettingsResizer {
4940
- background: yellow;
4941
- }
4942
4943
 
4943
4944
  .SettingsSideBar{
4944
4945
  width: var(--SettingsSideBarWidth);
@@ -5140,7 +5141,10 @@ const parentNode$1 = {
5140
5141
  className: mergeClassNames(SettingsScrollBar, SettingsScrollBarSmall),
5141
5142
  type: Div
5142
5143
  };
5143
- const getScrollBarDom = () => {
5144
+ const getScrollBarDom = visible => {
5145
+ if (!visible) {
5146
+ return [];
5147
+ }
5144
5148
  return [parentNode$1, {
5145
5149
  childCount: 0,
5146
5150
  className: SettingsScrollBarThumb,
@@ -5454,7 +5458,7 @@ const getSettingsItemsDom = (items, searchValue) => {
5454
5458
  }, ...items.flatMap(getItemVirtualDom)];
5455
5459
  };
5456
5460
 
5457
- const getSettingsContentDom = (visibleItems, tabs, searchValue) => {
5461
+ const getSettingsContentDom = (visibleItems, tabs, searchValue, showScrollBar) => {
5458
5462
  const selectedTab = tabs.find(tab => tab.selected);
5459
5463
  const headerText = selectedTab ? selectedTab.label : settingsContent();
5460
5464
  return [{
@@ -5466,7 +5470,7 @@ const getSettingsContentDom = (visibleItems, tabs, searchValue) => {
5466
5470
  childCount: 2,
5467
5471
  className: SettingsItemWrapper,
5468
5472
  type: Div
5469
- }, ...getSettingsItemsDom(visibleItems, searchValue), ...getScrollBarDom()];
5473
+ }, ...getSettingsItemsDom(visibleItems, searchValue), ...getScrollBarDom(showScrollBar)];
5470
5474
  };
5471
5475
 
5472
5476
  const getTabClassName = tab => {
@@ -5504,12 +5508,14 @@ const getSettingsSideBarDom = tabs => {
5504
5508
  }, ...getSettingsTabsDom(tabs)];
5505
5509
  };
5506
5510
 
5507
- const getSettingsMainDom = (tabs, visibleItems, totalItemCount, searchValue) => {
5511
+ const getSettingsMainDom = (tabs, visibleItems, totalItemCount, searchValue, height, itemHeight) => {
5512
+ const totalHeight = totalItemCount * itemHeight;
5513
+ const showScrollBar = totalHeight > height;
5508
5514
  return [{
5509
5515
  childCount: 3,
5510
5516
  className: SettingsMain,
5511
5517
  type: Div
5512
- }, ...getSettingsSideBarDom(tabs), ...getResizerVirtualDom(), ...getSettingsContentDom(visibleItems, tabs, searchValue)];
5518
+ }, ...getSettingsSideBarDom(tabs), ...getResizerVirtualDom(), ...getSettingsContentDom(visibleItems, tabs, searchValue, showScrollBar)];
5513
5519
  };
5514
5520
 
5515
5521
  const parentNode = {
@@ -5520,13 +5526,15 @@ const parentNode = {
5520
5526
  const getSettingsDom = state => {
5521
5527
  const {
5522
5528
  filteredItems,
5529
+ height,
5530
+ itemHeight,
5523
5531
  searchValue,
5524
5532
  tabs,
5525
5533
  visibleItems
5526
5534
  } = state;
5527
5535
  const hasSearchValue = searchValue.trim().length > 0;
5528
5536
  const filteredItemsCount = filteredItems.length;
5529
- return [parentNode, ...getSettingsHeaderDom(filteredItemsCount, hasSearchValue), ...getSettingsMainDom(tabs, visibleItems, filteredItemsCount, searchValue)];
5537
+ return [parentNode, ...getSettingsHeaderDom(filteredItemsCount, hasSearchValue), ...getSettingsMainDom(tabs, visibleItems, filteredItemsCount, searchValue, height, itemHeight)];
5530
5538
  };
5531
5539
 
5532
5540
  const renderItems = (oldState, newState) => {
@@ -5732,6 +5740,7 @@ const commandMap = {
5732
5740
  'Settings.getCommandIds': getCommandIds,
5733
5741
  'Settings.getKeyBindings': getKeyBindings$1,
5734
5742
  'Settings.getMenuEntries': getMenuEntries,
5743
+ 'Settings.getMenuIds': getMenuIds,
5735
5744
  'Settings.getName': getName,
5736
5745
  'Settings.handleClickFilterButton': wrapCommand(handleClickFilterButton),
5737
5746
  'Settings.handleClickTab': wrapCommand(handleClickTab),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/settings-view",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",