@lvce-editor/extension-search-view 3.0.0 → 3.2.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.
|
@@ -436,7 +436,7 @@ const set$2 = (id, fn) => {
|
|
|
436
436
|
const get$2 = id => {
|
|
437
437
|
return callbacks[id];
|
|
438
438
|
};
|
|
439
|
-
const remove
|
|
439
|
+
const remove = id => {
|
|
440
440
|
delete callbacks[id];
|
|
441
441
|
};
|
|
442
442
|
let id = 0;
|
|
@@ -455,7 +455,7 @@ const registerPromise = () => {
|
|
|
455
455
|
promise
|
|
456
456
|
};
|
|
457
457
|
};
|
|
458
|
-
const create$2 = (method, params) => {
|
|
458
|
+
const create$2$1 = (method, params) => {
|
|
459
459
|
const {
|
|
460
460
|
id,
|
|
461
461
|
promise
|
|
@@ -613,7 +613,7 @@ const resolve = (id, response) => {
|
|
|
613
613
|
return;
|
|
614
614
|
}
|
|
615
615
|
fn(response);
|
|
616
|
-
remove
|
|
616
|
+
remove(id);
|
|
617
617
|
};
|
|
618
618
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
|
619
619
|
const getErrorType = prettyError => {
|
|
@@ -747,7 +747,7 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
747
747
|
const {
|
|
748
748
|
message,
|
|
749
749
|
promise
|
|
750
|
-
} = create$2(method, params);
|
|
750
|
+
} = create$2$1(method, params);
|
|
751
751
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
752
752
|
ipc.sendAndTransfer(message);
|
|
753
753
|
} else {
|
|
@@ -831,7 +831,7 @@ const listen$1 = async (module, options) => {
|
|
|
831
831
|
const ipc = module.wrap(rawIpc);
|
|
832
832
|
return ipc;
|
|
833
833
|
};
|
|
834
|
-
const create$
|
|
834
|
+
const create$2 = async ({
|
|
835
835
|
commandMap
|
|
836
836
|
}) => {
|
|
837
837
|
// TODO create a commandMap per rpc instance
|
|
@@ -843,7 +843,7 @@ const create$1 = async ({
|
|
|
843
843
|
};
|
|
844
844
|
const WebWorkerRpcClient = {
|
|
845
845
|
__proto__: null,
|
|
846
|
-
create: create$
|
|
846
|
+
create: create$2
|
|
847
847
|
};
|
|
848
848
|
|
|
849
849
|
const handleError = (error, notify = true, prefix = '') => {
|
|
@@ -1063,8 +1063,8 @@ const handleInput = async (state, value) => {
|
|
|
1063
1063
|
placeholder: searchExtensionsInMarketPlace()
|
|
1064
1064
|
};
|
|
1065
1065
|
}
|
|
1066
|
-
const listHeight = getListHeight(items.length, itemHeight, height);
|
|
1067
1066
|
const total = items.length;
|
|
1067
|
+
const listHeight = getListHeight(total, itemHeight, height);
|
|
1068
1068
|
const contentHeight = total * itemHeight;
|
|
1069
1069
|
const scrollBarHeight = getScrollBarSize(height, contentHeight, minimumSliderSize);
|
|
1070
1070
|
const numberOfVisible = getNumberOfVisibleItems$1(listHeight, itemHeight);
|
|
@@ -1104,19 +1104,33 @@ const closeSuggest = state => {
|
|
|
1104
1104
|
return state;
|
|
1105
1105
|
};
|
|
1106
1106
|
|
|
1107
|
-
const
|
|
1108
|
-
const
|
|
1109
|
-
return
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
oldState,
|
|
1114
|
-
|
|
1107
|
+
const create$1 = () => {
|
|
1108
|
+
const states = Object.create(null);
|
|
1109
|
+
return {
|
|
1110
|
+
get(uid) {
|
|
1111
|
+
return states[uid];
|
|
1112
|
+
},
|
|
1113
|
+
set(uid, oldState, newState) {
|
|
1114
|
+
states[uid] = {
|
|
1115
|
+
oldState,
|
|
1116
|
+
newState
|
|
1117
|
+
};
|
|
1118
|
+
},
|
|
1119
|
+
dispose(uid) {
|
|
1120
|
+
delete states[uid];
|
|
1121
|
+
},
|
|
1122
|
+
getKeys() {
|
|
1123
|
+
return Object.keys(states).map(key => {
|
|
1124
|
+
return Number.parseInt(key);
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1115
1127
|
};
|
|
1116
1128
|
};
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1129
|
+
|
|
1130
|
+
const {
|
|
1131
|
+
get: get$1,
|
|
1132
|
+
set: set$1,
|
|
1133
|
+
dispose: dispose$1} = create$1();
|
|
1120
1134
|
|
|
1121
1135
|
const create = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
1122
1136
|
const state = {
|
|
@@ -1156,56 +1170,59 @@ const RenderScrollBar = 5;
|
|
|
1156
1170
|
const RenderMessage = 6;
|
|
1157
1171
|
const RenderSearchValue = 7;
|
|
1158
1172
|
|
|
1159
|
-
const diffType$
|
|
1160
|
-
const isEqual$
|
|
1173
|
+
const diffType$5 = RenderItems;
|
|
1174
|
+
const isEqual$5 = (oldState, newState) => {
|
|
1161
1175
|
return true;
|
|
1162
1176
|
};
|
|
1163
1177
|
|
|
1164
|
-
const diffType$
|
|
1165
|
-
const isEqual$
|
|
1178
|
+
const diffType$4 = RenderHeader;
|
|
1179
|
+
const isEqual$4 = (oldState, newState) => {
|
|
1166
1180
|
return oldState.placeholder === newState.placeholder;
|
|
1167
1181
|
};
|
|
1168
1182
|
|
|
1169
|
-
const diffType$
|
|
1170
|
-
const isEqual$
|
|
1183
|
+
const diffType$3 = RenderItems;
|
|
1184
|
+
const isEqual$3 = (oldState, newState) => {
|
|
1171
1185
|
return oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.deltaY === newState.deltaY && oldState.focusedIndex === newState.focusedIndex;
|
|
1172
1186
|
};
|
|
1173
1187
|
|
|
1174
|
-
const diffType$
|
|
1175
|
-
const isEqual$
|
|
1188
|
+
const diffType$2 = RenderMessage;
|
|
1189
|
+
const isEqual$2 = (oldState, newState) => {
|
|
1176
1190
|
return oldState.message === newState.message;
|
|
1177
1191
|
};
|
|
1178
1192
|
|
|
1179
|
-
const diffType = RenderScrollBar;
|
|
1180
|
-
const isEqual = (oldState, newState) => {
|
|
1193
|
+
const diffType$1 = RenderScrollBar;
|
|
1194
|
+
const isEqual$1 = (oldState, newState) => {
|
|
1181
1195
|
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;
|
|
1182
1196
|
};
|
|
1183
1197
|
|
|
1184
|
-
const
|
|
1185
|
-
const
|
|
1198
|
+
const User = 1;
|
|
1199
|
+
const Script = 2;
|
|
1186
1200
|
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
const fn = modules[i];
|
|
1191
|
-
if (!fn(oldState, newState)) {
|
|
1192
|
-
diffResult.push(numbers[i]);
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
return diffResult;
|
|
1201
|
+
const diffType = RenderSearchValue;
|
|
1202
|
+
const isEqual = (oldState, newState) => {
|
|
1203
|
+
return newState.inputSource === User || oldState.searchValue === newState.searchValue;
|
|
1196
1204
|
};
|
|
1197
1205
|
|
|
1206
|
+
const modules = [isEqual$1, isEqual$2, isEqual$4, isEqual$3, isEqual$5, isEqual];
|
|
1207
|
+
const numbers = [diffType$1, diffType$2, diffType$4, diffType$3, diffType$5, diffType];
|
|
1208
|
+
|
|
1198
1209
|
const diff2 = uid => {
|
|
1199
1210
|
const {
|
|
1200
1211
|
oldState,
|
|
1201
1212
|
newState
|
|
1202
1213
|
} = get$1(uid);
|
|
1203
|
-
const diffResult =
|
|
1214
|
+
const diffResult = [];
|
|
1215
|
+
for (let i = 0; i < modules.length; i++) {
|
|
1216
|
+
const fn = modules[i];
|
|
1217
|
+
if (!fn(oldState, newState)) {
|
|
1218
|
+
diffResult.push(numbers[i]);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1204
1221
|
return diffResult;
|
|
1205
1222
|
};
|
|
1206
1223
|
|
|
1207
1224
|
const dispose = uid => {
|
|
1208
|
-
|
|
1225
|
+
dispose$1(uid);
|
|
1209
1226
|
};
|
|
1210
1227
|
|
|
1211
1228
|
// TODO optimize this function to return the minimum number
|
|
@@ -1701,8 +1718,6 @@ const getViewletSize = width => {
|
|
|
1701
1718
|
return Large;
|
|
1702
1719
|
};
|
|
1703
1720
|
|
|
1704
|
-
const Script = 2;
|
|
1705
|
-
|
|
1706
1721
|
const getRemoteUrl = (extension, platform, assetDir) => {
|
|
1707
1722
|
if (platform === Remote || platform === Electron) {
|
|
1708
1723
|
if (extension.builtin) {
|