Slice · AI prompt
The notion-page-clone block editor as a portable slice: slash menu, markdown triggers, drag, per-block toolbar — host capabilities invert through an EditorAdapter seam.
# Install `notion-app` — Notion App — Block Editor
> The notion-page-clone block editor as a portable slice: slash menu, markdown triggers, drag, per-block toolbar — host capabilities invert through an EditorAdapter seam.
📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail : https://resource.rahmanef.com/slices/notion-app
🧠 JSON catalog : https://resource.rahmanef.com/api/knowledge?slice=notion-app
🔗 Source : https://github.com/rahmanef63/resource-site/tree/main/frontend/slices/notion-app
## 1. Install
```bash
npx rahman-resources add notion-app
# alias: npx rr add notion-app
```
The CLI copies `frontend/slices/notion-app/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.
## 2. What it ships
- npm: `sonner`, `@dnd-kit/core`, `@dnd-kit/sortable`, `@dnd-kit/utilities`, `katex`
- shadcn primitives: `button`, `dropdown-menu`, `popover`, `separator`, `checkbox`, `input`, `switch`, `skeleton`
- convex feature paths: `convex/features/notion`
## 3. Wire it up
Run `npx rr add notion-app`. Wire the `@notion/*` path alias to `./slices/notion-app/*` in tsconfig. Minimal mount: `<EditorAdapterProvider adapter={{ data }}><PageEditor pageId={id}/></EditorAdapterProvider>` where `data` implements EditorDataAdapter (block+page CRUD over your store — see lib/dataAdapter.ts; a localStorage reference impl lives in the rr preview). Add capabilities incrementally: `selection` for multi-select, `comments` for per-block threads, `database.renderDatabase` to mount your database renderer inside database blocks, `mention.search` for @-typeahead, `page.navigateToPage`/`uploadFile` for nav + media. Convex hosts: copy convex/features/notion (_blocks/_blockOps are pure, unit-tested array ops) and keep handlers thin.
## Rules of engagement
- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice
The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.