@lvce-editor/about-view 1.4.0 → 1.5.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 +15 -10
- package/package.json +5 -3
package/dist/aboutWorkerMain.js
CHANGED
@@ -342,7 +342,7 @@ const formatDate = (date, now) => {
|
|
342
342
|
return formatDateFuture(-seconds);
|
343
343
|
};
|
344
344
|
|
345
|
-
const formatAboutDate = isoDate => {
|
345
|
+
const formatAboutDate = (isoDate, now) => {
|
346
346
|
if (!isoDate) {
|
347
347
|
return 'unknown';
|
348
348
|
}
|
@@ -350,7 +350,6 @@ const formatAboutDate = isoDate => {
|
|
350
350
|
if (isNaN(date)) {
|
351
351
|
return `Invalid Date: ${isoDate}`;
|
352
352
|
}
|
353
|
-
const now = Date.now();
|
354
353
|
const ago = formatDate(date, now);
|
355
354
|
return `${isoDate} (${ago})`;
|
356
355
|
};
|
@@ -389,7 +388,8 @@ const productNameLong = 'Lvce Editor - OSS';
|
|
389
388
|
|
390
389
|
const getDetailString = async () => {
|
391
390
|
const [electronVersion, nodeVersion, chromeVersion, version, commit, v8Version, date] = await Promise.all([getElectronVersion(), getNodeVersion(), getChromeVersion(), getVersion(), getCommit(), getV8Version(), getDate()]);
|
392
|
-
const
|
391
|
+
const now = Date.now();
|
392
|
+
const formattedDate = formatAboutDate(date, now);
|
393
393
|
const lines = [`Version: ${version}`, `Commit: ${commit}`, `Date: ${formattedDate}`, `Electron: ${electronVersion}`, `Chromium: ${chromeVersion}`, `Node: ${nodeVersion}`, `V8: ${v8Version}`];
|
394
394
|
return joinLines$1(lines);
|
395
395
|
};
|
@@ -402,7 +402,8 @@ const getDetailStringWeb = () => {
|
|
402
402
|
const version$1 = version;
|
403
403
|
const commit$1 = commit;
|
404
404
|
const date$1 = date;
|
405
|
-
const
|
405
|
+
const now = Date.now();
|
406
|
+
const formattedDate = formatAboutDate(date$1, now);
|
406
407
|
const browser = getBrowser();
|
407
408
|
const lines = [`Version: ${version$1}`, `Commit: ${commit$1}`, `Date: ${formattedDate}`, `Browser: ${browser}`];
|
408
409
|
return lines;
|
@@ -461,10 +462,14 @@ const getAboutContentVirtualDom = lines => {
|
|
461
462
|
const Button = 'button';
|
462
463
|
const Dialog = 'dialog';
|
463
464
|
|
465
|
+
const mergeClassNames = (...classNames) => {
|
466
|
+
return classNames.filter(Boolean).join(' ');
|
467
|
+
};
|
468
|
+
|
464
469
|
const getPrimaryButtonVirtualDom = (message, onClick) => {
|
465
470
|
return [{
|
466
471
|
type: Button$2,
|
467
|
-
className:
|
472
|
+
className: mergeClassNames(Button$1, ButtonPrimary),
|
468
473
|
onClick,
|
469
474
|
childCount: 1
|
470
475
|
}, text(message)];
|
@@ -472,7 +477,7 @@ const getPrimaryButtonVirtualDom = (message, onClick) => {
|
|
472
477
|
const getSecondaryButtonVirtualDom = (message, onClick) => {
|
473
478
|
return [{
|
474
479
|
type: Button$2,
|
475
|
-
className:
|
480
|
+
className: mergeClassNames(Button$1, ButtonSecondary),
|
476
481
|
onClick,
|
477
482
|
childCount: 1
|
478
483
|
}, text(message)];
|
@@ -639,7 +644,7 @@ class AssertionError extends Error {
|
|
639
644
|
this.name = 'AssertionError';
|
640
645
|
}
|
641
646
|
}
|
642
|
-
const getType
|
647
|
+
const getType = value => {
|
643
648
|
switch (typeof value) {
|
644
649
|
case 'number':
|
645
650
|
return 'number';
|
@@ -662,7 +667,7 @@ const getType$1 = value => {
|
|
662
667
|
}
|
663
668
|
};
|
664
669
|
const number = value => {
|
665
|
-
const type = getType
|
670
|
+
const type = getType(value);
|
666
671
|
if (type !== 'number') {
|
667
672
|
throw new AssertionError('expected value to be of type number');
|
668
673
|
}
|
@@ -699,7 +704,7 @@ class JsonRpcError extends Error {
|
|
699
704
|
const MethodNotFound = -32601;
|
700
705
|
const Custom = -32001;
|
701
706
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
702
|
-
const
|
707
|
+
const getErrorType = prettyError => {
|
703
708
|
if (prettyError && prettyError.type) {
|
704
709
|
return prettyError.type;
|
705
710
|
}
|
@@ -722,7 +727,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
722
727
|
data: {
|
723
728
|
stack: prettyError.stack,
|
724
729
|
codeFrame: prettyError.codeFrame,
|
725
|
-
type:
|
730
|
+
type: getErrorType(prettyError),
|
726
731
|
code: prettyError.code,
|
727
732
|
name: prettyError.name
|
728
733
|
}
|
package/package.json
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lvce-editor/about-view",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.5.0",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/aboutWorkerMain.js",
|
6
6
|
"type": "module",
|
7
|
-
"keywords": [
|
8
|
-
|
7
|
+
"keywords": [
|
8
|
+
"about"
|
9
|
+
],
|
10
|
+
"author": "Lvce Editor",
|
9
11
|
"license": "MIT"
|
10
12
|
}
|