@lvce-editor/extension-search-view 2.3.0 → 2.4.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.
|
@@ -898,7 +898,7 @@ const getFinalDeltaY = (height, itemHeight, itemsLength) => {
|
|
|
898
898
|
return finalDeltaY;
|
|
899
899
|
};
|
|
900
900
|
|
|
901
|
-
const getListHeight
|
|
901
|
+
const getListHeight = (itemsLength, itemHeight, maxHeight) => {
|
|
902
902
|
number(itemsLength);
|
|
903
903
|
number(itemHeight);
|
|
904
904
|
number(maxHeight);
|
|
@@ -1139,8 +1139,7 @@ const handleInput = async (state, value) => {
|
|
|
1139
1139
|
placeholder: searchExtensionsInMarketPlace()
|
|
1140
1140
|
};
|
|
1141
1141
|
}
|
|
1142
|
-
|
|
1143
|
-
const listHeight = getListHeight$1(state);
|
|
1142
|
+
const listHeight = getListHeight(state.items.length, state.itemHeight, state.height);
|
|
1144
1143
|
const total = items.length;
|
|
1145
1144
|
const contentHeight = total * itemHeight;
|
|
1146
1145
|
const scrollBarHeight = getScrollBarSize(height, contentHeight, minimumSliderSize);
|
|
@@ -1694,7 +1693,7 @@ const getAllExtensions = async platform => {
|
|
|
1694
1693
|
if (platform === Web) {
|
|
1695
1694
|
return [];
|
|
1696
1695
|
}
|
|
1697
|
-
return
|
|
1696
|
+
return invoke('ExtensionManagement.getAllExtensions');
|
|
1698
1697
|
};
|
|
1699
1698
|
|
|
1700
1699
|
const Small = 1;
|
|
@@ -2139,8 +2138,7 @@ const position = (x, y) => {
|
|
|
2139
2138
|
};
|
|
2140
2139
|
|
|
2141
2140
|
const renderScrollBar$1 = newState => {
|
|
2142
|
-
|
|
2143
|
-
const listHeight = getListHeight(newState);
|
|
2141
|
+
const listHeight = getListHeight(newState.items.length, newState.itemHeight, newState.height);
|
|
2144
2142
|
const total = newState.items.length;
|
|
2145
2143
|
const contentHeight = total * newState.itemHeight;
|
|
2146
2144
|
const scrollBarHeight = getScrollBarSize(listHeight, contentHeight, newState.minimumSliderSize);
|
|
@@ -2294,44 +2292,55 @@ const toggleSuggest = () => {
|
|
|
2294
2292
|
// TODO
|
|
2295
2293
|
};
|
|
2296
2294
|
|
|
2295
|
+
const wrapCommand = fn => {
|
|
2296
|
+
const wrapped = async (uid, ...args) => {
|
|
2297
|
+
const {
|
|
2298
|
+
newState
|
|
2299
|
+
} = get$1(uid);
|
|
2300
|
+
const newerState = await fn(newState, ...args);
|
|
2301
|
+
set$1(uid, newState, newerState);
|
|
2302
|
+
};
|
|
2303
|
+
return wrapped;
|
|
2304
|
+
};
|
|
2305
|
+
|
|
2297
2306
|
const commandMap = {
|
|
2298
|
-
'SearchExtensions.clearSearchResults': clearSearchResults,
|
|
2299
|
-
'SearchExtensions.closeSuggest': closeSuggest,
|
|
2307
|
+
'SearchExtensions.clearSearchResults': wrapCommand(clearSearchResults),
|
|
2308
|
+
'SearchExtensions.closeSuggest': wrapCommand(closeSuggest),
|
|
2300
2309
|
'SearchExtensions.create': create,
|
|
2301
2310
|
'SearchExtensions.diff': diff,
|
|
2302
|
-
'SearchExtensions.focusFirst': focusFirst,
|
|
2303
|
-
'SearchExtensions.focusIndex': focusIndex,
|
|
2304
|
-
'SearchExtensions.focusLast': focusLast,
|
|
2305
|
-
'SearchExtensions.focusNext': focusNext,
|
|
2306
|
-
'SearchExtensions.focusNextPage': focusNextPage,
|
|
2307
|
-
'SearchExtensions.focusPreviousPage': focusPreviousPage,
|
|
2311
|
+
'SearchExtensions.focusFirst': wrapCommand(focusFirst),
|
|
2312
|
+
'SearchExtensions.focusIndex': wrapCommand(focusIndex),
|
|
2313
|
+
'SearchExtensions.focusLast': wrapCommand(focusLast),
|
|
2314
|
+
'SearchExtensions.focusNext': wrapCommand(focusNext),
|
|
2315
|
+
'SearchExtensions.focusNextPage': wrapCommand(focusNextPage),
|
|
2316
|
+
'SearchExtensions.focusPreviousPage': wrapCommand(focusPreviousPage),
|
|
2308
2317
|
'SearchExtensions.getActions': getActions,
|
|
2309
2318
|
'SearchExtensions.getKeyBindings': getKeyBindings,
|
|
2310
|
-
'SearchExtensions.handleBlur': handleBlur,
|
|
2319
|
+
'SearchExtensions.handleBlur': wrapCommand(handleBlur),
|
|
2311
2320
|
'SearchExtensions.renderEventListeners': renderEventListeners,
|
|
2312
|
-
'SearchExtensions.handleClick': handleClick,
|
|
2313
|
-
'SearchExtensions.handleClickCurrent': handleClickCurrent,
|
|
2314
|
-
'SearchExtensions.handleClickCurrentButKeepFocus': handleClickCurrentButKeepFocus,
|
|
2321
|
+
'SearchExtensions.handleClick': wrapCommand(handleClick),
|
|
2322
|
+
'SearchExtensions.handleClickCurrent': wrapCommand(handleClickCurrent),
|
|
2323
|
+
'SearchExtensions.handleClickCurrentButKeepFocus': wrapCommand(handleClickCurrentButKeepFocus),
|
|
2315
2324
|
'SearchExtensions.renderActions': renderActions,
|
|
2316
|
-
'SearchExtensions.handleContextMenu': handleContextMenu,
|
|
2317
|
-
'SearchExtensions.handleDisable': handleDisable,
|
|
2318
|
-
'SearchExtensions.handleEnable': handleEnable,
|
|
2319
|
-
'SearchExtensions.handleFocus': handleFocus,
|
|
2320
|
-
'SearchExtensions.handleInstall': handleInstall,
|
|
2321
|
-
'SearchExtensions.handleScrollBarCaptureLos': handleScrollBarCaptureLost,
|
|
2322
|
-
'SearchExtensions.handleScrollBarClick': handleScrollBarClick,
|
|
2323
|
-
'SearchExtensions.handleScrollBarMove': handleScrollBarMove,
|
|
2324
|
-
'SearchExtensions.handleUninstall': handleUninstall,
|
|
2325
|
-
'SearchExtensions.handleWheel': handleWheel,
|
|
2325
|
+
'SearchExtensions.handleContextMenu': wrapCommand(handleContextMenu),
|
|
2326
|
+
'SearchExtensions.handleDisable': wrapCommand(handleDisable),
|
|
2327
|
+
'SearchExtensions.handleEnable': wrapCommand(handleEnable),
|
|
2328
|
+
'SearchExtensions.handleFocus': wrapCommand(handleFocus),
|
|
2329
|
+
'SearchExtensions.handleInstall': wrapCommand(handleInstall),
|
|
2330
|
+
'SearchExtensions.handleScrollBarCaptureLos': wrapCommand(handleScrollBarCaptureLost),
|
|
2331
|
+
'SearchExtensions.handleScrollBarClick': wrapCommand(handleScrollBarClick),
|
|
2332
|
+
'SearchExtensions.handleScrollBarMove': wrapCommand(handleScrollBarMove),
|
|
2333
|
+
'SearchExtensions.handleUninstall': wrapCommand(handleUninstall),
|
|
2334
|
+
'SearchExtensions.handleWheel': wrapCommand(handleWheel),
|
|
2326
2335
|
'SearchExtensions.loadContent': loadContent,
|
|
2327
|
-
'SearchExtensions.openSuggest': openSuggest,
|
|
2336
|
+
'SearchExtensions.openSuggest': wrapCommand(openSuggest),
|
|
2328
2337
|
'SearchExtensions.render': doRender,
|
|
2329
2338
|
'SearchExtensions.saveState': saveState,
|
|
2330
|
-
'SearchExtensions.scrollDown': scrollDown,
|
|
2339
|
+
'SearchExtensions.scrollDown': wrapCommand(scrollDown),
|
|
2331
2340
|
'SearchExtensions.searchExtensions': searchExtensions,
|
|
2332
|
-
'SearchExtensions.selectIndex': selectIndex,
|
|
2333
|
-
'SearchExtensions.setDeltaY': setDeltaY,
|
|
2334
|
-
'SearchExtensions.toggleSuggest': toggleSuggest
|
|
2341
|
+
'SearchExtensions.selectIndex': wrapCommand(selectIndex),
|
|
2342
|
+
'SearchExtensions.setDeltaY': wrapCommand(setDeltaY),
|
|
2343
|
+
'SearchExtensions.toggleSuggest': wrapCommand(toggleSuggest)
|
|
2335
2344
|
};
|
|
2336
2345
|
|
|
2337
2346
|
const listen = async () => {
|