@lvce-editor/panel-worker 1.7.0 → 1.8.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/panelWorkerMain.js +36 -36
- package/package.json +1 -1
package/dist/panelWorkerMain.js
CHANGED
|
@@ -463,12 +463,12 @@ const getErrorConstructor = (message, type) => {
|
|
|
463
463
|
switch (type) {
|
|
464
464
|
case DomException:
|
|
465
465
|
return DOMException;
|
|
466
|
-
case TypeError$1:
|
|
467
|
-
return TypeError;
|
|
468
|
-
case SyntaxError$1:
|
|
469
|
-
return SyntaxError;
|
|
470
466
|
case ReferenceError$1:
|
|
471
467
|
return ReferenceError;
|
|
468
|
+
case SyntaxError$1:
|
|
469
|
+
return SyntaxError;
|
|
470
|
+
case TypeError$1:
|
|
471
|
+
return TypeError;
|
|
472
472
|
default:
|
|
473
473
|
return Error;
|
|
474
474
|
}
|
|
@@ -624,27 +624,27 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
624
624
|
if (error && error.code === E_COMMAND_NOT_FOUND) {
|
|
625
625
|
return {
|
|
626
626
|
code: MethodNotFound,
|
|
627
|
-
|
|
628
|
-
|
|
627
|
+
data: error.stack,
|
|
628
|
+
message: error.message
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
631
|
return {
|
|
632
632
|
code: Custom,
|
|
633
|
-
message: prettyError.message,
|
|
634
633
|
data: {
|
|
635
|
-
stack: getStack(prettyError),
|
|
636
|
-
codeFrame: prettyError.codeFrame,
|
|
637
|
-
type: getErrorType(prettyError),
|
|
638
634
|
code: prettyError.code,
|
|
639
|
-
|
|
640
|
-
|
|
635
|
+
codeFrame: prettyError.codeFrame,
|
|
636
|
+
name: prettyError.name,
|
|
637
|
+
stack: getStack(prettyError),
|
|
638
|
+
type: getErrorType(prettyError)
|
|
639
|
+
},
|
|
640
|
+
message: prettyError.message
|
|
641
641
|
};
|
|
642
642
|
};
|
|
643
643
|
const create$1$1 = (id, error) => {
|
|
644
644
|
return {
|
|
645
|
-
|
|
645
|
+
error,
|
|
646
646
|
id,
|
|
647
|
-
|
|
647
|
+
jsonrpc: Two$1
|
|
648
648
|
};
|
|
649
649
|
};
|
|
650
650
|
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
@@ -655,8 +655,8 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
655
655
|
};
|
|
656
656
|
const create$7 = (message, result) => {
|
|
657
657
|
return {
|
|
658
|
-
jsonrpc: Two$1,
|
|
659
658
|
id: message.id,
|
|
659
|
+
jsonrpc: Two$1,
|
|
660
660
|
result: result ?? null
|
|
661
661
|
};
|
|
662
662
|
};
|
|
@@ -666,14 +666,14 @@ const getSuccessResponse = (message, result) => {
|
|
|
666
666
|
};
|
|
667
667
|
const getErrorResponseSimple = (id, error) => {
|
|
668
668
|
return {
|
|
669
|
-
jsonrpc: Two$1,
|
|
670
|
-
id,
|
|
671
669
|
error: {
|
|
672
670
|
code: Custom,
|
|
671
|
+
data: error,
|
|
673
672
|
// @ts-ignore
|
|
674
|
-
message: error.message
|
|
675
|
-
|
|
676
|
-
|
|
673
|
+
message: error.message
|
|
674
|
+
},
|
|
675
|
+
id,
|
|
676
|
+
jsonrpc: Two$1
|
|
677
677
|
};
|
|
678
678
|
};
|
|
679
679
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
@@ -703,35 +703,35 @@ const normalizeParams = args => {
|
|
|
703
703
|
if (args.length === 1) {
|
|
704
704
|
const options = args[0];
|
|
705
705
|
return {
|
|
706
|
+
execute: options.execute,
|
|
706
707
|
ipc: options.ipc,
|
|
708
|
+
logError: options.logError || defaultLogError,
|
|
707
709
|
message: options.message,
|
|
708
|
-
execute: options.execute,
|
|
709
|
-
resolve: options.resolve || defaultResolve,
|
|
710
710
|
preparePrettyError: options.preparePrettyError || defaultPreparePrettyError,
|
|
711
|
-
|
|
712
|
-
|
|
711
|
+
requiresSocket: options.requiresSocket || defaultRequiresSocket,
|
|
712
|
+
resolve: options.resolve || defaultResolve
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
715
|
return {
|
|
716
|
+
execute: args[2],
|
|
716
717
|
ipc: args[0],
|
|
718
|
+
logError: args[5],
|
|
717
719
|
message: args[1],
|
|
718
|
-
execute: args[2],
|
|
719
|
-
resolve: args[3],
|
|
720
720
|
preparePrettyError: args[4],
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
requiresSocket: args[6],
|
|
722
|
+
resolve: args[3]
|
|
723
723
|
};
|
|
724
724
|
};
|
|
725
725
|
const handleJsonRpcMessage = async (...args) => {
|
|
726
726
|
const options = normalizeParams(args);
|
|
727
727
|
const {
|
|
728
|
-
message,
|
|
729
|
-
ipc,
|
|
730
728
|
execute,
|
|
731
|
-
|
|
732
|
-
preparePrettyError,
|
|
729
|
+
ipc,
|
|
733
730
|
logError,
|
|
734
|
-
|
|
731
|
+
message,
|
|
732
|
+
preparePrettyError,
|
|
733
|
+
requiresSocket,
|
|
734
|
+
resolve
|
|
735
735
|
} = options;
|
|
736
736
|
if ('id' in message) {
|
|
737
737
|
if ('method' in message) {
|
|
@@ -792,7 +792,6 @@ const registerPromise = map => {
|
|
|
792
792
|
};
|
|
793
793
|
};
|
|
794
794
|
|
|
795
|
-
// @ts-ignore
|
|
796
795
|
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
797
796
|
const {
|
|
798
797
|
id,
|
|
@@ -886,6 +885,7 @@ const create$3 = async ({
|
|
|
886
885
|
};
|
|
887
886
|
|
|
888
887
|
const Tab = 'tab';
|
|
888
|
+
const TabList = 'tablist';
|
|
889
889
|
const ToolBar = 'toolbar';
|
|
890
890
|
|
|
891
891
|
const Button = 1;
|
|
@@ -1659,7 +1659,7 @@ const createPanelTab = (tab, badgeCount, isSelected, index) => {
|
|
|
1659
1659
|
className,
|
|
1660
1660
|
'data-index': index,
|
|
1661
1661
|
name: tab,
|
|
1662
|
-
onClick:
|
|
1662
|
+
onClick: HandleClickTab,
|
|
1663
1663
|
role: Tab,
|
|
1664
1664
|
type: Button
|
|
1665
1665
|
};
|
|
@@ -1694,7 +1694,7 @@ const getPanelHeaderDom = newState => {
|
|
|
1694
1694
|
}, {
|
|
1695
1695
|
childCount: newState.views.length,
|
|
1696
1696
|
className: PanelTabs,
|
|
1697
|
-
role:
|
|
1697
|
+
role: TabList,
|
|
1698
1698
|
type: Div
|
|
1699
1699
|
}, ...tabsDom, ...getActionsDom(newState), ...getGlobalActionsDom()];
|
|
1700
1700
|
};
|