# atlibs-web-editor-ui Author, check and publish [atlibs](https://knotless.dev/johnandersen777.bsky.social/atlibs) compositions: https://atlibs.socialweb.computer/ - Open `/` or `at://…` (`@` pins it); `?ref=` in the URL does the same. - Each edit is checked against the `com.fedfork.exec.composition` lexicon, then loaded as both hosts load it (`loadComposition`: pins, hooks, parameters). Shown: instances, edges, hooks, parameters, exports, session scopes. - **Add module** `/`: an instance at its `at://` URI and pin. - **Publish**: `putRecord` as you (a swap on your own record's CID). - **Bind to knotless repo**: a `com.fedfork.exec.binding` at the repository's key (`getRecord` of its `dev.knotless.repo`), or `self`, pinning the opened composition by CID. Run it: ```sh git clone https://knotless.dev/johnandersen777.bsky.social/atlibs-web-editor-ui cd atlibs-web-editor-ui python3 -m http.server 8790 --bind 127.0.0.1 # http://127.0.0.1:8790/ (sign-in: the loopback client) ``` Test (headless Chrome; with `ALICE_ATPROTO_HANDLE` and `ALICE_ATPROTO_PASSWORD`, an app password, also a publish, bind and delete round as that account): ```sh npm ci node --test test/*.test.mjs ``` The example is written by `compose.ts` from `atlibs.modules.js` (`atlibs add` wrote it): ```sh node compose.ts | diff - example.json atlibs compose check example.json > /dev/null && echo loads ``` Deploy (`scripts/deploy.sh`: `dist/` to the socialweb.computer gateway, a Caddy site): ```sh cargo install --locked --git https://knotless.dev/johnandersen777.bsky.social/atlibs --rev 88b2ba8 atlibs scripts/build.sh # dist/ for https://atlibs.socialweb.computer/; another origin: scripts/build.sh https://host/path/ scripts/deploy.sh ``` | what | from | |---|---| | `@publicdomainrelay/atlibs` 0.3.0 | jsdelivr (`index.html` import map; `package-lock.json` for `compose.ts`) | | the example's `compose` module | `atlibs.lock.json` (`atlibs add bobvmbuilder.bsky.social/compose`) | | `@atproto/oauth-client-browser` 0.5.14, `@atproto/lexicon` 0.7.17, codemirror 6.0.2, `@codemirror/lang-json` 6.0.2 | esm.sh | | `lexicons/` | atlibs 88b2ba8 (v0.3.0), and `com.atproto.repo.strongRef` | | the OAuth client | `records/editor.json`, staged by `atlibs stage --target spa` | Decisions: - Records store `at://` URIs and pins; the editor shows `/` (a handle verified both ways, else `/`). Inputs take `/`, `/` or `at://…`. - A module key resolves against the opened composition's publisher, else you. Publishing someone else's composition rewrites its keys to `at://` URIs of theirs. - Added modules are pinned; the example pins every instance. - No `listRecords`: everything is a `getRecord` at a known key.