editlet 0.0.0-stage → 0.1.0-alpha.0
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.
- package/LICENSE +21 -0
- package/README.md +113 -2
- package/dist/admin/config.d.ts +22 -0
- package/dist/admin/config.js +75 -0
- package/dist/admin/dist/assets/RichEditor-BlaCRrEX.css +1 -0
- package/dist/admin/dist/assets/RichEditor-IZKdt6MK.js +42 -0
- package/dist/admin/dist/assets/blank-line-CbGzlqBI.js +1 -0
- package/dist/admin/dist/assets/channel-CljeMIwA.js +1 -0
- package/dist/admin/dist/assets/db-CCMyPgQa.js +1 -0
- package/dist/admin/dist/assets/index-CWoJh4H8.js +257 -0
- package/dist/admin/dist/assets/index-DkRMnD_M.css +1 -0
- package/dist/admin/dist/assets/mdast-util-from-markdown-C79q1_d8.js +3 -0
- package/dist/admin/dist/assets/mdast-util-gfm-cM-_xFJE.js +19 -0
- package/dist/admin/dist/assets/micromark-extension-gfm-Wz6-oszS.js +1 -0
- package/dist/admin/dist/assets/micromark-util-classify-character-BgXaGAja.js +1 -0
- package/dist/admin/dist/assets/micromark-util-html-tag-name-B61T18yC.js +1 -0
- package/dist/admin/dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/dist/admin/dist/index.html +16 -0
- package/dist/admin/dist/preview.js +1 -0
- package/dist/admin/dist/window.js +1 -0
- package/dist/astro/content.d.ts +21 -0
- package/dist/astro/content.js +235 -0
- package/dist/astro/devServer.js +89 -0
- package/dist/astro/index.d.ts +15 -0
- package/dist/astro/index.js +98 -0
- package/dist/astro/nodeBridge.js +36 -0
- package/dist/astro/shared.js +10 -0
- package/dist/astro/stub/index.html +71 -0
- package/dist/auth/client.d.ts +24 -0
- package/dist/auth/client.js +120 -0
- package/dist/auth/handler.d.ts +16 -0
- package/dist/auth/handler.js +281 -0
- package/dist/auth/protocol.d.ts +25 -0
- package/dist/auth/protocol.js +3 -0
- package/dist/core/assets.d.ts +73 -0
- package/dist/core/assets.js +405 -0
- package/dist/core/devApi.d.ts +28 -0
- package/dist/core/devApi.js +3 -0
- package/dist/core/entryFile.d.ts +13 -0
- package/dist/core/entryFile.js +81 -0
- package/dist/core/fields.js +147 -0
- package/dist/core/generate.d.ts +3 -0
- package/dist/core/generate.js +70 -0
- package/dist/core/gitStyle.d.ts +92 -0
- package/dist/core/gitStyle.js +206 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.js +16 -0
- package/dist/core/issues.d.ts +10 -0
- package/dist/core/issues.js +10 -0
- package/dist/core/paths.d.ts +31 -0
- package/dist/core/paths.js +114 -0
- package/dist/core/project.js +56 -0
- package/dist/core/references.d.ts +68 -0
- package/dist/core/references.js +103 -0
- package/dist/core/rename.d.ts +60 -0
- package/dist/core/rename.js +133 -0
- package/dist/core/schema.d.ts +117 -0
- package/dist/core/schema.js +299 -0
- package/dist/core/sha.d.ts +2 -0
- package/dist/core/sha.js +13 -0
- package/dist/core/source.d.ts +48 -0
- package/dist/core/source.js +57 -0
- package/dist/core/validate.d.ts +22 -0
- package/dist/core/validate.js +148 -0
- package/dist/core/walk.d.ts +23 -0
- package/dist/core/walk.js +94 -0
- package/dist/core/writes.d.ts +37 -0
- package/dist/core/writes.js +166 -0
- package/dist/github/base64.js +16 -0
- package/dist/github/cache.d.ts +34 -0
- package/dist/github/cache.js +126 -0
- package/dist/github/client.d.ts +38 -0
- package/dist/github/client.js +228 -0
- package/dist/github/codeowners.d.ts +23 -0
- package/dist/github/codeowners.js +96 -0
- package/dist/github/commitReader.d.ts +25 -0
- package/dist/github/commitReader.js +38 -0
- package/dist/github/deploy.d.ts +15 -0
- package/dist/github/deploy.js +33 -0
- package/dist/github/index.d.ts +9 -0
- package/dist/github/index.js +8 -0
- package/dist/github/repo.d.ts +95 -0
- package/dist/github/repo.js +375 -0
- package/dist/github/source.d.ts +115 -0
- package/dist/github/source.js +558 -0
- package/dist/loader/index.d.ts +27 -0
- package/dist/loader/index.js +151 -0
- package/dist/loader/protocol.d.ts +95 -0
- package/dist/loader/protocol.js +120 -0
- package/dist/loader/window/geometry.js +9 -0
- package/dist/next/EditletLoader.d.ts +5 -0
- package/dist/next/EditletLoader.js +33 -0
- package/dist/next/assetUrl.d.ts +9 -0
- package/dist/next/assetUrl.js +13 -0
- package/dist/next/buildGuard.js +26 -0
- package/dist/next/config.d.ts +18 -0
- package/dist/next/config.js +255 -0
- package/dist/next/devServer.js +70 -0
- package/dist/next/editletField.d.ts +7 -0
- package/dist/next/editletField.js +7 -0
- package/dist/next/index.d.ts +8 -0
- package/dist/next/index.js +6 -0
- package/dist/next/preview.d.ts +18 -0
- package/dist/next/preview.js +100 -0
- package/dist/next/previewCookie.d.ts +5 -0
- package/dist/next/previewCookie.js +72 -0
- package/dist/next/previewEnv.js +25 -0
- package/dist/next/previewRef.d.ts +8 -0
- package/dist/next/previewRef.js +17 -0
- package/dist/next/publicDir.js +65 -0
- package/dist/next/reader.d.ts +49 -0
- package/dist/next/reader.js +161 -0
- package/dist/next/stub/index.html +56 -0
- package/dist/node/devHandler.d.ts +6 -0
- package/dist/node/devHandler.js +430 -0
- package/dist/node/fs.js +37 -0
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.js +3 -0
- package/dist/node/project.d.ts +12 -0
- package/dist/node/project.js +43 -0
- package/package.json +187 -4
- package/skills/README.md +84 -0
- package/skills/editlet/SKILL.md +119 -0
- package/skills/editlet/references/content-format.md +191 -0
- package/skills/editlet/references/preview.md +75 -0
- package/skills/editlet/references/publishing.md +137 -0
- package/skills/editlet/references/schema-changes.md +127 -0
- package/skills/editlet/scripts/guard.mjs +1061 -0
- package/skills/editlet/scripts/link.mjs +193 -0
- package/skills/editlet/scripts/refs.mjs +1480 -0
- package/skills/editlet/scripts/schema.mjs +1340 -0
- package/skills/editlet/scripts/style.mjs +657 -0
- package/skills/editlet/scripts/types.mjs +525 -0
- package/skills/editlet/scripts/validate.mjs +724 -0
- package/skills/editlet-migrate/SKILL.md +92 -0
- package/skills/editlet-migrate/references/mapping.md +73 -0
- package/skills/editlet-migrate/references/sources.md +70 -0
- package/skills/editlet-setup/SKILL.md +108 -0
- package/skills/editlet-setup/references/astro.md +83 -0
- package/skills/editlet-setup/references/doctor.md +89 -0
- package/skills/editlet-setup/references/next.md +140 -0
- package/skills/editlet-setup/references/preview.md +54 -0
- package/skills/editlet-setup/references/production.md +153 -0
- package/skills/editlet-setup/references/roles.md +238 -0
- package/skills/editlet-setup/references/skills.md +99 -0
- package/skills/editlet-setup/scripts/doctor.mjs +1378 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Anton Gunkin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,114 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Editlet
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Git-based, file-based CMS for Next.js and Astro. Content is Markdown files with YAML frontmatter in your repo,
|
|
4
|
+
described by one `cms/schema.json`. Editors open `?editlet` on any page of the site, and every edit becomes a commit.
|
|
5
|
+
Claude Code is the main editor, through the bundled skill.
|
|
6
|
+
|
|
7
|
+
Status: alpha (the npm dist-tag `alpha`: `editlet@alpha`). Node 22.12 or newer. Browsers: Chrome 125+, Edge 125+,
|
|
8
|
+
Firefox 126+, Safari 17.5+. License: MIT.
|
|
9
|
+
|
|
10
|
+
## Install with your agent
|
|
11
|
+
|
|
12
|
+
Copy this prompt into Claude Code, Codex or another coding agent, in your Next.js or Astro project:
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
Install Editlet in this project: add the package `editlet@alpha` with the project's package manager, then read
|
|
16
|
+
node_modules/editlet/skills/editlet-setup/SKILL.md and follow it.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Install manually
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install editlet@alpha
|
|
23
|
+
node node_modules/editlet/skills/editlet/scripts/link.mjs --hooks
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`link.mjs --hooks` links the skill into `.claude/skills/editlet` and `.agents/skills/editlet` and adds the guard hook.
|
|
27
|
+
Run it again any time; with `--check --hooks` it only reports. Then add `cms/schema.json` and wire the framework as shown below
|
|
28
|
+
(the agent's version of these steps is the `editlet-setup` skill in `skills/editlet-setup/`).
|
|
29
|
+
|
|
30
|
+
`next`, `react` and `astro` are optional peer dependencies. Install the ones your framework needs: `next >=16` with
|
|
31
|
+
`react >=19`, or `astro ^6 || ^7`.
|
|
32
|
+
|
|
33
|
+
## Entry points
|
|
34
|
+
|
|
35
|
+
| Import | What it is |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `editlet/next` | `createReader`, `EditletLoader` for Next.js Server Components |
|
|
38
|
+
| `editlet/next/config` | `withEditlet` wrapper for `next.config.ts` |
|
|
39
|
+
| `editlet/next/preview` | Draft-mode preview route (`POST`/`DELETE`) for `app/api/editlet/preview/route.ts` |
|
|
40
|
+
| `editlet/astro` | Astro integration |
|
|
41
|
+
| `editlet/astro/content` | `editletCollections`, `editletLoader` for `src/content.config.ts` |
|
|
42
|
+
| `editlet/core` | Schema, entry parsing, validation, type generation (no Node or framework APIs) |
|
|
43
|
+
| `editlet/node` | Local project reading and the dev file API |
|
|
44
|
+
| `editlet/github` | GitHub content source: tree reads, commits, branches, PRs |
|
|
45
|
+
| `editlet/auth` | GitHub OAuth handler (Cloudflare, Vercel, Node) |
|
|
46
|
+
| `editlet/auth/client` | Browser side of the sign-in flow |
|
|
47
|
+
| `editlet/auth/protocol` | Shared auth constants and types |
|
|
48
|
+
| `editlet/loader` | The `?editlet` loader that mounts the editor iframe on a page |
|
|
49
|
+
| `editlet/loader/protocol` | The `postMessage` protocol between page and admin |
|
|
50
|
+
| `editlet/admin/dist/*` | The prebuilt admin app (static files) |
|
|
51
|
+
|
|
52
|
+
## Next.js
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
// next.config.ts
|
|
56
|
+
import { withEditlet } from 'editlet/next/config';
|
|
57
|
+
export default withEditlet({ reactStrictMode: true });
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
// src/lib/cms.ts
|
|
62
|
+
import { createReader } from 'editlet/next';
|
|
63
|
+
import type { EntryMap } from '../../.editlet/content';
|
|
64
|
+
export const { getEntries, getEntry, getRef } = createReader<EntryMap>();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
// app/layout.tsx: render <EditletLoader /> after {children}
|
|
69
|
+
import { EditletLoader } from 'editlet/next';
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Add `/.editlet/` and `/public/editlet/` to `.gitignore`. More in the Next.js adapter README (`next/README.md` in the
|
|
73
|
+
repository).
|
|
74
|
+
|
|
75
|
+
## Astro
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
// astro.config.mjs
|
|
79
|
+
import editlet from 'editlet/astro';
|
|
80
|
+
import { defineConfig } from 'astro/config';
|
|
81
|
+
export default defineConfig({ integrations: [editlet()] });
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
// src/content.config.ts
|
|
86
|
+
import { editletCollections } from 'editlet/astro/content';
|
|
87
|
+
export const collections = editletCollections();
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Then use `getCollection`, `getEntry` and `render` as usual. More in the Astro adapter README (`astro/README.md`).
|
|
91
|
+
|
|
92
|
+
## Agent skills
|
|
93
|
+
|
|
94
|
+
The package ships three Agent Skills in `skills/`:
|
|
95
|
+
|
|
96
|
+
| Skill | Use |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `editlet` | Edit content and the schema, preview in `?editlet`, publish through an `editlet/<name>` branch and a PR |
|
|
99
|
+
| `editlet-setup` | Install Editlet in Next.js or Astro, set up editing on the live site, upgrade, diagnose (`doctor.mjs`) |
|
|
100
|
+
| `editlet-migrate` | Import Markdown/MDX folders, Astro collections, Decap, TinaCMS, Keystatic and similar |
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
node node_modules/editlet/skills/editlet/scripts/link.mjs --hooks
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This links all three into `.claude/skills/` and `.agents/skills/` and adds the guard hook. Then ask your agent to set
|
|
107
|
+
up Editlet. Check content with `node node_modules/editlet/skills/editlet/scripts/validate.mjs`. More in
|
|
108
|
+
`skills/README.md`.
|
|
109
|
+
|
|
110
|
+
## Documentation
|
|
111
|
+
|
|
112
|
+
The package source is published in [antongunkin/editlet](https://github.com/antongunkin/editlet).
|
|
113
|
+
The full docs live in the development repository under `docs/`, which is not exported there yet, so module READMEs
|
|
114
|
+
that link to `docs/` have dead links in the public repo. There is no public docs URL yet.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Adapter option `admin`. Everything here ends up public. */
|
|
2
|
+
export interface AdminConfigOptions {
|
|
3
|
+
/** `owner/name`. Default: Vercel's `VERCEL_GIT_REPO_OWNER`/`VERCEL_GIT_REPO_SLUG`, then `GITHUB_REPOSITORY`. */
|
|
4
|
+
repo?: string;
|
|
5
|
+
/** Public URL of the auth handler: https, `http` on localhost, or a path starting with `/`. */
|
|
6
|
+
authUrl?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Minutes without clicks or typing in the admin after which the admin signs out (integer 1–1440). Default: the env
|
|
9
|
+
* var `CMS_SESSION_MINUTES`, else the admin's 60.
|
|
10
|
+
*/
|
|
11
|
+
sessionMinutes?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Turn on live preview of unsaved edits in the Next site. Needs a resolvable GitHub repo and the server env vars
|
|
14
|
+
* `CMS_PREVIEW_SECRET` and `CMS_GITHUB_TOKEN`; see `docs/next/preview.md`. Default: off.
|
|
15
|
+
*/
|
|
16
|
+
preview?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Query parameter that opens the editor on the site's pages (`?<param>`, `?<param>=branch:<name>`): letters, digits,
|
|
19
|
+
* `_` and `-`, starting with a letter. Default: the env var `EDITLET_PARAM`, else `editlet`.
|
|
20
|
+
*/
|
|
21
|
+
param?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { EDITLET_PARAM } from "../loader/protocol.js";
|
|
2
|
+
// admin/config.ts
|
|
3
|
+
/** File name of the admin config, next to the admin's `index.html`. */
|
|
4
|
+
const ADMIN_CONFIG_FILE = "config.json";
|
|
5
|
+
const PARAM = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
6
|
+
/**
|
|
7
|
+
* The site's editor query parameter: `options.param` (throws `TypeError` when invalid), else a valid `EDITLET_PARAM`
|
|
8
|
+
* env value, else `editlet`. The adapters pass it to the loader and write it to `config.json`.
|
|
9
|
+
*/
|
|
10
|
+
function resolveParam(options, env) {
|
|
11
|
+
if (options?.param !== void 0) {
|
|
12
|
+
if (!PARAM.test(options.param)) throw new TypeError(`admin.param must start with a letter and hold only letters, digits, "_" and "-", got "${options.param}"`);
|
|
13
|
+
return options.param;
|
|
14
|
+
}
|
|
15
|
+
const raw = env.EDITLET_PARAM?.trim();
|
|
16
|
+
return raw && PARAM.test(raw) ? raw : EDITLET_PARAM;
|
|
17
|
+
}
|
|
18
|
+
const REPO = /^([A-Za-z0-9-]+)\/([A-Za-z0-9._-]+)$/;
|
|
19
|
+
function isValidAuthUrl(value) {
|
|
20
|
+
if (value.startsWith("/")) return !value.startsWith("//");
|
|
21
|
+
let url;
|
|
22
|
+
try {
|
|
23
|
+
url = new URL(value);
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (url.protocol === "https:") return true;
|
|
28
|
+
return url.protocol === "http:" && (url.hostname === "localhost" || url.hostname === "127.0.0.1");
|
|
29
|
+
}
|
|
30
|
+
const MAX_SESSION_MINUTES = 1440;
|
|
31
|
+
function isValidSessionMinutes(value) {
|
|
32
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= MAX_SESSION_MINUTES;
|
|
33
|
+
}
|
|
34
|
+
/** `CMS_SESSION_MINUTES` when it is a valid whole number, else `undefined`. */
|
|
35
|
+
function envSessionMinutes(env) {
|
|
36
|
+
const raw = env.CMS_SESSION_MINUTES?.trim();
|
|
37
|
+
if (!raw || !/^\d+$/.test(raw)) return void 0;
|
|
38
|
+
const value = Number(raw);
|
|
39
|
+
return isValidSessionMinutes(value) ? value : void 0;
|
|
40
|
+
}
|
|
41
|
+
function toGitHub(repo, baseBranch) {
|
|
42
|
+
const match = REPO.exec(repo);
|
|
43
|
+
return match ? {
|
|
44
|
+
owner: match[1],
|
|
45
|
+
repo: match[2],
|
|
46
|
+
baseBranch
|
|
47
|
+
} : null;
|
|
48
|
+
}
|
|
49
|
+
function envRepo(env) {
|
|
50
|
+
const { VERCEL_GIT_REPO_OWNER: owner, VERCEL_GIT_REPO_SLUG: slug, GITHUB_REPOSITORY: full } = env;
|
|
51
|
+
return [owner && slug ? `${owner}/${slug}` : void 0, full].find((c) => c !== void 0 && REPO.test(c));
|
|
52
|
+
}
|
|
53
|
+
/** Throws `TypeError` for an invalid option. An invalid env value is ignored. */
|
|
54
|
+
function buildAdminConfig(options, ctx) {
|
|
55
|
+
const config = {};
|
|
56
|
+
if (options?.repo !== void 0 && !REPO.test(options.repo)) throw new TypeError(`admin.repo must look like "owner/name", got "${options.repo}"`);
|
|
57
|
+
const repo = options?.repo ?? envRepo(ctx.env);
|
|
58
|
+
if (repo && ctx.baseBranch) {
|
|
59
|
+
const github = toGitHub(repo, ctx.baseBranch);
|
|
60
|
+
if (github) config.github = github;
|
|
61
|
+
}
|
|
62
|
+
if (options?.authUrl !== void 0) {
|
|
63
|
+
if (!isValidAuthUrl(options.authUrl)) throw new TypeError("admin.authUrl must be an https URL, an http URL on localhost, or a path starting with \"/\"");
|
|
64
|
+
config.authUrl = options.authUrl;
|
|
65
|
+
}
|
|
66
|
+
if (options?.sessionMinutes !== void 0 && !isValidSessionMinutes(options.sessionMinutes)) throw new TypeError(`admin.sessionMinutes must be a whole number of minutes from 1 to ${MAX_SESSION_MINUTES}, got ${options.sessionMinutes}`);
|
|
67
|
+
const sessionMinutes = options?.sessionMinutes ?? envSessionMinutes(ctx.env);
|
|
68
|
+
if (sessionMinutes !== void 0) config.sessionMinutes = sessionMinutes;
|
|
69
|
+
if (options?.preview !== void 0 && typeof options.preview !== "boolean") throw new TypeError("admin.preview must be a boolean");
|
|
70
|
+
if (options?.preview) config.preview = true;
|
|
71
|
+
const param = resolveParam(options, ctx.env);
|
|
72
|
+
if (param !== "editlet") config.param = param;
|
|
73
|
+
return config;
|
|
74
|
+
}
|
|
75
|
+
export { ADMIN_CONFIG_FILE, buildAdminConfig, resolveParam };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer tokens,base;@layer components{.editlet-ff-markdown__mode{margin-bottom:calc(var(--editlet-spacing) * 2)}.editlet-ff-markdown__note{margin-bottom:calc(var(--editlet-spacing) * 2);font-size:var(--editlet-text-sm);color:var(--editlet-muted-foreground)}.editlet-rt{border:1px solid var(--editlet-input);border-radius:var(--editlet-radius-lg);background:var(--editlet-card);&:focus-within{border-color:var(--editlet-ring)}}.editlet-rt-toolbar{z-index:1;gap:calc(var(--editlet-spacing) * .5);padding:calc(var(--editlet-spacing) * 1.5);border-bottom:1px solid var(--editlet-border);border-radius:var(--editlet-radius-lg) var(--editlet-radius-lg) 0 0;background:var(--editlet-card);flex-wrap:wrap;align-items:center;display:flex;position:sticky;top:0}.editlet-rt-toolbar__select{height:calc(var(--editlet-spacing) * 8);margin-right:calc(var(--editlet-spacing) * 1);padding:0 calc(var(--editlet-spacing) * 2);border:1px solid var(--editlet-border);border-radius:var(--editlet-radius-md);background:var(--editlet-background);color:var(--editlet-foreground);font-size:var(--editlet-text-sm)}.editlet-rt-toolbar__button{min-width:calc(var(--editlet-spacing) * 8);height:calc(var(--editlet-spacing) * 8);padding:0 calc(var(--editlet-spacing) * 1.5);border-radius:var(--editlet-radius-md);color:var(--editlet-muted-foreground);cursor:pointer;background:0 0;border:0;place-items:center;display:inline-grid;&:hover{background:var(--editlet-accent);color:var(--editlet-foreground)}&[aria-pressed=true]{background:var(--editlet-secondary);color:var(--editlet-foreground)}&:focus-visible{outline:2px solid var(--editlet-ring);outline-offset:1px}}.editlet-rt-toolbar__text{font-size:var(--editlet-text-xs);font-weight:var(--editlet-font-weight-medium)}.editlet-rt__body{min-height:calc(var(--editlet-spacing) * 60)}.editlet-rt-content{min-height:calc(var(--editlet-spacing) * 60);padding:calc(var(--editlet-spacing) * 4);color:var(--editlet-foreground);font-size:var(--editlet-text-base);line-height:var(--editlet-leading-relaxed);overflow-wrap:anywhere;white-space:pre-wrap;outline:none;&>*+*{margin-top:calc(var(--editlet-spacing) * 3)}& h1{font-size:var(--editlet-text-2xl);font-weight:var(--editlet-font-weight-semibold)}& h2{font-size:var(--editlet-text-xl);font-weight:var(--editlet-font-weight-semibold)}& h3,& h4,& h5,& h6{font-size:var(--editlet-text-lg);font-weight:var(--editlet-font-weight-semibold)}& ul,& ol{padding-left:calc(var(--editlet-spacing) * 6)}& ul{list-style:outside}& ol{list-style:decimal}& li[data-item-type=task]{list-style:none}& blockquote{padding-left:calc(var(--editlet-spacing) * 4);border-left:3px solid var(--editlet-border);color:var(--editlet-muted-foreground)}& code{padding:0 calc(var(--editlet-spacing) * 1);border-radius:var(--editlet-radius-sm);background:var(--editlet-muted);font-family:var(--editlet-font-mono);font-size:var(--editlet-text-sm)}& pre{padding:calc(var(--editlet-spacing) * 3);border-radius:var(--editlet-radius-md);background:var(--editlet-muted);font-family:var(--editlet-font-mono);font-size:var(--editlet-text-sm);overflow-x:auto;& code{background:0 0;padding:0}}& a{color:var(--editlet-primary);text-decoration:underline}& hr{border:0;border-top:1px solid var(--editlet-border)}& table{border-collapse:collapse}& th,& td{padding:calc(var(--editlet-spacing) * 1.5) calc(var(--editlet-spacing) * 2);border:1px solid var(--editlet-border)}& th{font-weight:var(--editlet-font-weight-semibold)}& .ProseMirror-selectednode{outline:2px solid var(--editlet-ring)}}.editlet-rt-image{vertical-align:bottom;max-width:100%;display:inline-block;& img{max-width:100%;max-height:calc(var(--editlet-spacing) * 60);border-radius:var(--editlet-radius-md);display:block}& .editlet-ff-image__empty{width:calc(var(--editlet-spacing) * 24);height:calc(var(--editlet-spacing) * 16)}}.editlet-rt-raw{padding:calc(var(--editlet-spacing) * 2);border:1px dashed var(--editlet-border);border-radius:var(--editlet-radius-md);background:var(--editlet-muted)}.editlet-rt-raw__label{margin-bottom:calc(var(--editlet-spacing) * 1);font-size:var(--editlet-text-xs);color:var(--editlet-muted-foreground)}.editlet-rt-raw__text{resize:vertical;width:100%;color:var(--editlet-foreground);font-family:var(--editlet-font-mono);font-size:var(--editlet-text-sm);line-height:var(--editlet-leading-relaxed);white-space:pre;background:0 0;border:0;display:block;overflow-x:auto;&:focus-visible{outline:2px solid var(--editlet-ring)}}}@layer utilities;
|