@lvce-editor/status-bar-worker 3.35.3 → 3.37.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 +45 -29
- package/package.json +2 -1
|
@@ -632,9 +632,12 @@ const applyDataProperties = (restoredError, error) => {
|
|
|
632
632
|
writable: true
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
restoredError
|
|
635
|
+
const name = error.data.name || error.data.type;
|
|
636
|
+
if (name) {
|
|
637
|
+
Object.defineProperty(restoredError, 'name', {
|
|
638
|
+
configurable: true,
|
|
639
|
+
value: name
|
|
640
|
+
});
|
|
638
641
|
}
|
|
639
642
|
};
|
|
640
643
|
const applyDirectProperties = (restoredError, error) => {
|
|
@@ -651,7 +654,7 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
651
654
|
}
|
|
652
655
|
};
|
|
653
656
|
const restoreMessageError = (error, _currentStack) => {
|
|
654
|
-
const restoredError = constructError(error.message, error.type || error.data?.type, error.name);
|
|
657
|
+
const restoredError = constructError(error.message, error.type || error.data?.type, error.name || error.data?.name);
|
|
655
658
|
if (typeof error.code === 'string' || typeof error.code === 'number') {
|
|
656
659
|
Object.defineProperty(restoredError, 'code', {
|
|
657
660
|
configurable: true,
|
|
@@ -861,6 +864,12 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
861
864
|
requiresSocket,
|
|
862
865
|
resolve
|
|
863
866
|
} = options;
|
|
867
|
+
if (message === 'ready') {
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
if (!message || typeof message !== 'object') {
|
|
871
|
+
throw new JsonRpcError('unexpected message');
|
|
872
|
+
}
|
|
864
873
|
if ('id' in message) {
|
|
865
874
|
if ('method' in message) {
|
|
866
875
|
const response = await getResponse(message, ipc, execute, preparePrettyError, logError, requiresSocket);
|
|
@@ -1219,6 +1228,12 @@ const {
|
|
|
1219
1228
|
invokeAndTransfer,
|
|
1220
1229
|
set: set$5
|
|
1221
1230
|
} = create$2(RendererWorker);
|
|
1231
|
+
const initializeRendererWorkerForWorker = async commandMap => {
|
|
1232
|
+
const rpc = await create$3({
|
|
1233
|
+
commandMap
|
|
1234
|
+
});
|
|
1235
|
+
set$5(rpc);
|
|
1236
|
+
};
|
|
1222
1237
|
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1223
1238
|
const command = 'TextMeasurement.handleMessagePort';
|
|
1224
1239
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
@@ -1230,6 +1245,16 @@ const sendMessagePortToCacheWorker = async port => {
|
|
|
1230
1245
|
const getPreference = async key => {
|
|
1231
1246
|
return await invoke$3('Preferences.get', key);
|
|
1232
1247
|
};
|
|
1248
|
+
const send3 = port => {
|
|
1249
|
+
return sendMessagePortToTextMeasurementWorker(port);
|
|
1250
|
+
};
|
|
1251
|
+
const initializeTextMeasurementWorker = async () => {
|
|
1252
|
+
const rpc = await create$4({
|
|
1253
|
+
commandMap: {},
|
|
1254
|
+
send: send3
|
|
1255
|
+
});
|
|
1256
|
+
set$6(rpc);
|
|
1257
|
+
};
|
|
1233
1258
|
|
|
1234
1259
|
const toCommandId = key => {
|
|
1235
1260
|
const dotIndex = key.indexOf('.');
|
|
@@ -1501,7 +1526,8 @@ const {
|
|
|
1501
1526
|
set: set$4,
|
|
1502
1527
|
wrapCommand,
|
|
1503
1528
|
wrapGetter,
|
|
1504
|
-
wrapSerialAsyncCommand
|
|
1529
|
+
wrapSerialAsyncCommand
|
|
1530
|
+
} = create$1();
|
|
1505
1531
|
|
|
1506
1532
|
const create = (uid, uri, x, y, width, height, platform, assetDir, applicationId) => {
|
|
1507
1533
|
const state = {
|
|
@@ -2172,9 +2198,15 @@ const getStatusBarItemContextMenuItems = async (extensionId, providerId, applica
|
|
|
2172
2198
|
const StatusBar = 31;
|
|
2173
2199
|
|
|
2174
2200
|
const handleContextMenu = async (state, button, x, y, targetName = '') => {
|
|
2175
|
-
const
|
|
2176
|
-
|
|
2177
|
-
|
|
2201
|
+
const {
|
|
2202
|
+
applicationId,
|
|
2203
|
+
statusBarItemsLeft,
|
|
2204
|
+
statusBarItemsRight,
|
|
2205
|
+
uid
|
|
2206
|
+
} = state;
|
|
2207
|
+
const item = [...statusBarItemsLeft, ...statusBarItemsRight].find(statusBarItem => statusBarItem.name === targetName);
|
|
2208
|
+
const contextMenuItems = item?.extensionId && item.providerId ? await getStatusBarItemContextMenuItems(item.extensionId, item.providerId, applicationId) : [];
|
|
2209
|
+
await show2(uid, StatusBar, x, y, {
|
|
2178
2210
|
contextMenuItems,
|
|
2179
2211
|
menuId: StatusBar
|
|
2180
2212
|
});
|
|
@@ -3156,9 +3188,12 @@ const updateArray = (items, newItem) => {
|
|
|
3156
3188
|
};
|
|
3157
3189
|
|
|
3158
3190
|
const itemLeftUpdate = (state, newItem) => {
|
|
3191
|
+
const {
|
|
3192
|
+
statusBarItemsLeft
|
|
3193
|
+
} = state;
|
|
3159
3194
|
return {
|
|
3160
3195
|
...state,
|
|
3161
|
-
statusBarItemsLeft: updateArray([...
|
|
3196
|
+
statusBarItemsLeft: updateArray([...statusBarItemsLeft], newItem)
|
|
3162
3197
|
};
|
|
3163
3198
|
};
|
|
3164
3199
|
|
|
@@ -3375,25 +3410,6 @@ const initializeQuickPickWorker = async () => {
|
|
|
3375
3410
|
set$3(rpc);
|
|
3376
3411
|
};
|
|
3377
3412
|
|
|
3378
|
-
const initializeRenderWorker = async () => {
|
|
3379
|
-
const rpc = await create$3({
|
|
3380
|
-
commandMap: commandMap
|
|
3381
|
-
});
|
|
3382
|
-
set$5(rpc);
|
|
3383
|
-
};
|
|
3384
|
-
|
|
3385
|
-
const send = port => {
|
|
3386
|
-
// @ts-ignore
|
|
3387
|
-
return sendMessagePortToTextMeasurementWorker(port);
|
|
3388
|
-
};
|
|
3389
|
-
const initializeTextMeasurementWorkerRpc = async () => {
|
|
3390
|
-
const rpc = await create$4({
|
|
3391
|
-
commandMap: {},
|
|
3392
|
-
send
|
|
3393
|
-
});
|
|
3394
|
-
set$6(rpc);
|
|
3395
|
-
};
|
|
3396
|
-
|
|
3397
3413
|
const registerCacheWorker = async () => {
|
|
3398
3414
|
const lazyRpc = await create$4({
|
|
3399
3415
|
commandMap: {},
|
|
@@ -3410,7 +3426,7 @@ const registerCacheWorker = async () => {
|
|
|
3410
3426
|
};
|
|
3411
3427
|
const listen = async () => {
|
|
3412
3428
|
registerCommands(commandMap);
|
|
3413
|
-
await Promise.all([
|
|
3429
|
+
await Promise.all([initializeRendererWorkerForWorker(commandMap), initializeQuickPickWorker(), initializeMenuWorker(), initializeTextMeasurementWorker(), registerCacheWorker()]);
|
|
3414
3430
|
};
|
|
3415
3431
|
|
|
3416
3432
|
const main = async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/status-bar-worker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.37.0",
|
|
4
4
|
"description": "Status Bar Worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/statusBarWorkerMain.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"@lvce-editor/constants": "^5.31.1",
|
|
14
15
|
"@lvce-editor/i18n": "^2.10.0"
|
|
15
16
|
}
|
|
16
17
|
}
|