@dxos/plugin-wnfs 0.8.4-main.ae835ea → 0.8.4-main.bc2380dfbc
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/LICENSE +102 -5
- package/README.md +2 -2
- package/dist/lib/neutral/FileArticle-B3NF2VKL.mjs +58 -0
- package/dist/lib/neutral/FileArticle-B3NF2VKL.mjs.map +7 -0
- package/dist/lib/neutral/WnfsPlugin.mjs +50 -0
- package/dist/lib/neutral/WnfsPlugin.mjs.map +7 -0
- package/dist/lib/neutral/WnfsPlugin.node.mjs +23 -0
- package/dist/lib/neutral/WnfsPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/WnfsPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/WnfsPlugin.workerd.mjs.map +7 -0
- package/dist/lib/{browser/blockstore-2JFU4NBU.mjs → neutral/blockstore-3NLSWC7Z.mjs} +12 -13
- package/dist/lib/neutral/blockstore-3NLSWC7Z.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +19 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-D6VTEQIE.mjs → neutral/chunk-7KFJ6LYH.mjs} +43 -18
- package/dist/lib/neutral/chunk-7KFJ6LYH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{browser/chunk-OGPGLJCV.mjs → neutral/chunk-LHUHUCBD.mjs} +2 -9
- package/dist/lib/neutral/chunk-LHUHUCBD.mjs.map +7 -0
- package/dist/lib/neutral/chunk-UIZBWELF.mjs +8 -0
- package/dist/lib/neutral/chunk-UIZBWELF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-VWVCHTUK.mjs +125 -0
- package/dist/lib/neutral/chunk-VWVCHTUK.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +63 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-4ERE5CA4.mjs +23 -0
- package/dist/lib/neutral/create-4ERE5CA4.mjs.map +7 -0
- package/dist/lib/neutral/create-file-RAHDIJVU.mjs +40 -0
- package/dist/lib/neutral/create-file-RAHDIJVU.mjs.map +7 -0
- package/dist/lib/neutral/create-object-7PJC47BB.mjs +33 -0
- package/dist/lib/neutral/create-object-7PJC47BB.mjs.map +7 -0
- package/dist/lib/neutral/file-uploader-WOF3H3FN.mjs +34 -0
- package/dist/lib/neutral/file-uploader-WOF3H3FN.mjs.map +7 -0
- package/dist/lib/neutral/helpers/index.mjs +26 -0
- package/dist/lib/neutral/helpers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +40 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/{browser/markdown-3ZLVJIGT.mjs → neutral/markdown-I4FYAUCA.mjs} +23 -17
- package/dist/lib/neutral/markdown-I4FYAUCA.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-NPYSIPMR.mjs +13 -0
- package/dist/lib/neutral/operation-handler-NPYSIPMR.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-6QHCDYC3.mjs +53 -0
- package/dist/lib/neutral/react-surface-6QHCDYC3.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +30 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +14 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/upload-VA5CSUEP.mjs +33 -0
- package/dist/lib/neutral/upload-VA5CSUEP.mjs.map +7 -0
- package/dist/types/src/WnfsPlugin.d.ts +3 -1
- package/dist/types/src/WnfsPlugin.d.ts.map +1 -1
- package/dist/types/src/WnfsPlugin.node.d.ts +4 -0
- package/dist/types/src/WnfsPlugin.node.d.ts.map +1 -0
- package/dist/types/src/WnfsPlugin.test.d.ts +2 -0
- package/dist/types/src/WnfsPlugin.test.d.ts.map +1 -0
- package/dist/types/src/WnfsPlugin.workerd.d.ts +4 -0
- package/dist/types/src/WnfsPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blockstore.d.ts.map +1 -1
- package/dist/types/src/capabilities/blockstore.d.ts +3 -2
- package/dist/types/src/capabilities/blockstore.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/file-uploader.d.ts +4 -2
- package/dist/types/src/capabilities/file-uploader.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +13 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +4 -2
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/FileInput/FileInput.d.ts.map +1 -0
- package/dist/types/src/components/FileInput/index.d.ts +2 -0
- package/dist/types/src/components/FileInput/index.d.ts.map +1 -0
- package/dist/types/src/components/FilePreview/FilePreview.d.ts +12 -0
- package/dist/types/src/components/FilePreview/FilePreview.d.ts.map +1 -0
- package/dist/types/src/components/FilePreview/index.d.ts +2 -0
- package/dist/types/src/components/FilePreview/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/FileArticle/FileArticle.d.ts +7 -0
- package/dist/types/src/containers/FileArticle/FileArticle.d.ts.map +1 -0
- package/dist/types/src/containers/FileArticle/index.d.ts +2 -0
- package/dist/types/src/containers/FileArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/extensions/image.d.ts +1 -1
- package/dist/types/src/extensions/image.d.ts.map +1 -1
- package/dist/types/src/extensions/image.stories.d.ts.map +1 -1
- package/dist/types/src/helpers/common.d.ts.map +1 -1
- package/dist/types/src/helpers/load.d.ts +1 -1
- package/dist/types/src/helpers/load.d.ts.map +1 -1
- package/dist/types/src/helpers/upload.d.ts +1 -1
- package/dist/types/src/helpers/upload.d.ts.map +1 -1
- package/dist/types/src/helpers/wnfs-url.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-file.d.ts +5 -0
- package/dist/types/src/operations/create-file.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/upload.d.ts +5 -0
- package/dist/types/src/operations/upload.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +24 -12
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/WnfsCapabilities.d.ts +11 -0
- package/dist/types/src/types/WnfsCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/WnfsFile.d.ts +16 -0
- package/dist/types/src/types/WnfsFile.d.ts.map +1 -0
- package/dist/types/src/types/WnfsOperation.d.ts +38 -0
- package/dist/types/src/types/WnfsOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +4 -50
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +106 -49
- package/src/WnfsPlugin.node.ts +19 -0
- package/src/WnfsPlugin.test.ts +27 -0
- package/src/WnfsPlugin.tsx +28 -73
- package/src/WnfsPlugin.workerd.ts +18 -0
- package/src/blockstore.ts +1 -1
- package/src/capabilities/blockstore.ts +14 -10
- package/src/capabilities/create-object.ts +33 -0
- package/src/capabilities/file-uploader.ts +24 -17
- package/src/capabilities/index.ts +11 -8
- package/src/capabilities/markdown.ts +24 -12
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +49 -34
- package/src/components/{FileInput.tsx → FileInput/FileInput.tsx} +6 -6
- package/src/components/FileInput/index.ts +5 -0
- package/src/components/FilePreview/FilePreview.tsx +43 -0
- package/src/components/FilePreview/index.ts +5 -0
- package/src/components/index.ts +1 -4
- package/src/containers/FileArticle/FileArticle.tsx +57 -0
- package/src/containers/FileArticle/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/extensions/image.stories.tsx +9 -10
- package/src/extensions/image.tsx +7 -6
- package/src/helpers/load.ts +12 -7
- package/src/helpers/upload.ts +5 -2
- package/src/index.ts +2 -2
- package/src/meta.ts +3 -3
- package/src/operations/create-file.ts +30 -0
- package/src/operations/create.ts +21 -0
- package/src/operations/index.ts +11 -0
- package/src/operations/upload.ts +28 -0
- package/src/plugin.ts +11 -0
- package/src/translations.ts +14 -10
- package/src/types/WnfsCapabilities.ts +18 -0
- package/src/types/WnfsFile.ts +30 -0
- package/src/types/WnfsOperation.ts +44 -0
- package/src/types/index.ts +4 -1
- package/src/types/types.ts +3 -20
- package/dist/lib/browser/FileContainer-4U23PNBL.mjs +0 -103
- package/dist/lib/browser/FileContainer-4U23PNBL.mjs.map +0 -7
- package/dist/lib/browser/blockstore-2JFU4NBU.mjs.map +0 -7
- package/dist/lib/browser/chunk-7MEFQJWE.mjs +0 -16
- package/dist/lib/browser/chunk-7MEFQJWE.mjs.map +0 -7
- package/dist/lib/browser/chunk-CWMKN2F6.mjs +0 -71
- package/dist/lib/browser/chunk-CWMKN2F6.mjs.map +0 -7
- package/dist/lib/browser/chunk-D6VTEQIE.mjs.map +0 -7
- package/dist/lib/browser/chunk-F4QHZWQD.mjs +0 -16
- package/dist/lib/browser/chunk-F4QHZWQD.mjs.map +0 -7
- package/dist/lib/browser/chunk-OGPGLJCV.mjs.map +0 -7
- package/dist/lib/browser/file-uploader-W6TJLAAK.mjs +0 -30
- package/dist/lib/browser/file-uploader-W6TJLAAK.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -116
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FSW2EQF4.mjs +0 -48
- package/dist/lib/browser/intent-resolver-FSW2EQF4.mjs.map +0 -7
- package/dist/lib/browser/markdown-3ZLVJIGT.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-SLRIZ3UR.mjs +0 -88
- package/dist/lib/browser/react-surface-SLRIZ3UR.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/types/src/capabilities/capabilities.d.ts +0 -12
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/FileContainer.d.ts +0 -9
- package/dist/types/src/components/FileContainer.d.ts.map +0 -1
- package/dist/types/src/components/FileInput.d.ts.map +0 -1
- package/dist/types/src/components/FilePreview.d.ts +0 -11
- package/dist/types/src/components/FilePreview.d.ts.map +0 -1
- package/dist/types/src/types/File.d.ts +0 -16
- package/dist/types/src/types/File.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -18
- package/src/capabilities/intent-resolver.ts +0 -32
- package/src/components/FileContainer.tsx +0 -49
- package/src/components/FilePreview.tsx +0 -23
- package/src/types/File.ts +0 -24
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/types/src/components/{FileInput.d.ts → FileInput/FileInput.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,32 +1,87 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-wnfs",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.bc2380dfbc",
|
|
4
4
|
"description": "WNFS file management plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
-
"
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"type": "module",
|
|
14
|
+
"imports": {
|
|
15
|
+
"#capabilities": {
|
|
16
|
+
"source": "./src/capabilities/index.ts",
|
|
17
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
18
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
19
|
+
},
|
|
20
|
+
"#components": {
|
|
21
|
+
"source": "./src/components/index.ts",
|
|
22
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
23
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
24
|
+
},
|
|
25
|
+
"#containers": {
|
|
26
|
+
"source": "./src/containers/index.ts",
|
|
27
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
28
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
29
|
+
},
|
|
30
|
+
"#helpers": {
|
|
31
|
+
"source": "./src/helpers/index.ts",
|
|
32
|
+
"types": "./dist/types/src/helpers/index.d.ts",
|
|
33
|
+
"default": "./dist/lib/neutral/helpers/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"#meta": {
|
|
36
|
+
"source": "./src/meta.ts",
|
|
37
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
38
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
39
|
+
},
|
|
40
|
+
"#operations": {
|
|
41
|
+
"source": "./src/operations/index.ts",
|
|
42
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
43
|
+
"default": "./dist/lib/neutral/operations/index.mjs"
|
|
44
|
+
},
|
|
45
|
+
"#plugin": {
|
|
46
|
+
"source": {
|
|
47
|
+
"workerd": "./src/WnfsPlugin.workerd.ts",
|
|
48
|
+
"node": "./src/WnfsPlugin.node.ts",
|
|
49
|
+
"default": "./src/WnfsPlugin.tsx"
|
|
50
|
+
},
|
|
51
|
+
"types": "./dist/types/src/WnfsPlugin.d.ts",
|
|
52
|
+
"workerd": "./dist/lib/neutral/WnfsPlugin.workerd.mjs",
|
|
53
|
+
"node": "./dist/lib/neutral/WnfsPlugin.node.mjs",
|
|
54
|
+
"default": "./dist/lib/neutral/WnfsPlugin.mjs"
|
|
55
|
+
},
|
|
56
|
+
"#translations": {
|
|
57
|
+
"source": "./src/translations.ts",
|
|
58
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
59
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
60
|
+
},
|
|
61
|
+
"#types": {
|
|
62
|
+
"source": "./src/types/index.ts",
|
|
63
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
64
|
+
"default": "./dist/lib/neutral/types/index.mjs"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
10
67
|
"exports": {
|
|
11
68
|
".": {
|
|
12
69
|
"source": "./src/index.ts",
|
|
13
70
|
"types": "./dist/types/src/index.d.ts",
|
|
14
|
-
"
|
|
71
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
15
72
|
},
|
|
16
|
-
"./
|
|
17
|
-
"source": "./src/
|
|
18
|
-
"types": "./dist/types/src/
|
|
19
|
-
"
|
|
73
|
+
"./plugin": {
|
|
74
|
+
"source": "./src/plugin.ts",
|
|
75
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
76
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
77
|
+
},
|
|
78
|
+
"./translations": {
|
|
79
|
+
"source": "./src/translations.ts",
|
|
80
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
81
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
20
82
|
}
|
|
21
83
|
},
|
|
22
84
|
"types": "dist/types/src/index.d.ts",
|
|
23
|
-
"typesVersions": {
|
|
24
|
-
"*": {
|
|
25
|
-
"types": [
|
|
26
|
-
"dist/types/src/types/index.d.ts"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
85
|
"files": [
|
|
31
86
|
"dist",
|
|
32
87
|
"src"
|
|
@@ -34,13 +89,12 @@
|
|
|
34
89
|
"dependencies": {
|
|
35
90
|
"@codemirror/language": "^6.11.3",
|
|
36
91
|
"@codemirror/state": "^6.5.2",
|
|
37
|
-
"@codemirror/view": "^6.38.
|
|
92
|
+
"@codemirror/view": "^6.38.5",
|
|
38
93
|
"@ipld/car": "^5.3.3",
|
|
39
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
40
94
|
"blockstore-core": "^5.0.1",
|
|
41
95
|
"blockstore-idb": "^2.0.0",
|
|
42
96
|
"debounce": "^2.2.0",
|
|
43
|
-
"effect": "3.
|
|
97
|
+
"effect": "3.20.0",
|
|
44
98
|
"idb-keyval": "^6.2.1",
|
|
45
99
|
"interface-blockstore": "^5.2.10",
|
|
46
100
|
"it-all": "^3.0.6",
|
|
@@ -48,41 +102,44 @@
|
|
|
48
102
|
"react-dropzone": "^14.2.3",
|
|
49
103
|
"uint8arrays": "^5.1.0",
|
|
50
104
|
"wnfs": "0.2.2",
|
|
51
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/echo": "0.8.4-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/react-
|
|
64
|
-
"@dxos/react-ui
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
105
|
+
"@dxos/app-framework": "0.8.4-main.bc2380dfbc",
|
|
106
|
+
"@dxos/app-toolkit": "0.8.4-main.bc2380dfbc",
|
|
107
|
+
"@dxos/echo": "0.8.4-main.bc2380dfbc",
|
|
108
|
+
"@dxos/invariant": "0.8.4-main.bc2380dfbc",
|
|
109
|
+
"@dxos/crypto": "0.8.4-main.bc2380dfbc",
|
|
110
|
+
"@dxos/effect": "0.8.4-main.bc2380dfbc",
|
|
111
|
+
"@dxos/compute": "0.8.4-main.bc2380dfbc",
|
|
112
|
+
"@dxos/keys": "0.8.4-main.bc2380dfbc",
|
|
113
|
+
"@dxos/log": "0.8.4-main.bc2380dfbc",
|
|
114
|
+
"@dxos/plugin-client": "0.8.4-main.bc2380dfbc",
|
|
115
|
+
"@dxos/plugin-markdown": "0.8.4-main.bc2380dfbc",
|
|
116
|
+
"@dxos/plugin-space": "0.8.4-main.bc2380dfbc",
|
|
117
|
+
"@dxos/react-client": "0.8.4-main.bc2380dfbc",
|
|
118
|
+
"@dxos/react-ui": "0.8.4-main.bc2380dfbc",
|
|
119
|
+
"@dxos/react-ui-editor": "0.8.4-main.bc2380dfbc",
|
|
120
|
+
"@dxos/react-ui-form": "0.8.4-main.bc2380dfbc",
|
|
121
|
+
"@dxos/schema": "0.8.4-main.bc2380dfbc",
|
|
122
|
+
"@dxos/react-ui-stack": "0.8.4-main.bc2380dfbc",
|
|
123
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.bc2380dfbc",
|
|
124
|
+
"@dxos/ui-editor": "0.8.4-main.bc2380dfbc",
|
|
125
|
+
"@dxos/util": "0.8.4-main.bc2380dfbc"
|
|
67
126
|
},
|
|
68
127
|
"devDependencies": {
|
|
69
|
-
"@types/react": "~19.2.
|
|
70
|
-
"@types/react-dom": "~19.2.
|
|
71
|
-
"react": "~19.2.
|
|
72
|
-
"react-dom": "~19.2.
|
|
73
|
-
"vite": "
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
128
|
+
"@types/react": "~19.2.7",
|
|
129
|
+
"@types/react-dom": "~19.2.3",
|
|
130
|
+
"react": "~19.2.3",
|
|
131
|
+
"react-dom": "~19.2.3",
|
|
132
|
+
"vite": "^8.0.13",
|
|
133
|
+
"@dxos/plugin-testing": "0.8.4-main.bc2380dfbc",
|
|
134
|
+
"@dxos/random": "0.8.4-main.bc2380dfbc",
|
|
135
|
+
"@dxos/storybook-utils": "0.8.4-main.bc2380dfbc",
|
|
136
|
+
"@dxos/ui-theme": "0.8.4-main.bc2380dfbc"
|
|
77
137
|
},
|
|
78
138
|
"peerDependencies": {
|
|
79
|
-
"effect": "
|
|
80
|
-
"react": "
|
|
81
|
-
"react-dom": "
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/react-ui
|
|
84
|
-
},
|
|
85
|
-
"publishConfig": {
|
|
86
|
-
"access": "public"
|
|
139
|
+
"effect": "3.20.0",
|
|
140
|
+
"react": "~19.2.3",
|
|
141
|
+
"react-dom": "~19.2.3",
|
|
142
|
+
"@dxos/ui-theme": "0.8.4-main.bc2380dfbc",
|
|
143
|
+
"@dxos/react-ui": "0.8.4-main.bc2380dfbc"
|
|
87
144
|
}
|
|
88
145
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { CreateObject, OperationHandler } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { WnfsFile } from '#types';
|
|
11
|
+
|
|
12
|
+
export const WnfsPlugin = Plugin.define(meta).pipe(
|
|
13
|
+
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
14
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
15
|
+
AppPlugin.addSchemaModule({ schema: [WnfsFile.WnfsFile] }),
|
|
16
|
+
Plugin.make,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default WnfsPlugin;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
import { meta } from './meta';
|
|
13
|
+
|
|
14
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
15
|
+
|
|
16
|
+
describe('WnfsPlugin', () => {
|
|
17
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
18
|
+
await using harness = await createComposerTestApp({
|
|
19
|
+
plugins: [ClientPlugin({}), WnfsPlugin()],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// After autoStart: CreateObject, schema, and OperationHandler all auto-cascade.
|
|
23
|
+
expect(harness.manager.getActive()).toEqual(
|
|
24
|
+
expect.arrayContaining([moduleId('CreateObject'), moduleId('schema'), moduleId('OperationHandler')]),
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
});
|
package/src/WnfsPlugin.tsx
CHANGED
|
@@ -2,94 +2,49 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
Events,
|
|
10
|
-
chain,
|
|
11
|
-
contributes,
|
|
12
|
-
createIntent,
|
|
13
|
-
defineModule,
|
|
14
|
-
definePlugin,
|
|
15
|
-
} from '@dxos/app-framework';
|
|
7
|
+
import { Capability, Plugin } from '@dxos/app-framework';
|
|
8
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
16
9
|
import { ClientEvents } from '@dxos/plugin-client';
|
|
17
10
|
import { MarkdownEvents } from '@dxos/plugin-markdown';
|
|
18
|
-
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
19
|
-
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
20
11
|
|
|
21
|
-
import { Blockstore,
|
|
22
|
-
import { meta } from '
|
|
23
|
-
import { translations } from '
|
|
24
|
-
import {
|
|
12
|
+
import { Blockstore, CreateObject, FileUploader, Markdown, OperationHandler, ReactSurface } from '#capabilities';
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
import { translations } from '#translations';
|
|
15
|
+
import { WnfsCapabilities, WnfsFile } from '#types';
|
|
25
16
|
|
|
26
|
-
export const WnfsPlugin =
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
export const WnfsPlugin = Plugin.define(meta).pipe(
|
|
18
|
+
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
19
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
20
|
+
AppPlugin.addSchemaModule({ schema: [WnfsFile.WnfsFile] }),
|
|
21
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
22
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
23
|
+
Plugin.addModule({
|
|
24
|
+
id: 'blockstore',
|
|
29
25
|
activatesOn: ClientEvents.ClientReady,
|
|
30
26
|
activate: Blockstore,
|
|
31
27
|
}),
|
|
32
|
-
|
|
33
|
-
id:
|
|
28
|
+
Plugin.addModule({
|
|
29
|
+
id: 'instances',
|
|
34
30
|
activatesOn: ClientEvents.ClientReady,
|
|
35
|
-
activate: () => {
|
|
36
|
-
const instances: WnfsCapabilities.Instances = {};
|
|
37
|
-
return contributes(WnfsCapabilities.Instances, instances);
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
defineModule({
|
|
41
|
-
id: `${meta.id}/module/translations`,
|
|
42
|
-
activatesOn: Events.SetupTranslations,
|
|
43
|
-
activate: () => contributes(Capabilities.Translations, translations),
|
|
44
|
-
}),
|
|
45
|
-
defineModule({
|
|
46
|
-
id: `${meta.id}/module/metadata`,
|
|
47
|
-
activatesOn: Events.SetupMetadata,
|
|
48
31
|
activate: () =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// TODO(wittjosiah): Would be nice if icon could change based on the type of the file.
|
|
53
|
-
icon: 'ph--file--regular',
|
|
54
|
-
iconHue: 'teal',
|
|
55
|
-
},
|
|
32
|
+
Effect.sync(() => {
|
|
33
|
+
const instances: WnfsCapabilities.Instances = {};
|
|
34
|
+
return Capability.contributes(WnfsCapabilities.Instances, instances);
|
|
56
35
|
}),
|
|
57
36
|
}),
|
|
58
|
-
|
|
59
|
-
id:
|
|
60
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
61
|
-
activate: () =>
|
|
62
|
-
contributes(
|
|
63
|
-
SpaceCapabilities.ObjectForm,
|
|
64
|
-
defineObjectForm({
|
|
65
|
-
objectSchema: WnfsFile.File,
|
|
66
|
-
formSchema: WnfsAction.UploadFileSchema,
|
|
67
|
-
getIntent: (props, options) =>
|
|
68
|
-
Function.pipe(
|
|
69
|
-
createIntent(WnfsAction.Upload, { ...props, space: options.space }),
|
|
70
|
-
chain(WnfsAction.Create, {}),
|
|
71
|
-
),
|
|
72
|
-
}),
|
|
73
|
-
),
|
|
74
|
-
}),
|
|
75
|
-
defineModule({
|
|
76
|
-
id: `${meta.id}/module/file-uploader`,
|
|
37
|
+
Plugin.addModule({
|
|
38
|
+
id: 'file-uploader',
|
|
77
39
|
activatesOn: ClientEvents.ClientReady,
|
|
78
40
|
activate: FileUploader,
|
|
79
41
|
}),
|
|
80
|
-
|
|
81
|
-
id:
|
|
42
|
+
Plugin.addModule({
|
|
43
|
+
id: 'markdown',
|
|
82
44
|
activatesOn: MarkdownEvents.SetupExtensions,
|
|
83
45
|
activate: Markdown,
|
|
84
46
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}),
|
|
90
|
-
defineModule({
|
|
91
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
92
|
-
activatesOn: Events.SetupIntentResolver,
|
|
93
|
-
activate: IntentResolver,
|
|
94
|
-
}),
|
|
95
|
-
]);
|
|
47
|
+
Plugin.make,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export default WnfsPlugin;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
|
|
8
|
+
import { OperationHandler } from '#capabilities';
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
import { WnfsFile } from '#types';
|
|
11
|
+
|
|
12
|
+
export const WnfsPlugin = Plugin.define(meta).pipe(
|
|
13
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
14
|
+
AppPlugin.addSchemaModule({ schema: [WnfsFile.WnfsFile] }),
|
|
15
|
+
Plugin.make,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export default WnfsPlugin;
|
package/src/blockstore.ts
CHANGED
|
@@ -145,7 +145,7 @@ export class MixedBlockstore extends BaseBlockstore {
|
|
|
145
145
|
|
|
146
146
|
// QUEUE
|
|
147
147
|
|
|
148
|
-
readonly queueCacheName = `${storeName()}
|
|
148
|
+
readonly queueCacheName = `${storeName()}.state.queue`;
|
|
149
149
|
|
|
150
150
|
async #addToQueue(key: CID): Promise<void> {
|
|
151
151
|
await this.#saveQueue([...this.#queue, key.toString()]);
|
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
8
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
9
|
|
|
8
|
-
import
|
|
10
|
+
import { WnfsCapabilities } from '#types';
|
|
9
11
|
|
|
10
|
-
import
|
|
12
|
+
import * as Blockstore from '../blockstore';
|
|
11
13
|
|
|
12
|
-
export default
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
17
|
+
const apiHost = client.config.values.runtime?.services?.edge?.url || 'http://localhost:8787';
|
|
18
|
+
const blockstore = Blockstore.create(apiHost);
|
|
19
|
+
yield* Effect.tryPromise(() => blockstore.open());
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
}
|
|
21
|
+
return Capability.contributes(WnfsCapabilities.Blockstore, blockstore);
|
|
22
|
+
}),
|
|
23
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
10
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
11
|
+
|
|
12
|
+
import { WnfsOperation } from '#types';
|
|
13
|
+
import { WnfsAction, WnfsFile } from '#types';
|
|
14
|
+
|
|
15
|
+
export default Capability.makeModule(
|
|
16
|
+
Effect.fnUntraced(function* () {
|
|
17
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
18
|
+
id: WnfsFile.WnfsFile.typename,
|
|
19
|
+
inputSchema: WnfsAction.UploadFileSchema,
|
|
20
|
+
// TODO(wittjosiah): Would be nice if icon could change based on the type of the file.
|
|
21
|
+
createObject: (props, options) =>
|
|
22
|
+
Effect.gen(function* () {
|
|
23
|
+
const { object } = yield* Operation.invoke(WnfsOperation.CreateFile, { ...props, db: options.db });
|
|
24
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
25
|
+
object,
|
|
26
|
+
target: options.target,
|
|
27
|
+
hidden: true,
|
|
28
|
+
targetNodeId: options.targetNodeId,
|
|
29
|
+
});
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
@@ -3,25 +3,32 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
|
-
import * as Function from 'effect/Function';
|
|
7
6
|
|
|
8
|
-
import { Capabilities,
|
|
9
|
-
import {
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
10
11
|
|
|
11
|
-
import {
|
|
12
|
+
import { WnfsOperation } from '#types';
|
|
12
13
|
|
|
13
|
-
export default (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const fileInfo = yield* dispatch(createIntent(WnfsAction.Upload, { space, file }));
|
|
18
|
-
yield* dispatch(
|
|
19
|
-
Function.pipe(createIntent(WnfsAction.Create, fileInfo), chain(SpaceAction.AddObject, { target: space })),
|
|
20
|
-
);
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
// Get context for lazy capability access in callbacks.
|
|
17
|
+
const capabilities = yield* Capability.Service;
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
return Capability.contributes(AppCapabilities.FileUploader, (db, file) => {
|
|
20
|
+
const { invoke } = capabilities.get(Capabilities.OperationInvoker);
|
|
21
|
+
const program = Effect.gen(function* () {
|
|
22
|
+
const fileInfo = yield* invoke(WnfsOperation.Upload, { db, file });
|
|
23
|
+
const createResult = yield* invoke(WnfsOperation.Create, fileInfo);
|
|
24
|
+
if (createResult?.object) {
|
|
25
|
+
yield* invoke(SpaceOperation.AddObject, { target: db, object: createResult.object });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return fileInfo;
|
|
29
|
+
});
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
31
|
+
return runAndForwardErrors(program);
|
|
32
|
+
});
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
7
|
|
|
7
|
-
export const Blockstore = lazy(() => import('./blockstore'));
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const Markdown = lazy(() => import('./markdown'));
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
export const Blockstore = Capability.lazy('Blockstore', () => import('./blockstore'));
|
|
9
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
10
|
+
export const FileUploader = Capability.lazy('FileUploader', () => import('./file-uploader'));
|
|
11
|
+
export const Markdown = Capability.lazy('Markdown', () => import('./markdown'));
|
|
12
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
'OperationHandler',
|
|
14
|
+
() => import('./operation-handler'),
|
|
15
|
+
);
|
|
16
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -2,25 +2,37 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { type MarkdownExtensionProvider, MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
7
9
|
import { getSpace } from '@dxos/react-client/echo';
|
|
8
10
|
|
|
11
|
+
import { WnfsCapabilities } from '#types';
|
|
12
|
+
|
|
9
13
|
import { image } from '../extensions';
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
export default Capability.makeModule(
|
|
16
|
+
Effect.fnUntraced(function* () {
|
|
17
|
+
// Get context for lazy capability access in callbacks.
|
|
18
|
+
const capabilities = yield* Capability.Service;
|
|
12
19
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
const provider: MarkdownExtensionProvider = ({ document, viewMode }) => {
|
|
21
|
+
if (viewMode === 'source') {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const blockstore = capabilities.get(WnfsCapabilities.Blockstore);
|
|
26
|
+
const instances = capabilities.get(WnfsCapabilities.Instances);
|
|
18
27
|
|
|
19
28
|
if (document) {
|
|
20
29
|
const space = getSpace(document);
|
|
21
|
-
return space ? [image({ blockstore, instances, space })] :
|
|
30
|
+
return space ? [image({ blockstore, instances, space })] : undefined;
|
|
22
31
|
}
|
|
23
32
|
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
|
|
33
|
+
return undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return Capability.contributes(MarkdownCapabilities.Extensions, [provider]);
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/compute';
|
|
9
|
+
|
|
10
|
+
import { WnfsOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, WnfsOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|