reifyui 0.3.0 → 0.4.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.md +59 -10
- package/dist/index.d.ts +93 -22
- package/dist/slides.cjs +737 -0
- package/dist/slides.cjs.map +1 -0
- package/dist/slides.d.ts +128 -0
- package/dist/slides.js +705 -0
- package/dist/slides.js.map +1 -0
- package/package.json +10 -3
- package/src/auth/AuthForm.jsx +187 -0
- package/src/auth/GoogleButton.jsx +80 -0
- package/src/auth/client.js +177 -0
- package/src/components/ChatMessages.jsx +194 -0
- package/src/components/CodeBlock.jsx +120 -0
- package/src/components/Composer.jsx +75 -0
- package/src/components/Dialog.jsx +312 -0
- package/src/components/TaskList.jsx +193 -0
- package/src/components/ToolSteps.jsx +84 -0
- package/src/components/icons.jsx +33 -0
- package/src/components/resizable.jsx +84 -0
- package/src/components/toolMeta.js +91 -0
- package/src/index.d.ts +234 -0
- package/src/index.js +35 -0
- package/src/sheet/SheetGrid.jsx +633 -0
- package/src/slides/Editor.jsx +246 -0
- package/src/slides/Presentation.jsx +79 -0
- package/src/slides/SlideView.jsx +97 -0
- package/src/slides/elements.jsx +178 -0
- package/src/slides/index.d.ts +128 -0
- package/src/slides/index.js +10 -0
- package/src/state/blocks.js +37 -0
- package/src/state/conversationStore.js +55 -0
- package/src/stream/responses.js +122 -0
- package/styles/slides.css +38 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/slides/index.js","../src/slides/SlideView.jsx","../src/slides/elements.jsx","../src/slides/Editor.jsx","../src/slides/Presentation.jsx"],"sourcesContent":["// Shared deck renderer + presentation (the Slides product's canvas — and,\n// like SheetGrid, embeddable anywhere: studio Spaces can mount a deck later).\n// IMPORT VIA SUBPATH ONLY ('@ui-core/src/slides/index.js'), NOT the ui-core\n// root index: echarts/mermaid/highlight.js load lazily inside these\n// components, and a root re-export would force every ui-core consumer (CG,\n// Flowness) to resolve those deps at build time. See docs/slides-architecture.md.\nexport { SlideView, SlideStage, themeVars } from './SlideView.jsx';\nexport { ElementView } from './elements.jsx';\nexport { EditorCanvas } from './Editor.jsx';\nexport { Presentation } from './Presentation.jsx';\n","// SlideView — render ONE slide from the deck JSON onto the fixed 1920×1080\n// stage, then scale that stage to fit the container (the convergent pattern\n// from OpenDesign / frontend-slides). Theme tokens become CSS vars so every\n// element reads them; elements are absolutely positioned by their `frame`.\n// The SAME component renders the editor canvas, the thumbnails, and the\n// presentation view — one renderer, four surfaces.\nimport { useEffect, useRef, useState } from 'react';\nimport { ElementView } from './elements.jsx';\n\nconst STAGE_W = 1920;\nconst STAGE_H = 1080;\n\n/** deck.theme → CSS custom properties consumed by the element renderers. */\nexport function themeVars(theme) {\n const p = (theme && theme.palette) || {};\n const f = (theme && theme.fonts) || {};\n return {\n '--sl-bg': p.bg || '#FFFFFF',\n '--sl-surface': p.surface || '#F7F8FB',\n '--sl-ink': p.ink || '#111827',\n '--sl-mute': p.mute || '#6B7280',\n '--sl-brand': p.brand || '#4F46E5',\n '--sl-accent': p.accent || '#06B6D4',\n '--sl-head': f.head || 'Inter, system-ui, sans-serif',\n '--sl-body': f.body || 'Inter, system-ui, sans-serif',\n '--sl-mono': 'ui-monospace, SFMono-Regular, Menlo, monospace',\n };\n}\n\nfunction background(bg, theme) {\n if (!bg) return { background: 'var(--sl-bg)' };\n if (bg.color) return { background: bg.color };\n if (bg.gradient) return { background: bg.gradient };\n if (bg.image) return { backgroundImage: `url(${bg.image})`, backgroundSize: 'cover', backgroundPosition: 'center' };\n return { background: 'var(--sl-bg)' };\n}\n\n/** The un-scaled 1920×1080 stage. Used directly for export/screenshot; wrapped\n * by SlideView for on-screen scaling. */\nexport function SlideStage({ slide, theme, resolveSrc, selectedId, onSelectElement }) {\n return (\n <div className=\"sl-stage\"\n style={{ position: 'relative', width: STAGE_W, height: STAGE_H, overflow: 'hidden',\n fontFamily: 'var(--sl-body)', ...themeVars(theme), ...background(slide?.background, theme) }}>\n {(slide?.elements || []).map((el) => {\n const fr = el.frame || {};\n const sel = onSelectElement && el.id === selectedId;\n return (\n <div key={el.id}\n className={'sl-el' + (sel ? ' sl-el-selected' : '')}\n onMouseDown={onSelectElement ? (e) => { e.stopPropagation(); onSelectElement(el.id); } : undefined}\n style={{ position: 'absolute',\n left: fr.x || 0, top: fr.y || 0,\n width: fr.w ?? 400, height: fr.h ?? 100,\n transform: fr.rotation ? `rotate(${fr.rotation}deg)` : undefined,\n cursor: onSelectElement ? 'pointer' : 'default' }}>\n <ElementView el={el} resolveSrc={resolveSrc} />\n </div>\n );\n })}\n </div>\n );\n}\n\n/** Scales the fixed stage to fill its parent while preserving 16:9. */\nexport function SlideView({ slide, theme, resolveSrc, selectedId, onSelectElement, onDeselect, bare }) {\n const boxRef = useRef(null);\n const [scale, setScale] = useState(1);\n useEffect(() => {\n const el = boxRef.current;\n if (!el) return undefined;\n const fit = () => {\n const r = el.getBoundingClientRect();\n if (r.width && r.height) setScale(Math.min(r.width / STAGE_W, r.height / STAGE_H));\n };\n fit();\n const ro = new ResizeObserver(fit);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n return (\n <div ref={boxRef} className=\"sl-fit\"\n onMouseDown={onDeselect}\n style={{ position: 'relative', width: '100%', height: '100%',\n display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n <div style={{ width: STAGE_W * scale, height: STAGE_H * scale, position: 'relative',\n boxShadow: bare ? 'none' : '0 8px 40px -8px rgba(15,23,42,.25)',\n borderRadius: bare ? 0 : 6 * scale, overflow: 'hidden',\n flexShrink: 0 }}>\n <div style={{ position: 'absolute', top: 0, left: 0, transform: `scale(${scale})`, transformOrigin: 'top left' }}>\n <SlideStage slide={slide} theme={theme} resolveSrc={resolveSrc}\n selectedId={selectedId} onSelectElement={onSelectElement} />\n </div>\n </div>\n </div>\n );\n}\n","// Element renderers — one per element type in the deck model\n// (docs/slides-architecture.md). Each renders the element's `content` inside a\n// frame that SlideView has already absolutely-positioned + sized on the fixed\n// 1920×1080 stage, so these components fill 100% of their box and never worry\n// about placement. Charts (ECharts) and flowcharts (Mermaid) load lazily and\n// render to SVG so they stay crisp in the canvas, thumbnails, and PDF.\nimport { useEffect, useRef, useState } from 'react';\n\n// Rich-text runs → spans with marks. role drives default sizing (the stage is\n// 1920 wide, so these px sizes read correctly once the stage is scaled).\nconst ROLE_STYLE = {\n title: { fontSize: 72, fontWeight: 800, lineHeight: 1.1, fontFamily: 'var(--sl-head)' },\n subtitle: { fontSize: 36, fontWeight: 500, lineHeight: 1.25, color: 'var(--sl-mute)' },\n body: { fontSize: 30, fontWeight: 400, lineHeight: 1.4 },\n bullets: { fontSize: 30, fontWeight: 400, lineHeight: 1.5 },\n caption: { fontSize: 22, fontWeight: 400, lineHeight: 1.3, color: 'var(--sl-mute)' },\n};\n\nfunction runSpans(runs) {\n return (runs || []).map((r, i) => {\n const marks = new Set(r.marks || []);\n let node = r.text;\n const style = {};\n if (marks.has('bold')) style.fontWeight = 700;\n if (marks.has('italic')) style.fontStyle = 'italic';\n if (marks.has('underline')) style.textDecoration = 'underline';\n if (marks.has('code')) { style.fontFamily = 'var(--sl-mono, monospace)'; style.background = 'rgba(0,0,0,.06)'; style.padding = '0 6px'; style.borderRadius = 4; }\n const link = (r.marks || []).find((m) => typeof m === 'object' && m.link);\n if (link) return <a key={i} href={link.link} style={{ ...style, color: 'var(--sl-brand)' }}>{node}</a>;\n return <span key={i} style={style}>{node}</span>;\n });\n}\n\nfunction TextEl({ el }) {\n const role = el.content?.role || 'body';\n const base = ROLE_STYLE[role] || ROLE_STYLE.body;\n const align = el.style?.align || (role === 'title' || role === 'subtitle' ? 'left' : 'left');\n const runs = el.content?.runs || [];\n const style = { ...base, ...(el.style || {}), textAlign: align, color: el.style?.color || base.color || 'var(--sl-ink)',\n width: '100%', height: '100%', display: 'flex', flexDirection: 'column',\n justifyContent: el.style?.valign === 'center' ? 'center' : 'flex-start', overflow: 'visible' };\n if (role === 'bullets') {\n return (\n <ul style={{ ...style, margin: 0, paddingLeft: 40, display: 'block' }}>\n {runs.map((r, i) => <li key={i} style={{ marginBottom: 8 }}>{runSpans([r])}</li>)}\n </ul>\n );\n }\n return <div style={style}>{runSpans(runs)}</div>;\n}\n\nfunction ImageEl({ el, resolveSrc }) {\n const src = resolveSrc ? resolveSrc(el.content?.src) : el.content?.src;\n if (!src) return <div style={ph()}>image</div>;\n return <img src={src} alt={el.content?.alt || ''}\n style={{ width: '100%', height: '100%', objectFit: el.content?.fit || 'cover',\n borderRadius: el.style?.radius ?? 0, display: 'block' }} />;\n}\n\nfunction ChartEl({ el }) {\n const ref = useRef(null);\n useEffect(() => {\n let chart = null; let dead = false;\n (async () => {\n try {\n const echarts = (await import('echarts')).default || (await import('echarts'));\n if (dead || !ref.current) return;\n chart = echarts.init(ref.current, null, { renderer: 'svg' });\n if (el.content?.spec) chart.setOption(el.content.spec);\n } catch { /* echarts missing — leave the box */ }\n })();\n return () => { dead = true; try { chart && chart.dispose(); } catch {} };\n }, [JSON.stringify(el.content?.spec)]);\n return <div ref={ref} style={{ width: '100%', height: '100%' }} />;\n}\n\nfunction FlowchartEl({ el }) {\n const [svg, setSvg] = useState('');\n useEffect(() => {\n let dead = false;\n (async () => {\n const src = el.content?.mermaid;\n if (!src) return;\n try {\n const mermaid = (await import('mermaid')).default || (await import('mermaid'));\n mermaid.initialize({ startOnLoad: false, theme: 'neutral' });\n const id = 'mmd_' + Math.random().toString(36).slice(2);\n const { svg } = await mermaid.render(id, src);\n if (!dead) setSvg(svg);\n } catch { if (!dead) setSvg(''); }\n })();\n return () => { dead = true; };\n }, [el.content?.mermaid]);\n return <div style={{ width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }}\n dangerouslySetInnerHTML={{ __html: svg || '' }} />;\n}\n\nfunction ShapeEl({ el }) {\n const kind = el.content?.kind || 'rect';\n const fill = el.style?.fill || 'var(--sl-brand)';\n const stroke = el.style?.stroke || 'transparent';\n const sw = el.style?.strokeWidth ?? 0;\n if (kind === 'line' || kind === 'arrow') {\n return (\n <svg viewBox=\"0 0 100 100\" preserveAspectRatio=\"none\" style={{ width: '100%', height: '100%' }}>\n <defs><marker id=\"ah\" markerWidth=\"10\" markerHeight=\"10\" refX=\"7\" refY=\"3\" orient=\"auto\">\n <path d=\"M0,0 L7,3 L0,6 Z\" fill={stroke !== 'transparent' ? stroke : fill} /></marker></defs>\n <line x1=\"2\" y1=\"50\" x2=\"98\" y2=\"50\" stroke={stroke !== 'transparent' ? stroke : fill}\n strokeWidth={sw || 3} markerEnd={kind === 'arrow' ? 'url(#ah)' : undefined} />\n </svg>\n );\n }\n const radius = kind === 'ellipse' ? '50%' : (el.style?.radius ?? 8);\n return <div style={{ width: '100%', height: '100%', background: fill, borderRadius: radius,\n border: sw ? `${sw}px solid ${stroke}` : undefined }} />;\n}\n\nfunction TableEl({ el }) {\n const cols = el.content?.columns || [];\n const rows = el.content?.rows || [];\n return (\n <table style={{ width: '100%', borderCollapse: 'collapse', fontSize: 24, color: 'var(--sl-ink)' }}>\n {cols.length > 0 && (\n <thead><tr>{cols.map((c, i) => (\n <th key={i} style={{ textAlign: 'left', padding: '10px 14px', borderBottom: '2px solid var(--sl-brand)', fontWeight: 700 }}>{c}</th>\n ))}</tr></thead>\n )}\n <tbody>{rows.map((r, i) => (\n <tr key={i}>{(r || []).map((cell, j) => (\n <td key={j} style={{ padding: '10px 14px', borderBottom: '1px solid rgba(0,0,0,.08)' }}>{cell}</td>\n ))}</tr>\n ))}</tbody>\n </table>\n );\n}\n\nfunction CodeEl({ el }) {\n const ref = useRef(null);\n useEffect(() => {\n let dead = false;\n (async () => {\n try {\n const hljs = (await import('highlight.js/lib/common')).default;\n if (dead || !ref.current) return;\n ref.current.textContent = el.content?.source || '';\n hljs.highlightElement(ref.current);\n } catch { if (ref.current) ref.current.textContent = el.content?.source || ''; }\n })();\n return () => { dead = true; };\n }, [el.content?.source, el.content?.lang]);\n return (\n <pre style={{ width: '100%', height: '100%', margin: 0, overflow: 'auto', borderRadius: 8,\n fontSize: 22, lineHeight: 1.5, background: '#0B1020' }}>\n <code ref={ref} className={`language-${el.content?.lang || 'plaintext'}`} />\n </pre>\n );\n}\n\nfunction EmbedEl({ el }) {\n return <div style={{ width: '100%', height: '100%', overflow: 'hidden' }}\n dangerouslySetInnerHTML={{ __html: el.content?.html || '' }} />;\n}\n\nfunction ph() {\n return { width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center',\n background: 'var(--sl-surface)', color: 'var(--sl-mute)', fontSize: 20, borderRadius: 8 };\n}\n\nconst RENDERERS = {\n text: TextEl, image: ImageEl, chart: ChartEl, flowchart: FlowchartEl,\n shape: ShapeEl, table: TableEl, code: CodeEl, embed: EmbedEl,\n};\n\nexport function ElementView({ el, resolveSrc }) {\n const R = RENDERERS[el.type];\n if (!R) return <div style={ph()}>{el.type}</div>;\n return <R el={el} resolveSrc={resolveSrc} />;\n}\n","// EditorCanvas — direct manipulation over the deck renderer: a real slides\n// editor. One transparent interaction layer above the scaled SlideStage owns\n// ALL pointer behavior (hit-test → select, click-drag moves immediately like\n// Google Slides, corner handles resize, double-click edits text inline,\n// Delete removes, arrows nudge). It never mutates the deck itself — every\n// commit flows up as a typed patch (onPatchElement/onDeleteElement), so the\n// host owns undo/autosave/collab broadcast. Peer decorations (selection\n// outlines, live drag) render from the `peers` prop.\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { SlideStage } from './SlideView.jsx';\n\nconst STAGE_W = 1920;\nconst STAGE_H = 1080;\nconst MIN_SIZE = 24;\n\n// Topmost element whose frame contains the stage-space point (z = list order).\n// Rotation is ignored for hit-testing (rare, and the frame box stays close).\nfunction hitTest(slide, x, y) {\n const els = slide?.elements || [];\n for (let i = els.length - 1; i >= 0; i--) {\n const f = els[i].frame || {};\n if (x >= (f.x || 0) && x <= (f.x || 0) + (f.w || 0)\n && y >= (f.y || 0) && y <= (f.y || 0) + (f.h || 0)) return els[i];\n }\n return null;\n}\n\nconst HANDLES = [\n { k: 'nw', cx: 0, cy: 0 }, { k: 'ne', cx: 1, cy: 0 },\n { k: 'sw', cx: 0, cy: 1 }, { k: 'se', cx: 1, cy: 1 },\n];\n\nfunction resizeFrame(f0, k, dx, dy) {\n let { x, y, w, h } = f0;\n if (k.includes('e')) w = Math.max(MIN_SIZE, f0.w + dx);\n if (k.includes('s')) h = Math.max(MIN_SIZE, f0.h + dy);\n if (k.includes('w')) { const nw = Math.max(MIN_SIZE, f0.w - dx); x = f0.x + (f0.w - nw); w = nw; }\n if (k.includes('n')) { const nh = Math.max(MIN_SIZE, f0.h - dy); y = f0.y + (f0.h - nh); h = nh; }\n return { ...f0, x: Math.round(x), y: Math.round(y), w: Math.round(w), h: Math.round(h) };\n}\n\nfunction textOf(el) {\n return (el.content?.runs || []).map((r) => r.text ?? '').join('\\n');\n}\n\nexport function EditorCanvas({\n slide, theme, resolveSrc,\n selectedId, onSelect,\n onPatchElement, // (elementId, patch, {transient}) => void\n onDeleteElement, // (elementId) => void\n onDragState, // (elementId|null, frame|null) live broadcast hook\n peers = [], // [{id,name,color,sel:{slideId,elId},drag:{elId,frame}}]\n readOnly = false,\n}) {\n const boxRef = useRef(null);\n const [scale, setScale] = useState(1);\n const [box, setBox] = useState({ left: 0, top: 0 });\n const gestureRef = useRef(null); // {mode:'move'|'resize', handle, el, f0, sx, sy, moved}\n const [liveFrame, setLiveFrame] = useState(null); // frame during an active gesture\n const [editing, setEditing] = useState(null); // {elId, value}\n\n useEffect(() => {\n const el = boxRef.current;\n if (!el) return undefined;\n const fit = () => {\n const r = el.getBoundingClientRect();\n if (r.width && r.height) {\n const s = Math.min(r.width / STAGE_W, r.height / STAGE_H);\n setScale(s);\n setBox({ left: (r.width - STAGE_W * s) / 2, top: (r.height - STAGE_H * s) / 2 });\n }\n };\n fit();\n const ro = new ResizeObserver(fit);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n const toStage = useCallback((e) => {\n const r = boxRef.current.getBoundingClientRect();\n return { x: (e.clientX - r.left - box.left) / scale, y: (e.clientY - r.top - box.top) / scale };\n }, [scale, box]);\n\n const selected = (slide?.elements || []).find((el) => el.id === selectedId) || null;\n\n function beginGesture(mode, el, e, handle) {\n if (readOnly) return;\n const p = toStage(e);\n gestureRef.current = { mode, handle, el, f0: { ...el.frame }, sx: p.x, sy: p.y, moved: false };\n e.currentTarget.setPointerCapture?.(e.pointerId);\n }\n\n function onLayerPointerDown(e) {\n if (editing) return; // let the textarea own the pointer\n const p = toStage(e);\n const hit = hitTest(slide, p.x, p.y);\n onSelect?.(hit ? hit.id : null);\n if (hit) beginGesture('move', hit, e);\n }\n\n function onPointerMove(e) {\n const g = gestureRef.current;\n if (!g) return;\n const p = toStage(e);\n const dx = Math.round(p.x - g.sx);\n const dy = Math.round(p.y - g.sy);\n if (!g.moved && Math.abs(dx) < 3 && Math.abs(dy) < 3) return; // click, not drag\n g.moved = true;\n const f = g.mode === 'move'\n ? { ...g.f0,\n x: Math.max(-g.f0.w + 40, Math.min(STAGE_W - 40, g.f0.x + dx)),\n y: Math.max(-g.f0.h + 40, Math.min(STAGE_H - 40, g.f0.y + dy)) }\n : resizeFrame(g.f0, g.handle, dx, dy);\n setLiveFrame(f);\n onDragState?.(g.el.id, f);\n }\n\n function onPointerUp() {\n const g = gestureRef.current;\n gestureRef.current = null;\n onDragState?.(null, null);\n if (g && g.moved && liveFrame) onPatchElement?.(g.el.id, { frame: liveFrame });\n setLiveFrame(null);\n }\n\n function onDoubleClick(e) {\n if (readOnly) return;\n const p = toStage(e);\n const hit = hitTest(slide, p.x, p.y);\n if (hit && hit.type === 'text') {\n onSelect?.(hit.id);\n setEditing({ elId: hit.id, value: textOf(hit) });\n }\n }\n\n // Delete + nudge on the selected element (never while typing in the editor\n // overlay — it stops propagation itself).\n useEffect(() => {\n if (readOnly) return undefined;\n const onKey = (e) => {\n const t = e.target;\n if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable)) return;\n if (!selected) return;\n if (e.key === 'Backspace' || e.key === 'Delete') { e.preventDefault(); onDeleteElement?.(selected.id); }\n else if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {\n e.preventDefault();\n const step = e.shiftKey ? 24 : 4;\n const f = { ...selected.frame };\n if (e.key === 'ArrowLeft') f.x -= step;\n if (e.key === 'ArrowRight') f.x += step;\n if (e.key === 'ArrowUp') f.y -= step;\n if (e.key === 'ArrowDown') f.y += step;\n onPatchElement?.(selected.id, { frame: f });\n }\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [selected, readOnly, onPatchElement, onDeleteElement]);\n\n function commitText() {\n if (!editing) return;\n const el = (slide?.elements || []).find((x) => x.id === editing.elId);\n if (el && editing.value !== textOf(el)) {\n const runs = editing.value.split('\\n').map((t) => ({ text: t }));\n onPatchElement?.(el.id, { content: { ...el.content, runs } });\n }\n setEditing(null);\n }\n\n // Render-time frame override for the element being dragged/resized.\n const displaySlide = liveFrame && gestureRef.current\n ? { ...slide,\n elements: (slide.elements || []).map((el) => (el.id === gestureRef.current.el.id ? { ...el, frame: liveFrame } : el)) }\n : slide;\n\n const selFrame = liveFrame && gestureRef.current && selected && gestureRef.current.el.id === selected.id\n ? liveFrame : selected?.frame;\n\n const editingEl = editing ? (slide?.elements || []).find((x) => x.id === editing.elId) : null;\n\n return (\n <div ref={boxRef} className=\"sl-editor-fit\" style={{ position: 'relative', width: '100%', height: '100%' }}>\n <div style={{ position: 'absolute', left: box.left, top: box.top,\n width: STAGE_W * scale, height: STAGE_H * scale,\n boxShadow: '0 8px 40px -8px rgba(15,23,42,.25)', borderRadius: 6 * scale, overflow: 'hidden' }}>\n <div style={{ position: 'absolute', top: 0, left: 0, transform: `scale(${scale})`, transformOrigin: 'top left' }}>\n <SlideStage slide={displaySlide} theme={theme} resolveSrc={resolveSrc} />\n </div>\n </div>\n\n {/* interaction + decoration layer (stage coordinates * scale) */}\n <div className=\"sl-editor-layer\"\n style={{ position: 'absolute', left: box.left, top: box.top,\n width: STAGE_W * scale, height: STAGE_H * scale, touchAction: 'none' }}\n onPointerDown={onLayerPointerDown} onPointerMove={onPointerMove}\n onPointerUp={onPointerUp} onDoubleClick={onDoubleClick}>\n\n {/* peer selections + live peer drags */}\n {peers.map((p) => {\n const targetId = p.drag?.elId || p.sel?.elId;\n if (!targetId || p.sel?.slideId !== slide?.id) return null;\n const el = (slide?.elements || []).find((x) => x.id === targetId);\n const f = p.drag?.frame || el?.frame;\n if (!f) return null;\n return (\n <div key={p.id} className=\"sl-peer-box\" style={{\n left: f.x * scale, top: f.y * scale, width: f.w * scale, height: f.h * scale,\n borderColor: p.color }}>\n <span className=\"sl-peer-tag\" style={{ background: p.color }}>{p.name}</span>\n </div>\n );\n })}\n\n {/* own selection + handles */}\n {selected && selFrame && !editing && (\n <div className=\"sl-sel-box\" style={{ left: selFrame.x * scale, top: selFrame.y * scale,\n width: selFrame.w * scale, height: selFrame.h * scale }}>\n {!readOnly && HANDLES.map((h) => (\n <span key={h.k} className={`sl-sel-handle sl-h-${h.k}`}\n onPointerDown={(e) => { e.stopPropagation(); beginGesture('resize', selected, e, h.k); }} />\n ))}\n </div>\n )}\n\n {/* inline text editor */}\n {editingEl && (\n <textarea className=\"sl-text-edit\" autoFocus value={editing.value}\n style={{ left: editingEl.frame.x * scale, top: editingEl.frame.y * scale,\n width: editingEl.frame.w * scale, height: editingEl.frame.h * scale,\n fontSize: (editingEl.style?.fontSize\n || { title: 72, subtitle: 36, body: 30, bullets: 30, caption: 22 }[editingEl.content?.role || 'body']) * scale,\n fontFamily: 'var(--sl-body, inherit)', lineHeight: 1.25,\n textAlign: editingEl.style?.align || 'left' }}\n onChange={(e) => setEditing((v) => ({ ...v, value: e.target.value }))}\n onBlur={commitText}\n onPointerDown={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n e.stopPropagation();\n if (e.key === 'Escape') setEditing(null);\n if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) commitText();\n }} />\n )}\n </div>\n </div>\n );\n}\n","// Presentation — fullscreen deck playback, modeled on how people actually\n// present (Google Slides): entering triggers REAL browser fullscreen, the\n// slide fills the screen edge-to-edge on black, everything is keyboard-driven\n// (←/→/Space/PgUp/PgDn/Home/End, Esc exits), click advances, and the only\n// chrome is a floating control pill that appears on mouse move and fades away\n// with the cursor after a moment of stillness.\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { SlideView } from './SlideView.jsx';\n\nexport function Presentation({ deck, resolveSrc, startIndex = 0, onExit }) {\n const slides = deck?.slides || [];\n const rootRef = useRef(null);\n const idleRef = useRef(null);\n const iRef = useRef(Math.min(startIndex, Math.max(0, slides.length - 1)));\n const [i, setI] = useState(iRef.current);\n const [awake, setAwake] = useState(true);\n\n const go = useCallback((n) => {\n const next = Math.max(0, Math.min(slides.length - 1, n));\n iRef.current = next;\n setI(next);\n }, [slides.length]);\n\n // Real fullscreen on enter; leaving fullscreen (Esc) exits the show.\n useEffect(() => {\n const el = rootRef.current;\n el?.requestFullscreen?.().catch(() => {});\n const onFsChange = () => { if (!document.fullscreenElement) onExit && onExit(); };\n document.addEventListener('fullscreenchange', onFsChange);\n return () => {\n document.removeEventListener('fullscreenchange', onFsChange);\n if (document.fullscreenElement) document.exitFullscreen?.().catch(() => {});\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const onKey = (e) => {\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown' || e.key === ' ' || e.key === 'PageDown') { e.preventDefault(); go(iRef.current + 1); }\n else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp' || e.key === 'PageUp') { e.preventDefault(); go(iRef.current - 1); }\n else if (e.key === 'Home') go(0);\n else if (e.key === 'End') go(slides.length - 1);\n else if (e.key === 'Escape') onExit && onExit(); // also fires via fullscreenchange\n };\n window.addEventListener('keydown', onKey);\n return () => window.removeEventListener('keydown', onKey);\n }, [go, slides.length, onExit]);\n\n // Wake the chrome on movement; let it sleep (with the cursor) after 2s still.\n const wake = useCallback(() => {\n setAwake(true);\n window.clearTimeout(idleRef.current);\n idleRef.current = window.setTimeout(() => setAwake(false), 2000);\n }, []);\n useEffect(() => { wake(); return () => window.clearTimeout(idleRef.current); }, [wake]);\n\n return (\n <div ref={rootRef} className=\"sl-present\" onMouseMove={wake}\n onClick={() => go(iRef.current + 1)}\n style={{ position: 'fixed', inset: 0, zIndex: 1000, background: '#000',\n cursor: awake ? 'default' : 'none' }}>\n <SlideView slide={slides[i]} theme={deck?.theme} resolveSrc={resolveSrc} bare />\n <div className={'sl-present-pill' + (awake ? ' awake' : '')}\n onClick={(e) => e.stopPropagation()}>\n <button className=\"sl-pp-btn\" aria-label=\"Previous slide\" onClick={() => go(i - 1)} disabled={i === 0}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"M15 18l-6-6 6-6\"/></svg>\n </button>\n <span className=\"sl-pp-count\">{i + 1} / {slides.length}</span>\n <button className=\"sl-pp-btn\" aria-label=\"Next slide\" onClick={() => go(i + 1)} disabled={i >= slides.length - 1}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"M9 18l6-6-6-6\"/></svg>\n </button>\n <span className=\"sl-pp-sep\" />\n <button className=\"sl-pp-btn\" aria-label=\"Exit presentation\" onClick={onExit}>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\"><path d=\"M18 6L6 18M6 6l12 12\"/></svg>\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,IAAAA,gB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,6CAAC,UAAK,WAAU,aAAY;AAAA,cAC5B,6CAAC,YAAO,WAAU,aAAY,cAAW,qBAAoB,SAAS,QACpE,uDAAC,SAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,QAAO,gBAAe,aAAY,OAAM,eAAc,SAAQ,uDAAC,UAAK,GAAE,wBAAsB,GAAE,GAC5J;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["import_react","svg","import_jsx_runtime","import_react","import_jsx_runtime","STAGE_W","STAGE_H","import_react","import_jsx_runtime"]}
|
package/dist/slides.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// Type declarations for `reifyui/slides`.
|
|
2
|
+
//
|
|
3
|
+
// Hand-authored, like the root index: the source is plain JSX, so there is nothing to infer from.
|
|
4
|
+
// The deck model below is the contract — an agent writing a deck and this renderer drawing one are
|
|
5
|
+
// agreeing on exactly these shapes, so it is worth stating them precisely rather than as `any`.
|
|
6
|
+
import type { ComponentType, CSSProperties } from 'react';
|
|
7
|
+
|
|
8
|
+
// ── deck model ────────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
/** Absolute placement on the fixed 1920x1080 stage. Every element carries one. */
|
|
10
|
+
export interface Frame {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
w: number;
|
|
14
|
+
h: number;
|
|
15
|
+
rotation?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** A span of text plus its marks. `link` is an object mark; the rest are plain strings. */
|
|
19
|
+
export interface Run {
|
|
20
|
+
text: string;
|
|
21
|
+
marks?: Array<'bold' | 'italic' | 'underline' | 'code' | { link: string }>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Exactly the keys of RENDERERS in elements.jsx. An unknown type renders as a grey
|
|
25
|
+
// placeholder showing the type name, so getting this list wrong is a silent design bug.
|
|
26
|
+
export type ElementType =
|
|
27
|
+
| 'text' | 'image' | 'chart' | 'flowchart' | 'shape' | 'table' | 'code' | 'embed';
|
|
28
|
+
|
|
29
|
+
export interface SlideElement {
|
|
30
|
+
id: string;
|
|
31
|
+
type: ElementType;
|
|
32
|
+
frame: Frame;
|
|
33
|
+
style?: CSSProperties & { fontSize?: number; align?: 'left' | 'center' | 'right'; fill?: string };
|
|
34
|
+
/** Shape depends on `type`: text/bullets carry `runs`, images carry `src`, charts carry `spec`. */
|
|
35
|
+
content?: Record<string, unknown> & { role?: string; runs?: Run[]; src?: string; alt?: string };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Slide {
|
|
39
|
+
id: string;
|
|
40
|
+
layout?: string;
|
|
41
|
+
background?: { color?: string; image?: string };
|
|
42
|
+
notes?: string;
|
|
43
|
+
elements?: SlideElement[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface Theme {
|
|
47
|
+
palette?: { bg?: string; ink?: string; mute?: string; brand?: string; accent?: string };
|
|
48
|
+
fonts?: { head?: string; body?: string };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface Deck {
|
|
52
|
+
meta?: { title?: string; [k: string]: unknown };
|
|
53
|
+
stage?: { width: number; height: number };
|
|
54
|
+
theme?: Theme;
|
|
55
|
+
slides?: Slide[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Rewrites an element's `src` before it is fetched — point workspace-relative paths at your API. */
|
|
59
|
+
export type ResolveSrc = (src: string) => string;
|
|
60
|
+
|
|
61
|
+
// ── rendering ─────────────────────────────────────────────────────────────────────────────────
|
|
62
|
+
/** The theme as CSS custom properties (`--sl-bg`, `--sl-body`, ...), for spreading into a style. */
|
|
63
|
+
export function themeVars(theme?: Theme): CSSProperties;
|
|
64
|
+
|
|
65
|
+
export interface SlideStageProps {
|
|
66
|
+
slide?: Slide;
|
|
67
|
+
theme?: Theme;
|
|
68
|
+
resolveSrc?: ResolveSrc;
|
|
69
|
+
selectedId?: string | null;
|
|
70
|
+
onSelectElement?: (id: string) => void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** One slide at true 1920x1080. Scale it yourself — used by SlideView, EditorCanvas and print. */
|
|
74
|
+
export const SlideStage: ComponentType<SlideStageProps>;
|
|
75
|
+
|
|
76
|
+
export interface SlideViewProps extends SlideStageProps {
|
|
77
|
+
onDeselect?: () => void;
|
|
78
|
+
/** Drop the frame/shadow and render only the stage — for thumbnails and print pages. */
|
|
79
|
+
bare?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** A slide scaled to fit its container. The read-only renderer: thumbnails, previews, print. */
|
|
83
|
+
export const SlideView: ComponentType<SlideViewProps>;
|
|
84
|
+
|
|
85
|
+
/** A single element, unpositioned. Exported for hosts composing their own stage. */
|
|
86
|
+
export const ElementView: ComponentType<{ el: SlideElement; resolveSrc?: ResolveSrc }>;
|
|
87
|
+
|
|
88
|
+
// ── editing ───────────────────────────────────────────────────────────────────────────────────
|
|
89
|
+
/** A peer's cursor state, for multiplayer decorations. Omit `peers` for single-player. */
|
|
90
|
+
export interface Peer {
|
|
91
|
+
id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
color: string;
|
|
94
|
+
sel?: { slideId: string; elId: string };
|
|
95
|
+
drag?: { elId: string; frame: Frame };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface EditorCanvasProps {
|
|
99
|
+
slide?: Slide;
|
|
100
|
+
theme?: Theme;
|
|
101
|
+
resolveSrc?: ResolveSrc;
|
|
102
|
+
selectedId?: string | null;
|
|
103
|
+
onSelect?: (id: string | null) => void;
|
|
104
|
+
/** A committed change to one element. The canvas never mutates the deck — the host owns state. */
|
|
105
|
+
onPatchElement?: (elementId: string, patch: Partial<SlideElement>) => void;
|
|
106
|
+
onDeleteElement?: (elementId: string) => void;
|
|
107
|
+
/** Fires continuously during a drag/resize, then with (null, null). For collab broadcast. */
|
|
108
|
+
onDragState?: (elementId: string | null, frame: Frame | null) => void;
|
|
109
|
+
peers?: Peer[];
|
|
110
|
+
/** Selection still works; nothing can be moved, resized, typed into or deleted. */
|
|
111
|
+
readOnly?: boolean;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Direct manipulation over the deck renderer: click-drag to move, corner handles to resize,
|
|
116
|
+
* double-click to edit text inline, Delete to remove, arrows to nudge (Shift for a coarse step).
|
|
117
|
+
* Every commit leaves as a typed patch, so undo, autosave and collaboration stay with the host.
|
|
118
|
+
*/
|
|
119
|
+
export const EditorCanvas: ComponentType<EditorCanvasProps>;
|
|
120
|
+
|
|
121
|
+
// ── presenting ────────────────────────────────────────────────────────────────────────────────
|
|
122
|
+
/** Full-screen presentation with arrow/space navigation. Calls `onExit` on Escape. */
|
|
123
|
+
export const Presentation: ComponentType<{
|
|
124
|
+
deck?: Deck;
|
|
125
|
+
resolveSrc?: ResolveSrc;
|
|
126
|
+
startIndex?: number;
|
|
127
|
+
onExit?: () => void;
|
|
128
|
+
}>;
|