@lvce-editor/file-search-worker 5.4.0 → 5.5.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.
@@ -2045,6 +2045,9 @@ const selectIndex = async (state, index, button = /* left */0) => {
2045
2045
  } = state;
2046
2046
  const actualIndex = index + minLineY;
2047
2047
  const pick = getPick(items, actualIndex);
2048
+ if (!pick) {
2049
+ return state;
2050
+ }
2048
2051
  // @ts-ignore
2049
2052
  const selectPickResult = await provider.selectPick(pick, actualIndex, button);
2050
2053
  object(selectPickResult);
@@ -2575,10 +2578,6 @@ const commandMap = {
2575
2578
  'QuickPick.loadEntries2': get$1
2576
2579
  };
2577
2580
 
2578
- const getColorThemeNames = async () => {
2579
- return invoke$1(/* Ajax.getJson */'ColorTheme.getColorThemeNames');
2580
- };
2581
-
2582
2581
  const getPickDescription$c = value => {
2583
2582
  return '';
2584
2583
  };
@@ -2602,29 +2601,37 @@ const getVisibleItems$f = (picks, icons) => {
2602
2601
  return visibleItems;
2603
2602
  };
2604
2603
 
2605
- const setColorTheme = id => {
2606
- return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
2607
- };
2608
- const getPlaceholder$7 = () => {
2609
- return selectColorTheme();
2610
- };
2611
- const getLabel$4 = () => {
2612
- return selectColorTheme();
2604
+ const getColorThemeNames = async () => {
2605
+ return invoke$1(/* Ajax.getJson */'ColorTheme.getColorThemeNames');
2613
2606
  };
2607
+
2614
2608
  const getPicks$7 = async searchValue => {
2615
2609
  const colorThemeNames = await getColorThemeNames();
2616
2610
  return colorThemeNames;
2617
2611
  };
2618
- const getVisibleItems$e = getVisibleItems$f;
2612
+
2613
+ const setColorTheme = id => {
2614
+ return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
2615
+ };
2616
+
2619
2617
  const selectPick$7 = async pick => {
2620
2618
  await setColorTheme(/* colorThemeId */pick);
2621
2619
  return {
2622
2620
  command: Hide
2623
2621
  };
2624
2622
  };
2623
+
2625
2624
  const focusPick = async pick => {
2626
2625
  await setColorTheme(/* colorThemeId */pick);
2627
2626
  };
2627
+
2628
+ const getPlaceholder$7 = () => {
2629
+ return selectColorTheme();
2630
+ };
2631
+ const getLabel$4 = () => {
2632
+ return selectColorTheme();
2633
+ };
2634
+ const getVisibleItems$e = getVisibleItems$f;
2628
2635
  const getFilterValue$7 = value => {
2629
2636
  return value;
2630
2637
  };
@@ -2671,30 +2678,9 @@ const QuickPickEntriesColorTheme = {
2671
2678
  isPrepared: isPrepared$7,
2672
2679
  name: name$7,
2673
2680
  selectPick: selectPick$7,
2674
- setColorTheme,
2675
2681
  state: state$8
2676
2682
  };
2677
2683
 
2678
- const handleError = async (error, notify = true, prefix = '') => {
2679
- console.error(error);
2680
- };
2681
- const showErrorDialog = async error => {
2682
- const code = error.code;
2683
- const message = error.message;
2684
- const stack = error.stack;
2685
- const name = error.name;
2686
- const errorInfo = {
2687
- code,
2688
- message,
2689
- stack,
2690
- name
2691
- };
2692
- await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
2693
- };
2694
- const warn = (...args) => {
2695
- console.warn(...args);
2696
- };
2697
-
2698
2684
  const getPickIcon$b = () => {
2699
2685
  return '';
2700
2686
  };
@@ -2715,24 +2701,24 @@ const getVisibleItems$d = (picks, icons) => {
2715
2701
  return visibleItems;
2716
2702
  };
2717
2703
 
2718
- const name$6 = 'command';
2719
- const state$7 = {};
2720
- const isPrepared$6 = () => {
2721
- return false;
2722
- };
2723
- const getPickDescription$a = () => {
2724
- return '';
2725
- };
2726
- const getPlaceholder$6 = () => {
2727
- return typeNameofCommandToRun();
2728
- };
2729
- const getLabel$3 = () => {
2730
- return '';
2704
+ const handleError = async (error, notify = true, prefix = '') => {
2705
+ console.error(error);
2731
2706
  };
2732
- const getNoResults$6 = () => {
2733
- return {
2734
- label: noMatchingResults()
2707
+ const showErrorDialog = async error => {
2708
+ const code = error.code;
2709
+ const message = error.message;
2710
+ const stack = error.stack;
2711
+ const name = error.name;
2712
+ const errorInfo = {
2713
+ code,
2714
+ message,
2715
+ stack,
2716
+ name
2735
2717
  };
2718
+ await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
2719
+ };
2720
+ const warn = (...args) => {
2721
+ console.warn(...args);
2736
2722
  };
2737
2723
 
2738
2724
  // TODO combine Ajax with cache (specify strategy: cacheFirst, networkFirst)
@@ -2767,16 +2753,13 @@ const getExtensionPicks = async () => {
2767
2753
  return [];
2768
2754
  }
2769
2755
  };
2770
-
2771
- // TODO send strings to renderer process only once for next occurrence send uint16array of ids of strings
2772
-
2773
2756
  const getPicks$6 = async () => {
2774
2757
  const builtinPicks = await getBuiltinPicks();
2775
2758
  const extensionPicks = await getExtensionPicks();
2776
2759
  const allPicks = [...builtinPicks, ...extensionPicks];
2777
2760
  return allPicks;
2778
2761
  };
2779
- const getVisibleItems$c = getVisibleItems$d;
2762
+
2780
2763
  const shouldHide = item => {
2781
2764
  if (item.id === 'Viewlet.openWidget' && item.args[0] === 'QuickPick') {
2782
2765
  return false;
@@ -2814,6 +2797,27 @@ const selectPick$6 = async item => {
2814
2797
  }
2815
2798
  return selectPickBuiltin(item);
2816
2799
  };
2800
+
2801
+ const name$6 = 'command';
2802
+ const state$7 = {};
2803
+ const isPrepared$6 = () => {
2804
+ return false;
2805
+ };
2806
+ const getPickDescription$a = () => {
2807
+ return '';
2808
+ };
2809
+ const getPlaceholder$6 = () => {
2810
+ return typeNameofCommandToRun();
2811
+ };
2812
+ const getLabel$3 = () => {
2813
+ return '';
2814
+ };
2815
+ const getNoResults$6 = () => {
2816
+ return {
2817
+ label: noMatchingResults()
2818
+ };
2819
+ };
2820
+ const getVisibleItems$c = getVisibleItems$d;
2817
2821
  const getFilterValue$6 = value => {
2818
2822
  return value.trim();
2819
2823
  };
@@ -3023,10 +3027,6 @@ const getWorkspacePath = async () => {
3023
3027
  return invoke$1('Workspace.getPath');
3024
3028
  };
3025
3029
 
3026
- const openUri = async uri => {
3027
- await invoke$1(/* Main.openUri */'Main.openUri', /* uri */uri);
3028
- };
3029
-
3030
3030
  const state$5 = Object.create(null);
3031
3031
  const register = modules => {
3032
3032
  Object.assign(state$5, modules);
@@ -3043,25 +3043,12 @@ const searchFile$5 = async (path, value, prepare, assetDir) => {
3043
3043
  return result;
3044
3044
  };
3045
3045
 
3046
- const state$4 = {};
3047
3046
  const searchFile$4 = async (path, value) => {
3048
3047
  const prepare = true;
3049
3048
  // @ts-ignore
3050
3049
  const files = await searchFile$5(/* path */path, /* searchTerm */value, prepare);
3051
3050
  return files;
3052
3051
  };
3053
- const name$4 = 'file';
3054
- const getPlaceholder$4 = () => {
3055
- return '';
3056
- };
3057
- const getLabel$1 = () => {
3058
- return files();
3059
- };
3060
- const getNoResults$4 = () => {
3061
- return {
3062
- label: noMatchingResults()
3063
- };
3064
- };
3065
3052
  const getPicks$4 = async searchValue => {
3066
3053
  // TODO cache workspace path
3067
3054
  const workspace = await getWorkspacePath();
@@ -3071,6 +3058,11 @@ const getPicks$4 = async searchValue => {
3071
3058
  const files = await searchFile$4(workspace, searchValue);
3072
3059
  return files;
3073
3060
  };
3061
+
3062
+ const openUri = async uri => {
3063
+ await invoke$1(/* Main.openUri */'Main.openUri', /* uri */uri);
3064
+ };
3065
+
3074
3066
  const selectPick$4 = async pick => {
3075
3067
  if (typeof pick === 'object') {
3076
3068
  pick = pick.pick;
@@ -3082,6 +3074,20 @@ const selectPick$4 = async pick => {
3082
3074
  command: Hide
3083
3075
  };
3084
3076
  };
3077
+
3078
+ const state$4 = {};
3079
+ const name$4 = 'file';
3080
+ const getPlaceholder$4 = () => {
3081
+ return '';
3082
+ };
3083
+ const getLabel$1 = () => {
3084
+ return files();
3085
+ };
3086
+ const getNoResults$4 = () => {
3087
+ return {
3088
+ label: noMatchingResults()
3089
+ };
3090
+ };
3085
3091
  const getFilterValue$4 = value => {
3086
3092
  return value;
3087
3093
  };
@@ -3181,6 +3187,15 @@ const openWorkspaceFolder = uri => {
3181
3187
  return invoke$1(/* Workspace.setPath */'Workspace.setPath', /* path */uri);
3182
3188
  };
3183
3189
 
3190
+ // TODO selectPick should be independent of show/hide
3191
+ const selectPick$3 = async pick => {
3192
+ const path = pick;
3193
+ await openWorkspaceFolder(path);
3194
+ return {
3195
+ command: Hide
3196
+ };
3197
+ };
3198
+
3184
3199
  const getPlaceholder$3 = () => {
3185
3200
  return selectToOpen();
3186
3201
  };
@@ -3203,15 +3218,6 @@ const getPicks$3 = async () => {
3203
3218
  return recentlyOpened;
3204
3219
  };
3205
3220
  const getVisibleItems$6 = getVisibleItems$7;
3206
-
3207
- // TODO selectPick should be independent of show/hide
3208
- const selectPick$3 = async pick => {
3209
- const path = pick;
3210
- await openWorkspaceFolder(path);
3211
- return {
3212
- command: Hide
3213
- };
3214
- };
3215
3221
  const getFilterValue$3 = value => {
3216
3222
  return pathBaseName(value);
3217
3223
  };
@@ -3270,6 +3276,12 @@ const getVisibleItems$5 = picks => {
3270
3276
  return [];
3271
3277
  };
3272
3278
 
3279
+ const selectPick$2 = async item => {
3280
+ return {
3281
+ command: Hide
3282
+ };
3283
+ };
3284
+
3273
3285
  const name$2 = 'symbol';
3274
3286
  const getPlaceholder$2 = () => {
3275
3287
  return '';
@@ -3284,11 +3296,6 @@ const getPicks$2 = async () => {
3284
3296
  return picks;
3285
3297
  };
3286
3298
  const getVisibleItems$4 = getVisibleItems$5;
3287
- const selectPick$2 = async item => {
3288
- return {
3289
- command: Hide
3290
- };
3291
- };
3292
3299
  const getFilterValue$2 = value => {
3293
3300
  return value;
3294
3301
  };
@@ -3346,6 +3353,13 @@ const getVisibleItems$3 = picks => {
3346
3353
  return visibleItems;
3347
3354
  };
3348
3355
 
3356
+ const selectPick$1 = async item => {
3357
+ // Command.execute(/* openView */ 549, /* viewName */ item.label)
3358
+ // return {
3359
+ // command: QuickPickReturnValue.Hide,
3360
+ // }
3361
+ };
3362
+
3349
3363
  // TODO probably not needed
3350
3364
 
3351
3365
  const getPlaceholder$1 = () => {
@@ -3360,12 +3374,6 @@ const getPicks$1 = async () => {
3360
3374
  // return picks
3361
3375
  return [];
3362
3376
  };
3363
- const selectPick$1 = async item => {
3364
- // Command.execute(/* openView */ 549, /* viewName */ item.label)
3365
- // return {
3366
- // command: QuickPickReturnValue.Hide,
3367
- // }
3368
- };
3369
3377
  const getFilterValue$1 = value => {
3370
3378
  return value;
3371
3379
  };
@@ -3420,6 +3428,12 @@ const getVisibleItems$1 = picks => {
3420
3428
  return visibleItems;
3421
3429
  };
3422
3430
 
3431
+ const selectPick = async item => {
3432
+ return {
3433
+ command: Hide
3434
+ };
3435
+ };
3436
+
3423
3437
  const name = 'workspace-symbol';
3424
3438
  const getPlaceholder = () => {
3425
3439
  return '';
@@ -3449,11 +3463,6 @@ const getPicks = async () => {
3449
3463
  const picks = [];
3450
3464
  return picks;
3451
3465
  };
3452
- const selectPick = async item => {
3453
- return {
3454
- command: Hide
3455
- };
3456
- };
3457
3466
  const getFilterValue = value => {
3458
3467
  return value;
3459
3468
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-search-worker",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "text-search"