@lvce-editor/renderer-process 30.8.0 → 30.9.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/rendererProcessMain.js +41 -11
- package/package.json +1 -1
|
@@ -262,6 +262,7 @@ const applyDragInfoMaybe = event => {
|
|
|
262
262
|
};
|
|
263
263
|
|
|
264
264
|
const PointerMove$1 = 'pointermove';
|
|
265
|
+
const PointerUp$1 = 'pointerup';
|
|
265
266
|
const lostpointercapture = 'lostpointercapture';
|
|
266
267
|
|
|
267
268
|
const createEventState = () => {
|
|
@@ -520,8 +521,20 @@ const applyPointerTrackMaybe = (info, map, event) => {
|
|
|
520
521
|
} = event;
|
|
521
522
|
target.setPointerCapture(pointerId);
|
|
522
523
|
const [pointerMoveKey, pointerUpKey] = trackPointerEvents;
|
|
523
|
-
|
|
524
|
-
|
|
524
|
+
const pointerMove = map[pointerMoveKey];
|
|
525
|
+
const pointerUp = map[pointerUpKey];
|
|
526
|
+
const cleanup = () => {
|
|
527
|
+
target.removeEventListener(PointerMove$1, pointerMove);
|
|
528
|
+
target.removeEventListener(PointerUp$1, handlePointerUp);
|
|
529
|
+
target.removeEventListener(lostpointercapture, handlePointerUp);
|
|
530
|
+
};
|
|
531
|
+
const handlePointerUp = event => {
|
|
532
|
+
cleanup();
|
|
533
|
+
pointerUp(event);
|
|
534
|
+
};
|
|
535
|
+
target.addEventListener(PointerMove$1, pointerMove);
|
|
536
|
+
target.addEventListener(PointerUp$1, handlePointerUp);
|
|
537
|
+
target.addEventListener(lostpointercapture, handlePointerUp);
|
|
525
538
|
};
|
|
526
539
|
const createFn = (info, map) => {
|
|
527
540
|
const fn = event => {
|
|
@@ -2794,7 +2807,10 @@ const constructError = (message, type, name) => {
|
|
|
2794
2807
|
if (ErrorConstructor === Error) {
|
|
2795
2808
|
const error = new Error(message);
|
|
2796
2809
|
if (name && name !== 'VError') {
|
|
2797
|
-
error
|
|
2810
|
+
Object.defineProperty(error, 'name', {
|
|
2811
|
+
configurable: true,
|
|
2812
|
+
value: name
|
|
2813
|
+
});
|
|
2798
2814
|
}
|
|
2799
2815
|
return error;
|
|
2800
2816
|
}
|
|
@@ -2825,31 +2841,45 @@ const getParentStack = error => {
|
|
|
2825
2841
|
};
|
|
2826
2842
|
const MethodNotFound = -32601;
|
|
2827
2843
|
const Custom = -32001;
|
|
2844
|
+
const setStack = (error, stack) => {
|
|
2845
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, 'stack');
|
|
2846
|
+
if (descriptor) {
|
|
2847
|
+
if (!descriptor.configurable && !descriptor.writable) {
|
|
2848
|
+
return;
|
|
2849
|
+
}
|
|
2850
|
+
if (!descriptor.configurable && descriptor.writable) {
|
|
2851
|
+
error.stack = stack;
|
|
2852
|
+
return;
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
Object.defineProperty(error, 'stack', {
|
|
2856
|
+
configurable: true,
|
|
2857
|
+
value: stack,
|
|
2858
|
+
writable: true
|
|
2859
|
+
});
|
|
2860
|
+
};
|
|
2828
2861
|
const restoreExistingError = (error, currentStack) => {
|
|
2829
2862
|
if (typeof error.stack === 'string') {
|
|
2830
|
-
error
|
|
2863
|
+
setStack(error, `${error.stack}${NewLine}${currentStack}`);
|
|
2831
2864
|
}
|
|
2832
2865
|
return error;
|
|
2833
2866
|
};
|
|
2834
2867
|
const restoreMethodNotFoundError = (error, currentStack) => {
|
|
2835
2868
|
const restoredError = new JsonRpcError(error.message);
|
|
2836
2869
|
const parentStack = getParentStack(error);
|
|
2837
|
-
restoredError
|
|
2870
|
+
setStack(restoredError, `${parentStack}${NewLine}${currentStack}`);
|
|
2838
2871
|
return restoredError;
|
|
2839
2872
|
};
|
|
2840
2873
|
const restoreStackFromData = (restoredError, error, currentStack) => {
|
|
2841
2874
|
if (error.data.stack && error.data.type && error.message) {
|
|
2842
|
-
restoredError
|
|
2875
|
+
setStack(restoredError, `${error.data.type}: ${error.message}${NewLine}${error.data.stack}${NewLine}${currentStack}`);
|
|
2843
2876
|
return;
|
|
2844
2877
|
}
|
|
2845
2878
|
if (error.data.stack) {
|
|
2846
|
-
restoredError
|
|
2879
|
+
setStack(restoredError, error.data.stack);
|
|
2847
2880
|
}
|
|
2848
2881
|
};
|
|
2849
2882
|
const applyDataProperties = (restoredError, error) => {
|
|
2850
|
-
if (!error.data) {
|
|
2851
|
-
return;
|
|
2852
|
-
}
|
|
2853
2883
|
restoreStackFromData(restoredError, error, getCurrentStack());
|
|
2854
2884
|
if (error.data.codeFrame) {
|
|
2855
2885
|
// @ts-ignore
|
|
@@ -2870,7 +2900,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
2870
2900
|
const indexNewLine = getNewLineIndex(lowerStack);
|
|
2871
2901
|
const parentStack = getParentStack(error);
|
|
2872
2902
|
// @ts-ignore
|
|
2873
|
-
restoredError
|
|
2903
|
+
setStack(restoredError, `${parentStack}${lowerStack.slice(indexNewLine)}`);
|
|
2874
2904
|
}
|
|
2875
2905
|
if (error.codeFrame) {
|
|
2876
2906
|
// @ts-ignore
|