@lvce-editor/text-search-worker 5.24.0 → 5.25.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.
- package/dist/textSearchWorkerMain.js +82 -10
- package/package.json +1 -1
|
@@ -1226,6 +1226,7 @@ const TargetName = 'event.target.name';
|
|
|
1226
1226
|
const TargetValue = 'event.target.value';
|
|
1227
1227
|
|
|
1228
1228
|
const Search$1 = 18;
|
|
1229
|
+
const InputContextMenu$1 = 91;
|
|
1229
1230
|
|
|
1230
1231
|
const None$1 = 0;
|
|
1231
1232
|
|
|
@@ -1731,7 +1732,7 @@ const collapseDetails = state => {
|
|
|
1731
1732
|
};
|
|
1732
1733
|
};
|
|
1733
1734
|
|
|
1734
|
-
const copy = async state => {
|
|
1735
|
+
const copy$1 = async state => {
|
|
1735
1736
|
const {
|
|
1736
1737
|
items,
|
|
1737
1738
|
focusedIndex
|
|
@@ -2156,6 +2157,10 @@ const ConfirmReplaceOneOccurrenceInOneFile = "Replace 1 occurrence across 1 file
|
|
|
2156
2157
|
const ConfirmReplaceOneOccurrenceInOneFileNoValue = 'Replace 1 occurrence across 1 file';
|
|
2157
2158
|
const CopyPath = 'Copy Path';
|
|
2158
2159
|
const Dismiss = 'Dismiss';
|
|
2160
|
+
const Cut = 'Cut';
|
|
2161
|
+
const Copy = 'Copy';
|
|
2162
|
+
const Paste = 'Paste';
|
|
2163
|
+
const SelectAll = 'SelectAll';
|
|
2159
2164
|
const Exclude = 'Exclude';
|
|
2160
2165
|
const FilesToExclude$1 = 'Files to Exclude';
|
|
2161
2166
|
const FilesToInclude$1 = 'Files to Include';
|
|
@@ -2282,6 +2287,18 @@ const replace = () => {
|
|
|
2282
2287
|
const dismiss = () => {
|
|
2283
2288
|
return i18nString(Dismiss);
|
|
2284
2289
|
};
|
|
2290
|
+
const cut = () => {
|
|
2291
|
+
return i18nString(Cut);
|
|
2292
|
+
};
|
|
2293
|
+
const copy = () => {
|
|
2294
|
+
return i18nString(Copy);
|
|
2295
|
+
};
|
|
2296
|
+
const paste = () => {
|
|
2297
|
+
return i18nString(Paste);
|
|
2298
|
+
};
|
|
2299
|
+
const selectAll = () => {
|
|
2300
|
+
return i18nString(SelectAll);
|
|
2301
|
+
};
|
|
2285
2302
|
const theResultSetOnlyContainsASubSetOfMatches = () => {
|
|
2286
2303
|
return i18nString(TheResultSetOnlyContainsASubSetOfMatches);
|
|
2287
2304
|
};
|
|
@@ -2635,7 +2652,31 @@ const getKeyBindings = () => {
|
|
|
2635
2652
|
return [...getSearchHeaderKeyBindings(), ...getSearchResultKeyBindings()];
|
|
2636
2653
|
};
|
|
2637
2654
|
|
|
2638
|
-
const
|
|
2655
|
+
const getMenuEntriesInput = () => {
|
|
2656
|
+
return [{
|
|
2657
|
+
id: 'cut',
|
|
2658
|
+
label: cut(),
|
|
2659
|
+
flags: None$1,
|
|
2660
|
+
command: 'Search.cut'
|
|
2661
|
+
}, {
|
|
2662
|
+
id: 'copy',
|
|
2663
|
+
label: copy(),
|
|
2664
|
+
flags: None$1,
|
|
2665
|
+
command: 'Search.copy'
|
|
2666
|
+
}, {
|
|
2667
|
+
id: 'paste',
|
|
2668
|
+
label: paste(),
|
|
2669
|
+
flags: None$1,
|
|
2670
|
+
command: 'Search.paste'
|
|
2671
|
+
}, {
|
|
2672
|
+
id: 'selectAll',
|
|
2673
|
+
label: selectAll(),
|
|
2674
|
+
flags: None$1,
|
|
2675
|
+
command: 'Search.selectAll'
|
|
2676
|
+
}];
|
|
2677
|
+
};
|
|
2678
|
+
|
|
2679
|
+
const getMenuEntriesList = () => {
|
|
2639
2680
|
return [{
|
|
2640
2681
|
id: 'dismiss',
|
|
2641
2682
|
label: dismiss(),
|
|
@@ -2649,8 +2690,19 @@ const getMenuEntries = () => {
|
|
|
2649
2690
|
}];
|
|
2650
2691
|
};
|
|
2651
2692
|
|
|
2693
|
+
const getMenuEntries = (state, props) => {
|
|
2694
|
+
if (props.menuId === Search$1) {
|
|
2695
|
+
return getMenuEntriesList();
|
|
2696
|
+
}
|
|
2697
|
+
if (props.menuId === InputContextMenu$1) {
|
|
2698
|
+
return getMenuEntriesInput();
|
|
2699
|
+
}
|
|
2700
|
+
return [];
|
|
2701
|
+
};
|
|
2702
|
+
|
|
2703
|
+
const InputContextMenu = 91;
|
|
2652
2704
|
const getMenuEntryIds = () => {
|
|
2653
|
-
return [Search$1];
|
|
2705
|
+
return [Search$1, InputContextMenu];
|
|
2654
2706
|
};
|
|
2655
2707
|
|
|
2656
2708
|
const handleError = error => {
|
|
@@ -3307,6 +3359,20 @@ const handleInputBlur = async (state, name) => {
|
|
|
3307
3359
|
return state;
|
|
3308
3360
|
};
|
|
3309
3361
|
|
|
3362
|
+
const show2 = async (uid, menuId, x, y, args) => {
|
|
3363
|
+
await showContextMenu2(uid, menuId, x, y, args);
|
|
3364
|
+
};
|
|
3365
|
+
|
|
3366
|
+
const handleInputContextMenu = async (state, button, x, y) => {
|
|
3367
|
+
const {
|
|
3368
|
+
uid
|
|
3369
|
+
} = state;
|
|
3370
|
+
await show2(uid, InputContextMenu$1, x, y, {
|
|
3371
|
+
menuId: InputContextMenu$1
|
|
3372
|
+
});
|
|
3373
|
+
return state;
|
|
3374
|
+
};
|
|
3375
|
+
|
|
3310
3376
|
const getSearchFocusKey = key => {
|
|
3311
3377
|
switch (key) {
|
|
3312
3378
|
case SearchValue:
|
|
@@ -3469,6 +3535,7 @@ const focusIndexScrollDown = (state, index, listHeight, itemHeight, itemsLength)
|
|
|
3469
3535
|
return {
|
|
3470
3536
|
...state,
|
|
3471
3537
|
focusedIndex: index,
|
|
3538
|
+
listFocusedIndex: index,
|
|
3472
3539
|
minLineY: newMinLineY,
|
|
3473
3540
|
maxLineY: newMaxLineY,
|
|
3474
3541
|
focused: true,
|
|
@@ -3491,6 +3558,7 @@ const focusIndexScrollUp = (state, index, listHeight, itemHeight, itemsLength) =
|
|
|
3491
3558
|
return {
|
|
3492
3559
|
...state,
|
|
3493
3560
|
focusedIndex: index,
|
|
3561
|
+
listFocusedIndex: index,
|
|
3494
3562
|
minLineY: newMinLineY,
|
|
3495
3563
|
maxLineY: newMaxLineY,
|
|
3496
3564
|
focused: true,
|
|
@@ -3516,6 +3584,7 @@ const focusIndex = (state, index) => {
|
|
|
3516
3584
|
return {
|
|
3517
3585
|
...state,
|
|
3518
3586
|
focusedIndex: -1,
|
|
3587
|
+
listFocusedIndex: -1,
|
|
3519
3588
|
focused: true
|
|
3520
3589
|
};
|
|
3521
3590
|
}
|
|
@@ -3529,6 +3598,7 @@ const focusIndex = (state, index) => {
|
|
|
3529
3598
|
return {
|
|
3530
3599
|
...state,
|
|
3531
3600
|
focusedIndex: index,
|
|
3601
|
+
listFocusedIndex: index,
|
|
3532
3602
|
focused: true
|
|
3533
3603
|
};
|
|
3534
3604
|
};
|
|
@@ -4270,6 +4340,7 @@ const HandleWheel = 16;
|
|
|
4270
4340
|
const HandleInputFocus = 17;
|
|
4271
4341
|
const HandleInputBlur = 18;
|
|
4272
4342
|
const HandleListPointerDown = 19;
|
|
4343
|
+
const HandleInputContextMenu = 20;
|
|
4273
4344
|
|
|
4274
4345
|
const getSearchDetailsToggleVirtualDom = () => {
|
|
4275
4346
|
return [{
|
|
@@ -4449,7 +4520,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
4449
4520
|
onInput,
|
|
4450
4521
|
onFocus: HandleInputFocus,
|
|
4451
4522
|
onBlur: HandleInputBlur,
|
|
4452
|
-
onContextMenu:
|
|
4523
|
+
onContextMenu: HandleInputContextMenu,
|
|
4453
4524
|
childCount: 0
|
|
4454
4525
|
}, {
|
|
4455
4526
|
type: Div,
|
|
@@ -5057,6 +5128,10 @@ const renderEventListeners = () => {
|
|
|
5057
5128
|
name: HandleListContextMenu,
|
|
5058
5129
|
params: ['handleContextMenu', Button$1, ClientX, ClientY],
|
|
5059
5130
|
preventDefault: true
|
|
5131
|
+
}, {
|
|
5132
|
+
name: HandleInputContextMenu,
|
|
5133
|
+
params: ['handleInputContextMenu', Button$1, ClientX, ClientY],
|
|
5134
|
+
preventDefault: true
|
|
5060
5135
|
}, {
|
|
5061
5136
|
name: HandleHeaderContextMenu,
|
|
5062
5137
|
params: ['handleHeaderContextMenu'],
|
|
@@ -5269,10 +5344,6 @@ const viewAsTree = async state => {
|
|
|
5269
5344
|
|
|
5270
5345
|
const Keyboard = -1;
|
|
5271
5346
|
|
|
5272
|
-
const show2 = async (uid, menuId, x, y, args) => {
|
|
5273
|
-
await showContextMenu2(uid, menuId, x, y, args);
|
|
5274
|
-
};
|
|
5275
|
-
|
|
5276
5347
|
const handleContextMenuKeyboard = async state => {
|
|
5277
5348
|
const {
|
|
5278
5349
|
x,
|
|
@@ -5314,7 +5385,7 @@ const commandMap = {
|
|
|
5314
5385
|
'TextSearch.clearSearchResults': wrapCommand(clearSearchResults$1),
|
|
5315
5386
|
'TextSearch.collapseAll': wrapCommand(collapseAll$1),
|
|
5316
5387
|
'TextSearch.collapseDetails': wrapCommand(collapseDetails),
|
|
5317
|
-
'TextSearch.copy': wrapCommand(copy),
|
|
5388
|
+
'TextSearch.copy': wrapCommand(copy$1),
|
|
5318
5389
|
'TextSearch.copyPath': wrapCommand(copyPath$1),
|
|
5319
5390
|
'TextSearch.diff2': diff2,
|
|
5320
5391
|
'TextSearch.dismissItem': wrapCommand(dismissItem),
|
|
@@ -5332,6 +5403,7 @@ const commandMap = {
|
|
|
5332
5403
|
'TextSearch.focusPreserveCasePrevious': wrapCommand(focusPreserveCasePrevious),
|
|
5333
5404
|
'TextSearch.focusPrevious': wrapCommand(focusPrevious),
|
|
5334
5405
|
'TextSearch.focusPreviousInput': wrapCommand(focusPreviousInput),
|
|
5406
|
+
'TextSearch.handleInputContextMenu': wrapCommand(handleInputContextMenu),
|
|
5335
5407
|
'TextSearch.focusPreviousPage': wrapCommand(focusPreviousPage),
|
|
5336
5408
|
'TextSearch.focusRegex': wrapCommand(focusRegex),
|
|
5337
5409
|
'TextSearch.focusRegexNext': wrapCommand(focusRegexNext),
|
|
@@ -5384,6 +5456,7 @@ const commandMap = {
|
|
|
5384
5456
|
'TextSearch.toggleUseIgnoreFiles': wrapCommand(toggleUseIgnoreFiles),
|
|
5385
5457
|
'TextSearch.toggleUseRegularExpression': wrapCommand(toggleUseRegularExpression),
|
|
5386
5458
|
'TextSearch.viewAsTree': wrapCommand(viewAsTree),
|
|
5459
|
+
'TextSearch.getMenuEntries': wrapGetter(getMenuEntries),
|
|
5387
5460
|
// not wrapped
|
|
5388
5461
|
'TextSearch.initialize': initialize,
|
|
5389
5462
|
'TextSearch.create': create,
|
|
@@ -5397,7 +5470,6 @@ const commandMap = {
|
|
|
5397
5470
|
'TextSearch.terminate': terminate,
|
|
5398
5471
|
'TextSearch.renderActions': renderActions,
|
|
5399
5472
|
'TextSearch.getMenuEntryIds': getMenuEntryIds,
|
|
5400
|
-
'TextSearch.getMenuEntries': getMenuEntries,
|
|
5401
5473
|
// TODO needed?
|
|
5402
5474
|
'TextSearch.replaceAllAndPrompt': replaceAllAndPrompt,
|
|
5403
5475
|
'TextSearch.textSearch': textSearch$6
|