README.md
Media Browser sample
This teaching extension registers a quiet left-docked panel, loads a replaceable image catalogue, imports selected files into Powermove, and starts typed timeline drags. Copy the whole folder into an extension directory to try it.
Follow the data
mockMediaSourcereturns{ id, name, url }records. Replace only that function when connecting a real catalogue.- The panel fetches a URL as a
Blob, wraps it in a namedFile, and callsapi.assets.import. This API returns the durable asset id needed by drag/drop. api.dnd.startAssetDragwrites the canonical asset MIME payload. The sample also setsapi.dnd.mediaDragduring the gesture so the timeline can describe the drop preview while browsers protectDataTransfercontents.- Dropping creates one undoable project edit.
api.project.undo()removes that layer; the durable imported asset intentionally remains available.
The default catalogue uses data: URLs, so it needs no server and avoids
connect-src restrictions. If the app's Content Security Policy blocks a remote
catalogue, proxy it through an allowed origin or return data URLs from the source.
Only powermove, Svelte, and files inside this folder are imported. No renderer
internals or legacy registry are involved.