@lvce-editor/about-view 5.1.0 → 5.3.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 +25 -16
- package/package.json +1 -1
package/dist/aboutWorkerMain.js
CHANGED
@@ -756,6 +756,9 @@ const createRpc = ipc => {
|
|
756
756
|
},
|
757
757
|
invokeAndTransfer(method, ...params) {
|
758
758
|
return invokeAndTransfer(ipc, method, ...params);
|
759
|
+
},
|
760
|
+
async dispose() {
|
761
|
+
await ipc?.dispose();
|
759
762
|
}
|
760
763
|
};
|
761
764
|
return rpc;
|
@@ -829,6 +832,23 @@ const create$1 = () => {
|
|
829
832
|
for (const key of Object.keys(states)) {
|
830
833
|
delete states[key];
|
831
834
|
}
|
835
|
+
},
|
836
|
+
wrapCommand(fn) {
|
837
|
+
const wrapped = async (uid, ...args) => {
|
838
|
+
const {
|
839
|
+
newState
|
840
|
+
} = states[uid];
|
841
|
+
const newerState = await fn(newState, ...args);
|
842
|
+
if (newState === newerState) {
|
843
|
+
return;
|
844
|
+
}
|
845
|
+
const latest = states[uid];
|
846
|
+
states[uid] = {
|
847
|
+
oldState: latest.oldState,
|
848
|
+
newState: newerState
|
849
|
+
};
|
850
|
+
};
|
851
|
+
return wrapped;
|
832
852
|
}
|
833
853
|
};
|
834
854
|
};
|
@@ -836,7 +856,9 @@ const create$1 = () => {
|
|
836
856
|
const {
|
837
857
|
get: get$1,
|
838
858
|
set: set$1,
|
839
|
-
dispose: dispose$1
|
859
|
+
dispose: dispose$1,
|
860
|
+
wrapCommand
|
861
|
+
} = create$1();
|
840
862
|
|
841
863
|
const create = uid => {
|
842
864
|
const state = {
|
@@ -940,7 +962,8 @@ const focusPrevious = state => {
|
|
940
962
|
};
|
941
963
|
};
|
942
964
|
|
943
|
-
const commandIds = ['handleClickClose', 'handleClickOk', 'handleClickCopy', 'handleFocusIn', 'focusNext', 'focusPrevious'];
|
965
|
+
const commandIds = ['dispose', 'handleClickClose', 'handleClickOk', 'handleClickCopy', 'handleFocusIn', 'focusNext', 'focusPrevious'];
|
966
|
+
|
944
967
|
const getCommandIds = () => {
|
945
968
|
return commandIds;
|
946
969
|
};
|
@@ -1731,20 +1754,6 @@ const showAbout = async platform => {
|
|
1731
1754
|
await fn();
|
1732
1755
|
};
|
1733
1756
|
|
1734
|
-
const wrapCommand = fn => {
|
1735
|
-
const wrapped = async (uid, ...args) => {
|
1736
|
-
const {
|
1737
|
-
newState
|
1738
|
-
} = get$1(uid);
|
1739
|
-
const newerState = await fn(newState, ...args);
|
1740
|
-
if (newState === newerState) {
|
1741
|
-
return;
|
1742
|
-
}
|
1743
|
-
set$1(uid, newState, newerState);
|
1744
|
-
};
|
1745
|
-
return wrapped;
|
1746
|
-
};
|
1747
|
-
|
1748
1757
|
const commandMap = {
|
1749
1758
|
'About.create': create,
|
1750
1759
|
'About.diff2': diff2,
|