@lvce-editor/extension-search-view 2.8.0 → 2.9.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.
|
@@ -1139,7 +1139,7 @@ const handleInput = async (state, value) => {
|
|
|
1139
1139
|
placeholder: searchExtensionsInMarketPlace()
|
|
1140
1140
|
};
|
|
1141
1141
|
}
|
|
1142
|
-
const listHeight = getListHeight(
|
|
1142
|
+
const listHeight = getListHeight(items.length, itemHeight, height);
|
|
1143
1143
|
const total = items.length;
|
|
1144
1144
|
const contentHeight = total * itemHeight;
|
|
1145
1145
|
const scrollBarHeight = getScrollBarSize(height, contentHeight, minimumSliderSize);
|
|
@@ -1217,7 +1217,8 @@ const create = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
|
1217
1217
|
width,
|
|
1218
1218
|
x,
|
|
1219
1219
|
y,
|
|
1220
|
-
focused: false
|
|
1220
|
+
focused: false,
|
|
1221
|
+
inputSource: 0
|
|
1221
1222
|
};
|
|
1222
1223
|
set$1(id, state, state);
|
|
1223
1224
|
};
|
|
@@ -1228,31 +1229,31 @@ const RenderScrollBar = 5;
|
|
|
1228
1229
|
const RenderMessage = 6;
|
|
1229
1230
|
|
|
1230
1231
|
const diffType$4 = RenderItems;
|
|
1231
|
-
const isEqual$
|
|
1232
|
+
const isEqual$5 = (oldState, newState) => {
|
|
1232
1233
|
return true;
|
|
1233
1234
|
};
|
|
1234
1235
|
|
|
1235
1236
|
const diffType$3 = RenderHeader;
|
|
1236
|
-
const isEqual$
|
|
1237
|
+
const isEqual$4 = (oldState, newState) => {
|
|
1237
1238
|
return oldState.placeholder === newState.placeholder;
|
|
1238
1239
|
};
|
|
1239
1240
|
|
|
1240
1241
|
const diffType$2 = RenderItems;
|
|
1241
|
-
const isEqual$
|
|
1242
|
+
const isEqual$3 = (oldState, newState) => {
|
|
1242
1243
|
return oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.deltaY === newState.deltaY && oldState.focusedIndex === newState.focusedIndex;
|
|
1243
1244
|
};
|
|
1244
1245
|
|
|
1245
1246
|
const diffType$1 = RenderMessage;
|
|
1246
|
-
const isEqual$
|
|
1247
|
+
const isEqual$2 = (oldState, newState) => {
|
|
1247
1248
|
return oldState.message === newState.message;
|
|
1248
1249
|
};
|
|
1249
1250
|
|
|
1250
1251
|
const diffType = RenderScrollBar;
|
|
1251
|
-
const isEqual = (oldState, newState) => {
|
|
1252
|
+
const isEqual$1 = (oldState, newState) => {
|
|
1252
1253
|
return oldState.negativeMargin === newState.negativeMargin && oldState.deltaY === newState.deltaY && oldState.height === newState.height && oldState.finalDeltaY === newState.finalDeltaY && oldState.items.length === newState.items.length && oldState.scrollBarActive === newState.scrollBarActive;
|
|
1253
1254
|
};
|
|
1254
1255
|
|
|
1255
|
-
const modules = [isEqual$
|
|
1256
|
+
const modules = [isEqual$5, isEqual$1, isEqual$2, isEqual$4, isEqual$3];
|
|
1256
1257
|
const numbers = [diffType$4, diffType, diffType$1, diffType$3, diffType$2];
|
|
1257
1258
|
|
|
1258
1259
|
const diff = (oldState, newState) => {
|
|
@@ -1744,12 +1745,16 @@ const getViewletSize = width => {
|
|
|
1744
1745
|
return Large;
|
|
1745
1746
|
};
|
|
1746
1747
|
|
|
1748
|
+
const User = 1;
|
|
1749
|
+
const Script = 2;
|
|
1750
|
+
|
|
1747
1751
|
const getSavedValue = savedState => {
|
|
1748
1752
|
if (savedState && typeof savedState === 'object' && 'searchValue' in savedState && typeof savedState.searchValue === 'string') {
|
|
1749
1753
|
return savedState.searchValue;
|
|
1750
1754
|
}
|
|
1751
1755
|
return '';
|
|
1752
1756
|
};
|
|
1757
|
+
|
|
1753
1758
|
const restoreState = savedState => {
|
|
1754
1759
|
const searchValue = getSavedValue(savedState);
|
|
1755
1760
|
return {
|
|
@@ -1774,7 +1779,8 @@ const loadContent = async (uid, savedState) => {
|
|
|
1774
1779
|
const updatedState = await handleInput({
|
|
1775
1780
|
...newState,
|
|
1776
1781
|
allExtensions,
|
|
1777
|
-
size
|
|
1782
|
+
size,
|
|
1783
|
+
inputSource: Script
|
|
1778
1784
|
}, searchValue);
|
|
1779
1785
|
set$1(uid, newState, updatedState);
|
|
1780
1786
|
};
|
|
@@ -1783,6 +1789,10 @@ const openSuggest = state => {
|
|
|
1783
1789
|
return state;
|
|
1784
1790
|
};
|
|
1785
1791
|
|
|
1792
|
+
const isEqual = (oldState, newState) => {
|
|
1793
|
+
return newState.inputSource === User || oldState.searchValue === newState.searchValue;
|
|
1794
|
+
};
|
|
1795
|
+
|
|
1786
1796
|
const Actions = 'Actions';
|
|
1787
1797
|
const ExtensionActions = 'ExtensionActions';
|
|
1788
1798
|
const ExtensionActive = 'ExtensionActive';
|
|
@@ -2188,38 +2198,36 @@ const renderScrollBar$1 = newState => {
|
|
|
2188
2198
|
};
|
|
2189
2199
|
|
|
2190
2200
|
const renderExtensions = {
|
|
2191
|
-
isEqual: isEqual$
|
|
2201
|
+
isEqual: isEqual$3,
|
|
2192
2202
|
apply(oldState, newState) {
|
|
2193
2203
|
return renderItems(newState);
|
|
2194
2204
|
}
|
|
2195
2205
|
};
|
|
2196
2206
|
const renderScrollBar = {
|
|
2197
|
-
isEqual: isEqual,
|
|
2207
|
+
isEqual: isEqual$1,
|
|
2198
2208
|
apply(oldState, newState) {
|
|
2199
2209
|
return renderScrollBar$1(newState);
|
|
2200
2210
|
}
|
|
2201
2211
|
};
|
|
2202
2212
|
const renderMessage = {
|
|
2203
|
-
isEqual: isEqual$
|
|
2213
|
+
isEqual: isEqual$2,
|
|
2204
2214
|
apply(oldState, newState) {
|
|
2205
2215
|
return renderMessage$1(newState);
|
|
2206
2216
|
}
|
|
2207
2217
|
};
|
|
2208
2218
|
const renderSearchValue = {
|
|
2209
|
-
isEqual
|
|
2210
|
-
return oldState.searchValue === newState.searchValue;
|
|
2211
|
-
},
|
|
2219
|
+
isEqual: isEqual,
|
|
2212
2220
|
apply(oldState, newState) {
|
|
2213
2221
|
return [/* method */SetSearchValue, oldState.searchValue, newState.searchValue];
|
|
2214
2222
|
}
|
|
2215
2223
|
};
|
|
2216
2224
|
const renderHeader = {
|
|
2217
|
-
isEqual: isEqual$
|
|
2225
|
+
isEqual: isEqual$4,
|
|
2218
2226
|
apply(oldState, newState) {
|
|
2219
2227
|
return renderHeader$1(newState);
|
|
2220
2228
|
}
|
|
2221
2229
|
};
|
|
2222
|
-
const render = [renderScrollBar, renderMessage, renderExtensions,
|
|
2230
|
+
const render = [renderScrollBar, renderMessage, renderExtensions, renderHeader, renderSearchValue];
|
|
2223
2231
|
const doRender = (oldState, newState) => {
|
|
2224
2232
|
const commands = [];
|
|
2225
2233
|
for (const item of render) {
|
|
@@ -2305,10 +2313,13 @@ const renderEventListeners = () => {
|
|
|
2305
2313
|
}];
|
|
2306
2314
|
};
|
|
2307
2315
|
|
|
2308
|
-
const saveState =
|
|
2316
|
+
const saveState = uid => {
|
|
2317
|
+
const {
|
|
2318
|
+
newState
|
|
2319
|
+
} = get$1(uid);
|
|
2309
2320
|
const {
|
|
2310
2321
|
searchValue
|
|
2311
|
-
} =
|
|
2322
|
+
} = newState;
|
|
2312
2323
|
return {
|
|
2313
2324
|
searchValue
|
|
2314
2325
|
};
|
|
@@ -2323,6 +2334,10 @@ const scrollDown = state => {
|
|
|
2323
2334
|
return setDeltaY(state, newDeltaY);
|
|
2324
2335
|
};
|
|
2325
2336
|
|
|
2337
|
+
const terminate = () => {
|
|
2338
|
+
globalThis.close();
|
|
2339
|
+
};
|
|
2340
|
+
|
|
2326
2341
|
const toggleSuggest = state => {
|
|
2327
2342
|
return state;
|
|
2328
2343
|
};
|
|
@@ -2344,6 +2359,7 @@ const commandMap = {
|
|
|
2344
2359
|
'SearchExtensions.create': create,
|
|
2345
2360
|
'SearchExtensions.diff': diff,
|
|
2346
2361
|
'SearchExtensions.focusFirst': wrapCommand(focusFirst),
|
|
2362
|
+
'SearchExtensions.terminate': terminate,
|
|
2347
2363
|
'SearchExtensions.focusIndex': wrapCommand(focusIndex),
|
|
2348
2364
|
'SearchExtensions.focusLast': wrapCommand(focusLast),
|
|
2349
2365
|
'SearchExtensions.focusNext': wrapCommand(focusNext),
|