deictic 0.1.0 → 0.3.0
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/API.md +303 -0
- package/README.md +56 -104
- package/dist/annotations/index.d.ts +1 -1
- package/dist/astro.d.ts +1 -1
- package/dist/bun.d.ts +1 -1
- package/dist/bun.js +2 -2
- package/dist/client/index.d.ts +4 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +130 -16
- package/dist/client/index.js.map +1 -1
- package/dist/index.d.ts +21 -218
- package/dist/index.js.map +1 -1
- package/dist/loader.js +1 -1
- package/dist/logs/client.d.ts +4 -0
- package/dist/logs/client.d.ts.map +1 -0
- package/dist/logs/client.js +16 -0
- package/dist/logs/client.js.map +1 -0
- package/dist/logs/index.d.ts +18 -0
- package/dist/logs/index.d.ts.map +1 -0
- package/dist/logs/index.js +21 -0
- package/dist/logs/index.js.map +1 -0
- package/dist/network/client.d.ts +4 -0
- package/dist/network/client.d.ts.map +1 -0
- package/dist/network/client.js +29 -0
- package/dist/network/client.js.map +1 -0
- package/dist/network/index.d.ts +2 -0
- package/dist/network/index.js +39 -0
- package/dist/network/index.js.map +1 -0
- package/dist/next.d.ts +1 -1
- package/dist/next.js +2 -2
- package/dist/recommended/index.d.ts +15 -5
- package/dist/recommended/index.d.ts.map +1 -1
- package/dist/recommended/index.js +10 -3
- package/dist/recommended/index.js.map +1 -1
- package/dist/recordings/client.d.ts +1 -1
- package/dist/recordings/client.d.ts.map +1 -1
- package/dist/recordings/client.js +177 -48
- package/dist/recordings/client.js.map +1 -1
- package/dist/recordings/index.d.ts +2 -2
- package/dist/recordings/index.js +3 -3
- package/dist/screenshots/client.d.ts +7 -1
- package/dist/screenshots/client.d.ts.map +1 -1
- package/dist/screenshots/client.js +36 -4
- package/dist/screenshots/client.js.map +1 -1
- package/dist/screenshots/dom.d.ts +1 -1
- package/dist/screenshots/dom.d.ts.map +1 -1
- package/dist/screenshots/dom.js +1 -28
- package/dist/screenshots/dom.js.map +1 -1
- package/dist/screenshots/index.d.ts +1 -1
- package/dist/screenshots/index.js +2 -2
- package/dist/screenshots/index.js.map +1 -1
- package/dist/screenshots/rrweb.d.ts +2 -2
- package/dist/screenshots/rrweb.js +5 -1
- package/dist/screenshots/rrweb.js.map +1 -1
- package/dist/{endpoints.js → shared/endpoints.js} +1 -1
- package/dist/shared/endpoints.js.map +1 -0
- package/dist/shared/index.d.ts +238 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/{index3.d.ts → shared/index2.d.ts} +3 -1
- package/dist/shared/index2.d.ts.map +1 -0
- package/dist/shared/index3.d.ts +112 -0
- package/dist/shared/index3.d.ts.map +1 -0
- package/dist/shared/index4.d.ts +64 -0
- package/dist/shared/index4.d.ts.map +1 -0
- package/dist/shared/index5.d.ts +220 -0
- package/dist/shared/index5.d.ts.map +1 -0
- package/dist/{index5.d.ts → shared/index6.d.ts} +2 -2
- package/dist/shared/index6.d.ts.map +1 -0
- package/dist/{integration.d.ts → shared/integration.d.ts} +4 -3
- package/dist/shared/integration.d.ts.map +1 -0
- package/dist/{integration.js → shared/integration.js} +5 -3
- package/dist/shared/integration.js.map +1 -0
- package/dist/{kept.js → shared/kept.js} +2 -2
- package/dist/shared/kept.js.map +1 -0
- package/dist/{marks.js → shared/marks.js} +6 -1
- package/dist/shared/marks.js.map +1 -0
- package/dist/shared/mask.js +107 -0
- package/dist/shared/mask.js.map +1 -0
- package/dist/{playwright.js → shared/playwright.js} +19 -4
- package/dist/shared/playwright.js.map +1 -0
- package/dist/shared/recordings.js +437 -0
- package/dist/shared/recordings.js.map +1 -0
- package/dist/shared/shortcut.js.map +1 -0
- package/dist/shared/tasks.js +632 -0
- package/dist/shared/tasks.js.map +1 -0
- package/dist/shared/waveform.js.map +1 -0
- package/dist/tailwind/client.d.ts +1 -1
- package/dist/tailwind/index.d.ts +1 -1
- package/dist/tasks/client.d.ts +1 -1
- package/dist/tasks/client.d.ts.map +1 -1
- package/dist/tasks/client.js +272 -57
- package/dist/tasks/client.js.map +1 -1
- package/dist/tasks/index.d.ts +2 -159
- package/dist/tasks/index.js +1 -348
- package/dist/vite.d.ts +11 -12
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +21 -4
- package/dist/vite.js.map +1 -1
- package/dist/voice/client.d.ts.map +1 -1
- package/dist/voice/client.js +36 -15
- package/dist/voice/client.js.map +1 -1
- package/dist/voice/index.d.ts +6 -1
- package/dist/voice/index.d.ts.map +1 -1
- package/dist/voice/index.js +13 -3
- package/dist/voice/index.js.map +1 -1
- package/dist/webpack.d.ts +1 -1
- package/dist/webpack.js +2 -2
- package/package.json +41 -2
- package/skills/deictic/SKILL.md +20 -14
- package/skills/deictic/references/install.md +32 -10
- package/skills/deictic/references/recordings.md +29 -0
- package/skills/deictic/references/tasks.md +49 -21
- package/skills/deictic/references/watch.md +38 -11
- package/skills/deictic/scripts/lib.mjs +88 -4
- package/skills/deictic/scripts/recording.mjs +84 -4
- package/skills/deictic/scripts/task.mjs +36 -7
- package/skills/deictic/scripts/vb.mjs +12 -0
- package/skills/deictic/scripts/watch.mjs +74 -10
- package/src/client/away.ts +105 -0
- package/src/client/index.ts +60 -16
- package/src/client/style.ts +1 -0
- package/src/index.ts +21 -2
- package/src/plugins/logs/client.ts +18 -0
- package/src/plugins/logs/index.ts +55 -0
- package/src/plugins/network/client.ts +30 -0
- package/src/plugins/network/index.ts +69 -0
- package/src/plugins/network/mask.ts +133 -0
- package/src/plugins/recommended/index.ts +14 -1
- package/src/plugins/recordings/client.ts +220 -40
- package/src/plugins/recordings/index.ts +111 -25
- package/src/plugins/recordings/marks.ts +6 -0
- package/src/plugins/recordings/replay.ts +159 -10
- package/src/plugins/screenshots/client.ts +38 -2
- package/src/plugins/screenshots/dom.ts +1 -32
- package/src/plugins/screenshots/index.ts +2 -0
- package/src/plugins/screenshots/playwright.ts +15 -4
- package/src/plugins/screenshots/rrweb.ts +2 -1
- package/src/plugins/tasks/client.ts +273 -41
- package/src/plugins/tasks/index.ts +207 -47
- package/src/plugins/tasks/local.ts +170 -0
- package/src/plugins/tasks/watchers.ts +36 -0
- package/src/plugins/voice/client.ts +33 -10
- package/src/plugins/voice/index.ts +21 -4
- package/src/tools/integration.ts +5 -3
- package/src/tools/kept.ts +2 -2
- package/src/vite.ts +23 -4
- package/dist/endpoints.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index2.d.ts +0 -23
- package/dist/index3.d.ts.map +0 -1
- package/dist/index4.d.ts +0 -74
- package/dist/index4.d.ts.map +0 -1
- package/dist/index5.d.ts.map +0 -1
- package/dist/integration.d.ts.map +0 -1
- package/dist/integration.js.map +0 -1
- package/dist/kept.js.map +0 -1
- package/dist/marks.js.map +0 -1
- package/dist/playwright.js.map +0 -1
- package/dist/recordings.js +0 -235
- package/dist/recordings.js.map +0 -1
- package/dist/shortcut.js.map +0 -1
- package/dist/tasks/index.d.ts.map +0 -1
- package/dist/tasks/index.js.map +0 -1
- package/dist/waveform.js.map +0 -1
- /package/dist/{shortcut.js → shared/shortcut.js} +0 -0
- /package/dist/{waveform.js → shared/waveform.js} +0 -0
package/dist/tasks/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":[],"sources":["../../src/plugins/tasks/client.ts"],"sourcesContent":["/**\n * The tasks panel: the tasks already about this element and their state, and a field to add one. Each\n * task's ID opens it on the board, where the board has a page; one no one has claimed yet can be edited\n * in place (its words) or deleted (canceled on the board), both changes the popup's undo takes back.\n * Ctrl+Enter or Add sends it with the page's URL, the viewport and the element as it rendered, which\n * the source can't tell; and where the annotations plugin is loaded, what's marked on the page.\n *\n * Where the screenshots plugin is loaded, a shot of the page goes with it, unless that's unticked. With\n * the annotations plugin too, Annotate takes the shot now and opens it to draw on: saved, it's a chip\n * under the field, which opens it again to change the marks, and Add another takes one more. Any chip\n * (a recording's too) takes the box's place; removing the last brings it back unticked, so a task goes\n * without a shot unless asked again.\n *\n * Where the recordings plugin is loaded, Record leaves the popup (`away`) to record the page, keeping\n * what's typed and attached, and comes back with the recording as a chip too, which plays it back.\n * Where the voice plugin is, Voice records the mic here in the panel: stopped, it's a chip that plays it.\n */\nimport { liveWaveform } from '#src/client/waveform.ts';\nimport { defineClientPlugin, type LightboxItem, type Target } from '#src/index.ts';\n\n// For `use()`'s types: the plugins may not be loaded, and nothing of them runs here.\nimport type { Annotation, Annotations, Picture } from '#src/plugins/annotations/index.ts';\nimport type { Recording } from '#src/plugins/recordings/index.ts';\nimport type { Shot } from '#src/plugins/screenshots/index.ts';\nimport type { Clip, Take } from '#src/plugins/voice/index.ts';\n\nimport type { Change, Marks, Model, Op, Task, TaskAdded } from './index.ts';\n\nconst STYLE = `\n.tasks { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }\n.tasks li { display: flex; gap: 6px; align-items: baseline; }\n.tasks .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.tasks .state { font: 11px ui-monospace, monospace; color: var(--deictic-muted); }\n.tasks .state.completed { color: #4ade80; }\n.tasks .state.failed { color: var(--deictic-problem); }\n.tasks a { color: inherit; text-decoration: none; }\n.tasks a:hover { text-decoration: underline; }\n.tasks .act { align-self: center; display: inline-flex; padding: 2px; border: 0; color: var(--deictic-muted); }\n.tasks .act:hover { color: var(--deictic-fg); }\n.tasks .act svg { width: 12px; height: 12px; }\n.tasks li.editing { display: grid; }\n.tasks li.editing .row { margin-top: 0; }\n.tasks li.editing .actions { display: flex; gap: 6px; }\ntextarea { min-height: 64px; resize: vertical; font: 13px/1.4 system-ui, sans-serif; }\n.row { display: flex; gap: 6px; margin-top: 8px; justify-content: space-between; align-items: center; }\n.hint { color: var(--deictic-muted); font-size: 12px; }\n.hint a { color: inherit; }\n.hint a:hover { color: var(--deictic-fg); }\n.shot { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--deictic-muted); }\n.shot label { display: flex; gap: 6px; align-items: center; }\n.shot input { width: auto; margin: 0; }\n.shot .actions { display: flex; gap: 6px; margin-left: auto; }\n.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; font-size: 12px; }\n.chip { display: inline-flex; align-items: center; border: 1px solid var(--deictic-line); border-radius: 6px; }\n.chip button { border: 0; }\n.chip .open { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; }\n.chip img { display: block; height: 28px; border-radius: 4px; }\n.chip .play { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 4px; background: var(--deictic-line); }\n.chip .play svg { width: 12px; height: 12px; }\n.chip .remove { padding: 0 6px; color: var(--deictic-muted); }\n.chip .remove:hover { color: var(--deictic-fg); }\n.voice-on { display: inline-flex; align-items: center; gap: 4px; color: #fff; background: #ef4444; border-color: #ef4444; font-variant-numeric: tabular-nums; }\n.voice-on .wave { width: 36px; height: 14px; }\n.shot-problem { margin-top: 4px; font-size: 12px; color: var(--deictic-problem); }\n.shot-problem:empty { display: none; }\n.shot[hidden], .chips[hidden], label[hidden] { display: none; }\n`;\n\nconst ICON = (path: string) =>\n `<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"${path}\"/></svg>`;\nconst EDIT = ICON('M4 20h4L19 9l-4-4L4 16z');\nconst DELETE = ICON('M4 7h16M10 7V4h4v3M6 7l1 13h10l1-13');\nconst PLAY = '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M7 4v16l13-8z\" fill=\"currentColor\"/></svg>';\n\n/** Marks as a task tells of them: how many, and what the notes say. */\nfunction marksOf(list: readonly Annotation[]): Marks {\n return { count: list.length, notes: list.flatMap(({ shape }) => (shape.kind === 'note' ? [shape.text] : [])) };\n}\n\n/** The page's annotations for the op, where there are any. */\nfunction annotationsOf(marks: Annotations | undefined): Pick<Op, 'annotations'> {\n const list = marks?.list() ?? [];\n return list.length === 0 ? {} : { annotations: marksOf(list) };\n}\n\n/** An annotated shot: the shot as taken, the marks drawn on it, and the PNG of both. */\ninterface Drawn {\n shot: Shot;\n marks: Annotation[];\n png: Blob;\n}\n\n/** A drawn shot as the panel shows it, with a URL for its thumbnail, revoked with it. */\ninterface Chip extends Drawn {\n url: string;\n}\n\n/** What the panel keeps while it's away recording: what's typed, ticked and attached. */\ninterface Kept {\n text: string;\n attach: boolean;\n drawn: Drawn[];\n recordings: Recording[];\n voices: Clip[];\n}\n\nconst clock = (ms: number) => {\n const s = Math.round(ms / 1000);\n return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')}`;\n};\n\nconst messageOf = (e: unknown) => (e instanceof Error ? e.message : String(e));\n\n/**\n * `#shadow-root > div.panel > div.head > button.tab:nth-of-type(2)`: where `inner` is inside `outer`, through\n * shadow roots, by tag, classes and, among siblings alike, place, for whoever finds it in the code.\n */\nfunction pathTo(inner: Element, outer: Element): string {\n const steps: string[] = [];\n for (let at: Element | undefined = inner; at !== undefined && at !== outer;) {\n const nameOf = (el: Element) => `${el.localName}${[...el.classList].map((c) => `.${c}`).join('')}`;\n const name = nameOf(at);\n const siblings = at.parentElement === null ? [] : [...at.parentElement.children];\n // Its place only where a sibling reads the same.\n const same = siblings.filter((c) => nameOf(c) === name).length > 1;\n const alike = siblings.filter((c) => c.localName === at!.localName);\n steps.unshift(same ? `${name}:nth-of-type(${alike.indexOf(at) + 1})` : name);\n if (at.parentElement !== null) {\n at = at.parentElement;\n } else {\n const root = at.getRootNode();\n if (!(root instanceof ShadowRoot)) break;\n steps.unshift('#shadow-root');\n at = root.host;\n }\n }\n return steps.join(' > ');\n}\n\nfunction element<K extends keyof HTMLElementTagNameMap>(tag: K, props: Partial<HTMLElementTagNameMap[K]> = {}): HTMLElementTagNameMap[K] {\n return Object.assign(document.createElement(tag), props);\n}\n\n/** The event the page hears of each added task by, on `window`: its `detail` is a `TaskAdded`. */\nexport const TASK_ADDED = 'deictic:task';\n\n/** Tells the page of a task just added: the newest of the element's tasks, as the board answered them. */\nfunction announce(model: Model, op: Op, target: Target): void {\n const task = model.tasks.at(-1);\n if (task === undefined) return;\n const marks = (op.annotations?.count ?? 0) + (op.screenshots ?? []).reduce((n, shot) => n + (shot.marks?.count ?? 0), 0);\n const detail: TaskAdded = {\n id: task.id,\n title: task.title,\n state: task.state,\n channel: model.channel,\n target,\n page: op.page,\n attached: {\n screenshots: op.screenshots?.length ?? 0,\n recordings: op.recordings?.length ?? 0,\n voice: op.voice?.length ?? 0,\n marks,\n },\n };\n window.dispatchEvent(new CustomEvent(TASK_ADDED, { detail }));\n}\n\nexport default defineClientPlugin<Model, Change>({\n name: 'tasks',\n label: 'Task',\n mount: (panel, context) => {\n const style = element('style', { textContent: STYLE });\n const list = element('ul', { className: 'tasks' });\n const text = element('textarea', { placeholder: 'What should change here?' });\n const add = element('button', { type: 'button', className: 'primary', textContent: 'Add task' });\n const hint = element('span', { className: 'hint' });\n const row = element('div', { className: 'row' });\n row.append(hint, add);\n panel.append(style, list, text);\n\n const shots = context.use('screenshots');\n const notes = context.use('annotations');\n const recorder = context.use('recordings');\n const voice = context.use('voice');\n // Closes an open editor with the panel.\n const aborts = new AbortController();\n\n const attach = element('input', { type: 'checkbox', checked: true });\n const toggle = element('label', { hidden: shots === undefined });\n toggle.append(attach, 'Attach a screenshot');\n const annotate = element('button', { type: 'button', textContent: 'Annotate', title: 'Take the screenshot now and draw on it' });\n const record = element('button', {\n type: 'button',\n textContent: 'Record',\n title: 'Record the page, with a toolbar to draw on it, then come back here',\n });\n const speak = element('button', { type: 'button', textContent: 'Voice', title: 'Record your voice, here' });\n const actions = element('span', { className: 'actions' });\n actions.append(...(shots !== undefined && notes !== undefined ? [annotate] : []));\n const shot = element('div', { className: 'shot' });\n shot.append(toggle, actions);\n const chipsEl = element('div', { className: 'chips' });\n const another = element('button', { type: 'button', textContent: 'Add another', title: 'Take another screenshot and draw on it' });\n const problem = element('div', { className: 'shot-problem' });\n if (shots !== undefined || recorder !== undefined || voice !== undefined) panel.append(shot, chipsEl, problem);\n panel.append(row);\n\n let chips: Chip[] = [];\n let recordings: Recording[] = [];\n let voices: Clip[] = [];\n let busy = false;\n const attachedCount = () => chips.length + recordings.length + voices.length;\n // A task goes with words, or with something attached that says it; not while one is going.\n let sending = false;\n const able = () => (add.disabled = sending || (text.value.trim() === '' && attachedCount() === 0));\n // Record and Voice, where their plugins are: beside Annotate, or after the chips while the box is away.\n const more = () => [...(recorder !== undefined ? [record] : []), ...(voice !== undefined ? [speak] : [])];\n const chip = (content: (string | Node)[], title: string, at: number, remove: string, drop: () => void) => {\n const opener = element('button', { type: 'button', className: 'open', title });\n opener.append(...content);\n // Every attachment in one lightbox, opened at this one, growing out of its chip.\n opener.addEventListener('click', () => context.lightbox(viewed(), { at, from: el }));\n const remover = element('button', { type: 'button', className: 'remove', textContent: '×', title: remove });\n remover.addEventListener('click', drop);\n const el = element('span', { className: 'chip' });\n el.append(opener, remover);\n return el;\n };\n const shotName = (i: number) => `Screenshot ${i + 1}`;\n const recordingName = (i: number) => (recordings.length === 1 ? 'Recording' : `Recording ${i + 1}`);\n const voiceName = (i: number) => (voices.length === 1 ? 'Voice' : `Voice ${i + 1}`);\n /** What's attached, as the lightbox shows it, in the chips' order. */\n const viewed = (): LightboxItem[] => [\n ...chips.map((c, i) => ({\n kind: 'image' as const,\n url: c.url,\n title: shotName(i),\n actions: [{ label: 'Change marks', title: 'Draw on it again', run: () => void draw(c) }],\n })),\n ...recordings.map((r, i) => ({\n kind: 'page' as const,\n // The replay filling the frame, without a header of its own: the lightbox names it.\n url: `${r.url}${r.url.includes('?') ? '&' : '?'}embed`,\n title: `${recordingName(i)} · ${clock(r.duration)}`,\n actions: [\n { label: 'New tab', title: 'Play it back in a tab of its own', run: () => void window.open(r.url, '_blank', 'noopener') },\n ],\n })),\n ...voices.map((v, i) => ({ kind: 'audio' as const, url: v.url, title: `${voiceName(i)} · ${clock(v.duration)}` })),\n ];\n const showChips = () => {\n // The box stands for a shot taken as the task goes, so it's away while anything else is attached.\n const attached = attachedCount() > 0;\n shot.hidden = attached;\n chipsEl.hidden = !attached;\n if (!busy) another.textContent = chips.length > 0 ? 'Add another' : 'Annotate';\n if (!attached) actions.append(...more());\n chipsEl.replaceChildren(\n ...chips.map((c, i) => {\n const thumb = element('img', { src: c.url, alt: '' });\n return chip([thumb, shotName(i)], `Open ${shotName(i).toLowerCase()}`, i, `Remove ${shotName(i).toLowerCase()}`, () =>\n dropShot(c),\n );\n }),\n ...recordings.map((r, i) => {\n const play = element('span', { className: 'play', innerHTML: PLAY });\n return chip(\n [play, `${recordingName(i)} ${clock(r.duration)}${r.voice === undefined ? '' : ' · voice'}`],\n `Play ${recordingName(i).toLowerCase()} back`,\n chips.length + i,\n `Remove ${recordingName(i).toLowerCase()}`,\n () => {\n recordings = recordings.filter((x) => x !== r);\n dropped();\n },\n );\n }),\n ...voices.map((v, i) => {\n const play = element('span', { className: 'play', innerHTML: PLAY });\n return chip(\n [play, `${voiceName(i)} ${clock(v.duration)}`],\n `Play ${voiceName(i).toLowerCase()}`,\n chips.length + recordings.length + i,\n `Remove ${voiceName(i).toLowerCase()}`,\n () => {\n voices = voices.filter((x) => x !== v);\n dropped();\n },\n );\n }),\n ...(attached && shots !== undefined && notes !== undefined ? [another] : []),\n ...(attached ? more() : []),\n );\n able();\n mark();\n };\n const dropShot = (c: Chip) => {\n URL.revokeObjectURL(c.url);\n chips = chips.filter((x) => x !== c);\n dropped();\n };\n // Back to the box, unticked, once the last is gone: what was attached is, so nothing is until it's asked for again.\n const dropped = () => {\n if (attachedCount() === 0) attach.checked = false;\n showChips();\n };\n const toChip = (drawn: Drawn): Chip => ({ ...drawn, url: URL.createObjectURL(drawn.png) });\n const reset = () => {\n for (const c of chips) URL.revokeObjectURL(c.url);\n chips = [];\n recordings = [];\n voices = [];\n attach.checked = true;\n showChips();\n };\n\n /** Takes a shot and opens it to draw on, or opens a chip's again: saved, it's a chip. */\n const draw = async (old?: Chip) => {\n if (shots === undefined || notes === undefined || busy) return;\n busy = true;\n const was = { annotate: annotate.textContent, another: another.textContent };\n annotate.textContent = another.textContent = old === undefined ? 'Capturing…' : was.another;\n problem.textContent = '';\n try {\n const taken = old?.shot ?? (await shots.capture(context.element));\n annotate.textContent = was.annotate;\n another.textContent = was.another;\n const picture: Picture = { url: taken.url, ...taken.size };\n const marks = await notes.edit(picture, old?.marks ?? [], { signal: aborts.signal });\n if (marks === undefined) return;\n const next = toChip({ shot: taken, marks, png: await notes.flatten(picture, marks) });\n if (old === undefined) {\n chips = [...chips, next];\n } else {\n URL.revokeObjectURL(old.url);\n chips = chips.map((c) => (c === old ? next : c));\n }\n showChips();\n } catch (e) {\n problem.textContent = messageOf(e);\n } finally {\n annotate.textContent = was.annotate;\n another.textContent = was.another;\n busy = false;\n showChips();\n }\n };\n annotate.addEventListener('click', () => void draw());\n another.addEventListener('click', () => void draw());\n record.addEventListener('click', () => {\n if (recorder === undefined || busy) return;\n // A take going on is kept first, as a chip, to come back to with the rest.\n void speakOff().then(() => {\n const drawn = chips.map(({ url: _, ...d }) => d);\n const kept: Kept = { text: text.value, attach: attach.checked, drawn, recordings, voices };\n context.away(kept, () => recorder.record());\n });\n });\n\n // The mic, here: Voice starts a take, the same button (now its time) stops it, and it's a chip.\n let take: Take | undefined;\n let ticking: ReturnType<typeof setInterval> | undefined;\n let stopWave: (() => void) | undefined;\n const speakOn = async () => {\n if (voice === undefined) return;\n problem.textContent = '';\n speak.disabled = true;\n try {\n take = await voice.start();\n } catch (e) {\n problem.textContent = messageOf(e);\n return;\n } finally {\n speak.disabled = false;\n }\n const started = take.started;\n // The time, the mic's live waveform, so it's plain it hears, and what a click does.\n const time = element('span', { className: 'time' });\n const wave = element('canvas', { className: 'wave' });\n speak.replaceChildren('● ', time, wave, 'Stop');\n stopWave = liveWaveform(wave, take.stream, { played: '#fff', rest: 'rgb(255 255 255 / 0.4)' });\n const tick = () => (time.textContent = clock(Date.now() - started));\n speak.classList.add('voice-on');\n speak.title = 'Stop, and attach it';\n tick();\n ticking = setInterval(tick, 250);\n mark();\n };\n const speakOff = async () => {\n const ending = take;\n if (ending === undefined) return;\n take = undefined;\n clearInterval(ticking);\n stopWave?.();\n stopWave = undefined;\n speak.classList.remove('voice-on');\n speak.textContent = 'Saving…';\n try {\n voices = [...voices, await ending.stop()];\n } catch (e) {\n problem.textContent = messageOf(e);\n } finally {\n speak.textContent = 'Voice';\n speak.title = 'Record your voice, here';\n showChips();\n }\n };\n speak.addEventListener('click', () => void (take === undefined ? speakOn() : speakOff()));\n\n // The task whose words are open to change, by ID, and the tasks as last read.\n let editing: string | undefined;\n // The Save of a listed task whose words were changed and not kept yet.\n let edited: HTMLElement | undefined;\n /** Tells the popup what leaving now would lose: a listed task's changed words, or a new one's, typed, attached or being spoken. */\n const mark = () => context.unsaved(edited ?? (text.value.trim() !== '' || attachedCount() > 0 || take !== undefined ? add : undefined));\n let shown = context.model;\n /** Asks for a change to a listed task and shows the tasks as they are after; the panel's status says why not. */\n const change = async (op: Change) => {\n try {\n editing = undefined;\n render(await context.apply(op));\n } catch {\n render(shown);\n }\n };\n /** A task's words in a field of their own: Save or Ctrl+Enter keeps them, Cancel or Esc leaves them. */\n const editor = (t: Task) => {\n // Marked a modal while it's open, so Esc is its and not the popup's.\n const item = element('li', { className: 'editing' });\n item.dataset['deicticModal'] = '';\n const field = element('textarea', { value: t.text });\n const save = element('button', { type: 'button', className: 'primary', textContent: 'Save' });\n const leave = element('button', { type: 'button', textContent: 'Cancel' });\n const buttons = element('div', { className: 'row' });\n const right = element('span', { className: 'actions' });\n right.append(leave, save);\n buttons.append(element('code', { textContent: `#${t.id}` }), right);\n item.append(field, buttons);\n const done = () => {\n editing = undefined;\n render(shown);\n };\n const keep = () => {\n if (field.value.trim() === '') return;\n if (field.value.trim() === t.text) return done();\n save.disabled = true;\n void change({ edit: t.id, text: field.value });\n };\n field.addEventListener('input', () => {\n save.disabled = field.value.trim() === '';\n edited = field.value.trim() === t.text ? undefined : save;\n mark();\n });\n field.addEventListener('keydown', (e) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n done();\n }\n if (e.key !== 'Enter' || !(e.ctrlKey || e.metaKey)) return;\n e.preventDefault();\n keep();\n });\n save.addEventListener('click', keep);\n leave.addEventListener('click', done);\n queueMicrotask(() => field.focus());\n return item;\n };\n const render = (model: Model) => {\n shown = model;\n // A task being changed is drawn again with its words as they were.\n edited = undefined;\n const { channel, link, tasks } = model;\n const name =\n link === undefined\n ? element('span')\n : element('a', { href: link, target: '_blank', rel: 'noreferrer', title: 'Open the channel on the board' });\n name.textContent = `#${channel}`;\n hint.replaceChildren('to ', name);\n list.replaceChildren(\n ...tasks.map((t) => {\n if (t.id === editing && t.open) return editor(t);\n const item = element('li');\n const id = element('code', { textContent: `#${t.id}` });\n const title = element('span', { className: 'title', textContent: t.title, title: t.title });\n const state = element('span', { className: `state ${t.state}`, textContent: t.state });\n if (t.link === undefined) {\n item.append(id, title, state);\n } else {\n const to = element('a', { href: t.link, target: '_blank', rel: 'noreferrer', title: 'Open the task on the board' });\n to.append(id);\n item.append(to, title, state);\n }\n if (!t.open) return item;\n const edit = element('button', { type: 'button', className: 'act', innerHTML: EDIT, title: 'Edit the task' });\n edit.addEventListener('click', () => {\n editing = t.id;\n render(shown);\n });\n const remove = element('button', { type: 'button', className: 'act', innerHTML: DELETE, title: 'Delete the task' });\n remove.addEventListener('click', () => {\n remove.disabled = true;\n void change({ remove: t.id });\n });\n item.append(edit, remove);\n return item;\n }),\n );\n able();\n mark();\n };\n\n /** The shots to attach: each chip's PNG, kept as a shot, or a shot taken now where the box is ticked. */\n const screenshotsOf = async (): Promise<Op['screenshots']> => {\n if (shots === undefined) return undefined;\n if (chips.length > 0) {\n add.textContent = 'Uploading…';\n return Promise.all(\n chips.map(async ({ shot: taken, marks, png }) => ({\n id: (await shots.upload(png, taken)).id,\n box: taken.box,\n ...(marks.length === 0 ? {} : { marks: marksOf(marks) }),\n })),\n );\n }\n // With a recording attached the box is away, so no shot is asked for.\n if (!attach.checked || recordings.length > 0) return undefined;\n add.textContent = 'Capturing…';\n const { id, box } = await shots.capture(context.element);\n return [{ id, box }];\n };\n\n const send = async () => {\n if (busy || sending) return;\n // A take still going is kept first: it may be all there is to send.\n await speakOff();\n if (able()) return;\n sending = true;\n able();\n problem.textContent = '';\n let screenshots: Op['screenshots'];\n try {\n screenshots = await screenshotsOf();\n } catch (e) {\n // Said under the shots, which stay as they are: untick the box, or remove the chips, to send without.\n problem.textContent = messageOf(e);\n add.textContent = 'Add task';\n sending = false;\n able();\n return;\n }\n add.textContent = 'Add task';\n const { element: el, elements } = context;\n try {\n const op: Op = {\n text: text.value,\n page: location.href,\n viewport: { width: innerWidth, height: innerHeight },\n ...(context.pointed === undefined\n ? {}\n : { pointed: { path: pathTo(context.pointed, el), html: context.pointed.outerHTML.slice(0, 4000) } }),\n count: elements.length,\n ...(screenshots === undefined ? {} : { screenshots }),\n ...(recordings.length === 0\n ? {}\n : {\n recordings: recordings.map(({ id, duration, url, voice: clips }) => ({\n id,\n duration,\n replay: new URL(url, location.href).href,\n ...(clips === undefined ? {} : { voice: clips.map((c) => c.id) }),\n })),\n }),\n ...(voices.length === 0 ? {} : { voice: voices.map(({ id, duration }) => ({ id, duration })) }),\n ...annotationsOf(notes),\n };\n const model = await context.apply(op);\n render(model);\n announce(model, op, context.target);\n text.value = '';\n reset();\n } catch {\n // The panel's status says why; what was typed and drawn stays, to send again.\n }\n sending = false;\n able();\n };\n\n // Back from recording: what was kept, and the recording, or why there's none.\n const back = context.resumed;\n if (back !== undefined) {\n const kept = back.state as Kept;\n text.value = kept.text;\n attach.checked = kept.attach;\n chips = kept.drawn.map(toChip);\n recordings = [...kept.recordings, ...(back.result === undefined ? [] : [back.result as Recording])];\n voices = kept.voices;\n if (back.problem !== undefined) problem.textContent = back.problem;\n }\n\n text.addEventListener('input', () => {\n able();\n mark();\n });\n text.addEventListener('keydown', (e) => {\n if (e.key !== 'Enter' || !(e.ctrlKey || e.metaKey)) return;\n e.preventDefault();\n void send();\n });\n add.addEventListener('click', () => void send());\n showChips();\n render(context.model);\n text.focus();\n return () => {\n aborts.abort();\n take?.cancel();\n clearInterval(ticking);\n stopWave?.();\n for (const c of chips) URL.revokeObjectURL(c.url);\n };\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCd,MAAM,QAAQ,SACZ,0JAA0J,KAAK;AACjK,MAAM,OAAO,KAAK,yBAAyB;AAC3C,MAAM,SAAS,KAAK,qCAAqC;AACzD,MAAM,OAAO;;AAGb,SAAS,QAAQ,MAAoC;CACnD,OAAO;EAAE,OAAO,KAAK;EAAQ,OAAO,KAAK,SAAS,EAAE,YAAa,MAAM,SAAS,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,CAAE;CAAE;AAC/G;;AAGA,SAAS,cAAc,OAAyD;CAC9E,MAAM,OAAO,OAAO,KAAK,KAAK,CAAC;CAC/B,OAAO,KAAK,WAAW,IAAI,CAAC,IAAI,EAAE,aAAa,QAAQ,IAAI,EAAE;AAC/D;AAuBA,MAAM,SAAS,OAAe;CAC5B,MAAM,IAAI,KAAK,MAAM,KAAK,GAAI;CAC9B,OAAO,GAAG,KAAK,MAAM,IAAI,EAAE,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAChE;AAEA,MAAM,aAAa,MAAgB,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;;;;;AAM5E,SAAS,OAAO,OAAgB,OAAwB;CACtD,MAAM,QAAkB,CAAC;CACzB,KAAK,IAAI,KAA0B,OAAO,OAAO,KAAA,KAAa,OAAO,QAAQ;EAC3E,MAAM,UAAU,OAAgB,GAAG,GAAG,YAAY,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,KAAK,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE;EAC/F,MAAM,OAAO,OAAO,EAAE;EAC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,KAAK;IACxB;IACA,MAAM,QAAQ,MAAM,QAAQ,MAAM,EAAE;IACpC,OAAO,KAAK;IACZ,SAAS,OAAO,IAAI,QAAQ,MAAM;IAClC,KAAK,QAAQ;IACb,MAAM;GACR,QAAQ,CAER;GACA,UAAU;GACV,KAAK;EACP;EAGA,MAAM,OAAO,QAAQ;EACrB,IAAI,SAAS,KAAA,GAAW;GACtB,MAAM,OAAO,KAAK;GAClB,KAAK,QAAQ,KAAK;GAClB,OAAO,UAAU,KAAK;GACtB,QAAQ,KAAK,MAAM,IAAI,MAAM;GAC7B,aAAa,CAAC,GAAG,KAAK,YAAY,GAAI,KAAK,WAAW,KAAA,IAAY,CAAC,IAAI,CAAC,KAAK,MAAmB,CAAE;GAClG,SAAS,KAAK;GACd,IAAI,KAAK,YAAY,KAAA,GAAW,QAAQ,cAAc,KAAK;EAC7D;EAEA,KAAK,iBAAiB,eAAe;GACnC,KAAK;GACL,KAAK;EACP,CAAC;EACD,KAAK,iBAAiB,YAAY,MAAM;GACtC,IAAI,EAAE,QAAQ,WAAW,EAAE,EAAE,WAAW,EAAE,UAAU;GACpD,EAAE,eAAe;GACZ,KAAK;EACZ,CAAC;EACD,IAAI,iBAAiB,eAAe,KAAK,KAAK,CAAC;EAC/C,UAAU;EACV,OAAO,QAAQ,KAAK;EACpB,KAAK,MAAM;EACX,aAAa;GACX,OAAO,MAAM;GACb,MAAM,OAAO;GACb,cAAc,OAAO;GACrB,WAAW;GACX,KAAK,MAAM,KAAK,OAAO,IAAI,gBAAgB,EAAE,GAAG;EAClD;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"client.js","names":[],"sources":["../../src/plugins/tasks/client.ts"],"sourcesContent":["/**\n * The tasks panel: the tasks already about this element and their state, and a field to add one. Each\n * task's ID opens it on the board, where the board has a page; one no one has claimed yet can be edited\n * in place (its words) or deleted (canceled on the board), both changes the popup's undo takes back.\n * Beside the channel it says who watches it (`Model.watching`), or that no agent does.\n * Ctrl+Enter or Add sends it with the page's URL, the viewport and the element as it rendered, which\n * the source can't tell: the chain of source it rendered through, its HTML (a file attached), and where the\n * annotations plugin is loaded, what's marked on the page.\n *\n * Where the screenshots plugin is loaded, a shot of the page goes with it, unless that's unticked, the element\n * outlined in it as the task goes: nothing else says which of two rows alike was meant (a shot drawn on is\n * left as it was drawn). With\n * the annotations plugin too, Annotate takes the shot now and opens it to draw on: saved, it's a chip\n * under the field, which opens it again to change the marks, and Add another takes one more. Any chip\n * (a recording's too) takes the box's place; removing the last brings it back unticked, so a task goes\n * without a shot unless asked again.\n *\n * The element's HTML as it rendered goes with it too, as a file, unless its box is unticked (or the server\n * half's `html` option is off, and then there's no box).\n *\n * Where the recordings plugin is loaded, Record leaves the popup (`away`) to record the page, keeping\n * what's typed and attached, and comes back with the recording as a chip too, which plays it back.\n * Where the voice plugin is, Voice records the mic here in the panel: stopped, it's a chip that plays it.\n */\nimport { liveWaveform } from '#src/client/waveform.ts';\nimport { defineClientPlugin, type LightboxItem, type Target } from '#src/index.ts';\n\n// For `use()`'s types: the plugins may not be loaded, and nothing of them runs here.\nimport type { Annotation, Annotations, Picture } from '#src/plugins/annotations/index.ts';\nimport type { Recording } from '#src/plugins/recordings/index.ts';\nimport type { Shot } from '#src/plugins/screenshots/index.ts';\nimport type { Clip, Take } from '#src/plugins/voice/index.ts';\n\nimport type { Change, Marks, Model, Op, Task, TaskAdded } from './index.ts';\n\nconst STYLE = `\n/* The column is no wider than the panel: an \\`auto\\` one grows to a long title, which then never truncates. */\n.tasks { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }\n/* Five rows, and the rest scrolled to: the field stays where it is however many there are. */\n.tasks { max-height: 112px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--deictic-line) transparent; }\n/* A task's words being changed need the room. */\n.tasks:has(.editing) { max-height: none; }\n.tasks li { position: relative; display: flex; gap: 6px; align-items: baseline; }\n.tasks .title { flex: 1; min-width: 0; padding: 0; border: 0; border-radius: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n/* Clicked, a task reads whole, as it was typed. */\n.tasks li.whole .title { white-space: pre-wrap; overflow-wrap: anywhere; }\n/* The state is a dot, named by its tooltip: a ring while no one has it, filled once someone does or it's over. */\n.tasks .state { flex: none; align-self: center; box-sizing: border-box; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--deictic-muted); }\n/* Room for Edit and Delete, which would lie over the first line's end. */\n.tasks li.whole:has(.acts) .title { padding-right: 40px; }\n.tasks li.whole .state { align-self: baseline; }\n.tasks .state.waiting { border-style: dotted; }\n.tasks .state.claimed { border-color: #60a5fa; background: #60a5fa; }\n.tasks .state.blocked { border-color: #fbbf24; background: #fbbf24; }\n.tasks .state.completed { border-color: #4ade80; background: #4ade80; }\n.tasks .state.failed { border-color: var(--deictic-problem); background: var(--deictic-problem); }\n.tasks a { color: inherit; text-decoration: none; }\n.tasks a:hover { text-decoration: underline; }\n/* Over the row's end, and only while the row is pointed at or focused in: the title keeps the width. */\n.tasks .acts { position: absolute; inset: 0 0 auto auto; min-height: 18px; display: none; align-items: center; padding-left: 14px; background: linear-gradient(to right, transparent, var(--deictic-bg) 12px); }\n.tasks li:hover .acts, .tasks li:focus-within .acts { display: flex; }\n.tasks .act { display: inline-flex; padding: 2px; border: 0; color: var(--deictic-muted); }\n.tasks .act:hover { color: var(--deictic-fg); }\n.tasks .act svg { width: 12px; height: 12px; }\n.tasks .place { flex: none; padding: 0; border: 0; font: 11px ui-monospace, monospace; color: var(--deictic-muted); }\n.tasks button.place:hover { color: var(--deictic-fg); text-decoration: underline; }\n.more { margin: 0 0 8px; }\n.more[hidden] { display: none; }\n.more summary { cursor: pointer; font-size: 12px; color: var(--deictic-muted); }\n.more summary:hover { color: var(--deictic-fg); }\n.more .tasks { margin: 4px 0 0; }\n.tasks li.editing { display: grid; }\n.tasks li.editing .row { margin-top: 0; }\n.tasks li.editing .actions { display: flex; gap: 6px; }\ntextarea { min-height: 64px; resize: vertical; font: 13px/1.4 system-ui, sans-serif; }\n.row { display: flex; gap: 6px; margin-top: 8px; justify-content: space-between; align-items: center; }\n/* Cut short before it pushes Add out: a channel's name and its watchers' may be long. */\n.hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--deictic-muted); font-size: 12px; }\n/* A dot as a task's state is: a ring while no one watches, green while someone does. */\n.watch::before { content: ''; display: inline-block; box-sizing: border-box; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; border: 1.5px solid var(--deictic-muted); }\n.watch.on::before { border-color: #4ade80; background: #4ade80; }\n.hint a { color: inherit; }\n.hint a:hover { color: var(--deictic-fg); }\n.shot { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--deictic-muted); }\n.shot label { display: flex; gap: 6px; align-items: center; }\n.shot input { width: auto; margin: 0; }\n.shot .actions { display: flex; gap: 6px; margin-left: auto; }\n.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; font-size: 12px; }\n.chip { display: inline-flex; align-items: center; border: 1px solid var(--deictic-line); border-radius: 6px; }\n.chip button { border: 0; }\n.chip .open { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; }\n.chip img { display: block; height: 28px; border-radius: 4px; }\n.chip .play { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 4px; background: var(--deictic-line); }\n.chip .play svg { width: 12px; height: 12px; }\n.chip .remove { padding: 0 6px; color: var(--deictic-muted); }\n.chip .remove:hover { color: var(--deictic-fg); }\n.voice-on { display: inline-flex; align-items: center; gap: 4px; color: #fff; background: #ef4444; border-color: #ef4444; font-variant-numeric: tabular-nums; }\n.voice-on .wave { width: 36px; height: 14px; }\n.shot-problem { margin-top: 4px; font-size: 12px; color: var(--deictic-problem); }\n.shot-problem:empty { display: none; }\n.shot[hidden], .chips[hidden], label[hidden] { display: none; }\n`;\n\nconst ICON = (path: string) =>\n `<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"${path}\"/></svg>`;\nconst EDIT = ICON('M4 20h4L19 9l-4-4L4 16z');\nconst DELETE = ICON('M4 7h16M10 7V4h4v3M6 7l1 13h10l1-13');\n/** The states of a task that's over, as a board names them: nothing more happens to it. */\nconst OVER = new Set(['completed', 'failed']);\nconst PLAY = '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M7 4v16l13-8z\" fill=\"currentColor\"/></svg>';\n\n/** Marks as a task tells of them: how many, and what the notes say. */\nfunction marksOf(list: readonly Annotation[]): Marks {\n return { count: list.length, notes: list.flatMap(({ shape }) => (shape.kind === 'note' ? [shape.text] : [])) };\n}\n\n/** The page's annotations for the op, where there are any. */\nfunction annotationsOf(marks: Annotations | undefined): Pick<Op, 'annotations'> {\n const list = marks?.list() ?? [];\n return list.length === 0 ? {} : { annotations: marksOf(list) };\n}\n\n/** An annotated shot: the shot as taken, the marks drawn on it, and the PNG of both. */\ninterface Drawn {\n shot: Shot;\n marks: Annotation[];\n png: Blob;\n}\n\n/** A drawn shot as the panel shows it, with a URL for its thumbnail, revoked with it. */\ninterface Chip extends Drawn {\n url: string;\n}\n\n/** What the panel keeps while it's away recording: what's typed, ticked and attached. */\ninterface Kept {\n text: string;\n attach: boolean;\n html: boolean;\n drawn: Drawn[];\n recordings: Recording[];\n voices: Clip[];\n /** What the page said of the element as the panel left, for a task added where the page no longer has it. */\n facts: Facts;\n}\n\n/** What a task says that only the page with the element on it knows. */\ntype Facts = Pick<Op, 'page' | 'viewport' | 'pointed' | 'count' | 'chain'> & {\n /** The element's HTML, as it would be attached. */\n html: string;\n};\n\nconst clock = (ms: number) => {\n const s = Math.round(ms / 1000);\n return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')}`;\n};\n\nconst messageOf = (e: unknown) => (e instanceof Error ? e.message : String(e));\n\n/**\n * `#shadow-root > div.panel > div.head > button.tab:nth-of-type(2)`: where `inner` is inside `outer`, through\n * shadow roots, by tag, classes and, among siblings alike, place, for whoever finds it in the code.\n */\nfunction pathTo(inner: Element, outer: Element): string {\n const steps: string[] = [];\n for (let at: Element | undefined = inner; at !== undefined && at !== outer;) {\n const nameOf = (el: Element) => `${el.localName}${[...el.classList].map((c) => `.${c}`).join('')}`;\n const name = nameOf(at);\n const siblings = at.parentElement === null ? [] : [...at.parentElement.children];\n // Its place only where a sibling reads the same.\n const same = siblings.filter((c) => nameOf(c) === name).length > 1;\n const alike = siblings.filter((c) => c.localName === at!.localName);\n steps.unshift(same ? `${name}:nth-of-type(${alike.indexOf(at) + 1})` : name);\n if (at.parentElement !== null) {\n at = at.parentElement;\n } else {\n const root = at.getRootNode();\n if (!(root instanceof ShadowRoot)) break;\n steps.unshift('#shadow-root');\n at = root.host;\n }\n }\n return steps.join(' > ');\n}\n\nconst parentOf = (el: Element): Element | undefined => {\n if (el.parentElement !== null) return el.parentElement;\n const root = el.getRootNode();\n return root instanceof ShadowRoot ? root.host : undefined;\n};\n\n/** How many places a chain names after the element's own. */\nconst CHAIN = 5;\n\n/**\n * The source `el` rendered through, after its own file, nearest first, each a `file:line`: a shared component's\n * own line is the same wherever it's used, and what uses it is the next file out (or a component between them,\n * which is why there are several). Read off the marks around it, the only trace of source the page has: each\n * place is the nearest element the next file wrote, which is where, in that file, the one before is used.\n */\nfunction chainOf(el: Element, file: string): NonNullable<Op['chain']> {\n const found: NonNullable<Op['chain']> = [];\n let last = file;\n for (let at = parentOf(el); at !== undefined && found.length < CHAIN; at = parentOf(at)) {\n const mark = at.getAttribute('data-deictic');\n if (mark === null) continue;\n const from = mark.replace(/:\\d+:\\d+$/, '');\n if (from === last) continue;\n last = from;\n found.push(mark.replace(/:\\d+$/, ''));\n }\n return found;\n}\n\n/** What's sent of the element's HTML at most, in characters: the server attaches it as a file. */\nconst HTML = 100_000;\n\n/** The overlay's own green, as its outline of the element while the popup is open. */\nconst OUTLINE = '#12b358';\n/** CSS pixels between the element and its outline, so the dashes are on nothing of the element's. */\nconst ROOM = 3;\n\n/**\n * A shot's PNG with the element outlined in it: dashes around its box, white under them so they show on any\n * page. The shot may have more pixels than its size in CSS ones, which the box is in.\n */\nasync function outlined(png: Blob | string, { box, size }: Pick<Shot, 'box' | 'size'>): Promise<Blob> {\n const url = typeof png === 'string' ? png : URL.createObjectURL(png);\n try {\n const image = new Image();\n image.src = url;\n await image.decode();\n const canvas = element('canvas', { width: image.naturalWidth, height: image.naturalHeight });\n const ctx = canvas.getContext('2d');\n if (ctx === null) throw new Error(\"tasks: this browser won't draw to a canvas\");\n ctx.drawImage(image, 0, 0);\n const k = image.naturalWidth / size.width;\n const rect = [(box.x - ROOM) * k, (box.y - ROOM) * k, (box.width + 2 * ROOM) * k, (box.height + 2 * ROOM) * k] as const;\n ctx.lineWidth = 4 * k;\n ctx.strokeStyle = '#fff';\n ctx.strokeRect(...rect);\n ctx.lineWidth = 2 * k;\n ctx.strokeStyle = OUTLINE;\n ctx.setLineDash([6 * k, 4 * k]);\n ctx.strokeRect(...rect);\n return await new Promise<Blob>((done, fail) =>\n canvas.toBlob((blob) => (blob === null ? fail(new Error('tasks: the screenshot drew nothing')) : done(blob)), 'image/png'),\n );\n } finally {\n if (typeof png !== 'string') URL.revokeObjectURL(url);\n }\n}\n\nfunction element<K extends keyof HTMLElementTagNameMap>(tag: K, props: Partial<HTMLElementTagNameMap[K]> = {}): HTMLElementTagNameMap[K] {\n return Object.assign(document.createElement(tag), props);\n}\n\n/** The event the page hears of each added task by, on `window`: its `detail` is a `TaskAdded`. */\nexport const TASK_ADDED = 'deictic:task';\n\n/** Tells the page of a task just added: the newest of the element's tasks, as the board answered them. */\nfunction announce(model: Model, op: Op, target: Target): void {\n const task = model.tasks.at(-1);\n if (task === undefined) return;\n const marks = (op.annotations?.count ?? 0) + (op.screenshots ?? []).reduce((n, shot) => n + (shot.marks?.count ?? 0), 0);\n const detail: TaskAdded = {\n id: task.id,\n title: task.title,\n state: task.state,\n channel: model.channel,\n target,\n page: op.page,\n attached: {\n screenshots: op.screenshots?.length ?? 0,\n recordings: op.recordings?.length ?? 0,\n voice: op.voice?.length ?? 0,\n marks,\n },\n };\n window.dispatchEvent(new CustomEvent(TASK_ADDED, { detail }));\n}\n\nexport default defineClientPlugin<Model, Change>({\n name: 'tasks',\n label: 'Task',\n // All the panel leaves for is a recording, which a page load doesn't end.\n resume: ({ use }) => use('recordings')?.going(),\n mount: (panel, context) => {\n const style = element('style', { textContent: STYLE });\n const list = element('ul', { className: 'tasks' });\n const text = element('textarea', { placeholder: 'What should change here?' });\n const add = element('button', { type: 'button', className: 'primary', textContent: 'Add task' });\n const hint = element('span', { className: 'hint' });\n const row = element('div', { className: 'row' });\n row.append(hint, add);\n // The file's other tasks, folded away: the panel is about this element. It stays as it's left while the panel is up.\n const fold = element('details', { className: 'more' });\n const count = element('summary');\n const others = element('ul', { className: 'tasks' });\n fold.append(count, others);\n // The element's tasks that are over, folded away too: what's still to do is what's read first.\n const closed = element('details', { className: 'more' });\n const closedCount = element('summary');\n const ended = element('ul', { className: 'tasks' });\n closed.append(closedCount, ended);\n panel.append(style, list, closed, fold, text);\n\n const shots = context.use('screenshots');\n // Back from a recording that went on to a page without the element: there's nothing here to take a shot of.\n const here = context.element.isConnected;\n const notes = context.use('annotations');\n const recorder = context.use('recordings');\n const voice = context.use('voice');\n // The server half's `html` option, which takes the box away; a page half with no options (a `standalone` server's) has it.\n const sendsHtml = (context.options as { html?: boolean } | undefined)?.html !== false;\n // Closes an open editor with the panel.\n const aborts = new AbortController();\n\n const attach = element('input', { type: 'checkbox', checked: true });\n const toggle = element('label', { hidden: shots === undefined || !here });\n toggle.append(attach, 'Attach a screenshot');\n const annotate = element('button', { type: 'button', textContent: 'Annotate', title: 'Take the screenshot now and draw on it' });\n const record = element('button', {\n type: 'button',\n textContent: 'Record',\n title: 'Record the page, with a toolbar to draw on it, then come back here',\n });\n const speak = element('button', { type: 'button', textContent: 'Voice', title: 'Record your voice, here' });\n const actions = element('span', { className: 'actions' });\n actions.append(...(shots !== undefined && notes !== undefined && here ? [annotate] : []));\n const shot = element('div', { className: 'shot' });\n shot.append(toggle, actions);\n const chipsEl = element('div', { className: 'chips' });\n const another = element('button', { type: 'button', textContent: 'Add another', title: 'Take another screenshot and draw on it' });\n const problem = element('div', { className: 'shot-problem' });\n if (shots !== undefined || recorder !== undefined || voice !== undefined) panel.append(shot, chipsEl, problem);\n // Its own line: the screenshot's gives way to the chips, and this is asked whatever else is attached.\n const withHtml = element('input', { type: 'checkbox', checked: true });\n const htmlToggle = element('label', { title: 'The element as the page has it now, as a file: element.html' });\n htmlToggle.append(withHtml, 'Attach HTML snapshot');\n const htmlRow = element('div', { className: 'shot' });\n htmlRow.append(htmlToggle);\n if (sendsHtml) panel.append(htmlRow);\n panel.append(row);\n\n let chips: Chip[] = [];\n let recordings: Recording[] = [];\n let voices: Clip[] = [];\n let busy = false;\n const attachedCount = () => chips.length + recordings.length + voices.length;\n // A task goes with words, or with something attached that says it; not while one is going.\n let sending = false;\n const able = () => (add.disabled = sending || (text.value.trim() === '' && attachedCount() === 0));\n // Record and Voice, where their plugins are: beside Annotate, or after the chips while the box is away.\n const more = () => [...(recorder !== undefined ? [record] : []), ...(voice !== undefined ? [speak] : [])];\n const chip = (content: (string | Node)[], title: string, at: number, remove: string, drop: () => void) => {\n const opener = element('button', { type: 'button', className: 'open', title });\n opener.append(...content);\n // Every attachment in one lightbox, opened at this one, growing out of its chip.\n opener.addEventListener('click', () => context.lightbox(viewed(), { at, from: el }));\n const remover = element('button', { type: 'button', className: 'remove', textContent: '×', title: remove });\n remover.addEventListener('click', drop);\n const el = element('span', { className: 'chip' });\n el.append(opener, remover);\n return el;\n };\n const shotName = (i: number) => `Screenshot ${i + 1}`;\n const recordingName = (i: number) => (recordings.length === 1 ? 'Recording' : `Recording ${i + 1}`);\n const voiceName = (i: number) => (voices.length === 1 ? 'Voice' : `Voice ${i + 1}`);\n /** What's attached, as the lightbox shows it, in the chips' order. */\n const viewed = (): LightboxItem[] => [\n ...chips.map((c, i) => ({\n kind: 'image' as const,\n url: c.url,\n title: shotName(i),\n actions: [{ label: 'Change marks', title: 'Draw on it again', run: () => void draw(c) }],\n })),\n ...recordings.map((r, i) => ({\n kind: 'page' as const,\n // The replay filling the frame, without a header of its own: the lightbox names it.\n url: `${r.url}${r.url.includes('?') ? '&' : '?'}embed`,\n title: `${recordingName(i)} · ${clock(r.duration)}`,\n actions: [\n { label: 'New tab', title: 'Play it back in a tab of its own', run: () => void window.open(r.url, '_blank', 'noopener') },\n ],\n })),\n ...voices.map((v, i) => ({ kind: 'audio' as const, url: v.url, title: `${voiceName(i)} · ${clock(v.duration)}` })),\n ];\n const showChips = () => {\n // The box stands for a shot taken as the task goes, so it's away while anything else is attached.\n const attached = attachedCount() > 0;\n shot.hidden = attached;\n chipsEl.hidden = !attached;\n if (!busy) another.textContent = chips.length > 0 ? 'Add another' : 'Annotate';\n if (!attached) actions.append(...more());\n chipsEl.replaceChildren(\n ...chips.map((c, i) => {\n const thumb = element('img', { src: c.url, alt: '' });\n return chip([thumb, shotName(i)], `Open ${shotName(i).toLowerCase()}`, i, `Remove ${shotName(i).toLowerCase()}`, () =>\n dropShot(c),\n );\n }),\n ...recordings.map((r, i) => {\n const play = element('span', { className: 'play', innerHTML: PLAY });\n return chip(\n [play, `${recordingName(i)} ${clock(r.duration)}${r.voice === undefined ? '' : ' · voice'}`],\n `Play ${recordingName(i).toLowerCase()} back`,\n chips.length + i,\n `Remove ${recordingName(i).toLowerCase()}`,\n () => {\n recordings = recordings.filter((x) => x !== r);\n dropped();\n },\n );\n }),\n ...voices.map((v, i) => {\n const play = element('span', { className: 'play', innerHTML: PLAY });\n return chip(\n [play, `${voiceName(i)} ${clock(v.duration)}`],\n `Play ${voiceName(i).toLowerCase()}`,\n chips.length + recordings.length + i,\n `Remove ${voiceName(i).toLowerCase()}`,\n () => {\n voices = voices.filter((x) => x !== v);\n dropped();\n },\n );\n }),\n ...(attached && shots !== undefined && notes !== undefined && here ? [another] : []),\n ...(attached ? more() : []),\n );\n able();\n mark();\n };\n const dropShot = (c: Chip) => {\n URL.revokeObjectURL(c.url);\n chips = chips.filter((x) => x !== c);\n dropped();\n };\n // Back to the box, unticked, once the last is gone: what was attached is, so nothing is until it's asked for again.\n const dropped = () => {\n if (attachedCount() === 0) attach.checked = false;\n showChips();\n };\n const toChip = (drawn: Drawn): Chip => ({ ...drawn, url: URL.createObjectURL(drawn.png) });\n const reset = () => {\n for (const c of chips) URL.revokeObjectURL(c.url);\n chips = [];\n recordings = [];\n voices = [];\n attach.checked = true;\n showChips();\n };\n\n /** Takes a shot and opens it to draw on, or opens a chip's again: saved, it's a chip. */\n const draw = async (old?: Chip) => {\n if (shots === undefined || notes === undefined || busy) return;\n busy = true;\n const was = { annotate: annotate.textContent, another: another.textContent };\n annotate.textContent = another.textContent = old === undefined ? 'Capturing…' : was.another;\n problem.textContent = '';\n try {\n const taken = old?.shot ?? (await shots.capture(context.element));\n annotate.textContent = was.annotate;\n another.textContent = was.another;\n const picture: Picture = { url: taken.url, ...taken.size };\n const marks = await notes.edit(picture, old?.marks ?? [], { signal: aborts.signal });\n if (marks === undefined) return;\n const next = toChip({ shot: taken, marks, png: await notes.flatten(picture, marks) });\n if (old === undefined) {\n chips = [...chips, next];\n } else {\n URL.revokeObjectURL(old.url);\n chips = chips.map((c) => (c === old ? next : c));\n }\n showChips();\n } catch (e) {\n problem.textContent = messageOf(e);\n } finally {\n annotate.textContent = was.annotate;\n another.textContent = was.another;\n busy = false;\n showChips();\n }\n };\n annotate.addEventListener('click', () => void draw());\n another.addEventListener('click', () => void draw());\n record.addEventListener('click', () => {\n if (recorder === undefined || busy) return;\n // A take going on is kept first, as a chip, to come back to with the rest.\n void speakOff().then(() => {\n const drawn = chips.map(({ url: _, ...d }) => d);\n const kept: Kept = { text: text.value, attach: attach.checked, html: withHtml.checked, drawn, recordings, voices, facts: facts() };\n context.away(kept, () => recorder.record());\n });\n });\n\n // The mic, here: Voice starts a take, the same button (now its time) stops it, and it's a chip.\n let take: Take | undefined;\n let ticking: ReturnType<typeof setInterval> | undefined;\n let stopWave: (() => void) | undefined;\n const speakOn = async () => {\n if (voice === undefined) return;\n problem.textContent = '';\n speak.disabled = true;\n try {\n take = await voice.start();\n } catch (e) {\n problem.textContent = messageOf(e);\n return;\n } finally {\n speak.disabled = false;\n }\n const started = take.started;\n // The time, the mic's live waveform, so it's plain it hears, and what a click does.\n const time = element('span', { className: 'time' });\n const wave = element('canvas', { className: 'wave' });\n speak.replaceChildren('● ', time, wave, 'Stop');\n stopWave = liveWaveform(wave, take.stream, { played: '#fff', rest: 'rgb(255 255 255 / 0.4)' });\n const tick = () => (time.textContent = clock(Date.now() - started));\n speak.classList.add('voice-on');\n speak.title = 'Stop, and attach it';\n tick();\n ticking = setInterval(tick, 250);\n mark();\n };\n const speakOff = async () => {\n const ending = take;\n if (ending === undefined) return;\n take = undefined;\n clearInterval(ticking);\n stopWave?.();\n stopWave = undefined;\n speak.classList.remove('voice-on');\n speak.textContent = 'Saving…';\n try {\n voices = [...voices, await ending.stop()];\n } catch (e) {\n problem.textContent = messageOf(e);\n } finally {\n speak.textContent = 'Voice';\n speak.title = 'Record your voice, here';\n showChips();\n }\n };\n speak.addEventListener('click', () => void (take === undefined ? speakOn() : speakOff()));\n\n // The task whose words are open to change, by ID, and the tasks as last read.\n let editing: string | undefined;\n // The tasks shown whole, by ID: kept over a change, which draws the list again.\n const whole = new Set<string>();\n // The Save of a listed task whose words were changed and not kept yet.\n let edited: HTMLElement | undefined;\n /** Tells the popup what leaving now would lose: a listed task's changed words, or a new one's, typed, attached or being spoken. */\n const mark = () => context.unsaved(edited ?? (text.value.trim() !== '' || attachedCount() > 0 || take !== undefined ? add : undefined));\n let shown = context.model;\n /** Asks for a change to a listed task and shows the tasks as they are after; the panel's status says why not. */\n const change = async (op: Change) => {\n try {\n editing = undefined;\n render(await context.apply(op));\n } catch {\n render(shown);\n }\n };\n /** A task's words in a field of their own: Save or Ctrl+Enter keeps them, Cancel or Esc leaves them. */\n const editor = (t: Task) => {\n // Marked a modal while it's open, so Esc is its and not the popup's.\n const item = element('li', { className: 'editing' });\n item.dataset['deicticModal'] = '';\n const field = element('textarea', { value: t.text });\n const save = element('button', { type: 'button', className: 'primary', textContent: 'Save' });\n const leave = element('button', { type: 'button', textContent: 'Cancel' });\n const buttons = element('div', { className: 'row' });\n const right = element('span', { className: 'actions' });\n right.append(leave, save);\n buttons.append(element('code', { textContent: `#${t.id}` }), right);\n item.append(field, buttons);\n const done = () => {\n editing = undefined;\n render(shown);\n };\n const keep = () => {\n if (field.value.trim() === '') return;\n if (field.value.trim() === t.text) return done();\n save.disabled = true;\n void change({ edit: t.id, text: field.value });\n };\n field.addEventListener('input', () => {\n save.disabled = field.value.trim() === '';\n edited = field.value.trim() === t.text ? undefined : save;\n mark();\n });\n field.addEventListener('keydown', (e) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n done();\n }\n if (e.key !== 'Enter' || !(e.ctrlKey || e.metaKey)) return;\n e.preventDefault();\n keep();\n });\n save.addEventListener('click', keep);\n leave.addEventListener('click', done);\n queueMicrotask(() => field.focus());\n return item;\n };\n const render = (model: Model) => {\n shown = model;\n // A task being changed is drawn again with its words as they were.\n edited = undefined;\n const { channel, link, tasks, elsewhere, watching } = model;\n const name =\n link === undefined\n ? element('span')\n : element('a', { href: link, target: '_blank', rel: 'noreferrer', title: 'Open the channel on the board' });\n name.textContent = `#${channel}`;\n hint.replaceChildren('to ', name);\n // Whether a task added now is taken up: who watches the channel, or that no one does, where that's known.\n if (watching !== undefined) {\n const names = new Intl.ListFormat('en', { type: 'conjunction' }).format(watching);\n const on = watching.length > 0;\n const who = element('span', {\n className: on ? 'watch on' : 'watch',\n textContent: on ? `${names} watching` : 'no agent watching',\n title: on\n ? `${names} ${watching.length === 1 ? 'is' : 'are'} watching #${channel}, and take${watching.length === 1 ? 's' : ''} each task as it's added`\n : `A task waits on the board until an agent watches #${channel}: ask yours to watch deictic's tasks`,\n });\n hint.append(' · ', who);\n }\n /** A task's row: its state, its ID, a link where it has a page, its title, and where it's from when that's said. */\n const rowOf = (t: Task, from?: HTMLElement) => {\n const item = element('li');\n const state = element('span', { className: `state ${t.state}`, title: t.state });\n state.role = 'img';\n const id = element('code', { textContent: `#${t.id}` });\n const title = element('button', { type: 'button', className: 'title' });\n // In place, not by drawing the list again: that would take a task's words being changed with it.\n const show = () => {\n const all = whole.has(t.id);\n item.classList.toggle('whole', all);\n title.textContent = all ? t.text : t.title;\n title.title = all ? 'Show its first line only' : 'Show all of it';\n title.ariaExpanded = String(all);\n };\n title.addEventListener('click', () => {\n if (!whole.delete(t.id)) whole.add(t.id);\n show();\n });\n show();\n const to =\n t.link === undefined\n ? id\n : element('a', { href: t.link, target: '_blank', rel: 'noreferrer', title: 'Open the task on the board' });\n if (to !== id) to.append(id);\n item.append(state, to, title, ...(from === undefined ? [] : [from]));\n return item;\n };\n const { file } = context.target.loc;\n fold.hidden = elsewhere.length === 0;\n count.textContent = `${elsewhere.length} elsewhere in ${file.split('/').at(-1)}`;\n others.replaceChildren(\n ...elsewhere.map((t) => {\n if (t.at === undefined) return rowOf(t);\n const { line, column, tag } = t.at;\n const name = `<${tag}> :${line}`;\n // Only an element the page shows now has a popup to open: its place is from the task, which may be old.\n const there = document.querySelector(`[data-deictic=\"${CSS.escape(`${file}:${line}:${column}`)}\"]`);\n if (there === null)\n return rowOf(t, element('span', { className: 'place', textContent: name, title: `Line ${line}, not on this page now` }));\n\n const go = element('button', { type: 'button', className: 'place', textContent: name, title: `Open the tasks of line ${line}` });\n go.addEventListener('click', () => void context.open('tasks', there));\n return rowOf(t, go);\n }),\n );\n const over = tasks.filter((t) => OVER.has(t.state));\n closed.hidden = over.length === 0;\n closedCount.textContent = `${over.length} closed`;\n ended.replaceChildren(...over.map((t) => rowOf(t)));\n const live = tasks.filter((t) => !OVER.has(t.state));\n // The latest is the last, which a list longer than its room would keep out of sight: as it opens, and after one is added.\n const grew = live.length > list.childElementCount;\n list.replaceChildren(\n ...live.map((t) => {\n if (t.id === editing && t.open) return editor(t);\n const item = rowOf(\n t,\n t.at === undefined\n ? undefined\n : element('span', {\n className: 'place',\n textContent: `was :${t.at.line}`,\n title: `Added when this was on line ${t.at.line}: it has moved since`,\n }),\n );\n if (!t.open) return item;\n const edit = element('button', { type: 'button', className: 'act', innerHTML: EDIT, title: 'Edit the task' });\n edit.addEventListener('click', () => {\n editing = t.id;\n render(shown);\n });\n const remove = element('button', { type: 'button', className: 'act', innerHTML: DELETE, title: 'Delete the task' });\n remove.addEventListener('click', () => {\n remove.disabled = true;\n void change({ remove: t.id });\n });\n const acts = element('span', { className: 'acts' });\n acts.append(edit, remove);\n item.append(acts);\n return item;\n }),\n );\n if (grew) list.scrollTop = list.scrollHeight;\n able();\n mark();\n };\n\n const back = context.resumed;\n /**\n * What the page says of the element: read now, while the page has it, and as the panel left it where the\n * page has moved on without it (a recording that went on to another), which is the page the task is about.\n */\n const facts = (): Facts => {\n const { element: el, elements } = context;\n if (!here && back !== undefined) return (back.state as Kept).facts;\n const chain = chainOf(el, context.target.loc.file);\n return {\n page: location.href,\n viewport: { width: innerWidth, height: innerHeight },\n ...(context.pointed === undefined\n ? {}\n : { pointed: { path: pathTo(context.pointed, el), html: context.pointed.outerHTML.slice(0, 4000) } }),\n count: elements.length,\n ...(chain.length === 0 ? {} : { chain }),\n html: (shots?.masked(el) ?? el).outerHTML.slice(0, HTML),\n };\n };\n\n /**\n * The shots to attach: each chip's PNG, kept as a shot, as the person drew it, or a shot taken now where the\n * box is ticked. Only that one has the element outlined in it (or is as it was taken, where that can't be\n * drawn): nothing else in it says what it's about, while a shot someone annotated says what they marked.\n */\n const screenshotsOf = async (): Promise<Op['screenshots']> => {\n if (shots === undefined) return undefined;\n if (chips.length > 0) {\n add.textContent = 'Uploading…';\n return Promise.all(\n chips.map(async ({ shot: taken, marks, png }) => ({\n id: (await shots.upload(png, taken)).id,\n box: taken.box,\n ...(marks.length === 0 ? {} : { marks: marksOf(marks) }),\n })),\n );\n }\n // With a recording attached the box is away, so no shot is asked for.\n if (!attach.checked || recordings.length > 0 || !here) return undefined;\n add.textContent = 'Capturing…';\n const taken = await shots.capture(context.element);\n try {\n return [{ id: (await shots.upload(await outlined(taken.url, taken), taken)).id, box: taken.box, outlined: true }];\n } catch {\n return [{ id: taken.id, box: taken.box }];\n }\n };\n\n const send = async () => {\n if (busy || sending) return;\n // A take still going is kept first: it may be all there is to send.\n await speakOff();\n if (able()) return;\n sending = true;\n able();\n problem.textContent = '';\n let screenshots: Op['screenshots'];\n try {\n screenshots = await screenshotsOf();\n } catch (e) {\n // Said under the shots, which stay as they are: untick the box, or remove the chips, to send without.\n problem.textContent = messageOf(e);\n add.textContent = 'Add task';\n sending = false;\n able();\n return;\n }\n add.textContent = 'Add task';\n try {\n const { html, ...said } = facts();\n const op: Op = {\n text: text.value,\n ...said,\n ...(sendsHtml && withHtml.checked ? { html } : {}),\n ...(screenshots === undefined ? {} : { screenshots }),\n ...(recordings.length === 0\n ? {}\n : {\n recordings: recordings.map(({ id, duration, url, voice: clips }) => ({\n id,\n duration,\n replay: new URL(url, location.href).href,\n ...(clips === undefined ? {} : { voice: clips.map((c) => c.id) }),\n })),\n }),\n ...(voices.length === 0 ? {} : { voice: voices.map(({ id, duration }) => ({ id, duration })) }),\n ...annotationsOf(notes),\n };\n const model = await context.apply(op);\n render(model);\n announce(model, op, context.target);\n text.value = '';\n reset();\n } catch {\n // The panel's status says why; what was typed and drawn stays, to send again.\n }\n sending = false;\n able();\n };\n\n // Back from recording: what was kept, and the recording, or why there's none.\n if (back !== undefined) {\n const kept = back.state as Kept;\n text.value = kept.text;\n attach.checked = kept.attach;\n withHtml.checked = kept.html;\n chips = kept.drawn.map(toChip);\n recordings = [...kept.recordings, ...(back.result === undefined ? [] : [back.result as Recording])];\n voices = kept.voices;\n if (back.problem !== undefined) problem.textContent = back.problem;\n }\n\n text.addEventListener('input', () => {\n able();\n mark();\n });\n text.addEventListener('keydown', (e) => {\n if (e.key !== 'Enter' || !(e.ctrlKey || e.metaKey)) return;\n e.preventDefault();\n void send();\n });\n add.addEventListener('click', () => void send());\n showChips();\n render(context.model);\n text.focus();\n return () => {\n aborts.abort();\n take?.cancel();\n clearInterval(ticking);\n stopWave?.();\n for (const c of chips) URL.revokeObjectURL(c.url);\n };\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEd,MAAM,QAAQ,SACZ,0JAA0J,KAAK;AACjK,MAAM,OAAO,KAAK,yBAAyB;AAC3C,MAAM,SAAS,KAAK,qCAAqC;;AAEzD,MAAM,uBAAO,IAAI,IAAI,CAAC,aAAa,QAAQ,CAAC;AAC5C,MAAM,OAAO;;AAGb,SAAS,QAAQ,MAAoC;CACnD,OAAO;EAAE,OAAO,KAAK;EAAQ,OAAO,KAAK,SAAS,EAAE,YAAa,MAAM,SAAS,SAAS,CAAC,MAAM,IAAI,IAAI,CAAC,CAAE;CAAE;AAC/G;;AAGA,SAAS,cAAc,OAAyD;CAC9E,MAAM,OAAO,OAAO,KAAK,KAAK,CAAC;CAC/B,OAAO,KAAK,WAAW,IAAI,CAAC,IAAI,EAAE,aAAa,QAAQ,IAAI,EAAE;AAC/D;AAgCA,MAAM,SAAS,OAAe;CAC5B,MAAM,IAAI,KAAK,MAAM,KAAK,GAAI;CAC9B,OAAO,GAAG,KAAK,MAAM,IAAI,EAAE,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAChE;AAEA,MAAM,aAAa,MAAgB,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;;;;;AAM5E,SAAS,OAAO,OAAgB,OAAwB;CACtD,MAAM,QAAkB,CAAC;CACzB,KAAK,IAAI,KAA0B,OAAO,OA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,EAAE,QAAQ,WAAW,EAAE,EAAE,WAAW,EAAE,UAAU;GACpD,EAAE,eAAe;GACZ,KAAK;EACZ,CAAC;EACD,IAAI,iBAAiB,eAAe,KAAK,KAAK,CAAC;EAC/C,UAAU;EACV,OAAO,QAAQ,KAAK;EACpB,KAAK,MAAM;EACX,aAAa;GACX,OAAO,MAAM;GACb,MAAM,OAAO;GACb,cAAc,OAAO;GACrB,WAAW;GACX,KAAK,MAAM,KAAK,OAAO,IAAI,gBAAgB,EAAE,GAAG;EAClD;CACF;AACF,CAAC"}
|
package/dist/tasks/index.d.ts
CHANGED
|
@@ -1,159 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { t as Box } from "../index3.js";
|
|
4
|
-
/** What the plugin uses of a board: `board()` from `@vercel/board` is one. */
|
|
5
|
-
export type TaskBoard = Pick<Board, 'tasks' | 'thread' | 'discovery' | 'upload' | 'edit'>;
|
|
6
|
-
export interface TasksOptions {
|
|
7
|
-
/**
|
|
8
|
-
* The board, as `@vercel/board`'s `board()` answers it: by default the one `BOARD_URL` names (`npx vb serve`
|
|
9
|
-
* runs one on this machine), or your team's default board, through `vercel login`.
|
|
10
|
-
*/
|
|
11
|
-
board?: TaskBoard;
|
|
12
|
-
/** The channel tasks go to: `deictic` by default. */
|
|
13
|
-
channel?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The project the tasks are about, as the `deictic.project` label, to tell them apart on a board several
|
|
16
|
-
* projects share: by default the `name` in the root's `package.json`, and no label where it has none.
|
|
17
|
-
*/
|
|
18
|
-
project?: string;
|
|
19
|
-
/** Labels every task gets besides deictic's own, for whoever works them to filter by (`vb tail --label`). None by default. */
|
|
20
|
-
labels?: Record<string, string>;
|
|
21
|
-
/**
|
|
22
|
-
* Where the panel links the channel to, for a person to see its tasks, and with `task`, where it links
|
|
23
|
-
* that task's ID to. By default the board's own pages when it's one `vb serve` runs on this machine
|
|
24
|
-
* (`http://127.0.0.1:4100/c/deictic`, and `?thread=<id>` on it), and none for another board, whose pages
|
|
25
|
-
* deictic can't know.
|
|
26
|
-
*/
|
|
27
|
-
link?: (channel: string, task?: string) => string | undefined;
|
|
28
|
-
/** What opens its tab directly, beside deictic's own shortcut, which opens any: none by default. */
|
|
29
|
-
shortcut?: Shortcut;
|
|
30
|
-
}
|
|
31
|
-
export interface Task {
|
|
32
|
-
id: string;
|
|
33
|
-
/** The first line of what was typed. */
|
|
34
|
-
title: string;
|
|
35
|
-
/** What was typed, whole: what an edit changes. */
|
|
36
|
-
text: string;
|
|
37
|
-
state: string;
|
|
38
|
-
/** Whether it can still be edited or deleted: no one has claimed it. */
|
|
39
|
-
open: boolean;
|
|
40
|
-
/** Its page on the board, when there's one to link to. */
|
|
41
|
-
link?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface Model {
|
|
44
|
-
channel: string;
|
|
45
|
-
/** The channel's page, when there's one to link to. */
|
|
46
|
-
link?: string;
|
|
47
|
-
/** Tasks about this element, oldest first, canceled ones left out. */
|
|
48
|
-
tasks: Task[];
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* What the Task tab asks for: a new task (an `Op`), other words for one it lists (`edit` is its ID), or
|
|
52
|
-
* that one deleted (`remove` is its ID), which cancels it on the board.
|
|
53
|
-
*/
|
|
54
|
-
export type Change = Op | {
|
|
55
|
-
edit: string;
|
|
56
|
-
text: string;
|
|
57
|
-
} | {
|
|
58
|
-
remove: string;
|
|
59
|
-
};
|
|
60
|
-
/** A new task: what the page knows and the source doesn't. */
|
|
61
|
-
export interface Op {
|
|
62
|
-
text: string;
|
|
63
|
-
/** The page's URL. */
|
|
64
|
-
page: string;
|
|
65
|
-
viewport: {
|
|
66
|
-
width: number;
|
|
67
|
-
height: number;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* What was under the pointer inside the element, where nothing marked it (a dependency's markup, or a
|
|
71
|
-
* shadow root's): its path from the element, and its HTML, cut short.
|
|
72
|
-
*/
|
|
73
|
-
pointed?: {
|
|
74
|
-
path: string;
|
|
75
|
-
html: string;
|
|
76
|
-
};
|
|
77
|
-
/** How many elements on the page come from the same place in the source. */
|
|
78
|
-
count: number;
|
|
79
|
-
/**
|
|
80
|
-
* Shots the screenshots plugin took of it, to attach, where that plugin is loaded: each with where the
|
|
81
|
-
* element is in it, and the marks drawn on it in the panel, where there are any.
|
|
82
|
-
*/
|
|
83
|
-
screenshots?: {
|
|
84
|
-
id: string;
|
|
85
|
-
box: Box;
|
|
86
|
-
marks?: Marks;
|
|
87
|
-
}[];
|
|
88
|
-
/**
|
|
89
|
-
* Recordings the recordings plugin made, to attach, where that plugin is loaded: how long each ran,
|
|
90
|
-
* where it plays back, and the voice plugin's clips of the mic in it, attached too.
|
|
91
|
-
*/
|
|
92
|
-
recordings?: {
|
|
93
|
-
id: string;
|
|
94
|
-
duration: number;
|
|
95
|
-
replay: string;
|
|
96
|
-
voice?: string[];
|
|
97
|
-
}[];
|
|
98
|
-
/** Voice notes the voice plugin kept, to attach, where that plugin is loaded, and how long each runs. */
|
|
99
|
-
voice?: {
|
|
100
|
-
id: string;
|
|
101
|
-
duration: number;
|
|
102
|
-
}[];
|
|
103
|
-
/** The page's annotations, where that plugin is loaded and there are any: how many, and their notes' text. */
|
|
104
|
-
annotations?: Marks;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* A task the Task tab just added, as the page hears of it: the `detail` of a `deictic:task` event on `window`, for a
|
|
108
|
-
* page that shows its own tasks (deictic's playground lists them as a board does).
|
|
109
|
-
*/
|
|
110
|
-
export interface TaskAdded {
|
|
111
|
-
id: string;
|
|
112
|
-
/** The first line of what was typed. */
|
|
113
|
-
title: string;
|
|
114
|
-
state: string;
|
|
115
|
-
channel: string;
|
|
116
|
-
/** The element: its file, line and column, and its tag. */
|
|
117
|
-
target: Target;
|
|
118
|
-
/** The page's URL. */
|
|
119
|
-
page: string;
|
|
120
|
-
/** How many of each were attached; `marks` counts those drawn on shots and on the page. */
|
|
121
|
-
attached: {
|
|
122
|
-
screenshots: number;
|
|
123
|
-
recordings: number;
|
|
124
|
-
voice: number;
|
|
125
|
-
marks: number;
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
/** Marks, as a task tells of them: how many, and what the notes among them say. */
|
|
129
|
-
export interface Marks {
|
|
130
|
-
count: number;
|
|
131
|
-
notes: string[];
|
|
132
|
-
}
|
|
133
|
-
export interface Added {
|
|
134
|
-
channel: string;
|
|
135
|
-
id: string;
|
|
136
|
-
text: string;
|
|
137
|
-
labels: Record<string, string>;
|
|
138
|
-
/** What's attached, by the board's IDs: kept, so a redo attaches the same without uploading it again. */
|
|
139
|
-
attachments?: string[];
|
|
140
|
-
}
|
|
141
|
-
/** A task's words changed: its message's whole text before and after. */
|
|
142
|
-
export interface Edited {
|
|
143
|
-
kind: 'edited';
|
|
144
|
-
id: string;
|
|
145
|
-
before: string;
|
|
146
|
-
after: string;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* A task deleted in the panel: canceled on the board, for good, as a board has it. So it's kept whole, and
|
|
150
|
-
* an undo adds it again, as a new task whose ID the record then has.
|
|
151
|
-
*/
|
|
152
|
-
export interface Removed extends Added {
|
|
153
|
-
kind: 'removed';
|
|
154
|
-
}
|
|
155
|
-
/** What the history keeps of a change: a task added has no `kind`, as it had none before there were others. */
|
|
156
|
-
export type Kept = Added | Edited | Removed;
|
|
157
|
-
export declare function tasks(options?: TasksOptions): import("deictic").ServerPlugin<Model, Change, Kept, unknown>;
|
|
158
|
-
export { tasks as default };
|
|
159
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { _ as local, a as Marks, c as Place, d as TaskAdded, f as TaskBoard, g as LocalOptions, h as LocalBoard, i as Kept, l as Removed, m as tasks, n as Change, o as Model, p as TasksOptions, r as Edited, s as Op, t as Added, u as Task } from "../shared/index5.js";
|
|
2
|
+
export { Added, Change, Edited, Kept, type LocalBoard, type LocalOptions, Marks, Model, Op, Place, Removed, Task, TaskAdded, TaskBoard, TasksOptions, tasks as default, tasks, local };
|