@lvce-editor/main-area-worker 9.64.1 → 9.64.3
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 +46 -35
- package/package.json +1 -1
|
@@ -647,7 +647,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
649
|
const restoreMessageError = (error, _currentStack) => {
|
|
650
|
-
const restoredError = constructError(error.message, error.type, error.name);
|
|
650
|
+
const restoredError = constructError(error.message, error.type || error.data?.type, error.name);
|
|
651
651
|
if (typeof error.code === 'string' || typeof error.code === 'number') {
|
|
652
652
|
Object.defineProperty(restoredError, 'code', {
|
|
653
653
|
configurable: true,
|
|
@@ -735,7 +735,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
735
735
|
data: {
|
|
736
736
|
code: prettyError.code ?? error?.code,
|
|
737
737
|
codeFrame: prettyError.codeFrame,
|
|
738
|
-
name: prettyError.name,
|
|
738
|
+
name: prettyError.name ?? error?.name,
|
|
739
739
|
stack: getStack(prettyError),
|
|
740
740
|
type: getErrorType(prettyError)
|
|
741
741
|
},
|
|
@@ -3872,6 +3872,7 @@ const HandleTabKeyDown = 29;
|
|
|
3872
3872
|
const HandleTabsWheel = 30;
|
|
3873
3873
|
const HandleTabDragOver = 31;
|
|
3874
3874
|
const HandleTabsDragOver = 32;
|
|
3875
|
+
const HandleFocus = 33;
|
|
3875
3876
|
|
|
3876
3877
|
const dragOverlayVirtualDom = {
|
|
3877
3878
|
childCount: 0,
|
|
@@ -4522,6 +4523,7 @@ const renderEmptyEditorGroup = (group, groupIndex, closeButtonEnabled = true) =>
|
|
|
4522
4523
|
className: mergeClassNames(EditorGroupEmpty, getEditorGroupClassName(group.id)),
|
|
4523
4524
|
'data-groupId': String(group.id),
|
|
4524
4525
|
onContextMenu: HandleContextMenu,
|
|
4526
|
+
onFocus: HandleFocus,
|
|
4525
4527
|
tabIndex: Focusable,
|
|
4526
4528
|
type: Div
|
|
4527
4529
|
}, ...closeButtonDom, ...renderWaterMark(group.id)];
|
|
@@ -4755,11 +4757,42 @@ const getMenuIds = () => {
|
|
|
4755
4757
|
return [Main$1, Tab];
|
|
4756
4758
|
};
|
|
4757
4759
|
|
|
4760
|
+
const focusEditorGroup = (state, groupId) => {
|
|
4761
|
+
const {
|
|
4762
|
+
layout
|
|
4763
|
+
} = state;
|
|
4764
|
+
const {
|
|
4765
|
+
groups
|
|
4766
|
+
} = layout;
|
|
4767
|
+
const updatedGroups = groups.map(group => ({
|
|
4768
|
+
...group,
|
|
4769
|
+
focused: group.id === groupId
|
|
4770
|
+
}));
|
|
4771
|
+
return {
|
|
4772
|
+
...state,
|
|
4773
|
+
layout: {
|
|
4774
|
+
...layout,
|
|
4775
|
+
activeGroupId: groupId,
|
|
4776
|
+
groups: updatedGroups
|
|
4777
|
+
}
|
|
4778
|
+
};
|
|
4779
|
+
};
|
|
4780
|
+
|
|
4781
|
+
const parseRawGroupId = rawGroupId => {
|
|
4782
|
+
if (!rawGroupId) {
|
|
4783
|
+
return undefined;
|
|
4784
|
+
}
|
|
4785
|
+
const groupId = Number(rawGroupId);
|
|
4786
|
+
return Number.isNaN(groupId) ? undefined : groupId;
|
|
4787
|
+
};
|
|
4788
|
+
|
|
4758
4789
|
const handleClick = async (state, name) => {
|
|
4759
|
-
|
|
4790
|
+
const groupId = parseRawGroupId(name);
|
|
4791
|
+
if (groupId === undefined) {
|
|
4760
4792
|
return state;
|
|
4761
4793
|
}
|
|
4762
|
-
|
|
4794
|
+
const hasGroup = state.layout.groups.some(group => group.id === groupId);
|
|
4795
|
+
return hasGroup ? focusEditorGroup(state, groupId) : state;
|
|
4763
4796
|
};
|
|
4764
4797
|
|
|
4765
4798
|
const getActiveGroup = (groups, activeGroupId) => {
|
|
@@ -4808,27 +4841,6 @@ const findTabByUri = (state, uri) => {
|
|
|
4808
4841
|
return undefined;
|
|
4809
4842
|
};
|
|
4810
4843
|
|
|
4811
|
-
const focusEditorGroup = (state, groupId) => {
|
|
4812
|
-
const {
|
|
4813
|
-
layout
|
|
4814
|
-
} = state;
|
|
4815
|
-
const {
|
|
4816
|
-
groups
|
|
4817
|
-
} = layout;
|
|
4818
|
-
const updatedGroups = groups.map(group => ({
|
|
4819
|
-
...group,
|
|
4820
|
-
focused: group.id === groupId
|
|
4821
|
-
}));
|
|
4822
|
-
return {
|
|
4823
|
-
...state,
|
|
4824
|
-
layout: {
|
|
4825
|
-
...layout,
|
|
4826
|
-
activeGroupId: groupId,
|
|
4827
|
-
groups: updatedGroups
|
|
4828
|
-
}
|
|
4829
|
-
};
|
|
4830
|
-
};
|
|
4831
|
-
|
|
4832
4844
|
const getActiveTabId = state => {
|
|
4833
4845
|
const {
|
|
4834
4846
|
layout
|
|
@@ -5663,14 +5675,6 @@ const openUriWithContext = async (context, options, focus = true, viewletContext
|
|
|
5663
5675
|
await openInputWithContext(context, getOpenInputOptions(options, focus, viewletContext));
|
|
5664
5676
|
};
|
|
5665
5677
|
|
|
5666
|
-
const parseRawGroupId = rawGroupId => {
|
|
5667
|
-
if (!rawGroupId) {
|
|
5668
|
-
return undefined;
|
|
5669
|
-
}
|
|
5670
|
-
const groupId = Number(rawGroupId);
|
|
5671
|
-
return Number.isNaN(groupId) ? undefined : groupId;
|
|
5672
|
-
};
|
|
5673
|
-
|
|
5674
5678
|
const focusGroup = (groups, groupId, activeTabId) => {
|
|
5675
5679
|
return groups.map(group => {
|
|
5676
5680
|
if (group.id === groupId) {
|
|
@@ -7718,7 +7722,11 @@ const loadContent$1 = async (state, savedState) => {
|
|
|
7718
7722
|
|
|
7719
7723
|
const handleWorkspaceChange = async (state, _workspacePath, savedState) => {
|
|
7720
7724
|
await clear(state.uid);
|
|
7721
|
-
|
|
7725
|
+
const stateWithEmptyIconCache = {
|
|
7726
|
+
...state,
|
|
7727
|
+
fileIconCache: {}
|
|
7728
|
+
};
|
|
7729
|
+
return loadContent$1(stateWithEmptyIconCache, savedState);
|
|
7722
7730
|
};
|
|
7723
7731
|
|
|
7724
7732
|
const getEditorInputUris = editorInput => {
|
|
@@ -7985,7 +7993,7 @@ const getMenuEntries$1 = (state, groupId, tabId) => {
|
|
|
7985
7993
|
label: openContainingFolder()
|
|
7986
7994
|
}, {
|
|
7987
7995
|
args: [path],
|
|
7988
|
-
command: '
|
|
7996
|
+
command: 'RevealInExplorer.reveal',
|
|
7989
7997
|
flags: None$1,
|
|
7990
7998
|
id: 'revealInExplorerView',
|
|
7991
7999
|
label: revealInExplorerView()
|
|
@@ -8366,6 +8374,9 @@ const renderEventListeners = () => {
|
|
|
8366
8374
|
return [{
|
|
8367
8375
|
name: HandleClick,
|
|
8368
8376
|
params: ['handleClick', TargetName]
|
|
8377
|
+
}, {
|
|
8378
|
+
name: HandleFocus,
|
|
8379
|
+
params: ['handleClick', 'event.target.dataset.groupId']
|
|
8369
8380
|
}, {
|
|
8370
8381
|
name: HandleClickClose,
|
|
8371
8382
|
params: ['handleClickCloseTab', 'event.currentTarget.dataset.groupIndex', 'event.currentTarget.dataset.index'],
|