@lvce-editor/status-bar-worker 3.16.3 → 3.16.5
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/statusBarWorkerMain.js +43 -33
- package/package.json +1 -1
|
@@ -119,11 +119,11 @@ const terminate = () => {
|
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
const {
|
|
122
|
-
get: get$
|
|
122
|
+
get: get$4,
|
|
123
123
|
getCommandIds,
|
|
124
124
|
getKeys,
|
|
125
125
|
registerCommands,
|
|
126
|
-
set: set$
|
|
126
|
+
set: set$6,
|
|
127
127
|
wrapCommand,
|
|
128
128
|
wrapGetter
|
|
129
129
|
} = create$8();
|
|
@@ -139,7 +139,7 @@ const create$7 = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
|
139
139
|
uid,
|
|
140
140
|
warningCount: 0
|
|
141
141
|
};
|
|
142
|
-
set$
|
|
142
|
+
set$6(uid, state, state);
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
const isEqual = (oldState, newState) => {
|
|
@@ -167,7 +167,7 @@ const diff2 = uid => {
|
|
|
167
167
|
const {
|
|
168
168
|
newState,
|
|
169
169
|
oldState
|
|
170
|
-
} = get$
|
|
170
|
+
} = get$4(uid);
|
|
171
171
|
const result = diff(oldState, newState);
|
|
172
172
|
return result;
|
|
173
173
|
};
|
|
@@ -721,7 +721,7 @@ const execute = (command, ...args) => {
|
|
|
721
721
|
|
|
722
722
|
const Two$1 = '2.0';
|
|
723
723
|
const callbacks = Object.create(null);
|
|
724
|
-
const get$
|
|
724
|
+
const get$3 = id => {
|
|
725
725
|
return callbacks[id];
|
|
726
726
|
};
|
|
727
727
|
const remove$1 = id => {
|
|
@@ -911,7 +911,7 @@ const warn = (...args) => {
|
|
|
911
911
|
console.warn(...args);
|
|
912
912
|
};
|
|
913
913
|
const resolve = (id, response) => {
|
|
914
|
-
const fn = get$
|
|
914
|
+
const fn = get$3(id);
|
|
915
915
|
if (!fn) {
|
|
916
916
|
console.log(response);
|
|
917
917
|
warn(`callback ${id} may already be disposed`);
|
|
@@ -1244,10 +1244,10 @@ const createMockRpc = ({
|
|
|
1244
1244
|
};
|
|
1245
1245
|
|
|
1246
1246
|
const rpcs = Object.create(null);
|
|
1247
|
-
const set$
|
|
1247
|
+
const set$5 = (id, rpc) => {
|
|
1248
1248
|
rpcs[id] = rpc;
|
|
1249
1249
|
};
|
|
1250
|
-
const get$
|
|
1250
|
+
const get$2 = id => {
|
|
1251
1251
|
return rpcs[id];
|
|
1252
1252
|
};
|
|
1253
1253
|
const remove = id => {
|
|
@@ -1258,18 +1258,18 @@ const remove = id => {
|
|
|
1258
1258
|
const create = rpcId => {
|
|
1259
1259
|
return {
|
|
1260
1260
|
async dispose() {
|
|
1261
|
-
const rpc = get$
|
|
1261
|
+
const rpc = get$2(rpcId);
|
|
1262
1262
|
await rpc.dispose();
|
|
1263
1263
|
},
|
|
1264
1264
|
// @ts-ignore
|
|
1265
1265
|
invoke(method, ...params) {
|
|
1266
|
-
const rpc = get$
|
|
1266
|
+
const rpc = get$2(rpcId);
|
|
1267
1267
|
// @ts-ignore
|
|
1268
1268
|
return rpc.invoke(method, ...params);
|
|
1269
1269
|
},
|
|
1270
1270
|
// @ts-ignore
|
|
1271
1271
|
invokeAndTransfer(method, ...params) {
|
|
1272
|
-
const rpc = get$
|
|
1272
|
+
const rpc = get$2(rpcId);
|
|
1273
1273
|
// @ts-ignore
|
|
1274
1274
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1275
1275
|
},
|
|
@@ -1277,7 +1277,7 @@ const create = rpcId => {
|
|
|
1277
1277
|
const mockRpc = createMockRpc({
|
|
1278
1278
|
commandMap
|
|
1279
1279
|
});
|
|
1280
|
-
set$
|
|
1280
|
+
set$5(rpcId, mockRpc);
|
|
1281
1281
|
// @ts-ignore
|
|
1282
1282
|
mockRpc[Symbol.dispose] = () => {
|
|
1283
1283
|
remove(rpcId);
|
|
@@ -1286,7 +1286,7 @@ const create = rpcId => {
|
|
|
1286
1286
|
return mockRpc;
|
|
1287
1287
|
},
|
|
1288
1288
|
set(rpc) {
|
|
1289
|
-
set$
|
|
1289
|
+
set$5(rpcId, rpc);
|
|
1290
1290
|
}
|
|
1291
1291
|
};
|
|
1292
1292
|
};
|
|
@@ -1315,17 +1315,17 @@ const SetFocusContext = 'Viewlet.setFocusContext';
|
|
|
1315
1315
|
|
|
1316
1316
|
const {
|
|
1317
1317
|
invoke: invoke$3,
|
|
1318
|
-
set: set$
|
|
1318
|
+
set: set$4
|
|
1319
1319
|
} = create(ExtensionManagementWorker);
|
|
1320
1320
|
|
|
1321
1321
|
const {
|
|
1322
1322
|
invoke: invoke$2,
|
|
1323
|
-
set: set$
|
|
1323
|
+
set: set$3
|
|
1324
1324
|
} = create(RendererProcess);
|
|
1325
1325
|
|
|
1326
1326
|
const {
|
|
1327
1327
|
invoke: invoke$1,
|
|
1328
|
-
set: set$
|
|
1328
|
+
set: set$2
|
|
1329
1329
|
} = create(RendererWorker);
|
|
1330
1330
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1331
1331
|
number(uid);
|
|
@@ -1707,14 +1707,10 @@ const getStatusBarVirtualDom = (statusBarItemsLeft, statusBarItemsRight) => {
|
|
|
1707
1707
|
|
|
1708
1708
|
const renderItems = (oldState, newState) => {
|
|
1709
1709
|
const {
|
|
1710
|
-
initial,
|
|
1711
1710
|
statusBarItemsLeft,
|
|
1712
1711
|
statusBarItemsRight,
|
|
1713
1712
|
uid
|
|
1714
1713
|
} = newState;
|
|
1715
|
-
if (initial) {
|
|
1716
|
-
return [];
|
|
1717
|
-
}
|
|
1718
1714
|
const dom = getStatusBarVirtualDom(statusBarItemsLeft, statusBarItemsRight);
|
|
1719
1715
|
return [SetDom2, uid, dom];
|
|
1720
1716
|
};
|
|
@@ -1758,8 +1754,8 @@ const isConnected = () => {
|
|
|
1758
1754
|
const invoke = (method, ...params) => {
|
|
1759
1755
|
return invoke$2(method, ...params);
|
|
1760
1756
|
};
|
|
1761
|
-
const set = rpc => {
|
|
1762
|
-
set$
|
|
1757
|
+
const set$1 = rpc => {
|
|
1758
|
+
set$3(rpc);
|
|
1763
1759
|
state.connected = true;
|
|
1764
1760
|
};
|
|
1765
1761
|
|
|
@@ -1773,8 +1769,8 @@ const render2 = (uid, diffResult) => {
|
|
|
1773
1769
|
const {
|
|
1774
1770
|
newState,
|
|
1775
1771
|
oldState
|
|
1776
|
-
} = get$
|
|
1777
|
-
set$
|
|
1772
|
+
} = get$4(uid);
|
|
1773
|
+
set$6(uid, newState, newState);
|
|
1778
1774
|
const commands = applyRender(oldState, newState, diffResult);
|
|
1779
1775
|
if (!isConnected()) {
|
|
1780
1776
|
return commands;
|
|
@@ -1788,7 +1784,7 @@ const renderOutOfBand = async uid => {
|
|
|
1788
1784
|
}
|
|
1789
1785
|
const {
|
|
1790
1786
|
newState
|
|
1791
|
-
} = get$
|
|
1787
|
+
} = get$4(uid);
|
|
1792
1788
|
if (newState.initial) {
|
|
1793
1789
|
return;
|
|
1794
1790
|
}
|
|
@@ -1808,12 +1804,12 @@ const handleExtensionManagementChange = async () => {
|
|
|
1808
1804
|
const {
|
|
1809
1805
|
newState,
|
|
1810
1806
|
oldState
|
|
1811
|
-
} = get$
|
|
1807
|
+
} = get$4(uid);
|
|
1812
1808
|
const newerState = await handleItemsChanged(newState);
|
|
1813
1809
|
if (newState === newerState || oldState === newerState) {
|
|
1814
1810
|
continue;
|
|
1815
1811
|
}
|
|
1816
|
-
set$
|
|
1812
|
+
set$6(uid, oldState, {
|
|
1817
1813
|
...newState,
|
|
1818
1814
|
...newerState
|
|
1819
1815
|
});
|
|
@@ -1839,17 +1835,26 @@ const handleNotificationCountChanged = (state, count) => {
|
|
|
1839
1835
|
};
|
|
1840
1836
|
};
|
|
1841
1837
|
|
|
1838
|
+
let latestCount;
|
|
1839
|
+
const get$1 = () => {
|
|
1840
|
+
return latestCount;
|
|
1841
|
+
};
|
|
1842
|
+
const set = count => {
|
|
1843
|
+
latestCount = count;
|
|
1844
|
+
};
|
|
1845
|
+
|
|
1842
1846
|
const handleNotificationCountChangedAll = async count => {
|
|
1847
|
+
set(count);
|
|
1843
1848
|
for (const uid of getKeys()) {
|
|
1844
1849
|
const {
|
|
1845
1850
|
newState,
|
|
1846
1851
|
oldState
|
|
1847
|
-
} = get$
|
|
1852
|
+
} = get$4(uid);
|
|
1848
1853
|
const newerState = handleNotificationCountChanged(newState, count);
|
|
1849
1854
|
if (newState === newerState || oldState === newerState) {
|
|
1850
1855
|
continue;
|
|
1851
1856
|
}
|
|
1852
|
-
set$
|
|
1857
|
+
set$6(uid, oldState, newerState);
|
|
1853
1858
|
await renderOutOfBand(uid);
|
|
1854
1859
|
}
|
|
1855
1860
|
};
|
|
@@ -1864,7 +1869,7 @@ const handleExtensionManagementMessagePort = async port => {
|
|
|
1864
1869
|
commandMap: commandMap$1,
|
|
1865
1870
|
messagePort: port
|
|
1866
1871
|
});
|
|
1867
|
-
set$
|
|
1872
|
+
set$4(rpc);
|
|
1868
1873
|
};
|
|
1869
1874
|
|
|
1870
1875
|
const handleMessagePort = async port => {
|
|
@@ -1872,7 +1877,7 @@ const handleMessagePort = async port => {
|
|
|
1872
1877
|
commandMap: {},
|
|
1873
1878
|
messagePort: port
|
|
1874
1879
|
});
|
|
1875
|
-
set(rpc);
|
|
1880
|
+
set$1(rpc);
|
|
1876
1881
|
};
|
|
1877
1882
|
|
|
1878
1883
|
const handleProblemsSummaryChange = (state, summary) => {
|
|
@@ -1981,7 +1986,7 @@ const loadContent = async state => {
|
|
|
1981
1986
|
showItems: itemsVisible,
|
|
1982
1987
|
warningCount
|
|
1983
1988
|
});
|
|
1984
|
-
|
|
1989
|
+
const loadedState = {
|
|
1985
1990
|
...state,
|
|
1986
1991
|
errorCount: 0,
|
|
1987
1992
|
initial: false,
|
|
@@ -1989,6 +1994,11 @@ const loadContent = async state => {
|
|
|
1989
1994
|
statusBarItemsRight: statusBarItems.filter(item => item.name === Notifications),
|
|
1990
1995
|
warningCount: 0
|
|
1991
1996
|
};
|
|
1997
|
+
const latestNotificationCount = get$1();
|
|
1998
|
+
if (latestNotificationCount === undefined) {
|
|
1999
|
+
return loadedState;
|
|
2000
|
+
}
|
|
2001
|
+
return handleNotificationCountChanged(loadedState, latestNotificationCount);
|
|
1992
2002
|
};
|
|
1993
2003
|
|
|
1994
2004
|
const renderEventListeners = () => {
|
|
@@ -2049,7 +2059,7 @@ const initializeRenderWorker = async () => {
|
|
|
2049
2059
|
const rpc = await create$1({
|
|
2050
2060
|
commandMap: commandMap
|
|
2051
2061
|
});
|
|
2052
|
-
set$
|
|
2062
|
+
set$2(rpc);
|
|
2053
2063
|
};
|
|
2054
2064
|
|
|
2055
2065
|
const listen = async () => {
|