rvlib-shipkit 2.21.0 → 2.22.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/CHANGELOG.md +23 -0
- package/package.json +1 -1
- package/src/asks/asks-queue.ts +8 -7
- package/src/assets/kits/identity-kit.ts +158 -2
- package/src/cli/cmd_Bump.ts +3 -3
- package/src/cli/cmd_Rec.ts +349 -0
- package/src/cli/cmd_Releases.ts +4 -1
- package/src/cli/cmd_Secret.ts +10 -3
- package/src/cli/cmd_Sign.ts +24 -0
- package/src/cli/cmd_Social.ts +44 -1
- package/src/cli/family-pages.ts +1 -0
- package/src/cli/registry.ts +4 -0
- package/src/core/agent-spawn.ts +4 -17
- package/src/core/code-lines.ts +49 -0
- package/src/core/discover-checks.ts +27 -3
- package/src/core/hard-reset.ts +34 -0
- package/src/core/raw-access.ts +3 -13
- package/src/core/throwaway-worktree.ts +72 -0
- package/src/home/app-sign.ts +98 -0
- package/src/home/gui-app.ts +31 -12
- package/src/home/home-routes.ts +6 -0
- package/src/home/serve-web.ts +1 -1
- package/src/identities/identities.ts +6 -0
- package/src/media-kinds.ts +5 -3
- package/src/media-store/forget.ts +54 -0
- package/src/media-store/put.ts +4 -3
- package/src/media-store/space.ts +63 -24
- package/src/recordings/delete.ts +19 -0
- package/src/recordings/edit.ts +231 -0
- package/src/recordings/load.ts +37 -0
- package/src/recordings/marks-draw.ts +111 -0
- package/src/recordings/marks-png.ts +25 -0
- package/src/recordings/marks.ts +138 -0
- package/src/recordings/media-kind.ts +67 -0
- package/src/recordings/model.ts +170 -0
- package/src/recordings/open.ts +33 -0
- package/src/recordings/place.ts +89 -0
- package/src/recordings/presets.ts +99 -0
- package/src/recordings/recorder-app/Capture.swift +510 -0
- package/src/recordings/recorder-app/Clip.swift +162 -0
- package/src/recordings/recorder-app/Editor.swift +39 -0
- package/src/recordings/recorder-app/Tray.swift +298 -0
- package/src/recordings/recorder-app/main.swift +862 -0
- package/src/recordings/recorder-app.ts +46 -0
- package/src/recordings/recorder.shipkit.ts +11 -0
- package/src/recordings/routes.ts +140 -0
- package/src/recordings/run-recorder.ts +40 -0
- package/src/recordings/share.ts +107 -0
- package/src/recordings/take.ts +146 -0
- package/src/recordings/view.ts +40 -0
- package/src/release/gate-checkout.ts +74 -0
- package/src/release/release-scope.ts +35 -26
- package/src/release/run-bump.ts +79 -37
- package/src/release/run-release.ts +67 -53
- package/src/releases/add.ts +7 -2
- package/src/releases/from-card.ts +3 -3
- package/src/releases/model.ts +29 -7
- package/src/repo-config.ts +7 -3
- package/src/review/trailer-desk.ts +1 -0
- package/src/review/trailer-model.ts +2 -0
- package/src/secrets/manager.ts +18 -1
- package/src/serve/hub-app/home-st.ts +15 -5
- package/src/serve/hub-app/home.html +1 -0
- package/src/serve/hub-app/hub-app.tsx +6 -1
- package/src/serve/hub-app/icons.tsx +2 -0
- package/src/serve/hub-app/palette-st.ts +1 -0
- package/src/serve/hub-app/project-list.tsx +1 -0
- package/src/serve/hub-app/projects-svc.ts +1 -1
- package/src/serve/hub-app/recordings-st.ts +641 -0
- package/src/serve/hub-app/recordings-view.tsx +504 -0
- package/src/serve/hub-app/recordings.css +82 -0
- package/src/serve/hub-app/repo-st.ts +1 -1
- package/src/serve/hub-app/review/trailer-page.tsx +1 -0
- package/src/serve/hub-app/review/trailer-st.ts +16 -0
- package/src/serve/hub-app/review/trailer-timeline.tsx +3 -0
- package/src/serve/hub-app/review.css +2 -0
- package/src/serve/hub-app/social/post-card.tsx +31 -3
- package/src/serve/hub-app/social/social-model.ts +4 -0
- package/src/serve/hub-app/social/social-st.ts +12 -0
- package/src/serve/hub-app/social.css +4 -0
- package/src/shipkit.ts +2 -2
- package/src/shot/box.ts +23 -17
- package/src/shot/browser-slot.ts +13 -3
- package/src/shot/film-box.ts +193 -117
- package/src/shot/shooter.ts +5 -3
- package/src/smoke/run-smoke.ts +8 -6
- package/src/social/compose.ts +14 -0
- package/src/social/drafts.ts +1 -1
- package/src/social/load.ts +16 -2
- package/src/social/publish/index.ts +3 -1
- package/src/social/publish/secret.ts +12 -4
- package/src/social/release-card.ts +69 -0
- package/src/social/release-stage.ts +49 -10
- package/src/social/routes.ts +5 -0
- package/src/social/stage.ts +9 -5
- package/src/trailer/build.ts +24 -0
- package/src/trailer/ffmpeg.ts +8 -0
- package/src/trailer/grammar.ts +9 -2
- package/src/trailer/look.ts +7 -0
- package/src/veille/chrome.ts +6 -3
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
// `/recordings`: one editor window. On top the repo filter, the record buttons and the gallery switch; the capture
|
|
2
|
+
// picked (the newest unless the hash names one) big in the middle with its tools (select, arrow, rect, text, step,
|
|
3
|
+
// blur, crop), colours and undo; a video's timeline under it, with trim handles and a lane per mark for its span; the
|
|
4
|
+
// strip of every capture at the bottom, each thumb with copy file, copy link, Finder and delete. `#gallery` shows
|
|
5
|
+
// every thumb big instead. The marks are drawn by marks-draw.ts, the same drawing the export burns in
|
|
6
|
+
import { autorun } from 'mobx'
|
|
7
|
+
import { observer } from 'mobx-react-lite'
|
|
8
|
+
import { useEffect, useRef, useState } from 'react'
|
|
9
|
+
import { canvasOf, printTime, type Crop } from '../../recordings/edit.ts'
|
|
10
|
+
import { drawMark, type Ctx2D } from '../../recordings/marks-draw.ts'
|
|
11
|
+
import { boundsOf, COLORS, HEX, moved, type Mark, type Pt } from '../../recordings/marks.ts'
|
|
12
|
+
import { fileUrl, type RecView } from '../../recordings/view.ts'
|
|
13
|
+
import type { HomeSt } from './home-st.ts'
|
|
14
|
+
import { TOOLS, type EditorSt, type RecordingsSt, type Tool } from './recordings-st.ts'
|
|
15
|
+
|
|
16
|
+
const length = (r: RecView): string => (r.still ? 'still' : printTime(r.seconds).replace(/\.\d$/, ''))
|
|
17
|
+
const poster = (r: RecView): string => fileUrl(r, 'poster.webp', `${r.current}-${r.edit.length}`)
|
|
18
|
+
|
|
19
|
+
/** each tool's key alone, and Snagit's own on a Mac with ⌃ (Move ⌃V, Arrow ⌃A, Shape ⌃U, Text ⌃T, Step ⌃S, Blur ⌃B,
|
|
20
|
+
* Crop ⌃C); ⌃1 to ⌃7 pick the tool at that place, as Snagit does on Windows */
|
|
21
|
+
const TOOL_WORDS: Record<Tool, { label: string; name: string; key: string; ctrl: string; title: string }> = {
|
|
22
|
+
select: { label: '↖', name: 'Move', key: 'v', ctrl: 'v', title: 'pick a mark, drag it, Delete removes it' },
|
|
23
|
+
arrow: { label: '↗', name: 'Arrow', key: 'a', ctrl: 'a', title: 'drag from the tail to the point' },
|
|
24
|
+
rect: { label: '▭', name: 'Shape', key: 'r', ctrl: 'u', title: 'drag a rectangle' },
|
|
25
|
+
text: { label: 'T', name: 'Text', key: 't', ctrl: 't', title: 'click where the words go, type, Enter' },
|
|
26
|
+
step: { label: '①', name: 'Step', key: 'n', ctrl: 's', title: 'click: a numbered step, the next number each time' },
|
|
27
|
+
blur: { label: '▒', name: 'Blur', key: 'b', ctrl: 'b', title: 'drag over what must not show' },
|
|
28
|
+
crop: { label: '⌗', name: 'Crop', key: 'c', ctrl: 'c', title: 'drag the part of the frame to keep' },
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** a tool's tooltip: its name and both its keys first, then what it does */
|
|
32
|
+
export const toolTip = (t: Tool): string => `${TOOL_WORDS[t].name} · ${TOOL_WORDS[t].key.toUpperCase()} or ⌃${TOOL_WORDS[t].ctrl.toUpperCase()}: ${TOOL_WORDS[t].title}`
|
|
33
|
+
|
|
34
|
+
/** the tool a ⌃ key picks: Snagit's letter, or its place 1 to 7 */
|
|
35
|
+
export function ctrlTool(key: string): Tool | null {
|
|
36
|
+
const k = key.toLowerCase()
|
|
37
|
+
const byLetter = (Object.keys(TOOL_WORDS) as Tool[]).find((t) => TOOL_WORDS[t].ctrl === k)
|
|
38
|
+
if (byLetter) return byLetter
|
|
39
|
+
const n = Number(k)
|
|
40
|
+
return n >= 1 && n <= TOOLS.length ? TOOLS[n - 1]! : null
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ---- the strip and the gallery
|
|
44
|
+
|
|
45
|
+
const ThumbActions = observer(({ st, r }: { st: RecordingsSt; r: RecView }) => {
|
|
46
|
+
const busy = st.busy !== ''
|
|
47
|
+
const armed = st.arming === `${r.repo}/${r.id}`
|
|
48
|
+
return (
|
|
49
|
+
<span className="rcacts">
|
|
50
|
+
<button type="button" disabled={busy} data-tip="Copy the file" aria-label="copy the file" onClick={(e) => { e.stopPropagation(); void st.share(r, 'copy-file') }}>⧉</button>
|
|
51
|
+
<button type="button" disabled={busy} data-tip="Copy a link (7 days)" aria-label="copy a link" onClick={(e) => { e.stopPropagation(); void st.share(r, 'link') }}>🔗</button>
|
|
52
|
+
<button type="button" disabled={busy} data-tip="Show in Finder" aria-label="show in Finder" onClick={(e) => { e.stopPropagation(); void st.share(r, 'reveal') }}>📁</button>
|
|
53
|
+
<button type="button" className={armed ? 'rcarmed' : ''} disabled={busy} data-tip={armed ? 'Click again: deleted for good' : 'Delete (click twice)'} aria-label="delete" onClick={(e) => { e.stopPropagation(); void st.remove(r) }}>{armed ? 'delete?' : '🗑'}</button>
|
|
54
|
+
</span>
|
|
55
|
+
)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const Thumb = observer(({ st, r, big }: { st: RecordingsSt; r: RecView; big?: boolean }) => {
|
|
59
|
+
const on = !big && st.current?.repo === r.repo && st.current.id === r.id
|
|
60
|
+
return (
|
|
61
|
+
<div className={`rcthumb${on ? ' on' : ''}${big ? ' big' : ''}`} role="button" tabIndex={0} title={`${r.repo}/${r.name}`} onClick={() => st.select(r)} onKeyDown={(e) => { if (e.key === 'Enter') st.select(r) }}>
|
|
62
|
+
<img src={poster(r)} alt="" loading="lazy" />
|
|
63
|
+
<span className="rctname">{r.name}{st.hasDraft(r) ? <i title="an edit not exported yet"> •</i> : null}</span>
|
|
64
|
+
<span className="rctmeta">{r.repo} · {length(r)}{r.edit !== '' ? ' · edited' : ''}{r.local ? '' : ' · ☁︎'}{r.up ? '' : ' · uploading…'}</span>
|
|
65
|
+
<ThumbActions st={st} r={r} />
|
|
66
|
+
</div>
|
|
67
|
+
)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const Strip = observer(({ st }: { st: RecordingsSt }) => {
|
|
71
|
+
const box = useRef<HTMLDivElement>(null)
|
|
72
|
+
const cur = st.current
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const el = box.current?.querySelector('.rcthumb.on') as HTMLElement | null
|
|
75
|
+
el?.scrollIntoView({ block: 'nearest', inline: 'nearest' })
|
|
76
|
+
}, [cur?.id])
|
|
77
|
+
return (
|
|
78
|
+
<div ref={box} className="rcstrip">
|
|
79
|
+
{st.shown.map((r) => <Thumb key={`${r.repo}/${r.id}`} st={st} r={r} />)}
|
|
80
|
+
</div>
|
|
81
|
+
)
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
// ---- the stage
|
|
85
|
+
|
|
86
|
+
/** the size the frame takes inside its box, its proportions kept */
|
|
87
|
+
function useFit(w: number, h: number): [React.RefObject<HTMLDivElement | null>, number] {
|
|
88
|
+
const box = useRef<HTMLDivElement>(null)
|
|
89
|
+
const [scale, setScale] = useState(0)
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
const el = box.current
|
|
92
|
+
if (!el) return
|
|
93
|
+
const fit = (): void => setScale(Math.min(el.clientWidth / w, el.clientHeight / h))
|
|
94
|
+
fit()
|
|
95
|
+
const ro = new ResizeObserver(fit)
|
|
96
|
+
ro.observe(el)
|
|
97
|
+
return () => ro.disconnect()
|
|
98
|
+
}, [w, h])
|
|
99
|
+
return [box, scale]
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const norm = (a: Pt, b: Pt): Crop => ({ x: Math.round(Math.min(a.x, b.x)), y: Math.round(Math.min(a.y, b.y)), w: Math.round(Math.abs(b.x - a.x)), h: Math.round(Math.abs(b.y - a.y)) })
|
|
103
|
+
|
|
104
|
+
const Stage = observer(({ ed }: { ed: EditorSt }) => {
|
|
105
|
+
const r = ed.rec
|
|
106
|
+
const W = r.width
|
|
107
|
+
const H = r.height
|
|
108
|
+
// the canvas the export draws on: the take, grown by every mark past it (the one being drawn too)
|
|
109
|
+
const cv = canvasOf({ marks: ed.draft ? [...ed.marks, ed.draft] : ed.marks }, r)
|
|
110
|
+
const [box, scale] = useFit(cv.w, cv.h)
|
|
111
|
+
const canvas = useRef<HTMLCanvasElement>(null)
|
|
112
|
+
const frameEl = useRef<HTMLDivElement>(null)
|
|
113
|
+
const drag = useRef<{ from: Pt; moving: number | null; base: Mark | null } | null>(null)
|
|
114
|
+
const [hidden, setHidden] = useState<number | null>(null)
|
|
115
|
+
|
|
116
|
+
// the overlay drawn again whenever the marks, the playhead, the draft or the pick move
|
|
117
|
+
useEffect(
|
|
118
|
+
() =>
|
|
119
|
+
autorun(() => {
|
|
120
|
+
const c = canvas.current
|
|
121
|
+
if (!c || scale <= 0) return
|
|
122
|
+
const now = canvasOf({ marks: ed.draft ? [...ed.marks, ed.draft] : ed.marks }, r)
|
|
123
|
+
const dpr = window.devicePixelRatio || 1
|
|
124
|
+
c.width = Math.round(now.w * scale * dpr)
|
|
125
|
+
c.height = Math.round(now.h * scale * dpr)
|
|
126
|
+
const ctx = c.getContext('2d')!
|
|
127
|
+
ctx.setTransform(scale * dpr, 0, 0, scale * dpr, -now.x * scale * dpr, -now.y * scale * dpr)
|
|
128
|
+
ctx.clearRect(now.x, now.y, now.w, now.h)
|
|
129
|
+
const marks = ed.marks
|
|
130
|
+
for (const i of ed.marksNow) if (i !== hidden) drawMark(ctx as unknown as Ctx2D, marks, i, r, { preview: true })
|
|
131
|
+
if (ed.draft) drawMark(ctx as unknown as Ctx2D, [...marks, ed.draft], marks.length, r, { preview: true })
|
|
132
|
+
const crop = ed.cropDraft ?? ed.edit.crop
|
|
133
|
+
if (crop) {
|
|
134
|
+
ctx.fillStyle = 'rgba(0,0,0,0.45)'
|
|
135
|
+
ctx.fillRect(0, 0, W, crop.y)
|
|
136
|
+
ctx.fillRect(0, crop.y + crop.h, W, H - crop.y - crop.h)
|
|
137
|
+
ctx.fillRect(0, crop.y, crop.x, crop.h)
|
|
138
|
+
ctx.fillRect(crop.x + crop.w, crop.y, W - crop.x - crop.w, crop.h)
|
|
139
|
+
ctx.strokeStyle = '#ffffff'
|
|
140
|
+
ctx.lineWidth = 1.5 / scale
|
|
141
|
+
ctx.strokeRect(crop.x, crop.y, crop.w, crop.h)
|
|
142
|
+
}
|
|
143
|
+
const sel = ed.selected
|
|
144
|
+
if (sel !== null && marks[sel] && sel !== hidden) {
|
|
145
|
+
const b = boundsOf(marks[sel]!, r)
|
|
146
|
+
ctx.setLineDash([6 / scale, 4 / scale])
|
|
147
|
+
ctx.strokeStyle = '#2f7ff0'
|
|
148
|
+
ctx.lineWidth = 1.5 / scale
|
|
149
|
+
ctx.strokeRect(b.x - 4 / scale, b.y - 4 / scale, b.w + 8 / scale, b.h + 8 / scale)
|
|
150
|
+
}
|
|
151
|
+
}),
|
|
152
|
+
[ed, scale, hidden, W, H, r],
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
/** the pointer in the take's pixels: past its edges too, a mark may start outside it */
|
|
156
|
+
const at = (e: React.PointerEvent): Pt => {
|
|
157
|
+
const b = frameEl.current!.getBoundingClientRect()
|
|
158
|
+
return { x: Math.round((e.clientX - b.left) / scale), y: Math.round((e.clientY - b.top) / scale) }
|
|
159
|
+
}
|
|
160
|
+
const hit = (p: Pt): number | null => {
|
|
161
|
+
const shown = ed.marksNow
|
|
162
|
+
for (let k = shown.length - 1; k >= 0; k--) {
|
|
163
|
+
const b = boundsOf(ed.marks[shown[k]!]!, r)
|
|
164
|
+
if (p.x >= b.x && p.x <= b.x + b.w && p.y >= b.y && p.y <= b.y + b.h) return shown[k]!
|
|
165
|
+
}
|
|
166
|
+
return null
|
|
167
|
+
}
|
|
168
|
+
const inside = (p: Pt): Pt => ({ x: Math.min(Math.max(0, p.x), W), y: Math.min(Math.max(0, p.y), H) })
|
|
169
|
+
const down = (e: React.PointerEvent): void => {
|
|
170
|
+
if ((e.target as HTMLElement).closest('input')) return
|
|
171
|
+
if (ed.typing) return ed.commitText()
|
|
172
|
+
const p = at(e)
|
|
173
|
+
;(e.currentTarget as HTMLElement).setPointerCapture(e.pointerId)
|
|
174
|
+
if (ed.tool === 'select') {
|
|
175
|
+
const i = hit(p)
|
|
176
|
+
ed.select(i)
|
|
177
|
+
drag.current = { from: p, moving: i, base: i === null ? null : ed.marks[i]! }
|
|
178
|
+
if (i !== null) setHidden(i)
|
|
179
|
+
return
|
|
180
|
+
}
|
|
181
|
+
// the text box opens once the click is over: opened on the press, the rest of the click took the focus off it,
|
|
182
|
+
// its blur closed it empty and the letters went to the tool keys
|
|
183
|
+
if (ed.tool === 'text') {
|
|
184
|
+
e.preventDefault()
|
|
185
|
+
drag.current = { from: p, moving: null, base: null }
|
|
186
|
+
return
|
|
187
|
+
}
|
|
188
|
+
if (ed.tool === 'step') return ed.addMark({ kind: 'step', at: p, color: ed.color, span: null })
|
|
189
|
+
// a crop and a blur keep to the take: the space around it has nothing to cut or hide
|
|
190
|
+
drag.current = { from: ed.tool === 'crop' || ed.tool === 'blur' ? inside(p) : p, moving: null, base: null }
|
|
191
|
+
}
|
|
192
|
+
const move = (e: React.PointerEvent): void => {
|
|
193
|
+
const d = drag.current
|
|
194
|
+
if (!d) return
|
|
195
|
+
const p = at(e)
|
|
196
|
+
if (ed.tool === 'select') {
|
|
197
|
+
if (d.base) ed.setDraft(moved(d.base, p.x - d.from.x, p.y - d.from.y))
|
|
198
|
+
return
|
|
199
|
+
}
|
|
200
|
+
const b = norm(d.from, p)
|
|
201
|
+
if (ed.tool === 'arrow') ed.setDraft({ kind: 'arrow', from: d.from, to: p, color: ed.color, span: null })
|
|
202
|
+
else if (ed.tool === 'rect') ed.setDraft({ kind: 'rect', box: b, color: ed.color, span: null })
|
|
203
|
+
else if (ed.tool === 'blur') ed.setDraft({ kind: 'blur', box: norm(d.from, inside(p)), span: null })
|
|
204
|
+
else if (ed.tool === 'crop') ed.setCropDraft(norm(d.from, inside(p)))
|
|
205
|
+
}
|
|
206
|
+
const up = (e: React.PointerEvent): void => {
|
|
207
|
+
const d = drag.current
|
|
208
|
+
drag.current = null
|
|
209
|
+
if (!d) return
|
|
210
|
+
const p = at(e)
|
|
211
|
+
const far = Math.hypot(p.x - d.from.x, p.y - d.from.y) >= 8 / Math.max(scale, 0.01)
|
|
212
|
+
if (ed.tool === 'select') {
|
|
213
|
+
setHidden(null)
|
|
214
|
+
ed.setDraft(null)
|
|
215
|
+
if (d.moving !== null && far) ed.moveMark(d.moving, p.x - d.from.x, p.y - d.from.y)
|
|
216
|
+
return
|
|
217
|
+
}
|
|
218
|
+
if (ed.tool === 'text') return ed.startText(d.from)
|
|
219
|
+
const draft = ed.draft
|
|
220
|
+
ed.setDraft(null)
|
|
221
|
+
if (ed.tool === 'crop') {
|
|
222
|
+
const c = ed.cropDraft
|
|
223
|
+
ed.setCropDraft(null)
|
|
224
|
+
if (c && c.w >= 16 && c.h >= 16) ed.setCrop(c)
|
|
225
|
+
return
|
|
226
|
+
}
|
|
227
|
+
if (draft && far) ed.addMark(draft)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<div ref={box} className={`rcstage t-${ed.tool}`} onPointerDown={down} onPointerMove={move} onPointerUp={up}>
|
|
232
|
+
<div className={`rccanvas${cv.w !== W || cv.h !== H ? ' grown' : ''}`} style={{ width: cv.w * scale, height: cv.h * scale }}>
|
|
233
|
+
<div ref={frameEl} className="rcframe" style={{ left: -cv.x * scale, top: -cv.y * scale, width: W * scale, height: H * scale }}>
|
|
234
|
+
{r.still ? (
|
|
235
|
+
<img src={fileUrl(r, r.raw)} alt={r.name} draggable={false} />
|
|
236
|
+
) : (
|
|
237
|
+
<video ref={(v) => ed.setVideo(v)} src={fileUrl(r, r.raw)} preload="auto" onPlay={() => ed.onPlay()} onPause={() => ed.onPause()} onSeeked={() => ed.onVideoMoved()} onTimeUpdate={() => { if (!ed.playing) ed.onVideoMoved() }} />
|
|
238
|
+
)}
|
|
239
|
+
{ed.marksNow.map((i) => {
|
|
240
|
+
const m = ed.marks[i]!
|
|
241
|
+
if (m.kind !== 'blur' || i === hidden) return null
|
|
242
|
+
return <span key={i} className="rcblur" style={{ left: m.box.x * scale, top: m.box.y * scale, width: m.box.w * scale, height: m.box.h * scale }} />
|
|
243
|
+
})}
|
|
244
|
+
{ed.draft?.kind === 'blur' ? <span className="rcblur" style={{ left: ed.draft.box.x * scale, top: ed.draft.box.y * scale, width: ed.draft.box.w * scale, height: ed.draft.box.h * scale }} /> : null}
|
|
245
|
+
{ed.typing ? (
|
|
246
|
+
<input
|
|
247
|
+
className="rctyping"
|
|
248
|
+
autoFocus
|
|
249
|
+
value={ed.typing.value}
|
|
250
|
+
placeholder="type, then Enter"
|
|
251
|
+
style={{ left: ed.typing.at.x * scale, top: ed.typing.at.y * scale, color: HEX[ed.color] }}
|
|
252
|
+
onChange={(e) => ed.setTyping(e.currentTarget.value)}
|
|
253
|
+
onKeyDown={(e) => {
|
|
254
|
+
e.stopPropagation()
|
|
255
|
+
if (e.key === 'Enter') ed.commitText()
|
|
256
|
+
if (e.key === 'Escape') ed.cancelText()
|
|
257
|
+
}}
|
|
258
|
+
onBlur={() => ed.commitText()}
|
|
259
|
+
/>
|
|
260
|
+
) : null}
|
|
261
|
+
</div>
|
|
262
|
+
<canvas ref={canvas} className="rcdraw" style={{ width: cv.w * scale, height: cv.h * scale }} />
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
)
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
// ---- the timeline
|
|
269
|
+
|
|
270
|
+
/** a drag along the timeline, in seconds: `on(t)` live, `done(t)` once let go */
|
|
271
|
+
function dragTime(e: React.PointerEvent, track: HTMLElement, len: number, on: (t: number) => void, done: (t: number) => void): void {
|
|
272
|
+
e.stopPropagation()
|
|
273
|
+
e.preventDefault()
|
|
274
|
+
const b = track.getBoundingClientRect()
|
|
275
|
+
const t = (x: number): number => Math.min(len, Math.max(0, ((x - b.left) / b.width) * len))
|
|
276
|
+
const mv = (ev: PointerEvent): void => on(t(ev.clientX))
|
|
277
|
+
const end = (ev: PointerEvent): void => {
|
|
278
|
+
window.removeEventListener('pointermove', mv)
|
|
279
|
+
window.removeEventListener('pointerup', end)
|
|
280
|
+
done(t(ev.clientX))
|
|
281
|
+
}
|
|
282
|
+
window.addEventListener('pointermove', mv)
|
|
283
|
+
window.addEventListener('pointerup', end)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const Timeline = observer(({ ed }: { ed: EditorSt }) => {
|
|
287
|
+
const track = useRef<HTMLDivElement>(null)
|
|
288
|
+
const [trim, setTrim] = useState<{ from: number; to: number } | null>(null)
|
|
289
|
+
const [lane, setLane] = useState<{ i: number; from: number; to: number } | null>(null)
|
|
290
|
+
const len = Math.max(ed.length, 0.001)
|
|
291
|
+
const pct = (t: number): string => `${(t / len) * 100}%`
|
|
292
|
+
const kept = ed.kept
|
|
293
|
+
const a = trim?.from ?? kept[0]!.from
|
|
294
|
+
const b = trim?.to ?? kept.at(-1)!.to
|
|
295
|
+
const s = ed.selection
|
|
296
|
+
const seek = (e: React.PointerEvent<HTMLDivElement>): void => dragTime(e, e.currentTarget, ed.length, (t) => ed.seek(t), (t) => ed.seek(t))
|
|
297
|
+
return (
|
|
298
|
+
<div className="rctl">
|
|
299
|
+
<div ref={track} className="rcline" onPointerDown={seek} title="click or drag to move the playhead">
|
|
300
|
+
<span className="rcout" style={{ left: 0, width: pct(a) }} />
|
|
301
|
+
<span className="rcout" style={{ left: pct(b), right: 0 }} />
|
|
302
|
+
{kept.map((k, i) => <span key={`k${i}`} className="rckeep" style={{ left: pct(Math.max(k.from, a)), width: pct(Math.max(0, Math.min(k.to, b) - Math.max(k.from, a))) }} />)}
|
|
303
|
+
{ed.edit.speed.map((p, i) => <span key={`s${i}`} className="rcspeed" style={{ left: pct(p.from), width: pct(p.to - p.from) }}>{p.factor}×</span>)}
|
|
304
|
+
{s ? <span className="rcsel" style={{ left: pct(s.from), width: pct(s.to - s.from) }} /> : null}
|
|
305
|
+
{ed.mark.in != null ? <span className="rcmark" style={{ left: pct(ed.mark.in) }} /> : null}
|
|
306
|
+
{ed.mark.out != null ? <span className="rcmark" style={{ left: pct(ed.mark.out) }} /> : null}
|
|
307
|
+
<span className="rchandle" style={{ left: pct(a) }} title="drag: where the video starts" onPointerDown={(e) => dragTime(e, track.current!, ed.length, (t) => setTrim({ from: Math.min(t, b - 0.2), to: b }), (t) => { setTrim(null); ed.setTrim(Math.min(t, b - 0.2), b) })} />
|
|
308
|
+
<span className="rchandle end" style={{ left: pct(b) }} title="drag: where the video ends" onPointerDown={(e) => dragTime(e, track.current!, ed.length, (t) => setTrim({ from: a, to: Math.max(t, a + 0.2) }), (t) => { setTrim(null); ed.setTrim(a, Math.max(t, a + 0.2)) })} />
|
|
309
|
+
<span className="rchead" style={{ left: pct(ed.time) }} />
|
|
310
|
+
</div>
|
|
311
|
+
{ed.marks.map((m, i) => {
|
|
312
|
+
const sp = lane?.i === i ? lane : (m.span ?? { from: 0, to: ed.length })
|
|
313
|
+
const color = m.kind === 'blur' ? 'var(--dim)' : HEX[m.color]
|
|
314
|
+
const word = m.kind === 'text' ? `“${m.text}”` : m.kind
|
|
315
|
+
const grab = (e: React.PointerEvent, edge: 'from' | 'to' | 'both'): void => {
|
|
316
|
+
ed.select(i)
|
|
317
|
+
const t0 = ((e.clientX - track.current!.getBoundingClientRect().left) / track.current!.getBoundingClientRect().width) * ed.length
|
|
318
|
+
const base = m.span ?? { from: 0, to: ed.length }
|
|
319
|
+
const span = (t: number): { from: number; to: number } => {
|
|
320
|
+
if (edge === 'from') return { from: Math.min(t, base.to - 0.2), to: base.to }
|
|
321
|
+
if (edge === 'to') return { from: base.from, to: Math.max(t, base.from + 0.2) }
|
|
322
|
+
const d = Math.min(Math.max(t - t0, -base.from), ed.length - base.to)
|
|
323
|
+
return { from: base.from + d, to: base.to + d }
|
|
324
|
+
}
|
|
325
|
+
dragTime(e, track.current!, ed.length, (t) => setLane({ i, ...span(t) }), (t) => { setLane(null); ed.setMarkSpan(i, span(t)) })
|
|
326
|
+
}
|
|
327
|
+
return (
|
|
328
|
+
<div key={i} className={`rclane${ed.selected === i ? ' on' : ''}`} title={`${word}: drag its ends to show it only there`}>
|
|
329
|
+
<span className="rcspan" style={{ left: pct(sp.from), width: pct(sp.to - sp.from), background: color }} onPointerDown={(e) => grab(e, 'both')}>
|
|
330
|
+
<i className="rcedge" onPointerDown={(e) => grab(e, 'from')} />
|
|
331
|
+
<b>{word}</b>
|
|
332
|
+
<i className="rcedge end" onPointerDown={(e) => grab(e, 'to')} />
|
|
333
|
+
</span>
|
|
334
|
+
</div>
|
|
335
|
+
)
|
|
336
|
+
})}
|
|
337
|
+
</div>
|
|
338
|
+
)
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
// ---- the editor
|
|
342
|
+
|
|
343
|
+
const Editor = observer(({ st, ed, solo }: { st: RecordingsSt; ed: EditorSt; solo?: boolean }) => {
|
|
344
|
+
const r = ed.rec
|
|
345
|
+
const [name, setName] = useState(r.name)
|
|
346
|
+
const [showText, setShowText] = useState(false)
|
|
347
|
+
useEffect(() => setName(r.name), [r.name])
|
|
348
|
+
useEffect(() => {
|
|
349
|
+
const key = (e: KeyboardEvent): void => {
|
|
350
|
+
const t = e.target as HTMLElement
|
|
351
|
+
const typing = t.tagName === 'INPUT' || t.tagName === 'TEXTAREA'
|
|
352
|
+
// Snagit's ⌃ keys pick a tool, even from the text box (⌃ types nothing there on a Mac)
|
|
353
|
+
if (e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
354
|
+
const tool = ctrlTool(e.key)
|
|
355
|
+
if (tool) {
|
|
356
|
+
e.preventDefault()
|
|
357
|
+
return ed.setTool(tool)
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
const cmd = e.metaKey || e.ctrlKey
|
|
361
|
+
if (cmd && e.key.toLowerCase() === 's') {
|
|
362
|
+
e.preventDefault()
|
|
363
|
+
return void ed.save()
|
|
364
|
+
}
|
|
365
|
+
if (typing) return
|
|
366
|
+
if (cmd && e.key.toLowerCase() === 'z') {
|
|
367
|
+
e.preventDefault()
|
|
368
|
+
return e.shiftKey ? ed.redo() : ed.undo()
|
|
369
|
+
}
|
|
370
|
+
if (cmd || e.altKey) return
|
|
371
|
+
const tool = (Object.keys(TOOL_WORDS) as Tool[]).find((k) => TOOL_WORDS[k].key === e.key)
|
|
372
|
+
const act: Record<string, () => void> = {
|
|
373
|
+
' ': () => ed.toggle(),
|
|
374
|
+
i: () => ed.setIn(),
|
|
375
|
+
o: () => ed.setOut(),
|
|
376
|
+
x: () => ed.cut(),
|
|
377
|
+
k: () => ed.trim(),
|
|
378
|
+
f: () => ed.speed(2),
|
|
379
|
+
m: () => ed.toggleMute(),
|
|
380
|
+
Delete: () => ed.removeSelected(),
|
|
381
|
+
Backspace: () => ed.removeSelected(),
|
|
382
|
+
ArrowLeft: () => ed.nudge(e.shiftKey ? -0.1 : -1),
|
|
383
|
+
ArrowRight: () => ed.nudge(e.shiftKey ? 0.1 : 1),
|
|
384
|
+
Escape: () => (ed.tool !== 'select' ? ed.setTool('select') : ed.selected !== null ? ed.select(null) : ed.clearMarks()),
|
|
385
|
+
}
|
|
386
|
+
const run = tool ? () => ed.setTool(tool) : act[e.key]
|
|
387
|
+
if (!run) return
|
|
388
|
+
e.preventDefault()
|
|
389
|
+
run()
|
|
390
|
+
}
|
|
391
|
+
window.addEventListener('keydown', key)
|
|
392
|
+
return () => window.removeEventListener('keydown', key)
|
|
393
|
+
}, [ed])
|
|
394
|
+
return (
|
|
395
|
+
<div className="rced">
|
|
396
|
+
<div className="rctoolbar">
|
|
397
|
+
<input className="rcrename" value={name} aria-label="its name" onChange={(e) => setName(e.currentTarget.value)} onBlur={() => void st.rename(r, name)} onKeyDown={(e) => { if (e.key === 'Enter') e.currentTarget.blur() }} title="its name: what a trailer, a link and this page say" />
|
|
398
|
+
<select className="rcrepo" value={r.repo} aria-label="the repo it belongs to" title="the repo it belongs to: a trailer of that repo names it by its name" onChange={(e) => void st.move(r, e.currentTarget.value)}>
|
|
399
|
+
{[...new Set([r.repo, ...(st.data?.repos ?? [])])].map((x) => <option key={x} value={x}>{x}</option>)}
|
|
400
|
+
</select>
|
|
401
|
+
<span className="rcgroup" role="toolbar" aria-label="tools">
|
|
402
|
+
{TOOLS.map((t) => (
|
|
403
|
+
<button key={t} type="button" className={`rctool${ed.tool === t ? ' on' : ''}`} onClick={() => ed.setTool(t)} data-tip={toolTip(t)} aria-label={toolTip(t)}>{TOOL_WORDS[t].label}</button>
|
|
404
|
+
))}
|
|
405
|
+
</span>
|
|
406
|
+
<span className="rcgroup" role="radiogroup" aria-label="colour">
|
|
407
|
+
{COLORS.map((c) => <button key={c} type="button" className={`rcswatch${ed.color === c ? ' on' : ''}`} style={{ background: HEX[c] }} data-tip={c} aria-label={c} onClick={() => ed.setColor(c)} />)}
|
|
408
|
+
</span>
|
|
409
|
+
<span className="rcgroup">
|
|
410
|
+
<button type="button" className="rctool" disabled={!ed.canUndo} onClick={() => ed.undo()} data-tip="Undo · ⌘Z" aria-label="undo">↶</button>
|
|
411
|
+
<button type="button" className="rctool" onClick={() => ed.redo()} data-tip="Redo · ⌘⇧Z" aria-label="redo">↷</button>
|
|
412
|
+
{ed.selected !== null ? <button type="button" className="rctool" onClick={() => ed.removeSelected()} data-tip="Remove the mark picked · Delete" aria-label="remove the mark">✕</button> : null}
|
|
413
|
+
{ed.edit.crop ? <button type="button" className="rctool" onClick={() => ed.setCrop(null)} data-tip="No crop: the whole frame again" aria-label="no crop">⌗✕</button> : null}
|
|
414
|
+
</span>
|
|
415
|
+
<span className="sp" />
|
|
416
|
+
{st.current && !st.current.up ? <span className="rcup" data-tip="its links work once it is up; editing does not wait"><span className="acring on">↻</span> uploading…</span> : null}
|
|
417
|
+
{solo ? <ThumbActions st={st} r={r} /> : null}
|
|
418
|
+
<span className="acdim rcinfo">{r.repo} · {length(r)} · {r.width}×{r.height}{r.audio ? ' · sound' : ''}</span>
|
|
419
|
+
<button type="button" className={`ghost hsm${showText ? ' on' : ''}`} onClick={() => setShowText(!showText)} title="the edit as text, the same one every tool writes">text</button>
|
|
420
|
+
<button type="button" className="hbtn" disabled={!ed.dirty || ed.exporting || ed.parsed.error !== ''} onClick={() => void ed.save()} title="render the edit into what plays and shares (⌘S); the take never changes">
|
|
421
|
+
{ed.exporting ? 'exporting…' : ed.dirty ? 'export' : 'exported'}
|
|
422
|
+
</button>
|
|
423
|
+
</div>
|
|
424
|
+
<Stage ed={ed} />
|
|
425
|
+
{r.still ? null : (
|
|
426
|
+
<>
|
|
427
|
+
<Timeline ed={ed} />
|
|
428
|
+
<div className="rctransport">
|
|
429
|
+
<button type="button" className="acpill" onClick={() => ed.toggle()} title="play or pause, the edit previewed (space)">{ed.playing ? '❚❚' : '▶'}</button>
|
|
430
|
+
<span className="rctime">{printTime(ed.time)} / {printTime(ed.length)}</span>
|
|
431
|
+
<button type="button" className="acpill" onClick={() => ed.setIn()} title="a part starts here (i)">in</button>
|
|
432
|
+
<button type="button" className="acpill" onClick={() => ed.setOut()} title="the part ends here (o)">out</button>
|
|
433
|
+
<button type="button" className="acpill" disabled={!ed.selection} onClick={() => ed.cut()} title="take the marked part out (x)">cut</button>
|
|
434
|
+
<button type="button" className="acpill" disabled={!ed.selection} onClick={() => ed.trim()} title="keep only the marked part (k)">keep only</button>
|
|
435
|
+
<button type="button" className="acpill" disabled={!ed.selection} onClick={() => ed.speed(2)} title="the marked part twice as fast (f)">2×</button>
|
|
436
|
+
<button type="button" className="acpill" disabled={!ed.selection} onClick={() => ed.speed(1)} title="the marked part at its own speed">1×</button>
|
|
437
|
+
<button type="button" className={`acpill${ed.edit.mute ? ' on' : ''}`} disabled={!r.audio} onClick={() => ed.toggleMute()} title="no sound in the export (m)">mute</button>
|
|
438
|
+
</div>
|
|
439
|
+
</>
|
|
440
|
+
)}
|
|
441
|
+
{showText || ed.parsed.error ? (
|
|
442
|
+
<div className="rcedit">
|
|
443
|
+
<textarea value={ed.text} spellCheck={false} rows={4} aria-label="the edit as text" placeholder={'keep 0:01.5-0:12\narrow 100,200 400,300 red 0:02-0:05\ntext 120,80 "here" white'} onChange={(e) => ed.setText(e.currentTarget.value)} />
|
|
444
|
+
{ed.parsed.error ? <span className="rcerr">{ed.parsed.error}</span> : null}
|
|
445
|
+
</div>
|
|
446
|
+
) : null}
|
|
447
|
+
</div>
|
|
448
|
+
)
|
|
449
|
+
})
|
|
450
|
+
|
|
451
|
+
// ---- the page
|
|
452
|
+
|
|
453
|
+
export const RecordingsView = observer(({ app, solo }: { app: HomeSt; solo?: boolean }) => {
|
|
454
|
+
const st = app.recordings
|
|
455
|
+
const d = st.data
|
|
456
|
+
const ed = st.editor
|
|
457
|
+
// the recorder's editor window: the capture alone, its share buttons in the toolbar, no list around it
|
|
458
|
+
useEffect(() => {
|
|
459
|
+
if (solo) st.fromHash(location.hash)
|
|
460
|
+
}, [solo, st])
|
|
461
|
+
if (solo)
|
|
462
|
+
return (
|
|
463
|
+
<div className="hall recordings rcapp rcsolo">
|
|
464
|
+
{st.said ? <div className="rcsaid">{st.said}</div> : null}
|
|
465
|
+
{st.error !== '' ? <div className="hnote">{st.error}</div> : null}
|
|
466
|
+
{ed != null ? <Editor key={`${ed.rec.repo}/${ed.rec.id}`} st={st} ed={ed} solo /> : <p className="acdim rcempty">{d == null || st.loading ? 'reading…' : 'no such capture'}</p>}
|
|
467
|
+
</div>
|
|
468
|
+
)
|
|
469
|
+
return (
|
|
470
|
+
<div className="hall recordings rcapp">
|
|
471
|
+
<div className="rctop">
|
|
472
|
+
<div className="seg" role="radiogroup" aria-label="which repo">
|
|
473
|
+
<button role="radio" aria-checked={st.repo === ''} className={st.repo === '' ? 'on' : ''} onClick={() => st.setRepo('')}>all</button>
|
|
474
|
+
{st.repos.map((r) => <button key={r} role="radio" aria-checked={st.repo === r} className={st.repo === r ? 'on' : ''} onClick={() => st.setRepo(r)}>{r}</button>)}
|
|
475
|
+
</div>
|
|
476
|
+
{(d?.presets ?? []).map((p) => (
|
|
477
|
+
<button key={p.id} type="button" className="acpill" disabled={st.busy !== ''} onClick={() => void st.record(p.id)} title={`run ${p.id} in the recorder; the take goes to ${st.repo || d?.repo || 'the menu\'s repo'}`}>
|
|
478
|
+
<span className="rcdot">●</span> {p.label}{p.key ? <span className="acdim"> {p.key.replace('alt', '⌥').replace('shift', '⇧').replace('cmd', '⌘').replace('ctrl', '⌃').replace(/\+/g, '').toUpperCase()}</span> : null}
|
|
479
|
+
</button>
|
|
480
|
+
))}
|
|
481
|
+
<span className="sp" />
|
|
482
|
+
{st.said ? <span className="rcsaid">{st.said}</span> : null}
|
|
483
|
+
<button type="button" className={`acpill${st.gallery ? ' on' : ''}`} onClick={() => st.setGallery(!st.gallery)} title="every capture at once, big">▦ gallery</button>
|
|
484
|
+
<button type="button" className="acpill" disabled={st.loading} onClick={() => void st.load()} title="read the captures again">
|
|
485
|
+
<span className={`acring${st.loading ? ' on' : ''}`}>↻</span>
|
|
486
|
+
</button>
|
|
487
|
+
</div>
|
|
488
|
+
{st.error !== '' ? <div className="hnote">{st.error}</div> : null}
|
|
489
|
+
{(d?.problems ?? []).map((p) => <div key={p} className="hnote">{p}</div>)}
|
|
490
|
+
{st.gallery ? (
|
|
491
|
+
<div className="rcgallery">{st.shown.map((r) => <Thumb key={`${r.repo}/${r.id}`} st={st} r={r} big />)}</div>
|
|
492
|
+
) : ed != null ? (
|
|
493
|
+
<Editor key={`${ed.rec.repo}/${ed.rec.id}`} st={st} ed={ed} />
|
|
494
|
+
) : st.open != null && d != null && st.loading ? (
|
|
495
|
+
<p className="acdim rcempty">reading…</p>
|
|
496
|
+
) : st.open != null && d != null ? (
|
|
497
|
+
<div className="hnote">no capture {st.open.repo}/{st.open.id}: it was renamed away or deleted</div>
|
|
498
|
+
) : d != null ? (
|
|
499
|
+
<p className="acdim rcempty">no capture yet: a record button above, or its hotkey from any app</p>
|
|
500
|
+
) : null}
|
|
501
|
+
{st.gallery ? null : <Strip st={st} />}
|
|
502
|
+
</div>
|
|
503
|
+
)
|
|
504
|
+
})
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* the Recordings page (recordings-view.tsx): one editor window, the height of the page. The top row (repo, record,
|
|
2
|
+
gallery), the toolbar, the stage that takes all the room left, a video's timeline and transport, the strip */
|
|
3
|
+
.rcapp{display:flex;flex-direction:column;gap:var(--s2);height:100%;box-sizing:border-box;overflow:hidden;padding:var(--s2) var(--s3)}
|
|
4
|
+
.rctop{display:flex;align-items:center;gap:var(--s1);flex-wrap:wrap}
|
|
5
|
+
.rctop .sp,.rctoolbar .sp{flex:1}
|
|
6
|
+
.rcdot{color:var(--red)}
|
|
7
|
+
.rcsaid{color:var(--ok);font-size:12px}
|
|
8
|
+
.rcempty{flex:1}
|
|
9
|
+
.rcapp .acpill.on{color:var(--accent);border-color:var(--accent)}
|
|
10
|
+
|
|
11
|
+
.rced{flex:1;min-height:0;display:flex;flex-direction:column;gap:var(--s1)}
|
|
12
|
+
.rctoolbar{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap}
|
|
13
|
+
.rcrename{height:24px;width:200px;max-width:100%;box-sizing:border-box;background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:4px;padding:0 var(--s2);font:inherit;font-weight:650}
|
|
14
|
+
.rcrename:focus{outline:none;border-color:var(--accent)}
|
|
15
|
+
.rcrepo{height:24px;background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:4px;font:inherit;font-size:12px}
|
|
16
|
+
.rcgroup{display:inline-flex;align-items:center;gap:var(--s0)}
|
|
17
|
+
.rctool{min-width:28px;height:26px;padding:0 var(--s1);border:1px solid var(--line);border-radius:4px;background:var(--bg);color:var(--ink);font-size:14px;line-height:1;cursor:pointer}
|
|
18
|
+
.rctool:hover{border-color:var(--accent)}
|
|
19
|
+
.rctool.on{background:var(--accent);border-color:var(--accent);color:var(--bg)}
|
|
20
|
+
.rctool:disabled{opacity:.4;cursor:default}
|
|
21
|
+
.rcswatch{width:18px;height:18px;border-radius:50%;border:2px solid var(--line);padding:0;cursor:pointer}
|
|
22
|
+
.rcswatch.on{border-color:var(--ink);box-shadow:0 0 0 2px var(--accent)}
|
|
23
|
+
.rcinfo{font-size:11.5px}
|
|
24
|
+
.rcapp .ghost.on{color:var(--accent)}
|
|
25
|
+
|
|
26
|
+
.rcstage{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;background:var(--chk2);border-radius:4px;overflow:hidden}
|
|
27
|
+
.rccanvas{position:relative;flex:none}
|
|
28
|
+
.rccanvas.grown{background:repeating-conic-gradient(var(--chk1) 0% 25%,var(--chk2) 0% 50%) 0 0/16px 16px;outline:1px dashed var(--hair)}
|
|
29
|
+
.rcframe{position:absolute;background:var(--solid)}
|
|
30
|
+
.rcframe video,.rcframe img{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;display:block}
|
|
31
|
+
.rcdraw{position:absolute;inset:0;pointer-events:none}
|
|
32
|
+
.rcstage{touch-action:none}
|
|
33
|
+
.rcstage.t-select{cursor:default}
|
|
34
|
+
.rcstage.t-arrow,.rcstage.t-rect,.rcstage.t-blur,.rcstage.t-crop,.rcstage.t-step{cursor:crosshair}
|
|
35
|
+
.rcstage.t-text{cursor:text}
|
|
36
|
+
.rcblur{position:absolute;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);pointer-events:none}
|
|
37
|
+
.rctyping{position:absolute;min-width:160px;background:var(--scrim);border:1px dashed var(--tag);border-radius:2px;padding:0 var(--s1);font:600 18px -apple-system,Helvetica,sans-serif;outline:none}
|
|
38
|
+
|
|
39
|
+
.rctl{display:flex;flex-direction:column;gap:var(--s0)}
|
|
40
|
+
.rcline{position:relative;height:26px;border:1px solid var(--line);border-radius:4px;background:var(--chk2);cursor:pointer;touch-action:none}
|
|
41
|
+
.rcout{position:absolute;top:0;bottom:0;background:var(--hi2)}
|
|
42
|
+
.rckeep{position:absolute;top:0;bottom:0;background:var(--wash);border-left:1px solid var(--hair);border-right:1px solid var(--hair)}
|
|
43
|
+
.rcspeed{position:absolute;bottom:0;height:10px;background:var(--warn);color:var(--solid);font-size:9px;line-height:10px;text-align:center;opacity:.8}
|
|
44
|
+
.rcsel{position:absolute;top:0;bottom:0;background:var(--hi2);border-left:2px solid var(--accent);border-right:2px solid var(--accent)}
|
|
45
|
+
.rcmark{position:absolute;top:0;bottom:0;width:2px;transform:translateX(-50%);background:var(--accent)}
|
|
46
|
+
.rchead{position:absolute;top:0;bottom:0;width:2px;transform:translateX(-50%);background:var(--red);pointer-events:none}
|
|
47
|
+
.rchandle{position:absolute;top:-2px;bottom:-2px;width:8px;transform:translateX(-100%);background:var(--warn);border-radius:3px 0 0 3px;cursor:ew-resize}
|
|
48
|
+
.rchandle.end{transform:none;border-radius:0 3px 3px 0}
|
|
49
|
+
.rclane{position:relative;height:12px}
|
|
50
|
+
.rcspan{position:absolute;top:2px;bottom:2px;border-radius:3px;opacity:.75;cursor:grab;display:flex;align-items:center;overflow:hidden;touch-action:none}
|
|
51
|
+
.rclane.on .rcspan{opacity:1;outline:2px solid var(--accent)}
|
|
52
|
+
.rcspan b{flex:1;font-size:9px;line-height:8px;font-weight:600;color:var(--solid);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 var(--s1)}
|
|
53
|
+
.rcedge{width:6px;align-self:stretch;cursor:ew-resize;background:var(--hi1)}
|
|
54
|
+
.rctransport{display:flex;align-items:center;gap:var(--s1);flex-wrap:wrap}
|
|
55
|
+
.rctime{font:12px ui-monospace,monospace;color:var(--dim);margin:0 var(--s2);font-variant-numeric:tabular-nums}
|
|
56
|
+
.rcedit{display:flex;gap:var(--s2);align-items:flex-start}
|
|
57
|
+
.rcedit textarea{flex:1;min-width:0;box-sizing:border-box;background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:4px;padding:var(--s1) var(--s2);font:12.5px/1.5 ui-monospace,monospace;resize:vertical}
|
|
58
|
+
.rcerr{color:var(--red);font-size:12px;max-width:320px}
|
|
59
|
+
|
|
60
|
+
.rcstrip{flex:none;display:flex;gap:var(--s2);overflow-x:auto;padding:var(--s1) 0 var(--s0);border-top:1px solid var(--line)}
|
|
61
|
+
.rcthumb{position:relative;flex:none;width:150px;display:flex;flex-direction:column;gap:var(--s0);padding:var(--s1);border:1px solid var(--line);border-radius:4px;background:var(--bg);cursor:pointer}
|
|
62
|
+
.rcthumb:hover{border-color:var(--hair)}
|
|
63
|
+
.rcthumb.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
|
|
64
|
+
.rcthumb img{width:100%;aspect-ratio:16/10;object-fit:contain;background:var(--chk2);border-radius:2px}
|
|
65
|
+
.rctname{font-size:12px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
66
|
+
.rctname i{color:var(--warn);font-style:normal}
|
|
67
|
+
.rctmeta{font-size:10.5px;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
68
|
+
.rcacts{display:flex;gap:var(--s0)}
|
|
69
|
+
.rcacts button{flex:1;height:20px;padding:0;border:1px solid var(--line);border-radius:3px;background:var(--panel2);color:var(--ink);font-size:11px;cursor:pointer}
|
|
70
|
+
.rcacts button:hover{border-color:var(--accent)}
|
|
71
|
+
.rcacts button.rcarmed{flex:2;background:var(--red);border-color:var(--red);color:var(--bg)}
|
|
72
|
+
.rcgallery{flex:1;min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:var(--s3);align-content:start}
|
|
73
|
+
.rcthumb.big{width:auto}
|
|
74
|
+
.rcsolo{position:fixed;inset:0;background:var(--bg)}
|
|
75
|
+
.rcsolo .rcsaid{position:absolute;right:var(--s3);bottom:var(--s2);z-index:2}
|
|
76
|
+
.rctoolbar .rcacts{flex:none}
|
|
77
|
+
.rctoolbar .rcacts button{flex:none;width:30px;height:24px;font-size:13px}
|
|
78
|
+
/* instant tooltips: the native one waits a second; these show on hover at once */
|
|
79
|
+
.rcapp [data-tip]{position:relative}
|
|
80
|
+
.rcapp [data-tip]:hover::after{content:attr(data-tip);position:absolute;top:calc(100% + var(--s1));left:50%;transform:translateX(-50%);z-index:20;white-space:nowrap;padding:var(--s1) var(--s2);border-radius:4px;background:var(--ink);color:var(--bg);font:500 11.5px -apple-system,Helvetica,sans-serif;pointer-events:none}
|
|
81
|
+
.rcstrip [data-tip]:hover::after{top:auto;bottom:calc(100% + var(--s1))}
|
|
82
|
+
.rcup{display:inline-flex;align-items:center;gap:var(--s1);font-size:11.5px;color:var(--warn)}
|
|
@@ -43,7 +43,7 @@ export type Sel = HashSel | null
|
|
|
43
43
|
|
|
44
44
|
/** one picker target (cmd+j): run() fires the SAME action clicking would */
|
|
45
45
|
/** what a picker entry wears: a repo's own icon, or a place's button icon */
|
|
46
|
-
export type JumpFace = { repo: string } | { place: 'home' | 'inbox' | 'planned' | 'activity' | 'insights' | 'archived' } | { identity: string; account?: string }
|
|
46
|
+
export type JumpFace = { repo: string } | { place: 'home' | 'inbox' | 'planned' | 'activity' | 'insights' | 'recordings' | 'archived' } | { identity: string; account?: string }
|
|
47
47
|
/** `key`: the shortcut that does the same, printed at the entry's end */
|
|
48
48
|
export type Jump = { id: string; label: string; section: string; run: () => void; face?: JumpFace; key?: string }
|
|
49
49
|
|
|
@@ -340,6 +340,7 @@ const DraftBox = observer(({ tr }: { tr: TrailerSt }) => {
|
|
|
340
340
|
}
|
|
341
341
|
}} />
|
|
342
342
|
{tr.error ? <div className="rv-err">{tr.error}</div> : null}
|
|
343
|
+
{tr.said ? <div className="tr-dim">{tr.said}</div> : null}
|
|
343
344
|
<div className="tr-dim tr-small">Enter saves · Shift Enter a new line · Escape drops it</div>
|
|
344
345
|
<div className="tr-draftbtns">
|
|
345
346
|
<button onClick={() => tr.cancelDraft()}>Cancel</button>
|
|
@@ -113,6 +113,8 @@ export class TrailerSt {
|
|
|
113
113
|
zoom = 1
|
|
114
114
|
saving = false
|
|
115
115
|
error: string | null = null
|
|
116
|
+
/** what the last action said that is no error (a shot asked of the recorder) */
|
|
117
|
+
said: string | null = null
|
|
116
118
|
/** the montage page of the cut on screen, its markdown, once asked */
|
|
117
119
|
montage: { key: string; md: string | null } | null = null
|
|
118
120
|
montageOpen = false
|
|
@@ -816,6 +818,20 @@ export class TrailerSt {
|
|
|
816
818
|
}
|
|
817
819
|
}
|
|
818
820
|
|
|
821
|
+
/** a `film recording` shot shot again: the recorder app takes it as long as the shot, at the cut's size for a
|
|
822
|
+
* window, and files the new take under the old name (the home's recordings route) */
|
|
823
|
+
async shootAgain(shot: Pick<ShotSpan, 'recording' | 'length'>): Promise<void> {
|
|
824
|
+
const tl = this.timeline
|
|
825
|
+
if (!shot.recording || !tl) return
|
|
826
|
+
this.error = null
|
|
827
|
+
try {
|
|
828
|
+
const r = await send<{ said: string }>('/api/home/recordings/reshoot', 'POST', { ref: shot.recording, repo: this.st.key, seconds: shot.length, size: `${tl.size[0]}x${tl.size[1]}` })
|
|
829
|
+
runInAction(() => (this.said = r.said))
|
|
830
|
+
} catch (e) {
|
|
831
|
+
runInAction(() => (this.error = `shoot again: ${(e as Error).message}`))
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
819
835
|
/** the render on screen shown in the Finder */
|
|
820
836
|
async reveal(): Promise<void> {
|
|
821
837
|
const s = this.shown
|