@dxos/plugin-wnfs 0.6.14-main.1366248
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +8 -0
- package/README.md +15 -0
- package/dist/lib/browser/FileCard-HJIZDWJF.mjs +39 -0
- package/dist/lib/browser/FileCard-HJIZDWJF.mjs.map +7 -0
- package/dist/lib/browser/FileMain-WEWTX7QB.mjs +27 -0
- package/dist/lib/browser/FileMain-WEWTX7QB.mjs.map +7 -0
- package/dist/lib/browser/FileSection-BEUGJ7EI.mjs +24 -0
- package/dist/lib/browser/FileSection-BEUGJ7EI.mjs.map +7 -0
- package/dist/lib/browser/FileSlide-NYBGZEZS.mjs +21 -0
- package/dist/lib/browser/FileSlide-NYBGZEZS.mjs.map +7 -0
- package/dist/lib/browser/chunk-2I63TM7M.mjs +27 -0
- package/dist/lib/browser/chunk-2I63TM7M.mjs.map +7 -0
- package/dist/lib/browser/chunk-CUGB532P.mjs +30 -0
- package/dist/lib/browser/chunk-CUGB532P.mjs.map +7 -0
- package/dist/lib/browser/chunk-VL3H7P4F.mjs +18 -0
- package/dist/lib/browser/chunk-VL3H7P4F.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +517 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/meta.mjs +9 -0
- package/dist/lib/browser/meta.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/types/src/WnfsPlugin.d.ts +4 -0
- package/dist/types/src/WnfsPlugin.d.ts.map +1 -0
- package/dist/types/src/blockstore.d.ts +19 -0
- package/dist/types/src/blockstore.d.ts.map +1 -0
- package/dist/types/src/common.d.ts +11 -0
- package/dist/types/src/common.d.ts.map +1 -0
- package/dist/types/src/components/FileCard.d.ts +9 -0
- package/dist/types/src/components/FileCard.d.ts.map +1 -0
- package/dist/types/src/components/FileMain.d.ts +7 -0
- package/dist/types/src/components/FileMain.d.ts.map +1 -0
- package/dist/types/src/components/FilePreview.d.ts +11 -0
- package/dist/types/src/components/FilePreview.d.ts.map +1 -0
- package/dist/types/src/components/FileSection.d.ts +8 -0
- package/dist/types/src/components/FileSection.d.ts.map +1 -0
- package/dist/types/src/components/FileSlide.d.ts +8 -0
- package/dist/types/src/components/FileSlide.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +14 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/extensions/image.d.ts +9 -0
- package/dist/types/src/extensions/image.d.ts.map +1 -0
- package/dist/types/src/extensions/image.stories.d.ts +10 -0
- package/dist/types/src/extensions/image.stories.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +2 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/load.d.ts +8 -0
- package/dist/types/src/load.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +11 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +11 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/file.d.ts +20 -0
- package/dist/types/src/types/file.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +8 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/upload.d.ts +10 -0
- package/dist/types/src/upload.d.ts.map +1 -0
- package/dist/types/src/wnfs-url.d.ts +2 -0
- package/dist/types/src/wnfs-url.d.ts.map +1 -0
- package/package.json +82 -0
- package/src/WnfsPlugin.tsx +102 -0
- package/src/blockstore.ts +96 -0
- package/src/common.ts +84 -0
- package/src/components/FileCard.tsx +45 -0
- package/src/components/FileMain.tsx +28 -0
- package/src/components/FilePreview.tsx +23 -0
- package/src/components/FileSection.tsx +20 -0
- package/src/components/FileSlide.tsx +20 -0
- package/src/components/index.ts +11 -0
- package/src/extensions/image.stories.tsx +142 -0
- package/src/extensions/image.ts +244 -0
- package/src/extensions/index.ts +5 -0
- package/src/index.ts +9 -0
- package/src/load.ts +63 -0
- package/src/meta.ts +16 -0
- package/src/translations.ts +17 -0
- package/src/types/file.ts +13 -0
- package/src/types/index.ts +6 -0
- package/src/types/types.ts +27 -0
- package/src/upload.ts +46 -0
- package/src/wnfs-url.ts +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-wnfs/src/common.ts":{"bytes":7811,"imports":[{"path":"multiformats/cid","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/blockstore.ts":{"bytes":8224,"imports":[{"path":"blockstore-core","kind":"import-statement","external":true},{"path":"blockstore-idb","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/common.ts","kind":"import-statement","original":"./common"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/components/FileCard.tsx":{"bytes":5241,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-card","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/components/FilePreview.tsx":{"bytes":2928,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/components/FileMain.tsx":{"bytes":2672,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/components/FilePreview.tsx","kind":"import-statement","original":"./FilePreview"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/components/FileSection.tsx":{"bytes":2081,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/components/FilePreview.tsx","kind":"import-statement","original":"./FilePreview"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/components/FileSlide.tsx":{"bytes":1990,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/components/FilePreview.tsx","kind":"import-statement","original":"./FilePreview"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/components/index.ts":{"bytes":1687,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/components/FileCard.tsx","kind":"dynamic-import","original":"./FileCard"},{"path":"packages/plugins/experimental/plugin-wnfs/src/components/FileMain.tsx","kind":"dynamic-import","original":"./FileMain"},{"path":"packages/plugins/experimental/plugin-wnfs/src/components/FileSection.tsx","kind":"dynamic-import","original":"./FileSection"},{"path":"packages/plugins/experimental/plugin-wnfs/src/components/FileSlide.tsx","kind":"dynamic-import","original":"./FileSlide"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/load.ts":{"bytes":7140,"imports":[{"path":"multiformats","kind":"import-statement","external":true},{"path":"uint8arrays","kind":"import-statement","external":true},{"path":"wnfs","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/common.ts","kind":"import-statement","original":"./common"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/extensions/image.ts":{"bytes":22790,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/common.ts","kind":"import-statement","original":"../common"},{"path":"packages/plugins/experimental/plugin-wnfs/src/load.ts","kind":"import-statement","original":"../load"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/extensions/index.ts":{"bytes":517,"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/src/extensions/image.ts","kind":"import-statement","original":"./image"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/meta.ts":{"bytes":1559,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/translations.ts":{"bytes":1280,"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/types/file.ts":{"bytes":1678,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/types/types.ts":{"bytes":1750,"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/types/index.ts":{"bytes":592,"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/src/types/file.ts","kind":"import-statement","original":"./file"},{"path":"packages/plugins/experimental/plugin-wnfs/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/wnfs-url.ts":{"bytes":943,"imports":[],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/upload.ts":{"bytes":6174,"imports":[{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/codecs/raw","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/common.ts","kind":"import-statement","original":"./common"},{"path":"packages/plugins/experimental/plugin-wnfs/src/load.ts","kind":"import-statement","original":"./load"},{"path":"packages/plugins/experimental/plugin-wnfs/src/wnfs-url.ts","kind":"import-statement","original":"./wnfs-url"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/WnfsPlugin.tsx":{"bytes":14058,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/src/blockstore.ts","kind":"import-statement","original":"./blockstore"},{"path":"packages/plugins/experimental/plugin-wnfs/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-wnfs/src/extensions/index.ts","kind":"import-statement","original":"./extensions"},{"path":"packages/plugins/experimental/plugin-wnfs/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-wnfs/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-wnfs/src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/experimental/plugin-wnfs/src/upload.ts","kind":"import-statement","original":"./upload"}],"format":"esm"},"packages/plugins/experimental/plugin-wnfs/src/index.ts":{"bytes":765,"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/src/WnfsPlugin.tsx","kind":"import-statement","original":"./WnfsPlugin"},{"path":"packages/plugins/experimental/plugin-wnfs/src/WnfsPlugin.tsx","kind":"import-statement","original":"./WnfsPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":33984},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-CUGB532P.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-VL3H7P4F.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"blockstore-core","kind":"import-statement","external":true},{"path":"blockstore-idb","kind":"import-statement","external":true},{"path":"multiformats/cid","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileCard-HJIZDWJF.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileMain-WEWTX7QB.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileSection-BEUGJ7EI.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileSlide-NYBGZEZS.mjs","kind":"dynamic-import"},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/state","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"uint8arrays","kind":"import-statement","external":true},{"path":"wnfs","kind":"import-statement","external":true},{"path":"multiformats","kind":"import-statement","external":true},{"path":"multiformats/codecs/raw","kind":"import-statement","external":true},{"path":"multiformats/hashes/sha2","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["WnfsPlugin","default"],"entryPoint":"packages/plugins/experimental/plugin-wnfs/src/index.ts","inputs":{"packages/plugins/experimental/plugin-wnfs/src/WnfsPlugin.tsx":{"bytesInOutput":3617},"packages/plugins/experimental/plugin-wnfs/src/blockstore.ts":{"bytesInOutput":1609},"packages/plugins/experimental/plugin-wnfs/src/common.ts":{"bytesInOutput":1088},"packages/plugins/experimental/plugin-wnfs/src/components/index.ts":{"bytesInOutput":307},"packages/plugins/experimental/plugin-wnfs/src/extensions/image.ts":{"bytesInOutput":4729},"packages/plugins/experimental/plugin-wnfs/src/load.ts":{"bytesInOutput":1569},"packages/plugins/experimental/plugin-wnfs/src/extensions/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-wnfs/src/translations.ts":{"bytesInOutput":210},"packages/plugins/experimental/plugin-wnfs/src/upload.ts":{"bytesInOutput":1192},"packages/plugins/experimental/plugin-wnfs/src/wnfs-url.ts":{"bytesInOutput":110},"packages/plugins/experimental/plugin-wnfs/src/index.ts":{"bytesInOutput":30}},"bytes":15561},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-VL3H7P4F.mjs","kind":"import-statement"}],"exports":["WNFS_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-wnfs/src/meta.ts","inputs":{},"bytes":157},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-CUGB532P.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-VL3H7P4F.mjs","kind":"import-statement"}],"exports":["FileType","WnfsAction"],"entryPoint":"packages/plugins/experimental/plugin-wnfs/src/types/index.ts","inputs":{},"bytes":170},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-CUGB532P.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1724},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-CUGB532P.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-VL3H7P4F.mjs","kind":"import-statement"},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FileType","WnfsAction"],"inputs":{"packages/plugins/experimental/plugin-wnfs/src/types/file.ts":{"bytesInOutput":294},"packages/plugins/experimental/plugin-wnfs/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/experimental/plugin-wnfs/src/types/types.ts":{"bytesInOutput":196}},"bytes":755},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-VL3H7P4F.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":734},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-VL3H7P4F.mjs":{"imports":[],"exports":["WNFS_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-wnfs/src/meta.ts":{"bytesInOutput":312}},"bytes":456},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileCard-HJIZDWJF.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2773},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileCard-HJIZDWJF.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-card","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-wnfs/src/components/FileCard.tsx","inputs":{"packages/plugins/experimental/plugin-wnfs/src/components/FileCard.tsx":{"bytesInOutput":1299}},"bytes":1461},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileMain-WEWTX7QB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1372},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileMain-WEWTX7QB.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-2I63TM7M.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-wnfs/src/components/FileMain.tsx","inputs":{"packages/plugins/experimental/plugin-wnfs/src/components/FileMain.tsx":{"bytesInOutput":566}},"bytes":783},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileSection-BEUGJ7EI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1000},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileSection-BEUGJ7EI.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-2I63TM7M.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-wnfs/src/components/FileSection.tsx","inputs":{"packages/plugins/experimental/plugin-wnfs/src/components/FileSection.tsx":{"bytesInOutput":413}},"bytes":639},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileSlide-NYBGZEZS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":964},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/FileSlide-NYBGZEZS.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-2I63TM7M.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-wnfs/src/components/FileSlide.tsx","inputs":{"packages/plugins/experimental/plugin-wnfs/src/components/FileSlide.tsx":{"bytesInOutput":388}},"bytes":608},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-2I63TM7M.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1430},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-2I63TM7M.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["FilePreview"],"inputs":{"packages/plugins/experimental/plugin-wnfs/src/components/FilePreview.tsx":{"bytesInOutput":674}},"bytes":821}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WnfsPlugin.d.ts","sourceRoot":"","sources":["../../../src/WnfsPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,gBAAgB,EAA2B,MAAM,qBAAqB,CAAC;AAarF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,eAAO,MAAM,UAAU,QAAO,gBAAgB,CAAC,kBAAkB,CA8EhE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseBlockstore } from 'blockstore-core';
|
|
2
|
+
import type { CID } from 'multiformats';
|
|
3
|
+
export declare const create: (apiHost?: string) => MixedBlockstore;
|
|
4
|
+
/**
|
|
5
|
+
* A blockstore that communicates with the DXOS blob service,
|
|
6
|
+
* and which uses an indexedDB blockstore as a client cache.
|
|
7
|
+
*/
|
|
8
|
+
export declare class MixedBlockstore extends BaseBlockstore {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(apiHost?: string);
|
|
11
|
+
open(): Promise<void>;
|
|
12
|
+
url(apiHost: string, cid?: CID): string;
|
|
13
|
+
delete(key: CID): Promise<void>;
|
|
14
|
+
get(key: CID): Promise<Uint8Array>;
|
|
15
|
+
has(key: CID): Promise<boolean>;
|
|
16
|
+
put(key: CID, val: Uint8Array): Promise<CID>;
|
|
17
|
+
destroy(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=blockstore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockstore.d.ts","sourceRoot":"","sources":["../../../src/blockstore.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAIxC,eAAO,MAAM,MAAM,aAAc,MAAM,oBAEtC,CAAC;AAEF;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,cAAc;;gBAIrC,OAAO,CAAC,EAAE,MAAM;IAOtB,IAAI;IAIV,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG;IAMf,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAU/B,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC;IAgBlC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAc/B,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAarD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Blockstore } from 'interface-blockstore';
|
|
2
|
+
import { type BlockStore as WnfsBlockStore } from 'wnfs';
|
|
3
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
4
|
+
export declare const filePath: (fileName: string, space: Space) => string[];
|
|
5
|
+
export declare class Rng {
|
|
6
|
+
randomBytes(count: number): Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
export declare const store: (blockstore: Blockstore) => WnfsBlockStore;
|
|
9
|
+
export declare const storeName: () => string;
|
|
10
|
+
export declare const readFile: (file: File) => Promise<Uint8Array>;
|
|
11
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/common.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,KAAK,UAAU,IAAI,cAAc,EAAE,MAAM,MAAM,CAAC;AAGzD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAMrD,eAAO,MAAM,QAAQ,aAAc,MAAM,SAAS,KAAK,aAEtD,CAAC;AAMF,qBAAa,GAAG;IACd,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;CAGvC;AAMD,eAAO,MAAM,KAAK,eAAgB,UAAU,KAAG,cAyB9C,CAAC;AAEF,eAAO,MAAM,SAAS,cAAoB,CAAC;AAM3C,eAAO,MAAM,QAAQ,SAAU,IAAI,KAAG,OAAO,CAAC,UAAU,CAgBvD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MosaicTileComponent } from '@dxos/react-ui-mosaic';
|
|
2
|
+
import { type FileType } from '../types';
|
|
3
|
+
export type FileCardProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
object: FileType;
|
|
6
|
+
};
|
|
7
|
+
declare const FileCard: MosaicTileComponent<FileCardProps>;
|
|
8
|
+
export default FileCard;
|
|
9
|
+
//# sourceMappingURL=FileCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileCard.d.ts","sourceRoot":"","sources":["../../../../src/components/FileCard.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,mBAAmB,CAAC,aAAa,CAwBhD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileMain.d.ts","sourceRoot":"","sources":["../../../../src/components/FileMain.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAWvC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAQpC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
export type FilePreviewProps = ThemedClassName<{
|
|
4
|
+
type: string;
|
|
5
|
+
url: string;
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* File/content preview iframe.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FilePreview: ({ type, url, classNames }: FilePreviewProps) => React.JSX.Element;
|
|
11
|
+
//# sourceMappingURL=FilePreview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilePreview.d.ts","sourceRoot":"","sources":["../../../../src/components/FilePreview.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,WAAW,8BAA+B,gBAAgB,sBAQtE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileSection.d.ts","sourceRoot":"","sources":["../../../../src/components/FileSection.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAQxD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileSlide.d.ts","sourceRoot":"","sources":["../../../../src/components/FileSlide.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAQtD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const FileCard: React.LazyExoticComponent<import("packages/ui/react-ui-mosaic/dist/types/src").MosaicTileComponent<import("./FileCard").FileCardProps>>;
|
|
3
|
+
export declare const FileMain: React.LazyExoticComponent<React.FC<{
|
|
4
|
+
file: import("../types").FileType;
|
|
5
|
+
}>>;
|
|
6
|
+
export declare const FileSection: React.LazyExoticComponent<React.FC<{
|
|
7
|
+
file: import("../types").FileType;
|
|
8
|
+
height?: number;
|
|
9
|
+
}>>;
|
|
10
|
+
export declare const FileSlide: React.LazyExoticComponent<React.FC<{
|
|
11
|
+
file: import("../types").FileType;
|
|
12
|
+
cover?: boolean;
|
|
13
|
+
}>>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,QAAQ,yIAAyC,CAAC;AAC/D,eAAO,MAAM,QAAQ;;GAAyC,CAAC;AAC/D,eAAO,MAAM,WAAW;;;GAA4C,CAAC;AACrE,eAAO,MAAM,SAAS;;;GAA0C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import type { Blockstore } from 'interface-blockstore';
|
|
3
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
4
|
+
export type ImageOptions = {
|
|
5
|
+
blockstore: Blockstore;
|
|
6
|
+
space: Space;
|
|
7
|
+
};
|
|
8
|
+
export declare const image: (options: ImageOptions) => Extension[];
|
|
9
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/extensions/image.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,KAAK,SAAS,EAAuC,MAAM,mBAAmB,CAAC;AAE1G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAKrD,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,KAAK,YAAa,YAAY,KAAG,SAAS,EAEtD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '@dxos-theme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
render: () => React.JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react/*").Decorator[];
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const Default: {};
|
|
10
|
+
//# sourceMappingURL=image.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.stories.d.ts","sourceRoot":"","sources":["../../../../src/extensions/image.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAA8B,MAAM,OAAO,CAAC;;;;;;AAgInD,wBAIE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/extensions/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,eAAe,UAAU,CAAC;AAE1B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Blockstore } from 'interface-blockstore';
|
|
2
|
+
import { PrivateDirectory } from 'wnfs';
|
|
3
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
4
|
+
export declare const loadWnfs: (space: Space, blockstore: Blockstore) => Promise<{
|
|
5
|
+
directory: PrivateDirectory;
|
|
6
|
+
forest: any;
|
|
7
|
+
}>;
|
|
8
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/load.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAA4B,gBAAgB,EAAe,MAAM,MAAM,CAAC;AAE/E,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAQrD,eAAO,MAAM,QAAQ,UAAiB,KAAK,cAAc,UAAU;;;EAKlE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const WNFS_PLUGIN = "dxos.org/plugin/WNFS";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
source: string;
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,yBAAyB,CAAC;;;;;;;;;AAElD,wBAOuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;AAMA,wBAUE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { S } from '@dxos/echo-schema';
|
|
2
|
+
declare const FileType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
3
|
+
name?: string | undefined;
|
|
4
|
+
filename: string;
|
|
5
|
+
type: string;
|
|
6
|
+
timestamp?: string | undefined;
|
|
7
|
+
cid?: string | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
id: string;
|
|
10
|
+
}, S.Struct.Encoded<{
|
|
11
|
+
filename: typeof S.String;
|
|
12
|
+
type: typeof S.String;
|
|
13
|
+
timestamp: S.optional<typeof S.String>;
|
|
14
|
+
name: S.optional<typeof S.String>;
|
|
15
|
+
cid: S.optional<typeof S.String>;
|
|
16
|
+
}>>;
|
|
17
|
+
export declare class FileType extends FileType_base {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# 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,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;;;;;;;;;;;;;;;;AAEnD,qBAAa,QAAS,SAAQ,aAM5B;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type FileManagerProvides, type MetadataRecordsProvides, type SurfaceProvides, type TranslationsProvides } from '@dxos/app-framework';
|
|
2
|
+
import { type SchemaProvides } from '@dxos/plugin-client';
|
|
3
|
+
import { type MarkdownExtensionProvides } from '@dxos/plugin-markdown/types';
|
|
4
|
+
export declare enum WnfsAction {
|
|
5
|
+
CREATE = "dxos.org/plugin/WNFS/action/create"
|
|
6
|
+
}
|
|
7
|
+
export type WnfsPluginProvides = FileManagerProvides & SurfaceProvides & MetadataRecordsProvides & TranslationsProvides & SchemaProvides & MarkdownExtensionProvides;
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAM7E,oBAAY,UAAU;IACpB,MAAM,uCAA0B;CACjC;AAED,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAClD,eAAe,GACf,uBAAuB,GACvB,oBAAoB,GACpB,cAAc,GACd,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Blockstore } from 'interface-blockstore';
|
|
2
|
+
import type { Space } from '@dxos/client/echo';
|
|
3
|
+
export declare const upload: ({ blockstore, file, space }: {
|
|
4
|
+
blockstore: Blockstore;
|
|
5
|
+
file: File;
|
|
6
|
+
space: Space;
|
|
7
|
+
}) => Promise<{
|
|
8
|
+
url: string;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/upload.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAO/C,eAAO,MAAM,MAAM,gCAAuC;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE;;EA6B7G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wnfs-url.d.ts","sourceRoot":"","sources":["../../../src/wnfs-url.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,aAAc,MAAM,EAAE,WAEzC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dxos/plugin-wnfs",
|
|
3
|
+
"version": "0.6.14-main.1366248",
|
|
4
|
+
"description": "WNFS file management plugin",
|
|
5
|
+
"homepage": "https://dxos.org",
|
|
6
|
+
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "DXOS.org",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/types/src/index.d.ts",
|
|
12
|
+
"browser": "./dist/lib/browser/index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"./meta": {
|
|
15
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
16
|
+
"browser": "./dist/lib/browser/meta.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./types": {
|
|
19
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
20
|
+
"browser": "./dist/lib/browser/types/index.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"types": "dist/types/src/index.d.ts",
|
|
24
|
+
"typesVersions": {
|
|
25
|
+
"*": {
|
|
26
|
+
"meta": [
|
|
27
|
+
"dist/types/src/meta.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"types": [
|
|
30
|
+
"dist/types/src/types/index.d.ts"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"src"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@codemirror/language": "^6.10.3",
|
|
40
|
+
"@codemirror/state": "^6.4.1",
|
|
41
|
+
"@codemirror/view": "^6.34.1",
|
|
42
|
+
"blockstore-core": "^5.0.1",
|
|
43
|
+
"blockstore-idb": "^2.0.0",
|
|
44
|
+
"interface-blockstore": "^5.2.10",
|
|
45
|
+
"multiformats": "^13.2.2",
|
|
46
|
+
"uint8arrays": "^5.1.0",
|
|
47
|
+
"wnfs": "0.2.2",
|
|
48
|
+
"@dxos/app-framework": "0.6.14-main.1366248",
|
|
49
|
+
"@dxos/invariant": "0.6.14-main.1366248",
|
|
50
|
+
"@dxos/crypto": "0.6.14-main.1366248",
|
|
51
|
+
"@dxos/echo-schema": "0.6.14-main.1366248",
|
|
52
|
+
"@dxos/local-storage": "0.6.14-main.1366248",
|
|
53
|
+
"@dxos/plugin-client": "0.6.14-main.1366248",
|
|
54
|
+
"@dxos/log": "0.6.14-main.1366248",
|
|
55
|
+
"@dxos/react-client": "0.6.14-main.1366248",
|
|
56
|
+
"@dxos/plugin-markdown": "0.6.14-main.1366248",
|
|
57
|
+
"@dxos/react-ui-card": "0.6.14-main.1366248",
|
|
58
|
+
"@dxos/react-ui-mosaic": "0.6.14-main.1366248"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@phosphor-icons/react": "^2.1.5",
|
|
62
|
+
"@types/react": "~18.2.0",
|
|
63
|
+
"@types/react-dom": "~18.2.0",
|
|
64
|
+
"react": "~18.2.0",
|
|
65
|
+
"react-dom": "~18.2.0",
|
|
66
|
+
"vite": "5.4.7",
|
|
67
|
+
"@dxos/react-ui": "0.6.14-main.1366248",
|
|
68
|
+
"@dxos/react-ui-editor": "0.6.14-main.1366248",
|
|
69
|
+
"@dxos/react-ui-theme": "0.6.14-main.1366248",
|
|
70
|
+
"@dxos/storybook-utils": "0.6.14-main.1366248"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@phosphor-icons/react": "^2.0.5",
|
|
74
|
+
"react": "^18.2.0",
|
|
75
|
+
"react-dom": "^18.2.0",
|
|
76
|
+
"@dxos/react-ui": "0.6.14-main.1366248",
|
|
77
|
+
"@dxos/react-ui-theme": "0.6.14-main.1366248"
|
|
78
|
+
},
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { FileCloud, type IconProps } from '@phosphor-icons/react';
|
|
6
|
+
import React, { type Ref } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type PluginDefinition, isObject, resolvePlugin } from '@dxos/app-framework';
|
|
9
|
+
import { invariant } from '@dxos/invariant';
|
|
10
|
+
import { parseClientPlugin } from '@dxos/plugin-client';
|
|
11
|
+
import { type DocumentType } from '@dxos/plugin-markdown/types';
|
|
12
|
+
import { type Space, getSpace } from '@dxos/react-client/echo';
|
|
13
|
+
import { isTileComponentProps } from '@dxos/react-ui-mosaic';
|
|
14
|
+
|
|
15
|
+
import * as Blockstore from './blockstore';
|
|
16
|
+
import { FileCard, FileMain, FileSection, FileSlide } from './components';
|
|
17
|
+
import { image as imageExtension } from './extensions';
|
|
18
|
+
import meta, { WNFS_PLUGIN } from './meta';
|
|
19
|
+
import translations from './translations';
|
|
20
|
+
import { FileType } from './types';
|
|
21
|
+
import { type WnfsPluginProvides } from './types';
|
|
22
|
+
import { upload } from './upload';
|
|
23
|
+
|
|
24
|
+
export const WnfsPlugin = (): PluginDefinition<WnfsPluginProvides> => {
|
|
25
|
+
let blockstore: Blockstore.MixedBlockstore | undefined;
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
meta,
|
|
29
|
+
ready: async (plugins) => {
|
|
30
|
+
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
31
|
+
invariant(client);
|
|
32
|
+
const apiHost = client.config.values.runtime?.services?.edge?.url || 'http://localhost:8787';
|
|
33
|
+
blockstore = Blockstore.create(apiHost);
|
|
34
|
+
await blockstore.open();
|
|
35
|
+
},
|
|
36
|
+
provides: {
|
|
37
|
+
translations,
|
|
38
|
+
metadata: {
|
|
39
|
+
records: {
|
|
40
|
+
[FileType.typename]: {
|
|
41
|
+
placeholder: ['file title placeholder', { ns: WNFS_PLUGIN }],
|
|
42
|
+
icon: (props: IconProps) => <FileCloud {...props} />,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
echo: {
|
|
47
|
+
schema: [FileType],
|
|
48
|
+
},
|
|
49
|
+
// TODO(burdon): Add intent to upload file.
|
|
50
|
+
file: {
|
|
51
|
+
upload: async (file: File, space: Space) => {
|
|
52
|
+
if (!blockstore) {
|
|
53
|
+
throw new Error('Blockstore is not ready yet');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return await upload({ blockstore, file, space });
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
markdown: {
|
|
60
|
+
extensions: ({ document }: { document?: DocumentType }) => {
|
|
61
|
+
if (!blockstore) {
|
|
62
|
+
throw new Error('Blockstore is not ready yet');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (document) {
|
|
66
|
+
const space = getSpace(document);
|
|
67
|
+
return space ? [imageExtension({ blockstore, space })] : [];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return [];
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
surface: {
|
|
74
|
+
component: ({ data, role, ...props }, forwardedRef) => {
|
|
75
|
+
switch (role) {
|
|
76
|
+
case 'main':
|
|
77
|
+
return data.active instanceof FileType ? <FileMain file={data.active} /> : null;
|
|
78
|
+
case 'slide':
|
|
79
|
+
return data.slide instanceof FileType ? <FileSlide file={data.slide} cover={false} /> : null;
|
|
80
|
+
case 'section':
|
|
81
|
+
return data.object instanceof FileType ? <FileSection file={data.object} /> : null;
|
|
82
|
+
case 'card': {
|
|
83
|
+
if (
|
|
84
|
+
isObject(data.content) &&
|
|
85
|
+
typeof data.content.id === 'string' &&
|
|
86
|
+
data.content.object instanceof FileType
|
|
87
|
+
) {
|
|
88
|
+
const cardProps = { ...props, item: { id: data.content.id, object: data.content.object } };
|
|
89
|
+
return isTileComponentProps(cardProps) ? (
|
|
90
|
+
<FileCard {...cardProps} ref={forwardedRef as Ref<HTMLDivElement>} />
|
|
91
|
+
) : null;
|
|
92
|
+
}
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return null;
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
};
|