diff --git a/web/canvas.ts b/web/canvas.ts index 16c6cd3..481b0af 100644 --- a/web/canvas.ts +++ b/web/canvas.ts @@ -60,7 +60,7 @@ export type CanvasComponent = { would then need a cast, and the point of naming them is that the compiler knows `free-text` holds `html` and `gallery` holds `galleryId`. */ - content?: { html?: string; galleryId?: number | null }; + content?: { html?: string; galleryId?: number | null; url?: string }; padding?: Record; }; export type CanvasSection = { diff --git a/web/sections/PageBuilderPanel.tsx b/web/sections/PageBuilderPanel.tsx index 1225b3e..54abc31 100644 --- a/web/sections/PageBuilderPanel.tsx +++ b/web/sections/PageBuilderPanel.tsx @@ -1,6 +1,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { useNavigate } from 'react-router'; import { Button } from '@/components/ui/button'; +import { posterUrl, thumbUrl } from '../thumbnail'; import { href, useNav } from '../routes'; import { useClient } from 'hooks/useClient'; import { readableError } from '../errors'; @@ -641,16 +642,53 @@ export const PageBuilderPanel = () => { A button rather than the modal opening itself, so picking the block and changing what is in it are two acts — see the note in the selection effect. */} - {(block.kind === 'media' || block.kind === 'video' || block.kind === 'gallery') && ( + {block.kind === 'gallery' && ( )} + + {(block.kind === 'media' || block.kind === 'video') && ( +
+ {/* + What is actually in the block, at a glance. + + A button that says "Choose media…" and nothing else asks somebody to open a dialog to + find out what they already chose. A video shows its POSTER rather than playing: the + question here is which file this is, and a frame answers it. + */} + {block.content?.url && ( + + )} + +
+ + {block.content?.url ? block.content.url.split('/').pop() : 'Nothing chosen'} + + +
+
+ )} , ); return;