Files
glenloch-media/lumenroom/src/lib/drag.ts
T
bhursey 0cb315ea88
CI / build (push) Has been cancelled
feat(editor): bridge the advanced photo editor into the event workflow
Event photos can now be opened in Lumenroom, a WebGL2 develop module, from the
photo editor's Advanced button. The dashboard signs a short-lived token scoped
to one user and event; Lumenroom exchanges it, imports the event's photo list
and proxies bytes on demand, so nothing is copied and the temporary catalog
expires with the bridge session. Saving in Lumenroom renders the photo and
writes it back as the event's edited JPEG, with the advanced recipe kept in
event_photos.advanced_edit_json.

Lumenroom is vendored under lumenroom/ and built as a second compose service,
so one clone and `docker compose up -d --build` deploys both apps.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 01:34:20 +00:00

35 lines
786 B
TypeScript

/**
* Drag payloads live in a module variable because browsers only expose
* `dataTransfer.getData` on drop, not during dragover — and we need to know
* whether a photo (rather than an OS file) is being dragged while hovering.
*/
let photoIds: string[] = [];
let eventId: string | null = null;
export const PHOTO_DRAG = 'application/x-lumen-photos';
export const EVENT_DRAG = 'application/x-lumen-event';
export function startPhotoDrag(ids: string[]) {
photoIds = ids;
eventId = null;
}
export function draggedPhotoIds(): string[] {
return photoIds;
}
export function startEventDrag(id: string) {
eventId = id;
photoIds = [];
}
export function draggedEventId(): string | null {
return eventId;
}
export function endDrag() {
photoIds = [];
eventId = null;
}