@lvce-editor/quick-pick-worker 4.20.1 → 4.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.
- package/dist/quickPickWorkerMain.js +90 -54
- package/package.json +1 -1
|
@@ -1364,34 +1364,34 @@ const SetPatches = 'Viewlet.setPatches';
|
|
|
1364
1364
|
const FocusQuickPickInput = 20;
|
|
1365
1365
|
|
|
1366
1366
|
const {
|
|
1367
|
-
invoke: invoke$
|
|
1367
|
+
invoke: invoke$7,
|
|
1368
1368
|
set: set$7
|
|
1369
1369
|
} = create$4(EditorWorker);
|
|
1370
1370
|
const getLines = async editorUid => {
|
|
1371
|
-
const lines = await invoke$
|
|
1371
|
+
const lines = await invoke$7('Editor.getLines2', editorUid);
|
|
1372
1372
|
return lines;
|
|
1373
1373
|
};
|
|
1374
1374
|
|
|
1375
1375
|
const {
|
|
1376
|
-
invoke: invoke$
|
|
1376
|
+
invoke: invoke$6,
|
|
1377
1377
|
set: set$6
|
|
1378
1378
|
} = create$4(ExtensionManagementWorker);
|
|
1379
1379
|
const getLanguages = (platform, assetDir) => {
|
|
1380
|
-
return invoke$
|
|
1380
|
+
return invoke$6('Extensions.getLanguages', platform, assetDir);
|
|
1381
1381
|
};
|
|
1382
1382
|
|
|
1383
1383
|
const {
|
|
1384
|
-
invoke: invoke$
|
|
1384
|
+
invoke: invoke$5,
|
|
1385
1385
|
set: set$5
|
|
1386
1386
|
} = create$4(7013);
|
|
1387
1387
|
|
|
1388
1388
|
const {
|
|
1389
|
-
invoke: invoke$
|
|
1389
|
+
invoke: invoke$4,
|
|
1390
1390
|
set: set$4
|
|
1391
1391
|
} = create$4(RendererProcess);
|
|
1392
1392
|
|
|
1393
1393
|
const {
|
|
1394
|
-
invoke: invoke$
|
|
1394
|
+
invoke: invoke$3,
|
|
1395
1395
|
invokeAndTransfer,
|
|
1396
1396
|
set: set$3
|
|
1397
1397
|
} = create$4(RendererWorker);
|
|
@@ -1400,37 +1400,37 @@ const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
|
1400
1400
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1401
1401
|
};
|
|
1402
1402
|
const setFocus = key => {
|
|
1403
|
-
return invoke$
|
|
1403
|
+
return invoke$3('Focus.setFocus', key);
|
|
1404
1404
|
};
|
|
1405
1405
|
const getFileIcon = async options => {
|
|
1406
|
-
return invoke$
|
|
1406
|
+
return invoke$3('IconTheme.getFileIcon', options);
|
|
1407
1407
|
};
|
|
1408
1408
|
const getFolderIcon = async options => {
|
|
1409
|
-
return invoke$
|
|
1409
|
+
return invoke$3('IconTheme.getFolderIcon', options);
|
|
1410
1410
|
};
|
|
1411
1411
|
const closeWidget$1 = async widgetId => {
|
|
1412
|
-
return invoke$
|
|
1412
|
+
return invoke$3('Viewlet.closeWidget', widgetId);
|
|
1413
1413
|
};
|
|
1414
1414
|
const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
|
|
1415
1415
|
const command = 'FileSearch.handleMessagePort';
|
|
1416
1416
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1417
1417
|
};
|
|
1418
1418
|
const getActiveEditorId = () => {
|
|
1419
|
-
return invoke$
|
|
1419
|
+
return invoke$3('GetActiveEditor.getActiveEditorId');
|
|
1420
1420
|
};
|
|
1421
1421
|
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1422
1422
|
const command = 'Extensions.handleMessagePort';
|
|
1423
1423
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1424
1424
|
};
|
|
1425
1425
|
const openUri$1 = async (uri, focus, options) => {
|
|
1426
|
-
await invoke$
|
|
1426
|
+
await invoke$3('Main.openUri', {
|
|
1427
1427
|
...options,
|
|
1428
1428
|
focus,
|
|
1429
1429
|
uri
|
|
1430
1430
|
});
|
|
1431
1431
|
};
|
|
1432
1432
|
const showErrorDialog$1 = async errorInfo => {
|
|
1433
|
-
await invoke$
|
|
1433
|
+
await invoke$3('ErrorHandling.showErrorDialog', errorInfo);
|
|
1434
1434
|
};
|
|
1435
1435
|
|
|
1436
1436
|
const closeWidget = async id => {
|
|
@@ -1508,7 +1508,7 @@ const close = async state => {
|
|
|
1508
1508
|
}
|
|
1509
1509
|
executeCallback(resolveId, result);
|
|
1510
1510
|
} else {
|
|
1511
|
-
await invoke$
|
|
1511
|
+
await invoke$3('QuickPick.executeCallback', resolveId, result);
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
@@ -2057,7 +2057,7 @@ const dispose = uid => {
|
|
|
2057
2057
|
};
|
|
2058
2058
|
|
|
2059
2059
|
const setColorTheme = id => {
|
|
2060
|
-
return invoke$
|
|
2060
|
+
return invoke$3(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
2061
2061
|
};
|
|
2062
2062
|
|
|
2063
2063
|
const focusPick$1 = async pick => {
|
|
@@ -2710,7 +2710,7 @@ const getFinalDeltaY = (height, itemHeight, itemsLength) => {
|
|
|
2710
2710
|
};
|
|
2711
2711
|
|
|
2712
2712
|
const getColorThemeNames = async (assetDir, platform) => {
|
|
2713
|
-
return invoke$
|
|
2713
|
+
return invoke$3('ColorTheme.getColorThemeNames', assetDir, platform);
|
|
2714
2714
|
};
|
|
2715
2715
|
|
|
2716
2716
|
const toProtoVisibleItem$4 = name => {
|
|
@@ -2794,7 +2794,7 @@ const state$3 = {
|
|
|
2794
2794
|
const getAll = async () => {
|
|
2795
2795
|
try {
|
|
2796
2796
|
// @ts-ignore
|
|
2797
|
-
const entries = await invoke$
|
|
2797
|
+
const entries = await invoke$3('Layout.getAllQuickPickMenuEntries');
|
|
2798
2798
|
return entries || [];
|
|
2799
2799
|
} catch {
|
|
2800
2800
|
// ignore
|
|
@@ -2829,7 +2829,7 @@ const getExtensionPicks = async (assetDir, platform, applicationId) => {
|
|
|
2829
2829
|
// Assert.number(platform)
|
|
2830
2830
|
// TODO ask extension management worker directly
|
|
2831
2831
|
// TODO don't call this every time, cache the results
|
|
2832
|
-
const extensionPicks = applicationId === undefined ? await invoke$
|
|
2832
|
+
const extensionPicks = applicationId === undefined ? await invoke$3('ExtensionHost.getCommands', assetDir, platform) : await invoke$3('Application.execute', applicationId, 'ExtensionHost.getCommands', assetDir, platform);
|
|
2833
2833
|
if (!extensionPicks) {
|
|
2834
2834
|
return [];
|
|
2835
2835
|
}
|
|
@@ -2900,10 +2900,15 @@ const state$1 = {
|
|
|
2900
2900
|
const set$1 = newRpc => {
|
|
2901
2901
|
state$1.rpc = newRpc;
|
|
2902
2902
|
};
|
|
2903
|
-
const invoke$
|
|
2903
|
+
const invoke$2 = (method, ...args) => {
|
|
2904
2904
|
return state$1.rpc.invoke(method, ...args);
|
|
2905
2905
|
};
|
|
2906
2906
|
|
|
2907
|
+
const isTextInput = args => {
|
|
2908
|
+
const options = args.at(-1);
|
|
2909
|
+
return options?.type === 'text';
|
|
2910
|
+
};
|
|
2911
|
+
|
|
2907
2912
|
const toProtoVisibleItem$2 = item => {
|
|
2908
2913
|
const {
|
|
2909
2914
|
args,
|
|
@@ -2928,10 +2933,13 @@ const toProtoVisibleItem$2 = item => {
|
|
|
2928
2933
|
};
|
|
2929
2934
|
const getPicks$d = async (searchValue, args) => {
|
|
2930
2935
|
state$2.args = args;
|
|
2936
|
+
if (isTextInput(args)) {
|
|
2937
|
+
return [];
|
|
2938
|
+
}
|
|
2931
2939
|
const options = args.at(-1);
|
|
2932
2940
|
let items;
|
|
2933
2941
|
if (options?.mode === 'quickInput') {
|
|
2934
|
-
items = searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke$
|
|
2942
|
+
items = searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke$2('ExtensionHostQuickPick.renderQuickInput', options.quickInputId, searchValue);
|
|
2935
2943
|
} else {
|
|
2936
2944
|
items = options?.customItemsId ? get(options.customItemsId) : args[1] || [];
|
|
2937
2945
|
}
|
|
@@ -2956,11 +2964,11 @@ const getPicks$c = async () => {
|
|
|
2956
2964
|
const emptyMatches = [];
|
|
2957
2965
|
|
|
2958
2966
|
const getWorkspacePath = async () => {
|
|
2959
|
-
return invoke$
|
|
2967
|
+
return invoke$3('Workspace.getPath');
|
|
2960
2968
|
};
|
|
2961
2969
|
|
|
2962
2970
|
const searchFile$1 = async (path, value, prepare, assetDir) => {
|
|
2963
|
-
const result = await invoke$
|
|
2971
|
+
const result = await invoke$5('FileSearch.searchFile', path, value, prepare, assetDir);
|
|
2964
2972
|
return result;
|
|
2965
2973
|
};
|
|
2966
2974
|
|
|
@@ -3354,7 +3362,7 @@ const uniq = array => {
|
|
|
3354
3362
|
});
|
|
3355
3363
|
};
|
|
3356
3364
|
const getRecentlyOpened = async () => {
|
|
3357
|
-
const recentlyOpened = await invoke$
|
|
3365
|
+
const recentlyOpened = await invoke$3(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
3358
3366
|
return uniq(recentlyOpened);
|
|
3359
3367
|
};
|
|
3360
3368
|
|
|
@@ -3469,7 +3477,7 @@ const selectPickBuiltin = async item => {
|
|
|
3469
3477
|
}
|
|
3470
3478
|
const args = item.args || [];
|
|
3471
3479
|
// TODO ids should be all numbers for efficiency -> also directly can call command
|
|
3472
|
-
await invoke$
|
|
3480
|
+
await invoke$3(item.id, ...args);
|
|
3473
3481
|
if (shouldHide(item)) {
|
|
3474
3482
|
return {
|
|
3475
3483
|
command: Hide
|
|
@@ -3483,9 +3491,9 @@ const selectPickExtension = async (item, applicationId) => {
|
|
|
3483
3491
|
const id = item.id.slice(4); // TODO lots of string allocation with 'ext.' find a better way to separate builtin commands from extension commands
|
|
3484
3492
|
try {
|
|
3485
3493
|
if (applicationId === undefined) {
|
|
3486
|
-
await invoke$
|
|
3494
|
+
await invoke$3('ExtensionHost.executeCommand', id);
|
|
3487
3495
|
} else {
|
|
3488
|
-
await invoke$
|
|
3496
|
+
await invoke$3('Application.execute', applicationId, 'ExtensionHost.executeCommand', id);
|
|
3489
3497
|
}
|
|
3490
3498
|
} catch (error) {
|
|
3491
3499
|
await handleError(error, false);
|
|
@@ -3544,7 +3552,7 @@ const selectPick$a = async (_pick, value) => {
|
|
|
3544
3552
|
}
|
|
3545
3553
|
executeCallback(resolveId, result);
|
|
3546
3554
|
} else {
|
|
3547
|
-
await invoke$
|
|
3555
|
+
await invoke$3('QuickPick.executeCallback', resolveId, result);
|
|
3548
3556
|
}
|
|
3549
3557
|
return {
|
|
3550
3558
|
command: Hide
|
|
@@ -3553,7 +3561,7 @@ const selectPick$a = async (_pick, value) => {
|
|
|
3553
3561
|
|
|
3554
3562
|
const selectPick$9 = async pick => {
|
|
3555
3563
|
const editorId = await getActiveEditorId();
|
|
3556
|
-
await invoke$
|
|
3564
|
+
await invoke$3('Viewlet.executeViewletCommand', editorId, 'setEndOfLine', pick.value);
|
|
3557
3565
|
return {
|
|
3558
3566
|
command: Hide
|
|
3559
3567
|
};
|
|
@@ -3577,12 +3585,12 @@ const selectPick$8 = async pick => {
|
|
|
3577
3585
|
};
|
|
3578
3586
|
|
|
3579
3587
|
const setCursor = async (rowIndex, columnIndex) => {
|
|
3580
|
-
await invoke$
|
|
3588
|
+
await invoke$3('Editor.cursorSet', rowIndex, columnIndex);
|
|
3581
3589
|
};
|
|
3582
3590
|
|
|
3583
3591
|
const goToPositionAndFocus = async (rowIndex, columnIndex) => {
|
|
3584
3592
|
await setCursor(rowIndex, columnIndex);
|
|
3585
|
-
await invoke$
|
|
3593
|
+
await invoke$3('Editor.handleFocus');
|
|
3586
3594
|
};
|
|
3587
3595
|
|
|
3588
3596
|
const selectPickGoToColumn = async (item, value) => {
|
|
@@ -3625,7 +3633,7 @@ const selectPick$6 = async item => {
|
|
|
3625
3633
|
|
|
3626
3634
|
const selectPick$5 = async pick => {
|
|
3627
3635
|
const editorId = await getActiveEditorId();
|
|
3628
|
-
await invoke$
|
|
3636
|
+
await invoke$3('Viewlet.executeViewletCommand', editorId, 'setIndentation', pick.value);
|
|
3629
3637
|
return {
|
|
3630
3638
|
command: Hide
|
|
3631
3639
|
};
|
|
@@ -3634,7 +3642,7 @@ const selectPick$5 = async pick => {
|
|
|
3634
3642
|
const selectPick$4 = async pick => {
|
|
3635
3643
|
const editorId = await getActiveEditorId();
|
|
3636
3644
|
const value = pick.value;
|
|
3637
|
-
await invoke$
|
|
3645
|
+
await invoke$3('Viewlet.executeViewletCommand', editorId, 'setLanguageId', value.languageId, value.tokenizePath);
|
|
3638
3646
|
return {
|
|
3639
3647
|
command: Hide
|
|
3640
3648
|
};
|
|
@@ -3642,7 +3650,7 @@ const selectPick$4 = async pick => {
|
|
|
3642
3650
|
|
|
3643
3651
|
const openWorkspaceFolder = uri => {
|
|
3644
3652
|
const command = uri.includes('://') ? 'Workspace.setUri' : 'Workspace.setPath';
|
|
3645
|
-
return invoke$
|
|
3653
|
+
return invoke$3(command, uri);
|
|
3646
3654
|
};
|
|
3647
3655
|
|
|
3648
3656
|
// TODO selectPick should be independent of show/hide
|
|
@@ -3762,6 +3770,13 @@ const setValue = async (state, newValue) => {
|
|
|
3762
3770
|
if (value === newValue) {
|
|
3763
3771
|
return state;
|
|
3764
3772
|
}
|
|
3773
|
+
if (isTextInput(args)) {
|
|
3774
|
+
return {
|
|
3775
|
+
...state,
|
|
3776
|
+
inputSource: Script,
|
|
3777
|
+
value: newValue
|
|
3778
|
+
};
|
|
3779
|
+
}
|
|
3765
3780
|
const prefix = getQuickPickPrefix(newValue);
|
|
3766
3781
|
const subId = getQuickPickSubProviderId(providerId, prefix);
|
|
3767
3782
|
const quickInput = isQuickInput(args);
|
|
@@ -3890,7 +3905,7 @@ const handleBlur = async state => {
|
|
|
3890
3905
|
const options = args.at(-1);
|
|
3891
3906
|
if (!options?.executeItemCommand) {
|
|
3892
3907
|
const resolveId = args[2];
|
|
3893
|
-
await invoke$
|
|
3908
|
+
await invoke$3('QuickPick.executeCallback', resolveId, getCancelResult(args));
|
|
3894
3909
|
}
|
|
3895
3910
|
}
|
|
3896
3911
|
await closeWidget(state.uid);
|
|
@@ -4042,7 +4057,7 @@ const getLoadedState = async state => {
|
|
|
4042
4057
|
});
|
|
4043
4058
|
array(newPicks);
|
|
4044
4059
|
const filterValue = getFilterValue(id, subId, value);
|
|
4045
|
-
const items = filterQuickPickItems(newPicks, filterValue);
|
|
4060
|
+
const items = isTextInput(args) ? newPicks : filterQuickPickItems(newPicks, filterValue);
|
|
4046
4061
|
const minLineY = 0;
|
|
4047
4062
|
const maxLineY = Math.min(minLineY + maxVisibleItems, newPicks.length);
|
|
4048
4063
|
const sliced = newPicks.slice(minLineY, maxLineY);
|
|
@@ -4158,7 +4173,7 @@ const selectIndex = async (state, index, button = /* left */0) => {
|
|
|
4158
4173
|
case Hide:
|
|
4159
4174
|
await closeWidget(state.uid);
|
|
4160
4175
|
if (selectPickResult.itemCommand) {
|
|
4161
|
-
await invoke$
|
|
4176
|
+
await invoke$3(selectPickResult.itemCommand, ...(selectPickResult.itemCommandArgs || []));
|
|
4162
4177
|
}
|
|
4163
4178
|
return state;
|
|
4164
4179
|
case OpenColorTheme:
|
|
@@ -4227,8 +4242,8 @@ const isConnected = () => {
|
|
|
4227
4242
|
} = state;
|
|
4228
4243
|
return connected;
|
|
4229
4244
|
};
|
|
4230
|
-
const invoke = (method, ...params) => {
|
|
4231
|
-
return invoke$
|
|
4245
|
+
const invoke$1 = (method, ...params) => {
|
|
4246
|
+
return invoke$4(method, ...params);
|
|
4232
4247
|
};
|
|
4233
4248
|
const set = rpc => {
|
|
4234
4249
|
set$4(rpc);
|
|
@@ -4242,7 +4257,7 @@ const handleRendererProcessMessagePort = async (port, viewletCommandMap, setAsRe
|
|
|
4242
4257
|
throw new TypeError(`Viewlet command not found: ${command}`);
|
|
4243
4258
|
}
|
|
4244
4259
|
await fn(uid, ...args);
|
|
4245
|
-
await invoke$
|
|
4260
|
+
await invoke$3('Viewlet.requestRender', uid);
|
|
4246
4261
|
};
|
|
4247
4262
|
const rpc = await create$8({
|
|
4248
4263
|
commandMap: {
|
|
@@ -4780,14 +4795,17 @@ const QuickPick$1 = 'QuickPick';
|
|
|
4780
4795
|
const QuickPickItems = 'QuickPickItems';
|
|
4781
4796
|
const QuickPickItemActive = 'QuickPickItemActive';
|
|
4782
4797
|
|
|
4783
|
-
const getQuickPickInputVirtualDom = (placeholder = '', ariaLabel = typeNameofCommandToRun()) => {
|
|
4798
|
+
const getQuickPickInputVirtualDom = (placeholder = '', ariaLabel = typeNameofCommandToRun(), textInput = false) => {
|
|
4784
4799
|
return [{
|
|
4785
4800
|
childCount: 1,
|
|
4786
4801
|
className: QuickPickInputWrapper,
|
|
4787
4802
|
type: Div
|
|
4788
4803
|
}, {
|
|
4789
|
-
|
|
4790
|
-
|
|
4804
|
+
...(!textInput && {
|
|
4805
|
+
ariaAutoComplete: 'list',
|
|
4806
|
+
ariaExpanded: true,
|
|
4807
|
+
role: ComboBox
|
|
4808
|
+
}),
|
|
4791
4809
|
ariaLabel: ariaLabel,
|
|
4792
4810
|
autocapitalize: 'off',
|
|
4793
4811
|
autocomplete: 'off',
|
|
@@ -4799,18 +4817,17 @@ const getQuickPickInputVirtualDom = (placeholder = '', ariaLabel = typeNameofCom
|
|
|
4799
4817
|
onFocus: HandleFocus,
|
|
4800
4818
|
onInput: HandleInput,
|
|
4801
4819
|
placeholder,
|
|
4802
|
-
role: ComboBox,
|
|
4803
4820
|
spellcheck: false,
|
|
4804
4821
|
type: Input
|
|
4805
4822
|
}];
|
|
4806
4823
|
};
|
|
4807
4824
|
|
|
4808
|
-
const getQuickPickHeaderVirtualDom = (placeholder = '', ariaLabel) => {
|
|
4825
|
+
const getQuickPickHeaderVirtualDom = (placeholder = '', ariaLabel, textInput = false) => {
|
|
4809
4826
|
return [{
|
|
4810
4827
|
childCount: 1,
|
|
4811
4828
|
className: QuickPickHeader,
|
|
4812
4829
|
type: Div
|
|
4813
|
-
}, ...getQuickPickInputVirtualDom(placeholder, ariaLabel)];
|
|
4830
|
+
}, ...getQuickPickInputVirtualDom(placeholder, ariaLabel, textInput)];
|
|
4814
4831
|
};
|
|
4815
4832
|
|
|
4816
4833
|
const getFileIconVirtualDom = icon => {
|
|
@@ -4955,8 +4972,17 @@ const getRootNodeCount = nodes => {
|
|
|
4955
4972
|
}
|
|
4956
4973
|
return count;
|
|
4957
4974
|
};
|
|
4958
|
-
const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop, placeholder = '', inputAriaLabel) => {
|
|
4975
|
+
const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop, placeholder = '', inputAriaLabel, textInput = false) => {
|
|
4959
4976
|
const quickOpen$1 = quickOpen();
|
|
4977
|
+
if (textInput) {
|
|
4978
|
+
return [{
|
|
4979
|
+
ariaLabel: quickOpen$1,
|
|
4980
|
+
childCount: 1,
|
|
4981
|
+
className: mergeClassNames(Viewlet, QuickPick$2),
|
|
4982
|
+
id: QuickPick$1,
|
|
4983
|
+
type: Div
|
|
4984
|
+
}, ...getQuickPickHeaderVirtualDom(placeholder, inputAriaLabel, true)];
|
|
4985
|
+
}
|
|
4960
4986
|
const shouldShowScrollbar = scrollBarHeight > 0;
|
|
4961
4987
|
const quickPickItemsDom = getQuickPickItemsVirtualDom(visibleItems);
|
|
4962
4988
|
const listItemsChildCount = getRootNodeCount(quickPickItemsDom);
|
|
@@ -4993,7 +5019,7 @@ const renderItemsDom = state => {
|
|
|
4993
5019
|
visibleItems
|
|
4994
5020
|
} = viewModel;
|
|
4995
5021
|
const inputAriaLabel = getQuickPickInputAriaLabel(state.providerId, state.value, state.placeholder);
|
|
4996
|
-
return getQuickPickVirtualDom(visibleItems, scrollBarHeight, scrollBarTop, state.placeholder, inputAriaLabel);
|
|
5022
|
+
return getQuickPickVirtualDom(visibleItems, scrollBarHeight, scrollBarTop, state.placeholder, inputAriaLabel, isTextInput(state.args));
|
|
4997
5023
|
};
|
|
4998
5024
|
const renderItems = (_oldState, newState) => {
|
|
4999
5025
|
const dom = renderItemsDom(newState);
|
|
@@ -5055,7 +5081,7 @@ const isFocusContextCommand = command => {
|
|
|
5055
5081
|
const renderDirect = async (uid, commands) => {
|
|
5056
5082
|
const rendererWorkerCommands = commands.filter(isFocusContextCommand);
|
|
5057
5083
|
const rendererProcessCommands = commands.filter(command => !isFocusContextCommand(command));
|
|
5058
|
-
const transactionId = await invoke('Viewlet.queueCommands', uid, rendererProcessCommands);
|
|
5084
|
+
const transactionId = await invoke$1('Viewlet.queueCommands', uid, rendererProcessCommands);
|
|
5059
5085
|
return [...rendererWorkerCommands, ['Viewlet.commitPending', uid, transactionId]];
|
|
5060
5086
|
};
|
|
5061
5087
|
const render2 = (uid, diffResult) => {
|
|
@@ -5156,24 +5182,31 @@ const serialize = command => {
|
|
|
5156
5182
|
};
|
|
5157
5183
|
};
|
|
5158
5184
|
|
|
5185
|
+
const invoke = async (applicationId, method, ...args) => {
|
|
5186
|
+
return applicationId === undefined ? invoke$3(method, ...args) : invoke$3('Application.execute', applicationId, method, ...args);
|
|
5187
|
+
};
|
|
5188
|
+
|
|
5159
5189
|
const showQuickInput = async ({
|
|
5190
|
+
applicationId,
|
|
5160
5191
|
id,
|
|
5161
5192
|
ignoreFocusOut,
|
|
5162
5193
|
initialItems = [],
|
|
5163
5194
|
initialValue,
|
|
5164
5195
|
placeholder,
|
|
5196
|
+
type = id === undefined && initialItems.length === 0 ? 'text' : 'select',
|
|
5165
5197
|
waitUntil
|
|
5166
5198
|
}) => {
|
|
5167
5199
|
const customItemsId = add(initialItems);
|
|
5168
5200
|
const picks = [];
|
|
5169
5201
|
try {
|
|
5170
|
-
const result = await invoke
|
|
5202
|
+
const result = await invoke(applicationId, 'QuickPick.showCustom', picks, {
|
|
5171
5203
|
customItemsId,
|
|
5172
5204
|
ignoreFocusOut,
|
|
5173
5205
|
initialValue,
|
|
5174
5206
|
mode: 'quickInput',
|
|
5175
5207
|
placeholder,
|
|
5176
5208
|
quickInputId: id,
|
|
5209
|
+
type,
|
|
5177
5210
|
waitUntil
|
|
5178
5211
|
});
|
|
5179
5212
|
return result ?? {
|
|
@@ -5189,22 +5222,25 @@ const QuickPick = 'QuickPick';
|
|
|
5189
5222
|
|
|
5190
5223
|
const showQuickPick = async ({
|
|
5191
5224
|
acceptInput = false,
|
|
5225
|
+
applicationId,
|
|
5192
5226
|
items,
|
|
5193
5227
|
placeholder = '',
|
|
5228
|
+
type = 'select',
|
|
5194
5229
|
waitUntil = 'selected'
|
|
5195
5230
|
}) => {
|
|
5196
|
-
const customItemsId = add(items);
|
|
5231
|
+
const customItemsId = add(type === 'text' ? [] : items);
|
|
5197
5232
|
const {
|
|
5198
5233
|
id,
|
|
5199
5234
|
promise
|
|
5200
5235
|
} = registerCallback();
|
|
5201
5236
|
try {
|
|
5202
|
-
await invoke
|
|
5203
|
-
acceptInput,
|
|
5237
|
+
await invoke(applicationId, 'Viewlet.openWidget', QuickPick, 'custom', [], id, {
|
|
5238
|
+
acceptInput: type === 'text' || acceptInput,
|
|
5204
5239
|
callbackOwner: 'quickPickWorker',
|
|
5205
5240
|
customItemsId,
|
|
5206
5241
|
mode: 'quickPick',
|
|
5207
|
-
placeholder
|
|
5242
|
+
placeholder,
|
|
5243
|
+
type
|
|
5208
5244
|
});
|
|
5209
5245
|
if (waitUntil === 'visible') {
|
|
5210
5246
|
return undefined;
|