Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Logseq portable plugin demos

Reference plugins for the portable cross-platform plugin runtime (see the plugin system ADR in logseq/logseq, refactor/lui branch). Every plugin here is a single-artifact QuickJS plugin: it runs in the native desktop app today, and the same artifact is designed to run in the web app (WASM runtime) and mobile without repackaging.

Layout

One directory per plugin, each self-contained:

<plugin>/
  manifest.json   — id, name, version, main, capabilities
  main.ts         — plugin source against the portable SDK surface

Plugins use only the portable logseq SDK surface (logseq.Editor, logseq.DB, logseq.UI, logseq.Commands, logseq.Settings). No DOM, no CSS injection, no iframe APIs.

Authoring model

Panels are reactive: create state with logseq.state(initial), bind a panel once with logseq.UI.panel({ key, title }, view), and build trees with the element constructors in ui (ui.column, ui.text, ui.button, ...). Any state write re-runs the view and pushes the update — there is no manual diffing, re-render call, or callback management:

const count = logseq.state(0)
await logseq.UI.panel({ key: 'main', title: 'Demo' }, () =>
  ui.column({ gap: 8 }, [
    ui.text(`Pressed ${count.value}`),
    ui.button({ label: 'inc', onPress: () => { count.value += 1 } }),
  ])
)

Props accept state refs directly (ui.input({ value: name, ... })).

Building

The portable SDK lives in logseq/logseq libs/ (build:quickjs webpack target). To build a plugin:

pnpm --dir <logseq>/libs run build:quickjs \
  --env plugin=<this-repo>/<plugin>/main.ts \
  --env output=<plugin>/main.mjs

Installation in the native app: place manifest.json + the built main.mjs in the plugin package directory, or install from a URL serving both files.

Plugins

  • hello-panel — exercises the full vertical slice: panel surface, declarative tree with live updates, editor command, settings schema with typed reads/writes.

Webview-island plugins

excalidraw/ and tldraw/ are webview-island plugins (see 2026-12-04-webview-island-plugins.md in logseq/logseq): self-contained single-file HTML apps running in a sandboxed iframe/native webview, talking to the host over the typed plugin protocol via shared/logseq-webview-sdk.js. Both store scene files in the graph assets/whiteboards/ directory and can embed logseq page/block cards that navigate back into the host graph. Build with ./build-webview.sh, then copy */dist/ into the app's static/plugins/<id>/.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages