@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.
- package/LICENSE +102 -5
- package/README.md +2 -2
- package/dist/lib/neutral/WnfsPlugin.mjs +39 -0
- package/dist/lib/neutral/WnfsPlugin.mjs.map +7 -0
- package/dist/lib/neutral/WnfsPlugin.node.mjs +12 -0
- package/dist/lib/neutral/WnfsPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/WnfsPlugin.workerd.mjs +12 -0
- package/dist/lib/neutral/WnfsPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/backend-DHBQUTPC.mjs +47 -0
- package/dist/lib/neutral/backend-DHBQUTPC.mjs.map +7 -0
- package/dist/lib/{browser/blockstore-TUV5YIC5.mjs → neutral/blockstore-3NLSWC7Z.mjs} +6 -7
- package/dist/lib/neutral/blockstore-3NLSWC7Z.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +13 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-A7ETWNGC.mjs → neutral/chunk-7KFJ6LYH.mjs} +32 -17
- package/dist/lib/neutral/chunk-7KFJ6LYH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-EKFVDDRY.mjs +26 -0
- package/dist/lib/neutral/chunk-EKFVDDRY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-QODCKFTY.mjs +19 -0
- package/dist/lib/neutral/chunk-QODCKFTY.mjs.map +7 -0
- package/dist/lib/neutral/helpers/index.mjs +26 -0
- package/dist/lib/neutral/index.mjs +34 -0
- package/dist/lib/neutral/index.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/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +17 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +8 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/lib/neutral/url-resolver-UD3ZP77Y.mjs +47 -0
- package/dist/lib/neutral/url-resolver-UD3ZP77Y.mjs.map +7 -0
- package/dist/types/src/WnfsPlugin.d.ts +1 -0
- 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/backend.d.ts +7 -0
- package/dist/types/src/capabilities/backend.d.ts.map +1 -0
- package/dist/types/src/capabilities/blockstore.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-resolver.d.ts +7 -0
- package/dist/types/src/capabilities/url-resolver.d.ts.map +1 -0
- 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.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -16
- 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/index.d.ts +1 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +96 -49
- package/src/WnfsPlugin.node.ts +11 -0
- package/src/WnfsPlugin.test.ts +20 -0
- package/src/WnfsPlugin.tsx +11 -40
- package/src/WnfsPlugin.workerd.ts +11 -0
- package/src/capabilities/backend.ts +43 -0
- package/src/capabilities/{blockstore/blockstore.ts → blockstore.ts} +3 -2
- package/src/capabilities/index.ts +14 -5
- package/src/capabilities/url-resolver.ts +44 -0
- package/src/helpers/load.ts +3 -3
- package/src/helpers/upload.ts +2 -2
- package/src/index.ts +2 -2
- package/src/meta.ts +4 -0
- package/src/plugin.ts +9 -0
- package/src/translations.ts +2 -15
- package/src/types/WnfsCapabilities.ts +18 -0
- package/src/types/index.ts +1 -3
- package/dist/lib/browser/FileContainer-TFENLFD5.mjs +0 -72
- package/dist/lib/browser/FileContainer-TFENLFD5.mjs.map +0 -7
- package/dist/lib/browser/blockstore-TUV5YIC5.mjs.map +0 -7
- package/dist/lib/browser/chunk-3I3QQNA3.mjs +0 -84
- package/dist/lib/browser/chunk-3I3QQNA3.mjs.map +0 -7
- package/dist/lib/browser/chunk-A7ETWNGC.mjs.map +0 -7
- package/dist/lib/browser/chunk-CXWUR7YI.mjs +0 -8
- package/dist/lib/browser/chunk-CXWUR7YI.mjs.map +0 -7
- package/dist/lib/browser/chunk-HXGK35WW.mjs +0 -65
- package/dist/lib/browser/chunk-HXGK35WW.mjs.map +0 -7
- package/dist/lib/browser/chunk-QE7ZSOYG.mjs +0 -69
- package/dist/lib/browser/chunk-QE7ZSOYG.mjs.map +0 -7
- package/dist/lib/browser/create-WQ6CUUDN.mjs +0 -24
- package/dist/lib/browser/create-WQ6CUUDN.mjs.map +0 -7
- package/dist/lib/browser/create-file-NGKX6CFL.mjs +0 -49
- package/dist/lib/browser/create-file-NGKX6CFL.mjs.map +0 -7
- package/dist/lib/browser/file-uploader-THECEDM2.mjs +0 -37
- package/dist/lib/browser/file-uploader-THECEDM2.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -124
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/markdown-IEDBXCLX.mjs +0 -201
- package/dist/lib/browser/markdown-IEDBXCLX.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-handler-YAYDKG7R.mjs +0 -16
- package/dist/lib/browser/operation-handler-YAYDKG7R.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -12
- package/dist/lib/browser/react-surface-UGRUPU56.mjs +0 -60
- package/dist/lib/browser/react-surface-UGRUPU56.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -11
- package/dist/lib/browser/upload-42ZL2AE4.mjs +0 -42
- package/dist/lib/browser/upload-42ZL2AE4.mjs.map +0 -7
- package/dist/types/src/capabilities/blockstore/blockstore.d.ts.map +0 -1
- package/dist/types/src/capabilities/blockstore/index.d.ts +0 -3
- package/dist/types/src/capabilities/blockstore/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/file-uploader/file-uploader.d.ts +0 -6
- package/dist/types/src/capabilities/file-uploader/file-uploader.d.ts.map +0 -1
- package/dist/types/src/capabilities/file-uploader/index.d.ts +0 -3
- package/dist/types/src/capabilities/file-uploader/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown/index.d.ts +0 -3
- package/dist/types/src/capabilities/markdown/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/markdown/markdown.d.ts +0 -5
- package/dist/types/src/capabilities/markdown/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -4
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +0 -6
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/FileInput/FileInput.d.ts +0 -8
- package/dist/types/src/components/FileInput/FileInput.d.ts.map +0 -1
- package/dist/types/src/components/FileInput/index.d.ts +0 -2
- package/dist/types/src/components/FileInput/index.d.ts.map +0 -1
- package/dist/types/src/components/FilePreview/FilePreview.d.ts +0 -16
- package/dist/types/src/components/FilePreview/FilePreview.d.ts.map +0 -1
- package/dist/types/src/components/FilePreview/index.d.ts +0 -2
- package/dist/types/src/components/FilePreview/index.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -3
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/dist/types/src/containers/FileContainer/FileContainer.d.ts +0 -7
- package/dist/types/src/containers/FileContainer/FileContainer.d.ts.map +0 -1
- package/dist/types/src/containers/FileContainer/index.d.ts +0 -3
- package/dist/types/src/containers/FileContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/index.d.ts +0 -3
- package/dist/types/src/containers/index.d.ts.map +0 -1
- package/dist/types/src/extensions/image.d.ts +0 -14
- package/dist/types/src/extensions/image.d.ts.map +0 -1
- package/dist/types/src/extensions/image.stories.d.ts +0 -11
- package/dist/types/src/extensions/image.stories.d.ts.map +0 -1
- package/dist/types/src/extensions/index.d.ts +0 -2
- package/dist/types/src/extensions/index.d.ts.map +0 -1
- package/dist/types/src/operations/create-file.d.ts +0 -5
- package/dist/types/src/operations/create-file.d.ts.map +0 -1
- package/dist/types/src/operations/create.d.ts +0 -5
- package/dist/types/src/operations/create.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts +0 -38
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/operations/index.d.ts +0 -4
- package/dist/types/src/operations/index.d.ts.map +0 -1
- package/dist/types/src/operations/upload.d.ts +0 -5
- package/dist/types/src/operations/upload.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/dist/types/src/types/capabilities.d.ts +0 -13
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -9
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/blockstore/index.ts +0 -7
- package/src/capabilities/file-uploader/file-uploader.ts +0 -34
- package/src/capabilities/file-uploader/index.ts +0 -7
- package/src/capabilities/markdown/index.ts +0 -7
- package/src/capabilities/markdown/markdown.ts +0 -33
- package/src/capabilities/operation-handler/index.ts +0 -11
- package/src/capabilities/operation-handler/operation-handler.ts +0 -16
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -51
- package/src/components/FileInput/FileInput.tsx +0 -47
- package/src/components/FileInput/index.ts +0 -5
- package/src/components/FilePreview/FilePreview.tsx +0 -43
- package/src/components/FilePreview/index.ts +0 -5
- package/src/components/index.ts +0 -6
- package/src/containers/FileContainer/FileContainer.tsx +0 -56
- package/src/containers/FileContainer/index.ts +0 -7
- package/src/containers/index.ts +0 -7
- package/src/extensions/image.stories.tsx +0 -104
- package/src/extensions/image.tsx +0 -203
- package/src/extensions/index.ts +0 -5
- package/src/operations/create-file.ts +0 -32
- package/src/operations/create.ts +0 -23
- package/src/operations/definitions.ts +0 -40
- package/src/operations/index.ts +0 -13
- package/src/operations/upload.ts +0 -30
- package/src/types/File.ts +0 -28
- package/src/types/capabilities.ts +0 -18
- package/src/types/types.ts +0 -24
- /package/dist/lib/{browser/operations/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/helpers}/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{blockstore/blockstore.d.ts → blockstore.d.ts} +0 -0
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
upload
|
|
3
|
-
} from "./chunk-A7ETWNGC.mjs";
|
|
4
|
-
import {
|
|
5
|
-
Upload
|
|
6
|
-
} from "./chunk-QE7ZSOYG.mjs";
|
|
7
|
-
import {
|
|
8
|
-
WnfsCapabilities
|
|
9
|
-
} from "./chunk-3I3QQNA3.mjs";
|
|
10
|
-
|
|
11
|
-
// src/operations/upload.ts
|
|
12
|
-
import * as Effect from "effect/Effect";
|
|
13
|
-
import { Capability } from "@dxos/app-framework";
|
|
14
|
-
import { invariant } from "@dxos/invariant";
|
|
15
|
-
import { Operation } from "@dxos/operation";
|
|
16
|
-
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
17
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-wnfs/src/operations/upload.ts";
|
|
18
|
-
var handler = Upload.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ file, db }) {
|
|
19
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
20
|
-
const blockstore = yield* Capability.get(WnfsCapabilities.Blockstore);
|
|
21
|
-
const space = client.spaces.get(db.spaceId);
|
|
22
|
-
invariant(space, "Space not found", {
|
|
23
|
-
F: __dxlog_file,
|
|
24
|
-
L: 23,
|
|
25
|
-
S: this,
|
|
26
|
-
A: [
|
|
27
|
-
"space",
|
|
28
|
-
"'Space not found'"
|
|
29
|
-
]
|
|
30
|
-
});
|
|
31
|
-
const info = yield* Effect.promise(() => upload({
|
|
32
|
-
file,
|
|
33
|
-
blockstore,
|
|
34
|
-
space
|
|
35
|
-
}));
|
|
36
|
-
return info;
|
|
37
|
-
})));
|
|
38
|
-
var upload_default = handler;
|
|
39
|
-
export {
|
|
40
|
-
upload_default as default
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=upload-42ZL2AE4.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/upload.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { upload } from '../helpers';\nimport { WnfsCapabilities } from '../types';\n\nimport { Upload } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Upload> = Upload.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ file, db }) {\n const client = yield* Capability.get(ClientCapabilities.Client);\n const blockstore = yield* Capability.get(WnfsCapabilities.Blockstore);\n const space = client.spaces.get(db.spaceId);\n invariant(space, 'Space not found');\n const info = yield* Effect.promise(() => upload({ file, blockstore, space }));\n return info;\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,0BAA0B;;AAOnC,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,MAAMC,GAAE,GAAE;AACvC,QAAMC,SAAS,OAAOC,WAAWC,IAAIC,mBAAmBC,MAAM;AAC9D,QAAMC,aAAa,OAAOJ,WAAWC,IAAII,iBAAiBC,UAAU;AACpE,QAAMC,QAAQR,OAAOS,OAAOP,IAAIH,GAAGW,OAAO;AAC1CC,YAAUH,OAAO,mBAAA;;;;;;;;;AACjB,QAAMI,OAAO,OAAcC,eAAQ,MAAMC,OAAO;IAAEhB;IAAMO;IAAYG;EAAM,CAAA,CAAA;AAC1E,SAAOI;AACT,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAepB;",
|
|
6
|
-
"names": ["Effect", "Capability", "invariant", "Operation", "ClientCapabilities", "handler", "Upload", "pipe", "Operation", "withHandler", "fnUntraced", "file", "db", "client", "Capability", "get", "ClientCapabilities", "Client", "blockstore", "WnfsCapabilities", "Blockstore", "space", "spaces", "spaceId", "invariant", "info", "promise", "upload"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blockstore.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/blockstore/blockstore.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAMjD,wBASE"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
export declare const Blockstore: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("interface-blockstore").Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>>>, Error>;
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/blockstore/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,UAAU,mKAA8D,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
4
|
-
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<AppCapabilities.FileUploader>>, never, Capability.Service>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=file-uploader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-uploader.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/file-uploader/file-uploader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;;AAMpD,wBAoBE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/file-uploader/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,kJAAmE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/markdown/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,QAAQ,qJAA0D,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<import("@dxos/plugin-markdown").MarkdownExtensionProvider[]>>, never, Capability.Service>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/markdown/markdown.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAOjD,wBAmBE"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
import { OperationHandlerSet } from '@dxos/operation';
|
|
3
|
-
export declare const OperationHandler: Capability.LazyCapability<OperationHandlerSet.OperationHandlerSet, Capability.ModuleReturn, Error>;
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-handler/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,oGAG5B,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
import type { OperationHandlerSet } from '@dxos/operation';
|
|
4
|
-
declare const _default: (props: OperationHandlerSet.OperationHandlerSet) => Effect.Effect<Capability.ModuleReturn, Error, Capability.Service>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=operation-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation-handler.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-handler/operation-handler.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;;AAI3D,wBAIE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,YAAY,iJAAmE,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as Effect from 'effect/Effect';
|
|
2
|
-
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Capabilities.ReactSurface>>, never, never>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=react-surface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/react-surface/react-surface.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAW/D,wBA+BE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type * as Schema from 'effect/Schema';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export type FileInputProps = {
|
|
4
|
-
schema: Schema.Schema.Any;
|
|
5
|
-
onChange: (file: File) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare const FileInput: ({ schema, onChange }: FileInputProps) => React.JSX.Element;
|
|
8
|
-
//# sourceMappingURL=FileInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/FileInput/FileInput.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,sBAAsB,cAAc,sBA0B7D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/FileInput/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type FilePreviewProps = {
|
|
3
|
-
type: string;
|
|
4
|
-
url: string;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* File/content preview iframe.
|
|
8
|
-
*/
|
|
9
|
-
export declare const FilePreview: React.ForwardRefExoticComponent<Omit<FilePreviewProps, "className"> & {
|
|
10
|
-
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
11
|
-
} & {
|
|
12
|
-
className?: string;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
role?: string;
|
|
15
|
-
} & React.RefAttributes<HTMLElement>>;
|
|
16
|
-
//# sourceMappingURL=FilePreview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FilePreview.d.ts","sourceRoot":"","sources":["../../../../../src/components/FilePreview/FilePreview.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;qCA6BvB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/FilePreview/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
|
|
3
|
-
import { type WnfsFile } from '../../types';
|
|
4
|
-
export type FileContainerProps = SurfaceComponentProps<WnfsFile.File>;
|
|
5
|
-
export declare const FileContainer: ({ role, subject: file }: FileContainerProps) => React.JSX.Element | null;
|
|
6
|
-
export default FileContainer;
|
|
7
|
-
//# sourceMappingURL=FileContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileContainer.d.ts","sourceRoot":"","sources":["../../../../../src/containers/FileContainer/FileContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAOlE,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAEtE,eAAO,MAAM,aAAa,GAAI,yBAAyB,kBAAkB,6BAmCxE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/FileContainer/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/containers/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAQ,MAAM,OAAO,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,GAAG,CAAyC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Extension } from '@codemirror/state';
|
|
2
|
-
import type { Blockstore } from 'interface-blockstore';
|
|
3
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
4
|
-
import { type WnfsCapabilities } from '../types';
|
|
5
|
-
export type ImageOptions = {
|
|
6
|
-
blockstore: Blockstore;
|
|
7
|
-
instances: WnfsCapabilities.Instances;
|
|
8
|
-
space: Space;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Create WNFS image decorations.
|
|
12
|
-
*/
|
|
13
|
-
export declare const image: (options: ImageOptions) => Extension[];
|
|
14
|
-
//# sourceMappingURL=image.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/extensions/image.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,SAAS,EAA0B,MAAM,mBAAmB,CAAC;AAE7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAOrD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIjD,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,YAAY,KAAG,SAAS,EAgDtD,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
render: () => React.JSX.Element;
|
|
6
|
-
decorators: import("@storybook/react").Decorator[];
|
|
7
|
-
};
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj<typeof meta>;
|
|
10
|
-
export declare const Default: Story;
|
|
11
|
-
//# sourceMappingURL=image.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.stories.d.ts","sourceRoot":"","sources":["../../../../src/extensions/image.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAgD,MAAM,OAAO,CAAC;AAuFrE,QAAA,MAAM,IAAI;;;;CAI2B,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extensions/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-file.d.ts","sourceRoot":"","sources":["../../../../src/operations/create-file.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,UAAU,CAarD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/operations/create.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,MAAM,CAQjD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
import { Database } from '@dxos/echo';
|
|
3
|
-
import { Operation } from '@dxos/operation';
|
|
4
|
-
export declare const Create: Operation.Definition<{
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly type: string;
|
|
7
|
-
readonly cid: string;
|
|
8
|
-
}, {
|
|
9
|
-
readonly object: import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
10
|
-
readonly name?: string | undefined;
|
|
11
|
-
readonly type: string;
|
|
12
|
-
readonly cid: string;
|
|
13
|
-
readonly timestamp?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
}, Capability.Service>;
|
|
16
|
-
export declare const Upload: Operation.Definition<{
|
|
17
|
-
readonly file: File;
|
|
18
|
-
} & {
|
|
19
|
-
readonly db: Database.Database;
|
|
20
|
-
}, {
|
|
21
|
-
readonly name: string;
|
|
22
|
-
readonly type: string;
|
|
23
|
-
readonly cid: string;
|
|
24
|
-
readonly url: string;
|
|
25
|
-
}, Capability.Service>;
|
|
26
|
-
export declare const CreateFile: Operation.Definition<{
|
|
27
|
-
readonly file: File;
|
|
28
|
-
} & {
|
|
29
|
-
readonly db: Database.Database;
|
|
30
|
-
}, {
|
|
31
|
-
readonly object: import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
32
|
-
readonly name?: string | undefined;
|
|
33
|
-
readonly type: string;
|
|
34
|
-
readonly cid: string;
|
|
35
|
-
readonly timestamp?: string | undefined;
|
|
36
|
-
};
|
|
37
|
-
}, Capability.Service>;
|
|
38
|
-
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../../src/operations/definitions.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAO5C,eAAO,MAAM,MAAM;;;;;;;;;;;sBAOjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;sBAKjB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;sBAOrB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/operations/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,KAAK,aAAa,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,uBAAuB,yCAInC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/operations/upload.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM5C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,MAAM,CAWjD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as Schema from 'effect/Schema';
|
|
2
|
-
import { Obj, Type } from '@dxos/echo';
|
|
3
|
-
export declare const File: Type.Obj<{
|
|
4
|
-
readonly name?: string | undefined;
|
|
5
|
-
readonly type: string;
|
|
6
|
-
readonly cid: string;
|
|
7
|
-
readonly timestamp?: string | undefined;
|
|
8
|
-
}, Schema.Struct.Fields>;
|
|
9
|
-
export type File = Schema.Schema.Type<typeof File>;
|
|
10
|
-
export declare const make: (props: Obj.MakeProps<typeof File>) => Obj.OfShape<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
11
|
-
readonly name?: string | undefined;
|
|
12
|
-
readonly type: string;
|
|
13
|
-
readonly cid: string;
|
|
14
|
-
readonly timestamp?: string | undefined;
|
|
15
|
-
}>;
|
|
16
|
-
//# sourceMappingURL=File.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../../../src/types/File.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAc,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGnD,eAAO,MAAM,IAAI;;;;;wBAchB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnD,eAAO,MAAM,IAAI,GAAI,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC;;;;;EAA0B,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Blockstore } from 'interface-blockstore';
|
|
2
|
-
import { type PrivateDirectory, type PrivateForest } from 'wnfs';
|
|
3
|
-
import { Capability } from '@dxos/app-framework';
|
|
4
|
-
import { type SpaceId } from '@dxos/keys';
|
|
5
|
-
export declare namespace WnfsCapabilities {
|
|
6
|
-
const Blockstore: Capability.InterfaceDef<Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>>;
|
|
7
|
-
type Instances = Record<SpaceId, {
|
|
8
|
-
directory: PrivateDirectory;
|
|
9
|
-
forest: PrivateForest;
|
|
10
|
-
}>;
|
|
11
|
-
const Instances: Capability.InterfaceDef<Instances>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/types/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,MAAM,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,yBAAiB,gBAAgB,CAAC;IACzB,MAAM,UAAU,qEAAkE,CAAC;IAE1F,KAAY,SAAS,GAAG,MAAM,CAAC,OAAO,EAAE;QAAE,SAAS,EAAE,gBAAgB,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IACzF,MAAM,SAAS,oCAAgE,CAAC;CACxF"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as Schema from 'effect/Schema';
|
|
2
|
-
export declare namespace WnfsAction {
|
|
3
|
-
const UploadAnnotationId: unique symbol;
|
|
4
|
-
const UploadFileSchema: Schema.Struct<{
|
|
5
|
-
file: Schema.instanceOf<File>;
|
|
6
|
-
}>;
|
|
7
|
-
type UploadFileForm = Schema.Schema.Type<typeof UploadFileSchema>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,yBAAiB,UAAU,CAAC;IACnB,MAAM,kBAAkB,eAA6C,CAAC;IAEtE,MAAM,gBAAgB;;MAS3B,CAAC;IAEH,KAAY,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;CAC1E"}
|
|
@@ -1,34 +0,0 @@
|
|
|
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 { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
-
import { runAndForwardErrors } from '@dxos/effect';
|
|
10
|
-
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
11
|
-
|
|
12
|
-
import { WnfsOperation } from '../../operations';
|
|
13
|
-
|
|
14
|
-
export default Capability.makeModule(
|
|
15
|
-
Effect.fnUntraced(function* () {
|
|
16
|
-
// Get context for lazy capability access in callbacks.
|
|
17
|
-
const capabilities = yield* Capability.Service;
|
|
18
|
-
|
|
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
|
-
});
|
|
30
|
-
|
|
31
|
-
return runAndForwardErrors(program);
|
|
32
|
-
});
|
|
33
|
-
}),
|
|
34
|
-
);
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Effect from 'effect/Effect';
|
|
6
|
-
|
|
7
|
-
import { Capability } from '@dxos/app-framework';
|
|
8
|
-
import { MarkdownCapabilities } from '@dxos/plugin-markdown';
|
|
9
|
-
import { getSpace } from '@dxos/react-client/echo';
|
|
10
|
-
|
|
11
|
-
import { image } from '../../extensions';
|
|
12
|
-
import { WnfsCapabilities } from '../../types';
|
|
13
|
-
|
|
14
|
-
export default Capability.makeModule(
|
|
15
|
-
Effect.fnUntraced(function* () {
|
|
16
|
-
// Get context for lazy capability access in callbacks.
|
|
17
|
-
const capabilities = yield* Capability.Service;
|
|
18
|
-
|
|
19
|
-
return Capability.contributes(MarkdownCapabilities.Extensions, [
|
|
20
|
-
({ document }: { document?: any }) => {
|
|
21
|
-
const blockstore = capabilities.get(WnfsCapabilities.Blockstore);
|
|
22
|
-
const instances = capabilities.get(WnfsCapabilities.Instances);
|
|
23
|
-
|
|
24
|
-
if (document) {
|
|
25
|
-
const space = getSpace(document);
|
|
26
|
-
return space ? [image({ blockstore, instances, space })] : [];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return [];
|
|
30
|
-
},
|
|
31
|
-
]);
|
|
32
|
-
}),
|
|
33
|
-
);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capability } from '@dxos/app-framework';
|
|
6
|
-
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
-
|
|
8
|
-
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
9
|
-
'OperationHandler',
|
|
10
|
-
() => import('./operation-handler'),
|
|
11
|
-
);
|
|
@@ -1,16 +0,0 @@
|
|
|
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/operation';
|
|
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
|
-
);
|