@lvce-editor/explorer-view 7.2.0 → 7.3.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.
|
@@ -1276,6 +1276,7 @@ const DeltaMode = 'event.deltaMode';
|
|
|
1276
1276
|
const DeltaY = 'event.deltaY';
|
|
1277
1277
|
const EventTargetClassName = 'event.target.className';
|
|
1278
1278
|
const IsTrusted = 'event.isTrusted';
|
|
1279
|
+
const Key = 'event.key';
|
|
1279
1280
|
const ShiftKey = 'event.shiftKey';
|
|
1280
1281
|
const TargetName = 'event.target.name';
|
|
1281
1282
|
const TargetValue = 'event.target.value';
|
|
@@ -3695,6 +3696,18 @@ const getMouseActions = () => {
|
|
|
3695
3696
|
}];
|
|
3696
3697
|
};
|
|
3697
3698
|
|
|
3699
|
+
const getTitle$1 = state => {
|
|
3700
|
+
const {
|
|
3701
|
+
pathSeparator,
|
|
3702
|
+
root
|
|
3703
|
+
} = state;
|
|
3704
|
+
if (!root) {
|
|
3705
|
+
return 'Explorer';
|
|
3706
|
+
}
|
|
3707
|
+
const normalizedRoot = root.endsWith(pathSeparator) && root !== pathSeparator ? root.slice(0, -pathSeparator.length) : root;
|
|
3708
|
+
return getBaseName(pathSeparator, normalizedRoot) || normalizedRoot;
|
|
3709
|
+
};
|
|
3710
|
+
|
|
3698
3711
|
const getParentStartIndex = (dirents, index) => {
|
|
3699
3712
|
const dirent = dirents[index];
|
|
3700
3713
|
let startIndex = index - 1;
|
|
@@ -5301,7 +5314,7 @@ const filterByFocusWord = (items, focusedIndex, focusWord) => {
|
|
|
5301
5314
|
}
|
|
5302
5315
|
const matches = [];
|
|
5303
5316
|
for (let i = 0; i < items.length; i++) {
|
|
5304
|
-
if (items[i].toLowerCase().
|
|
5317
|
+
if (items[i].toLowerCase().startsWith(focusWord)) {
|
|
5305
5318
|
matches.push(i);
|
|
5306
5319
|
}
|
|
5307
5320
|
}
|
|
@@ -5318,19 +5331,22 @@ const filterByFocusWord = (items, focusedIndex, focusWord) => {
|
|
|
5318
5331
|
return matches[nextIndex];
|
|
5319
5332
|
};
|
|
5320
5333
|
|
|
5321
|
-
const RE_ASCII = /^[a-z]
|
|
5334
|
+
const RE_ASCII = /^[a-z]$/i;
|
|
5322
5335
|
const isAscii = key => {
|
|
5323
5336
|
return RE_ASCII.test(key);
|
|
5324
5337
|
};
|
|
5325
5338
|
|
|
5326
5339
|
const typeAheadTimeout = {};
|
|
5327
|
-
const handleKeyDown = (state, key) => {
|
|
5340
|
+
const handleKeyDown = (state, defaultPrevented, key) => {
|
|
5328
5341
|
const {
|
|
5329
5342
|
focusedIndex,
|
|
5330
5343
|
focusWord,
|
|
5331
5344
|
focusWordTimeout,
|
|
5332
5345
|
items
|
|
5333
5346
|
} = state;
|
|
5347
|
+
if (defaultPrevented) {
|
|
5348
|
+
return state;
|
|
5349
|
+
}
|
|
5334
5350
|
if (focusWord && key === '') {
|
|
5335
5351
|
return cancelTypeAhead(state);
|
|
5336
5352
|
}
|
|
@@ -6068,6 +6084,7 @@ const HandleDrop = 6;
|
|
|
6068
6084
|
const HandleEditingInput = 7;
|
|
6069
6085
|
const HandleInputBlur = 8;
|
|
6070
6086
|
const HandleInputClick = 9;
|
|
6087
|
+
const HandleKeyDown = 21;
|
|
6071
6088
|
const HandleListBlur = 11;
|
|
6072
6089
|
const HandleListFocus = 12;
|
|
6073
6090
|
const HandlePointerDown = 14;
|
|
@@ -6549,6 +6566,9 @@ const renderEventListeners = () => {
|
|
|
6549
6566
|
}, {
|
|
6550
6567
|
name: HandleListBlur,
|
|
6551
6568
|
params: ['handleBlur']
|
|
6569
|
+
}, {
|
|
6570
|
+
name: HandleKeyDown,
|
|
6571
|
+
params: ['handleKeyDown', DefaultPrevented, Key]
|
|
6552
6572
|
}, {
|
|
6553
6573
|
name: HandleClick,
|
|
6554
6574
|
params: ['handleClickAt', DefaultPrevented, Button$3, CtrlKey, ShiftKey, ClientX, ClientY],
|
|
@@ -6950,6 +6970,7 @@ const commandMap = {
|
|
|
6950
6970
|
'Explorer.getMenuEntries': getMenuEntries,
|
|
6951
6971
|
'Explorer.getMenuEntries2': wrapGetter(getMenuEntries2),
|
|
6952
6972
|
'Explorer.getMouseActions': getMouseActions,
|
|
6973
|
+
'Explorer.getTitle': wrapGetter(getTitle$1),
|
|
6953
6974
|
'Explorer.handleArrowLeft': wrapListItemCommand(handleArrowLeft),
|
|
6954
6975
|
'Explorer.handleArrowRight': wrapListItemCommand(handleArrowRight),
|
|
6955
6976
|
'Explorer.handleBlur': wrapListItemCommand(handleBlur),
|