editlet 0.0.0-stage → 0.1.0-alpha.1

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.
Files changed (146) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +140 -2
  3. package/dist/admin/config.d.ts +22 -0
  4. package/dist/admin/config.js +75 -0
  5. package/dist/admin/dist/assets/RichEditor-BlaCRrEX.css +1 -0
  6. package/dist/admin/dist/assets/RichEditor-IZKdt6MK.js +42 -0
  7. package/dist/admin/dist/assets/blank-line-CbGzlqBI.js +1 -0
  8. package/dist/admin/dist/assets/channel-CljeMIwA.js +1 -0
  9. package/dist/admin/dist/assets/db-CCMyPgQa.js +1 -0
  10. package/dist/admin/dist/assets/index-CWoJh4H8.js +257 -0
  11. package/dist/admin/dist/assets/index-DkRMnD_M.css +1 -0
  12. package/dist/admin/dist/assets/mdast-util-from-markdown-C79q1_d8.js +3 -0
  13. package/dist/admin/dist/assets/mdast-util-gfm-cM-_xFJE.js +19 -0
  14. package/dist/admin/dist/assets/micromark-extension-gfm-Wz6-oszS.js +1 -0
  15. package/dist/admin/dist/assets/micromark-util-classify-character-BgXaGAja.js +1 -0
  16. package/dist/admin/dist/assets/micromark-util-html-tag-name-B61T18yC.js +1 -0
  17. package/dist/admin/dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  18. package/dist/admin/dist/index.html +16 -0
  19. package/dist/admin/dist/preview.js +1 -0
  20. package/dist/admin/dist/window.js +1 -0
  21. package/dist/astro/content.d.ts +21 -0
  22. package/dist/astro/content.js +235 -0
  23. package/dist/astro/devServer.js +89 -0
  24. package/dist/astro/index.d.ts +15 -0
  25. package/dist/astro/index.js +98 -0
  26. package/dist/astro/nodeBridge.js +36 -0
  27. package/dist/astro/shared.js +10 -0
  28. package/dist/astro/stub/index.html +71 -0
  29. package/dist/auth/client.d.ts +24 -0
  30. package/dist/auth/client.js +120 -0
  31. package/dist/auth/handler.d.ts +16 -0
  32. package/dist/auth/handler.js +281 -0
  33. package/dist/auth/protocol.d.ts +25 -0
  34. package/dist/auth/protocol.js +3 -0
  35. package/dist/core/assets.d.ts +73 -0
  36. package/dist/core/assets.js +405 -0
  37. package/dist/core/devApi.d.ts +28 -0
  38. package/dist/core/devApi.js +3 -0
  39. package/dist/core/entryFile.d.ts +13 -0
  40. package/dist/core/entryFile.js +81 -0
  41. package/dist/core/fields.js +147 -0
  42. package/dist/core/generate.d.ts +3 -0
  43. package/dist/core/generate.js +70 -0
  44. package/dist/core/gitStyle.d.ts +92 -0
  45. package/dist/core/gitStyle.js +206 -0
  46. package/dist/core/index.d.ts +16 -0
  47. package/dist/core/index.js +16 -0
  48. package/dist/core/issues.d.ts +10 -0
  49. package/dist/core/issues.js +10 -0
  50. package/dist/core/paths.d.ts +31 -0
  51. package/dist/core/paths.js +114 -0
  52. package/dist/core/project.js +56 -0
  53. package/dist/core/references.d.ts +68 -0
  54. package/dist/core/references.js +103 -0
  55. package/dist/core/rename.d.ts +60 -0
  56. package/dist/core/rename.js +133 -0
  57. package/dist/core/schema.d.ts +117 -0
  58. package/dist/core/schema.js +299 -0
  59. package/dist/core/sha.d.ts +2 -0
  60. package/dist/core/sha.js +13 -0
  61. package/dist/core/source.d.ts +48 -0
  62. package/dist/core/source.js +57 -0
  63. package/dist/core/validate.d.ts +22 -0
  64. package/dist/core/validate.js +148 -0
  65. package/dist/core/walk.d.ts +23 -0
  66. package/dist/core/walk.js +94 -0
  67. package/dist/core/writes.d.ts +37 -0
  68. package/dist/core/writes.js +166 -0
  69. package/dist/github/base64.js +16 -0
  70. package/dist/github/cache.d.ts +34 -0
  71. package/dist/github/cache.js +126 -0
  72. package/dist/github/client.d.ts +38 -0
  73. package/dist/github/client.js +228 -0
  74. package/dist/github/codeowners.d.ts +23 -0
  75. package/dist/github/codeowners.js +96 -0
  76. package/dist/github/commitReader.d.ts +25 -0
  77. package/dist/github/commitReader.js +38 -0
  78. package/dist/github/deploy.d.ts +15 -0
  79. package/dist/github/deploy.js +33 -0
  80. package/dist/github/index.d.ts +9 -0
  81. package/dist/github/index.js +8 -0
  82. package/dist/github/repo.d.ts +95 -0
  83. package/dist/github/repo.js +375 -0
  84. package/dist/github/source.d.ts +115 -0
  85. package/dist/github/source.js +558 -0
  86. package/dist/loader/index.d.ts +27 -0
  87. package/dist/loader/index.js +151 -0
  88. package/dist/loader/protocol.d.ts +95 -0
  89. package/dist/loader/protocol.js +120 -0
  90. package/dist/loader/window/geometry.js +9 -0
  91. package/dist/next/EditletLoader.d.ts +5 -0
  92. package/dist/next/EditletLoader.js +33 -0
  93. package/dist/next/assetUrl.d.ts +9 -0
  94. package/dist/next/assetUrl.js +13 -0
  95. package/dist/next/buildGuard.js +26 -0
  96. package/dist/next/config.d.ts +18 -0
  97. package/dist/next/config.js +255 -0
  98. package/dist/next/devServer.js +70 -0
  99. package/dist/next/editletField.d.ts +7 -0
  100. package/dist/next/editletField.js +7 -0
  101. package/dist/next/index.d.ts +8 -0
  102. package/dist/next/index.js +6 -0
  103. package/dist/next/preview.d.ts +18 -0
  104. package/dist/next/preview.js +100 -0
  105. package/dist/next/previewCookie.d.ts +5 -0
  106. package/dist/next/previewCookie.js +72 -0
  107. package/dist/next/previewEnv.js +25 -0
  108. package/dist/next/previewRef.d.ts +8 -0
  109. package/dist/next/previewRef.js +17 -0
  110. package/dist/next/publicDir.js +65 -0
  111. package/dist/next/reader.d.ts +49 -0
  112. package/dist/next/reader.js +161 -0
  113. package/dist/next/stub/index.html +56 -0
  114. package/dist/node/devHandler.d.ts +6 -0
  115. package/dist/node/devHandler.js +430 -0
  116. package/dist/node/fs.js +37 -0
  117. package/dist/node/index.d.ts +3 -0
  118. package/dist/node/index.js +3 -0
  119. package/dist/node/project.d.ts +12 -0
  120. package/dist/node/project.js +43 -0
  121. package/package.json +187 -4
  122. package/skills/README.md +84 -0
  123. package/skills/editlet/SKILL.md +119 -0
  124. package/skills/editlet/references/content-format.md +191 -0
  125. package/skills/editlet/references/preview.md +75 -0
  126. package/skills/editlet/references/publishing.md +137 -0
  127. package/skills/editlet/references/schema-changes.md +127 -0
  128. package/skills/editlet/scripts/guard.mjs +1061 -0
  129. package/skills/editlet/scripts/link.mjs +193 -0
  130. package/skills/editlet/scripts/refs.mjs +1480 -0
  131. package/skills/editlet/scripts/schema.mjs +1340 -0
  132. package/skills/editlet/scripts/style.mjs +657 -0
  133. package/skills/editlet/scripts/types.mjs +525 -0
  134. package/skills/editlet/scripts/validate.mjs +724 -0
  135. package/skills/editlet-migrate/SKILL.md +92 -0
  136. package/skills/editlet-migrate/references/mapping.md +73 -0
  137. package/skills/editlet-migrate/references/sources.md +70 -0
  138. package/skills/editlet-setup/SKILL.md +108 -0
  139. package/skills/editlet-setup/references/astro.md +83 -0
  140. package/skills/editlet-setup/references/doctor.md +89 -0
  141. package/skills/editlet-setup/references/next.md +140 -0
  142. package/skills/editlet-setup/references/preview.md +54 -0
  143. package/skills/editlet-setup/references/production.md +153 -0
  144. package/skills/editlet-setup/references/roles.md +238 -0
  145. package/skills/editlet-setup/references/skills.md +99 -0
  146. 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,141 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="docs/assets/logo.svg" alt="Editlet logo" width="88" height="88">
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ <h1 align="center">Editlet</h1>
6
+
7
+ <p align="center"><strong>Your agent writes. You merge.</strong><br>A small Git CMS for Next.js and Astro, with a skill for your coding agent.</p>
8
+
9
+ <p align="center">
10
+ <a href="https://editlet.gunkin.dev/docs/introduction"><strong>Docs</strong></a> ·
11
+ <a href="https://editlet.gunkin.dev/?editlet">Live demo</a> ·
12
+ <a href="#try-it-with-your-coding-agent">Get started</a> ·
13
+ <a href="#ai-coding-agents">AI agents</a>
14
+ </p>
15
+
16
+ <p align="center">
17
+ <a href="https://www.npmjs.com/package/editlet"><img src="https://img.shields.io/npm/v/editlet/alpha?label=npm&color=7c8cff&labelColor=101114" alt="npm version"></a>
18
+ <a href="https://editlet.gunkin.dev/docs/quick-start-next"><img src="https://img.shields.io/badge/Built_for-Next.js_·_Astro-7c8cff?labelColor=101114" alt="Built for Next.js and Astro"></a>
19
+ <a href="https://editlet.gunkin.dev/docs/content-model"><img src="https://img.shields.io/badge/Content_in-Git-7c8cff?labelColor=101114" alt="Content in Git"></a>
20
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-7c8cff?labelColor=101114" alt="MIT license"></a>
21
+ </p>
22
+
23
+ Editlet keeps your content in your repository as Markdown with YAML frontmatter, described by one `cms/schema.json`.
24
+ Your coding agent edits it with the bundled skill, your team edits it with `?editlet` on any page of the site, and
25
+ every change is a pull request that a person merges.
26
+
27
+ > Early alpha: APIs may change between versions. Tested with Claude Code on Next.js and Astro.
28
+
29
+ <p align="center">
30
+ <a href="https://editlet.gunkin.dev"><img src="docs/assets/screenshot.png" alt="The Editlet homepage: Your agent writes. You merge." width="100%"></a>
31
+ </p>
32
+
33
+ ## Try it with your coding agent
34
+
35
+ Paste this into Claude Code, Codex or another coding agent in your Next.js or Astro project:
36
+
37
+ ```text
38
+ Install Editlet in this project: add the package `editlet@alpha` with the project's package manager, then read
39
+ node_modules/editlet/skills/editlet-setup/SKILL.md and follow it.
40
+ ```
41
+
42
+ 1. **Describe your content.** The agent writes `cms/schema.json` from your pages and wires the framework adapter.
43
+ 2. **Edit.** Ask the agent (`/editlet write a post about…`), or open `?editlet` on any page and edit next to the live
44
+ preview.
45
+ 3. **Merge.** Every edit is a commit on an `editlet/<name>` branch with a pull request. Nothing goes live until a
46
+ person merges it; the guard hook stops an agent from pushing to the base branch.
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ npm install editlet@alpha
52
+ node node_modules/editlet/skills/editlet/scripts/link.mjs --hooks
53
+ ```
54
+
55
+ `link.mjs --hooks` links the skills into `.claude/skills/` and `.agents/skills/` and adds the guard hook. Run it again
56
+ any time; with `--check --hooks` it only reports. Then add `cms/schema.json` and wire the framework as shown below.
57
+
58
+ `next`, `react` and `astro` are optional peer dependencies. Install the ones your framework needs: `next >=16` with
59
+ `react >=19`, or `astro ^6 || ^7`. Node 22.12 or newer.
60
+
61
+ ## Next.js
62
+
63
+ ```ts
64
+ // next.config.ts
65
+ import { withEditlet } from 'editlet/next/config';
66
+ export default withEditlet({ reactStrictMode: true });
67
+ ```
68
+
69
+ ```ts
70
+ // src/lib/cms.ts
71
+ import { createReader } from 'editlet/next';
72
+ import type { EntryMap } from '../../.editlet/content';
73
+ export const { getEntries, getEntry, getRef } = createReader<EntryMap>();
74
+ ```
75
+
76
+ ```tsx
77
+ // app/layout.tsx: render <EditletLoader /> after {children}
78
+ import { EditletLoader } from 'editlet/next';
79
+ ```
80
+
81
+ Add `/.editlet/` and `/public/editlet/` to `.gitignore`. Full guide:
82
+ [Quick start: Next.js](https://editlet.gunkin.dev/docs/quick-start-next).
83
+
84
+ ## Astro
85
+
86
+ ```js
87
+ // astro.config.mjs
88
+ import editlet from 'editlet/astro';
89
+ import { defineConfig } from 'astro/config';
90
+ export default defineConfig({ integrations: [editlet()] });
91
+ ```
92
+
93
+ ```ts
94
+ // src/content.config.ts
95
+ import { editletCollections } from 'editlet/astro/content';
96
+ export const collections = editletCollections();
97
+ ```
98
+
99
+ Then use `getCollection`, `getEntry` and `render` as usual. Full guide:
100
+ [Quick start: Astro](https://editlet.gunkin.dev/docs/quick-start-astro).
101
+
102
+ ## AI coding agents
103
+
104
+ The package ships three Agent Skills in `skills/`, matching the installed version. Knowledge is delivered as files, so
105
+ there is no MCP server to run.
106
+
107
+ | Skill | Use |
108
+ |---|---|
109
+ | `editlet` | Edit content and the schema, preview in `?editlet`, publish through an `editlet/<name>` branch and a PR |
110
+ | `editlet-setup` | Install Editlet in Next.js or Astro, set up editing on the live site, upgrade, diagnose (`doctor.mjs`) |
111
+ | `editlet-migrate` | Import Markdown/MDX folders, Astro collections, Decap, TinaCMS, Keystatic and similar |
112
+
113
+ Check content with `node node_modules/editlet/skills/editlet/scripts/validate.mjs`. Full guide:
114
+ [The agent skills](https://editlet.gunkin.dev/docs/agent-skills).
115
+
116
+ ## Entry points
117
+
118
+ | Import | What it is |
119
+ |---|---|
120
+ | `editlet/next` | `createReader`, `EditletLoader` for Next.js Server Components |
121
+ | `editlet/next/config` | `withEditlet` wrapper for `next.config.ts` |
122
+ | `editlet/next/preview` | Draft-mode preview route (`POST`/`DELETE`) for `app/api/editlet/preview/route.ts` |
123
+ | `editlet/astro` | Astro integration |
124
+ | `editlet/astro/content` | `editletCollections`, `editletLoader` for `src/content.config.ts` |
125
+ | `editlet/core` | Schema, entry parsing, validation, type generation (no Node or framework APIs) |
126
+ | `editlet/node` | Local project reading and the dev file API |
127
+ | `editlet/github` | GitHub content source: tree reads, commits, branches, PRs |
128
+ | `editlet/auth` | GitHub OAuth handler (Cloudflare, Vercel, Node) |
129
+ | `editlet/auth/client` | Browser side of the sign-in flow |
130
+ | `editlet/auth/protocol` | Shared auth constants and types |
131
+ | `editlet/loader` | The `?editlet` loader that mounts the editor iframe on a page |
132
+ | `editlet/loader/protocol` | The `postMessage` protocol between page and admin |
133
+ | `editlet/admin/dist/*` | The prebuilt admin app (static files) |
134
+
135
+ Browsers: Chrome 125+, Edge 125+, Firefox 126+, Safari 17.5+.
136
+
137
+ Documentation: https://editlet.gunkin.dev/docs/introduction
138
+
139
+ ## License
140
+
141
+ [MIT](LICENSE) © Anton Gunkin
@@ -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;