@lvce-editor/quick-pick-worker 4.13.1 → 4.14.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.
@@ -157,7 +157,6 @@ const walkValue = (value, transferrables, isTransferrable) => {
157
157
  for (const property of Object.values(value)) {
158
158
  walkValue(property, transferrables, isTransferrable);
159
159
  }
160
- return;
161
160
  }
162
161
  };
163
162
  const getTransferrables = value => {
@@ -311,7 +310,14 @@ class IpcError extends VError {
311
310
  const cause = new Error(message);
312
311
  // @ts-ignore
313
312
  cause.code = code;
314
- cause.stack = stack;
313
+ if (stack) {
314
+ Object.defineProperty(cause, 'stack', {
315
+ configurable: true,
316
+ enumerable: false,
317
+ value: stack,
318
+ writable: true
319
+ });
320
+ }
315
321
  super(cause, betterMessage);
316
322
  } else {
317
323
  super(betterMessage);
@@ -1020,6 +1026,34 @@ const listen$1 = async (module, options) => {
1020
1026
  return ipc;
1021
1027
  };
1022
1028
 
1029
+ const createSharedLazyRpc = factory => {
1030
+ let rpcPromise;
1031
+ const getOrCreate = () => {
1032
+ if (!rpcPromise) {
1033
+ rpcPromise = factory();
1034
+ }
1035
+ return rpcPromise;
1036
+ };
1037
+ return {
1038
+ async dispose() {
1039
+ const rpc = await getOrCreate();
1040
+ await rpc.dispose();
1041
+ },
1042
+ async invoke(method, ...params) {
1043
+ const rpc = await getOrCreate();
1044
+ return rpc.invoke(method, ...params);
1045
+ },
1046
+ async invokeAndTransfer(method, ...params) {
1047
+ const rpc = await getOrCreate();
1048
+ return rpc.invokeAndTransfer(method, ...params);
1049
+ },
1050
+ async send(method, ...params) {
1051
+ const rpc = await getOrCreate();
1052
+ rpc.send(method, ...params);
1053
+ }
1054
+ };
1055
+ };
1056
+
1023
1057
  const create$8 = async ({
1024
1058
  commandMap,
1025
1059
  isMessagePortOpen = true,
@@ -1055,34 +1089,6 @@ const create$7 = async ({
1055
1089
  });
1056
1090
  };
1057
1091
 
1058
- const createSharedLazyRpc = factory => {
1059
- let rpcPromise;
1060
- const getOrCreate = () => {
1061
- if (!rpcPromise) {
1062
- rpcPromise = factory();
1063
- }
1064
- return rpcPromise;
1065
- };
1066
- return {
1067
- async dispose() {
1068
- const rpc = await getOrCreate();
1069
- await rpc.dispose();
1070
- },
1071
- async invoke(method, ...params) {
1072
- const rpc = await getOrCreate();
1073
- return rpc.invoke(method, ...params);
1074
- },
1075
- async invokeAndTransfer(method, ...params) {
1076
- const rpc = await getOrCreate();
1077
- return rpc.invokeAndTransfer(method, ...params);
1078
- },
1079
- async send(method, ...params) {
1080
- const rpc = await getOrCreate();
1081
- rpc.send(method, ...params);
1082
- }
1083
- };
1084
- };
1085
-
1086
1092
  const create$6 = async ({
1087
1093
  commandMap,
1088
1094
  isMessagePortOpen,
@@ -1129,7 +1135,7 @@ const createMockRpc = ({
1129
1135
  };
1130
1136
 
1131
1137
  const rpcs = Object.create(null);
1132
- const set$6 = (id, rpc) => {
1138
+ const set$8 = (id, rpc) => {
1133
1139
  rpcs[id] = rpc;
1134
1140
  };
1135
1141
  const get$2 = id => {
@@ -1162,7 +1168,7 @@ const create$4 = rpcId => {
1162
1168
  const mockRpc = createMockRpc({
1163
1169
  commandMap
1164
1170
  });
1165
- set$6(rpcId, mockRpc);
1171
+ set$8(rpcId, mockRpc);
1166
1172
  // @ts-ignore
1167
1173
  mockRpc[Symbol.dispose] = () => {
1168
1174
  remove$1(rpcId);
@@ -1171,79 +1177,97 @@ const create$4 = rpcId => {
1171
1177
  return mockRpc;
1172
1178
  },
1173
1179
  set(rpc) {
1174
- set$6(rpcId, rpc);
1180
+ set$8(rpcId, rpc);
1175
1181
  }
1176
1182
  };
1177
1183
  };
1178
1184
 
1185
+ const Div = 4;
1186
+ const Input = 6;
1187
+ const Span = 8;
1188
+ const Text = 12;
1189
+ const Img = 17;
1190
+ const Reference = 100;
1191
+
1179
1192
  const EditorWorker = 99;
1180
1193
  const ExtensionManagementWorker = 9006;
1194
+ const RendererProcess = 1670;
1181
1195
  const RendererWorker = 1;
1182
1196
 
1183
1197
  const SetDom2 = 'Viewlet.setDom2';
1198
+ const SetFocusContext = 'Viewlet.setFocusContext';
1184
1199
  const SetPatches = 'Viewlet.setPatches';
1185
1200
 
1186
1201
  const FocusQuickPickInput = 20;
1187
1202
 
1188
1203
  const {
1189
- invoke: invoke$4,
1190
- set: set$5
1204
+ invoke: invoke$6,
1205
+ set: set$7
1191
1206
  } = create$4(EditorWorker);
1192
1207
  const getLines = async editorUid => {
1193
- const lines = await invoke$4('Editor.getLines2', editorUid);
1208
+ const lines = await invoke$6('Editor.getLines2', editorUid);
1194
1209
  return lines;
1195
1210
  };
1196
1211
 
1197
1212
  const {
1198
- invoke: invoke$3,
1199
- set: set$4
1213
+ invoke: invoke$5,
1214
+ set: set$6
1200
1215
  } = create$4(ExtensionManagementWorker);
1201
1216
  const getLanguages = (platform, assetDir) => {
1202
- return invoke$3('Extensions.getLanguages', platform, assetDir);
1217
+ return invoke$5('Extensions.getLanguages', platform, assetDir);
1203
1218
  };
1204
1219
 
1205
1220
  const {
1206
- invoke: invoke$2,
1207
- set: set$3
1221
+ invoke: invoke$4,
1222
+ set: set$5
1208
1223
  } = create$4(7013);
1209
1224
 
1210
1225
  const {
1211
- invoke: invoke$1,
1226
+ invoke: invoke$3,
1227
+ set: set$4
1228
+ } = create$4(RendererProcess);
1229
+
1230
+ const {
1231
+ invoke: invoke$2,
1212
1232
  invokeAndTransfer,
1213
- set: set$2
1233
+ set: set$3
1214
1234
  } = create$4(RendererWorker);
1215
1235
  const sendMessagePortToEditorWorker = async (port, rpcId) => {
1216
1236
  const command = 'HandleMessagePort.handleMessagePort';
1217
1237
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
1218
1238
  };
1219
1239
  const setFocus = key => {
1220
- return invoke$1('Focus.setFocus', key);
1240
+ return invoke$2('Focus.setFocus', key);
1221
1241
  };
1222
1242
  const getFileIcon = async options => {
1223
- return invoke$1('IconTheme.getFileIcon', options);
1243
+ return invoke$2('IconTheme.getFileIcon', options);
1224
1244
  };
1225
1245
  const getFolderIcon = async options => {
1226
- return invoke$1('IconTheme.getFolderIcon', options);
1246
+ return invoke$2('IconTheme.getFolderIcon', options);
1227
1247
  };
1228
1248
  const closeWidget$1 = async widgetId => {
1229
- return invoke$1('Viewlet.closeWidget', widgetId);
1249
+ return invoke$2('Viewlet.closeWidget', widgetId);
1230
1250
  };
1231
1251
  const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
1232
1252
  const command = 'FileSearch.handleMessagePort';
1233
1253
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
1234
1254
  };
1235
1255
  const getActiveEditorId = () => {
1236
- return invoke$1('GetActiveEditor.getActiveEditorId');
1256
+ return invoke$2('GetActiveEditor.getActiveEditorId');
1237
1257
  };
1238
1258
  const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
1239
1259
  const command = 'Extensions.handleMessagePort';
1240
1260
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
1241
1261
  };
1242
1262
  const openUri$1 = async (uri, focus, options) => {
1243
- await invoke$1('Main.openUri', uri, focus, options);
1263
+ await invoke$2('Main.openUri', {
1264
+ ...options,
1265
+ focus,
1266
+ uri
1267
+ });
1244
1268
  };
1245
1269
  const showErrorDialog$1 = async errorInfo => {
1246
- await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
1270
+ await invoke$2('ErrorHandling.showErrorDialog', errorInfo);
1247
1271
  };
1248
1272
 
1249
1273
  const closeWidget = async id => {
@@ -1251,11 +1275,11 @@ const closeWidget = async id => {
1251
1275
  await closeWidget$1(id);
1252
1276
  };
1253
1277
 
1254
- const state$3 = {
1278
+ const state$4 = {
1255
1279
  value: 0
1256
1280
  };
1257
1281
  const create$3 = () => {
1258
- return ++state$3.value;
1282
+ return ++state$4.value;
1259
1283
  };
1260
1284
 
1261
1285
  const callbacks$1 = Object.create(null);
@@ -1319,7 +1343,7 @@ const close = async state => {
1319
1343
  }
1320
1344
  executeCallback(resolveId, result);
1321
1345
  } else {
1322
- await invoke$1('QuickPick.executeCallback', resolveId, result);
1346
+ await invoke$2('QuickPick.executeCallback', resolveId, result);
1323
1347
  }
1324
1348
  }
1325
1349
  }
@@ -1480,7 +1504,7 @@ const {
1480
1504
  get: get$1,
1481
1505
  getCommandIds,
1482
1506
  registerCommands,
1483
- set: set$1,
1507
+ set: set$2,
1484
1508
  wrapAsyncCommand,
1485
1509
  wrapCommand
1486
1510
  } = create$2();
@@ -1688,7 +1712,7 @@ const create = (uid, uri, listItemHeight, x, y, width, height, platform, args, _
1688
1712
  platform,
1689
1713
  value: ''
1690
1714
  };
1691
- set$1(uid, state, state);
1715
+ set$2(uid, state, state);
1692
1716
  };
1693
1717
 
1694
1718
  const RenderItems = 1;
@@ -1747,7 +1771,7 @@ const dispose = uid => {
1747
1771
  };
1748
1772
 
1749
1773
  const setColorTheme = id => {
1750
- return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
1774
+ return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
1751
1775
  };
1752
1776
 
1753
1777
  const focusPick$1 = async pick => {
@@ -2394,7 +2418,7 @@ const getFinalDeltaY = (height, itemHeight, itemsLength) => {
2394
2418
  };
2395
2419
 
2396
2420
  const getColorThemeNames = async (assetDir, platform) => {
2397
- return invoke$1('ColorTheme.getColorThemeNames', assetDir, platform);
2421
+ return invoke$2('ColorTheme.getColorThemeNames', assetDir, platform);
2398
2422
  };
2399
2423
 
2400
2424
  const toProtoVisibleItem$4 = name => {
@@ -2472,21 +2496,21 @@ const warn = (...args) => {
2472
2496
  console.warn(...args);
2473
2497
  };
2474
2498
 
2475
- const state$2 = {
2499
+ const state$3 = {
2476
2500
  menuEntries: []
2477
2501
  };
2478
2502
  const getAll = async () => {
2479
2503
  try {
2480
2504
  // @ts-ignore
2481
- const entries = await invoke$1('Layout.getAllQuickPickMenuEntries');
2505
+ const entries = await invoke$2('Layout.getAllQuickPickMenuEntries');
2482
2506
  return entries || [];
2483
2507
  } catch {
2484
2508
  // ignore
2485
2509
  }
2486
- return state$2.menuEntries;
2510
+ return state$3.menuEntries;
2487
2511
  };
2488
2512
  const add$1 = menuEntries => {
2489
- state$2.menuEntries = [...state$2.menuEntries, ...menuEntries];
2513
+ state$3.menuEntries = [...state$3.menuEntries, ...menuEntries];
2490
2514
  };
2491
2515
 
2492
2516
  const changeLanguageModePick = {
@@ -2513,7 +2537,7 @@ const getExtensionPicks = async (assetDir, platform) => {
2513
2537
  // Assert.number(platform)
2514
2538
  // TODO ask extension management worker directly
2515
2539
  // TODO don't call this every time, cache the results
2516
- const extensionPicks = await invoke$1('ExtensionHost.getCommands', assetDir, platform);
2540
+ const extensionPicks = await invoke$2('ExtensionHost.getCommands', assetDir, platform);
2517
2541
  if (!extensionPicks) {
2518
2542
  return [];
2519
2543
  }
@@ -2557,7 +2581,7 @@ const getPicks$c = async (value, args, {
2557
2581
  return converted;
2558
2582
  };
2559
2583
 
2560
- const state$1 = {
2584
+ const state$2 = {
2561
2585
  args: [],
2562
2586
  items: Object.create(null)
2563
2587
  };
@@ -2567,24 +2591,24 @@ const idState = {
2567
2591
  };
2568
2592
  const add = items => {
2569
2593
  const nextId = ++idState.value;
2570
- state$1.items[nextId] = items;
2594
+ state$2.items[nextId] = items;
2571
2595
  return nextId;
2572
2596
  };
2573
2597
  const get = id => {
2574
- return state$1.items[id] || [];
2598
+ return state$2.items[id] || [];
2575
2599
  };
2576
2600
  const remove = id => {
2577
- delete state$1.items[id];
2601
+ delete state$2.items[id];
2578
2602
  };
2579
2603
 
2580
- const state = {
2604
+ const state$1 = {
2581
2605
  rpc: undefined
2582
2606
  };
2583
- const set = newRpc => {
2584
- state.rpc = newRpc;
2607
+ const set$1 = newRpc => {
2608
+ state$1.rpc = newRpc;
2585
2609
  };
2586
- const invoke = (method, ...args) => {
2587
- return state.rpc.invoke(method, ...args);
2610
+ const invoke$1 = (method, ...args) => {
2611
+ return state$1.rpc.invoke(method, ...args);
2588
2612
  };
2589
2613
 
2590
2614
  const toProtoVisibleItem$2 = item => {
@@ -2610,11 +2634,11 @@ const toProtoVisibleItem$2 = item => {
2610
2634
  };
2611
2635
  };
2612
2636
  const getPicks$b = async (searchValue, args) => {
2613
- state$1.args = args;
2637
+ state$2.args = args;
2614
2638
  const options = args.at(-1);
2615
2639
  let items;
2616
2640
  if (options?.mode === 'quickInput') {
2617
- items = searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke('ExtensionHostQuickPick.renderQuickInput', options.quickInputId, searchValue);
2641
+ items = searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke$1('ExtensionHostQuickPick.renderQuickInput', options.quickInputId, searchValue);
2618
2642
  } else {
2619
2643
  items = options?.customItemsId ? get(options.customItemsId) : args[1] || [];
2620
2644
  }
@@ -2625,11 +2649,11 @@ const getPicks$b = async (searchValue, args) => {
2625
2649
  const emptyMatches = [];
2626
2650
 
2627
2651
  const getWorkspacePath = async () => {
2628
- return invoke$1('Workspace.getPath');
2652
+ return invoke$2('Workspace.getPath');
2629
2653
  };
2630
2654
 
2631
2655
  const searchFile$1 = async (path, value, prepare, assetDir) => {
2632
- const result = await invoke$2('FileSearch.searchFile', path, value, prepare, assetDir);
2656
+ const result = await invoke$4('FileSearch.searchFile', path, value, prepare, assetDir);
2633
2657
  return result;
2634
2658
  };
2635
2659
 
@@ -2972,7 +2996,7 @@ const uniq = array => {
2972
2996
  return [...new Set(array)];
2973
2997
  };
2974
2998
  const getRecentlyOpened = async () => {
2975
- const recentlyOpened = await invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
2999
+ const recentlyOpened = await invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
2976
3000
  return uniq(recentlyOpened);
2977
3001
  };
2978
3002
 
@@ -3064,7 +3088,7 @@ const selectPickBuiltin = async item => {
3064
3088
  }
3065
3089
  const args = item.args || [];
3066
3090
  // TODO ids should be all numbers for efficiency -> also directly can call command
3067
- await invoke$1(item.id, ...args);
3091
+ await invoke$2(item.id, ...args);
3068
3092
  if (shouldHide(item)) {
3069
3093
  return {
3070
3094
  command: Hide
@@ -3077,7 +3101,7 @@ const selectPickBuiltin = async item => {
3077
3101
  const selectPickExtension = async item => {
3078
3102
  const id = item.id.slice(4); // TODO lots of string allocation with 'ext.' find a better way to separate builtin commands from extension commands
3079
3103
  try {
3080
- await invoke$1('ExtensionHost.executeCommand', id);
3104
+ await invoke$2('ExtensionHost.executeCommand', id);
3081
3105
  } catch (error) {
3082
3106
  await handleError(error, false);
3083
3107
  await showErrorDialog(error);
@@ -3110,7 +3134,7 @@ const getOptions = args => {
3110
3134
  const selectPick$8 = async (_pick, value) => {
3111
3135
  const {
3112
3136
  args
3113
- } = state$1;
3137
+ } = state$2;
3114
3138
  const options = getOptions(args);
3115
3139
  if (options.executeItemCommand && _pick.command) {
3116
3140
  return {
@@ -3135,7 +3159,7 @@ const selectPick$8 = async (_pick, value) => {
3135
3159
  }
3136
3160
  executeCallback(resolveId, result);
3137
3161
  } else {
3138
- await invoke$1('QuickPick.executeCallback', resolveId, result);
3162
+ await invoke$2('QuickPick.executeCallback', resolveId, result);
3139
3163
  }
3140
3164
  return {
3141
3165
  command: Hide
@@ -3160,12 +3184,12 @@ const selectPick$7 = async pick => {
3160
3184
  };
3161
3185
 
3162
3186
  const setCursor = async (rowIndex, columnIndex) => {
3163
- await invoke$1('Editor.cursorSet', rowIndex, columnIndex);
3187
+ await invoke$2('Editor.cursorSet', rowIndex, columnIndex);
3164
3188
  };
3165
3189
 
3166
3190
  const goToPositionAndFocus = async (rowIndex, columnIndex) => {
3167
3191
  await setCursor(rowIndex, columnIndex);
3168
- await invoke$1('Editor.handleFocus');
3192
+ await invoke$2('Editor.handleFocus');
3169
3193
  };
3170
3194
 
3171
3195
  const selectPickGoToColumn = async (item, value) => {
@@ -3210,14 +3234,14 @@ const selectPick$5 = async item => {
3210
3234
  const selectPick$4 = async pick => {
3211
3235
  const editorId = await getActiveEditorId();
3212
3236
  const value = pick.value;
3213
- await invoke$1('Viewlet.executeViewletCommand', editorId, 'setLanguageId', value.languageId, value.tokenizePath);
3237
+ await invoke$2('Viewlet.executeViewletCommand', editorId, 'setLanguageId', value.languageId, value.tokenizePath);
3214
3238
  return {
3215
3239
  command: Hide
3216
3240
  };
3217
3241
  };
3218
3242
 
3219
3243
  const openWorkspaceFolder = uri => {
3220
- return invoke$1(/* Workspace.setPath */'Workspace.setPath', /* path */uri);
3244
+ return invoke$2(/* Workspace.setPath */'Workspace.setPath', /* path */uri);
3221
3245
  };
3222
3246
 
3223
3247
  // TODO selectPick should be independent of show/hide
@@ -3459,7 +3483,7 @@ const handleBlur = async state => {
3459
3483
  const options = args.at(-1);
3460
3484
  if (!options?.executeItemCommand) {
3461
3485
  const resolveId = args[2];
3462
- await invoke$1('QuickPick.executeCallback', resolveId, getCancelResult(args));
3486
+ await invoke$2('QuickPick.executeCallback', resolveId, getCancelResult(args));
3463
3487
  }
3464
3488
  }
3465
3489
  await closeWidget(state.uid);
@@ -3674,6 +3698,9 @@ const createCustomPick = value => {
3674
3698
  };
3675
3699
  };
3676
3700
  const shouldCloseBeforeSelect = (subId, pick) => {
3701
+ if (subId === Recent$1) {
3702
+ return true;
3703
+ }
3677
3704
  if (subId !== Commands$1) {
3678
3705
  return false;
3679
3706
  }
@@ -3712,7 +3739,7 @@ const selectIndex = async (state, index, button = /* left */0) => {
3712
3739
  case Hide:
3713
3740
  await closeWidget(state.uid);
3714
3741
  if (selectPickResult.itemCommand) {
3715
- await invoke$1(selectPickResult.itemCommand, ...(selectPickResult.itemCommandArgs || []));
3742
+ await invoke$2(selectPickResult.itemCommand, ...(selectPickResult.itemCommandArgs || []));
3716
3743
  }
3717
3744
  return state;
3718
3745
  case OpenColorTheme:
@@ -3769,6 +3796,31 @@ const handleMessagePort = async port => {
3769
3796
  isMessagePortOpen: true,
3770
3797
  messagePort: port
3771
3798
  });
3799
+ set$1(rpc);
3800
+ };
3801
+
3802
+ const state = {
3803
+ connected: false
3804
+ };
3805
+ const isConnected = () => {
3806
+ const {
3807
+ connected
3808
+ } = state;
3809
+ return connected;
3810
+ };
3811
+ const invoke = (method, ...params) => {
3812
+ return invoke$3(method, ...params);
3813
+ };
3814
+ const set = rpc => {
3815
+ set$4(rpc);
3816
+ state.connected = true;
3817
+ };
3818
+
3819
+ const handleRendererProcessMessagePort = async port => {
3820
+ const rpc = await create$8({
3821
+ commandMap: {},
3822
+ messagePort: port
3823
+ });
3772
3824
  set(rpc);
3773
3825
  };
3774
3826
 
@@ -3807,13 +3859,6 @@ const renderHeight = (_oldState, newState) => {
3807
3859
  return ['Viewlet.send', uid, /* method */SetItemsHeight, /* height */height];
3808
3860
  };
3809
3861
 
3810
- const Div = 4;
3811
- const Input = 6;
3812
- const Span = 8;
3813
- const Text = 12;
3814
- const Img = 17;
3815
- const Reference = 100;
3816
-
3817
3862
  const mergeClassNames = (...classNames) => {
3818
3863
  return classNames.filter(Boolean).join(' ');
3819
3864
  };
@@ -4535,6 +4580,15 @@ const applyRender = (oldState, newState, diffResult) => {
4535
4580
  return commands;
4536
4581
  };
4537
4582
 
4583
+ const isFocusContextCommand = command => {
4584
+ return Array.isArray(command) && command[0] === SetFocusContext;
4585
+ };
4586
+ const renderDirect = async (uid, commands) => {
4587
+ const rendererWorkerCommands = commands.filter(isFocusContextCommand);
4588
+ const rendererProcessCommands = commands.filter(command => !isFocusContextCommand(command));
4589
+ const transactionId = await invoke('Viewlet.queueCommands', uid, rendererProcessCommands);
4590
+ return [...rendererWorkerCommands, ['Viewlet.commitPending', uid, transactionId]];
4591
+ };
4538
4592
  const render2 = (uid, diffResult) => {
4539
4593
  const {
4540
4594
  newState,
@@ -4543,9 +4597,12 @@ const render2 = (uid, diffResult) => {
4543
4597
  if (oldState === newState) {
4544
4598
  return [];
4545
4599
  }
4546
- set$1(uid, newState, newState);
4600
+ set$2(uid, newState, newState);
4547
4601
  const commands = applyRender(oldState, newState, diffResult);
4548
- return commands;
4602
+ if (!isConnected()) {
4603
+ return commands;
4604
+ }
4605
+ return renderDirect(uid, commands);
4549
4606
  };
4550
4607
 
4551
4608
  const renderEventListeners = () => {
@@ -4617,7 +4674,7 @@ const showQuickInput = async ({
4617
4674
  const customItemsId = add(initialItems);
4618
4675
  const picks = [];
4619
4676
  try {
4620
- const result = await invoke$1('QuickPick.showCustom', picks, {
4677
+ const result = await invoke$2('QuickPick.showCustom', picks, {
4621
4678
  customItemsId,
4622
4679
  ignoreFocusOut,
4623
4680
  initialValue,
@@ -4649,7 +4706,7 @@ const showQuickPick = async ({
4649
4706
  promise
4650
4707
  } = registerCallback();
4651
4708
  try {
4652
- await invoke$1('Viewlet.openWidget', QuickPick, 'custom', [], id, {
4709
+ await invoke$2('Viewlet.openWidget', QuickPick, 'custom', [], id, {
4653
4710
  acceptInput,
4654
4711
  callbackOwner: 'quickPickWorker',
4655
4712
  customItemsId,
@@ -4685,6 +4742,7 @@ const commandMap = {
4685
4742
  'QuickPick.handleFocus': wrapCommand(handleFocus),
4686
4743
  'QuickPick.handleInput': wrapAsyncCommand(handleInputWithContext),
4687
4744
  'QuickPick.handleMessagePort': handleMessagePort,
4745
+ 'QuickPick.handleRendererProcessMessagePort': handleRendererProcessMessagePort,
4688
4746
  'QuickPick.handleScrollBarPointerDown': wrapCommand(handleScrollBarPointerDown),
4689
4747
  'QuickPick.handleScrollBarPointerMove': wrapCommand(handleScrollBarPointerMove),
4690
4748
  'QuickPick.handleScrollBarPointerUp': wrapCommand(handleScrollBarPointerUp),
@@ -4710,7 +4768,7 @@ const initializeEditorWorker = async () => {
4710
4768
  await sendMessagePortToEditorWorker(port, 0);
4711
4769
  }
4712
4770
  });
4713
- set$5(rpc);
4771
+ set$7(rpc);
4714
4772
  };
4715
4773
 
4716
4774
  const initializeExtensionManagementWorker = async () => {
@@ -4720,7 +4778,7 @@ const initializeExtensionManagementWorker = async () => {
4720
4778
  await sendMessagePortToExtensionManagementWorker(port, 0);
4721
4779
  }
4722
4780
  });
4723
- set$4(rpc);
4781
+ set$6(rpc);
4724
4782
  };
4725
4783
 
4726
4784
  const initializeFileSearchWorker = async () => {
@@ -4730,14 +4788,14 @@ const initializeFileSearchWorker = async () => {
4730
4788
  await sendMessagePortToFileSearchWorker2(port, 0);
4731
4789
  }
4732
4790
  });
4733
- set$3(rpc);
4791
+ set$5(rpc);
4734
4792
  };
4735
4793
 
4736
4794
  const initializeRendererWorker = async () => {
4737
4795
  const rpc = await create$5({
4738
4796
  commandMap: commandMap
4739
4797
  });
4740
- set$2(rpc);
4798
+ set$3(rpc);
4741
4799
  };
4742
4800
 
4743
4801
  const listen = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/quick-pick-worker",
3
- "version": "4.13.1",
3
+ "version": "4.14.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lvce-editor/quick-pick-worker.git"