@lvce-editor/about-view 3.1.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/aboutWorkerMain.js +114 -108
- package/package.json +8 -4
package/dist/aboutWorkerMain.js
CHANGED
@@ -390,17 +390,15 @@ const create$4 = (method, params) => {
|
|
390
390
|
params
|
391
391
|
};
|
392
392
|
};
|
393
|
-
const
|
394
|
-
callbacks: Object.create(null)
|
395
|
-
};
|
393
|
+
const callbacks = Object.create(null);
|
396
394
|
const set = (id, fn) => {
|
397
|
-
|
395
|
+
callbacks[id] = fn;
|
398
396
|
};
|
399
397
|
const get = id => {
|
400
|
-
return
|
398
|
+
return callbacks[id];
|
401
399
|
};
|
402
400
|
const remove = id => {
|
403
|
-
delete
|
401
|
+
delete callbacks[id];
|
404
402
|
};
|
405
403
|
let id = 0;
|
406
404
|
const create$3 = () => {
|
@@ -807,15 +805,15 @@ const WebWorkerRpcClient = {
|
|
807
805
|
};
|
808
806
|
|
809
807
|
const None = 0;
|
810
|
-
const Ok$
|
811
|
-
const Copy$
|
808
|
+
const Ok$2 = 1;
|
809
|
+
const Copy$2 = 2;
|
812
810
|
|
813
811
|
const getNextFocus = focusId => {
|
814
812
|
switch (focusId) {
|
815
|
-
case Ok$
|
816
|
-
return Copy$
|
817
|
-
case Copy$
|
818
|
-
return Ok$
|
813
|
+
case Ok$2:
|
814
|
+
return Copy$2;
|
815
|
+
case Copy$2:
|
816
|
+
return Ok$2;
|
819
817
|
default:
|
820
818
|
return None;
|
821
819
|
}
|
@@ -833,10 +831,10 @@ const focusNext = state => {
|
|
833
831
|
|
834
832
|
const getPreviousFocus = focusId => {
|
835
833
|
switch (focusId) {
|
836
|
-
case Ok$
|
837
|
-
return Copy$
|
838
|
-
case Copy$
|
839
|
-
return Ok$
|
834
|
+
case Ok$2:
|
835
|
+
return Copy$2;
|
836
|
+
case Copy$2:
|
837
|
+
return Ok$2;
|
840
838
|
default:
|
841
839
|
return None;
|
842
840
|
}
|
@@ -852,6 +850,35 @@ const focusPrevious = state => {
|
|
852
850
|
};
|
853
851
|
};
|
854
852
|
|
853
|
+
const OneSecondAgo = '1 second ago';
|
854
|
+
const SomeSecondsAgo = '{PH1} seconds ago';
|
855
|
+
const OneMinuteAgo = '1 minute ago';
|
856
|
+
const SomeMinutesAgo = '{PH1} minutes ago';
|
857
|
+
const OneHourAgo = '1 hour ago';
|
858
|
+
const SomeHoursAgo = '{PH1} hours ago';
|
859
|
+
const OneDayAgo = '1 day ago';
|
860
|
+
const SomeDaysAgo = '{PH1} days ago';
|
861
|
+
const OneWeekAgo = '1 week ago';
|
862
|
+
const SomeWeeksAgo = '{PH1} weeks ago';
|
863
|
+
const OneMonthAgo = '1 month ago';
|
864
|
+
const SomeMonthsAgo = '{PH1} months ago';
|
865
|
+
const OneYearAgo = '1 year ago';
|
866
|
+
const SomeYearsAgo = '{PH1} years ago';
|
867
|
+
const InOneSecond = 'in 1 second';
|
868
|
+
const InSomeSeconds = 'in {PH1} seconds';
|
869
|
+
const InOneMinute = 'in 1 minute';
|
870
|
+
const InSomeMinutes = 'in {PH1} minutes';
|
871
|
+
const InOneHour = 'in 1 hour';
|
872
|
+
const InSomeHours = 'in {PH1} hours';
|
873
|
+
const InOneDay = 'in 1 day';
|
874
|
+
const InSomeDays = 'in {PH1} days';
|
875
|
+
const InOneWeek = 'in 1 week';
|
876
|
+
const InSomeWeeks = 'in {PH1} weeks';
|
877
|
+
const InOneMonth = 'in 1 month';
|
878
|
+
const InSomeMonths = 'in {PH1} months';
|
879
|
+
const InOneYear = 'in 1 year';
|
880
|
+
const InSomeYears = 'in {PH1} years';
|
881
|
+
|
855
882
|
const emptyObject = {};
|
856
883
|
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
857
884
|
const i18nString = (key, placeholders = emptyObject) => {
|
@@ -865,149 +892,115 @@ const i18nString = (key, placeholders = emptyObject) => {
|
|
865
892
|
};
|
866
893
|
|
867
894
|
// based on https://github.com/microsoft/vscode/blob/bd782eb059e133d3a20fdb446b8feb0010a278ad/src/vs/base/common/date.ts (License MIT)
|
868
|
-
|
869
|
-
/**
|
870
|
-
* @enum {string}
|
871
|
-
*/
|
872
|
-
const UiStrings$1 = {
|
873
|
-
OneSecondAgo: '1 second ago',
|
874
|
-
SomeSecondsAgo: '{PH1} seconds ago',
|
875
|
-
OneMinuteAgo: '1 minute ago',
|
876
|
-
SomeMinutesAgo: '{PH1} minutes ago',
|
877
|
-
OneHourAgo: '1 hour ago',
|
878
|
-
SomeHoursAgo: '{PH1} hours ago',
|
879
|
-
OneDayAgo: '1 day ago',
|
880
|
-
SomeDaysAgo: '{PH1} days ago',
|
881
|
-
OneWeekAgo: '1 week ago',
|
882
|
-
SomeWeeksAgo: '{PH1} weeks ago',
|
883
|
-
OneMonthAgo: '1 month ago',
|
884
|
-
SomeMonthsAgo: '{PH1} months ago',
|
885
|
-
OneYearAgo: '1 year ago',
|
886
|
-
SomeYearsAgo: '{PH1} years ago',
|
887
|
-
InOneSecond: 'in 1 second',
|
888
|
-
InSomeSeconds: 'in {PH1} seconds',
|
889
|
-
InOneMinute: 'in 1 minute',
|
890
|
-
InSomeMinutes: 'in {PH1} minutes',
|
891
|
-
InOneHour: 'in 1 hour',
|
892
|
-
InSomeHours: 'in {PH1} hours',
|
893
|
-
InOneDay: 'in 1 day',
|
894
|
-
InSomeDays: 'in {PH1} days',
|
895
|
-
InOneWeek: 'in 1 week',
|
896
|
-
InSomeWeeks: 'in {PH1} weeks',
|
897
|
-
InOneMonth: 'in 1 month',
|
898
|
-
InSomeMonths: 'in {PH1} months',
|
899
|
-
InOneYear: 'in 1 year',
|
900
|
-
InSomeYears: 'in {PH1} years'
|
901
|
-
};
|
902
895
|
const oneSecondAgo = () => {
|
903
|
-
return i18nString(
|
896
|
+
return i18nString(OneSecondAgo);
|
904
897
|
};
|
905
898
|
const someSecondsAgo = seconds => {
|
906
|
-
return i18nString(
|
899
|
+
return i18nString(SomeSecondsAgo, {
|
907
900
|
PH1: seconds
|
908
901
|
});
|
909
902
|
};
|
910
903
|
const oneMinuteAgo = () => {
|
911
|
-
return i18nString(
|
904
|
+
return i18nString(OneMinuteAgo);
|
912
905
|
};
|
913
906
|
const someMinutesAgo = minutes => {
|
914
|
-
return i18nString(
|
907
|
+
return i18nString(SomeMinutesAgo, {
|
915
908
|
PH1: minutes
|
916
909
|
});
|
917
910
|
};
|
918
911
|
const oneHourAgo = () => {
|
919
|
-
return i18nString(
|
912
|
+
return i18nString(OneHourAgo);
|
920
913
|
};
|
921
914
|
const someHoursAgo = hours => {
|
922
|
-
return i18nString(
|
915
|
+
return i18nString(SomeHoursAgo, {
|
923
916
|
PH1: hours
|
924
917
|
});
|
925
918
|
};
|
926
919
|
const oneDayAgo = () => {
|
927
|
-
return i18nString(
|
920
|
+
return i18nString(OneDayAgo);
|
928
921
|
};
|
929
922
|
const someDaysAgo = days => {
|
930
|
-
return i18nString(
|
923
|
+
return i18nString(SomeDaysAgo, {
|
931
924
|
PH1: days
|
932
925
|
});
|
933
926
|
};
|
934
927
|
const oneWeekAgo = () => {
|
935
|
-
return i18nString(
|
928
|
+
return i18nString(OneWeekAgo);
|
936
929
|
};
|
937
930
|
const someWeeksAgo = weeks => {
|
938
|
-
return i18nString(
|
931
|
+
return i18nString(SomeWeeksAgo, {
|
939
932
|
PH1: weeks
|
940
933
|
});
|
941
934
|
};
|
942
935
|
const oneMonthAgo = () => {
|
943
|
-
return i18nString(
|
936
|
+
return i18nString(OneMonthAgo);
|
944
937
|
};
|
945
938
|
const someMonthsAgo = months => {
|
946
|
-
return i18nString(
|
939
|
+
return i18nString(SomeMonthsAgo, {
|
947
940
|
PH1: months
|
948
941
|
});
|
949
942
|
};
|
950
943
|
const oneYearAgo = () => {
|
951
|
-
return i18nString(
|
944
|
+
return i18nString(OneYearAgo);
|
952
945
|
};
|
953
946
|
const someYearsAgo = years => {
|
954
|
-
return i18nString(
|
947
|
+
return i18nString(SomeYearsAgo, {
|
955
948
|
PH1: years
|
956
949
|
});
|
957
950
|
};
|
958
951
|
const inOneSecond = () => {
|
959
|
-
return i18nString(
|
952
|
+
return i18nString(InOneSecond);
|
960
953
|
};
|
961
954
|
const inSomeSeconds = seconds => {
|
962
|
-
return i18nString(
|
955
|
+
return i18nString(InSomeSeconds, {
|
963
956
|
PH1: seconds
|
964
957
|
});
|
965
958
|
};
|
966
959
|
const inOneMinute = () => {
|
967
|
-
return i18nString(
|
960
|
+
return i18nString(InOneMinute);
|
968
961
|
};
|
969
962
|
const inSomeMinutes = minutes => {
|
970
|
-
return i18nString(
|
963
|
+
return i18nString(InSomeMinutes, {
|
971
964
|
PH1: minutes
|
972
965
|
});
|
973
966
|
};
|
974
967
|
const inOneHour = () => {
|
975
|
-
return i18nString(
|
968
|
+
return i18nString(InOneHour);
|
976
969
|
};
|
977
970
|
const inSomeHours = hours => {
|
978
|
-
return i18nString(
|
971
|
+
return i18nString(InSomeHours, {
|
979
972
|
PH1: hours
|
980
973
|
});
|
981
974
|
};
|
982
975
|
const inOneDay = () => {
|
983
|
-
return i18nString(
|
976
|
+
return i18nString(InOneDay);
|
984
977
|
};
|
985
978
|
const inSomeDays = days => {
|
986
|
-
return i18nString(
|
979
|
+
return i18nString(InSomeDays, {
|
987
980
|
PH1: days
|
988
981
|
});
|
989
982
|
};
|
990
983
|
const inOneWeek = () => {
|
991
|
-
return i18nString(
|
984
|
+
return i18nString(InOneWeek);
|
992
985
|
};
|
993
986
|
const inSomeWeeks = weeks => {
|
994
|
-
return i18nString(
|
987
|
+
return i18nString(InSomeWeeks, {
|
995
988
|
PH1: weeks
|
996
989
|
});
|
997
990
|
};
|
998
991
|
const inOneMonth = () => {
|
999
|
-
return i18nString(
|
992
|
+
return i18nString(InOneMonth);
|
1000
993
|
};
|
1001
994
|
const inSomeMonths = months => {
|
1002
|
-
return i18nString(
|
995
|
+
return i18nString(InSomeMonths, {
|
1003
996
|
PH1: months
|
1004
997
|
});
|
1005
998
|
};
|
1006
999
|
const inOneYear = () => {
|
1007
|
-
return i18nString(
|
1000
|
+
return i18nString(InOneYear);
|
1008
1001
|
};
|
1009
1002
|
const inSomeYears = years => {
|
1010
|
-
return i18nString(
|
1003
|
+
return i18nString(InSomeYears, {
|
1011
1004
|
PH1: years
|
1012
1005
|
});
|
1013
1006
|
};
|
@@ -1302,8 +1295,8 @@ const getSecondaryButtonVirtualDom = (message, onClick, name) => {
|
|
1302
1295
|
const DialogIcon = 'DialogIcon';
|
1303
1296
|
const DialogHeading = 'DialogHeading';
|
1304
1297
|
|
1305
|
-
const Ok = 'Ok';
|
1306
|
-
const Copy = 'Copy';
|
1298
|
+
const Ok$1 = 'Ok';
|
1299
|
+
const Copy$1 = 'Copy';
|
1307
1300
|
|
1308
1301
|
const Focusable = -1;
|
1309
1302
|
|
@@ -1355,7 +1348,7 @@ const getDialogVirtualDom = (content, closeMessage, infoMessage, okMessage, copy
|
|
1355
1348
|
type: Div,
|
1356
1349
|
className: DialogButtonsRow,
|
1357
1350
|
childCount: 2
|
1358
|
-
}, ...getSecondaryButtonVirtualDom(okMessage, HandleClickOk, Ok), ...getPrimaryButtonVirtualDom(copyMessage, HandleClickCopy, Copy)];
|
1351
|
+
}, ...getSecondaryButtonVirtualDom(okMessage, HandleClickOk, Ok$1), ...getPrimaryButtonVirtualDom(copyMessage, HandleClickCopy, Copy$1)];
|
1359
1352
|
return dom;
|
1360
1353
|
};
|
1361
1354
|
|
@@ -1392,49 +1385,63 @@ const getKeyBindings = () => {
|
|
1392
1385
|
}];
|
1393
1386
|
};
|
1394
1387
|
|
1388
|
+
const handleClickClose = async state => {
|
1389
|
+
await invoke('Viewlet.closeWidget', 'About');
|
1390
|
+
return state;
|
1391
|
+
};
|
1392
|
+
|
1393
|
+
const writeText = async text => {
|
1394
|
+
await invoke('ClipBoard.writeText', /* text */text);
|
1395
|
+
};
|
1396
|
+
|
1397
|
+
const handleClickCopy = async state => {
|
1398
|
+
const {
|
1399
|
+
lines
|
1400
|
+
} = state;
|
1401
|
+
const message = joinLines(lines);
|
1402
|
+
await writeText(message);
|
1403
|
+
return state;
|
1404
|
+
};
|
1405
|
+
|
1406
|
+
const handleClickOk = async state => {
|
1407
|
+
await invoke('Viewlet.closeWidget', 'About');
|
1408
|
+
return state;
|
1409
|
+
};
|
1410
|
+
|
1395
1411
|
const loadContent = state => {
|
1396
1412
|
const lines = getDetailStringWeb();
|
1397
1413
|
return {
|
1398
1414
|
...state,
|
1399
1415
|
productName: productNameLong$1,
|
1400
1416
|
lines,
|
1401
|
-
focusId: Ok$
|
1417
|
+
focusId: Ok$2
|
1402
1418
|
};
|
1403
1419
|
};
|
1404
1420
|
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
const
|
1409
|
-
|
1410
|
-
Copy: 'Copy',
|
1411
|
-
Version: 'Version',
|
1412
|
-
Commit: 'Commit',
|
1413
|
-
Date: 'Date',
|
1414
|
-
Browser: 'Browser',
|
1415
|
-
Info: 'Info',
|
1416
|
-
Close: 'Close',
|
1417
|
-
CloseDialog: 'Close Dialog'
|
1418
|
-
};
|
1421
|
+
const Ok = 'Ok';
|
1422
|
+
const Copy = 'Copy';
|
1423
|
+
const Info$1 = 'Info';
|
1424
|
+
const CloseDialog = 'Close Dialog';
|
1425
|
+
|
1419
1426
|
const ok = () => {
|
1420
|
-
return i18nString(
|
1427
|
+
return i18nString(Ok);
|
1421
1428
|
};
|
1422
1429
|
const copy = () => {
|
1423
|
-
return i18nString(
|
1430
|
+
return i18nString(Copy);
|
1424
1431
|
};
|
1425
1432
|
const info = () => {
|
1426
|
-
return i18nString(
|
1433
|
+
return i18nString(Info$1);
|
1427
1434
|
};
|
1428
1435
|
const closeDialog = () => {
|
1429
|
-
return i18nString(
|
1436
|
+
return i18nString(CloseDialog);
|
1430
1437
|
};
|
1431
1438
|
|
1432
1439
|
const getFocusSelector = focusId => {
|
1433
1440
|
switch (focusId) {
|
1434
|
-
case Copy$
|
1435
|
-
return Copy;
|
1436
|
-
case Ok$
|
1437
|
-
return Ok;
|
1441
|
+
case Copy$2:
|
1442
|
+
return Copy$1;
|
1443
|
+
case Ok$2:
|
1444
|
+
return Ok$1;
|
1438
1445
|
default:
|
1439
1446
|
return '';
|
1440
1447
|
}
|
@@ -1493,10 +1500,6 @@ const renderEventListeners = () => {
|
|
1493
1500
|
}];
|
1494
1501
|
};
|
1495
1502
|
|
1496
|
-
const writeText = async text => {
|
1497
|
-
await invoke('ClipBoard.writeText', /* text */text);
|
1498
|
-
};
|
1499
|
-
|
1500
1503
|
const getWindowId = async () => {
|
1501
1504
|
return invoke('GetWindowId.getWindowId');
|
1502
1505
|
};
|
@@ -1545,6 +1548,9 @@ const commandMap = {
|
|
1545
1548
|
'About.getDetailStringWeb': getDetailStringWeb,
|
1546
1549
|
'About.getKeyBindings': getKeyBindings,
|
1547
1550
|
'About.getVirtualDom': getAboutVirtualDom,
|
1551
|
+
'About.handleClickClose': handleClickClose,
|
1552
|
+
'About.handleClickCopy': handleClickCopy,
|
1553
|
+
'About.handleClickOk': handleClickOk,
|
1548
1554
|
'About.loadContent': loadContent,
|
1549
1555
|
'About.render': doRender,
|
1550
1556
|
'About.renderEventListeners': renderEventListeners,
|
package/package.json
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lvce-editor/about-view",
|
3
|
-
"version": "
|
4
|
-
"description": "",
|
3
|
+
"version": "4.2.0",
|
4
|
+
"description": "About View Worker",
|
5
5
|
"main": "dist/aboutWorkerMain.js",
|
6
6
|
"type": "module",
|
7
7
|
"keywords": [
|
8
|
-
"about"
|
8
|
+
"about-view"
|
9
9
|
],
|
10
10
|
"author": "Lvce Editor",
|
11
|
-
"license": "MIT"
|
11
|
+
"license": "MIT",
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "git+https://github.com/lvce-editor/about-view.git"
|
15
|
+
}
|
12
16
|
}
|