@lvce-editor/quick-pick-worker 4.5.3 → 4.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.
@@ -1309,16 +1309,18 @@ const close = async state => {
1309
1309
  providerId
1310
1310
  } = state;
1311
1311
  if (providerId === Custom$1) {
1312
- const resolveId = args[2];
1313
1312
  const options = args.at(-1);
1314
- const result = getCancelResult$1(args);
1315
- if (options?.callbackOwner === 'quickPickWorker') {
1316
- if (typeof resolveId !== 'number') {
1317
- throw new TypeError('expected resolve id to be a number');
1313
+ if (!options?.executeItemCommand) {
1314
+ const resolveId = args[2];
1315
+ const result = getCancelResult$1(args);
1316
+ if (options?.callbackOwner === 'quickPickWorker') {
1317
+ if (typeof resolveId !== 'number') {
1318
+ throw new TypeError('expected resolve id to be a number');
1319
+ }
1320
+ executeCallback(resolveId, result);
1321
+ } else {
1322
+ await invoke$1('QuickPick.executeCallback', resolveId, result);
1318
1323
  }
1319
- executeCallback(resolveId, result);
1320
- } else {
1321
- await invoke$1('QuickPick.executeCallback', resolveId, result);
1322
1324
  }
1323
1325
  }
1324
1326
  await closeWidget(state.uid);
@@ -2587,15 +2589,20 @@ const invoke = (method, ...args) => {
2587
2589
 
2588
2590
  const toProtoVisibleItem$2 = item => {
2589
2591
  const {
2592
+ args,
2593
+ command,
2590
2594
  description = '',
2595
+ icon = '',
2591
2596
  label,
2592
2597
  value
2593
2598
  } = item;
2594
2599
  return {
2600
+ args,
2601
+ command,
2595
2602
  description,
2596
2603
  direntType: 0,
2597
2604
  fileIcon: '',
2598
- icon: '',
2605
+ icon,
2599
2606
  label,
2600
2607
  matches: [],
2601
2608
  uri: '',
@@ -3099,6 +3106,13 @@ const selectPick$8 = async (_pick, value) => {
3099
3106
  args
3100
3107
  } = state$1;
3101
3108
  const options = getOptions(args);
3109
+ if (options.executeItemCommand && _pick.command) {
3110
+ return {
3111
+ command: Hide,
3112
+ itemCommand: _pick.command,
3113
+ itemCommandArgs: _pick.args || []
3114
+ };
3115
+ }
3102
3116
  const resolveId = args[2];
3103
3117
  let result;
3104
3118
  if (options.mode === 'quickPick') {
@@ -3431,8 +3445,11 @@ const handleBlur = async state => {
3431
3445
  providerId
3432
3446
  } = state;
3433
3447
  if (providerId === Custom$1) {
3434
- const resolveId = args[2];
3435
- await invoke$1('QuickPick.executeCallback', resolveId, getCancelResult(args));
3448
+ const options = args.at(-1);
3449
+ if (!options?.executeItemCommand) {
3450
+ const resolveId = args[2];
3451
+ await invoke$1('QuickPick.executeCallback', resolveId, getCancelResult(args));
3452
+ }
3436
3453
  }
3437
3454
  await closeWidget(state.uid);
3438
3455
  return state;
@@ -3683,6 +3700,9 @@ const selectIndex = async (state, index, button = /* left */0) => {
3683
3700
  switch (command) {
3684
3701
  case Hide:
3685
3702
  await closeWidget(state.uid);
3703
+ if (selectPickResult.itemCommand) {
3704
+ await invoke$1(selectPickResult.itemCommand, ...(selectPickResult.itemCommandArgs || []));
3705
+ }
3686
3706
  return state;
3687
3707
  case OpenLanguageMode:
3688
3708
  return loadContent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/quick-pick-worker",
3
- "version": "4.5.3",
3
+ "version": "4.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lvce-editor/quick-pick-worker.git"