@theia/filesystem 1.65.0-next.6 → 1.65.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.
Files changed (147) hide show
  1. package/lib/browser/download/file-download-command-contribution.d.ts +1 -1
  2. package/lib/browser/download/file-download-command-contribution.d.ts.map +1 -1
  3. package/lib/browser/download/file-download-command-contribution.js +3 -3
  4. package/lib/browser/download/file-download-command-contribution.js.map +1 -1
  5. package/lib/browser/download/file-download-frontend-module.d.ts.map +1 -1
  6. package/lib/browser/download/file-download-frontend-module.js +2 -1
  7. package/lib/browser/download/file-download-frontend-module.js.map +1 -1
  8. package/lib/browser/download/file-download-service.d.ts +2 -10
  9. package/lib/browser/download/file-download-service.d.ts.map +1 -1
  10. package/lib/browser/download/file-download-service.js +8 -7
  11. package/lib/browser/download/file-download-service.js.map +1 -1
  12. package/lib/browser/file-resource.js +1 -1
  13. package/lib/browser/file-resource.js.map +1 -1
  14. package/lib/browser/file-service.d.ts +1 -1
  15. package/lib/browser/file-service.d.ts.map +1 -1
  16. package/lib/browser/file-service.js +1 -1
  17. package/lib/browser/file-service.js.map +1 -1
  18. package/lib/browser/file-tree/file-tree-widget.d.ts +1 -1
  19. package/lib/browser/file-tree/file-tree-widget.d.ts.map +1 -1
  20. package/lib/browser/file-tree/file-tree-widget.js +3 -3
  21. package/lib/browser/file-tree/file-tree-widget.js.map +1 -1
  22. package/lib/browser/filesystem-frontend-contribution.d.ts +5 -4
  23. package/lib/browser/filesystem-frontend-contribution.d.ts.map +1 -1
  24. package/lib/browser/filesystem-frontend-contribution.js +5 -5
  25. package/lib/browser/filesystem-frontend-contribution.js.map +1 -1
  26. package/lib/browser/filesystem-frontend-module.d.ts.map +1 -1
  27. package/lib/browser/filesystem-frontend-module.js +4 -3
  28. package/lib/browser/filesystem-frontend-module.js.map +1 -1
  29. package/lib/browser/filesystem-saveable-service.d.ts.map +1 -1
  30. package/lib/browser/filesystem-saveable-service.js +5 -1
  31. package/lib/browser/filesystem-saveable-service.js.map +1 -1
  32. package/lib/browser/index.d.ts +0 -1
  33. package/lib/browser/index.d.ts.map +1 -1
  34. package/lib/browser/index.js +0 -1
  35. package/lib/browser/index.js.map +1 -1
  36. package/lib/browser/{file-upload-service.d.ts → upload/file-upload-service-impl.d.ts} +16 -52
  37. package/lib/browser/upload/file-upload-service-impl.d.ts.map +1 -0
  38. package/lib/browser/{file-upload-service.js → upload/file-upload-service-impl.js} +27 -27
  39. package/lib/browser/upload/file-upload-service-impl.js.map +1 -0
  40. package/lib/browser-only/browser-only-filesystem-frontend-module.d.ts.map +1 -1
  41. package/lib/browser-only/browser-only-filesystem-frontend-module.js +8 -0
  42. package/lib/browser-only/browser-only-filesystem-frontend-module.js.map +1 -1
  43. package/lib/browser-only/download/file-download-command-contribution.d.ts +15 -0
  44. package/lib/browser-only/download/file-download-command-contribution.d.ts.map +1 -0
  45. package/lib/browser-only/download/file-download-command-contribution.js +55 -0
  46. package/lib/browser-only/download/file-download-command-contribution.js.map +1 -0
  47. package/lib/browser-only/download/file-download-frontend-module.d.ts +4 -0
  48. package/lib/browser-only/download/file-download-frontend-module.d.ts.map +1 -0
  49. package/lib/browser-only/download/file-download-frontend-module.js +27 -0
  50. package/lib/browser-only/download/file-download-frontend-module.js.map +1 -0
  51. package/lib/browser-only/download/file-download-service.d.ts +86 -0
  52. package/lib/browser-only/download/file-download-service.d.ts.map +1 -0
  53. package/lib/browser-only/download/file-download-service.js +551 -0
  54. package/lib/browser-only/download/file-download-service.js.map +1 -0
  55. package/lib/browser-only/file-search.d.ts +38 -0
  56. package/lib/browser-only/file-search.d.ts.map +1 -0
  57. package/lib/browser-only/file-search.js +153 -0
  58. package/lib/browser-only/file-search.js.map +1 -0
  59. package/lib/browser-only/opfs-filesystem-initialization.d.ts +4 -2
  60. package/lib/browser-only/opfs-filesystem-initialization.d.ts.map +1 -1
  61. package/lib/browser-only/opfs-filesystem-initialization.js +4 -1
  62. package/lib/browser-only/opfs-filesystem-initialization.js.map +1 -1
  63. package/lib/browser-only/opfs-filesystem-provider.d.ts +89 -12
  64. package/lib/browser-only/opfs-filesystem-provider.d.ts.map +1 -1
  65. package/lib/browser-only/opfs-filesystem-provider.js +345 -181
  66. package/lib/browser-only/opfs-filesystem-provider.js.map +1 -1
  67. package/lib/browser-only/upload/file-upload-service-impl.d.ts +67 -0
  68. package/lib/browser-only/upload/file-upload-service-impl.d.ts.map +1 -0
  69. package/lib/browser-only/upload/file-upload-service-impl.js +328 -0
  70. package/lib/browser-only/upload/file-upload-service-impl.js.map +1 -0
  71. package/lib/common/download/file-download.d.ts +17 -0
  72. package/lib/common/download/file-download.d.ts.map +1 -0
  73. package/lib/common/download/{file-download-data.js → file-download.js} +3 -2
  74. package/lib/common/download/file-download.js.map +1 -0
  75. package/lib/common/files.d.ts +8 -1
  76. package/lib/common/files.d.ts.map +1 -1
  77. package/lib/common/files.js +35 -1
  78. package/lib/common/files.js.map +1 -1
  79. package/lib/{browser → common}/filesystem-preferences.d.ts +3 -1
  80. package/lib/common/filesystem-preferences.d.ts.map +1 -0
  81. package/lib/{browser → common}/filesystem-preferences.js +17 -11
  82. package/lib/common/filesystem-preferences.js.map +1 -0
  83. package/lib/common/index.d.ts +1 -0
  84. package/lib/common/index.d.ts.map +1 -1
  85. package/lib/common/index.js +1 -0
  86. package/lib/common/index.js.map +1 -1
  87. package/lib/common/io.js +7 -1
  88. package/lib/common/io.js.map +1 -1
  89. package/lib/common/upload/file-upload.d.ts +45 -0
  90. package/lib/common/upload/file-upload.d.ts.map +1 -0
  91. package/{src/common/download/file-download-data.ts → lib/common/upload/file-upload.js} +6 -13
  92. package/lib/common/upload/file-upload.js.map +1 -0
  93. package/lib/node/disk-file-system-provider.d.ts.map +1 -1
  94. package/lib/node/disk-file-system-provider.js +2 -4
  95. package/lib/node/disk-file-system-provider.js.map +1 -1
  96. package/lib/node/download/file-download-handler.js +2 -2
  97. package/lib/node/download/file-download-handler.js.map +1 -1
  98. package/lib/node/filesystem-backend-module.d.ts.map +1 -1
  99. package/lib/node/filesystem-backend-module.js +3 -1
  100. package/lib/node/filesystem-backend-module.js.map +1 -1
  101. package/lib/node/parcel-watcher/parcel-filesystem-service.d.ts +2 -2
  102. package/lib/node/parcel-watcher/parcel-filesystem-service.d.ts.map +1 -1
  103. package/lib/node/parcel-watcher/parcel-filesystem-service.js.map +1 -1
  104. package/lib/node/upload/node-file-upload-service.d.ts.map +1 -0
  105. package/lib/node/{node-file-upload-service.js → upload/node-file-upload-service.js} +1 -1
  106. package/lib/node/upload/node-file-upload-service.js.map +1 -0
  107. package/package.json +11 -5
  108. package/src/browser/download/file-download-command-contribution.ts +1 -1
  109. package/src/browser/download/file-download-frontend-module.ts +3 -2
  110. package/src/browser/download/file-download-service.ts +7 -12
  111. package/src/browser/file-resource.ts +1 -1
  112. package/src/browser/file-service.ts +1 -1
  113. package/src/browser/file-tree/file-tree-widget.tsx +1 -1
  114. package/src/browser/filesystem-frontend-contribution.ts +4 -5
  115. package/src/browser/filesystem-frontend-module.ts +4 -3
  116. package/src/browser/filesystem-saveable-service.ts +5 -1
  117. package/src/browser/index.ts +0 -1
  118. package/src/browser/{file-upload-service.ts → upload/file-upload-service-impl.ts} +31 -72
  119. package/src/browser-only/browser-only-filesystem-frontend-module.ts +10 -0
  120. package/src/browser-only/download/file-download-command-contribution.ts +56 -0
  121. package/src/browser-only/download/file-download-frontend-module.ts +26 -0
  122. package/src/browser-only/download/file-download-service.ts +726 -0
  123. package/src/browser-only/file-search.ts +170 -0
  124. package/src/browser-only/opfs-filesystem-initialization.ts +7 -4
  125. package/src/browser-only/opfs-filesystem-provider.ts +402 -189
  126. package/src/browser-only/upload/file-upload-service-impl.ts +408 -0
  127. package/src/common/download/file-download.ts +40 -0
  128. package/src/common/files.ts +42 -1
  129. package/src/{browser → common}/filesystem-preferences.ts +14 -14
  130. package/src/common/index.ts +1 -0
  131. package/src/common/io.ts +6 -1
  132. package/src/common/upload/file-upload.ts +65 -0
  133. package/src/node/disk-file-system-provider.ts +3 -4
  134. package/src/node/download/file-download-handler.ts +1 -1
  135. package/src/node/filesystem-backend-module.ts +3 -1
  136. package/src/node/parcel-watcher/parcel-filesystem-service.ts +2 -2
  137. package/src/node/{node-file-upload-service.ts → upload/node-file-upload-service.ts} +1 -1
  138. package/lib/browser/file-upload-service.d.ts.map +0 -1
  139. package/lib/browser/file-upload-service.js.map +0 -1
  140. package/lib/browser/filesystem-preferences.d.ts.map +0 -1
  141. package/lib/browser/filesystem-preferences.js.map +0 -1
  142. package/lib/common/download/file-download-data.d.ts +0 -7
  143. package/lib/common/download/file-download-data.d.ts.map +0 -1
  144. package/lib/common/download/file-download-data.js.map +0 -1
  145. package/lib/node/node-file-upload-service.d.ts.map +0 -1
  146. package/lib/node/node-file-upload-service.js.map +0 -1
  147. /package/lib/node/{node-file-upload-service.d.ts → upload/node-file-upload-service.d.ts} +0 -0
@@ -20,16 +20,26 @@ import { OPFSFileSystemProvider } from './opfs-filesystem-provider';
20
20
  import { RemoteFileSystemProvider, RemoteFileSystemServer } from '../common/remote-file-system-provider';
21
21
  import { OPFSInitialization, DefaultOPFSInitialization } from './opfs-filesystem-initialization';
22
22
  import { BrowserOnlyFileSystemProviderServer } from './browser-only-filesystem-provider-server';
23
+ import { FileUploadService } from '../common/upload/file-upload';
24
+ import { FileUploadServiceImpl } from './upload/file-upload-service-impl';
23
25
 
24
26
  export default new ContainerModule((bind, _unbind, isBound, rebind) => {
25
27
  bind(DefaultOPFSInitialization).toSelf();
26
28
  bind(OPFSFileSystemProvider).toSelf();
27
29
  bind(OPFSInitialization).toService(DefaultOPFSInitialization);
30
+
31
+ if (isBound(FileUploadService)) {
32
+ rebind(FileUploadService).to(FileUploadServiceImpl).inSingletonScope();
33
+ } else {
34
+ bind(FileUploadService).to(FileUploadServiceImpl).inSingletonScope();
35
+ }
36
+
28
37
  if (isBound(FileSystemProvider)) {
29
38
  rebind(FileSystemProvider).to(OPFSFileSystemProvider).inSingletonScope();
30
39
  } else {
31
40
  bind(FileSystemProvider).to(OPFSFileSystemProvider).inSingletonScope();
32
41
  }
42
+
33
43
  if (isBound(RemoteFileSystemProvider)) {
34
44
  rebind(RemoteFileSystemServer).to(BrowserOnlyFileSystemProviderServer).inSingletonScope();
35
45
  } else {
@@ -0,0 +1,56 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2025 Maksim Kachurin and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { inject, injectable } from '@theia/core/shared/inversify';
18
+ import URI from '@theia/core/lib/common/uri';
19
+ import { SelectionService } from '@theia/core/lib/common/selection-service';
20
+ import { CommandContribution, CommandRegistry } from '@theia/core/lib/common/command';
21
+ import { UriAwareCommandHandler } from '@theia/core/lib/common/uri-command-handler';
22
+ import { FileDownloadService } from '../../common/download/file-download';
23
+ import { FileDownloadCommands } from '../../browser/download/file-download-command-contribution';
24
+
25
+ @injectable()
26
+ export class FileDownloadCommandContribution implements CommandContribution {
27
+
28
+ @inject(FileDownloadService)
29
+ protected readonly downloadService: FileDownloadService;
30
+
31
+ @inject(SelectionService)
32
+ protected readonly selectionService: SelectionService;
33
+
34
+ registerCommands(registry: CommandRegistry): void {
35
+ registry.registerCommand(
36
+ FileDownloadCommands.DOWNLOAD,
37
+ UriAwareCommandHandler.MultiSelect(this.selectionService, {
38
+ execute: uris => this.executeDownload(uris),
39
+ isEnabled: uris => this.isDownloadEnabled(uris),
40
+ isVisible: uris => this.isDownloadVisible(uris),
41
+ })
42
+ );
43
+ }
44
+
45
+ protected async executeDownload(uris: URI[], options?: { copyLink?: boolean }): Promise<void> {
46
+ this.downloadService.download(uris, options);
47
+ }
48
+
49
+ protected isDownloadEnabled(uris: URI[]): boolean {
50
+ return uris.length > 0 && uris.every(u => u.scheme === 'file');
51
+ }
52
+
53
+ protected isDownloadVisible(uris: URI[]): boolean {
54
+ return this.isDownloadEnabled(uris);
55
+ }
56
+ }
@@ -0,0 +1,26 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2025 Maksim Kachurin and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { ContainerModule } from '@theia/core/shared/inversify';
18
+ import { FileDownloadService } from '../../common/download/file-download';
19
+ import { FileDownloadServiceImpl } from './file-download-service';
20
+ import { CommandContribution } from '@theia/core/lib/common';
21
+ import { FileDownloadCommandContribution } from './file-download-command-contribution';
22
+
23
+ export default new ContainerModule(bind => {
24
+ bind(FileDownloadService).to(FileDownloadServiceImpl).inSingletonScope();
25
+ bind(CommandContribution).to(FileDownloadCommandContribution).inSingletonScope();
26
+ });