@lvce-editor/main-area-worker 9.37.6 → 9.37.7
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/mainAreaWorkerMain.js +25 -19
- package/package.json +1 -1
|
@@ -3953,6 +3953,7 @@ const ensureActiveGroup = (state, uri, preview = false, title = getLabel(uri), e
|
|
|
3953
3953
|
if (activeGroup) {
|
|
3954
3954
|
const activeTab = activeGroup.tabs.find(tab => tab.id === activeGroup.activeTabId);
|
|
3955
3955
|
if (activeTab?.isPreview) {
|
|
3956
|
+
const tabId = create$2();
|
|
3956
3957
|
const updatedGroups = groups.map(group => {
|
|
3957
3958
|
if (group.id !== activeGroup.id) {
|
|
3958
3959
|
return group;
|
|
@@ -3968,6 +3969,7 @@ const ensureActiveGroup = (state, uri, preview = false, title = getLabel(uri), e
|
|
|
3968
3969
|
editorUid: create$2(),
|
|
3969
3970
|
errorMessage: '',
|
|
3970
3971
|
icon: '',
|
|
3972
|
+
id: tabId,
|
|
3971
3973
|
isDirty: false,
|
|
3972
3974
|
isPreview: preview,
|
|
3973
3975
|
language: '',
|
|
@@ -3979,6 +3981,7 @@ const ensureActiveGroup = (state, uri, preview = false, title = getLabel(uri), e
|
|
|
3979
3981
|
});
|
|
3980
3982
|
return {
|
|
3981
3983
|
...group,
|
|
3984
|
+
activeTabId: tabId,
|
|
3982
3985
|
tabs: updatedTabs
|
|
3983
3986
|
};
|
|
3984
3987
|
});
|
|
@@ -5041,6 +5044,26 @@ const splitForDrop = (state, splitDirection) => {
|
|
|
5041
5044
|
return state;
|
|
5042
5045
|
}
|
|
5043
5046
|
};
|
|
5047
|
+
|
|
5048
|
+
const applyDropAction = async (context, action, splitDirection) => {
|
|
5049
|
+
switch (action.command) {
|
|
5050
|
+
case 'openFiles':
|
|
5051
|
+
{
|
|
5052
|
+
if (action.uris.length > 0 && splitDirection !== None) {
|
|
5053
|
+
await context.updateState(state => splitForDrop(state, splitDirection));
|
|
5054
|
+
}
|
|
5055
|
+
await openUrisWithContext(context, action.uris, splitDirection === None);
|
|
5056
|
+
break;
|
|
5057
|
+
}
|
|
5058
|
+
case 'setPath':
|
|
5059
|
+
void invoke('Workspace.setPath', action.value).catch(() => {});
|
|
5060
|
+
break;
|
|
5061
|
+
case 'setUri':
|
|
5062
|
+
void invoke('Workspace.setUri', action.value).catch(() => {});
|
|
5063
|
+
break;
|
|
5064
|
+
}
|
|
5065
|
+
};
|
|
5066
|
+
|
|
5044
5067
|
const getDropAction = async uris => {
|
|
5045
5068
|
for (const uri of uris) {
|
|
5046
5069
|
if (uri.endsWith('/') || (await isDirectoryEditorInput({
|
|
@@ -5064,24 +5087,7 @@ const getDropAction = async uris => {
|
|
|
5064
5087
|
uris
|
|
5065
5088
|
};
|
|
5066
5089
|
};
|
|
5067
|
-
|
|
5068
|
-
switch (action.command) {
|
|
5069
|
-
case 'openFiles':
|
|
5070
|
-
{
|
|
5071
|
-
if (action.uris.length > 0 && splitDirection !== None) {
|
|
5072
|
-
await context.updateState(state => splitForDrop(state, splitDirection));
|
|
5073
|
-
}
|
|
5074
|
-
await openUrisWithContext(context, action.uris, splitDirection === None);
|
|
5075
|
-
break;
|
|
5076
|
-
}
|
|
5077
|
-
case 'setPath':
|
|
5078
|
-
void invoke('Workspace.setPath', action.value).catch(() => {});
|
|
5079
|
-
break;
|
|
5080
|
-
case 'setUri':
|
|
5081
|
-
void invoke('Workspace.setUri', action.value).catch(() => {});
|
|
5082
|
-
break;
|
|
5083
|
-
}
|
|
5084
|
-
};
|
|
5090
|
+
|
|
5085
5091
|
const handleDrop = async (context, itemIds) => {
|
|
5086
5092
|
const splitDirection = context.getState().dragOverlay?.splitDirection ?? None;
|
|
5087
5093
|
await context.updateState(handleDragLeave);
|
|
@@ -7566,7 +7572,7 @@ const getViewProviderEntries = async uri => {
|
|
|
7566
7572
|
type: 'editor'
|
|
7567
7573
|
};
|
|
7568
7574
|
try {
|
|
7569
|
-
const providers = await invoke('WebView.
|
|
7575
|
+
const providers = await invoke('WebView.getEditorProviders');
|
|
7570
7576
|
const matchingProviders = providers.filter(provider => provider?.id && provider.selector?.some(selector => uri.endsWith(selector)));
|
|
7571
7577
|
return [textEditorEntry, ...matchingProviders.map(provider => {
|
|
7572
7578
|
const titleElement = provider.elements?.find(element => element.type === 'title');
|