@dxos/plugin-file 0.10.0 → 0.11.0
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/PLUGIN.mdl +86 -77
- package/dist/lib/FilePlugin.mjs +37 -0
- package/dist/lib/FilePlugin.mjs.map +1 -0
- package/dist/lib/FilePlugin.node.mjs +12 -0
- package/dist/lib/FilePlugin.node.mjs.map +1 -0
- package/dist/lib/capabilities/node.mjs +8 -0
- package/dist/lib/capabilities/node.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +15 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-FileArticle.mjs +62 -0
- package/dist/lib/chunk-FileArticle.mjs.map +1 -0
- package/dist/lib/chunk-create-object.mjs +28 -0
- package/dist/lib/chunk-create-object.mjs.map +1 -0
- package/dist/lib/chunk-create.mjs +78 -0
- package/dist/lib/chunk-create.mjs.map +1 -0
- package/dist/lib/chunk-edge-backend.mjs +18 -0
- package/dist/lib/chunk-edge-backend.mjs.map +1 -0
- package/dist/lib/chunk-file-uploader.mjs +37 -0
- package/dist/lib/chunk-file-uploader.mjs.map +1 -0
- package/dist/lib/chunk-inline-backend.mjs +19 -0
- package/dist/lib/chunk-inline-backend.mjs.map +1 -0
- package/dist/lib/chunk-markdown-extension.mjs +182 -0
- package/dist/lib/chunk-markdown-extension.mjs.map +1 -0
- package/dist/lib/chunk-meta.mjs +44 -0
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +11 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +55 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-read.mjs +32 -0
- package/dist/lib/chunk-read.mjs.map +1 -0
- package/dist/lib/chunk-settings.mjs +23 -0
- package/dist/lib/chunk-settings.mjs.map +1 -0
- package/dist/lib/chunk-skill-definition.mjs +10 -0
- package/dist/lib/chunk-skill-definition.mjs.map +1 -0
- package/dist/lib/chunk-skills.mjs +28 -0
- package/dist/lib/chunk-skills.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +98 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/components.mjs +57 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/containers.mjs +56 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/index.mjs +4 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/operations.mjs +7 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/skills.mjs +2 -0
- package/dist/lib/translations.mjs +30 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +2 -0
- package/dist/types/src/FilePlugin.d.ts.map +1 -1
- package/dist/types/src/FilePlugin.node.d.ts.map +1 -1
- package/dist/types/src/capabilities/FileUploadField.d.ts +12 -0
- package/dist/types/src/capabilities/FileUploadField.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +1 -1
- package/dist/types/src/capabilities/edge-backend.d.ts +5 -0
- package/dist/types/src/capabilities/edge-backend.d.ts.map +1 -0
- package/dist/types/src/capabilities/file-uploader.d.ts +1 -1
- package/dist/types/src/capabilities/file-uploader.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/inline-backend.d.ts +2 -2
- package/dist/types/src/capabilities/inline-backend.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown-extension.d.ts +1 -1
- package/dist/types/src/capabilities/node.d.ts +5 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/components/FileInput/FileInput.d.ts.map +1 -1
- package/dist/types/src/components/FilePreview/FilePreview.d.ts +1 -1
- package/dist/types/src/components/FilePreview/FilePreview.d.ts.map +1 -1
- package/dist/types/src/containers/FileArticle/FileArticle.d.ts +4 -1
- package/dist/types/src/containers/FileArticle/FileArticle.d.ts.map +1 -1
- package/dist/types/src/containers/FileSettings/FileSettings.d.ts +5 -3
- package/dist/types/src/containers/FileSettings/FileSettings.d.ts.map +1 -1
- package/dist/types/src/extensions/image.d.ts +0 -2
- package/dist/types/src/extensions/image.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +14 -5
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/read.d.ts.map +1 -1
- package/dist/types/src/types/FileCapabilities.d.ts +10 -28
- package/dist/types/src/types/FileCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +1 -1
- package/dist/types/src/types/Settings.d.ts.map +1 -1
- package/dist/types/src/types/limits.d.ts +0 -1
- package/dist/types/src/types/limits.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +10 -6
- package/package.json +45 -41
- package/src/FilePlugin.node.ts +2 -1
- package/src/FilePlugin.tsx +8 -1
- package/src/capabilities/FileUploadField.tsx +37 -0
- package/src/capabilities/edge-backend.ts +27 -0
- package/src/capabilities/file-uploader.ts +6 -4
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/inline-backend.ts +4 -21
- package/src/capabilities/markdown-extension.ts +3 -8
- package/src/capabilities/node.ts +16 -0
- package/src/capabilities/react-surface.ts +46 -0
- package/src/components/FileInput/FileInput.tsx +3 -2
- package/src/containers/FileArticle/FileArticle.tsx +49 -42
- package/src/containers/FileSettings/FileSettings.tsx +19 -14
- package/src/extensions/image.tsx +49 -28
- package/src/operations/create.test.ts +122 -32
- package/src/operations/create.ts +44 -24
- package/src/operations/read.ts +24 -6
- package/src/types/FileCapabilities.ts +10 -31
- package/src/types/Settings.ts +1 -1
- package/src/types/limits.ts +0 -2
- package/dist/lib/neutral/FileArticle-YU6NN3KN.mjs +0 -80
- package/dist/lib/neutral/FileArticle-YU6NN3KN.mjs.map +0 -7
- package/dist/lib/neutral/FilePlugin.mjs +0 -58
- package/dist/lib/neutral/FilePlugin.mjs.map +0 -7
- package/dist/lib/neutral/FilePlugin.node.mjs +0 -23
- package/dist/lib/neutral/FilePlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -23
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/chunk-DKGTSUUH.mjs +0 -8
- package/dist/lib/neutral/chunk-DKGTSUUH.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GMYSEHV4.mjs +0 -40
- package/dist/lib/neutral/chunk-GMYSEHV4.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-LBZ4MCLI.mjs +0 -45
- package/dist/lib/neutral/chunk-LBZ4MCLI.mjs.map +0 -7
- package/dist/lib/neutral/chunk-YODPX62X.mjs +0 -136
- package/dist/lib/neutral/chunk-YODPX62X.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZUXUTRAJ.mjs +0 -80
- package/dist/lib/neutral/chunk-ZUXUTRAJ.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -74
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -59
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/create-IUUG7RI6.mjs +0 -17
- package/dist/lib/neutral/create-IUUG7RI6.mjs.map +0 -7
- package/dist/lib/neutral/create-object-V667G4ZL.mjs +0 -30
- package/dist/lib/neutral/create-object-V667G4ZL.mjs.map +0 -7
- package/dist/lib/neutral/file-uploader-BCJH6TUL.mjs +0 -41
- package/dist/lib/neutral/file-uploader-BCJH6TUL.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -32
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/inline-backend-FGGGDYRB.mjs +0 -37
- package/dist/lib/neutral/inline-backend-FGGGDYRB.mjs.map +0 -7
- package/dist/lib/neutral/markdown-extension-RA5YNMTW.mjs +0 -230
- package/dist/lib/neutral/markdown-extension-RA5YNMTW.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/operation-handler-CPDANWGH.mjs +0 -13
- package/dist/lib/neutral/operation-handler-CPDANWGH.mjs.map +0 -7
- package/dist/lib/neutral/operations/index.mjs +0 -8
- package/dist/lib/neutral/operations/index.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -16
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-5BXKSHD2.mjs +0 -60
- package/dist/lib/neutral/react-surface-5BXKSHD2.mjs.map +0 -7
- package/dist/lib/neutral/read-HG6CSWKR.mjs +0 -28
- package/dist/lib/neutral/read-HG6CSWKR.mjs.map +0 -7
- package/dist/lib/neutral/settings-RR3RESL2.mjs +0 -28
- package/dist/lib/neutral/settings-RR3RESL2.mjs.map +0 -7
- package/dist/lib/neutral/skill-definition-YHBGWBUS.mjs +0 -15
- package/dist/lib/neutral/skill-definition-YHBGWBUS.mjs.map +0 -7
- package/dist/lib/neutral/skills/index.mjs +0 -11
- package/dist/lib/neutral/skills/index.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -36
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -22
- package/dist/lib/neutral/types/index.mjs.map +0 -7
- package/src/capabilities/react-surface.tsx +0 -61
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { a as Read } from "./chunk-types.mjs";
|
|
2
|
+
import { Skill, Template } from "@dxos/compute";
|
|
3
|
+
import { trim } from "@dxos/util";
|
|
4
|
+
//#region src/skills/file-skill.ts
|
|
5
|
+
var SKILL_KEY = "org.dxos.skill.file";
|
|
6
|
+
var make = () => Skill.make({
|
|
7
|
+
key: SKILL_KEY,
|
|
8
|
+
name: "File",
|
|
9
|
+
description: "Read the contents of files (images, videos, PDFs) as File content blocks.",
|
|
10
|
+
tools: Skill.toolDefinitions({ operations: [Read] }),
|
|
11
|
+
instructions: Template.make({ source: trim`
|
|
12
|
+
{{! File }}
|
|
13
|
+
|
|
14
|
+
You can read the contents of files.
|
|
15
|
+
Calling the read tool returns the file contents as a File content block (a data URL for
|
|
16
|
+
inline files, the original URL for external files). The model receives the file natively
|
|
17
|
+
and can describe, transcribe, or otherwise reason over its contents.
|
|
18
|
+
` }),
|
|
19
|
+
agentCanEnable: true
|
|
20
|
+
});
|
|
21
|
+
var skill = {
|
|
22
|
+
key: SKILL_KEY,
|
|
23
|
+
make
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { skill as n, SKILL_KEY as t };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=chunk-skills.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-skills.mjs","names":[],"sources":["../../src/skills/file-skill.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Skill, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { FileOperation } from '../types';\n\nexport const SKILL_KEY = 'org.dxos.skill.file';\n\nconst make = () =>\n Skill.make({\n key: SKILL_KEY,\n name: 'File',\n description: 'Read the contents of files (images, videos, PDFs) as File content blocks.',\n tools: Skill.toolDefinitions({\n operations: [FileOperation.Read],\n }),\n instructions: Template.make({\n source: trim`\n {{! File }}\n\n You can read the contents of files.\n Calling the read tool returns the file contents as a File content block (a data URL for\n inline files, the original URL for external files). The model receives the file natively\n and can describe, transcribe, or otherwise reason over its contents.\n `,\n }),\n agentCanEnable: true,\n });\n\nconst skill: Skill.Definition = {\n key: SKILL_KEY,\n make,\n};\n\nexport default skill;\n"],"mappings":";;;;AASA,IAAa,YAAY;AAEzB,IAAM,aACJ,MAAM,KAAK;CACT,KAAK;CACL,MAAM;CACN,aAAa;CACb,OAAO,MAAM,gBAAgB,EAC3B,YAAY,CAAC,IAAkB,EACjC,CAAC;CACD,cAAc,SAAS,KAAK,EAC1B,QAAQ,IAAI;;;;;;;QAQd,CAAC;CACD,gBAAgB;AAClB,CAAC;AAEH,IAAM,QAA0B;CAC9B,KAAK;CACL;AACF"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Operation } from "@dxos/compute";
|
|
2
|
+
import { ContentBlock, File as File$1, File as File$2 } from "@dxos/types";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { meta } from "#meta";
|
|
5
|
+
import { Capability } from "@dxos/app-framework";
|
|
6
|
+
import { DXN, Database, Ref, Type } from "@dxos/echo";
|
|
7
|
+
//#region \0rolldown/runtime.js
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __exportAll = (all, no_symbols) => {
|
|
10
|
+
let target = {};
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
16
|
+
return target;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/types/limits.ts
|
|
20
|
+
var ACCEPTED_MIME = {
|
|
21
|
+
"image/*": [
|
|
22
|
+
".jpg",
|
|
23
|
+
".jpeg",
|
|
24
|
+
".png",
|
|
25
|
+
".gif",
|
|
26
|
+
".webp",
|
|
27
|
+
".svg"
|
|
28
|
+
],
|
|
29
|
+
"video/*": [
|
|
30
|
+
".mp4",
|
|
31
|
+
".webm",
|
|
32
|
+
".mov"
|
|
33
|
+
],
|
|
34
|
+
"application/pdf": [".pdf"]
|
|
35
|
+
};
|
|
36
|
+
var isAcceptedMimeType = (type) => {
|
|
37
|
+
if (type === "application/pdf") return true;
|
|
38
|
+
if (type.startsWith("image/") || type.startsWith("video/")) return true;
|
|
39
|
+
return false;
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/types/types.ts
|
|
43
|
+
var FileAction;
|
|
44
|
+
(function(_FileAction) {
|
|
45
|
+
const UploadAnnotationId = _FileAction.UploadAnnotationId = Symbol.for(`${meta.profile.key}.annotation.upload`);
|
|
46
|
+
_FileAction.CreateFileSchema = Schema.Struct({ file: Schema.instanceOf(File).annotations({ [UploadAnnotationId]: ACCEPTED_MIME }) });
|
|
47
|
+
})(FileAction || (FileAction = {}));
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/types/FileCapabilities.ts
|
|
50
|
+
var FileCapabilities_exports = /* @__PURE__ */ __exportAll({
|
|
51
|
+
Backend: () => Backend,
|
|
52
|
+
SettingsAtom: () => SettingsAtom
|
|
53
|
+
});
|
|
54
|
+
var Backend = Capability.make(`${meta.profile.key}.capability.backend`);
|
|
55
|
+
var SettingsAtom = Capability.make(`${meta.profile.key}.capability.settings`);
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/types/FileOperation.ts
|
|
58
|
+
var FileOperation_exports = /* @__PURE__ */ __exportAll({
|
|
59
|
+
Create: () => Create,
|
|
60
|
+
Read: () => Read
|
|
61
|
+
});
|
|
62
|
+
var makeKey = (name) => DXN.make(`${meta.profile.key}.operation.${name}`);
|
|
63
|
+
var Create = Operation.make({
|
|
64
|
+
meta: {
|
|
65
|
+
key: makeKey("create"),
|
|
66
|
+
name: "Create File",
|
|
67
|
+
icon: "ph--file--regular"
|
|
68
|
+
},
|
|
69
|
+
services: [Capability.Service],
|
|
70
|
+
input: Schema.extend(FileAction.CreateFileSchema, Schema.Struct({ db: Database.Database })),
|
|
71
|
+
output: Schema.Struct({ object: Type.getSchema(File$1.File) })
|
|
72
|
+
});
|
|
73
|
+
var Read = Operation.make({
|
|
74
|
+
meta: {
|
|
75
|
+
key: makeKey("read"),
|
|
76
|
+
name: "Read File",
|
|
77
|
+
description: "Reads the contents of a file and returns them as a File content block (data URL for inline files, original URL for external files).",
|
|
78
|
+
icon: "ph--file-arrow-down--regular"
|
|
79
|
+
},
|
|
80
|
+
input: Schema.Struct({ file: Ref.Ref(File$1.File).annotations({ description: "The file to read." }) }),
|
|
81
|
+
output: ContentBlock.ContentBlockResult,
|
|
82
|
+
services: [Database.Service]
|
|
83
|
+
});
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/types/Settings.ts
|
|
86
|
+
var Settings_exports = /* @__PURE__ */ __exportAll({
|
|
87
|
+
DEFAULT_BACKEND_STORAGE: () => DEFAULT_BACKEND_STORAGE,
|
|
88
|
+
Settings: () => Settings
|
|
89
|
+
});
|
|
90
|
+
var DEFAULT_BACKEND_STORAGE = "inline";
|
|
91
|
+
var Settings = Schema.mutable(Schema.Struct({ backend: Schema.optional(Schema.String.annotations({
|
|
92
|
+
title: "File storage backend",
|
|
93
|
+
description: "Where uploaded files are stored. Defaults to inline (bytes saved on the ECHO object). Install additional plugins (e.g. WNFS) to add external backends."
|
|
94
|
+
})) }));
|
|
95
|
+
//#endregion
|
|
96
|
+
export { Read as a, SettingsAtom as c, isAcceptedMimeType as d, FileOperation_exports as i, FileAction as l, Settings_exports as n, Backend as o, Create as r, FileCapabilities_exports as s, File$2 as t, ACCEPTED_MIME as u };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=chunk-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-types.mjs","names":[],"sources":["../../src/types/limits.ts","../../src/types/types.ts","../../src/types/FileCapabilities.ts","../../src/types/FileOperation.ts","../../src/types/Settings.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nexport const ACCEPTED_MIME: Record<string, string[]> = {\n 'image/*': ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.svg'],\n 'video/*': ['.mp4', '.webm', '.mov'],\n 'application/pdf': ['.pdf'],\n};\n\nexport const isAcceptedMimeType = (type: string): boolean => {\n if (type === 'application/pdf') {\n return true;\n }\n if (type.startsWith('image/') || type.startsWith('video/')) {\n return true;\n }\n return false;\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from '#meta';\n\nimport { ACCEPTED_MIME } from './limits';\n\nexport namespace FileAction {\n export const UploadAnnotationId = Symbol.for(`${meta.profile.key}.annotation.upload`);\n\n export const CreateFileSchema = Schema.Struct({\n file: Schema.instanceOf(File).annotations({\n [UploadAnnotationId]: ACCEPTED_MIME,\n }),\n });\n\n export type CreateFileForm = Schema.Schema.Type<typeof CreateFileSchema>;\n}\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { type Atom } from '@effect-atom/atom';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport * as Settings from './Settings';\n\n/**\n * Descriptor for a registered `BlobBackend` storage option, surfaced in the file plugin's\n * settings UI. Actual upload/read logic lives in the Blob backend registered on the Hypergraph\n * under `storage` (see `client.graph.registerBlobBackend`) — this type carries no behavior.\n */\nexport type Backend = {\n /** Display label shown in the settings UI. */\n readonly name: string;\n /** Description shown next to the backend in settings. */\n readonly description?: string;\n /**\n * `Blob.fromBytes`'s `storage` option to use when this backend is selected. Also the settings\n * key identifying this backend — one `BlobBackend` is registered per storage name, so the two\n * concepts always coincide.\n */\n readonly storage: string;\n};\n\nexport const Backend = Capability.make<Backend>(`${meta.profile.key}.capability.backend`);\n\nexport const SettingsAtom = Capability.make<Atom.Writable<Settings.Settings>>(\n `${meta.profile.key}.capability.settings`,\n);\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, DXN, Ref, Type } from '@dxos/echo';\nimport { ContentBlock, File } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { FileAction } from './types';\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\nexport const Create = Operation.make({\n meta: { key: makeKey('create'), name: 'Create File', icon: 'ph--file--regular' },\n services: [Capability.Service],\n input: Schema.extend(FileAction.CreateFileSchema, Schema.Struct({ db: Database.Database })),\n output: Schema.Struct({\n object: Type.getSchema(File.File),\n }),\n});\n\nexport const Read = Operation.make({\n meta: {\n key: makeKey('read'),\n name: 'Read File',\n description:\n 'Reads the contents of a file and returns them as a File content block (data URL for inline files, original URL for external files).',\n icon: 'ph--file-arrow-down--regular',\n },\n input: Schema.Struct({\n file: Ref.Ref(File.File).annotations({\n description: 'The file to read.',\n }),\n }),\n output: ContentBlock.ContentBlockResult,\n services: [Database.Service],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const DEFAULT_BACKEND_STORAGE = 'inline';\n\nexport const Settings = Schema.mutable(\n Schema.Struct({\n backend: Schema.optional(\n Schema.String.annotations({\n title: 'File storage backend',\n description:\n 'Where uploaded files are stored. Defaults to inline (bytes saved on the ECHO object). Install additional plugins (e.g. WNFS) to add external backends.',\n }),\n ),\n }),\n);\n\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA,IAAa,gBAA0C;CACrD,WAAW;EAAC;EAAQ;EAAS;EAAQ;EAAQ;EAAS;CAAM;CAC5D,WAAW;EAAC;EAAQ;EAAS;CAAM;CACnC,mBAAmB,CAAC,MAAM;AAC5B;AAEA,IAAa,sBAAsB,SAA0B;CAC3D,IAAI,SAAS,mBACX,OAAO;CAET,IAAI,KAAK,WAAW,QAAQ,KAAK,KAAK,WAAW,QAAQ,GACvD,OAAO;CAET,OAAO;AACT;;;ACRO,IAAA;;CACE,MAAM,qBAAA,YAAA,qBAAqB,OAAO,IAAI,GAAG,KAAK,QAAQ,IAAI,mBAAmB;CAEvE,YAAA,mBAAmB,OAAO,OAAO,EAC5C,MAAM,OAAO,WAAW,IAAI,CAAC,CAAC,YAAY,GACvC,qBAAqB,cACxB,CAAC,EACH,CAAC;GAGH,eAAA,aAAA,CAAA,EAAA;;;;;;;ACYA,IAAa,UAAU,WAAW,KAAc,GAAG,KAAK,QAAQ,IAAI,oBAAoB;AAExF,IAAa,eAAe,WAAW,KACrC,GAAG,KAAK,QAAQ,IAAI,qBACtB;;;;;;;ACnBA,IAAM,WAAW,SAAiB,IAAI,KAAK,GAAG,KAAK,QAAQ,IAAI,aAAa,MAAM;AAElF,IAAa,SAAS,UAAU,KAAK;CACnC,MAAM;EAAE,KAAK,QAAQ,QAAQ;EAAG,MAAM;EAAe,MAAM;CAAoB;CAC/E,UAAU,CAAC,WAAW,OAAO;CAC7B,OAAO,OAAO,OAAO,WAAW,kBAAkB,OAAO,OAAO,EAAE,IAAI,SAAS,SAAS,CAAC,CAAC;CAC1F,QAAQ,OAAO,OAAO,EACpB,QAAQ,KAAK,UAAU,OAAK,IAAI,EAClC,CAAC;AACH,CAAC;AAED,IAAa,OAAO,UAAU,KAAK;CACjC,MAAM;EACJ,KAAK,QAAQ,MAAM;EACnB,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,OAAO,OAAO,OAAO,EACnB,MAAM,IAAI,IAAI,OAAK,IAAI,CAAC,CAAC,YAAY,EACnC,aAAa,oBACf,CAAC,EACH,CAAC;CACD,QAAQ,aAAa;CACrB,UAAU,CAAC,SAAS,OAAO;AAC7B,CAAC;;;;;;;ACnCD,IAAa,0BAA0B;AAEvC,IAAa,WAAW,OAAO,QAC7B,OAAO,OAAO,EACZ,SAAS,OAAO,SACd,OAAO,OAAO,YAAY;CACxB,OAAO;CACP,aACE;AACJ,CAAC,CACH,EACF,CAAC,CACH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { meta } from "#meta";
|
|
2
|
+
import { FileAction } from "#types";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { useDropzone } from "react-dropzone";
|
|
5
|
+
import { SchemaEx } from "@dxos/effect";
|
|
6
|
+
import { composable, composableProps, useTranslation } from "@dxos/react-ui";
|
|
7
|
+
import { mx } from "@dxos/ui-theme";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/FileInput/FileInput.tsx
|
|
10
|
+
var FileInput = ({ schema, onChange }) => {
|
|
11
|
+
const { t } = useTranslation(meta.profile.key);
|
|
12
|
+
const { acceptedFiles, getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = useDropzone({
|
|
13
|
+
multiple: false,
|
|
14
|
+
accept: SchemaEx.findAnnotation(schema.ast, FileAction.UploadAnnotationId),
|
|
15
|
+
onDropAccepted: useCallback((files) => onChange?.(files[0]), [onChange])
|
|
16
|
+
});
|
|
17
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
...getRootProps(),
|
|
19
|
+
className: mx("flex flex-col items-center p-8 border border-separator", isFocused && "focus-ring", isDragAccept && "bg-attention-surface", isDragReject && "border-rose-bg"),
|
|
20
|
+
children: [/* @__PURE__ */ jsx("input", { ...getInputProps() }), acceptedFiles[0] ? /* @__PURE__ */ jsx("p", { children: acceptedFiles[0].name }) : /* @__PURE__ */ jsx("p", { children: t("file-input.placeholder") })]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/FilePreview/FilePreview.tsx
|
|
25
|
+
/**
|
|
26
|
+
* File/content preview — image, video, PDF (iframe), or fallback download link.
|
|
27
|
+
*/
|
|
28
|
+
var FilePreview = composable(({ type, url, children, ...props }, forwardedRef) => {
|
|
29
|
+
if (type.startsWith("image/")) return /* @__PURE__ */ jsx("img", {
|
|
30
|
+
...composableProps(props, { classNames: "h-full w-full object-contain" }),
|
|
31
|
+
src: url,
|
|
32
|
+
ref: forwardedRef
|
|
33
|
+
});
|
|
34
|
+
else if (type.startsWith("video/")) return /* @__PURE__ */ jsx("video", {
|
|
35
|
+
...composableProps(props, { classNames: "h-full w-full object-contain" }),
|
|
36
|
+
src: url,
|
|
37
|
+
controls: true,
|
|
38
|
+
ref: forwardedRef
|
|
39
|
+
});
|
|
40
|
+
else if (type === "application/pdf") return /* @__PURE__ */ jsx("iframe", {
|
|
41
|
+
...composableProps(props, { classNames: "h-full w-full overflow-auto" }),
|
|
42
|
+
src: url,
|
|
43
|
+
title: "PDF preview",
|
|
44
|
+
ref: forwardedRef
|
|
45
|
+
});
|
|
46
|
+
else return /* @__PURE__ */ jsx("a", {
|
|
47
|
+
...composableProps(props, { classNames: "p-4 underline" }),
|
|
48
|
+
href: url,
|
|
49
|
+
download: true,
|
|
50
|
+
ref: forwardedRef,
|
|
51
|
+
children: "Download file"
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
export { FileInput, FilePreview };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=components.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.mjs","names":[],"sources":["../../src/components/FileInput/FileInput.tsx","../../src/components/FilePreview/FilePreview.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as Schema from 'effect/Schema';\nimport React, { useCallback } from 'react';\nimport { useDropzone } from 'react-dropzone';\n\nimport { SchemaEx } from '@dxos/effect';\nimport { useTranslation } from '@dxos/react-ui';\nimport { mx } from '@dxos/ui-theme';\n\nimport { meta } from '#meta';\nimport { FileAction } from '#types';\n\nexport type FileInputProps = {\n schema: Schema.Schema.AnyNoContext;\n onChange: (file: File) => void;\n};\n\nexport const FileInput = ({ schema, onChange }: FileInputProps) => {\n const { t } = useTranslation(meta.profile.key);\n const accept = SchemaEx.findAnnotation<Record<string, string[]>>(schema.ast, FileAction.UploadAnnotationId);\n\n const onDropAccepted = useCallback((files: File[]) => onChange?.(files[0]), [onChange]);\n\n // No client-side size cap here — the active backend determines the limit (inline is capped,\n // edge/wnfs are not), and `op:Create` enforces it against the actual selected backend.\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-surface',\n isDragReject && 'border-rose-bg',\n )}\n >\n <input {...getInputProps()} />\n {acceptedFiles[0] ? <p>{acceptedFiles[0].name}</p> : <p>{t('file-input.placeholder')}</p>}\n </div>\n );\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { ForwardedRef } from 'react';\n\nimport { composable, composableProps } from '@dxos/react-ui';\n\nexport type FilePreviewProps = { type: string; url: string };\n\n/**\n * File/content preview — image, video, PDF (iframe), or fallback download link.\n */\nexport const FilePreview = composable<HTMLElement, FilePreviewProps>(\n ({ type, url, children, ...props }, forwardedRef) => {\n if (type.startsWith('image/')) {\n return (\n <img\n {...composableProps(props, { classNames: 'h-full w-full object-contain' })}\n src={url}\n ref={forwardedRef as ForwardedRef<HTMLImageElement>}\n />\n );\n } else if (type.startsWith('video/')) {\n return (\n <video\n {...composableProps(props, { classNames: 'h-full w-full object-contain' })}\n src={url}\n controls\n ref={forwardedRef as ForwardedRef<HTMLVideoElement>}\n />\n );\n } else if (type === 'application/pdf') {\n return (\n <iframe\n {...composableProps(props, { classNames: 'h-full w-full overflow-auto' })}\n src={url}\n title='PDF preview'\n ref={forwardedRef as ForwardedRef<HTMLIFrameElement>}\n />\n );\n } else {\n return (\n <a\n {...composableProps(props, { classNames: 'p-4 underline' })}\n href={url}\n download\n ref={forwardedRef as ForwardedRef<HTMLAnchorElement>}\n >\n Download file\n </a>\n );\n }\n },\n);\n"],"mappings":";;;;;;;;;AAoBA,IAAa,aAAa,EAAE,QAAQ,eAA+B;CACjE,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAO7C,MAAM,EAAE,eAAe,cAAc,eAAe,WAAW,cAAc,iBAAiB,YAAY;EACxG,UAAU;EACV,QARa,SAAS,eAAyC,OAAO,KAAK,WAAW,kBAQtF;EACA,gBAPqB,aAAa,UAAkB,WAAW,MAAM,EAAE,GAAG,CAAC,QAAQ,CAOnF;CACF,CAAC;CAED,OACE,qBAAC,OAAD;EACE,GAAI,aAAa;EACjB,WAAW,GACT,0DACA,aAAa,cACb,gBAAgB,wBAChB,gBAAgB,gBAClB;YAPF,CASE,oBAAC,SAAD,EAAO,GAAI,cAAc,EAAI,CAAA,GAC5B,cAAc,KAAK,oBAAC,KAAD,EAAA,UAAI,cAAc,EAAE,CAAC,KAAQ,CAAA,IAAI,oBAAC,KAAD,EAAA,UAAI,EAAE,wBAAwB,EAAK,CAAA,CACrF;;AAET;;;;;;ACnCA,IAAa,cAAc,YACxB,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,iBAAiB;CACnD,IAAI,KAAK,WAAW,QAAQ,GAC1B,OACE,oBAAC,OAAD;EACE,GAAI,gBAAgB,OAAO,EAAE,YAAY,+BAA+B,CAAC;EACzE,KAAK;EACL,KAAK;CACN,CAAA;MAEE,IAAI,KAAK,WAAW,QAAQ,GACjC,OACE,oBAAC,SAAD;EACE,GAAI,gBAAgB,OAAO,EAAE,YAAY,+BAA+B,CAAC;EACzE,KAAK;EACL,UAAA;EACA,KAAK;CACN,CAAA;MAEE,IAAI,SAAS,mBAClB,OACE,oBAAC,UAAD;EACE,GAAI,gBAAgB,OAAO,EAAE,YAAY,8BAA8B,CAAC;EACxE,KAAK;EACL,OAAM;EACN,KAAK;CACN,CAAA;MAGH,OACE,oBAAC,KAAD;EACE,GAAI,gBAAgB,OAAO,EAAE,YAAY,gBAAgB,CAAC;EAC1D,MAAM;EACN,UAAA;EACA,KAAK;YACP;CAEG,CAAA;AAGT,CACF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { meta } from "#meta";
|
|
2
|
+
import { FileCapabilities, Settings } from "#types";
|
|
3
|
+
import { lazy, useCallback } from "react";
|
|
4
|
+
import { Select, useTranslation } from "@dxos/react-ui";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useCapabilities, useSettingsState } from "@dxos/app-framework/ui";
|
|
7
|
+
import { useClient } from "@dxos/react-client";
|
|
8
|
+
import { Form } from "@dxos/react-ui-form";
|
|
9
|
+
//#region src/containers/FileSettings/FileSettings.tsx
|
|
10
|
+
var FileSettings = ({ subject }) => {
|
|
11
|
+
const { t } = useTranslation(meta.profile.key);
|
|
12
|
+
const { settings, updateSettings } = useSettingsState(subject.atom);
|
|
13
|
+
const client = useClient();
|
|
14
|
+
const backends = useCapabilities(FileCapabilities.Backend);
|
|
15
|
+
const active = (settings.backend ? backends.find((b) => b.storage === settings.backend) : void 0) ?? backends.find((b) => b.storage === client.graph.defaultBlobStorage) ?? backends[0];
|
|
16
|
+
const activeStorage = active?.storage ?? Settings.DEFAULT_BACKEND_STORAGE;
|
|
17
|
+
const handleChange = useCallback((value) => updateSettings((current) => ({
|
|
18
|
+
...current,
|
|
19
|
+
backend: value
|
|
20
|
+
})), [updateSettings]);
|
|
21
|
+
return /* @__PURE__ */ jsx(Form.Root, {
|
|
22
|
+
schema: Settings.Settings,
|
|
23
|
+
values: settings,
|
|
24
|
+
variant: "settings",
|
|
25
|
+
onValuesChanged: (values) => updateSettings((current) => ({
|
|
26
|
+
...current,
|
|
27
|
+
...values
|
|
28
|
+
})),
|
|
29
|
+
children: /* @__PURE__ */ jsx(Form.Viewport, {
|
|
30
|
+
scroll: true,
|
|
31
|
+
children: /* @__PURE__ */ jsx(Form.Content, { children: /* @__PURE__ */ jsx(Form.Section, {
|
|
32
|
+
title: meta.profile.name ?? meta.profile.key,
|
|
33
|
+
children: /* @__PURE__ */ jsx(Form.Row, {
|
|
34
|
+
label: t("settings.backend.label"),
|
|
35
|
+
description: active?.description ?? t("settings.backend.description"),
|
|
36
|
+
children: /* @__PURE__ */ jsxs(Select.Root, {
|
|
37
|
+
value: activeStorage,
|
|
38
|
+
onValueChange: handleChange,
|
|
39
|
+
children: [/* @__PURE__ */ jsx(Select.TriggerButton, { placeholder: t("settings.backend.placeholder") }), /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsxs(Select.Content, { children: [/* @__PURE__ */ jsx(Select.Viewport, { children: backends.map((backend) => /* @__PURE__ */ jsx(Select.Option, {
|
|
40
|
+
value: backend.storage,
|
|
41
|
+
children: backend.name
|
|
42
|
+
}, backend.storage)) }), /* @__PURE__ */ jsx(Select.Arrow, {})] }) })]
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
}) })
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
FileSettings.displayName = "FileSettings";
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/containers/index.ts
|
|
52
|
+
var FileArticle = lazy(() => import("./chunk-FileArticle.mjs"));
|
|
53
|
+
//#endregion
|
|
54
|
+
export { FileArticle, FileSettings };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=containers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containers.mjs","names":[],"sources":["../../src/containers/FileSettings/FileSettings.tsx","../../src/containers/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { useCapabilities, useSettingsState } from '@dxos/app-framework/ui';\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { useClient } from '@dxos/react-client';\nimport { Select, useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { FileCapabilities, Settings } from '#types';\n\nexport type FileSettingsProps = AppSurface.SettingsData;\n\nexport const FileSettings = ({ subject }: FileSettingsProps) => {\n const { t } = useTranslation(meta.profile.key);\n const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);\n const client = useClient();\n const backends = useCapabilities(FileCapabilities.Backend);\n // No explicit choice defers to the Blob registry's own configured default (edge when\n // configured, inline otherwise), so the Select reflects what an upload will actually use.\n const requested = settings.backend ? backends.find((b) => b.storage === settings.backend) : undefined;\n const active = requested ?? backends.find((b) => b.storage === client.graph.defaultBlobStorage) ?? backends[0];\n // Use the resolved backend's storage name so the Select never shows a missing/stale value.\n const activeStorage = active?.storage ?? Settings.DEFAULT_BACKEND_STORAGE;\n\n const handleChange = useCallback(\n (value: string) => updateSettings((current) => ({ ...current, backend: value })),\n [updateSettings],\n );\n\n return (\n <Form.Root\n schema={Settings.Settings}\n values={settings}\n variant='settings'\n onValuesChanged={(values) => updateSettings((current) => ({ ...current, ...values }))}\n >\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={meta.profile.name ?? meta.profile.key}>\n <Form.Row\n label={t('settings.backend.label')}\n description={active?.description ?? t('settings.backend.description')}\n >\n <Select.Root value={activeStorage} onValueChange={handleChange}>\n <Select.TriggerButton placeholder={t('settings.backend.placeholder')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {backends.map((backend) => (\n <Select.Option key={backend.storage} value={backend.storage}>\n {backend.name}\n </Select.Option>\n ))}\n </Select.Viewport>\n <Select.Arrow />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </Form.Row>\n </Form.Section>\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n\nFileSettings.displayName = 'FileSettings';\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const FileArticle: ComponentType<any> = lazy(() => import('./FileArticle'));\n\nexport * from './FileSettings';\n"],"mappings":";;;;;;;;;AAiBA,IAAa,gBAAgB,EAAE,cAAiC;CAC9D,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAC7C,MAAM,EAAE,UAAU,mBAAmB,iBAAoC,QAAQ,IAAI;CACrF,MAAM,SAAS,UAAU;CACzB,MAAM,WAAW,gBAAgB,iBAAiB,OAAO;CAIzD,MAAM,UADY,SAAS,UAAU,SAAS,MAAM,MAAM,EAAE,YAAY,SAAS,OAAO,IAAI,KAAA,MAChE,SAAS,MAAM,MAAM,EAAE,YAAY,OAAO,MAAM,kBAAkB,KAAK,SAAS;CAE5G,MAAM,gBAAgB,QAAQ,WAAW,SAAS;CAElD,MAAM,eAAe,aAClB,UAAkB,gBAAgB,aAAa;EAAE,GAAG;EAAS,SAAS;CAAM,EAAE,GAC/E,CAAC,cAAc,CACjB;CAEA,OACE,oBAAC,KAAK,MAAN;EACE,QAAQ,SAAS;EACjB,QAAQ;EACR,SAAQ;EACR,kBAAkB,WAAW,gBAAgB,aAAa;GAAE,GAAG;GAAS,GAAG;EAAO,EAAE;YAEpF,oBAAC,KAAK,UAAN;GAAe,QAAA;aACb,oBAAC,KAAK,SAAN,EAAA,UACE,oBAAC,KAAK,SAAN;IAAc,OAAO,KAAK,QAAQ,QAAQ,KAAK,QAAQ;cACrD,oBAAC,KAAK,KAAN;KACE,OAAO,EAAE,wBAAwB;KACjC,aAAa,QAAQ,eAAe,EAAE,8BAA8B;eAEpE,qBAAC,OAAO,MAAR;MAAa,OAAO;MAAe,eAAe;gBAAlD,CACE,oBAAC,OAAO,eAAR,EAAsB,aAAa,EAAE,8BAA8B,EAAI,CAAA,GACvE,oBAAC,OAAO,QAAR,EAAA,UACE,qBAAC,OAAO,SAAR,EAAA,UAAA,CACE,oBAAC,OAAO,UAAR,EAAA,UACG,SAAS,KAAK,YACb,oBAAC,OAAO,QAAR;OAAqC,OAAO,QAAQ;iBACjD,QAAQ;MACI,GAFK,QAAQ,OAEb,CAChB,EACc,CAAA,GACjB,oBAAC,OAAO,OAAR,CAAe,CAAA,CACD,EAAA,CAAA,EACH,CAAA,CACJ;;IACL,CAAA;GACE,CAAA,EACF,CAAA;EACD,CAAA;CACN,CAAA;AAEf;AAEA,aAAa,cAAc;;;ACjE3B,IAAa,cAAkC,WAAW,OAAO,0BAAgB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { d as isAcceptedMimeType, i as FileOperation_exports, l as FileAction, n as Settings_exports, s as FileCapabilities_exports, t as File, u as ACCEPTED_MIME } from "./chunk-types.mjs";
|
|
2
|
+
import { n as skill, t as SKILL_KEY } from "./chunk-skills.mjs";
|
|
3
|
+
import { t as meta } from "./chunk-meta.mjs";
|
|
4
|
+
export { ACCEPTED_MIME, File, FileAction, FileCapabilities_exports as FileCapabilities, FileOperation_exports as FileOperation, skill as FileSkill, SKILL_KEY, Settings_exports as Settings, isAcceptedMimeType, meta };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
2
|
+
//#region src/operations/index.ts
|
|
3
|
+
var FileOperationHandlerSet = OperationHandlerSet.lazy(() => import("./chunk-create.mjs"), () => import("./chunk-read.mjs"));
|
|
4
|
+
//#endregion
|
|
5
|
+
export { FileOperationHandlerSet };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.mjs","names":[],"sources":["../../src/operations/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const FileOperationHandlerSet = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./read'),\n);\n"],"mappings":";;AAMA,IAAa,0BAA0B,oBAAoB,WACnD,OAAO,6BACP,OAAO,mBACf"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t as meta } from "./chunk-meta.mjs";
|
|
2
|
+
import { FileOperationHandlerSet } from "./operations.mjs";
|
|
3
|
+
import { Plugin } from "@dxos/app-framework";
|
|
4
|
+
//#region src/plugin.ts
|
|
5
|
+
var FilePlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { FileOperationHandlerSet, FilePlugin };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/plugin.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const FilePlugin = Plugin.lazy(meta, () => import('#plugin'));\n\nexport { FileOperationHandlerSet } from './operations';\n"],"mappings":";;;;AAQA,IAAa,aAAa,OAAO,KAAK,YAAY,OAAO,UAAU"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { meta } from "#meta";
|
|
2
|
+
import { Type } from "@dxos/echo";
|
|
3
|
+
import { File } from "#types";
|
|
4
|
+
//#region src/translations.ts
|
|
5
|
+
var translations = [{ "en-US": {
|
|
6
|
+
[Type.getTypename(File.File)]: {
|
|
7
|
+
"typename.label": "File",
|
|
8
|
+
"typename.label_zero": "Files",
|
|
9
|
+
"typename.label_one": "File",
|
|
10
|
+
"typename.label_other": "Files",
|
|
11
|
+
"object-name.placeholder": "New file",
|
|
12
|
+
"add-object.label": "Add file",
|
|
13
|
+
"rename-object.label": "Rename file",
|
|
14
|
+
"delete-object.label": "Delete file",
|
|
15
|
+
"object-deleted.label": "File deleted"
|
|
16
|
+
},
|
|
17
|
+
[meta.profile.key]: {
|
|
18
|
+
"plugin.name": "File",
|
|
19
|
+
"file-input.placeholder": "Drop a file here, or click to select a file",
|
|
20
|
+
"too-large-error.message": "File is too large. Maximum size is 4MB.",
|
|
21
|
+
"unsupported-type-error.message": "Unsupported file type. Only images, videos, and PDFs are allowed.",
|
|
22
|
+
"settings.backend.label": "Storage backend",
|
|
23
|
+
"settings.backend.description": "Where uploaded files are stored. Install additional plugins (e.g. WNFS) to add backends.",
|
|
24
|
+
"settings.backend.placeholder": "Select backend"
|
|
25
|
+
}
|
|
26
|
+
} }];
|
|
27
|
+
//#endregion
|
|
28
|
+
export { translations };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.mjs","names":[],"sources":["../../src/translations.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Type } from '@dxos/echo';\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\nimport { File } from '#types';\n\nexport const translations = [\n {\n 'en-US': {\n [Type.getTypename(File.File)]: {\n 'typename.label': 'File',\n 'typename.label_zero': 'Files',\n 'typename.label_one': 'File',\n 'typename.label_other': 'Files',\n 'object-name.placeholder': 'New file',\n 'add-object.label': 'Add file',\n 'rename-object.label': 'Rename file',\n 'delete-object.label': 'Delete file',\n 'object-deleted.label': 'File deleted',\n },\n [meta.profile.key]: {\n 'plugin.name': 'File',\n 'file-input.placeholder': 'Drop a file here, or click to select a file',\n 'too-large-error.message': 'File is too large. Maximum size is 4MB.',\n 'unsupported-type-error.message': 'Unsupported file type. Only images, videos, and PDFs are allowed.',\n 'settings.backend.label': 'Storage backend',\n 'settings.backend.description':\n 'Where uploaded files are stored. Install additional plugins (e.g. WNFS) to add backends.',\n 'settings.backend.placeholder': 'Select backend',\n },\n },\n },\n] as const satisfies Resource[];\n"],"mappings":";;;;AAUA,IAAa,eAAe,CAC1B,EACE,SAAS;EACN,KAAK,YAAY,KAAK,IAAI,IAAI;EAC7B,kBAAkB;EAClB,uBAAuB;EACvB,sBAAsB;EACtB,wBAAwB;EACxB,2BAA2B;EAC3B,oBAAoB;EACpB,uBAAuB;EACvB,uBAAuB;EACvB,wBAAwB;CAC1B;EACC,KAAK,QAAQ,MAAM;EAClB,eAAe;EACf,0BAA0B;EAC1B,2BAA2B;EAC3B,kCAAkC;EAClC,0BAA0B;EAC1B,gCACE;EACF,gCAAgC;CAClC;AACF,EACF,CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { d as isAcceptedMimeType, i as FileOperation_exports, l as FileAction, n as Settings_exports, s as FileCapabilities_exports, t as File, u as ACCEPTED_MIME } from "./chunk-types.mjs";
|
|
2
|
+
export { ACCEPTED_MIME, File, FileAction, FileCapabilities_exports as FileCapabilities, FileOperation_exports as FileOperation, Settings_exports as Settings, isAcceptedMimeType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePlugin.d.ts","sourceRoot":"","sources":["../../../src/FilePlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"FilePlugin.d.ts","sourceRoot":"","sources":["../../../src/FilePlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAwB7C,eAAO,MAAM,UAAU,4BAgCtB,CAAC;eAEa,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePlugin.node.d.ts","sourceRoot":"","sources":["../../../src/FilePlugin.node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"FilePlugin.node.d.ts","sourceRoot":"","sources":["../../../src/FilePlugin.node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C,eAAO,MAAM,UAAU,4BAKtB,CAAC;eAEa,UAAU"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Surface } from '@dxos/app-framework/ui';
|
|
3
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
4
|
+
import { type FormFieldRendererProps } from '@dxos/react-ui-form';
|
|
5
|
+
/** The form renderer's own props ride alongside `data` on the surface envelope. */
|
|
6
|
+
export type FileUploadFieldProps = Surface.ComponentProps<AppSurface.FormInputData> & Pick<FormFieldRendererProps<File>, 'onValueChange'>;
|
|
7
|
+
/**
|
|
8
|
+
* Form field that uploads a file for an upload-annotated property. It consumes the whole surface
|
|
9
|
+
* envelope, so it is registered without a `props` mapper.
|
|
10
|
+
*/
|
|
11
|
+
export declare const FileUploadField: ({ data, onValueChange }: FileUploadFieldProps) => React.JSX.Element | null;
|
|
12
|
+
//# sourceMappingURL=FileUploadField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileUploadField.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/FileUploadField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIlE,mFAAmF;AACnF,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,GACjF,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,eAAe,4BAA6B,oBAAoB,6BAgB5E,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
2
|
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props: void) => Effect.Effect<Capability.Any, never,
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=create-object.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Any, Error, import("effect/Scope").Scope | Capability.Service>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=edge-backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-backend.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/edge-backend.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
2
|
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props: void) => Effect.Effect<Capability.Any, never, Capability.Service>;
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope | Capability.Service>;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=file-uploader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-uploader.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/file-uploader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"file-uploader.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/file-uploader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { Capability } from '@dxos/app-framework';
|
|
|
2
2
|
import { OperationHandlerSet } from '@dxos/compute';
|
|
3
3
|
export declare const SkillDefinition: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
4
4
|
export declare const CreateObject: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
5
|
+
export declare const EdgeBackend: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
5
6
|
export declare const FileUploader: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
6
7
|
export declare const InlineBackend: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
7
8
|
export declare const Markdown: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,eAAO,MAAM,eAAe,iEAAyE,CAAC;AACtG,eAAO,MAAM,YAAY,iEAAmE,CAAC;AAC7F,eAAO,MAAM,YAAY,iEAAmE,CAAC;AAC7F,eAAO,MAAM,aAAa,iEAAqE,CAAC;AAChG,eAAO,MAAM,QAAQ,iEAA6E,CAAC;AACnG,eAAO,MAAM,gBAAgB,oGAG5B,CAAC;AACF,eAAO,MAAM,YAAY,iEAAmE,CAAC;AAC7F,eAAO,MAAM,QAAQ,iEAA0D,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,eAAO,MAAM,eAAe,iEAAyE,CAAC;AACtG,eAAO,MAAM,YAAY,iEAAmE,CAAC;AAC7F,eAAO,MAAM,WAAW,iEAAiE,CAAC;AAC1F,eAAO,MAAM,YAAY,iEAAmE,CAAC;AAC7F,eAAO,MAAM,aAAa,iEAAqE,CAAC;AAChG,eAAO,MAAM,QAAQ,iEAA6E,CAAC;AACnG,eAAO,MAAM,gBAAgB,oGAG5B,CAAC;AACF,eAAO,MAAM,YAAY,iEAAmE,CAAC;AAC7F,eAAO,MAAM,QAAQ,iEAA0D,CAAC"}
|
|
@@ -2,10 +2,10 @@ import * as Effect from 'effect/Effect';
|
|
|
2
2
|
import { Capability } from '@dxos/app-framework';
|
|
3
3
|
import { FileCapabilities } from '#types';
|
|
4
4
|
/**
|
|
5
|
-
* Inline backend: file bytes are stored on the ECHO object itself.
|
|
5
|
+
* Inline backend descriptor: file bytes are stored on the ECHO object itself.
|
|
6
6
|
* Exported standalone for direct testing.
|
|
7
7
|
*/
|
|
8
8
|
export declare const inlineBackend: FileCapabilities.Backend;
|
|
9
|
-
declare const _default: (props: void) => Effect.Effect<Capability.Any, never,
|
|
9
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
|
|
10
10
|
export default _default;
|
|
11
11
|
//# sourceMappingURL=inline-backend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-backend.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/inline-backend.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"inline-backend.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/inline-backend.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,OAI5C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
2
|
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props: void) => Effect.Effect<Capability.Any, never,
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=markdown-extension.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Capability } from '@dxos/app-framework';
|
|
2
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
3
|
+
export declare const CreateObject: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
4
|
+
export declare const OperationHandler: Capability.LazyCapability<OperationHandlerSet.OperationHandlerSet, Capability.ModuleReturn, Error>;
|
|
5
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAMpD,eAAO,MAAM,YAAY,iEAAmE,CAAC;AAC7F,eAAO,MAAM,gBAAgB,oGAG5B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
2
|
import { Capability } from '@dxos/app-framework';
|
|
3
3
|
import type { OperationHandlerSet } from '@dxos/compute';
|
|
4
|
-
declare const _default: (props: OperationHandlerSet.OperationHandlerSet) => Effect.Effect<Capability.ModuleReturn, Error, Capability.Service>;
|
|
4
|
+
declare const _default: (props: OperationHandlerSet.OperationHandlerSet) => Effect.Effect<Capability.ModuleReturn, Error, import("effect/Scope").Scope | Capability.Service>;
|
|
5
5
|
export default _default;
|
|
6
6
|
//# sourceMappingURL=operation-handler.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
2
|
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props: void) => Effect.Effect<Capability.Any, never,
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=react-surface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.
|
|
1
|
+
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Effect from 'effect/Effect';
|
|
2
2
|
import { Capability } from '@dxos/app-framework';
|
|
3
|
-
declare const _default: (props: void) => Effect.Effect<[Capability.Any, Capability.Any], never,
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<[Capability.Any, Capability.Any], never, import("effect/Scope").Scope>;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,YAAY,CAAC;IACnC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,SAAS,yBAA0B,cAAc,
|
|
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,YAAY,CAAC;IACnC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,SAAS,yBAA0B,cAAc,sBA4B7D,CAAC"}
|
|
@@ -8,5 +8,5 @@ export type FilePreviewProps = {
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const FilePreview: React.ForwardRefExoticComponent<Omit<FilePreviewProps, "className"> & {
|
|
10
10
|
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
11
|
-
} & Pick<React.HTMLAttributes<Element>, "children" | "
|
|
11
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLElement>>;
|
|
12
12
|
//# sourceMappingURL=FilePreview.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;;
|
|
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;;0GAyCvB,CAAC"}
|
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
3
|
import { File } from '#types';
|
|
4
4
|
export type FileArticleProps = AppSurface.ObjectArticleProps<File.File>;
|
|
5
|
-
export declare
|
|
5
|
+
export declare function FileArticle({ role, subject: file }: FileArticleProps): React.JSX.Element | null;
|
|
6
6
|
export default FileArticle;
|
|
7
|
+
export declare namespace FileArticle {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
7
10
|
//# sourceMappingURL=FileArticle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileArticle.d.ts","sourceRoot":"","sources":["../../../../../src/containers/FileArticle/FileArticle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileArticle.d.ts","sourceRoot":"","sources":["../../../../../src/containers/FileArticle/FileArticle.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAMvD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oCAE5C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,gBAAgB;eAsEtD,WAAW"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export declare
|
|
3
|
+
export type FileSettingsProps = AppSurface.SettingsData;
|
|
4
|
+
export declare function FileSettings({ subject }: FileSettingsProps): React.JSX.Element;
|
|
5
|
+
export declare namespace FileSettings {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
6
8
|
//# sourceMappingURL=FileSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSettings.d.ts","sourceRoot":"","sources":["../../../../../src/containers/FileSettings/FileSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"FileSettings.d.ts","sourceRoot":"","sources":["../../../../../src/containers/FileSettings/FileSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAQvD,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,YAAY,CAAC;qCAE3B,EAAE,OAAO,EAAE,EAAE,iBAAiB"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { type Extension } from '@codemirror/state';
|
|
2
2
|
import { type Space } from '@dxos/react-client/echo';
|
|
3
|
-
import { FileCapabilities } from '#types';
|
|
4
3
|
export type ImageOptions = {
|
|
5
4
|
space: Space;
|
|
6
|
-
resolvers: readonly FileCapabilities.UrlResolver[];
|
|
7
5
|
};
|
|
8
6
|
/**
|
|
9
7
|
* Decorate `` references that resolve to File objects with inline image previews.
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/extensions/image.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,SAAS,EAA0B,MAAM,mBAAmB,CAAC;AAU7F,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAUrD,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,YAAa,YAAY,KAAG,SAAS,EA2CtD,CAAC"}
|