@dxos/plugin-wnfs 0.7.2 → 0.7.3-staging.971cd8d

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.
@@ -27,4 +27,4 @@ export {
27
27
  FileType,
28
28
  WnfsAction
29
29
  };
30
- //# sourceMappingURL=chunk-CUGB532P.mjs.map
30
+ //# sourceMappingURL=chunk-JDSKIDDR.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/types/file.ts", "../../../src/types/types.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport class FileType extends TypedObject({ typename: 'dxos.org/type/File', version: '0.1.0' })({\n filename: S.String,\n type: S.String,\n timestamp: S.optional(S.String),\n name: S.optional(S.String),\n cid: S.optional(S.String),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n type FileManagerProvides,\n type MetadataRecordsProvides,\n type SurfaceProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type SchemaProvides } from '@dxos/plugin-client';\nimport { type MarkdownExtensionProvides } from '@dxos/plugin-markdown/types';\n\nimport { WNFS_PLUGIN } from '../meta';\n\nconst WNFS_ACTION = `${WNFS_PLUGIN}/action`;\n\nexport enum WnfsAction {\n CREATE = `${WNFS_ACTION}/create`,\n}\n\nexport type WnfsPluginProvides = FileManagerProvides &\n SurfaceProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n SchemaProvides &\n MarkdownExtensionProvides;\n"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport class FileType extends TypedObject({ typename: 'dxos.org/type/File', version: '0.1.0' })({\n filename: S.String,\n type: S.String,\n timestamp: S.optional(S.String),\n name: S.optional(S.String),\n cid: S.optional(S.String),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n type FileManagerProvides,\n type MetadataRecordsProvides,\n type SurfaceProvides,\n type TranslationsProvides,\n} from '@dxos/app-framework';\nimport { type MarkdownExtensionProvides } from '@dxos/plugin-markdown/types';\nimport { type SchemaProvides } from '@dxos/plugin-space';\n\nimport { WNFS_PLUGIN } from '../meta';\n\nconst WNFS_ACTION = `${WNFS_PLUGIN}/action`;\n\nexport enum WnfsAction {\n CREATE = `${WNFS_ACTION}/create`,\n}\n\nexport type WnfsPluginProvides = FileManagerProvides &\n SurfaceProvides &\n MetadataRecordsProvides &\n TranslationsProvides &\n SchemaProvides &\n MarkdownExtensionProvides;\n"],
5
5
  "mappings": ";;;;;AAIA,SAASA,GAAGC,mBAAmB;AAExB,IAAMC,WAAN,cAAuBC,YAAY;EAAEC,UAAU;EAAsBC,SAAS;AAAQ,CAAA,EAAG;EAC9FC,UAAUC,EAAEC;EACZC,MAAMF,EAAEC;EACRE,WAAWH,EAAEI,SAASJ,EAAEC,MAAM;EAC9BI,MAAML,EAAEI,SAASJ,EAAEC,MAAM;EACzBK,KAAKN,EAAEI,SAASJ,EAAEC,MAAM;AAC1B,CAAA,EAAA;AAAI;;;ACGJ,IAAMM,cAAc,GAAGC,WAAAA;;UAEXC,aAAAA;sCACD,GAAGF,WAAAA,SAAoB,IAAA;GADtBE,eAAAA,aAAAA,CAAAA,EAAAA;",
6
6
  "names": ["S", "TypedObject", "FileType", "TypedObject", "typename", "version", "filename", "S", "String", "type", "timestamp", "optional", "name", "cid", "WNFS_ACTION", "WNFS_PLUGIN", "WnfsAction"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FileType
3
- } from "./chunk-CUGB532P.mjs";
3
+ } from "./chunk-JDSKIDDR.mjs";
4
4
  import {
5
5
  WNFS_PLUGIN,
6
6
  meta_default
@@ -434,7 +434,7 @@ var WnfsPlugin = () => {
434
434
  }
435
435
  },
436
436
  echo: {
437
- schema: [
437
+ system: [
438
438
  FileType
439
439
  ]
440
440
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/WnfsPlugin.tsx", "../../../src/blockstore.ts", "../../../src/common.ts", "../../../src/components/index.ts", "../../../src/extensions/image.ts", "../../../src/load.ts", "../../../src/translations.ts", "../../../src/upload.ts", "../../../src/wnfs-url.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { FileCloud, type IconProps } from '@phosphor-icons/react';\nimport React, { type Ref } from 'react';\n\nimport { type PluginDefinition, isObject, resolvePlugin } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type DocumentType } from '@dxos/plugin-markdown/types';\nimport { type Space, getSpace } from '@dxos/react-client/echo';\nimport { isTileComponentProps } from '@dxos/react-ui-mosaic';\n\nimport * as Blockstore from './blockstore';\nimport { FileCard, FileMain, FileSection, FileSlide } from './components';\nimport { image as imageExtension } from './extensions';\nimport meta, { WNFS_PLUGIN } from './meta';\nimport translations from './translations';\nimport { FileType } from './types';\nimport { type WnfsPluginProvides } from './types';\nimport { upload } from './upload';\n\nexport const WnfsPlugin = (): PluginDefinition<WnfsPluginProvides> => {\n let blockstore: Blockstore.MixedBlockstore | undefined;\n\n return {\n meta,\n ready: async (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n invariant(client);\n const apiHost = client.config.values.runtime?.services?.edge?.url || 'http://localhost:8787';\n blockstore = Blockstore.create(apiHost);\n await blockstore.open();\n },\n provides: {\n translations,\n metadata: {\n records: {\n [FileType.typename]: {\n placeholder: ['file title placeholder', { ns: WNFS_PLUGIN }],\n icon: (props: IconProps) => <FileCloud {...props} />,\n },\n },\n },\n echo: {\n schema: [FileType],\n },\n // TODO(burdon): Add intent to upload file.\n file: {\n upload: async (file: File, space: Space) => {\n if (!blockstore) {\n throw new Error('Blockstore is not ready yet');\n }\n\n return await upload({ blockstore, file, space });\n },\n },\n markdown: {\n extensions: ({ document }: { document?: DocumentType }) => {\n if (!blockstore) {\n throw new Error('Blockstore is not ready yet');\n }\n\n if (document) {\n const space = getSpace(document);\n return space ? [imageExtension({ blockstore, space })] : [];\n }\n\n return [];\n },\n },\n surface: {\n component: ({ data, role, ...props }, forwardedRef) => {\n switch (role) {\n case 'main':\n return data.active instanceof FileType ? <FileMain file={data.active} /> : null;\n case 'slide':\n return data.slide instanceof FileType ? <FileSlide file={data.slide} cover={false} /> : null;\n case 'section':\n return data.object instanceof FileType ? <FileSection file={data.object} /> : null;\n case 'card': {\n if (\n isObject(data.content) &&\n typeof data.content.id === 'string' &&\n data.content.object instanceof FileType\n ) {\n const cardProps = { ...props, item: { id: data.content.id, object: data.content.object } };\n return isTileComponentProps(cardProps) ? (\n <FileCard {...cardProps} ref={forwardedRef as Ref<HTMLDivElement>} />\n ) : null;\n }\n break;\n }\n }\n\n return null;\n },\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { BaseBlockstore } from 'blockstore-core';\nimport { IDBBlockstore } from 'blockstore-idb';\nimport type { CID } from 'multiformats';\n\nimport { storeName } from './common';\n\nexport const create = (apiHost?: string) => {\n return new MixedBlockstore(apiHost);\n};\n\n/**\n * A blockstore that communicates with the DXOS blob service,\n * and which uses an indexedDB blockstore as a client cache.\n */\nexport class MixedBlockstore extends BaseBlockstore {\n readonly #apiHost: string | undefined;\n readonly #idbStore: IDBBlockstore;\n\n constructor(apiHost?: string) {\n super();\n\n this.#apiHost = apiHost;\n this.#idbStore = new IDBBlockstore(storeName());\n }\n\n async open() {\n await this.#idbStore.open();\n }\n\n url(apiHost: string, cid?: CID) {\n const path = cid ? cid.toString() : '';\n return `${apiHost}/api/file/${path}`;\n }\n\n // Blockstore implementation\n override async delete(key: CID): Promise<void> {\n await this.#idbStore.delete(key);\n\n if (this.#apiHost) {\n await fetch(this.url(this.#apiHost, key), {\n method: 'DELETE',\n });\n }\n }\n\n override async get(key: CID): Promise<Uint8Array> {\n if (await this.#idbStore.has(key)) {\n return await this.#idbStore.get(key);\n }\n\n if (this.#apiHost) {\n return await fetch(this.url(this.#apiHost, key), {\n method: 'GET',\n })\n .then((r) => r.arrayBuffer())\n .then((r) => new Uint8Array(r));\n }\n\n return await this.#idbStore.get(key);\n }\n\n override async has(key: CID): Promise<boolean> {\n if (await this.#idbStore.has(key)) {\n return true;\n }\n\n if (this.#apiHost) {\n return await fetch(this.url(this.#apiHost, key), {\n method: 'HEAD',\n }).then((r) => r.ok);\n }\n\n return false;\n }\n\n override async put(key: CID, val: Uint8Array): Promise<CID> {\n await this.#idbStore.put(key, val);\n\n if (this.#apiHost) {\n await fetch(this.url(this.#apiHost, key), {\n method: 'POST',\n body: val,\n });\n }\n\n return key;\n }\n\n async destroy(): Promise<void> {\n await this.#idbStore.destroy();\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats/cid';\nimport { sha256 } from 'multiformats/hashes/sha2';\nimport { type BlockStore as WnfsBlockStore } from 'wnfs';\n\nimport * as crypto from '@dxos/crypto';\nimport { type Space } from '@dxos/react-client/echo';\n\n//\n// PATH\n//\n\nexport const filePath = (fileName: string, space: Space) => {\n return ['spaces', space.properties.id, 'files', fileName];\n};\n\n//\n// RNG\n//\n\nexport class Rng {\n randomBytes(count: number): Uint8Array {\n return new Uint8Array(crypto.randomBytes(count));\n }\n}\n\n//\n// STORE\n//\n\nexport const store = (blockstore: Blockstore): WnfsBlockStore => {\n const getBlock = async (cid: Uint8Array): Promise<Uint8Array | undefined> => {\n const decodedCid = CID.decode(cid);\n return await blockstore.get(decodedCid);\n };\n\n const hasBlock = async (cid: Uint8Array): Promise<boolean> => {\n const decodedCid = CID.decode(cid);\n return await blockstore.has(decodedCid);\n };\n\n const putBlockKeyed = async (cid: Uint8Array, bytes: Uint8Array): Promise<void> => {\n const decodedCid = CID.decode(cid);\n await blockstore.put(decodedCid, bytes);\n };\n\n // Don't hash blocks with the rs-wnfs default Blake 3, sha256 has better support.\n const putBlock = async (bytes: Uint8Array, codec: number): Promise<Uint8Array> => {\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, codec, hash);\n await blockstore.put(cid, bytes);\n return cid.bytes;\n };\n\n return { getBlock, hasBlock, putBlockKeyed, putBlock };\n};\n\nexport const storeName = () => 'dxos/wnfs';\n\n//\n// OTHER\n//\n\nexport const readFile = (file: File): Promise<Uint8Array> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (event) => {\n const result = event.target?.result;\n if (result === null || result === undefined || typeof result === 'string') {\n reject(new Error('Expected an ArrayBuffer'));\n return;\n }\n resolve(new Uint8Array(result));\n };\n reader.onerror = (err) => {\n reject(err);\n };\n reader.readAsArrayBuffer(file);\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\n// Lazily load components for content surfaces.\nexport const FileCard = React.lazy(() => import('./FileCard'));\nexport const FileMain = React.lazy(() => import('./FileMain'));\nexport const FileSection = React.lazy(() => import('./FileSection'));\nexport const FileSlide = React.lazy(() => import('./FileSlide'));\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { syntaxTree } from '@codemirror/language';\nimport { type EditorState, type Extension, StateField, type Range, StateEffect } from '@codemirror/state';\nimport { Decoration, EditorView, WidgetType, ViewPlugin, type ViewUpdate } from '@codemirror/view';\nimport type { Blockstore } from 'interface-blockstore';\nimport type { PrivateDirectory, PrivateForest } from 'wnfs';\n\nimport { log } from '@dxos/log';\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { store } from '../common';\nimport { loadWnfs } from '../load';\n\nexport type ImageOptions = {\n blockstore: Blockstore;\n space: Space;\n};\n\nexport const image = (options: ImageOptions): Extension[] => {\n return [stateField(options), viewPlugin(options)];\n};\n\n// GLOBAL STATE\n\n/** Indexed by space id */\nconst loadedWnfsInstances: Record<string, { directory: PrivateDirectory; forest: PrivateForest }> = {};\n\n// EFFECT + EXTENSIONS\n\nconst stateEffect = StateEffect.define<{\n decorations: Range<Decoration>[];\n from: number;\n to: number;\n}>({});\n\nconst stateField = (options: ImageOptions) =>\n StateField.define({\n create: () => {\n return Decoration.none;\n },\n update: (value, tr) => {\n for (const effect of tr.effects) {\n if (effect.is(stateEffect)) {\n return value.map(tr.changes).update({\n filterFrom: effect.value.from,\n filterTo: effect.value.to,\n filter: () => false,\n add: effect.value.decorations,\n });\n }\n }\n\n return value;\n },\n provide: (f) => {\n return EditorView.decorations.from(f);\n },\n });\n\nconst viewPlugin = (options: ImageOptions) =>\n ViewPlugin.define((view: EditorView) => {\n // Initial decoration set on document load\n buildDecorations({\n from: 0,\n to: view.state.doc.length,\n state: view.state,\n options,\n })\n .then((decorations) => {\n view.dispatch({\n effects: stateEffect.of({\n decorations,\n from: 0,\n to: view.state.doc.length,\n }),\n });\n })\n .catch((err) => {\n throw new Error(err);\n });\n\n const update = (update: ViewUpdate) => {\n if (!update.docChanged) {\n return;\n }\n\n const { from, to } = changedRange(update);\n buildDecorations({\n from,\n to,\n state: view.state,\n options,\n })\n .then((decorations) => {\n view.dispatch({\n effects: stateEffect.of({\n decorations,\n from,\n to,\n }),\n });\n })\n .catch((err) => {\n log.catch(err);\n });\n };\n\n return { update };\n });\n\n// 🛠️\n\nconst changedRange = (update: ViewUpdate) => {\n // Find range of changes and cursor changes.\n const cursor = update.state.selection.main.head;\n const oldCursor = update.changes.mapPos(update.startState.selection.main.head);\n\n let from = Math.min(cursor, oldCursor);\n let to = Math.max(cursor, oldCursor);\n\n update.changes.iterChangedRanges((fromA, toA, fromB, toB) => {\n from = Math.min(from, fromB);\n to = Math.max(to, toB);\n });\n\n // Expand to cover lines.\n from = update.state.doc.lineAt(from).from;\n to = update.state.doc.lineAt(to).to;\n\n // Fin\n return { from, to };\n};\n\nconst buildDecorations = async ({\n from,\n to,\n state,\n options,\n}: {\n from: number;\n to: number;\n state: EditorState;\n options: ImageOptions;\n}) => {\n const cursor = state.selection.main.head;\n let nodes: { from: number; hide: boolean; to: number; url: string }[] = [];\n\n syntaxTree(state).iterate({\n enter: (node) => {\n if (node.name === 'Image') {\n const urlNode = node.node.getChild('URL');\n if (urlNode) {\n const hide = state.readOnly || cursor < node.from || cursor > node.to;\n const url = state.sliceDoc(urlNode.from, urlNode.to);\n\n if (url.startsWith('wnfs://')) {\n nodes.push({\n from: node.from,\n to: node.to,\n hide,\n url,\n });\n }\n }\n }\n },\n from,\n to,\n });\n\n // Nodes must be sorted by `from`\n nodes = nodes.sort((a, b) => {\n return a.from - b.from;\n });\n\n const decorations = await nodes.reduce(\n async (acc, node) => {\n const array = await acc;\n const path = node.url\n .replace(/^wnfs:\\/\\//, '')\n .split('/')\n .map((p) => decodeURIComponent(p));\n\n // Cannot load images from other spaces\n const spaceIdFromUrl = path[1];\n if (spaceIdFromUrl !== options.space.properties.id) {\n return array;\n }\n\n const cacheKey = options.space.properties.wnfs_private_forest_cid;\n\n const { directory, forest } = loadedWnfsInstances[cacheKey]\n ? loadedWnfsInstances[cacheKey]\n : await loadWnfs(options.space, options.blockstore);\n\n loadedWnfsInstances[cacheKey] = {\n directory,\n forest,\n };\n\n const wnfsStore = store(options.blockstore);\n\n // Load image contents into memory blob\n const { result } = await directory.read(path, true, forest, wnfsStore);\n const blob = new Blob([result]);\n const blobUrl = URL.createObjectURL(blob);\n\n // Create decoration\n return [\n ...array,\n Decoration.replace({\n block: true, // Prevent cursor from entering.\n widget: new WnfsImageWidget(blobUrl),\n }).range(node.hide ? node.from : node.to, node.to),\n ];\n },\n Promise.resolve([] as Range<Decoration>[]),\n );\n\n return decorations;\n};\n\nclass WnfsImageWidget extends WidgetType {\n constructor(readonly _url: string) {\n super();\n }\n\n override eq(other: this) {\n return this._url === (other as any as WnfsImageWidget)._url;\n }\n\n override toDOM(view: EditorView) {\n const img = document.createElement('img');\n img.setAttribute('loading', 'lazy');\n img.setAttribute('src', this._url);\n img.setAttribute('class', 'cm-image');\n // Images are hidden until successfully loaded to avoid flickering effects.\n img.onload = () => img.classList.add('cm-loaded-image');\n return img;\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats';\nimport * as Uint8Arrays from 'uint8arrays';\nimport { AccessKey, PrivateForest, PrivateDirectory, PrivateNode } from 'wnfs';\n\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { Rng, store } from './common';\n\n//\n// LOAD\n//\n\nexport const loadWnfs = async (space: Space, blockstore: Blockstore) => {\n const exists =\n space.properties.wnfs_access_key !== undefined && space.properties.wnfs_private_forest_cid !== undefined;\n\n return exists ? await loadWnfsDir(blockstore, space) : await createWnfsDir(blockstore, space);\n};\n\n//\n// PRIVATE\n//\n\nconst createWnfsDir = async (blockstore: Blockstore, space: Space) => {\n const wnfsStore = store(blockstore);\n const rng = new Rng();\n const forest = new PrivateForest(rng);\n\n const dirResult = await PrivateDirectory.newAndStore(forest.emptyName(), new Date(), forest, wnfsStore, rng);\n const dir = dirResult.rootDir as PrivateDirectory;\n\n const [accessKeyRaw, newForest]: [AccessKey, PrivateForest] = await dir\n .asNode()\n .store(dirResult.forest as PrivateForest, wnfsStore, rng);\n\n const cidBytes = await newForest.store(wnfsStore);\n\n space.properties.wnfs_access_key = Uint8Arrays.toString(accessKeyRaw.toBytes(), 'base64');\n space.properties.wnfs_private_forest_cid = CID.decode(cidBytes).toString();\n\n return {\n directory: dir,\n forest: newForest,\n };\n};\n\nconst loadWnfsDir = async (blockstore: Blockstore, space: Space) => {\n const wnfsStore = store(blockstore);\n\n const accessKey = AccessKey.fromBytes(Uint8Arrays.fromString(space.properties.wnfs_access_key, 'base64'));\n const forest = await PrivateForest.load(CID.parse(space.properties.wnfs_private_forest_cid).bytes, wnfsStore);\n const node: PrivateNode = await PrivateNode.load(accessKey, forest, wnfsStore);\n\n return {\n directory: node.asDir(),\n forest,\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { WNFS_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [WNFS_PLUGIN]: {\n 'plugin name': 'Files',\n 'file title placeholder': 'New file',\n 'delete object label': 'Delete',\n },\n },\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats';\nimport * as Raw from 'multiformats/codecs/raw';\nimport { sha256 } from 'multiformats/hashes/sha2';\n\nimport type { Space } from '@dxos/client/echo';\nimport { log } from '@dxos/log';\n\nimport { Rng, filePath, store } from './common';\nimport { loadWnfs } from './load';\nimport { wnfsUrl } from './wnfs-url';\n\nexport const upload = async ({ blockstore, file, space }: { blockstore: Blockstore; file: File; space: Space }) => {\n const { directory, forest } = await loadWnfs(space, blockstore);\n const wnfsStore = store(blockstore);\n\n const bytes = new Uint8Array(await file.arrayBuffer());\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, Raw.code, hash);\n\n const path = filePath(cid.toString(), space);\n\n // Given the root directory of the private file system,\n // write the file contents to `path` in said directory.\n const result = await directory.write(path, true, bytes, new Date(), forest, wnfsStore, new Rng());\n\n // Given the new immutable instance of the root directory after writing to it,\n // **store** the changes in the \"dark forest\" and the associated (block) store.\n const [_, updatedForest] = await result.rootDir.store(result.forest, wnfsStore, new Rng());\n const cidBytes = await updatedForest.store(wnfsStore);\n\n // Update the forest pointer on the associated space.\n space.properties.wnfs_private_forest_cid = CID.decode(cidBytes).toString();\n\n // Generate `wnfs://` URL & return the info.\n const info = {\n url: wnfsUrl(path),\n };\n\n log('upload', { file, info });\n return info;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport const wnfsUrl = (filePath: string[]) => {\n return 'wnfs://' + filePath.map((f) => encodeURIComponent(f)).join('/');\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { WnfsPlugin } from './WnfsPlugin';\n\nexport default WnfsPlugin;\n\nexport * from './WnfsPlugin';\n"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { FileCloud, type IconProps } from '@phosphor-icons/react';\nimport React, { type Ref } from 'react';\n\nimport { type PluginDefinition, isObject, resolvePlugin } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type DocumentType } from '@dxos/plugin-markdown/types';\nimport { type Space, getSpace } from '@dxos/react-client/echo';\nimport { isTileComponentProps } from '@dxos/react-ui-mosaic';\n\nimport * as Blockstore from './blockstore';\nimport { FileCard, FileMain, FileSection, FileSlide } from './components';\nimport { image as imageExtension } from './extensions';\nimport meta, { WNFS_PLUGIN } from './meta';\nimport translations from './translations';\nimport { FileType } from './types';\nimport { type WnfsPluginProvides } from './types';\nimport { upload } from './upload';\n\nexport const WnfsPlugin = (): PluginDefinition<WnfsPluginProvides> => {\n let blockstore: Blockstore.MixedBlockstore | undefined;\n\n return {\n meta,\n ready: async (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n invariant(client);\n const apiHost = client.config.values.runtime?.services?.edge?.url || 'http://localhost:8787';\n blockstore = Blockstore.create(apiHost);\n await blockstore.open();\n },\n provides: {\n translations,\n metadata: {\n records: {\n [FileType.typename]: {\n placeholder: ['file title placeholder', { ns: WNFS_PLUGIN }],\n icon: (props: IconProps) => <FileCloud {...props} />,\n },\n },\n },\n echo: {\n system: [FileType],\n },\n // TODO(burdon): Add intent to upload file.\n file: {\n upload: async (file: File, space: Space) => {\n if (!blockstore) {\n throw new Error('Blockstore is not ready yet');\n }\n\n return await upload({ blockstore, file, space });\n },\n },\n markdown: {\n extensions: ({ document }: { document?: DocumentType }) => {\n if (!blockstore) {\n throw new Error('Blockstore is not ready yet');\n }\n\n if (document) {\n const space = getSpace(document);\n return space ? [imageExtension({ blockstore, space })] : [];\n }\n\n return [];\n },\n },\n surface: {\n component: ({ data, role, ...props }, forwardedRef) => {\n switch (role) {\n case 'main':\n return data.active instanceof FileType ? <FileMain file={data.active} /> : null;\n case 'slide':\n return data.slide instanceof FileType ? <FileSlide file={data.slide} cover={false} /> : null;\n case 'section':\n return data.object instanceof FileType ? <FileSection file={data.object} /> : null;\n case 'card': {\n if (\n isObject(data.content) &&\n typeof data.content.id === 'string' &&\n data.content.object instanceof FileType\n ) {\n const cardProps = { ...props, item: { id: data.content.id, object: data.content.object } };\n return isTileComponentProps(cardProps) ? (\n <FileCard {...cardProps} ref={forwardedRef as Ref<HTMLDivElement>} />\n ) : null;\n }\n break;\n }\n }\n\n return null;\n },\n },\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { BaseBlockstore } from 'blockstore-core';\nimport { IDBBlockstore } from 'blockstore-idb';\nimport type { CID } from 'multiformats';\n\nimport { storeName } from './common';\n\nexport const create = (apiHost?: string) => {\n return new MixedBlockstore(apiHost);\n};\n\n/**\n * A blockstore that communicates with the DXOS blob service,\n * and which uses an indexedDB blockstore as a client cache.\n */\nexport class MixedBlockstore extends BaseBlockstore {\n readonly #apiHost: string | undefined;\n readonly #idbStore: IDBBlockstore;\n\n constructor(apiHost?: string) {\n super();\n\n this.#apiHost = apiHost;\n this.#idbStore = new IDBBlockstore(storeName());\n }\n\n async open() {\n await this.#idbStore.open();\n }\n\n url(apiHost: string, cid?: CID) {\n const path = cid ? cid.toString() : '';\n return `${apiHost}/api/file/${path}`;\n }\n\n // Blockstore implementation\n override async delete(key: CID): Promise<void> {\n await this.#idbStore.delete(key);\n\n if (this.#apiHost) {\n await fetch(this.url(this.#apiHost, key), {\n method: 'DELETE',\n });\n }\n }\n\n override async get(key: CID): Promise<Uint8Array> {\n if (await this.#idbStore.has(key)) {\n return await this.#idbStore.get(key);\n }\n\n if (this.#apiHost) {\n return await fetch(this.url(this.#apiHost, key), {\n method: 'GET',\n })\n .then((r) => r.arrayBuffer())\n .then((r) => new Uint8Array(r));\n }\n\n return await this.#idbStore.get(key);\n }\n\n override async has(key: CID): Promise<boolean> {\n if (await this.#idbStore.has(key)) {\n return true;\n }\n\n if (this.#apiHost) {\n return await fetch(this.url(this.#apiHost, key), {\n method: 'HEAD',\n }).then((r) => r.ok);\n }\n\n return false;\n }\n\n override async put(key: CID, val: Uint8Array): Promise<CID> {\n await this.#idbStore.put(key, val);\n\n if (this.#apiHost) {\n await fetch(this.url(this.#apiHost, key), {\n method: 'POST',\n body: val,\n });\n }\n\n return key;\n }\n\n async destroy(): Promise<void> {\n await this.#idbStore.destroy();\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats/cid';\nimport { sha256 } from 'multiformats/hashes/sha2';\nimport { type BlockStore as WnfsBlockStore } from 'wnfs';\n\nimport * as crypto from '@dxos/crypto';\nimport { type Space } from '@dxos/react-client/echo';\n\n//\n// PATH\n//\n\nexport const filePath = (fileName: string, space: Space) => {\n return ['spaces', space.properties.id, 'files', fileName];\n};\n\n//\n// RNG\n//\n\nexport class Rng {\n randomBytes(count: number): Uint8Array {\n return new Uint8Array(crypto.randomBytes(count));\n }\n}\n\n//\n// STORE\n//\n\nexport const store = (blockstore: Blockstore): WnfsBlockStore => {\n const getBlock = async (cid: Uint8Array): Promise<Uint8Array | undefined> => {\n const decodedCid = CID.decode(cid);\n return await blockstore.get(decodedCid);\n };\n\n const hasBlock = async (cid: Uint8Array): Promise<boolean> => {\n const decodedCid = CID.decode(cid);\n return await blockstore.has(decodedCid);\n };\n\n const putBlockKeyed = async (cid: Uint8Array, bytes: Uint8Array): Promise<void> => {\n const decodedCid = CID.decode(cid);\n await blockstore.put(decodedCid, bytes);\n };\n\n // Don't hash blocks with the rs-wnfs default Blake 3, sha256 has better support.\n const putBlock = async (bytes: Uint8Array, codec: number): Promise<Uint8Array> => {\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, codec, hash);\n await blockstore.put(cid, bytes);\n return cid.bytes;\n };\n\n return { getBlock, hasBlock, putBlockKeyed, putBlock };\n};\n\nexport const storeName = () => 'dxos/wnfs';\n\n//\n// OTHER\n//\n\nexport const readFile = (file: File): Promise<Uint8Array> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (event) => {\n const result = event.target?.result;\n if (result === null || result === undefined || typeof result === 'string') {\n reject(new Error('Expected an ArrayBuffer'));\n return;\n }\n resolve(new Uint8Array(result));\n };\n reader.onerror = (err) => {\n reject(err);\n };\n reader.readAsArrayBuffer(file);\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\n// Lazily load components for content surfaces.\nexport const FileCard = React.lazy(() => import('./FileCard'));\nexport const FileMain = React.lazy(() => import('./FileMain'));\nexport const FileSection = React.lazy(() => import('./FileSection'));\nexport const FileSlide = React.lazy(() => import('./FileSlide'));\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { syntaxTree } from '@codemirror/language';\nimport { type EditorState, type Extension, StateField, type Range, StateEffect } from '@codemirror/state';\nimport { Decoration, EditorView, WidgetType, ViewPlugin, type ViewUpdate } from '@codemirror/view';\nimport type { Blockstore } from 'interface-blockstore';\nimport type { PrivateDirectory, PrivateForest } from 'wnfs';\n\nimport { log } from '@dxos/log';\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { store } from '../common';\nimport { loadWnfs } from '../load';\n\nexport type ImageOptions = {\n blockstore: Blockstore;\n space: Space;\n};\n\nexport const image = (options: ImageOptions): Extension[] => {\n return [stateField(options), viewPlugin(options)];\n};\n\n// GLOBAL STATE\n\n/** Indexed by space id */\nconst loadedWnfsInstances: Record<string, { directory: PrivateDirectory; forest: PrivateForest }> = {};\n\n// EFFECT + EXTENSIONS\n\nconst stateEffect = StateEffect.define<{\n decorations: Range<Decoration>[];\n from: number;\n to: number;\n}>({});\n\nconst stateField = (options: ImageOptions) =>\n StateField.define({\n create: () => {\n return Decoration.none;\n },\n update: (value, tr) => {\n for (const effect of tr.effects) {\n if (effect.is(stateEffect)) {\n return value.map(tr.changes).update({\n filterFrom: effect.value.from,\n filterTo: effect.value.to,\n filter: () => false,\n add: effect.value.decorations,\n });\n }\n }\n\n return value;\n },\n provide: (f) => {\n return EditorView.decorations.from(f);\n },\n });\n\nconst viewPlugin = (options: ImageOptions) =>\n ViewPlugin.define((view: EditorView) => {\n // Initial decoration set on document load\n buildDecorations({\n from: 0,\n to: view.state.doc.length,\n state: view.state,\n options,\n })\n .then((decorations) => {\n view.dispatch({\n effects: stateEffect.of({\n decorations,\n from: 0,\n to: view.state.doc.length,\n }),\n });\n })\n .catch((err) => {\n throw new Error(err);\n });\n\n const update = (update: ViewUpdate) => {\n if (!update.docChanged) {\n return;\n }\n\n const { from, to } = changedRange(update);\n buildDecorations({\n from,\n to,\n state: view.state,\n options,\n })\n .then((decorations) => {\n view.dispatch({\n effects: stateEffect.of({\n decorations,\n from,\n to,\n }),\n });\n })\n .catch((err) => {\n log.catch(err);\n });\n };\n\n return { update };\n });\n\n// 🛠️\n\nconst changedRange = (update: ViewUpdate) => {\n // Find range of changes and cursor changes.\n const cursor = update.state.selection.main.head;\n const oldCursor = update.changes.mapPos(update.startState.selection.main.head);\n\n let from = Math.min(cursor, oldCursor);\n let to = Math.max(cursor, oldCursor);\n\n update.changes.iterChangedRanges((fromA, toA, fromB, toB) => {\n from = Math.min(from, fromB);\n to = Math.max(to, toB);\n });\n\n // Expand to cover lines.\n from = update.state.doc.lineAt(from).from;\n to = update.state.doc.lineAt(to).to;\n\n // Fin\n return { from, to };\n};\n\nconst buildDecorations = async ({\n from,\n to,\n state,\n options,\n}: {\n from: number;\n to: number;\n state: EditorState;\n options: ImageOptions;\n}) => {\n const cursor = state.selection.main.head;\n let nodes: { from: number; hide: boolean; to: number; url: string }[] = [];\n\n syntaxTree(state).iterate({\n enter: (node) => {\n if (node.name === 'Image') {\n const urlNode = node.node.getChild('URL');\n if (urlNode) {\n const hide = state.readOnly || cursor < node.from || cursor > node.to;\n const url = state.sliceDoc(urlNode.from, urlNode.to);\n\n if (url.startsWith('wnfs://')) {\n nodes.push({\n from: node.from,\n to: node.to,\n hide,\n url,\n });\n }\n }\n }\n },\n from,\n to,\n });\n\n // Nodes must be sorted by `from`\n nodes = nodes.sort((a, b) => {\n return a.from - b.from;\n });\n\n const decorations = await nodes.reduce(\n async (acc, node) => {\n const array = await acc;\n const path = node.url\n .replace(/^wnfs:\\/\\//, '')\n .split('/')\n .map((p) => decodeURIComponent(p));\n\n // Cannot load images from other spaces\n const spaceIdFromUrl = path[1];\n if (spaceIdFromUrl !== options.space.properties.id) {\n return array;\n }\n\n const cacheKey = options.space.properties.wnfs_private_forest_cid;\n\n const { directory, forest } = loadedWnfsInstances[cacheKey]\n ? loadedWnfsInstances[cacheKey]\n : await loadWnfs(options.space, options.blockstore);\n\n loadedWnfsInstances[cacheKey] = {\n directory,\n forest,\n };\n\n const wnfsStore = store(options.blockstore);\n\n // Load image contents into memory blob\n const { result } = await directory.read(path, true, forest, wnfsStore);\n const blob = new Blob([result]);\n const blobUrl = URL.createObjectURL(blob);\n\n // Create decoration\n return [\n ...array,\n Decoration.replace({\n block: true, // Prevent cursor from entering.\n widget: new WnfsImageWidget(blobUrl),\n }).range(node.hide ? node.from : node.to, node.to),\n ];\n },\n Promise.resolve([] as Range<Decoration>[]),\n );\n\n return decorations;\n};\n\nclass WnfsImageWidget extends WidgetType {\n constructor(readonly _url: string) {\n super();\n }\n\n override eq(other: this) {\n return this._url === (other as any as WnfsImageWidget)._url;\n }\n\n override toDOM(view: EditorView) {\n const img = document.createElement('img');\n img.setAttribute('loading', 'lazy');\n img.setAttribute('src', this._url);\n img.setAttribute('class', 'cm-image');\n // Images are hidden until successfully loaded to avoid flickering effects.\n img.onload = () => img.classList.add('cm-loaded-image');\n return img;\n }\n}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats';\nimport * as Uint8Arrays from 'uint8arrays';\nimport { AccessKey, PrivateForest, PrivateDirectory, PrivateNode } from 'wnfs';\n\nimport { type Space } from '@dxos/react-client/echo';\n\nimport { Rng, store } from './common';\n\n//\n// LOAD\n//\n\nexport const loadWnfs = async (space: Space, blockstore: Blockstore) => {\n const exists =\n space.properties.wnfs_access_key !== undefined && space.properties.wnfs_private_forest_cid !== undefined;\n\n return exists ? await loadWnfsDir(blockstore, space) : await createWnfsDir(blockstore, space);\n};\n\n//\n// PRIVATE\n//\n\nconst createWnfsDir = async (blockstore: Blockstore, space: Space) => {\n const wnfsStore = store(blockstore);\n const rng = new Rng();\n const forest = new PrivateForest(rng);\n\n const dirResult = await PrivateDirectory.newAndStore(forest.emptyName(), new Date(), forest, wnfsStore, rng);\n const dir = dirResult.rootDir as PrivateDirectory;\n\n const [accessKeyRaw, newForest]: [AccessKey, PrivateForest] = await dir\n .asNode()\n .store(dirResult.forest as PrivateForest, wnfsStore, rng);\n\n const cidBytes = await newForest.store(wnfsStore);\n\n space.properties.wnfs_access_key = Uint8Arrays.toString(accessKeyRaw.toBytes(), 'base64');\n space.properties.wnfs_private_forest_cid = CID.decode(cidBytes).toString();\n\n return {\n directory: dir,\n forest: newForest,\n };\n};\n\nconst loadWnfsDir = async (blockstore: Blockstore, space: Space) => {\n const wnfsStore = store(blockstore);\n\n const accessKey = AccessKey.fromBytes(Uint8Arrays.fromString(space.properties.wnfs_access_key, 'base64'));\n const forest = await PrivateForest.load(CID.parse(space.properties.wnfs_private_forest_cid).bytes, wnfsStore);\n const node: PrivateNode = await PrivateNode.load(accessKey, forest, wnfsStore);\n\n return {\n directory: node.asDir(),\n forest,\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { WNFS_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [WNFS_PLUGIN]: {\n 'plugin name': 'Files',\n 'file title placeholder': 'New file',\n 'delete object label': 'Delete',\n },\n },\n },\n];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Blockstore } from 'interface-blockstore';\nimport { CID } from 'multiformats';\nimport * as Raw from 'multiformats/codecs/raw';\nimport { sha256 } from 'multiformats/hashes/sha2';\n\nimport type { Space } from '@dxos/client/echo';\nimport { log } from '@dxos/log';\n\nimport { Rng, filePath, store } from './common';\nimport { loadWnfs } from './load';\nimport { wnfsUrl } from './wnfs-url';\n\nexport const upload = async ({ blockstore, file, space }: { blockstore: Blockstore; file: File; space: Space }) => {\n const { directory, forest } = await loadWnfs(space, blockstore);\n const wnfsStore = store(blockstore);\n\n const bytes = new Uint8Array(await file.arrayBuffer());\n const hash = await sha256.digest(bytes);\n const cid = CID.create(1, Raw.code, hash);\n\n const path = filePath(cid.toString(), space);\n\n // Given the root directory of the private file system,\n // write the file contents to `path` in said directory.\n const result = await directory.write(path, true, bytes, new Date(), forest, wnfsStore, new Rng());\n\n // Given the new immutable instance of the root directory after writing to it,\n // **store** the changes in the \"dark forest\" and the associated (block) store.\n const [_, updatedForest] = await result.rootDir.store(result.forest, wnfsStore, new Rng());\n const cidBytes = await updatedForest.store(wnfsStore);\n\n // Update the forest pointer on the associated space.\n space.properties.wnfs_private_forest_cid = CID.decode(cidBytes).toString();\n\n // Generate `wnfs://` URL & return the info.\n const info = {\n url: wnfsUrl(path),\n };\n\n log('upload', { file, info });\n return info;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nexport const wnfsUrl = (filePath: string[]) => {\n return 'wnfs://' + filePath.map((f) => encodeURIComponent(f)).join('/');\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { WnfsPlugin } from './WnfsPlugin';\n\nexport default WnfsPlugin;\n\nexport * from './WnfsPlugin';\n"],
5
5
  "mappings": ";;;;;;;;;AAIA,SAASA,iBAAiC;AAC1C,OAAOC,YAAyB;AAEhC,SAAgCC,UAAUC,qBAAqB;AAC/D,SAASC,iBAAiB;AAC1B,SAASC,yBAAyB;AAElC,SAAqBC,gBAAgB;AACrC,SAASC,4BAA4B;;;ACRrC,SAASC,sBAAsB;AAC/B,SAASC,qBAAqB;;;ACA9B,SAASC,WAAW;AACpB,SAASC,cAAc;AAGvB,YAAYC,YAAY;AAOjB,IAAMC,WAAW,CAACC,UAAkBC,UAAAA;AACzC,SAAO;IAAC;IAAUA,MAAMC,WAAWC;IAAI;IAASH;;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AAA,cAACwB,aAAAA;gBAAYpB,MAAMW,KAAKQ;mBAAa;YAChF,KAAK,QAAQ;AACX,kBACEE,SAASV,KAAKW,OAAO,KACrB,OAAOX,KAAKW,QAAQC,OAAO,YAC3BZ,KAAKW,QAAQH,kBAAkB9B,UAC/B;AACA,sBAAMmC,YAAY;kBAAE,GAAG7B;kBAAO8B,MAAM;oBAAEF,IAAIZ,KAAKW,QAAQC;oBAAIJ,QAAQR,KAAKW,QAAQH;kBAAO;gBAAE;AACzF,uBAAOO,qBAAqBF,SAAAA,IAC1B,gBAAA5B,OAAA,cAAC+B,UAAAA;kBAAU,GAAGH;kBAAWI,KAAKf;qBAC5B;cACN;AACA;YACF;UACF;AAEA,iBAAO;QACT;MACF;IACF;EACF;AACF;;;AS/FA,IAAA,cAAegB;",
6
- "names": ["FileCloud", "React", "isObject", "resolvePlugin", "invariant", "parseClientPlugin", "getSpace", "isTileComponentProps", "BaseBlockstore", "IDBBlockstore", "CID", "sha256", "crypto", "filePath", "fileName", "space", "properties", "id", "Rng", "randomBytes", "count", "Uint8Array", "store", "blockstore", "getBlock", "cid", "decodedCid", "CID", "decode", "get", "hasBlock", "has", "putBlockKeyed", "bytes", "put", "putBlock", "codec", "hash", "sha256", "digest", "create", "storeName", "create", "apiHost", "MixedBlockstore", "BaseBlockstore", "constructor", "IDBBlockstore", "storeName", "open", "url", "cid", "path", "toString", "delete", "key", "fetch", "method", "get", "has", "then", "r", "arrayBuffer", "Uint8Array", "ok", "put", "val", "body", "destroy", "React", "FileCard", "React", "lazy", "FileMain", "FileSection", "FileSlide", "syntaxTree", "StateField", "StateEffect", "Decoration", "EditorView", "WidgetType", "ViewPlugin", "log", "CID", "Uint8Arrays", "AccessKey", "PrivateForest", "PrivateDirectory", "PrivateNode", "loadWnfs", "space", "blockstore", "exists", "properties", "wnfs_access_key", "undefined", "wnfs_private_forest_cid", "loadWnfsDir", "createWnfsDir", "wnfsStore", "store", "rng", "Rng", "forest", "PrivateForest", "dirResult", "PrivateDirectory", "newAndStore", "emptyName", "Date", "dir", "rootDir", "accessKeyRaw", "newForest", "asNode", "cidBytes", "toString", "toBytes", "CID", "decode", "directory", "accessKey", "AccessKey", "fromBytes", "fromString", "load", "parse", "bytes", "node", "PrivateNode", "asDir", "image", "options", "stateField", "viewPlugin", "loadedWnfsInstances", "stateEffect", "StateEffect", "define", "StateField", "create", "Decoration", "none", "update", "value", "tr", "effect", "effects", "is", "map", "changes", "filterFrom", "from", "filterTo", "to", "filter", "add", "decorations", "provide", "f", "EditorView", "ViewPlugin", "view", "buildDecorations", "state", "doc", "length", "then", "dispatch", "of", "catch", "err", "Error", "docChanged", "changedRange", "log", "cursor", "selection", "main", "head", "oldCursor", "mapPos", "startState", "Math", "min", "max", "iterChangedRanges", "fromA", "toA", "fromB", "toB", "lineAt", "nodes", "syntaxTree", "iterate", "enter", "node", "name", "urlNode", "getChild", "hide", "readOnly", "url", "sliceDoc", "startsWith", "push", "sort", "a", "b", "reduce", "acc", "array", "path", "replace", "split", "p", "decodeURIComponent", "spaceIdFromUrl", "space", "properties", "id", "cacheKey", "wnfs_private_forest_cid", "directory", "forest", "loadWnfs", "blockstore", "wnfsStore", "store", "result", "read", "blob", "Blob", "blobUrl", "URL", "createObjectURL", "block", "widget", "WnfsImageWidget", "range", "Promise", "resolve", "WidgetType", "constructor", "_url", "eq", "other", "toDOM", "img", "document", "createElement", "setAttribute", "onload", "classList", "WNFS_PLUGIN", "CID", "Raw", "sha256", "log", "wnfsUrl", "filePath", "map", "f", "encodeURIComponent", "join", "upload", "blockstore", "file", "space", "directory", "forest", "loadWnfs", "wnfsStore", "store", "bytes", "Uint8Array", "arrayBuffer", "hash", "sha256", "digest", "cid", "CID", "create", "code", "path", "filePath", "toString", "result", "write", "Date", "Rng", "_", "updatedForest", "rootDir", "cidBytes", "properties", "wnfs_private_forest_cid", "decode", "info", "url", "wnfsUrl", "log", "WnfsPlugin", "blockstore", "meta", "ready", "plugins", "client", "resolvePlugin", "parseClientPlugin", "provides", "invariant", "apiHost", "config", "values", "runtime", "services", "edge", "url", "create", "open", "translations", "metadata", "records", "FileType", "typename", "placeholder", "ns", "WNFS_PLUGIN", "icon", "props", "React", "FileCloud", "echo", "schema", "file", "upload", "space", "Error", "markdown", "extensions", "document", "getSpace", "imageExtension", "surface", "component", "data", "role", "forwardedRef", "active", "FileMain", "slide", "FileSlide", "cover", "object", "FileSection", "isObject", "content", "id", "cardProps", "item", "isTileComponentProps", "FileCard", "ref", "WnfsPlugin"]
6
+ "names": ["FileCloud", "React", "isObject", "resolvePlugin", "invariant", "parseClientPlugin", "getSpace", "isTileComponentProps", "BaseBlockstore", "IDBBlockstore", "CID", "sha256", "crypto", "filePath", "fileName", "space", "properties", "id", "Rng", "randomBytes", "count", "Uint8Array", "store", "blockstore", "getBlock", "cid", "decodedCid", "CID", "decode", "get", "hasBlock", "has", "putBlockKeyed", "bytes", "put", "putBlock", "codec", "hash", "sha256", "digest", "create", "storeName", "create", "apiHost", "MixedBlockstore", "BaseBlockstore", "constructor", "IDBBlockstore", "storeName", "open", "url", "cid", "path", "toString", "delete", "key", "fetch", "method", "get", "has", "then", "r", "arrayBuffer", "Uint8Array", "ok", "put", "val", "body", "destroy", "React", "FileCard", "React", "lazy", "FileMain", "FileSection", "FileSlide", "syntaxTree", "StateField", "StateEffect", "Decoration", "EditorView", "WidgetType", "ViewPlugin", "log", "CID", "Uint8Arrays", "AccessKey", "PrivateForest", "PrivateDirectory", "PrivateNode", "loadWnfs", "space", "blockstore", "exists", "properties", "wnfs_access_key", "undefined", "wnfs_private_forest_cid", "loadWnfsDir", "createWnfsDir", "wnfsStore", "store", "rng", "Rng", "forest", "PrivateForest", "dirResult", "PrivateDirectory", "newAndStore", "emptyName", "Date", "dir", "rootDir", "accessKeyRaw", "newForest", "asNode", "cidBytes", "toString", "toBytes", "CID", "decode", "directory", "accessKey", "AccessKey", "fromBytes", "fromString", "load", "parse", "bytes", "node", "PrivateNode", "asDir", "image", "options", "stateField", "viewPlugin", "loadedWnfsInstances", "stateEffect", "StateEffect", "define", "StateField", "create", "Decoration", "none", "update", "value", "tr", "effect", "effects", "is", "map", "changes", "filterFrom", "from", "filterTo", "to", "filter", "add", "decorations", "provide", "f", "EditorView", "ViewPlugin", "view", "buildDecorations", "state", "doc", "length", "then", "dispatch", "of", "catch", "err", "Error", "docChanged", "changedRange", "log", "cursor", "selection", "main", "head", "oldCursor", "mapPos", "startState", "Math", "min", "max", "iterChangedRanges", "fromA", "toA", "fromB", "toB", "lineAt", "nodes", "syntaxTree", "iterate", "enter", "node", "name", "urlNode", "getChild", "hide", "readOnly", "url", "sliceDoc", "startsWith", "push", "sort", "a", "b", "reduce", "acc", "array", "path", "replace", "split", "p", "decodeURIComponent", "spaceIdFromUrl", "space", "properties", "id", "cacheKey", "wnfs_private_forest_cid", "directory", "forest", "loadWnfs", "blockstore", "wnfsStore", "store", "result", "read", "blob", "Blob", "blobUrl", "URL", "createObjectURL", "block", "widget", "WnfsImageWidget", "range", "Promise", "resolve", "WidgetType", "constructor", "_url", "eq", "other", "toDOM", "img", "document", "createElement", "setAttribute", "onload", "classList", "WNFS_PLUGIN", "CID", "Raw", "sha256", "log", "wnfsUrl", "filePath", "map", "f", "encodeURIComponent", "join", "upload", "blockstore", "file", "space", "directory", "forest", "loadWnfs", "wnfsStore", "store", "bytes", "Uint8Array", "arrayBuffer", "hash", "sha256", "digest", "cid", "CID", "create", "code", "path", "filePath", "toString", "result", "write", "Date", "Rng", "_", "updatedForest", "rootDir", "cidBytes", "properties", "wnfs_private_forest_cid", "decode", "info", "url", "wnfsUrl", "log", "WnfsPlugin", "blockstore", "meta", "ready", "plugins", "client", "resolvePlugin", "parseClientPlugin", "provides", "invariant", "apiHost", "config", "values", "runtime", "services", "edge", "url", "create", "open", "translations", "metadata", "records", "FileType", "typename", "placeholder", "ns", "WNFS_PLUGIN", "icon", "props", "React", "FileCloud", "echo", "system", "file", "upload", "space", "Error", "markdown", "extensions", "document", "getSpace", "imageExtension", "surface", "component", "data", "role", "forwardedRef", "active", "FileMain", "slide", "FileSlide", "cover", "object", "FileSection", "isObject", "content", "id", "cardProps", "item", "isTileComponentProps", "FileCard", "ref", "WnfsPlugin"]
7
7
  }
@@ -1 +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}}}
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-JDSKIDDR.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-JDSKIDDR.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-JDSKIDDR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1723},"packages/plugins/experimental/plugin-wnfs/dist/lib/browser/chunk-JDSKIDDR.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}}}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FileType,
3
3
  WnfsAction
4
- } from "../chunk-CUGB532P.mjs";
4
+ } from "../chunk-JDSKIDDR.mjs";
5
5
  import "../chunk-VL3H7P4F.mjs";
6
6
  export {
7
7
  FileType,
@@ -1,6 +1,6 @@
1
1
  import { type FileManagerProvides, type MetadataRecordsProvides, type SurfaceProvides, type TranslationsProvides } from '@dxos/app-framework';
2
- import { type SchemaProvides } from '@dxos/plugin-client';
3
2
  import { type MarkdownExtensionProvides } from '@dxos/plugin-markdown/types';
3
+ import { type SchemaProvides } from '@dxos/plugin-space';
4
4
  export declare enum WnfsAction {
5
5
  CREATE = "dxos.org/plugin/WNFS/action/create"
6
6
  }
@@ -1 +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"}
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,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMzD,oBAAY,UAAU;IACpB,MAAM,uCAA0B;CACjC;AAED,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAClD,eAAe,GACf,uBAAuB,GACvB,oBAAoB,GACpB,cAAc,GACd,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-wnfs",
3
- "version": "0.7.2",
3
+ "version": "0.7.3-staging.971cd8d",
4
4
  "description": "WNFS file management plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -45,17 +45,18 @@
45
45
  "multiformats": "^13.2.2",
46
46
  "uint8arrays": "^5.1.0",
47
47
  "wnfs": "0.2.2",
48
- "@dxos/crypto": "0.7.2",
49
- "@dxos/app-framework": "0.7.2",
50
- "@dxos/invariant": "0.7.2",
51
- "@dxos/echo-schema": "0.7.2",
52
- "@dxos/local-storage": "0.7.2",
53
- "@dxos/plugin-client": "0.7.2",
54
- "@dxos/log": "0.7.2",
55
- "@dxos/plugin-markdown": "0.7.2",
56
- "@dxos/react-client": "0.7.2",
57
- "@dxos/react-ui-card": "0.7.2",
58
- "@dxos/react-ui-mosaic": "0.7.2"
48
+ "@dxos/app-framework": "0.7.3-staging.971cd8d",
49
+ "@dxos/crypto": "0.7.3-staging.971cd8d",
50
+ "@dxos/echo-schema": "0.7.3-staging.971cd8d",
51
+ "@dxos/invariant": "0.7.3-staging.971cd8d",
52
+ "@dxos/log": "0.7.3-staging.971cd8d",
53
+ "@dxos/local-storage": "0.7.3-staging.971cd8d",
54
+ "@dxos/plugin-markdown": "0.7.3-staging.971cd8d",
55
+ "@dxos/plugin-client": "0.7.3-staging.971cd8d",
56
+ "@dxos/plugin-space": "0.7.3-staging.971cd8d",
57
+ "@dxos/react-ui-card": "0.7.3-staging.971cd8d",
58
+ "@dxos/react-client": "0.7.3-staging.971cd8d",
59
+ "@dxos/react-ui-mosaic": "0.7.3-staging.971cd8d"
59
60
  },
60
61
  "devDependencies": {
61
62
  "@phosphor-icons/react": "^2.1.5",
@@ -64,17 +65,17 @@
64
65
  "react": "~18.2.0",
65
66
  "react-dom": "~18.2.0",
66
67
  "vite": "5.4.7",
67
- "@dxos/react-ui-theme": "0.7.2",
68
- "@dxos/react-ui": "0.7.2",
69
- "@dxos/react-ui-editor": "0.7.2",
70
- "@dxos/storybook-utils": "0.7.2"
68
+ "@dxos/react-ui-editor": "0.7.3-staging.971cd8d",
69
+ "@dxos/react-ui-theme": "0.7.3-staging.971cd8d",
70
+ "@dxos/react-ui": "0.7.3-staging.971cd8d",
71
+ "@dxos/storybook-utils": "0.7.3-staging.971cd8d"
71
72
  },
72
73
  "peerDependencies": {
73
74
  "@phosphor-icons/react": "^2.0.5",
74
75
  "react": "~18.2.0",
75
76
  "react-dom": "~18.2.0",
76
- "@dxos/react-ui": "0.7.2",
77
- "@dxos/react-ui-theme": "0.7.2"
77
+ "@dxos/react-ui": "0.7.3-staging.971cd8d",
78
+ "@dxos/react-ui-theme": "0.7.3-staging.971cd8d"
78
79
  },
79
80
  "publishConfig": {
80
81
  "access": "public"
@@ -44,7 +44,7 @@ export const WnfsPlugin = (): PluginDefinition<WnfsPluginProvides> => {
44
44
  },
45
45
  },
46
46
  echo: {
47
- schema: [FileType],
47
+ system: [FileType],
48
48
  },
49
49
  // TODO(burdon): Add intent to upload file.
50
50
  file: {
@@ -8,8 +8,8 @@ import {
8
8
  type SurfaceProvides,
9
9
  type TranslationsProvides,
10
10
  } from '@dxos/app-framework';
11
- import { type SchemaProvides } from '@dxos/plugin-client';
12
11
  import { type MarkdownExtensionProvides } from '@dxos/plugin-markdown/types';
12
+ import { type SchemaProvides } from '@dxos/plugin-space';
13
13
 
14
14
  import { WNFS_PLUGIN } from '../meta';
15
15