@dxos/plugin-wnfs 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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/PLUGIN.mdl +371 -0
- package/README.md +2 -2
- package/dist/lib/neutral/WnfsPlugin.mjs +51 -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-4HPTHS33.mjs +47 -0
- package/dist/lib/neutral/backend-4HPTHS33.mjs.map +7 -0
- package/dist/lib/{browser/blockstore-Q66HQJ4Q.mjs → neutral/blockstore-U6SPNL2C.mjs} +7 -8
- package/dist/lib/neutral/blockstore-U6SPNL2C.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/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-KUQHRT52.mjs +39 -0
- package/dist/lib/neutral/chunk-KUQHRT52.mjs.map +7 -0
- package/dist/lib/{browser/chunk-UC4HMNZZ.mjs → neutral/chunk-L33MOD23.mjs} +80 -30
- package/dist/lib/neutral/chunk-L33MOD23.mjs.map +7 -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/helpers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +36 -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-BIRH7WHL.mjs +47 -0
- package/dist/lib/neutral/url-resolver-BIRH7WHL.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/annotations.d.ts +7 -0
- package/dist/types/src/annotations.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 +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +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 -15
- 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 +77 -48
- package/src/WnfsPlugin.node.ts +11 -0
- package/src/WnfsPlugin.test.ts +20 -0
- package/src/WnfsPlugin.tsx +16 -41
- package/src/WnfsPlugin.workerd.ts +11 -0
- package/src/annotations.ts +16 -0
- package/src/blockstore.ts +1 -1
- 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 +33 -19
- package/src/helpers/upload.ts +13 -4
- package/src/index.ts +3 -2
- package/src/meta.ts +22 -6
- package/src/plugin.ts +9 -0
- package/src/translations.ts +2 -14
- package/src/types/WnfsCapabilities.ts +18 -0
- package/src/types/index.ts +1 -3
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/FileContainer-EILNV5LV.mjs +0 -74
- package/dist/lib/browser/FileContainer-EILNV5LV.mjs.map +0 -7
- package/dist/lib/browser/blockstore-Q66HQJ4Q.mjs.map +0 -7
- package/dist/lib/browser/chunk-BXGCJRL2.mjs +0 -155
- package/dist/lib/browser/chunk-BXGCJRL2.mjs.map +0 -7
- package/dist/lib/browser/chunk-HXVPBJ3A.mjs +0 -56
- package/dist/lib/browser/chunk-HXVPBJ3A.mjs.map +0 -7
- package/dist/lib/browser/chunk-UC4HMNZZ.mjs.map +0 -7
- package/dist/lib/browser/file-uploader-QL4DTOMM.mjs +0 -35
- package/dist/lib/browser/file-uploader-QL4DTOMM.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -117
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/markdown-AYCVG6TJ.mjs +0 -201
- package/dist/lib/browser/markdown-AYCVG6TJ.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-YYWUF6EY.mjs +0 -99
- package/dist/lib/browser/operation-resolver-YYWUF6EY.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3LKVDPH7.mjs +0 -60
- package/dist/lib/browser/react-surface-3LKVDPH7.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -13
- 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-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.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.d.ts +0 -8
- 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/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/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 -112
- 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-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -62
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -51
- package/src/components/FileInput.tsx +0 -47
- package/src/components/FilePreview.tsx +0 -23
- package/src/components/index.ts +0 -6
- package/src/containers/FileContainer/FileContainer.tsx +0 -58
- 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/types/File.ts +0 -24
- package/src/types/capabilities.ts +0 -18
- package/src/types/types.ts +0 -81
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/types/src/capabilities/{blockstore/blockstore.d.ts → blockstore.d.ts} +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
FileInput
|
|
3
|
-
} from "./chunk-HXVPBJ3A.mjs";
|
|
4
|
-
import {
|
|
5
|
-
File_exports,
|
|
6
|
-
WnfsAction,
|
|
7
|
-
meta
|
|
8
|
-
} from "./chunk-BXGCJRL2.mjs";
|
|
9
|
-
|
|
10
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import React, { useCallback } from "react";
|
|
13
|
-
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
14
|
-
import { Surface } from "@dxos/app-framework/ui";
|
|
15
|
-
import { Obj } from "@dxos/echo";
|
|
16
|
-
import { findAnnotation } from "@dxos/effect";
|
|
17
|
-
|
|
18
|
-
// src/containers/index.ts
|
|
19
|
-
import { lazy } from "react";
|
|
20
|
-
var FileContainer = lazy(() => import("./FileContainer-EILNV5LV.mjs"));
|
|
21
|
-
|
|
22
|
-
// src/capabilities/react-surface/react-surface.tsx
|
|
23
|
-
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
24
|
-
Surface.create({
|
|
25
|
-
id: `${meta.id}/article`,
|
|
26
|
-
role: [
|
|
27
|
-
"article",
|
|
28
|
-
"section",
|
|
29
|
-
"slide"
|
|
30
|
-
],
|
|
31
|
-
filter: (data) => Obj.instanceOf(File_exports.File, data.subject),
|
|
32
|
-
component: ({ data, role }) => /* @__PURE__ */ React.createElement(FileContainer, {
|
|
33
|
-
role,
|
|
34
|
-
subject: data.subject
|
|
35
|
-
})
|
|
36
|
-
}),
|
|
37
|
-
Surface.create({
|
|
38
|
-
id: `${meta.id}/create-form`,
|
|
39
|
-
role: "form-input",
|
|
40
|
-
filter: (data) => {
|
|
41
|
-
const annotation = findAnnotation(data.schema.ast, WnfsAction.UploadAnnotationId);
|
|
42
|
-
return !!annotation;
|
|
43
|
-
},
|
|
44
|
-
component: ({ data: { schema }, ...props }) => {
|
|
45
|
-
const inputProps = props;
|
|
46
|
-
const handleChange = useCallback((file) => inputProps.onValueChange?.(inputProps.type, file), [
|
|
47
|
-
inputProps.type,
|
|
48
|
-
inputProps.onValueChange
|
|
49
|
-
]);
|
|
50
|
-
return /* @__PURE__ */ React.createElement(FileInput, {
|
|
51
|
-
schema,
|
|
52
|
-
onChange: handleChange
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
])));
|
|
57
|
-
export {
|
|
58
|
-
react_surface_default as default
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=react-surface-3LKVDPH7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/containers/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport type * as Schema from 'effect/Schema';\nimport React, { useCallback } from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { findAnnotation } from '@dxos/effect';\nimport { type FormFieldComponentProps } from '@dxos/react-ui-form';\n\nimport { FileInput } from '../../components';\nimport { FileContainer } from '../../containers';\nimport { meta } from '../../meta';\nimport { WnfsAction, WnfsFile } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: `${meta.id}/article`,\n role: ['article', 'section', 'slide'],\n filter: (data): data is { subject: WnfsFile.File } => Obj.instanceOf(WnfsFile.File, data.subject),\n component: ({ data, role }) => <FileContainer role={role} subject={data.subject} />,\n }),\n Surface.create({\n id: `${meta.id}/create-form`,\n role: 'form-input',\n filter: (data): data is { prop: string; schema: Schema.Schema.Any } => {\n const annotation = findAnnotation<boolean>(\n (data.schema as Schema.Schema.All).ast,\n WnfsAction.UploadAnnotationId,\n );\n return !!annotation;\n },\n component: ({ data: { schema }, ...props }) => {\n const inputProps = props as unknown as FormFieldComponentProps;\n const handleChange = useCallback(\n (file: File) => inputProps.onValueChange?.(inputProps.type, file),\n [inputProps.type, inputProps.onValueChange],\n );\n\n return <FileInput schema={schema} onChange={handleChange} />;\n },\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const FileContainer: ComponentType<any> = lazy(() => import('./FileContainer'));\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,OAAOC,SAASC,mBAAmB;AAEnC,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,WAAW;AACpB,SAASC,sBAAsB;;;ACP/B,SAA6BC,YAAY;AAElC,IAAMC,gBAAoCC,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ADanE,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;MAAC;MAAW;MAAW;;IAC7BC,QAAQ,CAACC,SAA6CC,IAAIC,WAAWC,aAASC,MAAMJ,KAAKK,OAAO;IAChGC,WAAW,CAAC,EAAEN,MAAMF,KAAI,MAAO,sBAAA,cAACS,eAAAA;MAAcT;MAAYO,SAASL,KAAKK;;EAC1E,CAAA;EACAX,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAAAA;AACP,YAAMQ,aAAaC,eAChBT,KAAKU,OAA6BC,KACnCC,WAAWC,kBAAkB;AAE/B,aAAO,CAAC,CAACL;IACX;IACAF,WAAW,CAAC,EAAEN,MAAM,EAAEU,OAAM,GAAI,GAAGI,MAAAA,MAAO;AACxC,YAAMC,aAAaD;AACnB,YAAME,eAAeC,YACnB,CAACC,SAAeH,WAAWI,gBAAgBJ,WAAWK,MAAMF,IAAAA,GAC5D;QAACH,WAAWK;QAAML,WAAWI;OAAc;AAG7C,aAAO,sBAAA,cAACE,WAAAA;QAAUX;QAAgBY,UAAUN;;IAC9C;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
-
"names": ["Effect", "React", "useCallback", "Capabilities", "Capability", "Surface", "Obj", "findAnnotation", "lazy", "FileContainer", "lazy", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "WnfsFile", "File", "subject", "component", "FileContainer", "annotation", "findAnnotation", "schema", "ast", "WnfsAction", "UploadAnnotationId", "props", "inputProps", "handleChange", "useCallback", "file", "onValueChange", "type", "FileInput", "onChange"]
|
|
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,3 +0,0 @@
|
|
|
1
|
-
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
export declare const OperationResolver: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Capabilities").OperationResolver[]>>, Error>;
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,wJAA6E,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.OperationResolver[]>>, never, never>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=operation-resolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation-resolver.d.ts","sourceRoot":"","sources":["../../../../../src/capabilities/operation-resolver/operation-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;AAU/D,wBA6CE"}
|
|
@@ -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.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,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
-
export type FilePreviewProps = ThemedClassName<{
|
|
4
|
-
type: string;
|
|
5
|
-
url: string;
|
|
6
|
-
}>;
|
|
7
|
-
/**
|
|
8
|
-
* File/content preview iframe.
|
|
9
|
-
*/
|
|
10
|
-
export declare const FilePreview: ({ type, url, classNames }: FilePreviewProps) => React.JSX.Element;
|
|
11
|
-
//# sourceMappingURL=FilePreview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FilePreview.d.ts","sourceRoot":"","sources":["../../../../src/components/FilePreview.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,2BAA2B,gBAAgB,sBAQtE,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,6BAqCxE,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,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,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,eAAO,MAAM,IAAI;;;;;wBAUhB,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,112 +0,0 @@
|
|
|
1
|
-
import * as Schema from 'effect/Schema';
|
|
2
|
-
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
import { Database } from '@dxos/echo';
|
|
4
|
-
export declare namespace WnfsAction {
|
|
5
|
-
const UploadAnnotationId: unique symbol;
|
|
6
|
-
const UploadFileSchema: Schema.Struct<{
|
|
7
|
-
file: Schema.instanceOf<any>;
|
|
8
|
-
}>;
|
|
9
|
-
type UploadFileForm = Schema.Schema.Type<typeof UploadFileSchema>;
|
|
10
|
-
}
|
|
11
|
-
export declare namespace WnfsOperation {
|
|
12
|
-
const OnCreateSpace: Omit<{
|
|
13
|
-
readonly meta: {
|
|
14
|
-
readonly key: `${string}/on-create-space`;
|
|
15
|
-
readonly name: "On Create Space";
|
|
16
|
-
};
|
|
17
|
-
readonly services: readonly [typeof Capability.Service];
|
|
18
|
-
readonly schema: {
|
|
19
|
-
readonly input: Schema.Struct<{
|
|
20
|
-
space: Schema.Schema<import("@dxos/client-protocol").Space, import("@dxos/client-protocol").Space, never>;
|
|
21
|
-
rootCollection: import("@dxos/echo/Type").Obj<{
|
|
22
|
-
readonly name?: string | undefined;
|
|
23
|
-
readonly objects: readonly import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>[];
|
|
24
|
-
}, Schema.Struct.Fields>;
|
|
25
|
-
isDefault: Schema.optional<typeof Schema.Boolean>;
|
|
26
|
-
}>;
|
|
27
|
-
readonly output: typeof Schema.Void;
|
|
28
|
-
};
|
|
29
|
-
}, "executionMode"> & import("effect/Pipeable").Pipeable & {
|
|
30
|
-
readonly executionMode: "sync" | "async";
|
|
31
|
-
};
|
|
32
|
-
const Create: Omit<{
|
|
33
|
-
readonly meta: {
|
|
34
|
-
readonly key: `${string}/create`;
|
|
35
|
-
readonly name: "Create WNFS File";
|
|
36
|
-
};
|
|
37
|
-
readonly services: readonly [typeof Capability.Service];
|
|
38
|
-
readonly schema: {
|
|
39
|
-
readonly input: Schema.SchemaClass<{
|
|
40
|
-
readonly name: string;
|
|
41
|
-
readonly type: string;
|
|
42
|
-
readonly cid: string;
|
|
43
|
-
}, {
|
|
44
|
-
readonly name: string;
|
|
45
|
-
readonly type: string;
|
|
46
|
-
readonly cid: string;
|
|
47
|
-
}, never>;
|
|
48
|
-
readonly output: Schema.Struct<{
|
|
49
|
-
object: import("@dxos/echo/Type").Obj<{
|
|
50
|
-
readonly name?: string | undefined;
|
|
51
|
-
readonly type: string;
|
|
52
|
-
readonly cid: string;
|
|
53
|
-
readonly timestamp?: string | undefined;
|
|
54
|
-
}, Schema.Struct.Fields>;
|
|
55
|
-
}>;
|
|
56
|
-
};
|
|
57
|
-
}, "executionMode"> & import("effect/Pipeable").Pipeable & {
|
|
58
|
-
readonly executionMode: "sync" | "async";
|
|
59
|
-
};
|
|
60
|
-
const Upload: Omit<{
|
|
61
|
-
readonly meta: {
|
|
62
|
-
readonly key: `${string}/upload`;
|
|
63
|
-
readonly name: "Upload File";
|
|
64
|
-
};
|
|
65
|
-
readonly services: readonly [typeof Capability.Service];
|
|
66
|
-
readonly schema: {
|
|
67
|
-
readonly input: Schema.extend<Schema.Struct<{
|
|
68
|
-
file: Schema.instanceOf<any>;
|
|
69
|
-
}>, Schema.Struct<{
|
|
70
|
-
db: Schema.Schema<Database.Database, Database.Database, never>;
|
|
71
|
-
}>>;
|
|
72
|
-
readonly output: Schema.SchemaClass<{
|
|
73
|
-
readonly name: string;
|
|
74
|
-
readonly type: string;
|
|
75
|
-
readonly cid: string;
|
|
76
|
-
readonly url: string;
|
|
77
|
-
}, {
|
|
78
|
-
readonly name: string;
|
|
79
|
-
readonly type: string;
|
|
80
|
-
readonly cid: string;
|
|
81
|
-
readonly url: string;
|
|
82
|
-
}, never>;
|
|
83
|
-
};
|
|
84
|
-
}, "executionMode"> & import("effect/Pipeable").Pipeable & {
|
|
85
|
-
readonly executionMode: "sync" | "async";
|
|
86
|
-
};
|
|
87
|
-
const CreateFile: Omit<{
|
|
88
|
-
readonly meta: {
|
|
89
|
-
readonly key: `${string}/create-file`;
|
|
90
|
-
readonly name: "Create File";
|
|
91
|
-
};
|
|
92
|
-
readonly services: readonly [typeof Capability.Service];
|
|
93
|
-
readonly schema: {
|
|
94
|
-
readonly input: Schema.extend<Schema.Struct<{
|
|
95
|
-
file: Schema.instanceOf<any>;
|
|
96
|
-
}>, Schema.Struct<{
|
|
97
|
-
db: Schema.Schema<Database.Database, Database.Database, never>;
|
|
98
|
-
}>>;
|
|
99
|
-
readonly output: Schema.Struct<{
|
|
100
|
-
object: import("@dxos/echo/Type").Obj<{
|
|
101
|
-
readonly name?: string | undefined;
|
|
102
|
-
readonly type: string;
|
|
103
|
-
readonly cid: string;
|
|
104
|
-
readonly timestamp?: string | undefined;
|
|
105
|
-
}, Schema.Struct.Fields>;
|
|
106
|
-
}>;
|
|
107
|
-
};
|
|
108
|
-
}, "executionMode"> & import("effect/Pipeable").Pipeable & {
|
|
109
|
-
readonly executionMode: "sync" | "async";
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
//# 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;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC,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;AAID,yBAAiB,aAAa,CAAC;IACtB,MAAM,aAAa;;;;;;;;;;;;;;;;;;;KAWxB,CAAC;IAEI,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;KASjB,CAAC;IAEI,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;KAOjB,CAAC;IAEI,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;KASrB,CAAC;CACJ"}
|
|
@@ -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/types';
|
|
11
|
-
|
|
12
|
-
import { WnfsOperation } 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(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,62 +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 { Obj, Ref, Type } from '@dxos/echo';
|
|
9
|
-
import { invariant } from '@dxos/invariant';
|
|
10
|
-
import { OperationResolver } from '@dxos/operation';
|
|
11
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
12
|
-
import { ManagedCollection } from '@dxos/schema';
|
|
13
|
-
|
|
14
|
-
import { upload } from '../../helpers';
|
|
15
|
-
import { WnfsCapabilities, WnfsFile, WnfsOperation } from '../../types';
|
|
16
|
-
|
|
17
|
-
export default Capability.makeModule(
|
|
18
|
-
Effect.fnUntraced(function* () {
|
|
19
|
-
return Capability.contributes(Capabilities.OperationResolver, [
|
|
20
|
-
OperationResolver.make({
|
|
21
|
-
operation: WnfsOperation.OnCreateSpace,
|
|
22
|
-
handler: Effect.fnUntraced(function* ({ rootCollection }) {
|
|
23
|
-
const collection = ManagedCollection.makeManagedCollection({ key: Type.getTypename(WnfsFile.File) });
|
|
24
|
-
Obj.change(rootCollection, (c) => {
|
|
25
|
-
c.objects.push(Ref.make(collection));
|
|
26
|
-
});
|
|
27
|
-
}),
|
|
28
|
-
}),
|
|
29
|
-
OperationResolver.make({
|
|
30
|
-
operation: WnfsOperation.Create,
|
|
31
|
-
handler: ({ name, type, cid }) =>
|
|
32
|
-
Effect.succeed({
|
|
33
|
-
object: WnfsFile.make({ name, type, cid }),
|
|
34
|
-
}),
|
|
35
|
-
}),
|
|
36
|
-
OperationResolver.make({
|
|
37
|
-
operation: WnfsOperation.Upload,
|
|
38
|
-
handler: Effect.fnUntraced(function* ({ file, db }) {
|
|
39
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
40
|
-
const blockstore = yield* Capability.get(WnfsCapabilities.Blockstore);
|
|
41
|
-
const space = client.spaces.get(db.spaceId);
|
|
42
|
-
invariant(space, 'Space not found');
|
|
43
|
-
const info = yield* Effect.promise(() => upload({ file, blockstore, space }));
|
|
44
|
-
return info;
|
|
45
|
-
}),
|
|
46
|
-
}),
|
|
47
|
-
OperationResolver.make({
|
|
48
|
-
operation: WnfsOperation.CreateFile,
|
|
49
|
-
handler: Effect.fnUntraced(function* ({ file, db }) {
|
|
50
|
-
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
51
|
-
const blockstore = yield* Capability.get(WnfsCapabilities.Blockstore);
|
|
52
|
-
const space = client.spaces.get(db.spaceId);
|
|
53
|
-
invariant(space, 'Space not found');
|
|
54
|
-
const info = yield* Effect.promise(() => upload({ file, blockstore, space }));
|
|
55
|
-
return {
|
|
56
|
-
object: WnfsFile.make({ name: info.name, type: info.type, cid: info.cid }),
|
|
57
|
-
};
|
|
58
|
-
}),
|
|
59
|
-
}),
|
|
60
|
-
]);
|
|
61
|
-
}),
|
|
62
|
-
);
|