@lvce-editor/status-bar-worker 3.16.4 → 3.17.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/statusBarWorkerMain.js +57 -32
- 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);
|
|
@@ -1754,8 +1754,8 @@ const isConnected = () => {
|
|
|
1754
1754
|
const invoke = (method, ...params) => {
|
|
1755
1755
|
return invoke$2(method, ...params);
|
|
1756
1756
|
};
|
|
1757
|
-
const set = rpc => {
|
|
1758
|
-
set$
|
|
1757
|
+
const set$1 = rpc => {
|
|
1758
|
+
set$3(rpc);
|
|
1759
1759
|
state.connected = true;
|
|
1760
1760
|
};
|
|
1761
1761
|
|
|
@@ -1769,8 +1769,8 @@ const render2 = (uid, diffResult) => {
|
|
|
1769
1769
|
const {
|
|
1770
1770
|
newState,
|
|
1771
1771
|
oldState
|
|
1772
|
-
} = get$
|
|
1773
|
-
set$
|
|
1772
|
+
} = get$4(uid);
|
|
1773
|
+
set$6(uid, newState, newState);
|
|
1774
1774
|
const commands = applyRender(oldState, newState, diffResult);
|
|
1775
1775
|
if (!isConnected()) {
|
|
1776
1776
|
return commands;
|
|
@@ -1784,7 +1784,7 @@ const renderOutOfBand = async uid => {
|
|
|
1784
1784
|
}
|
|
1785
1785
|
const {
|
|
1786
1786
|
newState
|
|
1787
|
-
} = get$
|
|
1787
|
+
} = get$4(uid);
|
|
1788
1788
|
if (newState.initial) {
|
|
1789
1789
|
return;
|
|
1790
1790
|
}
|
|
@@ -1804,12 +1804,12 @@ const handleExtensionManagementChange = async () => {
|
|
|
1804
1804
|
const {
|
|
1805
1805
|
newState,
|
|
1806
1806
|
oldState
|
|
1807
|
-
} = get$
|
|
1807
|
+
} = get$4(uid);
|
|
1808
1808
|
const newerState = await handleItemsChanged(newState);
|
|
1809
1809
|
if (newState === newerState || oldState === newerState) {
|
|
1810
1810
|
continue;
|
|
1811
1811
|
}
|
|
1812
|
-
set$
|
|
1812
|
+
set$6(uid, oldState, {
|
|
1813
1813
|
...newState,
|
|
1814
1814
|
...newerState
|
|
1815
1815
|
});
|
|
@@ -1835,17 +1835,26 @@ const handleNotificationCountChanged = (state, count) => {
|
|
|
1835
1835
|
};
|
|
1836
1836
|
};
|
|
1837
1837
|
|
|
1838
|
+
let latestCount;
|
|
1839
|
+
const get$1 = () => {
|
|
1840
|
+
return latestCount;
|
|
1841
|
+
};
|
|
1842
|
+
const set = count => {
|
|
1843
|
+
latestCount = count;
|
|
1844
|
+
};
|
|
1845
|
+
|
|
1838
1846
|
const handleNotificationCountChangedAll = async count => {
|
|
1847
|
+
set(count);
|
|
1839
1848
|
for (const uid of getKeys()) {
|
|
1840
1849
|
const {
|
|
1841
1850
|
newState,
|
|
1842
1851
|
oldState
|
|
1843
|
-
} = get$
|
|
1852
|
+
} = get$4(uid);
|
|
1844
1853
|
const newerState = handleNotificationCountChanged(newState, count);
|
|
1845
1854
|
if (newState === newerState || oldState === newerState) {
|
|
1846
1855
|
continue;
|
|
1847
1856
|
}
|
|
1848
|
-
set$
|
|
1857
|
+
set$6(uid, oldState, newerState);
|
|
1849
1858
|
await renderOutOfBand(uid);
|
|
1850
1859
|
}
|
|
1851
1860
|
};
|
|
@@ -1860,15 +1869,25 @@ const handleExtensionManagementMessagePort = async port => {
|
|
|
1860
1869
|
commandMap: commandMap$1,
|
|
1861
1870
|
messagePort: port
|
|
1862
1871
|
});
|
|
1863
|
-
set$
|
|
1872
|
+
set$4(rpc);
|
|
1864
1873
|
};
|
|
1865
1874
|
|
|
1866
|
-
const handleMessagePort = async port => {
|
|
1875
|
+
const handleMessagePort = async (port, viewletCommandMap) => {
|
|
1876
|
+
const executeViewletCommand = async (uid, command, ...args) => {
|
|
1877
|
+
const fn = viewletCommandMap[`StatusBar.${command}`];
|
|
1878
|
+
if (typeof fn !== 'function') {
|
|
1879
|
+
throw new TypeError(`Viewlet command not found: ${command}`);
|
|
1880
|
+
}
|
|
1881
|
+
await fn(uid, ...args);
|
|
1882
|
+
await invoke$1('Viewlet.requestRender', uid);
|
|
1883
|
+
};
|
|
1867
1884
|
const rpc = await create$2({
|
|
1868
|
-
commandMap: {
|
|
1885
|
+
commandMap: {
|
|
1886
|
+
'Viewlet.executeViewletCommand': executeViewletCommand
|
|
1887
|
+
},
|
|
1869
1888
|
messagePort: port
|
|
1870
1889
|
});
|
|
1871
|
-
set(rpc);
|
|
1890
|
+
set$1(rpc);
|
|
1872
1891
|
};
|
|
1873
1892
|
|
|
1874
1893
|
const handleProblemsSummaryChange = (state, summary) => {
|
|
@@ -1977,7 +1996,7 @@ const loadContent = async state => {
|
|
|
1977
1996
|
showItems: itemsVisible,
|
|
1978
1997
|
warningCount
|
|
1979
1998
|
});
|
|
1980
|
-
|
|
1999
|
+
const loadedState = {
|
|
1981
2000
|
...state,
|
|
1982
2001
|
errorCount: 0,
|
|
1983
2002
|
initial: false,
|
|
@@ -1985,6 +2004,11 @@ const loadContent = async state => {
|
|
|
1985
2004
|
statusBarItemsRight: statusBarItems.filter(item => item.name === Notifications),
|
|
1986
2005
|
warningCount: 0
|
|
1987
2006
|
};
|
|
2007
|
+
const latestNotificationCount = get$1();
|
|
2008
|
+
if (latestNotificationCount === undefined) {
|
|
2009
|
+
return loadedState;
|
|
2010
|
+
}
|
|
2011
|
+
return handleNotificationCountChanged(loadedState, latestNotificationCount);
|
|
1988
2012
|
};
|
|
1989
2013
|
|
|
1990
2014
|
const renderEventListeners = () => {
|
|
@@ -2016,6 +2040,7 @@ const saveState = state => {
|
|
|
2016
2040
|
};
|
|
2017
2041
|
};
|
|
2018
2042
|
|
|
2043
|
+
const handleDirectMessagePort = port => handleMessagePort(port, commandMap);
|
|
2019
2044
|
const commandMap = {
|
|
2020
2045
|
'StatusBar.create': create$7,
|
|
2021
2046
|
'StatusBar.diff2': diff2,
|
|
@@ -2026,7 +2051,7 @@ const commandMap = {
|
|
|
2026
2051
|
'StatusBar.handleExtensionManagementMessagePort': handleExtensionManagementMessagePort,
|
|
2027
2052
|
'StatusBar.handleExtensionsChanged': wrapCommand(handleExtensionsChanged),
|
|
2028
2053
|
'StatusBar.handleItemsChanged': wrapCommand(handleItemsChanged),
|
|
2029
|
-
'StatusBar.handleMessagePort':
|
|
2054
|
+
'StatusBar.handleMessagePort': handleDirectMessagePort,
|
|
2030
2055
|
'StatusBar.handleNotificationCountChanged': wrapCommand(handleNotificationCountChanged),
|
|
2031
2056
|
'StatusBar.handleProblemsSummaryChange': wrapCommand(handleProblemsSummaryChange),
|
|
2032
2057
|
'StatusBar.initialize': initialize,
|
|
@@ -2045,7 +2070,7 @@ const initializeRenderWorker = async () => {
|
|
|
2045
2070
|
const rpc = await create$1({
|
|
2046
2071
|
commandMap: commandMap
|
|
2047
2072
|
});
|
|
2048
|
-
set$
|
|
2073
|
+
set$2(rpc);
|
|
2049
2074
|
};
|
|
2050
2075
|
|
|
2051
2076
|
const listen = async () => {
|