Emdash source with visual editor image upload fix

Fixes:
1. media.ts: wrap placeholder generation in try-catch
2. toolbar.ts: check r.ok, display error message in popover
This commit is contained in:
2026-05-03 10:44:54 +07:00
parent 78f81bebb6
commit 2d1be52177
2352 changed files with 662964 additions and 0 deletions

41
packages/core/locals.d.ts vendored Normal file
View File

@@ -0,0 +1,41 @@
/**
* EmDash Astro type declarations
*
* Augments App.Locals with EmDash types.
* Referenced via triple-slash directive in the generated emdash-env.d.ts.
*/
import type { User } from "@emdash-cms/auth";
import type { EmDashHandlers } from "./dist/types.d.mts";
declare global {
namespace App {
interface Locals {
/**
* EmDash API handlers - available on /_emdash/* routes
*/
emdash: EmDashHandlers;
/**
* Authenticated user - set by auth middleware when a valid session exists
*/
user?: User;
/**
* Per-session Durable Object database for playground mode.
*
* Set by the playground middleware (@emdash-cms/cloudflare). Read by
* the runtime middleware and request-context middleware to set the
* database in ALS for the current request.
*
* This exists because Vite SSR loads two copies of request-context.ts
* (dist for integration middleware, source for the loader). locals
* bridges the DB across that module boundary.
*/
__playgroundDb?: unknown;
}
}
}
export {};