@lvce-editor/extension-search-view 2.7.0 → 2.8.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.
|
@@ -1176,8 +1176,8 @@ const clearSearchResults = state => {
|
|
|
1176
1176
|
return handleInput(state, '');
|
|
1177
1177
|
};
|
|
1178
1178
|
|
|
1179
|
-
const closeSuggest =
|
|
1180
|
-
|
|
1179
|
+
const closeSuggest = state => {
|
|
1180
|
+
return state;
|
|
1181
1181
|
};
|
|
1182
1182
|
|
|
1183
1183
|
const states = Object.create(null);
|
|
@@ -1216,7 +1216,8 @@ const create = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
|
1216
1216
|
size: 0,
|
|
1217
1217
|
width,
|
|
1218
1218
|
x,
|
|
1219
|
-
y
|
|
1219
|
+
y,
|
|
1220
|
+
focused: false
|
|
1220
1221
|
};
|
|
1221
1222
|
set$1(id, state, state);
|
|
1222
1223
|
};
|
|
@@ -1362,7 +1363,7 @@ const focusNext = state => {
|
|
|
1362
1363
|
return focusIndex(state, nextIndex);
|
|
1363
1364
|
};
|
|
1364
1365
|
|
|
1365
|
-
const focusNextPage =
|
|
1366
|
+
const focusNextPage = state => {
|
|
1366
1367
|
const {
|
|
1367
1368
|
focusedIndex,
|
|
1368
1369
|
items,
|
|
@@ -1376,7 +1377,7 @@ const focusNextPage = async state => {
|
|
|
1376
1377
|
return focusIndex(state, indexNextPage);
|
|
1377
1378
|
};
|
|
1378
1379
|
|
|
1379
|
-
const focusPreviousPage =
|
|
1380
|
+
const focusPreviousPage = state => {
|
|
1380
1381
|
const {
|
|
1381
1382
|
focusedIndex,
|
|
1382
1383
|
minLineY,
|
|
@@ -1509,6 +1510,30 @@ const handleClick = async (state, index) => {
|
|
|
1509
1510
|
return focusIndex(state, actualIndex);
|
|
1510
1511
|
};
|
|
1511
1512
|
|
|
1513
|
+
const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight) => {
|
|
1514
|
+
const relativeY = eventY - y + deltaY;
|
|
1515
|
+
const index = Math.floor(relativeY / itemHeight);
|
|
1516
|
+
return index;
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1519
|
+
const selectIndex = (state, index) => {
|
|
1520
|
+
return {
|
|
1521
|
+
...state,
|
|
1522
|
+
focusedIndex: index
|
|
1523
|
+
};
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
const handleClickAt = async (state, eventX, eventY) => {
|
|
1527
|
+
const {
|
|
1528
|
+
x,
|
|
1529
|
+
y,
|
|
1530
|
+
itemHeight,
|
|
1531
|
+
deltaY
|
|
1532
|
+
} = state;
|
|
1533
|
+
const index = getListIndex(eventX, eventY, x, y, deltaY, itemHeight);
|
|
1534
|
+
return selectIndex(state, index);
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1512
1537
|
const handleClickCurrent = state => {
|
|
1513
1538
|
const {
|
|
1514
1539
|
focusedIndex
|
|
@@ -1539,11 +1564,12 @@ const handleContextMenu = async (state, button, x, y) => {
|
|
|
1539
1564
|
};
|
|
1540
1565
|
|
|
1541
1566
|
const handleDisable = (state, id) => {
|
|
1567
|
+
return state;
|
|
1542
1568
|
// TODO
|
|
1543
1569
|
};
|
|
1544
1570
|
|
|
1545
1571
|
const handleEnable = (state, id) => {
|
|
1546
|
-
|
|
1572
|
+
return state;
|
|
1547
1573
|
};
|
|
1548
1574
|
|
|
1549
1575
|
const setFocus = async focusId => {
|
|
@@ -1557,6 +1583,7 @@ const handleFocus = async state => {
|
|
|
1557
1583
|
|
|
1558
1584
|
// TODO show error / warning when installment fails / times out
|
|
1559
1585
|
const handleInstall = async (state, id) => {
|
|
1586
|
+
return state;
|
|
1560
1587
|
// TODO
|
|
1561
1588
|
};
|
|
1562
1589
|
|
|
@@ -1687,7 +1714,7 @@ const handleScrollBarMove = (state, eventY) => {
|
|
|
1687
1714
|
|
|
1688
1715
|
// TODO show error / warning when installment fails / times out
|
|
1689
1716
|
const handleUninstall = async (state, id) => {
|
|
1690
|
-
|
|
1717
|
+
return state;
|
|
1691
1718
|
};
|
|
1692
1719
|
|
|
1693
1720
|
const handleWheel = (state, deltaMode, deltaY) => {
|
|
@@ -1752,8 +1779,8 @@ const loadContent = async (uid, savedState) => {
|
|
|
1752
1779
|
set$1(uid, newState, updatedState);
|
|
1753
1780
|
};
|
|
1754
1781
|
|
|
1755
|
-
const openSuggest =
|
|
1756
|
-
|
|
1782
|
+
const openSuggest = state => {
|
|
1783
|
+
return state;
|
|
1757
1784
|
};
|
|
1758
1785
|
|
|
1759
1786
|
const Actions = 'Actions';
|
|
@@ -2296,15 +2323,8 @@ const scrollDown = state => {
|
|
|
2296
2323
|
return setDeltaY(state, newDeltaY);
|
|
2297
2324
|
};
|
|
2298
2325
|
|
|
2299
|
-
const
|
|
2300
|
-
return
|
|
2301
|
-
...state,
|
|
2302
|
-
focusedIndex: index
|
|
2303
|
-
};
|
|
2304
|
-
};
|
|
2305
|
-
|
|
2306
|
-
const toggleSuggest = () => {
|
|
2307
|
-
// TODO
|
|
2326
|
+
const toggleSuggest = state => {
|
|
2327
|
+
return state;
|
|
2308
2328
|
};
|
|
2309
2329
|
|
|
2310
2330
|
const wrapCommand = fn => {
|
|
@@ -2330,16 +2350,18 @@ const commandMap = {
|
|
|
2330
2350
|
'SearchExtensions.focusNextPage': wrapCommand(focusNextPage),
|
|
2331
2351
|
'SearchExtensions.focusPreviousPage': wrapCommand(focusPreviousPage),
|
|
2332
2352
|
'SearchExtensions.getActions': getActions,
|
|
2353
|
+
'SearchExtensions.getCommandIds': getCommandIds,
|
|
2333
2354
|
'SearchExtensions.getKeyBindings': getKeyBindings,
|
|
2334
2355
|
'SearchExtensions.handleBlur': wrapCommand(handleBlur),
|
|
2335
|
-
'SearchExtensions.handleInput': wrapCommand(handleInput),
|
|
2336
2356
|
'SearchExtensions.handleClick': wrapCommand(handleClick),
|
|
2357
|
+
'SearchExtensions.handleClickAt': wrapCommand(handleClickAt),
|
|
2337
2358
|
'SearchExtensions.handleClickCurrent': wrapCommand(handleClickCurrent),
|
|
2338
2359
|
'SearchExtensions.handleClickCurrentButKeepFocus': wrapCommand(handleClickCurrentButKeepFocus),
|
|
2339
2360
|
'SearchExtensions.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2340
2361
|
'SearchExtensions.handleDisable': wrapCommand(handleDisable),
|
|
2341
2362
|
'SearchExtensions.handleEnable': wrapCommand(handleEnable),
|
|
2342
2363
|
'SearchExtensions.handleFocus': wrapCommand(handleFocus),
|
|
2364
|
+
'SearchExtensions.handleInput': wrapCommand(handleInput),
|
|
2343
2365
|
'SearchExtensions.handleInstall': wrapCommand(handleInstall),
|
|
2344
2366
|
'SearchExtensions.handleScrollBarCaptureLost': wrapCommand(handleScrollBarCaptureLost),
|
|
2345
2367
|
'SearchExtensions.handleScrollBarClick': wrapCommand(handleScrollBarClick),
|
|
@@ -2347,7 +2369,6 @@ const commandMap = {
|
|
|
2347
2369
|
'SearchExtensions.handleUninstall': wrapCommand(handleUninstall),
|
|
2348
2370
|
'SearchExtensions.handleWheel': wrapCommand(handleWheel),
|
|
2349
2371
|
'SearchExtensions.loadContent': loadContent,
|
|
2350
|
-
'SearchExtensions.getCommandIds': getCommandIds,
|
|
2351
2372
|
'SearchExtensions.openSuggest': wrapCommand(openSuggest),
|
|
2352
2373
|
'SearchExtensions.render': doRender,
|
|
2353
2374
|
'SearchExtensions.render2': render2,
|