@lvce-editor/about-view 7.7.0 → 7.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/aboutWorkerMain.js +76 -29
- package/package.json +1 -1
package/dist/aboutWorkerMain.js
CHANGED
|
@@ -251,7 +251,7 @@ const focusPrevious = state => {
|
|
|
251
251
|
};
|
|
252
252
|
|
|
253
253
|
const Audio = 0;
|
|
254
|
-
const Button$
|
|
254
|
+
const Button$1 = 1;
|
|
255
255
|
const Col = 2;
|
|
256
256
|
const ColGroup = 3;
|
|
257
257
|
const Div = 4;
|
|
@@ -342,7 +342,7 @@ const VirtualDomElements = {
|
|
|
342
342
|
Audio,
|
|
343
343
|
BlockQuote,
|
|
344
344
|
Br,
|
|
345
|
-
Button: Button$
|
|
345
|
+
Button: Button$1,
|
|
346
346
|
Canvas,
|
|
347
347
|
Circle,
|
|
348
348
|
Cite,
|
|
@@ -427,7 +427,7 @@ const Escape = 8;
|
|
|
427
427
|
const Shift = 1 << 10 >>> 0;
|
|
428
428
|
|
|
429
429
|
const FileSystemWorker = 209;
|
|
430
|
-
const RendererWorker = 1;
|
|
430
|
+
const RendererWorker$1 = 1;
|
|
431
431
|
|
|
432
432
|
const mergeClassNames = (...classNames) => {
|
|
433
433
|
return classNames.filter(Boolean).join(' ');
|
|
@@ -1006,7 +1006,10 @@ const constructError = (message, type, name) => {
|
|
|
1006
1006
|
if (ErrorConstructor === Error) {
|
|
1007
1007
|
const error = new Error(message);
|
|
1008
1008
|
if (name && name !== 'VError') {
|
|
1009
|
-
error
|
|
1009
|
+
Object.defineProperty(error, 'name', {
|
|
1010
|
+
configurable: true,
|
|
1011
|
+
value: name
|
|
1012
|
+
});
|
|
1010
1013
|
}
|
|
1011
1014
|
return error;
|
|
1012
1015
|
}
|
|
@@ -1037,31 +1040,45 @@ const getParentStack = error => {
|
|
|
1037
1040
|
};
|
|
1038
1041
|
const MethodNotFound = -32601;
|
|
1039
1042
|
const Custom = -32001;
|
|
1043
|
+
const setStack = (error, stack) => {
|
|
1044
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, 'stack');
|
|
1045
|
+
if (descriptor) {
|
|
1046
|
+
if (!descriptor.configurable && !descriptor.writable) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
if (!descriptor.configurable && descriptor.writable) {
|
|
1050
|
+
error.stack = stack;
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
Object.defineProperty(error, 'stack', {
|
|
1055
|
+
configurable: true,
|
|
1056
|
+
value: stack,
|
|
1057
|
+
writable: true
|
|
1058
|
+
});
|
|
1059
|
+
};
|
|
1040
1060
|
const restoreExistingError = (error, currentStack) => {
|
|
1041
1061
|
if (typeof error.stack === 'string') {
|
|
1042
|
-
error
|
|
1062
|
+
setStack(error, `${error.stack}${NewLine$1}${currentStack}`);
|
|
1043
1063
|
}
|
|
1044
1064
|
return error;
|
|
1045
1065
|
};
|
|
1046
1066
|
const restoreMethodNotFoundError = (error, currentStack) => {
|
|
1047
1067
|
const restoredError = new JsonRpcError(error.message);
|
|
1048
1068
|
const parentStack = getParentStack(error);
|
|
1049
|
-
restoredError
|
|
1069
|
+
setStack(restoredError, `${parentStack}${NewLine$1}${currentStack}`);
|
|
1050
1070
|
return restoredError;
|
|
1051
1071
|
};
|
|
1052
1072
|
const restoreStackFromData = (restoredError, error, currentStack) => {
|
|
1053
1073
|
if (error.data.stack && error.data.type && error.message) {
|
|
1054
|
-
restoredError
|
|
1074
|
+
setStack(restoredError, `${error.data.type}: ${error.message}${NewLine$1}${error.data.stack}${NewLine$1}${currentStack}`);
|
|
1055
1075
|
return;
|
|
1056
1076
|
}
|
|
1057
1077
|
if (error.data.stack) {
|
|
1058
|
-
restoredError
|
|
1078
|
+
setStack(restoredError, error.data.stack);
|
|
1059
1079
|
}
|
|
1060
1080
|
};
|
|
1061
1081
|
const applyDataProperties = (restoredError, error) => {
|
|
1062
|
-
if (!error.data) {
|
|
1063
|
-
return;
|
|
1064
|
-
}
|
|
1065
1082
|
restoreStackFromData(restoredError, error, getCurrentStack());
|
|
1066
1083
|
if (error.data.codeFrame) {
|
|
1067
1084
|
// @ts-ignore
|
|
@@ -1082,7 +1099,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
1082
1099
|
const indexNewLine = getNewLineIndex(lowerStack);
|
|
1083
1100
|
const parentStack = getParentStack(error);
|
|
1084
1101
|
// @ts-ignore
|
|
1085
|
-
restoredError
|
|
1102
|
+
setStack(restoredError, `${parentStack}${lowerStack.slice(indexNewLine)}`);
|
|
1086
1103
|
}
|
|
1087
1104
|
if (error.codeFrame) {
|
|
1088
1105
|
// @ts-ignore
|
|
@@ -1579,7 +1596,7 @@ const {
|
|
|
1579
1596
|
invoke,
|
|
1580
1597
|
invokeAndTransfer,
|
|
1581
1598
|
set
|
|
1582
|
-
} = create(RendererWorker);
|
|
1599
|
+
} = create(RendererWorker$1);
|
|
1583
1600
|
const getElectronVersion$1 = async () => {
|
|
1584
1601
|
return invoke('Process.getElectronVersion');
|
|
1585
1602
|
};
|
|
@@ -1615,7 +1632,27 @@ const getWindowId$1 = async () => {
|
|
|
1615
1632
|
return invoke('GetWindowId.getWindowId');
|
|
1616
1633
|
};
|
|
1617
1634
|
|
|
1618
|
-
const
|
|
1635
|
+
const RendererWorker = {
|
|
1636
|
+
__proto__: null,
|
|
1637
|
+
closeWidget: closeWidget$1,
|
|
1638
|
+
getChromeVersion: getChromeVersion$1,
|
|
1639
|
+
getElectronVersion: getElectronVersion$1,
|
|
1640
|
+
getNodeVersion: getNodeVersion$1,
|
|
1641
|
+
getV8Version: getV8Version$1,
|
|
1642
|
+
getWindowId: getWindowId$1,
|
|
1643
|
+
invoke,
|
|
1644
|
+
invokeAndTransfer,
|
|
1645
|
+
openWidget,
|
|
1646
|
+
sendMessagePortToFileSystemWorker,
|
|
1647
|
+
set,
|
|
1648
|
+
setFocus,
|
|
1649
|
+
showMessageBox: showMessageBox$1,
|
|
1650
|
+
writeClipBoardText
|
|
1651
|
+
};
|
|
1652
|
+
|
|
1653
|
+
const {
|
|
1654
|
+
closeWidget
|
|
1655
|
+
} = RendererWorker;
|
|
1619
1656
|
|
|
1620
1657
|
const About$1 = 'About';
|
|
1621
1658
|
|
|
@@ -1678,7 +1715,10 @@ const handleFocusIn = async context => {
|
|
|
1678
1715
|
// TODO remove side effect
|
|
1679
1716
|
await setFocus(FocusAbout);
|
|
1680
1717
|
await context.updateState(state => {
|
|
1681
|
-
|
|
1718
|
+
const {
|
|
1719
|
+
focusId
|
|
1720
|
+
} = state;
|
|
1721
|
+
if (focusId) {
|
|
1682
1722
|
return state;
|
|
1683
1723
|
}
|
|
1684
1724
|
return {
|
|
@@ -1997,7 +2037,6 @@ const getString = (config, key) => {
|
|
|
1997
2037
|
const loadConfig = async () => {
|
|
1998
2038
|
const configJsonPath = await getConfigJsonPath();
|
|
1999
2039
|
// FileSystemWorker.readFile is a custom RPC that already returns a string.
|
|
2000
|
-
// eslint-disable-next-line unicorn/consistent-json-file-read
|
|
2001
2040
|
const content = await readFile(configJsonPath);
|
|
2002
2041
|
const config = JSON.parse(content);
|
|
2003
2042
|
return {
|
|
@@ -2055,7 +2094,7 @@ const createViewModel = state => {
|
|
|
2055
2094
|
};
|
|
2056
2095
|
};
|
|
2057
2096
|
|
|
2058
|
-
const Button
|
|
2097
|
+
const Button = 'Button';
|
|
2059
2098
|
const ButtonPrimary = 'ButtonPrimary';
|
|
2060
2099
|
const ButtonSecondary = 'ButtonSecondary';
|
|
2061
2100
|
const DialogButtonsRow = 'DialogButtonsRow';
|
|
@@ -2101,26 +2140,25 @@ const getAboutContentVirtualDom = lines => {
|
|
|
2101
2140
|
|
|
2102
2141
|
const True = 'true';
|
|
2103
2142
|
|
|
2104
|
-
const Button = 'button';
|
|
2105
2143
|
const Dialog = 'dialog';
|
|
2106
2144
|
|
|
2107
2145
|
const getPrimaryButtonVirtualDom = (message, name) => {
|
|
2108
2146
|
return [{
|
|
2109
2147
|
childCount: 1,
|
|
2110
|
-
className: mergeClassNames(Button
|
|
2148
|
+
className: mergeClassNames(Button, ButtonPrimary),
|
|
2111
2149
|
name,
|
|
2112
2150
|
onClick: HandleClickButton,
|
|
2113
|
-
type: Button$
|
|
2151
|
+
type: Button$1
|
|
2114
2152
|
}, text(message)];
|
|
2115
2153
|
};
|
|
2116
2154
|
|
|
2117
2155
|
const getSecondaryButtonVirtualDom = (message, name) => {
|
|
2118
2156
|
return [{
|
|
2119
2157
|
childCount: 1,
|
|
2120
|
-
className: mergeClassNames(Button
|
|
2158
|
+
className: mergeClassNames(Button, ButtonSecondary),
|
|
2121
2159
|
name,
|
|
2122
2160
|
onClick: HandleClickButton,
|
|
2123
|
-
type: Button$
|
|
2161
|
+
type: Button$1
|
|
2124
2162
|
}, text(message)];
|
|
2125
2163
|
};
|
|
2126
2164
|
|
|
@@ -2152,8 +2190,7 @@ const getDialogVirtualDom = (content, closeMessage, infoMessage, okMessage, copy
|
|
|
2152
2190
|
childCount: 1,
|
|
2153
2191
|
className: DialogClose,
|
|
2154
2192
|
onClick: HandleClickClose,
|
|
2155
|
-
|
|
2156
|
-
type: Div
|
|
2193
|
+
type: Button$1
|
|
2157
2194
|
}, {
|
|
2158
2195
|
childCount: 0,
|
|
2159
2196
|
className: mergeClassNames(MaskIcon, MaskIconClose),
|
|
@@ -2283,7 +2320,9 @@ const showAboutDefault = async () => {
|
|
|
2283
2320
|
await openWidget(About$1);
|
|
2284
2321
|
};
|
|
2285
2322
|
|
|
2286
|
-
const
|
|
2323
|
+
const {
|
|
2324
|
+
getWindowId
|
|
2325
|
+
} = RendererWorker;
|
|
2287
2326
|
|
|
2288
2327
|
const showMessageBox = async options => {
|
|
2289
2328
|
const windowId = await getWindowId();
|
|
@@ -2296,10 +2335,18 @@ const showMessageBox = async options => {
|
|
|
2296
2335
|
|
|
2297
2336
|
const Info = 'info';
|
|
2298
2337
|
|
|
2299
|
-
const
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
const
|
|
2338
|
+
const {
|
|
2339
|
+
getElectronVersion
|
|
2340
|
+
} = RendererWorker;
|
|
2341
|
+
const {
|
|
2342
|
+
getNodeVersion
|
|
2343
|
+
} = RendererWorker;
|
|
2344
|
+
const {
|
|
2345
|
+
getChromeVersion
|
|
2346
|
+
} = RendererWorker;
|
|
2347
|
+
const {
|
|
2348
|
+
getV8Version
|
|
2349
|
+
} = RendererWorker;
|
|
2303
2350
|
|
|
2304
2351
|
const getDetailString = async config => {
|
|
2305
2352
|
const [electronVersion, nodeVersion, chromeVersion, v8Version] = await Promise.all([getElectronVersion(), getNodeVersion(), getChromeVersion(), getV8Version()]);
|