@lvce-editor/renderer-process 30.64.0 → 30.64.1
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/rendererProcessMain.js +42 -6
- package/package.json +1 -1
|
@@ -804,7 +804,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
804
804
|
}
|
|
805
805
|
};
|
|
806
806
|
const restoreMessageError = (error, _currentStack) => {
|
|
807
|
-
const restoredError = constructError(error.message, error.type, error.name);
|
|
807
|
+
const restoredError = constructError(error.message, error.type || error.data?.type, error.name);
|
|
808
808
|
if (typeof error.code === 'string' || typeof error.code === 'number') {
|
|
809
809
|
Object.defineProperty(restoredError, 'code', {
|
|
810
810
|
configurable: true,
|
|
@@ -819,6 +819,23 @@ const restoreMessageError = (error, _currentStack) => {
|
|
|
819
819
|
}
|
|
820
820
|
return restoredError;
|
|
821
821
|
};
|
|
822
|
+
const getFallbackMessage = error => {
|
|
823
|
+
if (error && typeof error.message === 'string' && error.message) {
|
|
824
|
+
return error.message;
|
|
825
|
+
}
|
|
826
|
+
if (error && error.data) {
|
|
827
|
+
return getFallbackMessage(error.data);
|
|
828
|
+
}
|
|
829
|
+
const stringified = String(error);
|
|
830
|
+
if (stringified !== '[object Object]') {
|
|
831
|
+
return stringified;
|
|
832
|
+
}
|
|
833
|
+
try {
|
|
834
|
+
return JSON.stringify(error);
|
|
835
|
+
} catch {
|
|
836
|
+
return stringified;
|
|
837
|
+
}
|
|
838
|
+
};
|
|
822
839
|
const restoreJsonRpcError = error => {
|
|
823
840
|
const currentStack = getCurrentStack();
|
|
824
841
|
if (error && error instanceof Error) {
|
|
@@ -827,13 +844,13 @@ const restoreJsonRpcError = error => {
|
|
|
827
844
|
if (error && error.code && error.code === MethodNotFound) {
|
|
828
845
|
return restoreMethodNotFoundError(error, currentStack);
|
|
829
846
|
}
|
|
847
|
+
if (error && error.error) {
|
|
848
|
+
return restoreJsonRpcError(error.error);
|
|
849
|
+
}
|
|
830
850
|
if (error && error.message) {
|
|
831
851
|
return restoreMessageError(error);
|
|
832
852
|
}
|
|
833
|
-
|
|
834
|
-
return new Error(`JsonRpc Error: ${error}`);
|
|
835
|
-
}
|
|
836
|
-
return new Error(`JsonRpc Error: ${error}`);
|
|
853
|
+
return new Error(`JsonRpc Error: ${getFallbackMessage(error)}`);
|
|
837
854
|
};
|
|
838
855
|
const unwrapJsonRpcResult = responseMessage => {
|
|
839
856
|
if ('error' in responseMessage) {
|
|
@@ -892,7 +909,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
892
909
|
data: {
|
|
893
910
|
code: prettyError.code ?? error?.code,
|
|
894
911
|
codeFrame: prettyError.codeFrame,
|
|
895
|
-
name: prettyError.name,
|
|
912
|
+
name: prettyError.name ?? error?.name,
|
|
896
913
|
stack: getStack(prettyError),
|
|
897
914
|
type: getErrorType(prettyError)
|
|
898
915
|
},
|
|
@@ -1114,6 +1131,9 @@ const logError$1 = () => {
|
|
|
1114
1131
|
// handled by renderer worker
|
|
1115
1132
|
};
|
|
1116
1133
|
const handleMessage = event => {
|
|
1134
|
+
if (event.data === 'ready') {
|
|
1135
|
+
return Promise.resolve();
|
|
1136
|
+
}
|
|
1117
1137
|
const actualRequiresSocket = event?.target?.requiresSocket || requiresSocket;
|
|
1118
1138
|
const actualExecute = event?.target?.execute || execute;
|
|
1119
1139
|
return handleJsonRpcMessage(event.target, event.data, actualExecute, event.target._resolve, preparePrettyError, logError$1, actualRequiresSocket);
|
|
@@ -7089,10 +7109,26 @@ const isTerminalTextInput = event => {
|
|
|
7089
7109
|
}
|
|
7090
7110
|
return target instanceof Element && Boolean(target.closest('.XtermTerminal'));
|
|
7091
7111
|
};
|
|
7112
|
+
const isEditableTarget = target => {
|
|
7113
|
+
if (!(target instanceof Element)) {
|
|
7114
|
+
return false;
|
|
7115
|
+
}
|
|
7116
|
+
return Boolean(target.closest('input, textarea, [contenteditable]:not([contenteditable="false"])'));
|
|
7117
|
+
};
|
|
7092
7118
|
const handleKeyDown$2 = event => {
|
|
7093
7119
|
if (isNativeButtonActivation(event) || isTerminalTextInput(event)) {
|
|
7094
7120
|
return;
|
|
7095
7121
|
}
|
|
7122
|
+
const {
|
|
7123
|
+
altKey,
|
|
7124
|
+
ctrlKey,
|
|
7125
|
+
key,
|
|
7126
|
+
metaKey,
|
|
7127
|
+
shiftKey
|
|
7128
|
+
} = event;
|
|
7129
|
+
if (key === '.' && !altKey && !ctrlKey && !metaKey && !shiftKey && isEditableTarget(event.target)) {
|
|
7130
|
+
return;
|
|
7131
|
+
}
|
|
7096
7132
|
const identifier = getKeyBindingIdentifier(event);
|
|
7097
7133
|
const identifiers = getIdentifiers();
|
|
7098
7134
|
const matchingKeyBinding = isMatchingKeyBinding(identifiers, identifier);
|