@atom.io/template-spa-astro-ssr 0.0.0-stage → 0.0.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.
package/README.mdx ADDED
@@ -0,0 +1,89 @@
1
+ import Workspace from "./exhibits/workspace.sh" with { type: "code" };
2
+ import Run from "./exhibits/run.sh" with { type: "code" };
3
+ import Config from "./astro.config.ts" with { type: "code" };
4
+ import Islands from "./src/pages/index.astro" with { type: "code" };
5
+ import Model from "./src/model.ts" with { type: "code" };
6
+ import Prepare from "./src/prepare-drafts.ts" with { type: "code" };
7
+ import Query from "./src/server/read-draft.sql" with { type: "code" };
8
+ import ReadDraft from "./src/server/drafts.ts" with { type: "code" };
9
+ import Router from "./src/server/router.ts" with { type: "code" };
10
+
11
+ # SPA + Astro SSR
12
+
13
+ A starter with module-scoped atom definitions, server-rendered Astro islands, and typed database refreshes. It uses atom.io, @atom.io/spa, resumability/astro, Reylo over node:sqlite, and tRPC. Requires Node 24.12 or newer and TypeScript 7.1's content mappers (currently beta).
14
+
15
+ ## Run
16
+
17
+ <Run />
18
+
19
+ Inside the atom.io workspace:
20
+
21
+ <Workspace />
22
+
23
+ The workspace uses local unpublished packages; a packed release replaces workspace dependency ranges with published versions. Development, build, and typecheck commands initialize drafts.sqlite from schema.sql and insert missing example rows without overwriting edits. Reylo checks queries against that schema using .reylo.yaml. The generated database is ignored by Git and excluded from the package.
24
+
25
+ This is an on-demand Node server application. The Astro Node adapter serves both pages and the tRPC endpoint. Start production from the template directory so it can find drafts.sqlite; supply persistent storage for that file when deploying. Initialize the database before starting a new deployment.
26
+
27
+ ## Rendering and caching
28
+
29
+ The starter uses on-demand SSR with Astro’s built-in memoryCache provider. The public drafts page has a 60-second TTL and no stale-while-revalidate window. A cache miss reads SQLite in a request-owned store and caches the complete HTML response, including its resumption sidecar. Hits reuse that snapshot; the first request after expiry renders a new one. There are no prerendered pages. The tRPC endpoint is outside the cached route rule and returns Cache-Control: no-store, so resets always read the database.
30
+
31
+ The cache belongs to one server process: it is lost on restart and is not shared across replicas. This is a small, self-contained deployment default; choose an infrastructure-backed provider when multiple instances need shared caching or invalidation. Astro disables caching in development. Build and preview the template to exercise the production cache.
32
+
33
+ This template’s example data is public. When adapting it, cache the complete HTML response together with its resumption sidecar. The markup and initial values must come from the same render. Choose a freshness window and invalidation policy that match the data; do not cache a live atom.io store or reuse it across requests. Cache only responses whose data can be shared by everyone using the cache entry. Personalized snapshots need private caching or a correctly scoped cache key.
34
+
35
+ The initial browser load consumes that snapshot without immediately refetching it. Expiring or invalidating the server cache affects future page loads, not an already running browser store. Keep the explicit reset/tRPC path fresh so Refresh from database can fetch the current row. ClientRouter navigation continues to preserve live browser state rather than replacing edits with another server snapshot.
36
+
37
+ SSG is also compatible with resumption: the sidecar is produced during the build and remains that snapshot until the next deployment. Use it for routes whose freshness can follow deployments, while retaining on-demand API routes for resets. Astro's [on-demand rendering](https://docs.astro.build/en/guides/on-demand-rendering/) and [route caching](https://docs.astro.build/en/guides/caching/) documentation describe the route-level controls and cache providers.
38
+
39
+ ## Try it
40
+
41
+ Both views use the same two module-scoped document tokens in one browser store and resumption scope. The initial notes come directly from SQLite during SSR. The first island hydrates its existing DOM without making an RPC request. Type into a draft before scrolling to the second view: that delayed island mounts fresh and immediately shows the edit. Typing or refreshing a document updates both views; other documents retain their values. Refresh from database resets the atom, whose client closure calls tRPC for the latest row. The returned revision identifies that read.
42
+
43
+ Visit How it works and return. Astro's ClientRouter removes the old DOM and SPA releases the island subscriptions, while the application store and resumption scope stay alive. Returning islands render fresh from those live values, so an incoming server response cannot overwrite your edits. Refresh explicitly to fetch new server data. A full page load starts a new application from SSR again. Shared client requests receive the application scope's AbortSignal; navigation keeps that scope alive, while a full page exit aborts it. Resetting does not cancel earlier requests by itself.
44
+
45
+ ## Integrations
46
+
47
+ <Config />
48
+
49
+ SPA compiles the .spa.tsx components. Resumability removes inline server closures before browser import analysis, including their dynamic imports. Reylo compiles SQL imports on the server. The browser imports the tRPC router only as a type: no database module, query, or router implementation reaches executable browser code.
50
+
51
+ ## One query, two entry points
52
+
53
+ <Query />
54
+
55
+ <ReadDraft />
56
+
57
+ SSR calls readDraft directly. The tRPC procedure validates its input and calls the same function:
58
+
59
+ <Router />
60
+
61
+ Reylo infers the row type from SQL and the database schema. The return type flows through the router into the client and atom, without a handwritten response DTO. The type check uses TypeScript's runExternalCode flag to run Reylo's content mapper.
62
+
63
+ ## Module-scoped atom defaults
64
+
65
+ <Model />
66
+
67
+ The family key supplies the query input and resumability key. Atom definitions live on the module graph. All browser views share values; each SSR request has its own store. First browser reads consume the seed. Subsequent defaults use tRPC, with errors available through useLoadable for retry.
68
+
69
+ ## Normal Astro islands
70
+
71
+ <Islands />
72
+
73
+ The first workspace uses client:load; the second uses client:visible. Both render their initial data on the server. Deferred child functions keep Astro's eager framework-slot evaluation inside Resumption's async collection scope. One Resumption wrapper covers both views and collects each document once. Its sidecar precedes all the islands, so either can activate first. Keep the wrapper around page content inside the HTML body, not around the document itself.
74
+
75
+ Drafts.prepareStore initializes the store already selected by SPA:
76
+
77
+ <Prepare />
78
+
79
+ On the server, Resumption's async collection supplies the scope. In the browser, application.get creates one resumption scope and registers its cleanup once. Each preparation adds the surrounding sidecar; consumed keys cannot be reseeded. Store.runDefault activates that scope whenever a default executes, including lazy family members and transactional resets. Application.canResume controls whether unread seeds may initialize client-capable defaults: after an edit or navigation, those defaults use the client path. The callback awaits the initial reads before rendering or hydration. There are no model factories, model props, or store-to-model registries.
80
+
81
+ SPA owns the request lifetime through the end of streaming and the browser application lifetime across navigation. Individual islands own only their DOM and subscriptions. Shared preparation resources survive an individual island failing or unmounting. Resumability stays independent of SPA, atom.io, Reylo, and tRPC. Treat all sidecar data as public browser-visible data.
82
+
83
+ ## Validation
84
+
85
+ The browser check runs against both the production Node server and the Astro dev server. It inspects real SSR content, verifies that initial hydration preserves textarea nodes and IDs while a delayed island replaces stale DOM, and asserts zero RPC requests during hydration. In production, it verifies byte-identical cached HTML and sidecars after SQLite changes, waits for the real 60-second TTL to expire, and checks that a new snapshot is rendered and cached. Development checks verify fresh SSR instead. Repeated resets fetch changed rows through tRPC with no-store headers, including after resuming an older cached snapshot; resets do not rewrite the page cache. It also checks shared document state, client:load and client:visible scheduling, fresh mounts and preserved edits after navigation, and removal of server modules from browser scripts. Browser exceptions fail the check. Type tests reject invalid RPC input and verify the inferred response fields.
86
+
87
+ ## License
88
+
89
+ MPL-2.0 or later. See [LICENSE](./LICENSE).
package/_gitignore ADDED
@@ -0,0 +1,6 @@
1
+ node_modules/
2
+ dist/
3
+ .astro/
4
+ .env
5
+ test-results/
6
+ drafts.sqlite*
@@ -0,0 +1,17 @@
1
+ import node from "@astrojs/node"
2
+ import spa from "@atom.io/spa/astro"
3
+ import { defineConfig, memoryCache } from "astro/config"
4
+ import resumability from "resumability/astro"
5
+ import reylo from "reylo/vite"
6
+
7
+ export default defineConfig({
8
+ output: `server`,
9
+ adapter: node({ mode: `standalone` }),
10
+ cache: { provider: memoryCache() },
11
+ routeRules: {
12
+ // Cache the public HTML and its resumption sidecar as one snapshot.
13
+ [`/`]: { maxAge: 60 },
14
+ },
15
+ integrations: [resumability(), spa()],
16
+ vite: { plugins: [reylo()] },
17
+ })
@@ -0,0 +1,10 @@
1
+ npm install
2
+ npm run dev
3
+
4
+ # Build and serve the production output.
5
+ npm run build
6
+ npm run preview
7
+
8
+ # Install the test browser, then verify production and development.
9
+ npx playwright install chromium
10
+ npm test
@@ -0,0 +1,2 @@
1
+ pnpm exec turbo run build --filter=@atom.io/template-spa-astro-ssr...
2
+ pnpm --filter @atom.io/template-spa-astro-ssr dev
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
2
  "name": "@atom.io/template-spa-astro-ssr",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.1",
4
+ "description": "Astro, SPA, and resumable atom defaults with SQLite server data.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/jeremybanka/atom.io.git",
8
+ "directory": "templates/spa-astro-ssr"
9
+ },
10
+ "license": "MPL-2.0",
11
+ "type": "module",
12
+ "files": [
13
+ "src",
14
+ "tests",
15
+ "exhibits",
16
+ "astro.config.ts",
17
+ "tsconfig.json",
18
+ "README.mdx",
19
+ "_gitignore",
20
+ "scripts",
21
+ "schema.sql",
22
+ ".reylo.yaml"
23
+ ],
24
+ "dependencies": {
25
+ "@astrojs/node": "11.1.9",
26
+ "@atom.io/spa": "0.0.1",
27
+ "@trpc/client": "11.22.1",
28
+ "@trpc/server": "11.22.1",
29
+ "astro": "7.4.4",
30
+ "atom.io": "0.54.3",
31
+ "resumability": "0.0.1",
32
+ "reylo": "0.6.0",
33
+ "zod": "4.6.7"
34
+ },
35
+ "devDependencies": {
36
+ "@reylosql/sqlite": "0.6.0",
37
+ "@types/node": "26.6.6",
38
+ "galley.md": "0.3.1",
39
+ "oxlint": "1.90.0",
40
+ "oxlint-tsgolint": "7.0.2005",
41
+ "playwright": "1.64.1",
42
+ "typescript": "7.1.0-beta",
43
+ "vite": "8.3.5"
44
+ },
45
+ "engines": {
46
+ "node": ">=24.12.0"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
50
+ },
51
+ "scripts": {
52
+ "dev": "npm run db:seed && astro dev",
53
+ "build": "npm run db:seed && tsc --noEmit --runExternalCode && astro build",
54
+ "preview": "astro preview",
55
+ "lint:types": "npm run db:seed && tsc --noEmit --runExternalCode",
56
+ "lint:oxlint": "oxlint src tests astro.config.ts",
57
+ "test": "npm run test:browser",
58
+ "test:browser": "npm run build && node tests/browser.mjs && node tests/browser.mjs --dev",
59
+ "readme:write": "galley write README.mdx",
60
+ "readme:check": "galley check README.mdx",
61
+ "db:seed": "node scripts/seed.ts"
62
+ }
6
63
  }
package/schema.sql ADDED
@@ -0,0 +1,5 @@
1
+ CREATE TABLE IF NOT EXISTS drafts (
2
+ id INTEGER PRIMARY KEY,
3
+ title TEXT NOT NULL,
4
+ body TEXT NOT NULL
5
+ ) STRICT;
@@ -0,0 +1,14 @@
1
+ import { readFileSync } from "node:fs"
2
+ import { DatabaseSync } from "node:sqlite"
3
+
4
+ const database = new DatabaseSync(`drafts.sqlite`)
5
+ try {
6
+ database.exec(readFileSync(new URL(`../schema.sql`, import.meta.url), `utf8`))
7
+ const insert = database.prepare(
8
+ `INSERT OR IGNORE INTO drafts (id, title, body) VALUES (?, ?, ?)`,
9
+ )
10
+ for (const id of [1, 2])
11
+ insert.run(id, `Draft ${id}`, `A note from SQLite for document ${id}.`)
12
+ } finally {
13
+ database.close()
14
+ }
@@ -0,0 +1,62 @@
1
+ import type { VNode } from "@atom.io/spa"
2
+ import { useId, useLoadable, useSetter, useStore } from "@atom.io/spa"
3
+ import { resetInStore } from "atom.io/internal"
4
+
5
+ import type { Draft } from "./api.ts"
6
+ import { documentIds, draftAtoms } from "./model.ts"
7
+ import { prepareDrafts } from "./prepare-drafts.ts"
8
+
9
+ function DraftCard(props: { id: number }): VNode {
10
+ const store = useStore()
11
+ const label = useId()
12
+ const fallback: Draft = {
13
+ id: props.id,
14
+ title: `Draft ${props.id}`,
15
+ body: ``,
16
+ revision: `00000000-0000-0000-0000-000000000000`,
17
+ }
18
+ const draft = useLoadable(draftAtoms, props.id, fallback)
19
+ const setDraft = useSetter(draftAtoms, props.id)
20
+ return (
21
+ <article class="draft" data-document={props.id} aria-busy={draft().loading}>
22
+ <header>
23
+ <h3>{draft().value.title}</h3>
24
+ <span class="source">{draft().loading ? `Refreshing…` : `Ready`}</span>
25
+ </header>
26
+ <label for={label}>Your note</label>
27
+ <textarea
28
+ id={label}
29
+ value={draft().value.body}
30
+ onInput={(event) => {
31
+ setDraft({ ...draft().value, body: event.currentTarget.value })
32
+ }}
33
+ />
34
+ <p class="preview" data-preview>
35
+ {draft().value.body}
36
+ </p>
37
+ <p role="status">{draft().error?.message ?? ``}</p>
38
+ <footer>
39
+ <button
40
+ onClick={() => {
41
+ resetInStore(store, draftAtoms, props.id)
42
+ }}
43
+ >
44
+ Refresh from database
45
+ </button>
46
+ <output data-revision>{draft().value.revision}</output>
47
+ </footer>
48
+ </article>
49
+ )
50
+ }
51
+
52
+ export default function Drafts(props: { id: string }): VNode {
53
+ return (
54
+ <div class="draft-grid" data-island={props.id}>
55
+ {documentIds.map((id) => (
56
+ <DraftCard key={id} id={id} />
57
+ ))}
58
+ </div>
59
+ )
60
+ }
61
+
62
+ Drafts.prepareStore = prepareDrafts
package/src/api.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { createTRPCClient, httpLink } from "@trpc/client"
2
+ import type { inferRouterOutputs } from "@trpc/server"
3
+
4
+ import type { AppRouter } from "./server/router.ts"
5
+
6
+ export type Draft = inferRouterOutputs<AppRouter>[`drafts`][`get`]
7
+ export const api = createTRPCClient<AppRouter>({
8
+ links: [httpLink({ url: `/api/trpc` })],
9
+ })
@@ -0,0 +1,24 @@
1
+ ---
2
+ import { ClientRouter } from "astro:transitions"
3
+ import "../style.css"
4
+ interface Props {
5
+ title: string
6
+ }
7
+ ---
8
+ <!DOCTYPE html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="UTF-8" />
12
+ <meta name="viewport" content="width=device-width" />
13
+ <title>{Astro.props.title} · Resumable drafts</title>
14
+ <ClientRouter />
15
+ </head>
16
+ <body>
17
+ <nav>
18
+ <a href="/" class="brand">Resumable drafts</a><a href="/about"
19
+ >How it works</a>
20
+ </nav>
21
+ <main><slot /></main>
22
+ <footer class="page-footer">Astro + atom.io + SPA + resumability</footer>
23
+ </body>
24
+ </html>
package/src/model.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { atomFamily, type Loadable } from "atom.io"
2
+ import { resumable } from "resumability"
3
+
4
+ import { api, type Draft } from "./api.ts"
5
+
6
+ export const documentIds = [1, 2] as const
7
+
8
+ export const draftAtoms = atomFamily<Loadable<Draft>, number, Error>({
9
+ key: `draft`,
10
+ default: (id) =>
11
+ resumable({
12
+ key: [`draft`, id],
13
+ server: async ({ signal }) => {
14
+ const { readDraft } = await import(`./server/drafts.ts`)
15
+ signal.throwIfAborted()
16
+ return readDraft(id)
17
+ },
18
+ client: ({ signal }) => api.drafts.get.query({ id }, { signal }),
19
+ }),
20
+ catch: [Error],
21
+ })
@@ -0,0 +1,25 @@
1
+ ---
2
+ import Page from "../layouts/Page.astro"
3
+ ---
4
+ <Page title="How it works">
5
+ <section class="intro">
6
+ <p class="eyebrow">One value, two beginnings</p>
7
+ <h1>One database. Two ways to read it.</h1>
8
+ <p>
9
+ Astro waits for the atom defaults, renders the draft cards with SPA, and
10
+ places the results in a JSON sidecar. The browser consumes those values
11
+ before hydrating the existing cards.
12
+ </p>
13
+ <p>
14
+ A reset calls the default again. Its server value has already been
15
+ consumed, so the client closure calls tRPC for a fresh database read.
16
+ Editing or resetting a document updates both views of that document.
17
+ </p>
18
+ <p>
19
+ Navigation releases the islands while keeping your shared state alive.
20
+ Returning renders fresh views of your edits. Refresh explicitly to fetch
21
+ new data. SSR and tRPC call the same function, backed by a typed SQL query.
22
+ </p>
23
+ <a class="back" href="/">Back to drafts →</a>
24
+ </section>
25
+ </Page>
@@ -0,0 +1,13 @@
1
+ import { fetchRequestHandler } from "@trpc/server/adapters/fetch"
2
+ import type { APIRoute } from "astro"
3
+
4
+ import { appRouter } from "../../../server/router.ts"
5
+
6
+ export const ALL: APIRoute = ({ request }) =>
7
+ fetchRequestHandler({
8
+ endpoint: `/api/trpc`,
9
+ req: request,
10
+ router: appRouter,
11
+ createContext: () => ({}),
12
+ responseMeta: () => ({ headers: { "Cache-Control": `no-store` } }),
13
+ })
@@ -0,0 +1,28 @@
1
+ ---
2
+ import Resumption from "resumability/Resumption.astro"
3
+ import Drafts from "../Drafts.spa.tsx"
4
+ import Page from "../layouts/Page.astro"
5
+ ---
6
+ <Page title="Your drafts">
7
+ <Resumption>{() => (
8
+ <>
9
+ <header class="intro">
10
+ <p class="eyebrow">A server head start</p>
11
+ <h1>Pick up where the server left off.</h1>
12
+ <p>
13
+ These notes arrive from SQLite. Edit one, or refresh it from the
14
+ database. Both views share the same atom.io state.
15
+ </p>
16
+ </header>
17
+ <section class="workspace" aria-labelledby="work-heading">
18
+ <h2 id="work-heading">Your editor <small>Loads immediately</small></h2>
19
+ <Drafts id="work" client:load />
20
+ </section>
21
+ <section class="workspace" aria-labelledby="personal-heading">
22
+ <h2 id="personal-heading">
23
+ Another view <small>Same shared documents · loads when visible</small>
24
+ </h2><Drafts id="personal" client:visible />
25
+ </section>
26
+ </>
27
+ )}</Resumption>
28
+ </Page>
@@ -0,0 +1,22 @@
1
+ import type { AstroStorePreparation } from "@atom.io/spa/astro"
2
+ import { getFromStore } from "atom.io/internal"
3
+ import { createResumption } from "resumability/client"
4
+ import { documentIds, draftAtoms } from "./model.ts"
5
+
6
+ export const prepareDrafts: AstroStorePreparation = async (
7
+ store,
8
+ _props,
9
+ { element, application },
10
+ ) => {
11
+ if (element) {
12
+ const scope = application.get(createResumption, () => {
13
+ const created = createResumption()
14
+ application.onCleanup(created.dispose)
15
+ store.runDefault = (run) =>
16
+ created.run(run, { resume: application.canResume })
17
+ return created
18
+ })
19
+ scope.add(element.closest(`astro-resumption`)!)
20
+ }
21
+ await Promise.all(documentIds.map((id) => getFromStore(store, draftAtoms, id)))
22
+ }
@@ -0,0 +1,17 @@
1
+ import { randomUUID } from "node:crypto"
2
+ import { DatabaseSync } from "node:sqlite"
3
+
4
+ import readDraftQuery from "./read-draft.sql"
5
+
6
+ /** Both SSR and tRPC use this function and its inferred query result. */
7
+ // oxlint-disable-next-line typescript/explicit-module-boundary-types -- Infer the response from Reylo's content-mapped SQL type; tsc verifies the full RPC contract.
8
+ export function readDraft(id: number) {
9
+ const database = new DatabaseSync(`drafts.sqlite`, { readOnly: true })
10
+ try {
11
+ const draft = readDraftQuery.runSync(database, { id })
12
+ if (!draft) throw new Error(`Draft ${id} does not exist`)
13
+ return { ...draft, revision: randomUUID() }
14
+ } finally {
15
+ database.close()
16
+ }
17
+ }
@@ -0,0 +1 @@
1
+ SELECT id, title, body FROM drafts WHERE id = :id;
@@ -0,0 +1,14 @@
1
+ import { initTRPC } from "@trpc/server"
2
+ import { z } from "zod"
3
+
4
+ import { readDraft } from "./drafts.ts"
5
+
6
+ const t = initTRPC.create()
7
+ export const appRouter = t.router({
8
+ drafts: t.router({
9
+ get: t.procedure
10
+ .input(z.object({ id: z.number().int().positive() }))
11
+ .query(({ input }) => readDraft(input.id)),
12
+ }),
13
+ })
14
+ export type AppRouter = typeof appRouter
package/src/style.css ADDED
@@ -0,0 +1,170 @@
1
+ :root {
2
+ font-family: system-ui, sans-serif;
3
+ color: #20392f;
4
+ background: #f5f4ee;
5
+ font-synthesis: none;
6
+ line-height: 1.55;
7
+ }
8
+ * {
9
+ box-sizing: border-box;
10
+ }
11
+ body {
12
+ margin: 0;
13
+ }
14
+ nav, main, .page-footer {
15
+ width: min(1100px, calc(100% - 48px));
16
+ margin-inline: auto;
17
+ }
18
+ nav {
19
+ display: flex;
20
+ justify-content: space-between;
21
+ align-items: center;
22
+ padding-block: 25px;
23
+ border-bottom: 1px solid #d5ddd4;
24
+ }
25
+ a {
26
+ color: #256745;
27
+ text-underline-offset: 4px;
28
+ }
29
+ .brand {
30
+ font-weight: 750;
31
+ text-decoration: none;
32
+ }
33
+ .intro {
34
+ max-width: 760px;
35
+ padding: 44px 0 24px;
36
+ }
37
+ .eyebrow {
38
+ color: #52765d;
39
+ text-transform: uppercase;
40
+ letter-spacing: 0.13em;
41
+ font-size: 0.78rem;
42
+ font-weight: 750;
43
+ }
44
+ h1 {
45
+ font-size: clamp(2rem, 5vw, 3.4rem);
46
+ line-height: 1.1;
47
+ letter-spacing: -0.04em;
48
+ margin: 16px 0;
49
+ }
50
+ .intro > p:not(.eyebrow) {
51
+ color: #56645d;
52
+ font-size: 1.1rem;
53
+ }
54
+ .workspace {
55
+ margin-block: 24px 36px;
56
+ }
57
+ h2 {
58
+ font-size: 1.2rem;
59
+ }
60
+ h2 small {
61
+ font-size: 0.78rem;
62
+ font-weight: 450;
63
+ color: #65776b;
64
+ margin-left: 12px;
65
+ }
66
+ astro-resumption {
67
+ display: contents;
68
+ }
69
+ .draft-grid {
70
+ display: grid;
71
+ grid-template-columns: repeat(2, minmax(0, 1fr));
72
+ gap: 20px;
73
+ }
74
+ .draft {
75
+ background: #fffef9;
76
+ border: 1px solid #d7ded3;
77
+ border-radius: 16px;
78
+ padding: 24px;
79
+ box-shadow: 0 3px 12px #20392f06;
80
+ }
81
+ .draft header {
82
+ display: flex;
83
+ align-items: center;
84
+ justify-content: space-between;
85
+ margin-bottom: 20px;
86
+ }
87
+ h3 {
88
+ margin: 0;
89
+ font-size: 1.1rem;
90
+ }
91
+ .source {
92
+ font-size: 0.74rem;
93
+ padding: 3px 10px;
94
+ border-radius: 12px;
95
+ background: #e6eee1;
96
+ color: #3d643c;
97
+ }
98
+ label {
99
+ display: block;
100
+ font-size: 0.78rem;
101
+ font-weight: 650;
102
+ margin-bottom: 7px;
103
+ }
104
+ textarea {
105
+ width: 100%;
106
+ min-height: 100px;
107
+ padding: 12px;
108
+ font: inherit;
109
+ resize: vertical;
110
+ color: inherit;
111
+ border: 1px solid #bdcbbb;
112
+ border-radius: 7px;
113
+ background: #fff;
114
+ }
115
+ textarea:focus {
116
+ outline: 2px solid #6d9870;
117
+ outline-offset: 2px;
118
+ }
119
+ .preview {
120
+ min-height: 24px;
121
+ overflow-wrap: anywhere;
122
+ color: #657569;
123
+ font-size: 0.85rem;
124
+ }
125
+ .draft footer {
126
+ display: flex;
127
+ flex-wrap: wrap;
128
+ align-items: center;
129
+ gap: 12px;
130
+ }
131
+ button {
132
+ border: 0;
133
+ border-radius: 7px;
134
+ padding: 9px 12px;
135
+ background: #22573c;
136
+ color: #fff;
137
+ cursor: pointer;
138
+ font: inherit;
139
+ font-size: 0.82rem;
140
+ }
141
+ button:hover {
142
+ background: #123c27;
143
+ }
144
+ output {
145
+ color: #788878;
146
+ font-size: 0.65rem;
147
+ overflow-wrap: anywhere;
148
+ }
149
+ .page-footer {
150
+ color: #6b7e6f;
151
+ font-size: 0.78rem;
152
+ padding-block: 24px;
153
+ border-top: 1px solid #d5ddd4;
154
+ }
155
+ .back {
156
+ display: inline-block;
157
+ margin-block: 18px 60px;
158
+ }
159
+ @media (max-width: 650px) {
160
+ .draft-grid {
161
+ grid-template-columns: 1fr;
162
+ }
163
+ h2 small {
164
+ display: block;
165
+ margin: 2px 0 0;
166
+ }
167
+ .draft {
168
+ padding: 20px;
169
+ }
170
+ }