@lvce-editor/extension-search-view 7.20.3 → 7.21.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.
|
@@ -2904,6 +2904,11 @@ const getActions = () => {
|
|
|
2904
2904
|
}];
|
|
2905
2905
|
};
|
|
2906
2906
|
|
|
2907
|
+
const getComponentState = uid => {
|
|
2908
|
+
return get(uid).newState;
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
const Tab = 2;
|
|
2907
2912
|
const Enter = 3;
|
|
2908
2913
|
const Escape = 8;
|
|
2909
2914
|
const Space = 9;
|
|
@@ -2928,6 +2933,10 @@ const getKeyBindings = () => {
|
|
|
2928
2933
|
command: 'Extensions.acceptCompletion',
|
|
2929
2934
|
key: Enter,
|
|
2930
2935
|
when: FocusExtensionsInput
|
|
2936
|
+
}, {
|
|
2937
|
+
command: 'Extensions.acceptCompletion',
|
|
2938
|
+
key: Tab,
|
|
2939
|
+
when: FocusExtensionsInput
|
|
2931
2940
|
}, {
|
|
2932
2941
|
command: 'Extensions.selectPreviousCompletion',
|
|
2933
2942
|
key: UpArrow,
|
|
@@ -5286,6 +5295,23 @@ const selectPreviousCompletion = state => {
|
|
|
5286
5295
|
};
|
|
5287
5296
|
};
|
|
5288
5297
|
|
|
5298
|
+
const applyComponentState = (currentState, state) => {
|
|
5299
|
+
if (!state || typeof state !== 'object' || Array.isArray(state)) {
|
|
5300
|
+
throw new TypeError('Extension Search state must be an object');
|
|
5301
|
+
}
|
|
5302
|
+
const {
|
|
5303
|
+
uid
|
|
5304
|
+
} = state;
|
|
5305
|
+
const {
|
|
5306
|
+
uid: currentUid
|
|
5307
|
+
} = currentState;
|
|
5308
|
+
if (uid !== currentUid) {
|
|
5309
|
+
throw new Error(`Extension Search state uid must remain ${currentUid}`);
|
|
5310
|
+
}
|
|
5311
|
+
return state;
|
|
5312
|
+
};
|
|
5313
|
+
const setComponentState = wrapCommand(applyComponentState);
|
|
5314
|
+
|
|
5289
5315
|
const toggleSuggest = state => {
|
|
5290
5316
|
return state.suggestOpen ? closeSuggest(state) : openSuggest(state);
|
|
5291
5317
|
};
|
|
@@ -5327,6 +5353,7 @@ const commandMap = {
|
|
|
5327
5353
|
'SearchExtensions.focusPreviousPage': wrapCommand(focusPreviousPage),
|
|
5328
5354
|
'SearchExtensions.getActions': getActions,
|
|
5329
5355
|
'SearchExtensions.getCommandIds': getCommandIds,
|
|
5356
|
+
'SearchExtensions.getComponentState': getComponentState,
|
|
5330
5357
|
'SearchExtensions.getKeyBindings': getKeyBindings,
|
|
5331
5358
|
'SearchExtensions.getMenuEntries': getMenuEntriesList,
|
|
5332
5359
|
'SearchExtensions.getMenuEntries2': wrapGetter(getMenuEntries2),
|
|
@@ -5372,6 +5399,7 @@ const commandMap = {
|
|
|
5372
5399
|
'SearchExtensions.selectIndex': wrapCommand(selectIndex),
|
|
5373
5400
|
'SearchExtensions.selectNextCompletion': wrapCommand(selectNextCompletion),
|
|
5374
5401
|
'SearchExtensions.selectPreviousCompletion': wrapCommand(selectPreviousCompletion),
|
|
5402
|
+
'SearchExtensions.setComponentState': setComponentState,
|
|
5375
5403
|
'SearchExtensions.setDeltaY': wrapCommand(setDeltaY),
|
|
5376
5404
|
'SearchExtensions.setExtensionStatus': wrapCommand(setExtensionStatus),
|
|
5377
5405
|
'SearchExtensions.terminate': terminate,
|