@dxos/plugin-wnfs 0.8.4-main.7996785055 → 0.8.4-main.8baae0fced

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 (205) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +2 -2
  3. package/dist/lib/neutral/WnfsPlugin.mjs +39 -0
  4. package/dist/lib/neutral/WnfsPlugin.mjs.map +7 -0
  5. package/dist/lib/neutral/WnfsPlugin.node.mjs +12 -0
  6. package/dist/lib/neutral/WnfsPlugin.node.mjs.map +7 -0
  7. package/dist/lib/neutral/WnfsPlugin.workerd.mjs +12 -0
  8. package/dist/lib/neutral/WnfsPlugin.workerd.mjs.map +7 -0
  9. package/dist/lib/neutral/backend-DHBQUTPC.mjs +47 -0
  10. package/dist/lib/neutral/backend-DHBQUTPC.mjs.map +7 -0
  11. package/dist/lib/{browser/blockstore-TUV5YIC5.mjs → neutral/blockstore-3NLSWC7Z.mjs} +6 -7
  12. package/dist/lib/neutral/blockstore-3NLSWC7Z.mjs.map +7 -0
  13. package/dist/lib/neutral/capabilities/index.mjs +13 -0
  14. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  15. package/dist/lib/{browser/chunk-A7ETWNGC.mjs → neutral/chunk-7KFJ6LYH.mjs} +32 -17
  16. package/dist/lib/neutral/chunk-7KFJ6LYH.mjs.map +7 -0
  17. package/dist/lib/neutral/chunk-EKFVDDRY.mjs +26 -0
  18. package/dist/lib/neutral/chunk-EKFVDDRY.mjs.map +7 -0
  19. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  20. package/dist/lib/neutral/chunk-QODCKFTY.mjs +19 -0
  21. package/dist/lib/neutral/chunk-QODCKFTY.mjs.map +7 -0
  22. package/dist/lib/neutral/helpers/index.mjs +26 -0
  23. package/dist/lib/neutral/index.mjs +34 -0
  24. package/dist/lib/neutral/index.mjs.map +7 -0
  25. package/dist/lib/neutral/meta.json +1 -0
  26. package/dist/lib/neutral/meta.mjs +8 -0
  27. package/dist/lib/neutral/meta.mjs.map +7 -0
  28. package/dist/lib/neutral/plugin.mjs +12 -0
  29. package/dist/lib/neutral/plugin.mjs.map +7 -0
  30. package/dist/lib/neutral/translations.mjs +17 -0
  31. package/dist/lib/neutral/translations.mjs.map +7 -0
  32. package/dist/lib/neutral/types/index.mjs +8 -0
  33. package/dist/lib/neutral/types/index.mjs.map +7 -0
  34. package/dist/lib/neutral/url-resolver-UD3ZP77Y.mjs +47 -0
  35. package/dist/lib/neutral/url-resolver-UD3ZP77Y.mjs.map +7 -0
  36. package/dist/types/src/WnfsPlugin.d.ts +1 -0
  37. package/dist/types/src/WnfsPlugin.d.ts.map +1 -1
  38. package/dist/types/src/WnfsPlugin.node.d.ts +4 -0
  39. package/dist/types/src/WnfsPlugin.node.d.ts.map +1 -0
  40. package/dist/types/src/WnfsPlugin.test.d.ts +2 -0
  41. package/dist/types/src/WnfsPlugin.test.d.ts.map +1 -0
  42. package/dist/types/src/WnfsPlugin.workerd.d.ts +4 -0
  43. package/dist/types/src/WnfsPlugin.workerd.d.ts.map +1 -0
  44. package/dist/types/src/blockstore.d.ts.map +1 -1
  45. package/dist/types/src/capabilities/backend.d.ts +7 -0
  46. package/dist/types/src/capabilities/backend.d.ts.map +1 -0
  47. package/dist/types/src/capabilities/blockstore.d.ts.map +1 -0
  48. package/dist/types/src/capabilities/index.d.ts +5 -5
  49. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  50. package/dist/types/src/capabilities/url-resolver.d.ts +7 -0
  51. package/dist/types/src/capabilities/url-resolver.d.ts.map +1 -0
  52. package/dist/types/src/helpers/common.d.ts.map +1 -1
  53. package/dist/types/src/helpers/load.d.ts +1 -1
  54. package/dist/types/src/helpers/load.d.ts.map +1 -1
  55. package/dist/types/src/helpers/upload.d.ts +1 -1
  56. package/dist/types/src/helpers/upload.d.ts.map +1 -1
  57. package/dist/types/src/helpers/wnfs-url.d.ts.map +1 -1
  58. package/dist/types/src/index.d.ts +2 -2
  59. package/dist/types/src/index.d.ts.map +1 -1
  60. package/dist/types/src/meta.d.ts.map +1 -1
  61. package/dist/types/src/plugin.d.ts +3 -0
  62. package/dist/types/src/plugin.d.ts.map +1 -0
  63. package/dist/types/src/translations.d.ts +2 -16
  64. package/dist/types/src/translations.d.ts.map +1 -1
  65. package/dist/types/src/types/WnfsCapabilities.d.ts +11 -0
  66. package/dist/types/src/types/WnfsCapabilities.d.ts.map +1 -0
  67. package/dist/types/src/types/index.d.ts +1 -3
  68. package/dist/types/src/types/index.d.ts.map +1 -1
  69. package/dist/types/tsconfig.tsbuildinfo +1 -1
  70. package/package.json +96 -49
  71. package/src/WnfsPlugin.node.ts +11 -0
  72. package/src/WnfsPlugin.test.ts +20 -0
  73. package/src/WnfsPlugin.tsx +11 -40
  74. package/src/WnfsPlugin.workerd.ts +11 -0
  75. package/src/capabilities/backend.ts +43 -0
  76. package/src/capabilities/{blockstore/blockstore.ts → blockstore.ts} +3 -2
  77. package/src/capabilities/index.ts +14 -5
  78. package/src/capabilities/url-resolver.ts +44 -0
  79. package/src/helpers/load.ts +3 -3
  80. package/src/helpers/upload.ts +2 -2
  81. package/src/index.ts +2 -2
  82. package/src/meta.ts +4 -0
  83. package/src/plugin.ts +9 -0
  84. package/src/translations.ts +2 -15
  85. package/src/types/WnfsCapabilities.ts +18 -0
  86. package/src/types/index.ts +1 -3
  87. package/dist/lib/browser/FileContainer-TFENLFD5.mjs +0 -72
  88. package/dist/lib/browser/FileContainer-TFENLFD5.mjs.map +0 -7
  89. package/dist/lib/browser/blockstore-TUV5YIC5.mjs.map +0 -7
  90. package/dist/lib/browser/chunk-3I3QQNA3.mjs +0 -84
  91. package/dist/lib/browser/chunk-3I3QQNA3.mjs.map +0 -7
  92. package/dist/lib/browser/chunk-A7ETWNGC.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-CXWUR7YI.mjs +0 -8
  94. package/dist/lib/browser/chunk-CXWUR7YI.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-HXGK35WW.mjs +0 -65
  96. package/dist/lib/browser/chunk-HXGK35WW.mjs.map +0 -7
  97. package/dist/lib/browser/chunk-QE7ZSOYG.mjs +0 -69
  98. package/dist/lib/browser/chunk-QE7ZSOYG.mjs.map +0 -7
  99. package/dist/lib/browser/create-WQ6CUUDN.mjs +0 -24
  100. package/dist/lib/browser/create-WQ6CUUDN.mjs.map +0 -7
  101. package/dist/lib/browser/create-file-NGKX6CFL.mjs +0 -49
  102. package/dist/lib/browser/create-file-NGKX6CFL.mjs.map +0 -7
  103. package/dist/lib/browser/file-uploader-THECEDM2.mjs +0 -37
  104. package/dist/lib/browser/file-uploader-THECEDM2.mjs.map +0 -7
  105. package/dist/lib/browser/index.mjs +0 -124
  106. package/dist/lib/browser/index.mjs.map +0 -7
  107. package/dist/lib/browser/markdown-IEDBXCLX.mjs +0 -201
  108. package/dist/lib/browser/markdown-IEDBXCLX.mjs.map +0 -7
  109. package/dist/lib/browser/meta.json +0 -1
  110. package/dist/lib/browser/operation-handler-YAYDKG7R.mjs +0 -16
  111. package/dist/lib/browser/operation-handler-YAYDKG7R.mjs.map +0 -7
  112. package/dist/lib/browser/operations/index.mjs +0 -12
  113. package/dist/lib/browser/react-surface-UGRUPU56.mjs +0 -60
  114. package/dist/lib/browser/react-surface-UGRUPU56.mjs.map +0 -7
  115. package/dist/lib/browser/types/index.mjs +0 -11
  116. package/dist/lib/browser/upload-42ZL2AE4.mjs +0 -42
  117. package/dist/lib/browser/upload-42ZL2AE4.mjs.map +0 -7
  118. package/dist/types/src/capabilities/blockstore/blockstore.d.ts.map +0 -1
  119. package/dist/types/src/capabilities/blockstore/index.d.ts +0 -3
  120. package/dist/types/src/capabilities/blockstore/index.d.ts.map +0 -1
  121. package/dist/types/src/capabilities/file-uploader/file-uploader.d.ts +0 -6
  122. package/dist/types/src/capabilities/file-uploader/file-uploader.d.ts.map +0 -1
  123. package/dist/types/src/capabilities/file-uploader/index.d.ts +0 -3
  124. package/dist/types/src/capabilities/file-uploader/index.d.ts.map +0 -1
  125. package/dist/types/src/capabilities/markdown/index.d.ts +0 -3
  126. package/dist/types/src/capabilities/markdown/index.d.ts.map +0 -1
  127. package/dist/types/src/capabilities/markdown/markdown.d.ts +0 -5
  128. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +0 -1
  129. package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -4
  130. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
  131. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +0 -6
  132. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +0 -1
  133. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  134. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  135. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  136. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  137. package/dist/types/src/components/FileInput/FileInput.d.ts +0 -8
  138. package/dist/types/src/components/FileInput/FileInput.d.ts.map +0 -1
  139. package/dist/types/src/components/FileInput/index.d.ts +0 -2
  140. package/dist/types/src/components/FileInput/index.d.ts.map +0 -1
  141. package/dist/types/src/components/FilePreview/FilePreview.d.ts +0 -16
  142. package/dist/types/src/components/FilePreview/FilePreview.d.ts.map +0 -1
  143. package/dist/types/src/components/FilePreview/index.d.ts +0 -2
  144. package/dist/types/src/components/FilePreview/index.d.ts.map +0 -1
  145. package/dist/types/src/components/index.d.ts +0 -3
  146. package/dist/types/src/components/index.d.ts.map +0 -1
  147. package/dist/types/src/containers/FileContainer/FileContainer.d.ts +0 -7
  148. package/dist/types/src/containers/FileContainer/FileContainer.d.ts.map +0 -1
  149. package/dist/types/src/containers/FileContainer/index.d.ts +0 -3
  150. package/dist/types/src/containers/FileContainer/index.d.ts.map +0 -1
  151. package/dist/types/src/containers/index.d.ts +0 -3
  152. package/dist/types/src/containers/index.d.ts.map +0 -1
  153. package/dist/types/src/extensions/image.d.ts +0 -14
  154. package/dist/types/src/extensions/image.d.ts.map +0 -1
  155. package/dist/types/src/extensions/image.stories.d.ts +0 -11
  156. package/dist/types/src/extensions/image.stories.d.ts.map +0 -1
  157. package/dist/types/src/extensions/index.d.ts +0 -2
  158. package/dist/types/src/extensions/index.d.ts.map +0 -1
  159. package/dist/types/src/operations/create-file.d.ts +0 -5
  160. package/dist/types/src/operations/create-file.d.ts.map +0 -1
  161. package/dist/types/src/operations/create.d.ts +0 -5
  162. package/dist/types/src/operations/create.d.ts.map +0 -1
  163. package/dist/types/src/operations/definitions.d.ts +0 -38
  164. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  165. package/dist/types/src/operations/index.d.ts +0 -4
  166. package/dist/types/src/operations/index.d.ts.map +0 -1
  167. package/dist/types/src/operations/upload.d.ts +0 -5
  168. package/dist/types/src/operations/upload.d.ts.map +0 -1
  169. package/dist/types/src/types/File.d.ts +0 -16
  170. package/dist/types/src/types/File.d.ts.map +0 -1
  171. package/dist/types/src/types/capabilities.d.ts +0 -13
  172. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  173. package/dist/types/src/types/types.d.ts +0 -9
  174. package/dist/types/src/types/types.d.ts.map +0 -1
  175. package/src/capabilities/blockstore/index.ts +0 -7
  176. package/src/capabilities/file-uploader/file-uploader.ts +0 -34
  177. package/src/capabilities/file-uploader/index.ts +0 -7
  178. package/src/capabilities/markdown/index.ts +0 -7
  179. package/src/capabilities/markdown/markdown.ts +0 -33
  180. package/src/capabilities/operation-handler/index.ts +0 -11
  181. package/src/capabilities/operation-handler/operation-handler.ts +0 -16
  182. package/src/capabilities/react-surface/index.ts +0 -7
  183. package/src/capabilities/react-surface/react-surface.tsx +0 -51
  184. package/src/components/FileInput/FileInput.tsx +0 -47
  185. package/src/components/FileInput/index.ts +0 -5
  186. package/src/components/FilePreview/FilePreview.tsx +0 -43
  187. package/src/components/FilePreview/index.ts +0 -5
  188. package/src/components/index.ts +0 -6
  189. package/src/containers/FileContainer/FileContainer.tsx +0 -56
  190. package/src/containers/FileContainer/index.ts +0 -7
  191. package/src/containers/index.ts +0 -7
  192. package/src/extensions/image.stories.tsx +0 -104
  193. package/src/extensions/image.tsx +0 -203
  194. package/src/extensions/index.ts +0 -5
  195. package/src/operations/create-file.ts +0 -32
  196. package/src/operations/create.ts +0 -23
  197. package/src/operations/definitions.ts +0 -40
  198. package/src/operations/index.ts +0 -13
  199. package/src/operations/upload.ts +0 -30
  200. package/src/types/File.ts +0 -28
  201. package/src/types/capabilities.ts +0 -18
  202. package/src/types/types.ts +0 -24
  203. /package/dist/lib/{browser/operations/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  204. /package/dist/lib/{browser/types → neutral/helpers}/index.mjs.map +0 -0
  205. /package/dist/types/src/capabilities/{blockstore/blockstore.d.ts → blockstore.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-wnfs",
3
- "version": "0.8.4-main.7996785055",
3
+ "version": "0.8.4-main.8baae0fced",
4
4
  "description": "WNFS file management plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -8,37 +8,81 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/dxos/dxos"
10
10
  },
11
- "license": "MIT",
11
+ "license": "FSL-1.1-Apache-2.0",
12
12
  "author": "DXOS.org",
13
+ "sideEffects": true,
13
14
  "type": "module",
14
- "exports": {
15
- ".": {
16
- "source": "./src/index.ts",
17
- "browser": "./dist/lib/browser/index.mjs",
18
- "types": "./dist/types/src/index.d.ts"
15
+ "imports": {
16
+ "#capabilities": {
17
+ "source": "./src/capabilities/index.ts",
18
+ "types": "./dist/types/src/capabilities/index.d.ts",
19
+ "default": "./dist/lib/neutral/capabilities/index.mjs"
20
+ },
21
+ "#components": {
22
+ "source": "./src/components/index.ts",
23
+ "types": "./dist/types/src/components/index.d.ts",
24
+ "default": "./dist/lib/neutral/components/index.mjs"
19
25
  },
20
- "./operations": {
26
+ "#containers": {
27
+ "source": "./src/containers/index.ts",
28
+ "types": "./dist/types/src/containers/index.d.ts",
29
+ "default": "./dist/lib/neutral/containers/index.mjs"
30
+ },
31
+ "#helpers": {
32
+ "source": "./src/helpers/index.ts",
33
+ "types": "./dist/types/src/helpers/index.d.ts",
34
+ "default": "./dist/lib/neutral/helpers/index.mjs"
35
+ },
36
+ "#meta": {
37
+ "source": "./src/meta.ts",
38
+ "types": "./dist/types/src/meta.d.ts",
39
+ "default": "./dist/lib/neutral/meta.mjs"
40
+ },
41
+ "#operations": {
21
42
  "source": "./src/operations/index.ts",
22
- "browser": "./dist/lib/browser/operations/index.mjs",
23
- "types": "./dist/types/src/operations/index.d.ts"
43
+ "types": "./dist/types/src/operations/index.d.ts",
44
+ "default": "./dist/lib/neutral/operations/index.mjs"
45
+ },
46
+ "#plugin": {
47
+ "source": {
48
+ "workerd": "./src/WnfsPlugin.workerd.ts",
49
+ "node": "./src/WnfsPlugin.node.ts",
50
+ "default": "./src/WnfsPlugin.tsx"
51
+ },
52
+ "types": "./dist/types/src/WnfsPlugin.d.ts",
53
+ "workerd": "./dist/lib/neutral/WnfsPlugin.workerd.mjs",
54
+ "node": "./dist/lib/neutral/WnfsPlugin.node.mjs",
55
+ "default": "./dist/lib/neutral/WnfsPlugin.mjs"
24
56
  },
25
- "./types": {
57
+ "#translations": {
58
+ "source": "./src/translations.ts",
59
+ "types": "./dist/types/src/translations.d.ts",
60
+ "default": "./dist/lib/neutral/translations.mjs"
61
+ },
62
+ "#types": {
26
63
  "source": "./src/types/index.ts",
27
- "browser": "./dist/lib/browser/types/index.mjs",
28
- "types": "./dist/types/src/types/index.d.ts"
64
+ "types": "./dist/types/src/types/index.d.ts",
65
+ "default": "./dist/lib/neutral/types/index.mjs"
29
66
  }
30
67
  },
31
- "types": "dist/types/src/index.d.ts",
32
- "typesVersions": {
33
- "*": {
34
- "types": [
35
- "dist/types/src/types/index.d.ts"
36
- ],
37
- "operations": [
38
- "dist/types/src/operations/index.d.ts"
39
- ]
68
+ "exports": {
69
+ ".": {
70
+ "source": "./src/index.ts",
71
+ "types": "./dist/types/src/index.d.ts",
72
+ "default": "./dist/lib/neutral/index.mjs"
73
+ },
74
+ "./plugin": {
75
+ "source": "./src/plugin.ts",
76
+ "types": "./dist/types/src/plugin.d.ts",
77
+ "default": "./dist/lib/neutral/plugin.mjs"
78
+ },
79
+ "./translations": {
80
+ "source": "./src/translations.ts",
81
+ "types": "./dist/types/src/translations.d.ts",
82
+ "default": "./dist/lib/neutral/translations.mjs"
40
83
  }
41
84
  },
85
+ "types": "dist/types/src/index.d.ts",
42
86
  "files": [
43
87
  "dist",
44
88
  "src"
@@ -46,7 +90,7 @@
46
90
  "dependencies": {
47
91
  "@codemirror/language": "^6.11.3",
48
92
  "@codemirror/state": "^6.5.2",
49
- "@codemirror/view": "^6.38.4",
93
+ "@codemirror/view": "^6.38.5",
50
94
  "@ipld/car": "^5.3.3",
51
95
  "blockstore-core": "^5.0.1",
52
96
  "blockstore-idb": "^2.0.0",
@@ -59,43 +103,46 @@
59
103
  "react-dropzone": "^14.2.3",
60
104
  "uint8arrays": "^5.1.0",
61
105
  "wnfs": "0.2.2",
62
- "@dxos/crypto": "0.8.4-main.7996785055",
63
- "@dxos/app-toolkit": "0.8.4-main.7996785055",
64
- "@dxos/app-framework": "0.8.4-main.7996785055",
65
- "@dxos/echo": "0.8.4-main.7996785055",
66
- "@dxos/effect": "0.8.4-main.7996785055",
67
- "@dxos/log": "0.8.4-main.7996785055",
68
- "@dxos/invariant": "0.8.4-main.7996785055",
69
- "@dxos/operation": "0.8.4-main.7996785055",
70
- "@dxos/plugin-space": "0.8.4-main.7996785055",
71
- "@dxos/plugin-client": "0.8.4-main.7996785055",
72
- "@dxos/react-client": "0.8.4-main.7996785055",
73
- "@dxos/react-ui-editor": "0.8.4-main.7996785055",
74
- "@dxos/react-ui": "0.8.4-main.7996785055",
75
- "@dxos/react-ui-form": "0.8.4-main.7996785055",
76
- "@dxos/schema": "0.8.4-main.7996785055",
77
- "@dxos/react-ui-stack": "0.8.4-main.7996785055",
78
- "@dxos/react-ui-mosaic": "0.8.4-main.7996785055",
79
- "@dxos/plugin-markdown": "0.8.4-main.7996785055",
80
- "@dxos/ui-editor": "0.8.4-main.7996785055",
81
- "@dxos/util": "0.8.4-main.7996785055"
106
+ "@dxos/app-framework": "0.8.4-main.8baae0fced",
107
+ "@dxos/compute": "0.8.4-main.8baae0fced",
108
+ "@dxos/app-toolkit": "0.8.4-main.8baae0fced",
109
+ "@dxos/effect": "0.8.4-main.8baae0fced",
110
+ "@dxos/echo": "0.8.4-main.8baae0fced",
111
+ "@dxos/invariant": "0.8.4-main.8baae0fced",
112
+ "@dxos/keys": "0.8.4-main.8baae0fced",
113
+ "@dxos/log": "0.8.4-main.8baae0fced",
114
+ "@dxos/plugin-client": "0.8.4-main.8baae0fced",
115
+ "@dxos/plugin-file": "0.8.4-main.8baae0fced",
116
+ "@dxos/plugin-space": "0.8.4-main.8baae0fced",
117
+ "@dxos/react-client": "0.8.4-main.8baae0fced",
118
+ "@dxos/crypto": "0.8.4-main.8baae0fced",
119
+ "@dxos/react-ui": "0.8.4-main.8baae0fced",
120
+ "@dxos/react-ui-editor": "0.8.4-main.8baae0fced",
121
+ "@dxos/react-ui-mosaic": "0.8.4-main.8baae0fced",
122
+ "@dxos/react-ui-stack": "0.8.4-main.8baae0fced",
123
+ "@dxos/types": "0.8.4-main.8baae0fced",
124
+ "@dxos/schema": "0.8.4-main.8baae0fced",
125
+ "@dxos/react-ui-form": "0.8.4-main.8baae0fced",
126
+ "@dxos/util": "0.8.4-main.8baae0fced",
127
+ "@dxos/ui-editor": "0.8.4-main.8baae0fced"
82
128
  },
83
129
  "devDependencies": {
84
130
  "@types/react": "~19.2.7",
85
131
  "@types/react-dom": "~19.2.3",
86
132
  "react": "~19.2.3",
87
133
  "react-dom": "~19.2.3",
88
- "vite": "^7.1.11",
89
- "@dxos/random": "0.8.4-main.7996785055",
90
- "@dxos/storybook-utils": "0.8.4-main.7996785055",
91
- "@dxos/ui-theme": "0.8.4-main.7996785055"
134
+ "vite": "^8.0.13",
135
+ "@dxos/plugin-testing": "0.8.4-main.8baae0fced",
136
+ "@dxos/storybook-utils": "0.8.4-main.8baae0fced",
137
+ "@dxos/random": "0.8.4-main.8baae0fced",
138
+ "@dxos/ui-theme": "0.8.4-main.8baae0fced"
92
139
  },
93
140
  "peerDependencies": {
94
141
  "effect": "3.20.0",
95
142
  "react": "~19.2.3",
96
143
  "react-dom": "~19.2.3",
97
- "@dxos/react-ui": "0.8.4-main.7996785055",
98
- "@dxos/ui-theme": "0.8.4-main.7996785055"
144
+ "@dxos/react-ui": "0.8.4-main.8baae0fced",
145
+ "@dxos/ui-theme": "0.8.4-main.8baae0fced"
99
146
  },
100
147
  "publishConfig": {
101
148
  "access": "public"
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from '#meta';
8
+
9
+ export const WnfsPlugin = Plugin.define(meta).pipe(Plugin.make);
10
+
11
+ export default WnfsPlugin;
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { describe, test } from 'vitest';
6
+
7
+ import { ClientPlugin } from '@dxos/plugin-client/plugin';
8
+ import { createComposerTestApp } from '@dxos/plugin-testing/harness';
9
+
10
+ import { WnfsPlugin } from '#plugin';
11
+
12
+ describe('WnfsPlugin', () => {
13
+ test('activates without errors', async ({ expect }) => {
14
+ await using harness = await createComposerTestApp({
15
+ plugins: [ClientPlugin({}), WnfsPlugin()],
16
+ });
17
+
18
+ expect(harness.manager.getActive()).toBeInstanceOf(Array);
19
+ });
20
+ });
@@ -3,48 +3,17 @@
3
3
  //
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
- import * as Option from 'effect/Option';
7
6
 
8
7
  import { Capability, Plugin } from '@dxos/app-framework';
9
8
  import { AppPlugin } from '@dxos/app-toolkit';
10
- import { Annotation } from '@dxos/echo';
11
- import { Operation } from '@dxos/operation';
12
9
  import { ClientEvents } from '@dxos/plugin-client';
13
- import { MarkdownEvents } from '@dxos/plugin-markdown';
14
- import { type CreateObject } from '@dxos/plugin-space/types';
15
- import { SpaceOperation } from '@dxos/plugin-space/operations';
16
10
 
17
- import { Blockstore, FileUploader, Markdown, OperationHandler, ReactSurface } from './capabilities';
18
- import { meta } from './meta';
19
- import { translations } from './translations';
20
- import { WnfsAction, WnfsCapabilities, WnfsFile } from './types';
21
- import { WnfsOperation } from './operations';
11
+ import { Backend, Blockstore, UrlResolver } from '#capabilities';
12
+ import { meta } from '#meta';
13
+ import { translations } from '#translations';
14
+ import { WnfsCapabilities } from '#types';
22
15
 
23
16
  export const WnfsPlugin = Plugin.define(meta).pipe(
24
- AppPlugin.addMetadataModule({
25
- metadata: {
26
- id: WnfsFile.File.typename,
27
- metadata: {
28
- // TODO(wittjosiah): Would be nice if icon could change based on the type of the file.
29
- icon: Annotation.IconAnnotation.get(WnfsFile.File).pipe(Option.getOrThrow).icon,
30
- iconHue: Annotation.IconAnnotation.get(WnfsFile.File).pipe(Option.getOrThrow).hue ?? 'white',
31
- inputSchema: WnfsAction.UploadFileSchema,
32
- createObject: ((props, options) =>
33
- Effect.gen(function* () {
34
- const { object } = yield* Operation.invoke(WnfsOperation.CreateFile, { ...props, db: options.db });
35
- return yield* Operation.invoke(SpaceOperation.AddObject, {
36
- object,
37
- target: options.target,
38
- hidden: true,
39
- targetNodeId: options.targetNodeId,
40
- });
41
- })) satisfies CreateObject,
42
- },
43
- },
44
- }),
45
- AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
46
- AppPlugin.addSchemaModule({ schema: [WnfsFile.File] }),
47
- AppPlugin.addSurfaceModule({ activate: ReactSurface }),
48
17
  AppPlugin.addTranslationsModule({ translations }),
49
18
  Plugin.addModule({
50
19
  id: 'blockstore',
@@ -61,14 +30,16 @@ export const WnfsPlugin = Plugin.define(meta).pipe(
61
30
  }),
62
31
  }),
63
32
  Plugin.addModule({
64
- id: 'file-uploader',
33
+ id: 'backend',
65
34
  activatesOn: ClientEvents.ClientReady,
66
- activate: FileUploader,
35
+ activate: Backend,
67
36
  }),
68
37
  Plugin.addModule({
69
- id: 'markdown',
70
- activatesOn: MarkdownEvents.SetupExtensions,
71
- activate: Markdown,
38
+ id: 'url-resolver',
39
+ activatesOn: ClientEvents.ClientReady,
40
+ activate: UrlResolver,
72
41
  }),
73
42
  Plugin.make,
74
43
  );
44
+
45
+ export default WnfsPlugin;
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from '#meta';
8
+
9
+ export const WnfsPlugin = Plugin.define(meta).pipe(Plugin.make);
10
+
11
+ export default WnfsPlugin;
@@ -0,0 +1,43 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { invariant } from '@dxos/invariant';
9
+ import { ClientCapabilities } from '@dxos/plugin-client';
10
+ import { FileCapabilities } from '@dxos/plugin-file/types';
11
+ import { File } from '@dxos/types';
12
+
13
+ import { WnfsCapabilities } from '#types';
14
+
15
+ import { upload } from '../helpers';
16
+
17
+ export const WNFS_BACKEND_ID = 'wnfs';
18
+
19
+ export default Capability.makeModule(
20
+ Effect.fnUntraced(function* () {
21
+ const capabilities = yield* Capability.Service;
22
+
23
+ return Capability.contributes(FileCapabilities.Backend, {
24
+ id: WNFS_BACKEND_ID,
25
+ name: 'WNFS',
26
+ description: 'Decentralized, end-to-end encrypted storage via Web Native File System.',
27
+ upload: async (file, db) => {
28
+ const client = capabilities.get(ClientCapabilities.Client);
29
+ const blockstore = capabilities.get(WnfsCapabilities.Blockstore);
30
+ const instances = capabilities.get(WnfsCapabilities.Instances);
31
+ const space = client.spaces.get(db.spaceId);
32
+ invariant(space, 'Space not found');
33
+ const info = await upload({ file, blockstore, instances, space });
34
+ return {
35
+ name: info.name,
36
+ type: info.type,
37
+ size: file.size,
38
+ data: File.externalData(info.url, info.cid),
39
+ };
40
+ },
41
+ });
42
+ }),
43
+ );
@@ -7,8 +7,9 @@ import * as Effect from 'effect/Effect';
7
7
  import { Capability } from '@dxos/app-framework';
8
8
  import { ClientCapabilities } from '@dxos/plugin-client';
9
9
 
10
- import * as Blockstore from '../../blockstore';
11
- import { WnfsCapabilities } from '../../types';
10
+ import { WnfsCapabilities } from '#types';
11
+
12
+ import * as Blockstore from '../blockstore';
12
13
 
13
14
  export default Capability.makeModule(
14
15
  Effect.fnUntraced(function* () {
@@ -2,8 +2,17 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './blockstore';
6
- export * from './file-uploader';
7
- export * from './markdown';
8
- export * from './operation-handler';
9
- export * from './react-surface';
5
+ import { Capability } from '@dxos/app-framework';
6
+ import { type FileCapabilities } from '@dxos/plugin-file/types';
7
+
8
+ export const Backend: Capability.LazyCapability<
9
+ void,
10
+ Capability.Capability<Capability.InterfaceDef<FileCapabilities.Backend>>
11
+ > = Capability.lazy('Backend', () => import('./backend'));
12
+
13
+ export const Blockstore = Capability.lazy('Blockstore', () => import('./blockstore'));
14
+
15
+ export const UrlResolver: Capability.LazyCapability<
16
+ void,
17
+ Capability.Capability<Capability.InterfaceDef<FileCapabilities.UrlResolver>>
18
+ > = Capability.lazy('UrlResolver', () => import('./url-resolver'));
@@ -0,0 +1,44 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { FileCapabilities } from '@dxos/plugin-file/types';
9
+
10
+ import { WnfsCapabilities } from '#types';
11
+
12
+ import { getBlobUrl, loadWnfs } from '../helpers';
13
+
14
+ export const WNFS_URL_RESOLVER_ID = 'wnfs';
15
+
16
+ export default Capability.makeModule(
17
+ Effect.fnUntraced(function* () {
18
+ const capabilities = yield* Capability.Service;
19
+
20
+ return Capability.contributes(FileCapabilities.UrlResolver, {
21
+ id: WNFS_URL_RESOLVER_ID,
22
+ test: (url) => url.startsWith('wnfs://'),
23
+ resolve: async (wnfsUrl, file, space) => {
24
+ if (!space) {
25
+ return undefined;
26
+ }
27
+ try {
28
+ const blockstore = capabilities.get(WnfsCapabilities.Blockstore);
29
+ const instances = capabilities.get(WnfsCapabilities.Instances);
30
+ const { directory, forest } = await loadWnfs({ blockstore, instances, space });
31
+ return await getBlobUrl({
32
+ wnfsUrl,
33
+ blockstore,
34
+ directory,
35
+ forest,
36
+ type: file.type,
37
+ });
38
+ } catch {
39
+ return undefined;
40
+ }
41
+ },
42
+ });
43
+ }),
44
+ );
@@ -10,7 +10,7 @@ import { AccessKey, PrivateDirectory, PrivateForest, PrivateNode } from 'wnfs';
10
10
  import { Obj } from '@dxos/echo';
11
11
  import { type Space } from '@dxos/react-client/echo';
12
12
 
13
- import { type WnfsCapabilities } from '../types';
13
+ import { type WnfsCapabilities } from '#types';
14
14
 
15
15
  import { Rng, store } from './common';
16
16
 
@@ -30,7 +30,7 @@ export const loadWnfs = async ({
30
30
  // TODO(wittjosiah): Remove.
31
31
  // Delete old properties if they exist.
32
32
  if (space.properties.wnfs_access_key !== undefined && space.properties.wnfs_private_forest_cid !== undefined) {
33
- Obj.change(space.properties, (obj) => {
33
+ Obj.update(space.properties, (obj) => {
34
34
  delete obj['wnfs_access_key'];
35
35
  delete obj['wnfs_private_forest_cid'];
36
36
  });
@@ -68,7 +68,7 @@ const createWnfsDir = async (blockstore: Blockstore, space: Space) => {
68
68
 
69
69
  const cidBytes = await newForest.store(wnfsStore);
70
70
 
71
- Obj.change(space.properties, (obj) => {
71
+ Obj.update(space.properties, (obj) => {
72
72
  obj.wnfs = {
73
73
  accessKey: Uint8Arrays.toString(accessKeyRaw.toBytes(), 'base64'),
74
74
  privateForestCid: CID.decode(cidBytes).toString(),
@@ -11,7 +11,7 @@ import type { Space } from '@dxos/client/echo';
11
11
  import { Obj } from '@dxos/echo';
12
12
  import { log } from '@dxos/log';
13
13
 
14
- import { type WnfsCapabilities } from '../types';
14
+ import { type WnfsCapabilities } from '#types';
15
15
 
16
16
  import { Rng, filePath, store } from './common';
17
17
  import { loadWnfs } from './load';
@@ -47,7 +47,7 @@ export const upload = async ({
47
47
  const cidBytes = await updatedForest.store(wnfsStore);
48
48
 
49
49
  // Update the forest pointer on the associated space.
50
- Obj.change(space.properties, (obj) => {
50
+ Obj.update(space.properties, (obj) => {
51
51
  obj.wnfs.privateForestCid = CID.decode(cidBytes).toString();
52
52
  });
53
53
 
package/src/index.ts CHANGED
@@ -2,6 +2,6 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export { WnfsCapabilities } from './types';
5
+ export * from './helpers';
6
6
  export * from './meta';
7
- export * from './WnfsPlugin';
7
+ export * from './types';
package/src/meta.ts CHANGED
@@ -3,11 +3,13 @@
3
3
  //
4
4
 
5
5
  import { type Plugin } from '@dxos/app-framework';
6
+ import { meta as fileMeta } from '@dxos/plugin-file';
6
7
  import { trim } from '@dxos/util';
7
8
 
8
9
  export const meta: Plugin.Meta = {
9
10
  id: 'org.dxos.plugin.wnfs',
10
11
  name: 'WNFS',
12
+ author: 'DXOS',
11
13
  description: trim`
12
14
  Decentralized file storage using the Web Native File System protocol.
13
15
  Store and sync files with end-to-end encryption across devices without central servers.
@@ -15,4 +17,6 @@ export const meta: Plugin.Meta = {
15
17
  icon: 'ph--file-cloud--regular',
16
18
  iconHue: 'teal',
17
19
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-wnfs',
20
+ tags: ['labs'],
21
+ dependsOn: [fileMeta.id],
18
22
  };
package/src/plugin.ts ADDED
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const WnfsPlugin = Plugin.lazy(meta, () => import('#plugin'));
@@ -4,26 +4,13 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
8
- import { WnfsFile } from './types';
7
+ import { meta } from '#meta';
9
8
 
10
9
  export const translations = [
11
10
  {
12
11
  'en-US': {
13
- [WnfsFile.File.typename]: {
14
- 'typename label': 'File',
15
- 'typename label_zero': 'Files',
16
- 'typename label_one': 'File',
17
- 'typename label_other': 'Files',
18
- 'object name placeholder': 'New file',
19
- 'add object label': 'Add file',
20
- 'rename object label': 'Rename file',
21
- 'delete object label': 'Delete file',
22
- 'object deleted label': 'File deleted',
23
- },
24
12
  [meta.id]: {
25
- 'plugin name': 'Files',
26
- 'file input placeholder': 'Drop a file here, or click to select a file',
13
+ 'plugin.name': 'WNFS',
27
14
  },
28
15
  },
29
16
  },
@@ -0,0 +1,18 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import { type Blockstore as BlockstoreInterface } from 'interface-blockstore';
8
+ import { type PrivateDirectory, type PrivateForest } from 'wnfs';
9
+
10
+ import { Capability } from '@dxos/app-framework';
11
+ import { type SpaceId } from '@dxos/keys';
12
+
13
+ import { meta } from '#meta';
14
+
15
+ export const Blockstore = Capability.make<BlockstoreInterface>(`${meta.id}.capability.blockstore`);
16
+
17
+ export type Instances = Record<SpaceId, { directory: PrivateDirectory; forest: PrivateForest }>;
18
+ export const Instances = Capability.make<Instances>(`${meta.id}.capability.instances`);
@@ -2,6 +2,4 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export * from './capabilities';
6
- export * as WnfsFile from './File';
7
- export * from './types';
5
+ export * as WnfsCapabilities from './WnfsCapabilities';
@@ -1,72 +0,0 @@
1
- import {
2
- FilePreview
3
- } from "./chunk-HXGK35WW.mjs";
4
- import {
5
- filePath,
6
- getBlobUrl,
7
- loadWnfs,
8
- wnfsUrl
9
- } from "./chunk-A7ETWNGC.mjs";
10
- import {
11
- WnfsCapabilities
12
- } from "./chunk-3I3QQNA3.mjs";
13
-
14
- // src/containers/FileContainer/FileContainer.tsx
15
- import React, { useState } from "react";
16
- import { useCapability } from "@dxos/app-framework/ui";
17
- import { invariant } from "@dxos/invariant";
18
- import { getSpace } from "@dxos/react-client/echo";
19
- import { Panel, useAsyncEffect } from "@dxos/react-ui";
20
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-wnfs/src/containers/FileContainer/FileContainer.tsx";
21
- var FileContainer = ({ role, subject: file }) => {
22
- const blockstore = useCapability(WnfsCapabilities.Blockstore);
23
- const instances = useCapability(WnfsCapabilities.Instances);
24
- const [blobUrl, setBlobUrl] = useState();
25
- useAsyncEffect(async () => {
26
- const space = getSpace(file);
27
- invariant(space, void 0, {
28
- F: __dxlog_file,
29
- L: 26,
30
- S: void 0,
31
- A: [
32
- "space",
33
- ""
34
- ]
35
- });
36
- const { directory, forest } = await loadWnfs({
37
- blockstore,
38
- instances,
39
- space
40
- });
41
- const path = filePath(file.cid.toString(), space);
42
- const url = await getBlobUrl({
43
- wnfsUrl: wnfsUrl(path),
44
- blockstore,
45
- directory,
46
- forest,
47
- type: file.type
48
- });
49
- setBlobUrl(url);
50
- }, [
51
- file
52
- ]);
53
- if (!blobUrl) {
54
- return null;
55
- }
56
- return /* @__PURE__ */ React.createElement(Panel.Root, {
57
- role,
58
- className: "dx-document"
59
- }, /* @__PURE__ */ React.createElement(Panel.Content, {
60
- asChild: true
61
- }, /* @__PURE__ */ React.createElement(FilePreview, {
62
- type: file.type,
63
- url: blobUrl
64
- })));
65
- };
66
-
67
- // src/containers/FileContainer/index.ts
68
- var FileContainer_default = FileContainer;
69
- export {
70
- FileContainer_default as default
71
- };
72
- //# sourceMappingURL=FileContainer-TFENLFD5.mjs.map