@dxos/plugin-wnfs 0.8.4-main.67995b8 → 0.8.4-main.69d29f4
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/dist/lib/browser/FileContainer-O5YFSIWV.mjs +91 -0
- package/dist/lib/browser/FileContainer-O5YFSIWV.mjs.map +7 -0
- package/dist/lib/browser/{blockstore-KQO2NTVM.mjs → blockstore-KKFOALUH.mjs} +19 -19
- package/dist/lib/browser/blockstore-KKFOALUH.mjs.map +7 -0
- package/dist/lib/browser/chunk-GXXEH7H6.mjs +154 -0
- package/dist/lib/browser/chunk-GXXEH7H6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VRRXG6IB.mjs → chunk-NCTUASHL.mjs} +18 -10
- package/dist/lib/browser/chunk-NCTUASHL.mjs.map +7 -0
- package/dist/lib/browser/file-uploader-BUHAXRSV.mjs +34 -0
- package/dist/lib/browser/file-uploader-BUHAXRSV.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +85 -87
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{markdown-6VH477GB.mjs → markdown-BRT2MN6C.mjs} +31 -26
- package/dist/lib/browser/markdown-BRT2MN6C.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-F6GUL54A.mjs +99 -0
- package/dist/lib/browser/operation-resolver-F6GUL54A.mjs.map +7 -0
- package/dist/lib/browser/react-surface-UNAYSIAC.mjs +81 -0
- package/dist/lib/browser/react-surface-UNAYSIAC.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +9 -6
- package/dist/types/src/WnfsPlugin.d.ts +2 -1
- package/dist/types/src/WnfsPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/blockstore/blockstore.d.ts +5 -0
- package/dist/types/src/capabilities/blockstore/blockstore.d.ts.map +1 -0
- package/dist/types/src/capabilities/blockstore/index.d.ts +3 -0
- package/dist/types/src/capabilities/blockstore/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/file-uploader/file-uploader.d.ts +5 -0
- package/dist/types/src/capabilities/file-uploader/file-uploader.d.ts.map +1 -0
- package/dist/types/src/capabilities/file-uploader/index.d.ts +3 -0
- package/dist/types/src/capabilities/file-uploader/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -6
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown/index.d.ts +3 -0
- package/dist/types/src/capabilities/markdown/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts +5 -0
- package/dist/types/src/capabilities/markdown/markdown.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/FileContainer.d.ts +4 -6
- package/dist/types/src/components/FileContainer.d.ts.map +1 -1
- package/dist/types/src/components/FileInput.d.ts +1 -1
- package/dist/types/src/components/FileInput.d.ts.map +1 -1
- 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/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 +5 -4
- package/dist/types/src/extensions/image.stories.d.ts.map +1 -1
- package/dist/types/src/helpers/load.d.ts +2 -2
- 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/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +6 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/File.d.ts +16 -0
- package/dist/types/src/types/File.d.ts.map +1 -0
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +3 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +108 -47
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -40
- package/src/WnfsPlugin.tsx +61 -79
- package/src/blockstore.ts +2 -2
- package/src/capabilities/blockstore/blockstore.ts +22 -0
- package/src/capabilities/blockstore/index.ts +7 -0
- package/src/capabilities/file-uploader/file-uploader.ts +33 -0
- package/src/capabilities/file-uploader/index.ts +7 -0
- package/src/capabilities/index.ts +5 -9
- package/src/capabilities/markdown/index.ts +7 -0
- package/src/capabilities/markdown/markdown.ts +33 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +62 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +49 -0
- package/src/components/FileContainer.tsx +28 -23
- package/src/components/FileInput.tsx +5 -5
- package/src/components/FilePreview.tsx +4 -4
- package/src/extensions/image.stories.tsx +18 -14
- package/src/extensions/image.tsx +9 -9
- package/src/helpers/load.ts +14 -8
- package/src/helpers/upload.ts +6 -2
- package/src/index.ts +1 -1
- package/src/meta.ts +9 -6
- package/src/translations.ts +6 -3
- package/src/types/File.ts +24 -0
- package/src/{capabilities → types}/capabilities.ts +4 -4
- package/src/types/index.ts +2 -1
- package/src/types/types.ts +57 -17
- package/dist/lib/browser/FileContainer-6P2SYTVH.mjs +0 -105
- package/dist/lib/browser/FileContainer-6P2SYTVH.mjs.map +0 -7
- package/dist/lib/browser/blockstore-KQO2NTVM.mjs.map +0 -7
- package/dist/lib/browser/chunk-GVBV2QWA.mjs +0 -64
- package/dist/lib/browser/chunk-GVBV2QWA.mjs.map +0 -7
- package/dist/lib/browser/chunk-KZANQHJY.mjs +0 -16
- package/dist/lib/browser/chunk-KZANQHJY.mjs.map +0 -7
- package/dist/lib/browser/chunk-VDDGZWAY.mjs +0 -15
- package/dist/lib/browser/chunk-VDDGZWAY.mjs.map +0 -7
- package/dist/lib/browser/chunk-VRRXG6IB.mjs.map +0 -7
- package/dist/lib/browser/chunk-WTYTESSC.mjs +0 -16
- package/dist/lib/browser/chunk-WTYTESSC.mjs.map +0 -7
- package/dist/lib/browser/file-uploader-JA55DPMW.mjs +0 -29
- package/dist/lib/browser/file-uploader-JA55DPMW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-YM6QRFIH.mjs +0 -49
- package/dist/lib/browser/intent-resolver-YM6QRFIH.mjs.map +0 -7
- package/dist/lib/browser/markdown-6VH477GB.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NOSB5MZ2.mjs +0 -88
- package/dist/lib/browser/react-surface-NOSB5MZ2.mjs.map +0 -7
- package/dist/types/src/capabilities/blockstore.d.ts +0 -4
- package/dist/types/src/capabilities/blockstore.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/file-uploader.d.ts +0 -4
- package/dist/types/src/capabilities/file-uploader.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/capabilities/markdown.d.ts +0 -4
- package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.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/blockstore.ts +0 -18
- package/src/capabilities/file-uploader.ts +0 -24
- package/src/capabilities/intent-resolver.ts +0 -32
- package/src/capabilities/markdown.ts +0 -25
- package/src/capabilities/react-surface.tsx +0 -45
- package/src/types/file.ts +0 -17
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {
|
|
2
|
+
upload
|
|
3
|
+
} from "./chunk-NCTUASHL.mjs";
|
|
4
|
+
import {
|
|
5
|
+
File_exports,
|
|
6
|
+
WnfsCapabilities,
|
|
7
|
+
WnfsOperation
|
|
8
|
+
} from "./chunk-GXXEH7H6.mjs";
|
|
9
|
+
|
|
10
|
+
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
11
|
+
import * as Effect from "effect/Effect";
|
|
12
|
+
import { Capability, Common } from "@dxos/app-framework";
|
|
13
|
+
import { Obj, Ref, Type } from "@dxos/echo";
|
|
14
|
+
import { invariant } from "@dxos/invariant";
|
|
15
|
+
import { OperationResolver } from "@dxos/operation";
|
|
16
|
+
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
17
|
+
import { Collection } from "@dxos/schema";
|
|
18
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-wnfs/src/capabilities/operation-resolver/operation-resolver.ts";
|
|
19
|
+
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
20
|
+
return Capability.contributes(Common.Capability.OperationResolver, [
|
|
21
|
+
OperationResolver.make({
|
|
22
|
+
operation: WnfsOperation.OnCreateSpace,
|
|
23
|
+
handler: Effect.fnUntraced(function* ({ rootCollection }) {
|
|
24
|
+
const collection = Collection.makeManaged({
|
|
25
|
+
key: Type.getTypename(File_exports.File)
|
|
26
|
+
});
|
|
27
|
+
Obj.change(rootCollection, (c) => {
|
|
28
|
+
c.objects.push(Ref.make(collection));
|
|
29
|
+
});
|
|
30
|
+
})
|
|
31
|
+
}),
|
|
32
|
+
OperationResolver.make({
|
|
33
|
+
operation: WnfsOperation.Create,
|
|
34
|
+
handler: ({ name, type, cid }) => Effect.succeed({
|
|
35
|
+
object: File_exports.make({
|
|
36
|
+
name,
|
|
37
|
+
type,
|
|
38
|
+
cid
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
OperationResolver.make({
|
|
43
|
+
operation: WnfsOperation.Upload,
|
|
44
|
+
handler: Effect.fnUntraced(function* ({ file, db }) {
|
|
45
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
46
|
+
const blockstore = yield* Capability.get(WnfsCapabilities.Blockstore);
|
|
47
|
+
const space = client.spaces.get(db.spaceId);
|
|
48
|
+
invariant(space, "Space not found", {
|
|
49
|
+
F: __dxlog_file,
|
|
50
|
+
L: 42,
|
|
51
|
+
S: this,
|
|
52
|
+
A: [
|
|
53
|
+
"space",
|
|
54
|
+
"'Space not found'"
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
const info = yield* Effect.promise(() => upload({
|
|
58
|
+
file,
|
|
59
|
+
blockstore,
|
|
60
|
+
space
|
|
61
|
+
}));
|
|
62
|
+
return info;
|
|
63
|
+
})
|
|
64
|
+
}),
|
|
65
|
+
OperationResolver.make({
|
|
66
|
+
operation: WnfsOperation.CreateFile,
|
|
67
|
+
handler: Effect.fnUntraced(function* ({ file, db }) {
|
|
68
|
+
const client = yield* Capability.get(ClientCapabilities.Client);
|
|
69
|
+
const blockstore = yield* Capability.get(WnfsCapabilities.Blockstore);
|
|
70
|
+
const space = client.spaces.get(db.spaceId);
|
|
71
|
+
invariant(space, "Space not found", {
|
|
72
|
+
F: __dxlog_file,
|
|
73
|
+
L: 53,
|
|
74
|
+
S: this,
|
|
75
|
+
A: [
|
|
76
|
+
"space",
|
|
77
|
+
"'Space not found'"
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
const info = yield* Effect.promise(() => upload({
|
|
81
|
+
file,
|
|
82
|
+
blockstore,
|
|
83
|
+
space
|
|
84
|
+
}));
|
|
85
|
+
return {
|
|
86
|
+
object: File_exports.make({
|
|
87
|
+
name: info.name,
|
|
88
|
+
type: info.type,
|
|
89
|
+
cid: info.cid
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
]);
|
|
95
|
+
}));
|
|
96
|
+
export {
|
|
97
|
+
operation_resolver_default as default
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=operation-resolver-F6GUL54A.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Obj, Ref, Type } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { OperationResolver } from '@dxos/operation';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { Collection } from '@dxos/schema';\n\nimport { upload } from '../../helpers';\nimport { WnfsCapabilities, WnfsFile, WnfsOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Common.Capability.OperationResolver, [\n OperationResolver.make({\n operation: WnfsOperation.OnCreateSpace,\n handler: Effect.fnUntraced(function* ({ rootCollection }) {\n const collection = Collection.makeManaged({ key: Type.getTypename(WnfsFile.File) });\n Obj.change(rootCollection, (c) => {\n c.objects.push(Ref.make(collection));\n });\n }),\n }),\n OperationResolver.make({\n operation: WnfsOperation.Create,\n handler: ({ name, type, cid }) =>\n Effect.succeed({\n object: WnfsFile.make({ name, type, cid }),\n }),\n }),\n OperationResolver.make({\n operation: WnfsOperation.Upload,\n handler: 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 OperationResolver.make({\n operation: WnfsOperation.CreateFile,\n handler: 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 {\n object: WnfsFile.make({ name: info.name, type: info.type, cid: info.cid }),\n };\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,KAAKC,KAAKC,YAAY;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,yBAAyB;AAClC,SAASC,0BAA0B;AACnC,SAASC,kBAAkB;;AAK3B,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,OAAOJ,WAAWK,mBAAmB;IACjEA,kBAAkBC,KAAK;MACrBC,WAAWC,cAAcC;MACzBC,SAAgBR,kBAAW,WAAW,EAAES,eAAc,GAAE;AACtD,cAAMC,aAAaC,WAAWC,YAAY;UAAEC,KAAKC,KAAKC,YAAYC,aAASC,IAAI;QAAE,CAAA;AACjFC,YAAIC,OAAOV,gBAAgB,CAACW,MAAAA;AAC1BA,YAAEC,QAAQC,KAAKC,IAAInB,KAAKM,UAAAA,CAAAA;QAC1B,CAAA;MACF,CAAA;IACF,CAAA;IACAP,kBAAkBC,KAAK;MACrBC,WAAWC,cAAckB;MACzBhB,SAAS,CAAC,EAAEiB,MAAMC,MAAMC,IAAG,MAClBC,eAAQ;QACbC,QAAQb,aAASZ,KAAK;UAAEqB;UAAMC;UAAMC;QAAI,CAAA;MAC1C,CAAA;IACJ,CAAA;IACAxB,kBAAkBC,KAAK;MACrBC,WAAWC,cAAcwB;MACzBtB,SAAgBR,kBAAW,WAAW,EAAE+B,MAAMC,GAAE,GAAE;AAChD,cAAMC,SAAS,OAAOnC,WAAWoC,IAAIC,mBAAmBC,MAAM;AAC9D,cAAMC,aAAa,OAAOvC,WAAWoC,IAAII,iBAAiBC,UAAU;AACpE,cAAMC,QAAQP,OAAOQ,OAAOP,IAAIF,GAAGU,OAAO;AAC1CC,kBAAUH,OAAO,mBAAA;;;;;;;;;AACjB,cAAMI,OAAO,OAAcC,eAAQ,MAAMC,OAAO;UAAEf;UAAMM;UAAYG;QAAM,CAAA,CAAA;AAC1E,eAAOI;MACT,CAAA;IACF,CAAA;IACAzC,kBAAkBC,KAAK;MACrBC,WAAWC,cAAcyC;MACzBvC,SAAgBR,kBAAW,WAAW,EAAE+B,MAAMC,GAAE,GAAE;AAChD,cAAMC,SAAS,OAAOnC,WAAWoC,IAAIC,mBAAmBC,MAAM;AAC9D,cAAMC,aAAa,OAAOvC,WAAWoC,IAAII,iBAAiBC,UAAU;AACpE,cAAMC,QAAQP,OAAOQ,OAAOP,IAAIF,GAAGU,OAAO;AAC1CC,kBAAUH,OAAO,mBAAA;;;;;;;;;AACjB,cAAMI,OAAO,OAAcC,eAAQ,MAAMC,OAAO;UAAEf;UAAMM;UAAYG;QAAM,CAAA,CAAA;AAC1E,eAAO;UACLX,QAAQb,aAASZ,KAAK;YAAEqB,MAAMmB,KAAKnB;YAAMC,MAAMkB,KAAKlB;YAAMC,KAAKiB,KAAKjB;UAAI,CAAA;QAC1E;MACF,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "Common", "Obj", "Ref", "Type", "invariant", "OperationResolver", "ClientCapabilities", "Collection", "Capability", "makeModule", "fnUntraced", "contributes", "Common", "OperationResolver", "make", "operation", "WnfsOperation", "OnCreateSpace", "handler", "rootCollection", "collection", "Collection", "makeManaged", "key", "Type", "getTypename", "WnfsFile", "File", "Obj", "change", "c", "objects", "push", "Ref", "Create", "name", "type", "cid", "succeed", "object", "Upload", "file", "db", "client", "get", "ClientCapabilities", "Client", "blockstore", "WnfsCapabilities", "Blockstore", "space", "spaces", "spaceId", "invariant", "info", "promise", "upload", "CreateFile"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
File_exports,
|
|
3
|
+
WnfsAction,
|
|
4
|
+
meta
|
|
5
|
+
} from "./chunk-GXXEH7H6.mjs";
|
|
6
|
+
|
|
7
|
+
// src/capabilities/react-surface/react-surface.tsx
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import React2, { useCallback as useCallback2 } from "react";
|
|
10
|
+
import { Capability, Common } from "@dxos/app-framework";
|
|
11
|
+
import { Obj } from "@dxos/echo";
|
|
12
|
+
import { findAnnotation as findAnnotation2 } from "@dxos/effect";
|
|
13
|
+
|
|
14
|
+
// src/components/index.ts
|
|
15
|
+
import { lazy } from "react";
|
|
16
|
+
|
|
17
|
+
// src/components/FileInput.tsx
|
|
18
|
+
import React, { useCallback } from "react";
|
|
19
|
+
import { useDropzone } from "react-dropzone";
|
|
20
|
+
import { findAnnotation } from "@dxos/effect";
|
|
21
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
22
|
+
import { mx } from "@dxos/ui-theme";
|
|
23
|
+
var FileInput = ({ schema, onChange }) => {
|
|
24
|
+
const { t } = useTranslation(meta.id);
|
|
25
|
+
const accept = findAnnotation(schema.ast, WnfsAction.UploadAnnotationId);
|
|
26
|
+
const onDropAccepted = useCallback((files) => onChange?.(files[0]), [
|
|
27
|
+
onChange
|
|
28
|
+
]);
|
|
29
|
+
const { acceptedFiles, getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = useDropzone({
|
|
30
|
+
multiple: false,
|
|
31
|
+
accept,
|
|
32
|
+
onDropAccepted
|
|
33
|
+
});
|
|
34
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
35
|
+
...getRootProps(),
|
|
36
|
+
className: mx("flex flex-col items-center p-8 border border-separator", isFocused && "focus-ring", isDragAccept && "bg-attention", isDragReject && "border-roseFill")
|
|
37
|
+
}, /* @__PURE__ */ React.createElement("input", getInputProps()), acceptedFiles[0] ? /* @__PURE__ */ React.createElement("p", null, acceptedFiles[0].name) : /* @__PURE__ */ React.createElement("p", null, t("file input placeholder")));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/components/index.ts
|
|
41
|
+
var FileContainer = lazy(() => import("./FileContainer-O5YFSIWV.mjs"));
|
|
42
|
+
|
|
43
|
+
// src/capabilities/react-surface/react-surface.tsx
|
|
44
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Common.Capability.ReactSurface, [
|
|
45
|
+
Common.createSurface({
|
|
46
|
+
id: `${meta.id}/article`,
|
|
47
|
+
role: [
|
|
48
|
+
"article",
|
|
49
|
+
"section",
|
|
50
|
+
"slide"
|
|
51
|
+
],
|
|
52
|
+
filter: (data) => Obj.instanceOf(File_exports.File, data.subject),
|
|
53
|
+
component: ({ data, role }) => /* @__PURE__ */ React2.createElement(FileContainer, {
|
|
54
|
+
role,
|
|
55
|
+
subject: data.subject
|
|
56
|
+
})
|
|
57
|
+
}),
|
|
58
|
+
Common.createSurface({
|
|
59
|
+
id: `${meta.id}/create-form`,
|
|
60
|
+
role: "form-input",
|
|
61
|
+
filter: (data) => {
|
|
62
|
+
const annotation = findAnnotation2(data.schema.ast, WnfsAction.UploadAnnotationId);
|
|
63
|
+
return !!annotation;
|
|
64
|
+
},
|
|
65
|
+
component: ({ data: { schema }, ...props }) => {
|
|
66
|
+
const inputProps = props;
|
|
67
|
+
const handleChange = useCallback2((file) => inputProps.onValueChange?.(inputProps.type, file), [
|
|
68
|
+
inputProps.type,
|
|
69
|
+
inputProps.onValueChange
|
|
70
|
+
]);
|
|
71
|
+
return /* @__PURE__ */ React2.createElement(FileInput, {
|
|
72
|
+
schema,
|
|
73
|
+
onChange: handleChange
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
])));
|
|
78
|
+
export {
|
|
79
|
+
react_surface_default as default
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=react-surface-UNAYSIAC.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/components/index.ts", "../../../src/components/FileInput.tsx"],
|
|
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 { Capability, Common } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { findAnnotation } from '@dxos/effect';\nimport { type FormFieldComponentProps } from '@dxos/react-ui-form';\n\nimport { FileContainer, FileInput } from '../../components';\nimport { meta } from '../../meta';\nimport { WnfsAction, WnfsFile } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Common.Capability.ReactSurface, [\n Common.createSurface({\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 Common.createSurface({\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 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport const FileContainer = lazy(() => import('./FileContainer'));\n\nexport * from './FileInput';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as Schema from 'effect/Schema';\nimport React, { useCallback } from 'react';\nimport { useDropzone } from 'react-dropzone';\n\nimport { findAnnotation } from '@dxos/effect';\nimport { useTranslation } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { meta } from '../meta';\nimport { WnfsAction } from '../types';\n\nexport type FileInputProps = {\n schema: Schema.Schema.Any;\n onChange: (file: File) => void;\n};\n\nexport const FileInput = ({ schema, onChange }: FileInputProps) => {\n const { t } = useTranslation(meta.id);\n const accept = findAnnotation<Record<string, string[]>>(schema.ast, WnfsAction.UploadAnnotationId);\n\n const onDropAccepted = useCallback((files: File[]) => onChange?.(files[0]), [onChange]);\n\n const { acceptedFiles, getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = useDropzone({\n multiple: false,\n accept,\n onDropAccepted,\n });\n\n return (\n <div\n {...getRootProps()}\n className={mx(\n 'flex flex-col items-center p-8 border border-separator',\n isFocused && 'focus-ring',\n isDragAccept && 'bg-attention',\n isDragReject && 'border-roseFill',\n )}\n >\n <input {...getInputProps()} />\n {acceptedFiles[0] ? <p>{acceptedFiles[0].name}</p> : <p>{t('file input placeholder')}</p>}\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,OAAOC,UAASC,eAAAA,oBAAmB;AAEnC,SAASC,YAAYC,cAAc;AACnC,SAASC,WAAW;AACpB,SAASC,kBAAAA,uBAAsB;;;ACN/B,SAASC,YAAY;;;ACCrB,OAAOC,SAASC,mBAAmB;AACnC,SAASC,mBAAmB;AAE5B,SAASC,sBAAsB;AAC/B,SAASC,sBAAsB;AAC/B,SAASC,UAAU;AAUZ,IAAMC,YAAY,CAAC,EAAEC,QAAQC,SAAQ,MAAkB;AAC5D,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,QAAMC,SAASC,eAAyCP,OAAOQ,KAAKC,WAAWC,kBAAkB;AAEjG,QAAMC,iBAAiBC,YAAY,CAACC,UAAkBZ,WAAWY,MAAM,CAAA,CAAE,GAAG;IAACZ;GAAS;AAEtF,QAAM,EAAEa,eAAeC,cAAcC,eAAeC,WAAWC,cAAcC,aAAY,IAAKC,YAAY;IACxGC,UAAU;IACVf;IACAK;EACF,CAAA;AAEA,SACE,sBAAA,cAACW,OAAAA;IACE,GAAGP,aAAAA;IACJQ,WAAWC,GACT,0DACAP,aAAa,cACbC,gBAAgB,gBAChBC,gBAAgB,iBAAA;KAGlB,sBAAA,cAACM,SAAUT,cAAAA,CAAAA,GACVF,cAAc,CAAA,IAAK,sBAAA,cAACY,KAAAA,MAAGZ,cAAc,CAAA,EAAGa,IAAI,IAAQ,sBAAA,cAACD,KAAAA,MAAGxB,EAAE,wBAAA,CAAA,CAAA;AAGjE;;;ADxCO,IAAM0B,gBAAgBC,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ADW/C,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,OAAOJ,WAAWK,cAAc;EACrDD,OAAOE,cAAc;IACnBC,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,gBAAAS,OAAA,cAACC,eAAAA;MAAcV;MAAYO,SAASL,KAAKK;;EAC1E,CAAA;EACAZ,OAAOE,cAAc;IACnBC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAAAA;AACP,YAAMS,aAAaC,gBAChBV,KAAKW,OAA6BC,KACnCC,WAAWC,kBAAkB;AAE/B,aAAO,CAAC,CAACL;IACX;IACAH,WAAW,CAAC,EAAEN,MAAM,EAAEW,OAAM,GAAI,GAAGI,MAAAA,MAAO;AACxC,YAAMC,aAAaD;AACnB,YAAME,eAAeC,aACnB,CAACC,SAAeH,WAAWI,gBAAgBJ,WAAWK,MAAMF,IAAAA,GAC5D;QAACH,WAAWK;QAAML,WAAWI;OAAc;AAG7C,aAAO,gBAAAb,OAAA,cAACe,WAAAA;QAAUX;QAAgBY,UAAUN;;IAC9C;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "useCallback", "Capability", "Common", "Obj", "findAnnotation", "lazy", "React", "useCallback", "useDropzone", "findAnnotation", "useTranslation", "mx", "FileInput", "schema", "onChange", "t", "useTranslation", "meta", "id", "accept", "findAnnotation", "ast", "WnfsAction", "UploadAnnotationId", "onDropAccepted", "useCallback", "files", "acceptedFiles", "getRootProps", "getInputProps", "isFocused", "isDragAccept", "isDragReject", "useDropzone", "multiple", "div", "className", "mx", "input", "p", "name", "FileContainer", "lazy", "Capability", "makeModule", "succeed", "contributes", "Common", "ReactSurface", "createSurface", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "WnfsFile", "File", "subject", "component", "React", "FileContainer", "annotation", "findAnnotation", "schema", "ast", "WnfsAction", "UploadAnnotationId", "props", "inputProps", "handleChange", "useCallback", "file", "onValueChange", "type", "FileInput", "onChange"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
WnfsAction
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
File_exports,
|
|
3
|
+
WnfsAction,
|
|
4
|
+
WnfsCapabilities,
|
|
5
|
+
WnfsOperation
|
|
6
|
+
} from "../chunk-GXXEH7H6.mjs";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
WnfsAction,
|
|
9
|
+
WnfsCapabilities,
|
|
10
|
+
File_exports as WnfsFile,
|
|
11
|
+
WnfsOperation
|
|
9
12
|
};
|
|
10
13
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WnfsPlugin.d.ts","sourceRoot":"","sources":["../../../src/WnfsPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WnfsPlugin.d.ts","sourceRoot":"","sources":["../../../src/WnfsPlugin.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAsB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAYjE,eAAO,MAAM,UAAU,4BAwDtB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<import("interface-blockstore").Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>>>, Error, Capability.Service>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=blockstore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.FileUploader>>, never, Capability.Service>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=file-uploader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AAMzD,wBAoBE"}
|
|
@@ -0,0 +1 @@
|
|
|
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,sJAAmE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export * from './capabilities';
|
|
1
|
+
export * from './blockstore';
|
|
2
|
+
export * from './file-uploader';
|
|
3
|
+
export * from './markdown';
|
|
4
|
+
export * from './operation-resolver';
|
|
5
|
+
export * from './react-surface';
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<import("@dxos/plugin-markdown").MarkdownExtensionProvider[]>>, never, Capability.Service>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Capability } from '@dxos/app-framework';
|
|
2
|
+
export declare const OperationResolver: Capability.LazyCapability<void, Capability.Capability<Capability.InterfaceDef<import("@dxos/app-framework/Common").Capability.OperationResolver[]>>, Error>;
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,6JAA6E,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.OperationResolver[]>>, never, never>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=operation-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AAUzD,wBA6CE"}
|
|
@@ -0,0 +1 @@
|
|
|
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,sJAAmE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability, Common } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Common.Capability.ReactSurface>>, never, never>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=react-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,UAAU,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;;AASzD,wBA+BE"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export declare const FileContainer: ({ file }: FileContainerProps) => React.JSX.Element | null;
|
|
2
|
+
import { type SurfaceComponentProps } from '@dxos/app-framework/react';
|
|
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;
|
|
8
6
|
export default FileContainer;
|
|
9
7
|
//# sourceMappingURL=FileContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/FileContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"FileContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/FileContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,KAAK,qBAAqB,EAAiB,MAAM,2BAA2B,CAAC;AAQtF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIzC,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAEtE,eAAO,MAAM,aAAa,GAAI,yBAAyB,kBAAkB,6BAiCxE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../../src/components/FileInput.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
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,3 +1,3 @@
|
|
|
1
|
-
export declare const FileContainer: import("react").LazyExoticComponent<({ file }: import("./FileContainer").FileContainerProps) => import("react").JSX.Element | null>;
|
|
1
|
+
export declare const FileContainer: import("react").LazyExoticComponent<({ role, subject: file }: import("./FileContainer").FileContainerProps) => import("react").JSX.Element | null>;
|
|
2
2
|
export * from './FileInput';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,oJAAwC,CAAC;AAEnE,cAAc,aAAa,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
2
|
import type { Blockstore } from 'interface-blockstore';
|
|
3
3
|
import { type Space } from '@dxos/react-client/echo';
|
|
4
|
-
import { type WnfsCapabilities } from '../
|
|
4
|
+
import { type WnfsCapabilities } from '../types';
|
|
5
5
|
export type ImageOptions = {
|
|
6
6
|
blockstore: Blockstore;
|
|
7
7
|
instances: WnfsCapabilities.Instances;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,10 +1,11 @@
|
|
|
1
|
-
import '@
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
declare const
|
|
3
|
+
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
5
|
render: () => React.JSX.Element;
|
|
6
6
|
decorators: import("@storybook/react").Decorator[];
|
|
7
7
|
};
|
|
8
|
-
export default
|
|
9
|
-
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof meta>;
|
|
10
|
+
export declare const Default: Story;
|
|
10
11
|
//# sourceMappingURL=image.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.stories.d.ts","sourceRoot":"","sources":["../../../../src/extensions/image.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import type { Blockstore } from 'interface-blockstore';
|
|
2
|
-
import {
|
|
2
|
+
import { PrivateDirectory, PrivateForest } from 'wnfs';
|
|
3
3
|
import { type Space } from '@dxos/react-client/echo';
|
|
4
|
-
import { type WnfsCapabilities } from '../
|
|
4
|
+
import { type WnfsCapabilities } from '../types';
|
|
5
5
|
export declare const loadWnfs: ({ space, blockstore, instances, }: {
|
|
6
6
|
space: Space;
|
|
7
7
|
blockstore: Blockstore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/helpers/load.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAa,
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/helpers/load.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAa,gBAAgB,EAAE,aAAa,EAAe,MAAM,MAAM,CAAC;AAG/E,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQjD,eAAO,MAAM,QAAQ,GAAU,mCAI5B;IACD,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC;CACxC;;;EAsBA,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Blockstore } from 'interface-blockstore';
|
|
2
2
|
import type { Space } from '@dxos/client/echo';
|
|
3
|
-
import { type WnfsCapabilities } from '../
|
|
3
|
+
import { type WnfsCapabilities } from '../types';
|
|
4
4
|
export declare const upload: ({ file, blockstore, instances, space, }: {
|
|
5
5
|
file: File;
|
|
6
6
|
blockstore: Blockstore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/helpers/upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/helpers/upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAMjD,eAAO,MAAM,MAAM,GAAU,yCAK1B;IACD,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC;IACvC,KAAK,EAAE,KAAK,CAAC;CACd;;;;;EAkCA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const meta: PluginMeta;
|
|
1
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
2
|
+
export declare const meta: Plugin.Meta;
|
|
4
3
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IAUzB,CAAC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { meta } from './meta';
|
|
2
|
-
import {
|
|
2
|
+
import { WnfsFile } from './types';
|
|
3
3
|
export declare const translations: [{
|
|
4
4
|
readonly 'en-US': {
|
|
5
|
-
readonly [
|
|
5
|
+
readonly [WnfsFile.File.typename]: {
|
|
6
6
|
readonly 'typename label': "File";
|
|
7
|
+
readonly 'typename label_zero': "Files";
|
|
8
|
+
readonly 'typename label_one': "File";
|
|
9
|
+
readonly 'typename label_other': "Files";
|
|
7
10
|
readonly 'object name placeholder': "New file";
|
|
8
11
|
readonly 'rename object label': "Rename file";
|
|
9
12
|
readonly 'delete object label': "Delete file";
|
|
13
|
+
readonly 'object deleted label': "File deleted";
|
|
10
14
|
};
|
|
11
15
|
readonly [meta.id]: {
|
|
12
16
|
readonly 'plugin name': "Files";
|
|
13
|
-
readonly 'delete object label': "Delete";
|
|
14
17
|
readonly 'file input placeholder': "Drop a file here, or click to select a file";
|
|
15
18
|
};
|
|
16
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,QAAQ,CAAC,QAAQ,CAAC
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;;;;;;;;;UASvB;QACD,SAAA,CAAC,IAAI,CAAC,EAAE,CAAC;;;UAGR;;EAGwB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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.Obj<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
|
|
@@ -0,0 +1 @@
|
|
|
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,12 +1,13 @@
|
|
|
1
1
|
import { type Blockstore } from 'interface-blockstore';
|
|
2
2
|
import { type PrivateDirectory, type PrivateForest } from 'wnfs';
|
|
3
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
4
|
import { type SpaceId } from '@dxos/keys';
|
|
4
5
|
export declare namespace WnfsCapabilities {
|
|
5
|
-
const Blockstore:
|
|
6
|
+
const Blockstore: Capability.InterfaceDef<Blockstore<{}, {}, {}, {}, {}, {}, {}, {}>>;
|
|
6
7
|
type Instances = Record<SpaceId, {
|
|
7
8
|
directory: PrivateDirectory;
|
|
8
9
|
forest: PrivateForest;
|
|
9
10
|
}>;
|
|
10
|
-
const Instances:
|
|
11
|
+
const Instances: Capability.InterfaceDef<Instances>;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|