@lvce-editor/extension-search-view 5.0.0 → 5.1.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.
@@ -1269,17 +1269,17 @@ const Ellipsis = 'Ellipsis';
1269
1269
  const getInputActions = hasValue => {
1270
1270
  const clearEnabled = hasValue;
1271
1271
  const actions = [{
1272
- onClick: HandleClearSearchResults,
1272
+ enabled: clearEnabled,
1273
1273
  icon: `MaskIcon${ClearAll}`,
1274
+ onClick: HandleClearSearchResults,
1274
1275
  title: clearExtensionSearchResults(),
1275
- type: Button,
1276
- enabled: clearEnabled
1276
+ type: Button
1277
1277
  }, {
1278
+ enabled: true,
1278
1279
  icon: `MaskIcon${Filter}`,
1279
- title: filter(),
1280
- type: Button,
1281
1280
  onClick: HandleClickFilter,
1282
- enabled: true
1281
+ title: filter(),
1282
+ type: Button
1283
1283
  }];
1284
1284
  return actions;
1285
1285
  };
@@ -1383,16 +1383,16 @@ const parseValue = value => {
1383
1383
  });
1384
1384
  const isLocal = enabled || builtin || disabled || outdated || installed;
1385
1385
  return {
1386
- query: replaced,
1387
- enabled,
1388
1386
  builtin,
1387
+ category,
1389
1388
  disabled,
1390
- outdated,
1391
- installed,
1389
+ enabled,
1392
1390
  id,
1393
- sort,
1391
+ installed,
1394
1392
  isLocal,
1395
- category
1393
+ outdated,
1394
+ query: replaced,
1395
+ sort
1396
1396
  };
1397
1397
  };
1398
1398
 
@@ -1473,12 +1473,12 @@ const handleChange = async (state, update) => {
1473
1473
  const inputActions = getInputActions(hasValue);
1474
1474
  const {
1475
1475
  allExtensions,
1476
+ assetDir,
1477
+ headerHeight,
1478
+ height,
1476
1479
  itemHeight,
1477
1480
  minimumSliderSize,
1478
- height,
1479
- platform,
1480
- assetDir,
1481
- headerHeight
1481
+ platform
1482
1482
  } = state;
1483
1483
  // TODO cancel ongoing requests
1484
1484
  // TODO handle errors
@@ -1490,15 +1490,15 @@ const handleChange = async (state, update) => {
1490
1490
  deltaY: 0,
1491
1491
  finalDeltaY: 0,
1492
1492
  focus: Input,
1493
+ inputActions,
1494
+ inputSource,
1493
1495
  items,
1494
1496
  maxLineY: 0,
1495
1497
  message: noExtensionsFound(),
1496
1498
  minLineY: 0,
1497
1499
  placeholder: searchExtensionsInMarketPlace(),
1498
1500
  scrollBarHeight: 0,
1499
- searchValue: value,
1500
- inputSource,
1501
- inputActions
1501
+ searchValue: value
1502
1502
  };
1503
1503
  }
1504
1504
  const total = items.length;
@@ -1514,6 +1514,8 @@ const handleChange = async (state, update) => {
1514
1514
  allExtensions,
1515
1515
  deltaY: 0,
1516
1516
  finalDeltaY,
1517
+ inputActions,
1518
+ inputSource,
1517
1519
  items,
1518
1520
  maxLineY,
1519
1521
  message: '',
@@ -1521,9 +1523,7 @@ const handleChange = async (state, update) => {
1521
1523
  placeholder: searchExtensionsInMarketPlace(),
1522
1524
  scrollBarHeight,
1523
1525
  scrollBarY,
1524
- searchValue: value,
1525
- inputSource,
1526
- inputActions
1526
+ searchValue: value
1527
1527
  };
1528
1528
 
1529
1529
  // TODO handle out of order responses (a bit complicated)
@@ -1542,8 +1542,8 @@ const clearSearchResults = state => {
1542
1542
  return handleChange(state, {
1543
1543
  ...state,
1544
1544
  focus: Input,
1545
- searchValue: '',
1546
- inputSource: Script$1
1545
+ inputSource: Script$1,
1546
+ searchValue: ''
1547
1547
  });
1548
1548
  };
1549
1549
 
@@ -2003,8 +2003,8 @@ const RendererWorker = {
2003
2003
 
2004
2004
  const getFocusedItem = state => {
2005
2005
  const {
2006
- items,
2007
- focusedIndex
2006
+ focusedIndex,
2007
+ items
2008
2008
  } = state;
2009
2009
  if (focusedIndex === -1) {
2010
2010
  return undefined;
@@ -2034,10 +2034,10 @@ const stringifyRow = row => {
2034
2034
  };
2035
2035
  const getExtensionInfoText = extension => {
2036
2036
  const {
2037
- name: name$1,
2037
+ description: description$1,
2038
2038
  id: id$1,
2039
- publisher: publisher$1,
2040
- description: description$1
2039
+ name: name$1,
2040
+ publisher: publisher$1
2041
2041
  } = extension;
2042
2042
  const version$1 = ''; // TODO
2043
2043
  const marketplaceLink$1 = ''; // TODO
@@ -2076,14 +2076,14 @@ const copyExtensionInfo = async state => {
2076
2076
  };
2077
2077
 
2078
2078
  const {
2079
- get,
2080
- set: set$2,
2079
+ diff,
2081
2080
  dispose: dispose$1,
2082
- wrapCommand,
2081
+ get,
2083
2082
  getCommandIds,
2084
2083
  registerCommands,
2085
- wrapGetter,
2086
- diff
2084
+ set: set$2,
2085
+ wrapCommand,
2086
+ wrapGetter
2087
2087
  } = create$2();
2088
2088
 
2089
2089
  const create = (id, uri, x, y, width, height, platform, assetDir) => {
@@ -2331,15 +2331,15 @@ const focusPreviousPage = state => {
2331
2331
 
2332
2332
  const getActions = () => {
2333
2333
  return [{
2334
- type: Button,
2335
- id: refresh(),
2334
+ command: '',
2336
2335
  icon: Refresh,
2337
- command: ''
2336
+ id: refresh(),
2337
+ type: Button
2338
2338
  }, {
2339
- type: Button,
2340
- id: viewsAndMoreActions(),
2339
+ command: '',
2341
2340
  icon: Ellipsis,
2342
- command: ''
2341
+ id: viewsAndMoreActions(),
2342
+ type: Button
2343
2343
  }];
2344
2344
  };
2345
2345
 
@@ -2359,44 +2359,44 @@ const FocusExtensionsInput = 7000;
2359
2359
 
2360
2360
  const getKeyBindings = () => {
2361
2361
  return [{
2362
- key: Home,
2363
2362
  command: 'Extensions.focusFirst',
2363
+ key: Home,
2364
2364
  when: FocusExtensions
2365
2365
  }, {
2366
- key: End,
2367
2366
  command: 'Extensions.focusLast',
2367
+ key: End,
2368
2368
  when: FocusExtensions
2369
2369
  }, {
2370
- key: PageUp,
2371
2370
  command: 'Extensions.focusPreviousPage',
2371
+ key: PageUp,
2372
2372
  when: FocusExtensions
2373
2373
  }, {
2374
- key: PageDown,
2375
2374
  command: 'Extensions.focusNextPage',
2375
+ key: PageDown,
2376
2376
  when: FocusExtensions
2377
2377
  }, {
2378
- key: UpArrow,
2379
2378
  command: 'Extensions.focusPrevious',
2379
+ key: UpArrow,
2380
2380
  when: FocusExtensions
2381
2381
  }, {
2382
- key: DownArrow,
2383
2382
  command: 'Extensions.focusNext',
2383
+ key: DownArrow,
2384
2384
  when: FocusExtensions
2385
2385
  }, {
2386
- key: Space,
2387
2386
  command: 'Extensions.handleClickCurrentButKeepFocus',
2387
+ key: Space,
2388
2388
  when: FocusExtensions
2389
2389
  }, {
2390
- key: Enter,
2391
2390
  command: 'Extensions.handleClickCurrent',
2391
+ key: Enter,
2392
2392
  when: FocusExtensions
2393
2393
  }, {
2394
- key: CtrlCmd | Space,
2395
2394
  command: 'Extensions.toggleSuggest',
2395
+ key: CtrlCmd | Space,
2396
2396
  when: FocusExtensions
2397
2397
  }, {
2398
- key: CtrlCmd | DownArrow,
2399
2398
  command: 'Extensions.scrollDown',
2399
+ key: CtrlCmd | DownArrow,
2400
2400
  when: FocusExtensions
2401
2401
  }];
2402
2402
  };
@@ -2405,30 +2405,30 @@ const None$1 = 0;
2405
2405
 
2406
2406
  const getMenuEntries = () => {
2407
2407
  return [{
2408
- id: 'enable',
2409
- label: enable(),
2408
+ command: 'SearchExtensions.enable',
2410
2409
  flags: None$1,
2411
- command: 'SearchExtensions.enable'
2410
+ id: 'enable',
2411
+ label: enable()
2412
2412
  }, {
2413
- id: 'disable',
2414
- label: disable(),
2413
+ command: 'SearchExtensions.disable',
2415
2414
  flags: None$1,
2416
- command: 'SearchExtensions.disable'
2415
+ id: 'disable',
2416
+ label: disable()
2417
2417
  }, {
2418
- id: 'installAnotherVersion',
2419
- label: installAnotherVersion(),
2418
+ command: 'SearchExtensions.installAnotherVersion',
2420
2419
  flags: None$1,
2421
- command: 'SearchExtensions.installAnotherVersion'
2420
+ id: 'installAnotherVersion',
2421
+ label: installAnotherVersion()
2422
2422
  }, {
2423
- id: 'copy',
2424
- label: copy(),
2423
+ command: 'Extensions.copyExtensionInfo',
2425
2424
  flags: None$1,
2426
- command: 'Extensions.copyExtensionInfo'
2425
+ id: 'copy',
2426
+ label: copy()
2427
2427
  }, {
2428
- id: 'copyExtensionId',
2429
- label: copyExtensionId$1(),
2428
+ command: 'Extensions.copyExtensionId',
2430
2429
  flags: None$1,
2431
- command: 'Extensions.copyExtensionId'
2430
+ id: 'copyExtensionId',
2431
+ label: copyExtensionId$1()
2432
2432
  }];
2433
2433
  };
2434
2434
 
@@ -2453,10 +2453,9 @@ const getExtensionDetailUri = extensionId => {
2453
2453
 
2454
2454
  const {
2455
2455
  invoke: invoke$1,
2456
- set: set$1,
2457
2456
  openUri: openUri$1,
2458
- sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1
2459
- } = RendererWorker;
2457
+ sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
2458
+ set: set$1} = RendererWorker;
2460
2459
 
2461
2460
  const openUri = async uri => {
2462
2461
  return openUri$1(uri);
@@ -2503,11 +2502,11 @@ const handleClickAt = async (state, button, eventX, eventY) => {
2503
2502
  return state;
2504
2503
  }
2505
2504
  const {
2506
- x,
2507
- y,
2508
- itemHeight,
2509
2505
  deltaY,
2510
- headerHeight
2506
+ headerHeight,
2507
+ itemHeight,
2508
+ x,
2509
+ y
2511
2510
  } = state;
2512
2511
  const index = getListIndex(eventX, eventY, x, y, deltaY, itemHeight, headerHeight);
2513
2512
  return handleClick(state, index);
@@ -2566,8 +2565,8 @@ const handleHeaderContextMenu = async state => {
2566
2565
 
2567
2566
  const handleInput = async (state, value, inputSource = User) => {
2568
2567
  return handleChange(state, {
2569
- searchValue: value,
2570
- inputSource
2568
+ inputSource,
2569
+ searchValue: value
2571
2570
  });
2572
2571
  };
2573
2572
 
@@ -2589,21 +2588,21 @@ const getNewDeltaPercent = (height, scrollBarHeight, relativeY) => {
2589
2588
  if (relativeY <= halfScrollBarHeight) {
2590
2589
  // clicked at top
2591
2590
  return {
2592
- percent: 0,
2593
- handleOffset: relativeY
2591
+ handleOffset: relativeY,
2592
+ percent: 0
2594
2593
  };
2595
2594
  }
2596
2595
  if (relativeY <= height - halfScrollBarHeight) {
2597
2596
  // clicked in middle
2598
2597
  return {
2599
- percent: (relativeY - halfScrollBarHeight) / (height - scrollBarHeight),
2600
- handleOffset: halfScrollBarHeight
2598
+ handleOffset: halfScrollBarHeight,
2599
+ percent: (relativeY - halfScrollBarHeight) / (height - scrollBarHeight)
2601
2600
  };
2602
2601
  }
2603
2602
  // clicked at bottom
2604
2603
  return {
2605
- percent: 1,
2606
- handleOffset: scrollBarHeight - height + relativeY
2604
+ handleOffset: scrollBarHeight - height + relativeY,
2605
+ percent: 1
2607
2606
  };
2608
2607
  };
2609
2608
 
@@ -2618,11 +2617,11 @@ const setDeltaY = (state, value) => {
2618
2617
  object(state);
2619
2618
  number(value);
2620
2619
  const {
2621
- itemHeight,
2622
- finalDeltaY,
2623
2620
  deltaY,
2624
- height,
2621
+ finalDeltaY,
2625
2622
  headerHeight,
2623
+ height,
2624
+ itemHeight,
2626
2625
  items,
2627
2626
  minimumSliderSize
2628
2627
  } = state;
@@ -2641,8 +2640,8 @@ const setDeltaY = (state, value) => {
2641
2640
  return {
2642
2641
  ...state,
2643
2642
  deltaY: newDeltaY,
2644
- minLineY,
2645
2643
  maxLineY,
2644
+ minLineY,
2646
2645
  scrollBarY
2647
2646
  };
2648
2647
  };
@@ -2650,12 +2649,12 @@ const setDeltaY = (state, value) => {
2650
2649
  const handleScrollBarClick = (state, eventY) => {
2651
2650
  // TODO move this to list
2652
2651
  const {
2653
- y,
2654
2652
  deltaY,
2655
- headerHeight,
2656
2653
  finalDeltaY,
2654
+ headerHeight,
2655
+ height,
2657
2656
  scrollBarHeight,
2658
- height
2657
+ y
2659
2658
  } = state;
2660
2659
  const contentHeight = height - headerHeight;
2661
2660
  const relativeY = eventY - y - headerHeight;
@@ -2669,8 +2668,8 @@ const handleScrollBarClick = (state, eventY) => {
2669
2668
  };
2670
2669
  }
2671
2670
  const {
2672
- percent,
2673
- handleOffset
2671
+ handleOffset,
2672
+ percent
2674
2673
  } = getNewDeltaPercent(contentHeight, scrollBarHeight, relativeY);
2675
2674
  const newDeltaY = percent * finalDeltaY;
2676
2675
  return {
@@ -2690,12 +2689,12 @@ const getNewPercent = (contentHeight, scrollBarHeight, relativeY) => {
2690
2689
  };
2691
2690
  const handleScrollBarMove = (state, eventY) => {
2692
2691
  const {
2693
- y,
2694
- headerHeight,
2695
- handleOffset,
2696
2692
  finalDeltaY,
2693
+ handleOffset,
2694
+ headerHeight,
2697
2695
  height,
2698
- scrollBarHeight
2696
+ scrollBarHeight,
2697
+ y
2699
2698
  } = state;
2700
2699
  const relativeY = eventY - y - headerHeight - handleOffset;
2701
2700
  const contentHeight = height - headerHeight;
@@ -2732,8 +2731,9 @@ const createExtensionHostWorkerRpc = async () => {
2732
2731
  };
2733
2732
 
2734
2733
  const {
2735
- set,
2736
- invoke} = ExtensionHost;
2734
+ invoke,
2735
+ set
2736
+ } = ExtensionHost;
2737
2737
 
2738
2738
  const initializeExtensionHostWorker = async () => {
2739
2739
  const rpc = await createExtensionHostWorkerRpc();
@@ -2875,13 +2875,13 @@ const getPublisher = extension => {
2875
2875
 
2876
2876
  const normalizeExtension$1 = (extension, platform, assetDir) => {
2877
2877
  return {
2878
+ categories: getCategories(extension),
2879
+ description: getDescription(extension),
2880
+ icon: getIcon(extension, platform, assetDir),
2878
2881
  id: getId$1(extension),
2879
2882
  name: getName(extension),
2880
- description: getDescription(extension),
2881
- uri: '',
2882
2883
  publisher: getPublisher(extension),
2883
- icon: getIcon(extension, platform, assetDir),
2884
- categories: getCategories(extension)
2884
+ uri: ''
2885
2885
  };
2886
2886
  };
2887
2887
 
@@ -2910,20 +2910,20 @@ const restoreState = savedState => {
2910
2910
  const searchValue = getSavedValue(savedState);
2911
2911
  const savedDeltaY = getSavedDeltaY(savedState);
2912
2912
  return {
2913
- searchValue,
2914
- deltaY: savedDeltaY
2913
+ deltaY: savedDeltaY,
2914
+ searchValue
2915
2915
  };
2916
2916
  };
2917
2917
 
2918
2918
  const loadContent = async (state, savedState) => {
2919
2919
  const {
2920
- width,
2920
+ assetDir,
2921
2921
  platform,
2922
- assetDir
2922
+ width
2923
2923
  } = state;
2924
2924
  const {
2925
- searchValue,
2926
- deltaY
2925
+ deltaY,
2926
+ searchValue
2927
2927
  } = restoreState(savedState);
2928
2928
  // TODO just get local extensions on demand (not when query string is already different)
2929
2929
  const allExtensions = await getAllExtensions(platform);
@@ -2932,9 +2932,9 @@ const loadContent = async (state, savedState) => {
2932
2932
  const updatedState = await handleInput({
2933
2933
  ...state,
2934
2934
  allExtensions: normalized,
2935
- size,
2935
+ deltaY,
2936
2936
  inputSource: Script,
2937
- deltaY
2937
+ size
2938
2938
  }, searchValue, Script);
2939
2939
  return updatedState;
2940
2940
  };
@@ -2957,8 +2957,8 @@ const getSelector = focus => {
2957
2957
  };
2958
2958
  const renderFocus = newState => {
2959
2959
  const {
2960
- uid,
2961
- focus
2960
+ focus,
2961
+ uid
2962
2962
  } = newState;
2963
2963
  if (!focus) {
2964
2964
  return [];
@@ -3022,56 +3022,56 @@ const getClassName$1 = enabled => {
3022
3022
  };
3023
3023
  const getSearchFieldButtonVirtualDom = button => {
3024
3024
  const {
3025
- icon,
3026
- title,
3027
3025
  enabled,
3028
- onClick
3026
+ icon,
3027
+ onClick,
3028
+ title
3029
3029
  } = button;
3030
3030
  return [{
3031
- type: Button$2,
3031
+ childCount: 1,
3032
3032
  className: getClassName$1(enabled),
3033
- title,
3033
+ onClick,
3034
3034
  tabIndex: 0,
3035
- childCount: 1,
3036
- onClick
3035
+ title,
3036
+ type: Button$2
3037
3037
  }, {
3038
- type: Div,
3038
+ childCount: 0,
3039
3039
  className: mergeClassNames(MaskIcon, icon),
3040
- childCount: 0
3040
+ type: Div
3041
3041
  }];
3042
3042
  };
3043
3043
 
3044
3044
  const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, outsideButtons, onFocus = '') => {
3045
3045
  // TODO avoid mutation
3046
3046
  const dom = [{
3047
- type: Div,
3047
+ childCount: 2,
3048
3048
  className: SearchField,
3049
3049
  role: None,
3050
- childCount: 2
3050
+ type: Div
3051
3051
  }, {
3052
- type: Input$1,
3053
- inputType: 'search',
3054
- className: MultilineInputBox,
3055
- spellcheck: false,
3056
3052
  autocapitalize: 'off',
3057
- autocorrect: 'off',
3058
3053
  autocomplete: 'off',
3059
- placeholder,
3054
+ autocorrect: 'off',
3055
+ childCount: 0,
3056
+ className: MultilineInputBox,
3057
+ inputType: 'search',
3060
3058
  name,
3061
- onInput,
3062
3059
  onFocus,
3063
- childCount: 0
3060
+ onInput,
3061
+ placeholder,
3062
+ spellcheck: false,
3063
+ type: Input$1
3064
3064
  }, {
3065
- type: Div,
3065
+ childCount: insideButtons.length,
3066
3066
  className: SearchFieldButtons,
3067
- childCount: insideButtons.length
3067
+ type: Div
3068
3068
  }, ...insideButtons.flatMap(getSearchFieldButtonVirtualDom)];
3069
3069
  if (outsideButtons.length > 0) {
3070
3070
  dom.unshift({
3071
- type: Div,
3071
+ childCount: 1 + outsideButtons.length,
3072
3072
  className: SearchFieldContainer,
3073
3073
  role: None,
3074
- childCount: 1 + outsideButtons.length
3074
+ type: Div
3075
3075
  });
3076
3076
  dom.push(...outsideButtons.flatMap(getSearchFieldButtonVirtualDom));
3077
3077
  }
@@ -3079,10 +3079,10 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
3079
3079
  };
3080
3080
 
3081
3081
  const parentNode = {
3082
- type: Div,
3083
- className: ExtensionHeader,
3084
3082
  childCount: 1,
3085
- onContextMenu: HandleHeaderContextMenu
3083
+ className: ExtensionHeader,
3084
+ onContextMenu: HandleHeaderContextMenu,
3085
+ type: Div
3086
3086
  };
3087
3087
  const getExtensionHeaderVirtualDom = (placeholder, actions) => {
3088
3088
  return [parentNode, ...getSearchFieldVirtualDom(Extensions$1, placeholder, HandleExtensionsInput, actions, [])];
@@ -3097,29 +3097,29 @@ const renderHeader = newState => {
3097
3097
  const Extension = 'Extension';
3098
3098
 
3099
3099
  const listItemDetail = {
3100
- type: Div,
3100
+ childCount: 3,
3101
3101
  className: ExtensionListItemDetail,
3102
- childCount: 3
3102
+ type: Div
3103
3103
  };
3104
3104
  const listItemName = {
3105
- type: Div,
3105
+ childCount: 1,
3106
3106
  className: ExtensionListItemName,
3107
- childCount: 1
3107
+ type: Div
3108
3108
  };
3109
3109
  const listItemDescription = {
3110
- type: Div,
3110
+ childCount: 1,
3111
3111
  className: ExtensionListItemDescription,
3112
- childCount: 1
3112
+ type: Div
3113
3113
  };
3114
3114
  const listItemFooter = {
3115
- type: Div,
3115
+ childCount: 2,
3116
3116
  className: ExtensionListItemFooter,
3117
- childCount: 2
3117
+ type: Div
3118
3118
  };
3119
3119
  const listItemAuthorName = {
3120
- type: Div,
3120
+ childCount: 1,
3121
3121
  className: ExtensionListItemAuthorName,
3122
- childCount: 1
3122
+ type: Div
3123
3123
  };
3124
3124
  const getClassName = focused => {
3125
3125
  if (focused) {
@@ -3135,46 +3135,44 @@ const getId = focused => {
3135
3135
  };
3136
3136
  const getExtensionListItemVirtualDom = extension => {
3137
3137
  const {
3138
- posInSet,
3139
- setSize,
3140
- top,
3138
+ description,
3139
+ focused,
3141
3140
  icon,
3142
3141
  name,
3143
- description,
3142
+ posInSet,
3144
3143
  publisher,
3145
- focused
3144
+ setSize,
3145
+ top
3146
3146
  } = extension;
3147
3147
  const dom = [{
3148
- type: Div,
3149
- role: ListItem,
3148
+ ariaPosInSet: posInSet,
3150
3149
  ariaRoleDescription: Extension,
3150
+ ariaSetSize: setSize,
3151
+ childCount: 2,
3151
3152
  className: getClassName(focused),
3152
3153
  id: getId(focused),
3153
- ariaPosInSet: posInSet,
3154
- ariaSetSize: setSize,
3154
+ role: ListItem,
3155
3155
  top,
3156
- childCount: 2
3156
+ type: Div
3157
3157
  }, {
3158
- type: Img,
3159
- src: icon,
3158
+ childCount: 0,
3160
3159
  className: ExtensionListItemIcon,
3161
3160
  role: None,
3162
- childCount: 0
3161
+ src: icon,
3162
+ type: Img
3163
3163
  }, listItemDetail, listItemName, text(name), listItemDescription, text(description), listItemFooter, listItemAuthorName, text(publisher), {
3164
- type: Div,
3164
+ childCount: 0,
3165
3165
  className: ExtensionActions,
3166
- childCount: 0
3166
+ type: Div
3167
3167
  }];
3168
3168
  return dom;
3169
3169
  };
3170
3170
 
3171
3171
  const getExtensionsListVirtualDom = visibleExtensions => {
3172
3172
  const dom = [{
3173
- type: Div,
3174
- className: ListItems,
3175
- tabIndex: 0,
3176
3173
  ariaLabel: extensions(),
3177
- role: List,
3174
+ childCount: visibleExtensions.length,
3175
+ className: ListItems,
3178
3176
  onContextmenu: HandleContextMenu,
3179
3177
  onContextMenu: HandleContextMenu,
3180
3178
  onFocus: HandleFocus,
@@ -3183,7 +3181,9 @@ const getExtensionsListVirtualDom = visibleExtensions => {
3183
3181
  onTouchMove: HandleTouchMove,
3184
3182
  onTouchStart: HandleTouchStart,
3185
3183
  onWheel: HandleWheel,
3186
- childCount: visibleExtensions.length
3184
+ role: List,
3185
+ tabIndex: 0,
3186
+ type: Div
3187
3187
  }, ...visibleExtensions.flatMap(getExtensionListItemVirtualDom)];
3188
3188
  return dom;
3189
3189
  };
@@ -3210,50 +3210,50 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarTop) => {
3210
3210
  const heightString = px(scrollBarHeight);
3211
3211
  const translateString = position(0, scrollBarTop);
3212
3212
  return [{
3213
- type: Div,
3213
+ childCount: 1,
3214
3214
  className: mergeClassNames(ScrollBar, ScrollBarSmall),
3215
3215
  onPointerDown: HandleScrollBarPointerDown,
3216
3216
  // TODO support pointercapture event
3217
- childCount: 1
3217
+ type: Div
3218
3218
  }, {
3219
- type: Div,
3220
- className: ScrollBarThumb,
3221
3219
  childCount: 0,
3220
+ className: ScrollBarThumb,
3222
3221
  height: heightString,
3223
- translate: translateString
3222
+ translate: translateString,
3223
+ type: Div
3224
3224
  }];
3225
3225
  };
3226
3226
 
3227
3227
  const getVisibleItem = (item, setSize, itemHeight, minLineY, relative, i, focusedIndex) => {
3228
3228
  // TODO use normal parameters
3229
3229
  const {
3230
- publisher,
3231
3230
  description,
3232
3231
  icon,
3233
3232
  id,
3234
- name
3233
+ name,
3234
+ publisher
3235
3235
  } = item;
3236
3236
  return {
3237
- setSize,
3238
- posInSet: i + 1,
3239
- top: (i - minLineY) * itemHeight - relative,
3240
- focused: i === focusedIndex,
3241
- publisher,
3242
3237
  description,
3238
+ focused: i === focusedIndex,
3243
3239
  icon,
3244
3240
  id,
3245
- name
3241
+ name,
3242
+ posInSet: i + 1,
3243
+ publisher,
3244
+ setSize,
3245
+ top: (i - minLineY) * itemHeight - relative
3246
3246
  };
3247
3247
  };
3248
3248
 
3249
3249
  const getVisible = state => {
3250
3250
  const {
3251
- minLineY,
3252
- maxLineY,
3253
- items,
3254
- itemHeight,
3255
3251
  deltaY,
3256
- focusedIndex
3252
+ focusedIndex,
3253
+ itemHeight,
3254
+ items,
3255
+ maxLineY,
3256
+ minLineY
3257
3257
  } = state;
3258
3258
  const setSize = items.length;
3259
3259
  const visible = [];
@@ -3268,32 +3268,32 @@ const getVisible = state => {
3268
3268
  const getContentVirtualDom = (visibleExtensions, message, scrollBarHeight, scrollBarY) => {
3269
3269
  if (message) {
3270
3270
  return [{
3271
- type: Div,
3272
- childCount: 1
3271
+ childCount: 1,
3272
+ type: Div
3273
3273
  }, text(message)];
3274
3274
  }
3275
3275
  return [{
3276
- type: Div,
3276
+ childCount: 2,
3277
3277
  className: mergeClassNames(Viewlet, List$1),
3278
- childCount: 2
3278
+ type: Div
3279
3279
  }, ...getExtensionsVirtualDom(visibleExtensions), ...getScrollBarVirtualDom(scrollBarHeight, scrollBarY)];
3280
3280
  };
3281
3281
  const getExtensionsViewVirtualDom = state => {
3282
3282
  const visibleExtensions = getVisible(state);
3283
3283
  const {
3284
- placeholder,
3285
3284
  inputActions,
3286
3285
  message,
3286
+ placeholder,
3287
3287
  scrollBarHeight,
3288
3288
  scrollBarY
3289
3289
  } = state;
3290
3290
  return [{
3291
- type: Div,
3292
- className: mergeClassNames(Viewlet, Extensions),
3293
- childCount: 2,
3294
- ariaLive: 'polite',
3295
3291
  ariaBusy: false,
3296
- role: None$3
3292
+ ariaLive: 'polite',
3293
+ childCount: 2,
3294
+ className: mergeClassNames(Viewlet, Extensions),
3295
+ role: None$3,
3296
+ type: Div
3297
3297
  }, ...getExtensionHeaderVirtualDom(placeholder, inputActions), ...getContentVirtualDom(visibleExtensions, message, scrollBarHeight, scrollBarY)];
3298
3298
  };
3299
3299
 
@@ -3331,6 +3331,12 @@ const renderSearchValue = newState => {
3331
3331
 
3332
3332
  const getRenderer = diffType => {
3333
3333
  switch (diffType) {
3334
+ case RenderFocus:
3335
+ return renderFocus;
3336
+ case RenderFocusContext:
3337
+ return renderFocusContext;
3338
+ case RenderHeader:
3339
+ return renderHeader;
3334
3340
  case RenderItems:
3335
3341
  return renderItems2;
3336
3342
  case RenderMessage:
@@ -3339,12 +3345,6 @@ const getRenderer = diffType => {
3339
3345
  return renderScrollBar;
3340
3346
  case RenderSearchValue:
3341
3347
  return renderSearchValue;
3342
- case RenderHeader:
3343
- return renderHeader;
3344
- case RenderFocus:
3345
- return renderFocus;
3346
- case RenderFocusContext:
3347
- return renderFocusContext;
3348
3348
  default:
3349
3349
  throw new Error('unknown renderer');
3350
3350
  }
@@ -3361,8 +3361,8 @@ const applyRender = (oldState, newState, diffResult) => {
3361
3361
 
3362
3362
  const render3 = (uid, diffResult) => {
3363
3363
  const {
3364
- oldState,
3365
- newState
3364
+ newState,
3365
+ oldState
3366
3366
  } = get(uid);
3367
3367
  set$2(uid, newState, newState);
3368
3368
  const commands = applyRender(oldState, newState, diffResult);
@@ -3371,23 +3371,23 @@ const render3 = (uid, diffResult) => {
3371
3371
 
3372
3372
  const getIconVirtualDom = (icon, type = Div) => {
3373
3373
  return {
3374
- type,
3374
+ childCount: 0,
3375
3375
  className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
3376
3376
  role: None,
3377
- childCount: 0
3377
+ type
3378
3378
  };
3379
3379
  };
3380
3380
 
3381
3381
  const getActionButtonVirtualDom = action => {
3382
3382
  const {
3383
- id,
3384
- icon
3383
+ icon,
3384
+ id
3385
3385
  } = action;
3386
3386
  return [{
3387
- type: Button$2,
3387
+ childCount: 1,
3388
3388
  className: IconButton,
3389
3389
  title: id,
3390
- childCount: 1
3390
+ type: Button$2
3391
3391
  }, getIconVirtualDom(icon)];
3392
3392
  };
3393
3393
 
@@ -3402,17 +3402,17 @@ const getActionVirtualDom = action => {
3402
3402
 
3403
3403
  const getActionsVirtualDom = actions => {
3404
3404
  return [{
3405
- type: Div,
3405
+ childCount: actions.length,
3406
3406
  className: Actions,
3407
3407
  role: ToolBar,
3408
- childCount: actions.length
3408
+ type: Div
3409
3409
  }, ...actions.flatMap(getActionVirtualDom)];
3410
3410
  };
3411
3411
 
3412
3412
  const renderActions = uid => {
3413
3413
  const {
3414
- oldState,
3415
- newState
3414
+ newState,
3415
+ oldState
3416
3416
  } = get(uid);
3417
3417
  if (oldState === newState) {
3418
3418
  return [];
@@ -3467,16 +3467,16 @@ const renderEventListeners = () => {
3467
3467
 
3468
3468
  const resize = async (state, dimensions) => {
3469
3469
  const {
3470
- items,
3471
- itemHeight,
3472
3470
  headerHeight,
3471
+ itemHeight,
3472
+ items,
3473
3473
  minimumSliderSize
3474
3474
  } = state;
3475
3475
  const {
3476
- x,
3477
- y,
3476
+ height,
3478
3477
  width,
3479
- height
3478
+ x,
3479
+ y
3480
3480
  } = dimensions;
3481
3481
  const total = items.length;
3482
3482
  const listHeight = getListHeight(total, itemHeight, height);
@@ -3501,19 +3501,19 @@ const resize = async (state, dimensions) => {
3501
3501
 
3502
3502
  const saveState = state => {
3503
3503
  const {
3504
- searchValue,
3505
- deltaY
3504
+ deltaY,
3505
+ searchValue
3506
3506
  } = state;
3507
3507
  return {
3508
- searchValue,
3509
- deltaY
3508
+ deltaY,
3509
+ searchValue
3510
3510
  };
3511
3511
  };
3512
3512
 
3513
3513
  const scrollDown = state => {
3514
3514
  const {
3515
- finalDeltaY,
3516
- deltaY
3515
+ deltaY,
3516
+ finalDeltaY
3517
3517
  } = state;
3518
3518
  const newDeltaY = Math.min(deltaY + 20, finalDeltaY);
3519
3519
  return setDeltaY(state, newDeltaY);
@@ -3541,9 +3541,7 @@ const commandMap = {
3541
3541
  'SearchExtensions.focusFirst': wrapCommand(focusFirst),
3542
3542
  'SearchExtensions.focusIndex': wrapCommand(focusIndex),
3543
3543
  'SearchExtensions.focusLast': wrapCommand(focusLast),
3544
- 'SearchExtensions.getMenuEntries2': wrapGetter(getMenuEntries2),
3545
3544
  'SearchExtensions.focusNext': wrapCommand(focusNext),
3546
- 'SearchExtensions.handleHeaderContextMenu': wrapCommand(handleHeaderContextMenu),
3547
3545
  'SearchExtensions.focusNextPage': wrapCommand(focusNextPage),
3548
3546
  'SearchExtensions.focusPrevious': wrapCommand(focusPrevious),
3549
3547
  'SearchExtensions.focusPreviousPage': wrapCommand(focusPreviousPage),
@@ -3551,6 +3549,8 @@ const commandMap = {
3551
3549
  'SearchExtensions.getCommandIds': getCommandIds,
3552
3550
  'SearchExtensions.getKeyBindings': getKeyBindings,
3553
3551
  'SearchExtensions.getMenuEntries': getMenuEntries,
3552
+ 'SearchExtensions.getMenuEntries2': wrapGetter(getMenuEntries2),
3553
+ 'SearchExtensions.getMenuIds': getMenuIds,
3554
3554
  'SearchExtensions.handleBlur': wrapCommand(handleBlur),
3555
3555
  'SearchExtensions.handleClick': wrapCommand(handleClick),
3556
3556
  'SearchExtensions.handleClickAt': wrapCommand(handleClickAt),
@@ -3560,6 +3560,7 @@ const commandMap = {
3560
3560
  'SearchExtensions.handleDisable': wrapCommand(handleDisable),
3561
3561
  'SearchExtensions.handleEnable': wrapCommand(handleEnable),
3562
3562
  'SearchExtensions.handleFocus': wrapCommand(handleFocus),
3563
+ 'SearchExtensions.handleHeaderContextMenu': wrapCommand(handleHeaderContextMenu),
3563
3564
  'SearchExtensions.handleInput': wrapCommand(handleInput),
3564
3565
  'SearchExtensions.handleInstall': wrapCommand(handleInstall),
3565
3566
  'SearchExtensions.handleScrollBarCaptureLost': wrapCommand(handleScrollBarCaptureLost),
@@ -3574,6 +3575,7 @@ const commandMap = {
3574
3575
  'SearchExtensions.render3': render3,
3575
3576
  'SearchExtensions.renderActions': renderActions,
3576
3577
  'SearchExtensions.renderEventListeners': renderEventListeners,
3578
+ 'SearchExtensions.resize': wrapCommand(resize),
3577
3579
  'SearchExtensions.restoreState': restoreState,
3578
3580
  'SearchExtensions.saveState': wrapGetter(saveState),
3579
3581
  'SearchExtensions.scrollDown': wrapCommand(scrollDown),
@@ -3581,9 +3583,7 @@ const commandMap = {
3581
3583
  'SearchExtensions.selectIndex': wrapCommand(selectIndex),
3582
3584
  'SearchExtensions.setDeltaY': wrapCommand(setDeltaY),
3583
3585
  'SearchExtensions.terminate': terminate,
3584
- 'SearchExtensions.toggleSuggest': wrapCommand(toggleSuggest),
3585
- 'SearchExtensions.resize': wrapCommand(resize),
3586
- 'SearchExtensions.getMenuIds': getMenuIds
3586
+ 'SearchExtensions.toggleSuggest': wrapCommand(toggleSuggest)
3587
3587
  };
3588
3588
 
3589
3589
  const listen = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-search-view",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "Extension Search View Worker",
5
5
  "repository": {
6
6
  "type": "git",