Autosave box HTML, fix editor selection, make /shrines a canvas page
Test and deploy / test (push) Successful in 1m56s
Test and deploy / deploy (push) Successful in 48s

The HTML editor's selection was invisible: CodeMirror's focused-selection
rule outranked ours and painted #233, and the opaque active line covered
the selection layer. Match its selector and make the active line
translucent.

Unsaved HTML now saves on leaving a box (selecting another, clicking
empty canvas, Done, closing the panel) instead of asking to discard.

/shrines is no longer a hard-coded route but an ordinary canvas page,
with links placed by hand as Link boxes; the backend no longer reserves
the slug. The Shrine starter layout is gone, and the admin Pages tab
gains a "New shrine" form that makes a blank page under shrines/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-15 12:27:06 +01:00
co-authored by Claude Opus 5.5
parent e54aaac181
commit ca3cd4db30
11 changed files with 83 additions and 110 deletions
+3 -7
View File
@@ -25,7 +25,8 @@ const maxSlugLen = 100
// nginx or one of the SPA's own routes answers them first (see // nginx or one of the SPA's own routes answers them first (see
// nginx/nginx_routes.conf.template and vue/src/router/index.js), plus the // nginx/nginx_routes.conf.template and vue/src/router/index.js), plus the
// built-in canvases' page keys, whose boxes a page of the same slug would // built-in canvases' page keys, whose boxes a page of the same slug would
// share. "shrines" is deliberately absent: shrine pages live under it. // share. "shrines" is deliberately absent: /shrines and the shrine pages under
// it are all canvas pages.
var reservedFirstSegments = map[string]bool{ var reservedFirstSegments = map[string]bool{
"stp": true, "stp2": true, "index": true, "admin": true, "cv": true, "stp": true, "stp2": true, "index": true, "admin": true, "cv": true,
"automata": true, "hotels": true, "api": true, "py": true, "radio": true, "automata": true, "hotels": true, "api": true, "py": true, "radio": true,
@@ -34,11 +35,6 @@ var reservedFirstSegments = map[string]bool{
"sound": true, "assets": true, "internal": true, "sound": true, "assets": true, "internal": true,
} }
// reservedSlugs are individual paths the SPA routes itself.
var reservedSlugs = map[string]bool{
"shrines": true,
}
func validPageKey(key string) bool { func validPageKey(key string) bool {
return len(key) <= maxSlugLen && pageKeyPattern.MatchString(key) return len(key) <= maxSlugLen && pageKeyPattern.MatchString(key)
} }
@@ -49,7 +45,7 @@ func validateSlug(slug string) error {
return errors.New("a page address is lower-case letters, digits and hyphens, in /-separated parts, e.g. shrines/evangelion") return errors.New("a page address is lower-case letters, digits and hyphens, in /-separated parts, e.g. shrines/evangelion")
} }
first, _, _ := strings.Cut(slug, "/") first, _, _ := strings.Cut(slug, "/")
if reservedFirstSegments[first] || reservedSlugs[slug] { if reservedFirstSegments[first] {
return errors.New("that address is already used by the site") return errors.New("that address is already used by the site")
} }
return nil return nil
+1 -1
View File
@@ -17,7 +17,7 @@ func TestValidateSlug(t *testing.T) {
{"shrines//gto", false}, // empty segment {"shrines//gto", false}, // empty segment
{"shrines/gto-", false}, // trailing hyphen {"shrines/gto-", false}, // trailing hyphen
{"shrines/../admin", false}, // dots {"shrines/../admin", false}, // dots
{"shrines", false}, // the SPA's own index {"shrines", true}, // the index is a canvas page too
{"shrines/demoman", true}, // no longer an SPA route {"shrines/demoman", true}, // no longer an SPA route
{"admin/pages", false}, // under an SPA route {"admin/pages", false}, // under an SPA route
{"jobs/x", false}, // under an nginx route {"jobs/x", false}, // under an nginx route
+9 -6
View File
@@ -68,7 +68,8 @@ Two layout shells, defined in `src/router/index.js`:
| `/` | DefaultLayout | Landing page (statically imported — it's the first paint): a box canvas, page key `index`; the old fixed page is its starter layout, `views/landing/landingLayout.js` | | `/` | DefaultLayout | Landing page (statically imported — it's the first paint): a box canvas, page key `index`; the old fixed page is its starter layout, `views/landing/landingLayout.js` |
| `/stp` | DefaultLayout | The personal home page: an admin-editable canvas of boxes (`views/home3/`, see "The /stp canvas" below) | | `/stp` | DefaultLayout | The personal home page: an admin-editable canvas of boxes (`views/home3/`, see "The /stp canvas" below) |
| `/admin`, `/admin/login` | DefaultLayout | `/admin` is guarded by `meta.requiresAdmin` | | `/admin`, `/admin/login` | DefaultLayout | `/admin` is guarded by `meta.requiresAdmin` |
| `/automata`, `/hotels`, `/shrines` | DefaultLayout | Each shrine under `/shrines/` is a canvas page | | `/automata`, `/hotels` | DefaultLayout | |
| `/shrines`, `/shrines/*` | DefaultLayout | All canvas pages via the catch-all: `/shrines` is an index whose links are Link boxes placed by hand |
| `/cv` | CVLayout | Light print theme. Its Jobs button goes to `/jobs/`, the separate job tracker app (`adamf/job-tracker`); nginx redirects the old `/cv/jobs` and `/cv/leads` there | | `/cv` | CVLayout | Light print theme. Its Jobs button goes to `/jobs/`, the separate job tracker app (`adamf/job-tracker`); nginx redirects the old `/cv/jobs` and `/cv/leads` there |
| `/stp2` | (none) | Bare full-bleed mock, deliberately outside both layouts | | `/stp2` | (none) | Bare full-bleed mock, deliberately outside both layouts |
| `:pathMatch(.*)*` | DefaultLayout | `views/canvas/CanvasPage.vue`: an admin-created canvas page if one exists at the path, else the 404 (with a "create a page here" form for admins) | | `:pathMatch(.*)*` | DefaultLayout | `views/canvas/CanvasPage.vue`: an admin-created canvas page if one exists at the path, else the 404 (with a "create a page here" form for admins) |
@@ -209,9 +210,9 @@ renders any page's boxes.
(`Landing.vue`), which is nothing but the canvas. Any other key is the slug of a **`Page`** (GraphQL (`Landing.vue`), which is nothing but the canvas. Any other key is the slug of a **`Page`** (GraphQL
type, `stores/pages.js`), an admin-created page served at `/<slug>` by the type, `stores/pages.js`), an admin-created page served at `/<slug>` by the
router's catch-all (`views/canvas/CanvasPage.vue`). Pages are created from router's catch-all (`views/canvas/CanvasPage.vue`). Pages are created from
the admin panel's Pages tab, from `/shrines`, or from the 404 of the address the admin panel's Pages tab (which also has a "New shrine" form, a blank page
you want; each can start from a layout in `views/canvas/pageStarters.js` under `shrines/`), or from the 404 of the address you want; each can start
(Blank, Shrine, Notes board). Title, address and visibility are under "Page from a layout in `views/canvas/pageStarters.js` (Blank, Notes board). Title, address and visibility are under "Page
settings" on the page; renaming moves its boxes, deleting takes them too. settings" on the page; renaming moves its boxes, deleting takes them too.
The server refuses slugs that an SPA or nginx route would answer first The server refuses slugs that an SPA or nginx route would answer first
(`validateSlug` in `backend/graph/page_helpers.go`) — add to that list when (`validateSlug` in `backend/graph/page_helpers.go`) — add to that list when
@@ -248,7 +249,9 @@ renders any page's boxes.
- **Editing.** Admins get an "Edit layout" toggle at desktop width. Geometry - **Editing.** Admins get an "Edit layout" toggle at desktop width. Geometry
saves on pointer release, and the box is moved locally first and put back if saves on pointer release, and the box is moved locally first and put back if
the save fails. `BoxEditor.vue` is the side panel. Settings save on change; the save fails. `BoxEditor.vue` is the side panel. Settings save on change;
HTML is a draft that previews live and saves with Save or Ctrl/Cmd+S. HTML is a draft that previews live and saves with Save or Ctrl/Cmd+S, or
automatically on leaving the box (selecting another, clicking empty canvas,
Done, ✕).
CodeMirror is loaded only when that panel opens; the panel is teleported to CodeMirror is loaded only when that panel opens; the panel is teleported to
`<body>`. `<body>`.
Image and video files dropped onto the canvas in edit mode are uploaded and Image and video files dropped onto the canvas in edit mode are uploaded and
@@ -307,7 +310,7 @@ in its header comment; the summary:
| File | Status | | File | Status |
| --- | --- | | --- | --- |
| `views/home3/Home3.vue` | live (`/stp`) — the box canvas; its widget boxes use **Intro3** and **Gym2** | | `views/home3/Home3.vue` | live (`/stp`) — the box canvas; its widget boxes use **Intro3** and **Gym2** |
| `views/home/shrines/{Demoman,GTO,Evangelion,Skipskipbenben}.vue` | the old hand-written shrines (Demoman a video wall, the rest `<Wip />`), unrouted; shrines are canvas pages now | | `views/home/shrines/{Shrines,Demoman,GTO,Evangelion,Skipskipbenben}.vue` | the old `/shrines` index and hand-written shrines (Demoman a video wall, the rest `<Wip />`), unrouted; shrines are canvas pages now |
| `views/home/Home.vue` | legacy fixed grid that `/stp` used to be; no route. Its widgets are still live through `home3/widgetRegistry.js` | | `views/home/Home.vue` | legacy fixed grid that `/stp` used to be; no route. Its widgets are still live through `home3/widgetRegistry.js` |
| `views/home/Intro.vue` | superseded by `Intro2.vue`; not imported | | `views/home/Intro.vue` | superseded by `Intro2.vue`; not imported |
| `views/home/Gym.vue` | superseded by `Gym2.vue`; not imported | | `views/home/Gym.vue` | superseded by `Gym2.vue`; not imported |
+4 -8
View File
@@ -60,14 +60,10 @@ const router = createRouter({
name: "cheap-hotels", name: "cheap-hotels",
component: () => import("@/views/hotels/CheapHotels.vue"), component: () => import("@/views/hotels/CheapHotels.vue"),
}, },
{ // /shrines and the shrines under it are canvas pages, made
path: "shrines", // from the admin panel's Pages tab and served by the catch-all
name: "shrine links", // below. The old hand-written ones (views/home/shrines/) are
component: () => import("@/views/home/shrines/Shrines.vue"), // unrouted.
},
// Individual shrines are canvas pages, made from /shrines and
// served by the catch-all below. The old hand-written ones
// (views/home/shrines/) are unrouted.
// Anything else is an admin-created canvas page if one exists // Anything else is an admin-created canvas page if one exists
// at that address (the Page GraphQL type), else the 404. // at that address (the Page GraphQL type), else the 404.
{ {
+13
View File
@@ -3,6 +3,10 @@
* Admin tab: the canvas pages made in the browser (views/canvas/). Lists them * Admin tab: the canvas pages made in the browser (views/canvas/). Lists them
* all, admin-only ones included, and creates new ones. A page's title, * all, admin-only ones included, and creates new ones. A page's title,
* address and visibility are edited from "Page settings" on the page itself. * address and visibility are edited from "Page settings" on the page itself.
*
* "New shrine" is the same form with the address fixed under /shrines/. It
* starts blank and adds no link anywhere: /shrines is itself a canvas page,
* and its links are boxes put there by hand.
*/ */
import { usePagesStore } from "@/stores/pages"; import { usePagesStore } from "@/stores/pages";
import PageForm from "@/views/canvas/PageForm.vue"; import PageForm from "@/views/canvas/PageForm.vue";
@@ -44,6 +48,15 @@ async function remove(page) {
<p v-else-if="pages.loaded" class="text-muted">No pages yet.</p> <p v-else-if="pages.loaded" class="text-muted">No pages yet.</p>
</section> </section>
<section>
<h1>New shrine</h1>
<p class="text-muted">
A blank page under /shrines/. Link to it from the /shrines page with a
Link box.
</p>
<PageForm prefix="shrines/" placeholder="address, e.g. evangelion" submit-label="Create shrine" />
</section>
<section> <section>
<h1>New page</h1> <h1>New page</h1>
<PageForm /> <PageForm />
+8 -5
View File
@@ -2,8 +2,9 @@
/** /**
* Create a canvas page: its address, title, a starting layout from * Create a canvas page: its address, title, a starting layout from
* pageStarters.js, and whether only admins may see it. On success it opens * pageStarters.js, and whether only admins may see it. On success it opens
* the new page and emits `created`. Used on the admin panel's Pages tab, on /shrines, and on the * the new page and emits `created`. Used on the admin panel's Pages tab
* 404 an admin sees at an address that has no page yet. * (twice: any page, and a shrine under /shrines/) and on the 404 an admin sees
* at an address that has no page yet.
*/ */
import { ref } from "vue"; import { ref } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
@@ -15,9 +16,11 @@ import { STARTERS } from "./pageStarters";
const props = defineProps({ const props = defineProps({
// Pre-filled address, e.g. the path of the 404 being looked at. // Pre-filled address, e.g. the path of the 404 being looked at.
slug: { type: String, default: "" }, slug: { type: String, default: "" },
// Fixed leading part of the address, e.g. "shrines/" on /shrines. // Fixed leading part of the address, e.g. "shrines/" for a new shrine.
prefix: { type: String, default: "" }, prefix: { type: String, default: "" },
starter: { type: String, default: "blank" }, starter: { type: String, default: "blank" },
placeholder: { type: String, default: "address, e.g. shrines/evangelion" },
submitLabel: { type: String, default: "Create page" },
}); });
const emit = defineEmits(["created"]); const emit = defineEmits(["created"]);
@@ -64,7 +67,7 @@ async function submit() {
<form class="page-form flex flex-col gap-1" @submit.prevent="submit"> <form class="page-form flex flex-col gap-1" @submit.prevent="submit">
<label class="flex items-center gap-1"> <label class="flex items-center gap-1">
<span class="text-muted">/{{ prefix }}</span> <span class="text-muted">/{{ prefix }}</span>
<input v-model="slug" type="text" placeholder="address, e.g. evangelion" required class="flex-1" /> <input v-model="slug" type="text" :placeholder="placeholder" required class="flex-1" />
</label> </label>
<input v-model="title" type="text" placeholder="Title (required)" /> <input v-model="title" type="text" placeholder="Title (required)" />
<select v-model="starter"> <select v-model="starter">
@@ -74,7 +77,7 @@ async function submit() {
<input v-model="adminOnly" type="checkbox" /> <input v-model="adminOnly" type="checkbox" />
Only admins can see this page Only admins can see this page
</label> </label>
<Button type="submit" :disabled="busy">{{ busy ? "Creating…" : "Create page" }}</Button> <Button type="submit" :disabled="busy">{{ busy ? "Creating…" : submitLabel }}</Button>
<p v-if="error" class="text-tertiary">{{ error }}</p> <p v-if="error" class="text-tertiary">{{ error }}</p>
</form> </form>
</template> </template>
-55
View File
@@ -4,62 +4,8 @@
* stores/boxes.js — without `page`, which the store adds. Everything is an * stores/boxes.js — without `page`, which the store adds. Everything is an
* ordinary box afterwards: move it, edit it, delete it. * ordinary box afterwards: move it, edit it, delete it.
*/ */
import { galleryHtml, imageHtml } from "@/views/home3/templates";
const escape = (s) =>
s.replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c]);
const html = (title, body, geom, extra = {}) => ({ kind: "html", title, html: body, ...geom, ...extra }); const html = (title, body, geom, extra = {}) => ({ kind: "html", title, html: body, ...geom, ...extra });
function shrine(title) {
const t = escape(title);
return [
html(
"Heading",
`<style>
body { display: grid; place-items: center; text-align: center; }
h1 { margin: 0; font-size: 4.5rem; line-height: 1; }
p { margin: .3rem 0 0; color: var(--color-tertiary); }
</style>
<div>
<h1>${t}</h1>
<p>a shrine</p>
</div>`,
{ x: 300, y: 20, w: 800, h: 160 },
{ framed: false },
),
html(
"Main image",
imageHtml("/img/memes/epic.jpeg"),
{ x: 300, y: 200, w: 380, h: 380 },
{ framed: false },
),
html(
"About",
`<h3>Why ${t}</h3>
<p>What it is, and why it gets a shrine.</p>
<h3>Favourite moments</h3>
<ul>
<li>…</li>
</ul>`,
{ x: 700, y: 200, w: 400, h: 380 },
),
html(
"Gallery",
galleryHtml(["/img/memes/fire-woman.gif", "/img/memes/mix.gif", "/img/memes/lol.jpg"]),
{ x: 300, y: 600, w: 800, h: 320 },
),
html(
"Quote",
`<style>
body { display: grid; place-items: center; text-align: center; font-style: italic; }
</style>
<blockquote>“A line worth remembering.”</blockquote>`,
{ x: 300, y: 940, w: 800, h: 120 },
),
].map((box, i) => ({ z: i + 1, ...box }));
}
function notes() { function notes() {
const note = (text, x, y) => const note = (text, x, y) =>
html( html(
@@ -82,6 +28,5 @@ function notes() {
export const STARTERS = [ export const STARTERS = [
{ id: "blank", label: "Blank", boxes: () => [] }, { id: "blank", label: "Blank", boxes: () => [] },
{ id: "shrine", label: "Shrine", boxes: shrine },
{ id: "notes", label: "Notes board (admin-only notes)", boxes: notes }, { id: "notes", label: "Notes board (admin-only notes)", boxes: notes },
]; ];
+6 -3
View File
@@ -1,10 +1,13 @@
<script setup> <script setup>
/** /**
* Route `/shrines` — index of the shrine pages: every canvas page * STATUS: unused — unrouted. /shrines is now an admin-made canvas page whose
* links are boxes; new shrines are made on the admin panel's Pages tab.
*
* Was route `/shrines` — index of the shrine pages: every canvas page
* (views/canvas/) whose address starts with "shrines/", from the pages query. * (views/canvas/) whose address starts with "shrines/", from the pages query.
* Admins — and only admins; the server refuses createPage to anyone else * Admins — and only admins; the server refuses createPage to anyone else
* anyway — get a button that opens a form to start one from the Shrine * anyway — get a button that opens a form to start one from the Shrine
* layout. * layout (since removed).
*/ */
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import RouterTable from "@/components/util/RouterTable.vue"; import RouterTable from "@/components/util/RouterTable.vue";
@@ -41,7 +44,7 @@ const shrine_links = computed(() =>
<button type="button" class="bdr-2 bg-surface mt-4 cursor-pointer" @click="creating = !creating"> <button type="button" class="bdr-2 bg-surface mt-4 cursor-pointer" @click="creating = !creating">
{{ creating ? "Cancel" : "+ New shrine" }} {{ creating ? "Cancel" : "+ New shrine" }}
</button> </button>
<PageForm v-if="creating" prefix="shrines/" starter="shrine" /> <PageForm v-if="creating" prefix="shrines/" />
</template> </template>
</div> </div>
</main> </main>
+2 -12
View File
@@ -82,7 +82,6 @@ const selectedId = ref(null);
const selected = computed(() => store.boxes.find((b) => b.id === selectedId.value) ?? null); const selected = computed(() => store.boxes.find((b) => b.id === selectedId.value) ?? null);
const preview = ref(null); // unsaved HTML for the selected box, from BoxEditor const preview = ref(null); // unsaved HTML for the selected box, from BoxEditor
const errorMsg = ref(""); const errorMsg = ref("");
const editor = ref(null);
// ---- Scaling ------------------------------------------------------------- // ---- Scaling -------------------------------------------------------------
const viewport = ref(null); const viewport = ref(null);
@@ -271,21 +270,13 @@ async function onDrop(event) {
} }
// ---- Selection ----------------------------------------------------------- // ---- Selection -----------------------------------------------------------
// Leaving a box saves its unsaved HTML; BoxEditor does that itself as the
// selection changes or it unmounts.
function select(box) { function select(box) {
if (selectedId.value === box.id) return;
// Leaving a box with unsaved HTML goes through the editor's own confirm.
if (editor.value && selected.value) {
editor.value.close();
if (selectedId.value !== null) return; // they chose to keep editing
}
selectedId.value = box.id; selectedId.value = box.id;
} }
function toggleEdit() { function toggleEdit() {
if (editing.value && selected.value) {
editor.value?.close();
if (selectedId.value !== null) return;
}
editing.value = !editing.value; editing.value = !editing.value;
} }
</script> </script>
@@ -391,7 +382,6 @@ function toggleEdit() {
<BoxEditor <BoxEditor
v-if="inEditMode && selected" v-if="inEditMode && selected"
ref="editor"
:box="selected" :box="selected"
@preview="preview = $event" @preview="preview = $event"
@close="selectedId = null" @close="selectedId = null"
+26 -11
View File
@@ -8,8 +8,10 @@
* "instant" model as dragging. * "instant" model as dragging.
* - HTML is a draft. Typing updates the box on the canvas live (through the * - HTML is a draft. Typing updates the box on the canvas live (through the
* `preview` event, so the parent can render the draft without touching the * `preview` event, so the parent can render the draft without touching the
* store) and is saved only by Save or Ctrl/Cmd+S. Saving every keystroke * store) and is saved by Save or Ctrl/Cmd+S, or automatically on leaving
* would push half-written markup to every visitor. * the box: selecting another one, clicking empty canvas, Done, or closing
* the panel. Saving every keystroke would push half-written markup to
* every visitor; leaving is the point it is finished.
* *
* "Insert upload" uploads a file (upload.js) and puts a tag for it at the * "Insert upload" uploads a file (upload.js) and puts a tag for it at the
* cursor — the way to add pictures to an existing box, e.g. a gallery. * cursor — the way to add pictures to an existing box, e.g. a gallery.
@@ -17,7 +19,7 @@
* The panel is teleported to <body>, so it is fixed to the window whatever * The panel is teleported to <body>, so it is fixed to the window whatever
* transform or stacking context the page puts around the canvas. * transform or stacking context the page puts around the canvas.
*/ */
import { computed, ref, watch } from "vue"; import { computed, onBeforeUnmount, ref, watch } from "vue";
import { useBoxesStore } from "@/stores/boxes"; import { useBoxesStore } from "@/stores/boxes";
import { tagFor, uploadFile } from "./upload"; import { tagFor, uploadFile } from "./upload";
import CodeEditor from "./CodeEditor.vue"; import CodeEditor from "./CodeEditor.vue";
@@ -38,16 +40,33 @@ const draftHtml = ref(props.box.html ?? "");
const saving = ref(false); const saving = ref(false);
const dirty = computed(() => props.box.kind === "html" && draftHtml.value !== (props.box.html ?? "")); const dirty = computed(() => props.box.kind === "html" && draftHtml.value !== (props.box.html ?? ""));
// Switching to another box: drop this one's preview, start from the new // Save the draft of box `id` if it differs from what is stored. Fire and
// box's saved html. // forget: it runs as the editor moves on or unmounts, with nothing left to
// show progress in, so a failure is only reported through `error`.
function flush(id) {
const box = store.boxes.find((b) => b.id === id);
if (!box || box.kind !== "html" || draftHtml.value === (box.html ?? "")) return;
store.update(id, { html: draftHtml.value }).catch((err) => emit("error", err));
}
// Switching to another box: save the old one's draft, drop its preview, start
// from the new box's saved html.
watch( watch(
() => props.box.id, () => props.box.id,
() => { (_, oldId) => {
flush(oldId);
emit("preview", null); emit("preview", null);
draftHtml.value = props.box.html ?? ""; draftHtml.value = props.box.html ?? "";
}, },
); );
// Deselecting, Done and ✕ all unmount the panel.
onBeforeUnmount(() => {
clearTimeout(previewTimer);
flush(props.box.id);
emit("preview", null);
});
let previewTimer = null; let previewTimer = null;
watch(draftHtml, (html) => { watch(draftHtml, (html) => {
clearTimeout(previewTimer); clearTimeout(previewTimer);
@@ -100,12 +119,8 @@ async function upload(event) {
} }
function close() { function close() {
if (dirty.value && !confirm("Discard unsaved HTML changes?")) return;
emit("preview", null);
emit("close"); emit("close");
} }
defineExpose({ close });
</script> </script>
<template> <template>
@@ -171,7 +186,7 @@ defineExpose({ close });
<footer class="flex items-center justify-between gap-2"> <footer class="flex items-center justify-between gap-2">
<small class="text-muted"> <small class="text-muted">
Runs sandboxed: scripts work, cookies and /api don't. fetch() only reaches Runs sandboxed: scripts work, cookies and /api don't. fetch() only reaches
keyless CORS-open APIs. Ctrl+S saves. keyless CORS-open APIs. Ctrl+S saves; so does leaving the box.
</small> </small>
<input <input
ref="fileInput" ref="fileInput"
+11 -2
View File
@@ -37,8 +37,17 @@ onMounted(async () => {
"&": { height: "100%", fontSize: "13px", backgroundColor: "var(--color-surface-deep)", color: "var(--color-muted)" }, "&": { height: "100%", fontSize: "13px", backgroundColor: "var(--color-surface-deep)", color: "var(--color-muted)" },
".cm-content": { caretColor: "var(--color-primary)" }, ".cm-content": { caretColor: "var(--color-primary)" },
".cm-gutters": { backgroundColor: "var(--color-surface)", color: "var(--color-quaternary)", border: "none" }, ".cm-gutters": { backgroundColor: "var(--color-surface)", color: "var(--color-quaternary)", border: "none" },
".cm-activeLine, .cm-activeLineGutter": { backgroundColor: "var(--color-surface-tint)" }, // The selection is drawn in a layer *behind* the text, so an opaque
"&.cm-focused .cm-selectionBackground, .cm-selectionBackground": { backgroundColor: "#24504a" }, // active-line colour would hide it on the cursor's line: keep it
// translucent.
".cm-activeLine": { backgroundColor: "#55ffbb0d" },
".cm-activeLineGutter": { backgroundColor: "var(--color-surface-tint)" },
// Same selectors as CodeMirror's base theme — a shorter one loses to
// its focused rule, which paints #233, all but invisible here.
"& .cm-selectionBackground, &.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
backgroundColor: "#1f6b5c",
},
".cm-selectionMatch": { backgroundColor: "#55ffbb26" },
".cm-scroller": { fontFamily: "ui-monospace, monospace" }, ".cm-scroller": { fontFamily: "ui-monospace, monospace" },
}, },
{ dark: true }, { dark: true },