retake-dev 0.5.0 → 0.5.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 +76 -1
- package/README.md +141 -7
- package/bin/retake.js +14 -1
- package/package.json +6 -1
- package/src/core.js +14 -1
- package/src/next-dev.js +183 -0
- package/src/next.js +81 -0
- package/src/note-text.js +844 -0
- package/src/plugin.js +6 -2
- package/src/runtime/10-animations.js +9 -0
- package/src/runtime/60-preview.js +3 -1
- package/src/runtime/62-motion.js +106 -0
- package/src/runtime/65-timeline.js +39 -0
- package/src/runtime/67-csssource.js +73 -1
- package/src/runtime/70-boot.js +9 -2
- package/src/server/api.js +73 -1
- package/src/server/front.js +3 -1
- package/src/server/mcp.js +213 -16
- package/src/server/moments.js +317 -0
- package/src/server/sourcemap.js +192 -0
- package/src/shell/10-dock.js +27 -5
- package/src/shell/15-session.js +11 -5
- package/src/shell/20-timeline.js +30 -5
- package/src/shell/25-input.js +25 -2
- package/src/shell/30-notes.js +704 -110
- package/src/shell/32-anims.js +1353 -0
- package/src/shell/shell.css +24 -0
- package/src/shell/shell.html +1 -0
- package/types/client.d.ts +7 -0
- package/types/index.d.ts +2 -0
- package/types/next.d.ts +50 -0
package/src/shell/shell.css
CHANGED
|
@@ -277,6 +277,7 @@ body.branching .track, body.branching .track * { cursor: crosshair !important; }
|
|
|
277
277
|
#wb-layers .layer.pseudo { padding-left: 14px; }
|
|
278
278
|
#wb-layers .layer.on { color: var(--ink); background: var(--amber); }
|
|
279
279
|
#wb-layers .more { padding: 2px 6px; color: var(--dim); }
|
|
280
|
+
#wb-layers .layer.skipped:not(.on) { color: var(--dim); }
|
|
280
281
|
#wb-hl.select::after { background: var(--white); }
|
|
281
282
|
#wb-scope { position: fixed; pointer-events: none; border: 1px dashed var(--muted); border-radius: 8px; z-index: 14; display: none; }
|
|
282
283
|
#wb-pins { position: fixed; inset: 0; pointer-events: none; z-index: 15; }
|
|
@@ -284,6 +285,7 @@ body.branching .track, body.branching .track * { cursor: crosshair !important; }
|
|
|
284
285
|
color: var(--ink); font: 600 11px/1 var(--mono); box-shadow: 0 0 0 2px rgba(22, 22, 26, 0.85), var(--shadow); transition: transform .12s var(--ease), opacity .15s var(--ease); }
|
|
285
286
|
@media (hover: hover) { .canvas-pin:hover { transform: scale(1.12); } }
|
|
286
287
|
.canvas-pin.away { opacity: .45; }
|
|
288
|
+
body.picking-notes .canvas-pin { pointer-events: none; }
|
|
287
289
|
@media (hover: hover) { .canvas-pin.away:hover { opacity: 1; } }
|
|
288
290
|
|
|
289
291
|
/* ---- popovers: a note, a context menu ---- */
|
|
@@ -340,3 +342,25 @@ body.branching .track, body.branching .track * { cursor: crosshair !important; }
|
|
|
340
342
|
.ctx .menu-note { padding: 8px; color: var(--dim); font-size: 12px; line-height: 16px; }
|
|
341
343
|
|
|
342
344
|
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0s !important; transition-duration: 0s !important; transition-delay: 0s !important; } }
|
|
345
|
+
|
|
346
|
+
/* The focused element's own row (32-anims.js): its name in the gutter, where it is on its clock in the hint. */
|
|
347
|
+
.focus-name { position: absolute; left: 0; right: 0; padding: 0 8px; display: flex; align-items: center; font: 500 10px/1 var(--mono); color: #fde68a;
|
|
348
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
349
|
+
.gutter.dots .focus-name { padding: 0 2px; font-size: 0; }
|
|
350
|
+
.gutter.dots .focus-name::before { content: ""; width: 8px; height: 8px; margin: 0 auto; border-radius: 2px; background: #fde68a; transform: rotate(45deg); }
|
|
351
|
+
.hint.readout { max-width: max(0px, calc(100% - 420px)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11px; display: block; line-height: 24px; }
|
|
352
|
+
@media (max-width: 760px) { .hint.readout { display: none; } }
|
|
353
|
+
.note-at { margin-top: 6px; font: 500 11px/15px var(--mono); color: #fde68a; }
|
|
354
|
+
.note-asked { all: unset; cursor: pointer; display: block; margin-top: 6px; padding: 3px 8px; border-radius: 6px; font: 400 11px/15px var(--sans); color: var(--muted);
|
|
355
|
+
background: rgba(253, 230, 138, 0.08); border: 1px solid rgba(253, 230, 138, 0.2); }
|
|
356
|
+
.note-asked[hidden] { display: none; }
|
|
357
|
+
@media (hover: hover) { .note-asked:hover { color: var(--fg); } }
|
|
358
|
+
/* Where the open clip moves the element, on the app: its start and end boxes, the path of its centre, the range in full colour. */
|
|
359
|
+
#wb-path { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 14; overflow: visible; }
|
|
360
|
+
#wb-path[hidden] { display: none; }
|
|
361
|
+
#wb-path .edge { fill: none; stroke: #fde68a; stroke-opacity: .55; stroke-width: 1; stroke-dasharray: 4 3; }
|
|
362
|
+
#wb-path .edge.on { stroke-opacity: 1; }
|
|
363
|
+
#wb-path .path { fill: none; stroke: #fde68a; stroke-opacity: .6; stroke-width: 1.5; stroke-dasharray: 1 3; stroke-linecap: round; }
|
|
364
|
+
#wb-path .path.on { stroke-opacity: 1; stroke-dasharray: none; stroke-width: 2; }
|
|
365
|
+
#wb-path .tick { fill: #fff; }
|
|
366
|
+
#wb-path text { font: 600 10px var(--mono); fill: #fde68a; }
|
package/src/shell/shell.html
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
<div id="wb-layers" hidden></div>
|
|
57
57
|
<div id="wb-hl"></div>
|
|
58
58
|
<div id="wb-scope"></div>
|
|
59
|
+
<svg id="wb-path" hidden aria-hidden="true"></svg>
|
|
59
60
|
<div id="wb-pins"></div>
|
|
60
61
|
<div id="wb-note" class="card" hidden></div>
|
|
61
62
|
<div id="wb-menu" class="card ctx" hidden></div>
|
package/types/client.d.ts
CHANGED
|
@@ -25,6 +25,13 @@ export interface RetakeClip {
|
|
|
25
25
|
property?: string
|
|
26
26
|
path: Array<string | number>
|
|
27
27
|
iterations?: "infinite" | number
|
|
28
|
+
/** One iteration's duration (ms), for clips that repeat. */
|
|
29
|
+
dur?: number
|
|
30
|
+
/** Start delay (ms), included in `start`..`end`. */
|
|
31
|
+
delay?: number
|
|
32
|
+
/** First and last keyframe's values (up to 4 properties), e.g. `{ opacity: "0" }` → `{ opacity: "1" }`. */
|
|
33
|
+
from?: Record<string, string>
|
|
34
|
+
to?: Record<string, string>
|
|
28
35
|
pseudoElement?: string
|
|
29
36
|
}
|
|
30
37
|
|
package/types/index.d.ts
CHANGED
|
@@ -85,6 +85,8 @@ export interface ShellOptions {
|
|
|
85
85
|
* from it falls back to memory.
|
|
86
86
|
*/
|
|
87
87
|
server?: boolean
|
|
88
|
+
/** The project folder: source paths in notes are written relative to it. */
|
|
89
|
+
root?: string
|
|
88
90
|
/** The token mutating `/__retake/` requests carry. */
|
|
89
91
|
token?: string
|
|
90
92
|
}
|
package/types/next.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Types for `retake-dev/next`: Retake from a Next.js app's middleware
|
|
2
|
+
// (src/next.js). Dev only: outside `next dev` every request goes straight on.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A middleware (Next 16's `proxy.ts`, Next 15's `middleware.ts`): in `next dev`
|
|
6
|
+
* a top-level page load gets the dock, the dock's frame gets the page with the
|
|
7
|
+
* time runtime first in `<head>`, and `/__retake/*` is the session API (kept
|
|
8
|
+
* in `.retake/`, read by `retake mcp`). Everything else goes on as it was.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* // proxy.ts (Next 16)
|
|
12
|
+
* export { default } from "retake-dev/next"
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* // middleware.ts (Next 15: the Node.js runtime)
|
|
17
|
+
* import retake from "retake-dev/next"
|
|
18
|
+
* export default retake
|
|
19
|
+
* export const config = { runtime: "nodejs" }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Next reads `config` from your file as written (it can't be re-exported).
|
|
23
|
+
* With a matcher of your own, add these entries to it:
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* "/__retake/:path*",
|
|
27
|
+
* { source: "/((?!_next/static|_next/image).*)", has: [{ type: "header", key: "sec-fetch-mode", value: "navigate" }] },
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare const retake: (req: Request, event?: unknown) => Promise<Response | undefined>
|
|
31
|
+
export default retake
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Wraps a middleware of your own: in `next dev` Retake answers page loads and
|
|
35
|
+
* `/__retake/*` first; every other request (and every request outside
|
|
36
|
+
* `next dev`) goes to yours. The dock's frame is fetched through your
|
|
37
|
+
* middleware too, so its redirects, rewrites and headers apply to the page.
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { withRetake } from "retake-dev/next"
|
|
41
|
+
* export default withRetake(async (req) => { ... })
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export function withRetake<M extends (req: any, event?: any) => any>(middleware?: M): (req: Request, event?: unknown) => Promise<Awaited<ReturnType<M>> | Response | undefined>
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Retake's answer to a request, or `undefined` to let it through (always
|
|
48
|
+
* `undefined` outside `next dev`). For a middleware that decides itself.
|
|
49
|
+
*/
|
|
50
|
+
export function retakeResponse(req: Request): Promise<Response | undefined>
|