@lvce-editor/extension-search-view 7.13.0 → 7.13.2

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.
@@ -1014,6 +1014,34 @@ const listen$1 = async (module, options) => {
1014
1014
  return ipc;
1015
1015
  };
1016
1016
 
1017
+ const createSharedLazyRpc = factory => {
1018
+ let rpcPromise;
1019
+ const getOrCreate = () => {
1020
+ if (!rpcPromise) {
1021
+ rpcPromise = factory();
1022
+ }
1023
+ return rpcPromise;
1024
+ };
1025
+ return {
1026
+ async dispose() {
1027
+ const rpc = await getOrCreate();
1028
+ await rpc.dispose();
1029
+ },
1030
+ async invoke(method, ...params) {
1031
+ const rpc = await getOrCreate();
1032
+ return rpc.invoke(method, ...params);
1033
+ },
1034
+ async invokeAndTransfer(method, ...params) {
1035
+ const rpc = await getOrCreate();
1036
+ return rpc.invokeAndTransfer(method, ...params);
1037
+ },
1038
+ async send(method, ...params) {
1039
+ const rpc = await getOrCreate();
1040
+ rpc.send(method, ...params);
1041
+ }
1042
+ };
1043
+ };
1044
+
1017
1045
  const create$7 = async ({
1018
1046
  commandMap,
1019
1047
  isMessagePortOpen = true,
@@ -1049,34 +1077,6 @@ const create$6 = async ({
1049
1077
  });
1050
1078
  };
1051
1079
 
1052
- const createSharedLazyRpc = factory => {
1053
- let rpcPromise;
1054
- const getOrCreate = () => {
1055
- if (!rpcPromise) {
1056
- rpcPromise = factory();
1057
- }
1058
- return rpcPromise;
1059
- };
1060
- return {
1061
- async dispose() {
1062
- const rpc = await getOrCreate();
1063
- await rpc.dispose();
1064
- },
1065
- async invoke(method, ...params) {
1066
- const rpc = await getOrCreate();
1067
- return rpc.invoke(method, ...params);
1068
- },
1069
- async invokeAndTransfer(method, ...params) {
1070
- const rpc = await getOrCreate();
1071
- return rpc.invokeAndTransfer(method, ...params);
1072
- },
1073
- async send(method, ...params) {
1074
- const rpc = await getOrCreate();
1075
- rpc.send(method, ...params);
1076
- }
1077
- };
1078
- };
1079
-
1080
1080
  const create$5 = async ({
1081
1081
  commandMap,
1082
1082
  isMessagePortOpen,
@@ -1123,7 +1123,7 @@ const createMockRpc = ({
1123
1123
  };
1124
1124
 
1125
1125
  const rpcs = Object.create(null);
1126
- const set$6 = (id, rpc) => {
1126
+ const set$4 = (id, rpc) => {
1127
1127
  rpcs[id] = rpc;
1128
1128
  };
1129
1129
  const get$1 = id => {
@@ -1156,7 +1156,7 @@ const create$3 = rpcId => {
1156
1156
  const mockRpc = createMockRpc({
1157
1157
  commandMap
1158
1158
  });
1159
- set$6(rpcId, mockRpc);
1159
+ set$4(rpcId, mockRpc);
1160
1160
  // @ts-ignore
1161
1161
  mockRpc[Symbol.dispose] = () => {
1162
1162
  remove(rpcId);
@@ -1165,7 +1165,7 @@ const create$3 = rpcId => {
1165
1165
  return mockRpc;
1166
1166
  },
1167
1167
  set(rpc) {
1168
- set$6(rpcId, rpc);
1168
+ set$4(rpcId, rpc);
1169
1169
  }
1170
1170
  };
1171
1171
  };
@@ -1358,7 +1358,6 @@ const ExtensionSearchFilter = 95;
1358
1358
  const LeftClick = 0;
1359
1359
 
1360
1360
  const DialogWorker = 7014;
1361
- const ExtensionHostWorker = 44;
1362
1361
  const ExtensionManagementWorker = 9006;
1363
1362
  const RendererWorker = 1;
1364
1363
 
@@ -1369,27 +1368,21 @@ const SetPatches = 'Viewlet.setPatches';
1369
1368
 
1370
1369
  const {
1371
1370
  invoke: invoke$2,
1372
- set: set$5
1371
+ set: set$3
1373
1372
  } = create$3(DialogWorker);
1374
1373
 
1375
- const {
1376
- set: set$4
1377
- } = create$3(ExtensionHostWorker);
1378
-
1379
- const ExtensionHost = {
1380
- __proto__: null,
1381
- set: set$4
1382
- };
1383
-
1384
1374
  const {
1385
1375
  invoke: invoke$1,
1386
- set: set$3
1376
+ set: set$2
1387
1377
  } = create$3(ExtensionManagementWorker);
1378
+ const disableWorkspace$2 = id => {
1379
+ return invoke$1('Extensions.disableWorkspace', id);
1380
+ };
1388
1381
 
1389
1382
  const {
1390
1383
  invoke,
1391
1384
  invokeAndTransfer,
1392
- set: set$2
1385
+ set: set$1
1393
1386
  } = create$3(RendererWorker);
1394
1387
  const showContextMenu2 = async (uid, menuId, x, y, args) => {
1395
1388
  number(uid);
@@ -1408,10 +1401,6 @@ const disableExtension = async id => {
1408
1401
  const enableExtension = async id => {
1409
1402
  return invoke('ExtensionManagement.enable', id);
1410
1403
  };
1411
- const sendMessagePortToExtensionHostWorker$1 = async (port, rpcId = 0) => {
1412
- const command = 'HandleMessagePort.handleMessagePort2';
1413
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
1414
- };
1415
1404
  const writeClipBoardText = async text => {
1416
1405
  await invoke('ClipBoard.writeText', /* text */text);
1417
1406
  };
@@ -1420,7 +1409,11 @@ const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
1420
1409
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
1421
1410
  };
1422
1411
  const openUri$1 = async (uri, focus, options) => {
1423
- await invoke('Main.openUri', uri, focus, options);
1412
+ await invoke('Main.openUri', {
1413
+ ...options,
1414
+ focus,
1415
+ uri
1416
+ });
1424
1417
  };
1425
1418
  const showErrorDialog = async errorInfo => {
1426
1419
  await invoke('ErrorHandling.showErrorDialog', errorInfo);
@@ -1682,8 +1675,9 @@ const None$2 = 0;
1682
1675
  const Input = 1;
1683
1676
  const List$2 = 2;
1684
1677
 
1678
+ const RE_WHITESPACE$1 = /\s/;
1685
1679
  const isWhiteSpace = character => {
1686
- return /\s/.test(character);
1680
+ return RE_WHITESPACE$1.test(character);
1687
1681
  };
1688
1682
  const getCompletionRange = (value, cursorOffset) => {
1689
1683
  const offset = Math.min(Math.max(cursorOffset, 0), value.length);
@@ -2030,6 +2024,7 @@ const Recommended = '@recommended';
2030
2024
  const WorkspaceUnsupported = '@workspaceunsupported';
2031
2025
  const Deprecated = '@deprecated';
2032
2026
 
2027
+ const RE_LEADING_COLON = /^:/;
2033
2028
  const RE_PARAM = /@[\w-]+(?::\w+)?/g;
2034
2029
  const deserializeCategory = value => {
2035
2030
  if (value.startsWith(':"') && value.endsWith('"')) {
@@ -2078,7 +2073,7 @@ const parseValue = value => {
2078
2073
  sort = 'installs';
2079
2074
  } else {
2080
2075
  // Handle cases like @sort:installs or @sortsize (without colon)
2081
- sort = sortValue.replace(/^:/, '');
2076
+ sort = sortValue.replace(RE_LEADING_COLON, '');
2082
2077
  }
2083
2078
  }
2084
2079
  if (match.startsWith(Id)) {
@@ -2308,8 +2303,9 @@ const handleChange = async (state, update) => {
2308
2303
  const User = 1;
2309
2304
  const Script = 2;
2310
2305
 
2306
+ const RE_WHITESPACE = /\s/;
2311
2307
  const getCompletionText = (searchValue, completion, rangeEnd) => {
2312
- const hasTrailingWhitespace = /\s/.test(searchValue[rangeEnd] || '');
2308
+ const hasTrailingWhitespace = RE_WHITESPACE.test(searchValue[rangeEnd] || '');
2313
2309
  return completion.endsWith(':') || hasTrailingWhitespace ? completion : `${completion} `;
2314
2310
  };
2315
2311
  const acceptCompletionWithContext = async (context, label) => {
@@ -2458,7 +2454,7 @@ const {
2458
2454
  get,
2459
2455
  getCommandIds,
2460
2456
  registerCommands,
2461
- set: set$1,
2457
+ set,
2462
2458
  wrapAsyncCommand,
2463
2459
  wrapCommand,
2464
2460
  wrapGetter
@@ -2505,7 +2501,7 @@ const create = (id, uri, x, y, width, height, platform, assetDir, parentUid) =>
2505
2501
  y
2506
2502
  };
2507
2503
  create$1(id);
2508
- set$1(id, state, state);
2504
+ set(id, state, state);
2509
2505
  };
2510
2506
 
2511
2507
  const isEqual$4 = (oldState, newState) => {
@@ -2549,14 +2545,55 @@ const diff2 = uid => {
2549
2545
  return diff(uid, modules, numbers);
2550
2546
  };
2551
2547
 
2552
- const disable$1 = async (state, _id) => {
2553
- await invoke$2('ConfirmPrompt.prompt', 'not implemented', undefined);
2554
- return state;
2548
+ const Disabled$1 = 'disabled';
2549
+ const Enabled = 'enabled';
2550
+ const Installing = 'installing';
2551
+ const NotInstalled = 'not-installed';
2552
+ const Uninstalling = 'uninstalling';
2553
+ const statuses = [Disabled$1, Enabled, Installing, NotInstalled, Uninstalling];
2554
+ const isExtensionStatus = status => {
2555
+ return statuses.includes(status);
2555
2556
  };
2556
2557
 
2557
- const disableWorkspace = async (state, _id) => {
2558
- await invoke$2('ConfirmPrompt.prompt', 'not implemented', undefined);
2559
- return state;
2558
+ const updateStatus = (extension, id, status, builtin) => {
2559
+ if (extension.id !== id) {
2560
+ return extension;
2561
+ }
2562
+ return {
2563
+ ...extension,
2564
+ builtin: builtin ?? extension.builtin,
2565
+ disabled: status === Disabled$1,
2566
+ status
2567
+ };
2568
+ };
2569
+ const setExtensionStatus = (state, id, status, builtin) => {
2570
+ if (!isExtensionStatus(status)) {
2571
+ throw new TypeError(`Invalid extension status: ${status}`);
2572
+ }
2573
+ return {
2574
+ ...state,
2575
+ allExtensions: state.allExtensions.map(extension => updateStatus(extension, id, status, builtin)),
2576
+ items: state.items.map(extension => updateStatus(extension, id, status, builtin))
2577
+ };
2578
+ };
2579
+
2580
+ const handleDisable = async (state, id) => {
2581
+ const error = await disableExtension(id);
2582
+ return error ? state : setExtensionStatus(state, id, Disabled$1);
2583
+ };
2584
+
2585
+ const disable$1 = async state => {
2586
+ const item = getFocusedItem(state);
2587
+ return item ? handleDisable(state, item.id) : state;
2588
+ };
2589
+
2590
+ const disableWorkspace = async state => {
2591
+ const item = getFocusedItem(state);
2592
+ if (!item) {
2593
+ return state;
2594
+ }
2595
+ await disableWorkspace$2(item.id);
2596
+ return setExtensionStatus(state, item.id, Disabled$1);
2560
2597
  };
2561
2598
 
2562
2599
  const dispose = uid => {
@@ -2564,14 +2601,23 @@ const dispose = uid => {
2564
2601
  dispose$1(uid);
2565
2602
  };
2566
2603
 
2567
- const enable$1 = async (state, _id) => {
2568
- await invoke$2('ConfirmPrompt.prompt', 'not implemented', undefined);
2569
- return state;
2604
+ const handleEnable = async (state, id) => {
2605
+ const error = await enableExtension(id);
2606
+ return error ? state : setExtensionStatus(state, id, Enabled);
2570
2607
  };
2571
2608
 
2572
- const enableWorkspace = async (state, _id) => {
2573
- await invoke$2('ConfirmPrompt.prompt', 'not implemented', undefined);
2574
- return state;
2609
+ const enable$1 = async state => {
2610
+ const item = getFocusedItem(state);
2611
+ return item ? handleEnable(state, item.id) : state;
2612
+ };
2613
+
2614
+ const enableWorkspace = async state => {
2615
+ const item = getFocusedItem(state);
2616
+ if (!item) {
2617
+ return state;
2618
+ }
2619
+ await invoke$1('Extensions.enableWorkspace', item.id);
2620
+ return setExtensionStatus(state, item.id, Enabled);
2575
2621
  };
2576
2622
 
2577
2623
  const CategorySuggestions = ['@category:"ai"', '@category:"azure"', '@category:"chat"', '@category:"data science"', '@category:"debuggers"', '@category:"education"', '@category:"extension packs"', '@category:"formatters"', '@category:"keymaps"', '@category:"language packs"', '@category:"linters"', '@category:"machine learning"', '@category:"notebooks"', '@category:"other"', '@category:"programming languages"', '@category:"scm providers"', '@category:"snippets"', '@category:"testing"', '@category:"themes"', '@category:"visualization"'];
@@ -2635,8 +2681,9 @@ const handleInputWithContext = async (context, value, inputSource = User, cursor
2635
2681
  });
2636
2682
  };
2637
2683
 
2684
+ const RE_WHITESPACE_SEQUENCE = /\s+/;
2638
2685
  const addFilter = (searchValue, filter) => {
2639
- const values = searchValue.trim().split(/\s+/);
2686
+ const values = searchValue.trim().split(RE_WHITESPACE_SEQUENCE);
2640
2687
  if (values.includes(filter)) {
2641
2688
  return searchValue;
2642
2689
  }
@@ -2913,16 +2960,6 @@ const getKeyBindings = () => {
2913
2960
  }];
2914
2961
  };
2915
2962
 
2916
- const Disabled$1 = 'disabled';
2917
- const Enabled = 'enabled';
2918
- const Installing = 'installing';
2919
- const NotInstalled = 'not-installed';
2920
- const Uninstalling = 'uninstalling';
2921
- const statuses = [Disabled$1, Enabled, Installing, NotInstalled, Uninstalling];
2922
- const isExtensionStatus = status => {
2923
- return statuses.includes(status);
2924
- };
2925
-
2926
2963
  const Separator = 1;
2927
2964
  const None$1 = 0;
2928
2965
  const SubMenu = 4;
@@ -2945,12 +2982,12 @@ const getEnablementFlags = (disabled, status) => {
2945
2982
  const getMenuEntriesList = (builtin, disabled = false, status) => {
2946
2983
  const enablementFlags = getEnablementFlags(disabled, status);
2947
2984
  return [{
2948
- command: 'SearchExtensions.enable',
2985
+ command: 'Extensions.enable',
2949
2986
  flags: enablementFlags.enable,
2950
2987
  id: 'enable',
2951
2988
  label: enable$2()
2952
2989
  }, {
2953
- command: 'SearchExtensions.enableWorkspace',
2990
+ command: 'Extensions.enableWorkspace',
2954
2991
  flags: enablementFlags.enable,
2955
2992
  id: 'enableWorkspace',
2956
2993
  label: enableWorkspace$1()
@@ -2960,12 +2997,12 @@ const getMenuEntriesList = (builtin, disabled = false, status) => {
2960
2997
  id: 'separator1',
2961
2998
  label: ''
2962
2999
  }, {
2963
- command: 'SearchExtensions.disable',
3000
+ command: 'Extensions.disable',
2964
3001
  flags: enablementFlags.disable,
2965
3002
  id: 'disable',
2966
3003
  label: disable$2()
2967
3004
  }, {
2968
- command: 'SearchExtensions.disableWorkspace',
3005
+ command: 'Extensions.disableWorkspace',
2969
3006
  flags: enablementFlags.disable,
2970
3007
  id: 'disableWorkspace',
2971
3008
  label: disableWorkspace$1()
@@ -2975,8 +3012,8 @@ const getMenuEntriesList = (builtin, disabled = false, status) => {
2975
3012
  id: 'separator2',
2976
3013
  label: ''
2977
3014
  }, {
2978
- command: 'SearchExtensions.installAnotherVersion',
2979
- flags: builtin ? Disabled : None$1,
3015
+ command: 'Extensions.installAnotherVersion',
3016
+ flags: Disabled,
2980
3017
  id: 'installAnotherVersion',
2981
3018
  label: installAnotherVersion$1()
2982
3019
  }, {
@@ -3226,14 +3263,11 @@ const compareNodes = (oldNode, newNode) => {
3226
3263
  }
3227
3264
  const patches = [];
3228
3265
  // Handle reference nodes - special handling for uid changes
3229
- if (oldNode.type === Reference) {
3230
- if (oldNode.uid !== newNode.uid) {
3231
- patches.push({
3232
- type: SetReferenceNodeUid,
3233
- uid: newNode.uid
3234
- });
3235
- }
3236
- return patches;
3266
+ if (oldNode.type === Reference && oldNode.uid !== newNode.uid) {
3267
+ patches.push({
3268
+ type: SetReferenceNodeUid,
3269
+ uid: newNode.uid
3270
+ });
3237
3271
  }
3238
3272
  // Handle text nodes
3239
3273
  if (oldNode.type === Text && newNode.type === Text) {
@@ -3246,8 +3280,8 @@ const compareNodes = (oldNode, newNode) => {
3246
3280
  return patches;
3247
3281
  }
3248
3282
  // Compare attributes
3249
- const oldKeys = getKeys(oldNode);
3250
- const newKeys = getKeys(newNode);
3283
+ const oldKeys = getKeys(oldNode).filter(key => oldNode.type !== Reference || key !== 'uid');
3284
+ const newKeys = getKeys(newNode).filter(key => newNode.type !== Reference || key !== 'uid');
3251
3285
  // Check for attribute changes
3252
3286
  for (const key of newKeys) {
3253
3287
  if (oldNode[key] !== newNode[key]) {
@@ -3271,9 +3305,14 @@ const compareNodes = (oldNode, newNode) => {
3271
3305
  };
3272
3306
 
3273
3307
  const treeToArray = node => {
3274
- const result = [node.node];
3275
- for (const child of node.children) {
3276
- result.push(...treeToArray(child));
3308
+ const result = [];
3309
+ const stack = [node];
3310
+ while (stack.length > 0) {
3311
+ const current = stack.pop();
3312
+ result.push(current.node);
3313
+ for (let i = current.children.length - 1; i >= 0; i--) {
3314
+ stack.push(current.children[i]);
3315
+ }
3277
3316
  }
3278
3317
  return result;
3279
3318
  };
@@ -3483,128 +3522,326 @@ const handleContextMenu = async (state, button, eventX, eventY) => {
3483
3522
  headerHeight,
3484
3523
  itemHeight,
3485
3524
  items,
3525
+ minLineY,
3486
3526
  uid,
3487
3527
  x,
3488
3528
  y
3489
3529
  } = state;
3490
- const index = getListIndex(eventX, eventY, x, y, deltaY, itemHeight, headerHeight);
3491
- if (index < 0 || index > items.length) {
3530
+ const visibleIndex = getListIndex(eventX, eventY, x, y, deltaY, itemHeight, headerHeight);
3531
+ const index = visibleIndex + minLineY;
3532
+ if (index < 0 || index >= items.length) {
3492
3533
  return state;
3493
3534
  }
3535
+ const item = items[index];
3494
3536
  await show2(uid, ManageExtension, eventX, eventY, {
3495
- builtin: items[index]?.builtin === true,
3496
- disabled: items[index]?.disabled === true,
3537
+ builtin: item.builtin === true,
3538
+ disabled: item.disabled === true,
3497
3539
  menuId: ManageExtension,
3498
- status: items[index]?.status
3540
+ status: item.status
3499
3541
  });
3500
- return state;
3501
- };
3502
-
3503
- const updateStatus = (extension, id, status, builtin) => {
3504
- if (extension.id !== id) {
3505
- return extension;
3506
- }
3507
- return {
3508
- ...extension,
3509
- builtin: builtin ?? extension.builtin,
3510
- disabled: status === Disabled$1,
3511
- status
3512
- };
3513
- };
3514
- const setExtensionStatus = (state, id, status, builtin) => {
3515
- if (!isExtensionStatus(status)) {
3516
- throw new TypeError(`Invalid extension status: ${status}`);
3517
- }
3518
3542
  return {
3519
3543
  ...state,
3520
- allExtensions: state.allExtensions.map(extension => updateStatus(extension, id, status, builtin)),
3521
- items: state.items.map(extension => updateStatus(extension, id, status, builtin))
3544
+ focusedIndex: index
3522
3545
  };
3523
3546
  };
3524
3547
 
3525
- const handleDisable = async (state, id) => {
3526
- const error = await disableExtension(id);
3527
- return error ? state : setExtensionStatus(state, id, Disabled$1);
3528
- };
3529
-
3530
3548
  const handleDisableWorkspace = (state, id) => {
3531
3549
  return state;
3532
3550
  };
3533
3551
 
3534
- const handleEnable = async (state, id) => {
3535
- const error = await enableExtension(id);
3536
- return error ? state : setExtensionStatus(state, id, Enabled);
3537
- };
3538
-
3539
3552
  const handleEnableWorkspace = (state, id) => {
3540
3553
  return state;
3541
3554
  };
3542
3555
 
3543
- const handleFocus = async state => {
3544
- return {
3545
- ...state,
3546
- focus: List$2
3547
- };
3548
- };
3556
+ const Web = 1;
3557
+ const Electron = 2;
3558
+ const Remote = 3;
3549
3559
 
3550
- const handleHeaderContextMenu = async state => {
3551
- return state;
3560
+ const getAllExtensions$1 = async (assetDir, platform) => {
3561
+ try {
3562
+ return await invoke$1('Extensions.getAllExtensions', assetDir, platform);
3563
+ } catch (error) {
3564
+ if (platform === Web) {
3565
+ return [];
3566
+ }
3567
+ throw error;
3568
+ }
3552
3569
  };
3553
3570
 
3554
- const handleInputFocus = state => {
3555
- return {
3556
- ...state,
3557
- focus: Input
3558
- };
3571
+ const getAllExtensions = (assetDir, platform) => {
3572
+ return getAllExtensions$1(assetDir, platform);
3559
3573
  };
3560
3574
 
3561
- const handleInstall = async (state, id) => {
3562
- await installExtension(id);
3563
- return setExtensionStatus(state, id, Enabled);
3575
+ const getBuiltin = extension => {
3576
+ return extension !== null && typeof extension === 'object' && 'builtin' in extension && extension.builtin === true;
3564
3577
  };
3565
3578
 
3566
- const handleScrollBarCaptureLost = state => {
3567
- return {
3568
- ...state,
3569
- scrollBarActive: false
3570
- };
3579
+ const isString = item => {
3580
+ return typeof item === 'string';
3571
3581
  };
3572
3582
 
3573
- const getNewDeltaPercent = (height, scrollBarHeight, relativeY) => {
3574
- const halfScrollBarHeight = scrollBarHeight / 2;
3575
- if (relativeY <= halfScrollBarHeight) {
3576
- // clicked at top
3577
- return {
3578
- handleOffset: relativeY,
3579
- percent: 0
3580
- };
3583
+ const getCategories = extension => {
3584
+ if (extension === null || typeof extension !== 'object' || !('categories' in extension) || !Array.isArray(extension.categories)) {
3585
+ return [];
3581
3586
  }
3582
- if (relativeY <= height - halfScrollBarHeight) {
3583
- // clicked in middle
3584
- return {
3585
- handleOffset: halfScrollBarHeight,
3586
- percent: (relativeY - halfScrollBarHeight) / (height - scrollBarHeight)
3587
- };
3587
+ return extension.categories.filter(isString);
3588
+ };
3589
+
3590
+ const getDescription = extension => {
3591
+ if (extension === null || typeof extension !== 'object' || !('description' in extension) || typeof extension.description !== 'string' || !extension.description) {
3592
+ return 'n/a';
3588
3593
  }
3589
- // clicked at bottom
3590
- return {
3591
- handleOffset: scrollBarHeight - height + relativeY,
3592
- percent: 1
3593
- };
3594
+ return extension.description;
3594
3595
  };
3595
3596
 
3596
- const clamp = (num, min, max) => {
3597
- number(num);
3598
- number(min);
3599
- number(max);
3600
- return Math.min(Math.max(num, min), max);
3597
+ const getDisabled = extension => {
3598
+ return extension !== null && typeof extension === 'object' && 'disabled' in extension && extension.disabled === true;
3601
3599
  };
3602
3600
 
3603
- const setDeltaY = (state, value) => {
3604
- object(state);
3605
- number(value);
3606
- const {
3607
- deltaY,
3601
+ const getDownloadCountValue = extension => {
3602
+ if (extension === null || typeof extension !== 'object') {
3603
+ return undefined;
3604
+ }
3605
+ const marketplace = 'marketplace' in extension && extension.marketplace !== null && typeof extension.marketplace === 'object' ? extension.marketplace : {};
3606
+ const packageJson = 'packageJSON' in extension && extension.packageJSON !== null && typeof extension.packageJSON === 'object' ? extension.packageJSON : {};
3607
+ return ('downloadCount' in extension ? extension.downloadCount : undefined) ?? ('downloads' in extension ? extension.downloads : undefined) ?? ('downloadCount' in marketplace ? marketplace.downloadCount : undefined) ?? ('downloads' in marketplace ? marketplace.downloads : undefined) ?? ('downloadCount' in packageJson ? packageJson.downloadCount : undefined) ?? ('downloads' in packageJson ? packageJson.downloads : undefined);
3608
+ };
3609
+ const getDownloadCount = extension => {
3610
+ const downloadCount = getDownloadCountValue(extension);
3611
+ if (typeof downloadCount !== 'number') {
3612
+ return 'n/a';
3613
+ }
3614
+ return downloadCount.toLocaleString();
3615
+ };
3616
+
3617
+ const getRemoteUrl = (extension, platform, assetDir) => {
3618
+ if (extension === null || typeof extension !== 'object') {
3619
+ return '';
3620
+ }
3621
+ const builtin = 'builtin' in extension && extension.builtin === true;
3622
+ const icon = 'icon' in extension && typeof extension.icon === 'string' ? extension.icon : '';
3623
+ const id = 'id' in extension && typeof extension.id === 'string' ? extension.id : '';
3624
+ const path = 'path' in extension && typeof extension.path === 'string' ? extension.path : '';
3625
+ if (platform === Remote || platform === Electron) {
3626
+ if (builtin) {
3627
+ return `${assetDir}/extensions/${id}/${icon}`;
3628
+ }
3629
+ return `/remote/${path}/${icon}`; // TODO support windows paths
3630
+ }
3631
+ if (platform === Web) {
3632
+ return `${path}/${icon}`;
3633
+ }
3634
+ return '';
3635
+ };
3636
+
3637
+ const getExtensionDefaultIcon = assetDir => {
3638
+ return `${assetDir}/icons/extensionDefaultIcon.png`;
3639
+ };
3640
+ const getExtensionLanguageBasicsIcon = assetDir => {
3641
+ return `${assetDir}/icons/language-icon.svg`;
3642
+ };
3643
+ const getExtensionThemeIcon = assetDir => {
3644
+ return `${assetDir}/icons/theme-icon.png`;
3645
+ };
3646
+
3647
+ const isLanguageBasicsExtension = extension => {
3648
+ return 'name' in extension && typeof extension.name === 'string' && extension.name.startsWith('Language Basics');
3649
+ };
3650
+ const isThemeExtension = extension => {
3651
+ return 'name' in extension && typeof extension.name === 'string' && extension.name.endsWith(' Theme');
3652
+ };
3653
+ const getExtensionIcon = (extension, platform, assetDir) => {
3654
+ if (extension === null || typeof extension !== 'object') {
3655
+ return getExtensionDefaultIcon(assetDir);
3656
+ }
3657
+ const hasIcon = 'icon' in extension && typeof extension.icon === 'string' && extension.icon;
3658
+ const hasPath = 'path' in extension && typeof extension.path === 'string' && extension.path;
3659
+ if (!hasPath || !hasIcon) {
3660
+ if (isLanguageBasicsExtension(extension)) {
3661
+ return getExtensionLanguageBasicsIcon(assetDir);
3662
+ }
3663
+ if (isThemeExtension(extension)) {
3664
+ return getExtensionThemeIcon(assetDir);
3665
+ }
3666
+ return getExtensionDefaultIcon(assetDir);
3667
+ }
3668
+ return getRemoteUrl(extension, platform, assetDir);
3669
+ };
3670
+
3671
+ const getIcon = (extension, platform, assetDir) => {
3672
+ return getExtensionIcon(extension, platform, assetDir);
3673
+ };
3674
+
3675
+ const getId = extension => {
3676
+ if (extension === null || typeof extension !== 'object' || !('id' in extension) || typeof extension.id !== 'string' || !extension.id) {
3677
+ return 'n/a';
3678
+ }
3679
+ return extension.id;
3680
+ };
3681
+
3682
+ const getName = extension => {
3683
+ if (extension === null || typeof extension !== 'object') {
3684
+ return 'n/a';
3685
+ }
3686
+ if ('name' in extension && typeof extension.name === 'string' && extension.name) {
3687
+ return extension.name;
3688
+ }
3689
+ if ('id' in extension && typeof extension.id === 'string' && extension.id) {
3690
+ return extension.id;
3691
+ }
3692
+ return 'n/a';
3693
+ };
3694
+
3695
+ const RE_PUBLISHER = /^[a-z\d-]+/;
3696
+ const getPublisher = extension => {
3697
+ if (extension === null || typeof extension !== 'object' || !('id' in extension) || typeof extension.id !== 'string') {
3698
+ return 'n/a';
3699
+ }
3700
+ const match = extension.id.match(RE_PUBLISHER);
3701
+ if (!match) {
3702
+ return 'n/a';
3703
+ }
3704
+ return match[0];
3705
+ };
3706
+
3707
+ const getRatingValue = extension => {
3708
+ if (extension === null || typeof extension !== 'object') {
3709
+ return undefined;
3710
+ }
3711
+ const marketplace = 'marketplace' in extension && extension.marketplace !== null && typeof extension.marketplace === 'object' ? extension.marketplace : {};
3712
+ const packageJson = 'packageJSON' in extension && extension.packageJSON !== null && typeof extension.packageJSON === 'object' ? extension.packageJSON : {};
3713
+ return ('rating' in extension ? extension.rating : undefined) ?? ('averageRating' in extension ? extension.averageRating : undefined) ?? ('rating' in marketplace ? marketplace.rating : undefined) ?? ('averageRating' in marketplace ? marketplace.averageRating : undefined) ?? ('rating' in packageJson ? packageJson.rating : undefined) ?? ('averageRating' in packageJson ? packageJson.averageRating : undefined);
3714
+ };
3715
+ const getRating = extension => {
3716
+ const rating = getRatingValue(extension);
3717
+ if (typeof rating !== 'number') {
3718
+ return 'n/a';
3719
+ }
3720
+ return rating.toFixed(1);
3721
+ };
3722
+
3723
+ const getSize = extension => {
3724
+ if (extension === null || typeof extension !== 'object' || !('size' in extension) || extension.size === 0 || typeof extension.size !== 'number') {
3725
+ return 0;
3726
+ }
3727
+ return extension.size;
3728
+ };
3729
+
3730
+ const getStatus = extension => {
3731
+ if (extension === null || typeof extension !== 'object' || !('status' in extension)) {
3732
+ return undefined;
3733
+ }
3734
+ return typeof extension.status === 'string' ? extension.status : undefined;
3735
+ };
3736
+
3737
+ const getUpdatedDate = extension => {
3738
+ if (extension === null || typeof extension !== 'object' || !('updatedDate' in extension) || !extension.updatedDate || typeof extension.updatedDate !== 'number') {
3739
+ return 0;
3740
+ }
3741
+ return extension.updatedDate;
3742
+ };
3743
+
3744
+ const normalizeExtension = (extension, platform, assetDir) => {
3745
+ return {
3746
+ builtin: getBuiltin(extension),
3747
+ categories: getCategories(extension),
3748
+ description: getDescription(extension),
3749
+ disabled: getDisabled(extension),
3750
+ downloadCount: getDownloadCount(extension),
3751
+ icon: getIcon(extension, platform, assetDir),
3752
+ id: getId(extension),
3753
+ name: getName(extension),
3754
+ publisher: getPublisher(extension),
3755
+ rating: getRating(extension),
3756
+ size: getSize(extension),
3757
+ status: getStatus(extension),
3758
+ updatedDate: getUpdatedDate(extension),
3759
+ uri: ''
3760
+ };
3761
+ };
3762
+
3763
+ const normalizeExtensions = (extensions, platform, assetDir) => {
3764
+ return Array.from(extensions, extension => normalizeExtension(extension, platform, assetDir));
3765
+ };
3766
+
3767
+ const handleExtensionsChanged = async state => {
3768
+ const {
3769
+ assetDir,
3770
+ platform
3771
+ } = state;
3772
+ const allExtensions = await getAllExtensions(assetDir, platform);
3773
+ const normalized = normalizeExtensions(allExtensions, platform, assetDir);
3774
+ return handleChange({
3775
+ ...state,
3776
+ allExtensions: normalized
3777
+ }, {});
3778
+ };
3779
+
3780
+ const handleFocus = async state => {
3781
+ return {
3782
+ ...state,
3783
+ focus: List$2
3784
+ };
3785
+ };
3786
+
3787
+ const handleHeaderContextMenu = async state => {
3788
+ return state;
3789
+ };
3790
+
3791
+ const handleInputFocus = state => {
3792
+ return {
3793
+ ...state,
3794
+ focus: Input
3795
+ };
3796
+ };
3797
+
3798
+ const handleInstall = async (state, id) => {
3799
+ await installExtension(id);
3800
+ return setExtensionStatus(state, id, Enabled);
3801
+ };
3802
+
3803
+ const handleScrollBarCaptureLost = state => {
3804
+ return {
3805
+ ...state,
3806
+ scrollBarActive: false
3807
+ };
3808
+ };
3809
+
3810
+ const getNewDeltaPercent = (height, scrollBarHeight, relativeY) => {
3811
+ const halfScrollBarHeight = scrollBarHeight / 2;
3812
+ if (relativeY <= halfScrollBarHeight) {
3813
+ // clicked at top
3814
+ return {
3815
+ handleOffset: relativeY,
3816
+ percent: 0
3817
+ };
3818
+ }
3819
+ if (relativeY <= height - halfScrollBarHeight) {
3820
+ // clicked in middle
3821
+ return {
3822
+ handleOffset: halfScrollBarHeight,
3823
+ percent: (relativeY - halfScrollBarHeight) / (height - scrollBarHeight)
3824
+ };
3825
+ }
3826
+ // clicked at bottom
3827
+ return {
3828
+ handleOffset: scrollBarHeight - height + relativeY,
3829
+ percent: 1
3830
+ };
3831
+ };
3832
+
3833
+ const clamp = (num, min, max) => {
3834
+ number(num);
3835
+ number(min);
3836
+ number(max);
3837
+ return Math.min(Math.max(num, min), max);
3838
+ };
3839
+
3840
+ const setDeltaY = (state, value) => {
3841
+ object(state);
3842
+ number(value);
3843
+ const {
3844
+ deltaY,
3608
3845
  finalDeltaY,
3609
3846
  headerHeight,
3610
3847
  height,
@@ -3740,31 +3977,6 @@ const handleWheel = (state, deltaMode, deltaY) => {
3740
3977
  return setDeltaY(state, state.deltaY + deltaY * state.scrollSensitivity);
3741
3978
  };
3742
3979
 
3743
- const sendMessagePortToExtensionHostWorker = async port => {
3744
- await sendMessagePortToExtensionHostWorker$1(port, 0);
3745
- };
3746
-
3747
- const createExtensionHostWorkerRpc = async () => {
3748
- try {
3749
- const rpc = await create$6({
3750
- commandMap: {},
3751
- send: sendMessagePortToExtensionHostWorker
3752
- });
3753
- return rpc;
3754
- } catch (error) {
3755
- throw new VError(error, `Failed to create extension host rpc`);
3756
- }
3757
- };
3758
-
3759
- const {
3760
- set
3761
- } = ExtensionHost;
3762
-
3763
- const initializeExtensionHostWorker = async () => {
3764
- const rpc = await createExtensionHostWorkerRpc();
3765
- set(rpc);
3766
- };
3767
-
3768
3980
  const createExtensionManagementWorkerRpc = async () => {
3769
3981
  try {
3770
3982
  const rpc = await create$6({
@@ -3780,14 +3992,14 @@ const createExtensionManagementWorkerRpc = async () => {
3780
3992
  const initializeExtensionManagementWorker = async () => {
3781
3993
  try {
3782
3994
  const rpc = await createExtensionManagementWorkerRpc();
3783
- set$3(rpc);
3995
+ set$2(rpc);
3784
3996
  } catch {
3785
3997
  // ignore
3786
3998
  }
3787
3999
  };
3788
4000
 
3789
4001
  const initialize = async () => {
3790
- await Promise.all([initializeExtensionHostWorker(), initializeExtensionManagementWorker()]);
4002
+ await initializeExtensionManagementWorker();
3791
4003
  };
3792
4004
 
3793
4005
  const installAnotherVersion = async state => {
@@ -3795,25 +4007,6 @@ const installAnotherVersion = async state => {
3795
4007
  return state;
3796
4008
  };
3797
4009
 
3798
- const Web = 1;
3799
- const Electron = 2;
3800
- const Remote = 3;
3801
-
3802
- const getAllExtensions$1 = async (assetDir, platform) => {
3803
- try {
3804
- return await invoke$1('Extensions.getAllExtensions', assetDir, platform);
3805
- } catch (error) {
3806
- if (platform === Web) {
3807
- return [];
3808
- }
3809
- throw error;
3810
- }
3811
- };
3812
-
3813
- const getAllExtensions = (assetDir, platform) => {
3814
- return getAllExtensions$1(assetDir, platform);
3815
- };
3816
-
3817
4010
  const Small = 1;
3818
4011
  const Normal = 2;
3819
4012
  const Large = 3;
@@ -3833,166 +4026,6 @@ const getIsFirefox = () => {
3833
4026
  return globalWithNavigator.navigator?.userAgent.toLowerCase().includes('firefox') ?? false;
3834
4027
  };
3835
4028
 
3836
- const getRemoteUrl = (extension, platform, assetDir) => {
3837
- if (platform === Remote || platform === Electron) {
3838
- if (extension.builtin) {
3839
- return `${assetDir}/extensions/${extension.id}/${extension.icon}`;
3840
- }
3841
- return `/remote/${extension.path}/${extension.icon}`; // TODO support windows paths
3842
- }
3843
- if (platform === Web) {
3844
- return `${extension.path}/${extension.icon}`;
3845
- }
3846
- return '';
3847
- };
3848
-
3849
- const getExtensionDefaultIcon = assetDir => {
3850
- return `${assetDir}/icons/extensionDefaultIcon.png`;
3851
- };
3852
- const getExtensionLanguageBasicsIcon = assetDir => {
3853
- return `${assetDir}/icons/language-icon.svg`;
3854
- };
3855
- const getExtensionThemeIcon = assetDir => {
3856
- return `${assetDir}/icons/theme-icon.png`;
3857
- };
3858
-
3859
- const isLanguageBasicsExtension = extension => {
3860
- return extension.name && extension.name.startsWith('Language Basics');
3861
- };
3862
- const isThemeExtension = extension => {
3863
- return extension.name && extension.name.endsWith(' Theme');
3864
- };
3865
- const getExtensionIcon = (extension, platform, assetDir) => {
3866
- if (!extension) {
3867
- return getExtensionDefaultIcon(assetDir);
3868
- }
3869
- if (!extension.path || !extension.icon) {
3870
- if (isLanguageBasicsExtension(extension)) {
3871
- return getExtensionLanguageBasicsIcon(assetDir);
3872
- }
3873
- if (isThemeExtension(extension)) {
3874
- return getExtensionThemeIcon(assetDir);
3875
- }
3876
- return getExtensionDefaultIcon(assetDir);
3877
- }
3878
- return getRemoteUrl(extension, platform, assetDir);
3879
- };
3880
-
3881
- const getDownloadCountValue = extension => {
3882
- return extension?.downloadCount ?? extension?.downloads ?? extension?.marketplace?.downloadCount ?? extension?.marketplace?.downloads ?? extension?.packageJSON?.downloadCount ?? extension?.packageJSON?.downloads;
3883
- };
3884
- const getDownloadCount = extension => {
3885
- const downloadCount = getDownloadCountValue(extension);
3886
- if (typeof downloadCount !== 'number') {
3887
- return 'n/a';
3888
- }
3889
- return downloadCount.toLocaleString();
3890
- };
3891
-
3892
- const getRatingValue = extension => {
3893
- return extension?.rating ?? extension?.averageRating ?? extension?.marketplace?.rating ?? extension?.marketplace?.averageRating ?? extension?.packageJSON?.rating ?? extension?.packageJSON?.averageRating;
3894
- };
3895
- const getRating = extension => {
3896
- const rating = getRatingValue(extension);
3897
- if (typeof rating !== 'number') {
3898
- return 'n/a';
3899
- }
3900
- return rating.toFixed(1);
3901
- };
3902
-
3903
- const getBuiltin = extension => {
3904
- return extension?.builtin === true;
3905
- };
3906
- const getDisabled = extension => {
3907
- return extension?.disabled === true;
3908
- };
3909
- const getStatus = extension => {
3910
- return typeof extension?.status === 'string' ? extension.status : undefined;
3911
- };
3912
- const getIcon = (extension, platform, assetDir) => {
3913
- return getExtensionIcon(extension, platform, assetDir);
3914
- };
3915
- const getName = extension => {
3916
- if (extension && extension.name) {
3917
- return extension.name;
3918
- }
3919
- if (extension && extension.id) {
3920
- return extension.id;
3921
- }
3922
- return 'n/a';
3923
- };
3924
- const getDescription = extension => {
3925
- if (!extension || !extension.description) {
3926
- return 'n/a';
3927
- }
3928
- return extension.description;
3929
- };
3930
- const getId$1 = extension => {
3931
- if (!extension || !extension.id) {
3932
- return 'n/a';
3933
- }
3934
- return extension.id;
3935
- };
3936
- const getSize = extension => {
3937
- if (!extension || extension.size === 0 || typeof extension.size !== 'number') {
3938
- return 0;
3939
- }
3940
- return extension.size;
3941
- };
3942
- const getUpdatedDate = extension => {
3943
- if (!extension || !extension.updatedDate || typeof extension.updatedDate !== 'number') {
3944
- return 0;
3945
- }
3946
- return extension.updatedDate;
3947
- };
3948
- const isString = item => {
3949
- return typeof item === 'string';
3950
- };
3951
- const getCategories = extension => {
3952
- if (!extension || !extension.categories || !Array.isArray(extension.categories)) {
3953
- return [];
3954
- }
3955
- return extension.categories.filter(isString);
3956
- };
3957
-
3958
- const RE_PUBLISHER = /^[a-z\d-]+/;
3959
-
3960
- // TODO handle case when extension is of type number|array|null|string
3961
- const getPublisher = extension => {
3962
- if (!extension || !extension.id) {
3963
- return 'n/a';
3964
- }
3965
- // TODO handle case when id is not of type string -> should not crash application
3966
- const match = extension.id.match(RE_PUBLISHER);
3967
- if (!match) {
3968
- return 'n/a';
3969
- }
3970
- return match[0];
3971
- };
3972
-
3973
- const normalizeExtension = (extension, platform, assetDir) => {
3974
- return {
3975
- builtin: getBuiltin(extension),
3976
- categories: getCategories(extension),
3977
- description: getDescription(extension),
3978
- disabled: getDisabled(extension),
3979
- downloadCount: getDownloadCount(extension),
3980
- icon: getIcon(extension, platform, assetDir),
3981
- id: getId$1(extension),
3982
- name: getName(extension),
3983
- publisher: getPublisher(extension),
3984
- rating: getRating(extension),
3985
- size: getSize(extension),
3986
- status: getStatus(extension),
3987
- updatedDate: getUpdatedDate(extension),
3988
- uri: ''
3989
- };
3990
- };
3991
-
3992
- const normalizeExtensions = (extensions, platform, assetDir) => {
3993
- return Array.from(extensions, extension => normalizeExtension(extension, platform, assetDir));
3994
- };
3995
-
3996
4029
  const getSavedValue = savedState => {
3997
4030
  if (savedState && typeof savedState === 'object' && 'searchValue' in savedState && typeof savedState.searchValue === 'string') {
3998
4031
  return savedState.searchValue;
@@ -4352,7 +4385,7 @@ const getCompletionWidgetVirtualDom = (items, focusedIndex) => {
4352
4385
  const Focusable = 0;
4353
4386
 
4354
4387
  const disabledClassName = mergeClassNames(SearchFieldButton, SearchFieldButtonDisabled);
4355
- const getClassName$1 = enabled => {
4388
+ const getClassName = enabled => {
4356
4389
  if (enabled) {
4357
4390
  return SearchFieldButton;
4358
4391
  }
@@ -4367,7 +4400,7 @@ const getSearchFieldButtonVirtualDom = button => {
4367
4400
  } = button;
4368
4401
  return [{
4369
4402
  childCount: 1,
4370
- className: getClassName$1(enabled),
4403
+ className: getClassName(enabled),
4371
4404
  onClick,
4372
4405
  tabIndex: Focusable,
4373
4406
  title,
@@ -4501,7 +4534,7 @@ const getExtensionActions = (builtin, disabled, status) => {
4501
4534
  };
4502
4535
 
4503
4536
  const className = mergeClassNames(ExtensionListItemActionInstall, ExtensionActionButton);
4504
- const getActionVirtualDom$1 = (action, id) => {
4537
+ const getExtensionActionVirtualDom = (action, id) => {
4505
4538
  return [{
4506
4539
  childCount: 1,
4507
4540
  className,
@@ -4511,13 +4544,33 @@ const getActionVirtualDom$1 = (action, id) => {
4511
4544
  type: Button$2
4512
4545
  }, text(action.label)];
4513
4546
  };
4547
+
4514
4548
  const getExtensionActionsVirtualDom = (id, builtin, disabled, status) => {
4515
4549
  const actions = getExtensionActions(builtin, disabled, status);
4516
4550
  return [{
4517
4551
  childCount: actions.length,
4518
4552
  className: ExtensionActions,
4519
4553
  type: Div
4520
- }, ...actions.flatMap(action => getActionVirtualDom$1(action, id))];
4554
+ }, ...actions.flatMap(action => getExtensionActionVirtualDom(action, id))];
4555
+ };
4556
+
4557
+ const getExtensionListItemClassName = (focused, disabled) => {
4558
+ return mergeClassNames(ExtensionListItem, focused ? ExtensionActive : '', disabled ? ExtensionListItemDisabled : '');
4559
+ };
4560
+
4561
+ const getExtensionListItemFooter = hasStatistics => {
4562
+ return {
4563
+ childCount: hasStatistics ? 3 : 2,
4564
+ className: ExtensionListItemFooter,
4565
+ type: Div
4566
+ };
4567
+ };
4568
+
4569
+ const getExtensionListItemId = focused => {
4570
+ if (focused) {
4571
+ return `ExtensionActive`;
4572
+ }
4573
+ return undefined;
4521
4574
  };
4522
4575
 
4523
4576
  const extensionListItemMetadataNode = {
@@ -4539,6 +4592,13 @@ const getExtensionStatisticsVirtualDom = (downloadCount, rating$1) => {
4539
4592
  return [extensionListItemMetadataNode, ...getStatisticVirtualDom(downloads(), downloadCount, ExtensionListItemDownloadCount), ...getStatisticVirtualDom(rating(), rating$1, ExtensionListItemRating)];
4540
4593
  };
4541
4594
 
4595
+ const getExtensionListItemStatisticsVirtualDom = (hasStatistics, downloadCount, rating) => {
4596
+ if (!hasStatistics) {
4597
+ return [];
4598
+ }
4599
+ return getExtensionStatisticsVirtualDom(downloadCount, rating);
4600
+ };
4601
+
4542
4602
  const listItemDetail = {
4543
4603
  childCount: 3,
4544
4604
  className: ExtensionListItemDetail,
@@ -4554,33 +4614,11 @@ const listItemDescription = {
4554
4614
  className: ExtensionListItemDescription,
4555
4615
  type: Div
4556
4616
  };
4557
- const getListItemFooter = hasStatistics => {
4558
- return {
4559
- childCount: hasStatistics ? 3 : 2,
4560
- className: ExtensionListItemFooter,
4561
- type: Div
4562
- };
4563
- };
4564
4617
  const listItemAuthorName = {
4565
4618
  childCount: 1,
4566
4619
  className: ExtensionListItemAuthorName,
4567
4620
  type: Div
4568
4621
  };
4569
- const getClassName = (focused, disabled) => {
4570
- return mergeClassNames(ExtensionListItem, focused ? ExtensionActive : '', disabled ? ExtensionListItemDisabled : '');
4571
- };
4572
- const getId = focused => {
4573
- if (focused) {
4574
- return `ExtensionActive`;
4575
- }
4576
- return undefined;
4577
- };
4578
- const getStatisticsVirtualDom = (hasStatistics, downloadCount, rating) => {
4579
- if (!hasStatistics) {
4580
- return [];
4581
- }
4582
- return getExtensionStatisticsVirtualDom(downloadCount, rating);
4583
- };
4584
4622
  const getExtensionListItemVirtualDom = extension => {
4585
4623
  const {
4586
4624
  builtin = false,
@@ -4604,8 +4642,8 @@ const getExtensionListItemVirtualDom = extension => {
4604
4642
  ariaRoleDescription: Extension,
4605
4643
  ariaSetSize: setSize,
4606
4644
  childCount: 2,
4607
- className: getClassName(focused, disabled),
4608
- id: getId(focused),
4645
+ className: getExtensionListItemClassName(focused, disabled),
4646
+ id: getExtensionListItemId(focused),
4609
4647
  role: ListItem,
4610
4648
  type: Div
4611
4649
  }, {
@@ -4614,16 +4652,19 @@ const getExtensionListItemVirtualDom = extension => {
4614
4652
  role: None,
4615
4653
  src: icon,
4616
4654
  type: Img
4617
- }, listItemDetail, listItemName, text(name), listItemDescription, text(description), getListItemFooter(hasStatistics), listItemAuthorName, text(publisher), ...getStatisticsVirtualDom(hasStatistics, downloadCount, rating), ...actionsDom];
4655
+ }, listItemDetail, listItemName, text(name), listItemDescription, text(description), getExtensionListItemFooter(hasStatistics), listItemAuthorName, text(publisher), ...getExtensionListItemStatisticsVirtualDom(hasStatistics, downloadCount, rating), ...actionsDom];
4618
4656
  return dom;
4619
4657
  };
4620
4658
 
4621
- const getExtensionsListVirtualDom = (visibleExtensions, focusOutline) => {
4659
+ const getListClassName = focusOutline => {
4622
4660
  const className = focusOutline ? mergeClassNames(ListItems, FocusOutline) : ListItems;
4661
+ return className;
4662
+ };
4663
+ const getExtensionsListVirtualDom = (visibleExtensions, focusOutline) => {
4623
4664
  const dom = [{
4624
4665
  ariaLabel: extensions(),
4625
4666
  childCount: visibleExtensions.length,
4626
- className,
4667
+ className: getListClassName(focusOutline),
4627
4668
  onBlur: HandleBlur,
4628
4669
  onContextmenu: HandleContextMenu,
4629
4670
  onContextMenu: HandleContextMenu,
@@ -4917,7 +4958,7 @@ const render3 = (uid, diffResult) => {
4917
4958
  newState,
4918
4959
  oldState
4919
4960
  } = get(uid);
4920
- set$1(uid, newState, newState);
4961
+ set(uid, newState, newState);
4921
4962
  const commands = applyRender(oldState, newState, diffResult);
4922
4963
  return commands;
4923
4964
  };
@@ -5164,6 +5205,7 @@ const commandMap = {
5164
5205
  'SearchExtensions.handleDisableWorkspace': wrapCommand(handleDisableWorkspace),
5165
5206
  'SearchExtensions.handleEnable': wrapCommand(handleEnable),
5166
5207
  'SearchExtensions.handleEnableWorkspace': wrapCommand(handleEnableWorkspace),
5208
+ 'SearchExtensions.handleExtensionsChanged': wrapCommand(handleExtensionsChanged),
5167
5209
  'SearchExtensions.handleFocus': wrapCommand(handleFocus),
5168
5210
  'SearchExtensions.handleHeaderContextMenu': wrapCommand(handleHeaderContextMenu),
5169
5211
  'SearchExtensions.handleInput': wrapAsyncCommand(handleInputWithContext),
@@ -5202,12 +5244,12 @@ const listen = async () => {
5202
5244
  const rpc = await create$4({
5203
5245
  commandMap: commandMap
5204
5246
  });
5205
- set$2(rpc);
5247
+ set$1(rpc);
5206
5248
  const dialogRpc = await create$5({
5207
5249
  commandMap: {},
5208
5250
  send: sendMessagePortToDialogWorker
5209
5251
  });
5210
- set$5(dialogRpc);
5252
+ set$3(dialogRpc);
5211
5253
  };
5212
5254
 
5213
5255
  const main = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-search-view",
3
- "version": "7.13.0",
3
+ "version": "7.13.2",
4
4
  "description": "Extension Search View Worker",
5
5
  "repository": {
6
6
  "type": "git",