transitions-refine 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/demo.html +451 -672
- package/package.json +1 -1
- package/server/inject.mjs +3 -5
- package/server/relay.mjs +39 -6
package/README.md
CHANGED
|
@@ -4,7 +4,9 @@ A live, agent-driven **Refine** panel for CSS and [Motion](https://motion.dev) t
|
|
|
4
4
|
|
|
5
5
|
The feedback shows up **in a panel that slides in from the right** — not in your chat — and you pick which suggestions to apply. Applied suggestions are **live overrides** (instant preview, reversible) — the same path as dragging the timeline bars. When you're happy, **Accept** writes those values back into your source via the agent.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
There's **no play button or scrubber** — the running component *is* the preview. Any edit (a dragged bar, an inspector tweak, or an applied suggestion) is written straight onto the live element as an inline `transition`, so you see it the next time you trigger the transition (open the dropdown, hover the card, …). Reset reverts the element to its source.
|
|
8
|
+
|
|
9
|
+
Real components rarely live in one CSS rule. A dropdown has an **Open** and a **Close** phase, each animating several elements (panel, backdrop, staggered items) with different timings — and the close phase usually isn't even in the DOM while the panel is open. So when the panel opens it also asks the agent to **read your source and group** the page's transitions into components → phases → member elements. You then pick a whole phase (e.g. *Dropdown · Open*) and see every sub-transition as a labeled lane on one shared timeline. If no agent is live, the panel falls back to the flat DOM scan with no regression.
|
|
8
10
|
|
|
9
11
|
Inspired by the [impeccable.style](https://impeccable.style/live-mode/) "live" pattern: the browser drops a job in a tiny local relay, and the relay answers it with **one agent run per click**. No standing loop, nothing to start per click — you just keep the relay running.
|
|
10
12
|
|
|
@@ -51,14 +53,16 @@ After `--llm`, make sure the CLI is authenticated once: run `cursor-agent` to lo
|
|
|
51
53
|
You can also point the relay at any one-shot agent CLI via `REFINE_AGENT_CMD` (the relay feeds it the prompt on stdin and reads a JSON result from stdout):
|
|
52
54
|
|
|
53
55
|
```bash
|
|
54
|
-
REFINE_AGENT_CMD='cursor-agent -p' npm run relay # or: codex exec - | claude -p
|
|
56
|
+
REFINE_AGENT_CMD='cursor-agent -p --trust --force' npm run relay # or: codex exec - | claude -p
|
|
55
57
|
```
|
|
56
58
|
|
|
59
|
+
For `cursor-agent` the relay auto-appends any missing `-p`/`--trust`/`--force`, so headless jobs never stall on the workspace-trust prompt (a bare `cursor-agent` goes interactive and exits 1). `-p` = headless/print mode (prompt on stdin), `--trust` = trust the workspace without prompting (only valid with `--print`), `--force` = auto-allow tool calls so apply/scan jobs don't hang on approval.
|
|
60
|
+
|
|
57
61
|
The CLI must have the `transitions-dev` skill available (the prompt tells it to read the skill).
|
|
58
62
|
|
|
59
63
|
## Grouped scan — Open / Close phases
|
|
60
64
|
|
|
61
|
-
When the panel opens it posts a **scan job** to the relay; the agent reads your source and returns the page's animated components, each split into phases (`open`, `close`, …) with their **member elements** and the *real* per-state timings — including the close transition the DOM can't show you. The picker then groups by component, you select a phase, and the timeline renders one lane per member-property (each lane labeled with its member) on a single time axis so stagger and delays line up. **
|
|
65
|
+
When the panel opens it posts a **scan job** to the relay; the agent reads your source and returns the page's animated components, each split into phases (`open`, `close`, …) with their **member elements** and the *real* per-state timings — including the close transition the DOM can't show you. The picker then groups by component, you select a phase, and the timeline renders one lane per member-property (each lane labeled with its member) on a single time axis so stagger and delays line up. Editing any lane applies **live** as an inline `transition` on that member element, so triggering the component yourself (open/close it) previews the whole phase with your values; **Accept** writes back to the correct state rule (`.is-open` vs `.is-closing`) per member.
|
|
62
66
|
|
|
63
67
|
Grouping needs the agent (`/refine live`, `--llm`, or `REFINE_AGENT_CMD`); with no agent the panel just shows the flat DOM scan as before.
|
|
64
68
|
|
|
@@ -71,7 +75,7 @@ Grouping needs the agent (`/refine live`, `--llm`, or `REFINE_AGENT_CMD`); with
|
|
|
71
75
|
|
|
72
76
|
The **Accept** button (next to Refine) is enabled whenever the selected transition has unsaved changes — whether you edited the bars/easing by hand or applied a Refine suggestion. Pressing it sends an **apply job** to the relay: the agent finds where that transition is declared in your source (plain CSS, CSS Modules, styled-components/emotion, Tailwind, or inline styles), edits only the changed timings, and reports back. The button shows a spinner while saving and flips to **Done** on success.
|
|
73
77
|
|
|
74
|
-
Like Replace, Accept needs the agent — run `/refine live` (or `--llm` / `REFINE_AGENT_CMD`). The deterministic answerer can't edit files.
|
|
78
|
+
Like Replace, Accept needs the agent — run `/refine live` (or `--llm` / `REFINE_AGENT_CMD`). The deterministic answerer can't edit files.
|
|
75
79
|
|
|
76
80
|
## Pieces
|
|
77
81
|
|