@lvce-editor/quick-pick-worker 4.14.0 → 4.14.2
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 +56 -10
- package/package.json +1 -1
|
@@ -2758,14 +2758,24 @@ const i18nString = (key, placeholders = emptyObject) => {
|
|
|
2758
2758
|
const GoToFile = 'Go to file';
|
|
2759
2759
|
const GoToLineColumn = 'Go to Line / Column';
|
|
2760
2760
|
const GoToSymbolInEditor = 'Go to Symbol in Editor';
|
|
2761
|
+
const GoToSymbolInWorkspace = 'Go to Symbol in Workspace';
|
|
2761
2762
|
const NoResults = 'No Results';
|
|
2762
2763
|
const OpenView = 'Open View';
|
|
2763
2764
|
const QuickOpen = 'Quick open';
|
|
2764
2765
|
const SearchForText = 'Search for text';
|
|
2766
|
+
const SelectColorTheme = 'Select Color Theme';
|
|
2767
|
+
const SelectLanguageMode = 'Select Language Mode';
|
|
2768
|
+
const SelectToOpen = 'Select to open';
|
|
2765
2769
|
const ShowAndRunCommands = 'Show And Run Commands';
|
|
2766
2770
|
const TypeNameOfCommandToRun = 'Type the name of a command to run.';
|
|
2767
2771
|
const PressEnterToGoToLine = "Press 'Enter' to go to line {PH1} column {PH2}";
|
|
2768
2772
|
|
|
2773
|
+
const selectColorTheme = () => {
|
|
2774
|
+
return i18nString(SelectColorTheme);
|
|
2775
|
+
};
|
|
2776
|
+
const selectLanguageMode = () => {
|
|
2777
|
+
return i18nString(SelectLanguageMode);
|
|
2778
|
+
};
|
|
2769
2779
|
const pressEnterToGoToLine = (row, column) => {
|
|
2770
2780
|
return i18nString(PressEnterToGoToLine, {
|
|
2771
2781
|
PH1: row,
|
|
@@ -2784,6 +2794,9 @@ const goToFile = () => {
|
|
|
2784
2794
|
const noResults = () => {
|
|
2785
2795
|
return i18nString(NoResults);
|
|
2786
2796
|
};
|
|
2797
|
+
const selectToOpen = () => {
|
|
2798
|
+
return i18nString(SelectToOpen);
|
|
2799
|
+
};
|
|
2787
2800
|
const quickOpen = () => {
|
|
2788
2801
|
return i18nString(QuickOpen);
|
|
2789
2802
|
};
|
|
@@ -2793,6 +2806,9 @@ const goToLineColumn = () => {
|
|
|
2793
2806
|
const goToSymbolInEditor = () => {
|
|
2794
2807
|
return i18nString(GoToSymbolInEditor);
|
|
2795
2808
|
};
|
|
2809
|
+
const goToSymbolInWorkspace = () => {
|
|
2810
|
+
return i18nString(GoToSymbolInWorkspace);
|
|
2811
|
+
};
|
|
2796
2812
|
const searchForText = () => {
|
|
2797
2813
|
return i18nString(SearchForText);
|
|
2798
2814
|
};
|
|
@@ -3838,8 +3854,8 @@ const renderCursorOffset = (_oldState, newState) => {
|
|
|
3838
3854
|
|
|
3839
3855
|
const QuickPickInput = 'QuickPickInput';
|
|
3840
3856
|
|
|
3841
|
-
const renderFocus = (_oldState,
|
|
3842
|
-
return ['Viewlet.focusElementByName', QuickPickInput];
|
|
3857
|
+
const renderFocus = (_oldState, newState) => {
|
|
3858
|
+
return ['Viewlet.focusElementByName', newState.uid, QuickPickInput];
|
|
3843
3859
|
};
|
|
3844
3860
|
|
|
3845
3861
|
const renderFocusedIndex = (oldState, newState) => {
|
|
@@ -4269,6 +4285,36 @@ const createQuickPickViewModel = (oldState, newState) => {
|
|
|
4269
4285
|
};
|
|
4270
4286
|
};
|
|
4271
4287
|
|
|
4288
|
+
const getQuickPickInputAriaLabel = (providerId, value, placeholder) => {
|
|
4289
|
+
const prefix = getQuickPickPrefix(value);
|
|
4290
|
+
const subProviderId = getQuickPickSubProviderId(providerId, prefix);
|
|
4291
|
+
switch (subProviderId) {
|
|
4292
|
+
case ColorTheme$1:
|
|
4293
|
+
return selectColorTheme();
|
|
4294
|
+
case Commands$1:
|
|
4295
|
+
return typeNameofCommandToRun();
|
|
4296
|
+
case Custom$1:
|
|
4297
|
+
return placeholder || quickOpen();
|
|
4298
|
+
case File$1:
|
|
4299
|
+
return goToFile();
|
|
4300
|
+
case GoToColumn$1:
|
|
4301
|
+
case GoToLine$2:
|
|
4302
|
+
return goToLineColumn();
|
|
4303
|
+
case LanguageMode$1:
|
|
4304
|
+
return selectLanguageMode();
|
|
4305
|
+
case Recent$1:
|
|
4306
|
+
return selectToOpen();
|
|
4307
|
+
case Symbol$3:
|
|
4308
|
+
return goToSymbolInEditor();
|
|
4309
|
+
case View$3:
|
|
4310
|
+
return openView();
|
|
4311
|
+
case WorkspaceSymbol$2:
|
|
4312
|
+
return goToSymbolInWorkspace();
|
|
4313
|
+
default:
|
|
4314
|
+
return quickOpen();
|
|
4315
|
+
}
|
|
4316
|
+
};
|
|
4317
|
+
|
|
4272
4318
|
const ComboBox = 'combobox';
|
|
4273
4319
|
const ListBox = 'listbox';
|
|
4274
4320
|
const None = 'none';
|
|
@@ -4309,8 +4355,7 @@ const QuickPick$1 = 'QuickPick';
|
|
|
4309
4355
|
const QuickPickItems = 'QuickPickItems';
|
|
4310
4356
|
const QuickPickItemActive = 'QuickPickItemActive';
|
|
4311
4357
|
|
|
4312
|
-
const getQuickPickInputVirtualDom = (placeholder = '') => {
|
|
4313
|
-
const ariaLabel = typeNameofCommandToRun();
|
|
4358
|
+
const getQuickPickInputVirtualDom = (placeholder = '', ariaLabel = typeNameofCommandToRun()) => {
|
|
4314
4359
|
return [{
|
|
4315
4360
|
childCount: 1,
|
|
4316
4361
|
className: QuickPickInputWrapper,
|
|
@@ -4335,12 +4380,12 @@ const getQuickPickInputVirtualDom = (placeholder = '') => {
|
|
|
4335
4380
|
}];
|
|
4336
4381
|
};
|
|
4337
4382
|
|
|
4338
|
-
const getQuickPickHeaderVirtualDom = (placeholder = '') => {
|
|
4383
|
+
const getQuickPickHeaderVirtualDom = (placeholder = '', ariaLabel) => {
|
|
4339
4384
|
return [{
|
|
4340
4385
|
childCount: 1,
|
|
4341
4386
|
className: QuickPickHeader,
|
|
4342
4387
|
type: Div
|
|
4343
|
-
}, ...getQuickPickInputVirtualDom(placeholder)];
|
|
4388
|
+
}, ...getQuickPickInputVirtualDom(placeholder, ariaLabel)];
|
|
4344
4389
|
};
|
|
4345
4390
|
|
|
4346
4391
|
const getFileIconVirtualDom = icon => {
|
|
@@ -4489,7 +4534,7 @@ const getRootNodeCount = nodes => {
|
|
|
4489
4534
|
}
|
|
4490
4535
|
return count;
|
|
4491
4536
|
};
|
|
4492
|
-
const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop, placeholder = '') => {
|
|
4537
|
+
const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop, placeholder = '', inputAriaLabel) => {
|
|
4493
4538
|
const quickOpen$1 = quickOpen();
|
|
4494
4539
|
const shouldShowScrollbar = scrollBarHeight > 0;
|
|
4495
4540
|
const quickPickItemsDom = getQuickPickItemsVirtualDom(visibleItems);
|
|
@@ -4500,7 +4545,7 @@ const getQuickPickVirtualDom = (visibleItems, scrollBarHeight, scrollBarTop, pla
|
|
|
4500
4545
|
className: mergeClassNames(Viewlet, QuickPick$2),
|
|
4501
4546
|
id: QuickPick$1,
|
|
4502
4547
|
type: Div
|
|
4503
|
-
}, ...getQuickPickHeaderVirtualDom(placeholder), {
|
|
4548
|
+
}, ...getQuickPickHeaderVirtualDom(placeholder, inputAriaLabel), {
|
|
4504
4549
|
ariaActivedescendant: QuickPickItemActive,
|
|
4505
4550
|
childCount: shouldShowScrollbar ? 2 : 1,
|
|
4506
4551
|
className: mergeClassNames(List, ContainContent),
|
|
@@ -4526,7 +4571,8 @@ const renderItemsDom = state => {
|
|
|
4526
4571
|
scrollBarTop,
|
|
4527
4572
|
visibleItems
|
|
4528
4573
|
} = viewModel;
|
|
4529
|
-
|
|
4574
|
+
const inputAriaLabel = getQuickPickInputAriaLabel(state.providerId, state.value, state.placeholder);
|
|
4575
|
+
return getQuickPickVirtualDom(visibleItems, scrollBarHeight, scrollBarTop, state.placeholder, inputAriaLabel);
|
|
4530
4576
|
};
|
|
4531
4577
|
const renderItems = (_oldState, newState) => {
|
|
4532
4578
|
const dom = renderItemsDom(newState);
|
|
@@ -4541,7 +4587,7 @@ const renderIncremental = (oldState, newState) => {
|
|
|
4541
4587
|
};
|
|
4542
4588
|
|
|
4543
4589
|
const renderValue = (_oldState, newState) => {
|
|
4544
|
-
return ['Viewlet.setValueByName', QuickPickInput, /* value */newState.value];
|
|
4590
|
+
return ['Viewlet.setValueByName', newState.uid, QuickPickInput, /* value */newState.value];
|
|
4545
4591
|
};
|
|
4546
4592
|
|
|
4547
4593
|
const getRenderer = diffType => {
|