@lvce-editor/explorer-view 5.22.0 → 5.24.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.
@@ -149,6 +149,9 @@ const Copy$1 = 3;
149
149
  const Rename$2 = 4;
150
150
  const Remove = 5;
151
151
 
152
+ const Text = 12;
153
+ const Reference = 100;
154
+
152
155
  const Button$3 = 'event.button';
153
156
  const ClientX = 'event.clientX';
154
157
  const ClientY = 'event.clientY';
@@ -164,6 +167,27 @@ const ShiftKey = 'event.shiftKey';
164
167
  const TargetName = 'event.target.name';
165
168
  const TargetValue = 'event.target.value';
166
169
 
170
+ const Enter = 3;
171
+ const Escape = 8;
172
+ const Space = 9;
173
+ const End = 255;
174
+ const Home = 12;
175
+ const LeftArrow = 13;
176
+ const UpArrow = 14;
177
+ const RightArrow = 15;
178
+ const DownArrow = 16;
179
+ const Delete$1 = 18;
180
+ const KeyA = 29;
181
+ const KeyC = 31;
182
+ const KeyV = 50;
183
+ const KeyX = 52;
184
+ const F2 = 58;
185
+ const Star = 131;
186
+
187
+ const CtrlCmd = 1 << 11 >>> 0;
188
+ const Shift = 1 << 10 >>> 0;
189
+ const Alt = 1 << 9 >>> 0;
190
+
167
191
  const FileSystemWorker$1 = 209;
168
192
  const IconThemeWorker = 7009;
169
193
  const RendererWorker = 1;
@@ -654,7 +678,7 @@ const callbacks = Object.create(null);
654
678
  const get$2 = id => {
655
679
  return callbacks[id];
656
680
  };
657
- const remove$3 = id => {
681
+ const remove$2 = id => {
658
682
  delete callbacks[id];
659
683
  };
660
684
  class JsonRpcError extends Error {
@@ -807,7 +831,7 @@ const resolve = (id, response) => {
807
831
  return;
808
832
  }
809
833
  fn(response);
810
- remove$3(id);
834
+ remove$2(id);
811
835
  };
812
836
  const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
813
837
  const getErrorType = prettyError => {
@@ -1221,7 +1245,7 @@ const set$6 = (id, rpc) => {
1221
1245
  const get$1 = id => {
1222
1246
  return rpcs[id];
1223
1247
  };
1224
- const remove$2 = id => {
1248
+ const remove$1 = id => {
1225
1249
  delete rpcs[id];
1226
1250
  };
1227
1251
 
@@ -1251,7 +1275,7 @@ const create$1 = rpcId => {
1251
1275
  set$6(rpcId, mockRpc);
1252
1276
  // @ts-ignore
1253
1277
  mockRpc[Symbol.dispose] = () => {
1254
- remove$2(rpcId);
1278
+ remove$1(rpcId);
1255
1279
  };
1256
1280
  // @ts-ignore
1257
1281
  return mockRpc;
@@ -1263,88 +1287,12 @@ const create$1 = rpcId => {
1263
1287
  };
1264
1288
 
1265
1289
  const {
1266
- dispose,
1267
- invoke: invoke$4,
1268
- invokeAndTransfer: invokeAndTransfer$1,
1269
- registerMockRpc,
1270
1290
  set: set$5
1271
1291
  } = create$1(FileSystemWorker$1);
1272
- const remove$1 = async dirent => {
1273
- return invoke$4('FileSystem.remove', dirent);
1274
- };
1275
- const readDirWithFileTypes$1 = async uri => {
1276
- return invoke$4('FileSystem.readDirWithFileTypes', uri);
1277
- };
1278
- const getPathSeparator$2 = async root => {
1279
- return invoke$4('FileSystem.getPathSeparator', root);
1280
- };
1281
- const getRealPath$1 = async path => {
1282
- return invoke$4('FileSystem.getRealPath', path);
1283
- };
1284
- const stat$1 = async dirent => {
1285
- return invoke$4('FileSystem.stat', dirent);
1286
- };
1287
- const createFile = async uri => {
1288
- return invoke$4('FileSystem.writeFile', uri, '');
1289
- };
1290
- const readFile = async uri => {
1291
- return invoke$4('FileSystem.readFile', uri);
1292
- };
1293
- const writeFile$1 = async (uri, content) => {
1294
- return invoke$4('FileSystem.writeFile', uri, content);
1295
- };
1296
- const mkdir$1 = async uri => {
1297
- return invoke$4('FileSystem.mkdir', uri);
1298
- };
1299
- const rename$2 = async (oldUri, newUri) => {
1300
- return invoke$4('FileSystem.rename', oldUri, newUri);
1301
- };
1302
- const copy$2 = async (oldUri, newUri) => {
1303
- return invoke$4('FileSystem.copy', oldUri, newUri);
1304
- };
1305
- const exists = async uri => {
1306
- return invoke$4('FileSystem.exists', uri);
1307
- };
1308
- const getFolderSize = async uri => {
1309
- return invoke$4('FileSystem.getFolderSize', uri);
1310
- };
1311
- const readFileAsBlob = async uri => {
1312
- return invoke$4('FileSystem.readFileAsBlob', uri);
1313
- };
1314
- const appendFile = async (uri, text) => {
1315
- return invoke$4('FileSystem.appendFile', uri, text);
1316
- };
1317
- const watchFile = async (watchId, uri, rpcId) => {
1318
- await invoke$4('FileSystem.watchFile', watchId, uri, rpcId);
1319
- };
1320
- const unwatchFile = async watchId => {
1321
- await invoke$4('FileSystem.unwatchFile', watchId);
1322
- };
1323
1292
 
1324
1293
  const FileSystemWorker = {
1325
1294
  __proto__: null,
1326
- appendFile,
1327
- copy: copy$2,
1328
- createFile,
1329
- dispose,
1330
- exists,
1331
- getFolderSize,
1332
- getPathSeparator: getPathSeparator$2,
1333
- getRealPath: getRealPath$1,
1334
- invoke: invoke$4,
1335
- invokeAndTransfer: invokeAndTransfer$1,
1336
- mkdir: mkdir$1,
1337
- readDirWithFileTypes: readDirWithFileTypes$1,
1338
- readFile,
1339
- readFileAsBlob,
1340
- registerMockRpc,
1341
- remove: remove$1,
1342
- rename: rename$2,
1343
- set: set$5,
1344
- stat: stat$1,
1345
- unwatchFile,
1346
- watchFile,
1347
- writeFile: writeFile$1
1295
+ set: set$5
1348
1296
  };
1349
1297
 
1350
1298
  const {
@@ -1366,7 +1314,6 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
1366
1314
  number(menuId);
1367
1315
  number(x);
1368
1316
  number(y);
1369
- // @ts-ignore
1370
1317
  await invoke$2('ContextMenu.show2', uid, menuId, x, y, args);
1371
1318
  };
1372
1319
  const getFileHandles$1 = async fileIds => {
@@ -1375,16 +1322,13 @@ const getFileHandles$1 = async fileIds => {
1375
1322
  };
1376
1323
  const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
1377
1324
  const command = 'IconTheme.handleMessagePort';
1378
- // @ts-ignore
1379
1325
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
1380
1326
  };
1381
1327
  const sendMessagePortToFileSystemWorker$1 = async (port, rpcId) => {
1382
1328
  const command = 'FileSystem.handleMessagePort';
1383
- // @ts-ignore
1384
1329
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
1385
1330
  };
1386
1331
  const confirm = async (message, options) => {
1387
- // @ts-ignore
1388
1332
  const result = await invoke$2('ConfirmPrompt.prompt', message, options);
1389
1333
  return result;
1390
1334
  };
@@ -1393,7 +1337,6 @@ const writeClipBoardText = async text => {
1393
1337
  };
1394
1338
  const sendMessagePortToSourceControlWorker = async port => {
1395
1339
  const command = 'SourceControl.handleMessagePort';
1396
- // @ts-ignore
1397
1340
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
1398
1341
  };
1399
1342
 
@@ -1820,6 +1763,10 @@ const mergeTrees = (a, b) => {
1820
1763
  };
1821
1764
  };
1822
1765
 
1766
+ const openUri = async (uri, focus) => {
1767
+ await invoke$2(/* Main.openAbsolutePath */'Main.openUri', /* absolutePath */uri, /* focus */focus);
1768
+ };
1769
+
1823
1770
  const refreshWorkspace = async () => {
1824
1771
  // TODO maybe pass an application id to this?
1825
1772
  try {
@@ -1880,7 +1827,7 @@ const Copy = 'Copy';
1880
1827
  const CopyPath = 'Copy Path';
1881
1828
  const CopyRelativePath = 'Copy Relative Path';
1882
1829
  const Cut = 'Cut';
1883
- const Delete$1 = 'Delete';
1830
+ const Delete = 'Delete';
1884
1831
  const FileNameCannotStartWithSlash = 'A file or folder name cannot start with a slash.';
1885
1832
  const FileOrFolderAlreadyExists = 'A file or folder **{PH1}** already exists at this location. Please choose a different name.';
1886
1833
  const FileOrFolderNameMustBeProvider = 'A file or folder name must be provided.';
@@ -1929,7 +1876,7 @@ const rename = () => {
1929
1876
  return i18nString(Rename);
1930
1877
  };
1931
1878
  const deleteItem = () => {
1932
- return i18nString(Delete$1);
1879
+ return i18nString(Delete);
1933
1880
  };
1934
1881
  const refresh$1 = () => {
1935
1882
  return i18nString(RefreshExplorer);
@@ -2032,6 +1979,9 @@ const acceptCreate = async (state, newDirentType) => {
2032
1979
  const dirents = newItems;
2033
1980
  const newFocusedIndex = getIndex(newItems, absolutePath);
2034
1981
  await refreshWorkspace();
1982
+ if (newDirentType === File) {
1983
+ await openUri(absolutePath, true);
1984
+ }
2035
1985
  return {
2036
1986
  ...state,
2037
1987
  editingIndex: -1,
@@ -2500,29 +2450,6 @@ const Viewlet = 'Viewlet';
2500
2450
  const Welcome = 'Welcome';
2501
2451
  const WelcomeMessage = 'WelcomeMessage';
2502
2452
 
2503
- const Text = 12;
2504
-
2505
- const Enter = 3;
2506
- const Escape = 8;
2507
- const Space = 9;
2508
- const End = 255;
2509
- const Home = 12;
2510
- const LeftArrow = 13;
2511
- const UpArrow = 14;
2512
- const RightArrow = 15;
2513
- const DownArrow = 16;
2514
- const Delete = 18;
2515
- const KeyA = 29;
2516
- const KeyC = 31;
2517
- const KeyV = 50;
2518
- const KeyX = 52;
2519
- const F2 = 58;
2520
- const Star = 131;
2521
-
2522
- const CtrlCmd = 1 << 11 >>> 0;
2523
- const Shift = 1 << 10 >>> 0;
2524
- const Alt = 1 << 9 >>> 0;
2525
-
2526
2453
  const mergeClassNames = (...classNames) => {
2527
2454
  return classNames.filter(Boolean).join(' ');
2528
2455
  };
@@ -2551,6 +2478,7 @@ const NavigateChild = 7;
2551
2478
  const NavigateParent = 8;
2552
2479
  const RemoveChild = 9;
2553
2480
  const NavigateSibling = 10;
2481
+ const SetReferenceNodeUid = 11;
2554
2482
 
2555
2483
  const isKey = key => {
2556
2484
  return key !== 'type' && key !== 'childCount';
@@ -2618,6 +2546,16 @@ const compareNodes = (oldNode, newNode) => {
2618
2546
  if (oldNode.type !== newNode.type) {
2619
2547
  return null;
2620
2548
  }
2549
+ // Handle reference nodes - special handling for uid changes
2550
+ if (oldNode.type === Reference) {
2551
+ if (oldNode.uid !== newNode.uid) {
2552
+ patches.push({
2553
+ type: SetReferenceNodeUid,
2554
+ uid: newNode.uid
2555
+ });
2556
+ }
2557
+ return patches;
2558
+ }
2621
2559
  // Handle text nodes
2622
2560
  if (oldNode.type === Text && newNode.type === Text) {
2623
2561
  if (oldNode.text !== newNode.text) {
@@ -2921,6 +2859,9 @@ const wrapListItemCommand = fn => {
2921
2859
  newState
2922
2860
  } = get(id);
2923
2861
  const updatedState = await fn(newState, ...args);
2862
+ if (newState === updatedState) {
2863
+ return;
2864
+ }
2924
2865
  const {
2925
2866
  cutItems,
2926
2867
  decorations,
@@ -3416,7 +3357,7 @@ const getKeyBindings = () => {
3416
3357
  when: FocusExplorerEditBox
3417
3358
  }, {
3418
3359
  command: 'Explorer.removeDirent',
3419
- key: Delete,
3360
+ key: Delete$1,
3420
3361
  when: FocusExplorer
3421
3362
  }, {
3422
3363
  command: 'Explorer.focusNone',
@@ -3715,10 +3656,6 @@ const handleClickDirectory = async (state, dirent, index, keepFocus) => {
3715
3656
  };
3716
3657
  };
3717
3658
 
3718
- const openUri = async (uri, focus) => {
3719
- await invoke$2(/* Main.openAbsolutePath */'Main.openUri', /* absolutePath */uri, /* focus */focus);
3720
- };
3721
-
3722
3659
  const handleClickFile = async (state, dirent, index, keepFocus = false) => {
3723
3660
  await openUri(dirent.path, !keepFocus);
3724
3661
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/explorer-view",
3
- "version": "5.22.0",
3
+ "version": "5.24.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",