@1agh/maude 0.19.0 → 0.20.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/package.json +9 -9
- package/plugins/design/dev-server/annotations-context-toolbar.tsx +126 -44
- package/plugins/design/dev-server/annotations-layer.tsx +343 -112
- package/plugins/design/dev-server/api.ts +70 -17
- package/plugins/design/dev-server/artboard-marquee.tsx +174 -0
- package/plugins/design/dev-server/bin/asset-sweep.sh +180 -0
- package/plugins/design/dev-server/bin/visual-sanity.sh +221 -0
- package/plugins/design/dev-server/canvas-lib.tsx +691 -119
- package/plugins/design/dev-server/canvas-shell.tsx +818 -42
- package/plugins/design/dev-server/client/app.jsx +173 -52
- package/plugins/design/dev-server/client/hmr.mjs +28 -0
- package/plugins/design/dev-server/client/styles/1-tokens.css +15 -8
- package/plugins/design/dev-server/client/styles/4-components.css +32 -2
- package/plugins/design/dev-server/commands/annotation-strokes-command.ts +127 -0
- package/plugins/design/dev-server/commands/equal-spacing-command.ts +28 -0
- package/plugins/design/dev-server/commands/move-artboards-command.ts +158 -0
- package/plugins/design/dev-server/comments-overlay.tsx +12 -4
- package/plugins/design/dev-server/config.schema.json +31 -5
- package/plugins/design/dev-server/context-menu.tsx +3 -3
- package/plugins/design/dev-server/context.ts +37 -3
- package/plugins/design/dev-server/contextual-toolbar.tsx +241 -0
- package/plugins/design/dev-server/dist/client.bundle.js +212 -103
- package/plugins/design/dev-server/dist/runtime/motion.js +165 -0
- package/plugins/design/dev-server/dist/runtime/motion_react.js +409 -0
- package/plugins/design/dev-server/dist/styles.css +38 -2
- package/plugins/design/dev-server/equal-spacing-detector.ts +98 -0
- package/plugins/design/dev-server/equal-spacing-handles.tsx +289 -0
- package/plugins/design/dev-server/export-dialog.tsx +3 -3
- package/plugins/design/dev-server/handoff.ts +24 -0
- package/plugins/design/dev-server/http.ts +41 -2
- package/plugins/design/dev-server/input-router.tsx +74 -10
- package/plugins/design/dev-server/marquee-overlay.tsx +282 -0
- package/plugins/design/dev-server/runtime-bundle.ts +7 -0
- package/plugins/design/dev-server/server.mjs +84 -18
- package/plugins/design/dev-server/test/annotation-strokes-command.test.ts +149 -0
- package/plugins/design/dev-server/test/annotations-layer.test.ts +44 -0
- package/plugins/design/dev-server/test/canvas-lib-motion.test.ts +131 -0
- package/plugins/design/dev-server/test/context-resolve-tokens.test.ts +97 -0
- package/plugins/design/dev-server/test/equal-spacing-detector.test.ts +93 -0
- package/plugins/design/dev-server/test/input-router.test.ts +87 -1
- package/plugins/design/dev-server/test/marquee-overlay.test.ts +94 -0
- package/plugins/design/dev-server/test/move-artboards-command.test.ts +108 -0
- package/plugins/design/dev-server/test/snap-distance-pill.test.ts +68 -0
- package/plugins/design/dev-server/test/system-endpoint.test.ts +144 -0
- package/plugins/design/dev-server/test/undo-stack.test.ts +211 -0
- package/plugins/design/dev-server/test/use-cursor-modifiers.test.ts +59 -0
- package/plugins/design/dev-server/test/use-keyboard-discipline.test.ts +27 -0
- package/plugins/design/dev-server/test/use-undo-stack.test.tsx +193 -0
- package/plugins/design/dev-server/tool-palette.tsx +71 -15
- package/plugins/design/dev-server/undo-hud.tsx +95 -0
- package/plugins/design/dev-server/undo-stack.ts +240 -0
- package/plugins/design/dev-server/use-annotation-resize.tsx +295 -0
- package/plugins/design/dev-server/use-artboard-drag.tsx +6 -3
- package/plugins/design/dev-server/use-cursor-modifiers.tsx +122 -0
- package/plugins/design/dev-server/use-keyboard-discipline.tsx +125 -0
- package/plugins/design/dev-server/use-snap-guides.tsx +25 -1
- package/plugins/design/dev-server/use-tool-mode.tsx +31 -2
- package/plugins/design/dev-server/use-undo-stack.tsx +355 -0
- package/plugins/design/templates/_shell.html +17 -6
- package/plugins/design/templates/design-system-inspiration/SUB-AGENT-PROMPTS.md +245 -0
- package/plugins/design/templates/design-system-inspiration/_MAPPING.md +2 -2
- package/plugins/design/templates/design-system-inspiration/core/preview/_components.css.tpl +129 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/_motion-readme.md.tpl +63 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/motion.css.tpl +106 -0
- package/plugins/design/templates/design-system-inspiration/core/preview/motion.tsx.tpl +208 -0
- /package/plugins/design/templates/design-system-inspiration/core/preview/{motion.html → .archive/motion.html} +0 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @canvas motion — motion vocabulary (Phase 3.7 / DDR-049 playground).
|
|
3
|
+
* 8 role tiles looping on first paint, 4 token-derived playback
|
|
4
|
+
* chips, 2 easing-curve SVGs derived from token cubic-bezier
|
|
5
|
+
* control points. Reduced-motion toggle for in-browser
|
|
6
|
+
* inspection without OS settings.
|
|
7
|
+
* @ds {{ds_dirname}}
|
|
8
|
+
* @platform desktop
|
|
9
|
+
* @opt_out none
|
|
10
|
+
* @artboards primary
|
|
11
|
+
* @brief MDCC-DSN/01.motion / {{project_label}}
|
|
12
|
+
* @stack React 19 · TSX · Bun.build · css_mode=inline
|
|
13
|
+
* @history .design/_history/motion/
|
|
14
|
+
* @handoff bunx shadcn add file://./motion.registry.json
|
|
15
|
+
*
|
|
16
|
+
* SPECIMEN: motion
|
|
17
|
+
* DEMONSTRATES: --dur-flip · --dur-panel · --dur-route · --dur-soft ·
|
|
18
|
+
* --ease-out · --ease-in-out · prefers-reduced-motion guard ·
|
|
19
|
+
* <MotionDemo role> 8-role vocabulary · TokenPlayback chips
|
|
20
|
+
* COMPOSITION: 8 role tiles looping always · 4 token chips · 2 curve SVGs ·
|
|
21
|
+
* reduced-motion toggle · inline a11y note
|
|
22
|
+
* COPY VOICE: role-named ("Flip", "Panel slide", "Route enter", ...)
|
|
23
|
+
* WHEN SCAFFOLDED: always (Core, gated on motion ∈ activeFamilies which is
|
|
24
|
+
* default-on)
|
|
25
|
+
*
|
|
26
|
+
* BOUNDED GEOMETRY (ANIMATION SAFETY, SUB-AGENT-PROMPTS.md):
|
|
27
|
+
* Every <MotionDemo> root has overflow: hidden inline (set in canvas-lib).
|
|
28
|
+
* Sparkle / pulse / twinkle keyframes (scale 0→1→0) are demonstrated ONLY
|
|
29
|
+
* on the 32×32 sparkle chip inside the "presence" tile — NEVER on the full
|
|
30
|
+
* tile. The bounding box of a rotating element extends √2× at 45°; tile
|
|
31
|
+
* chrome would overflow without the explicit clip.
|
|
32
|
+
*
|
|
33
|
+
* REDUCED-MOTION:
|
|
34
|
+
* <ReducedMotionToggle/> on the chrome row flips data-reduced-motion="true"
|
|
35
|
+
* on <html>. The motion specimen is the documented exception to the
|
|
36
|
+
* OS-level prefers-reduced-motion contract — reviewers need both branches
|
|
37
|
+
* visible side-by-side. <MotionDemo> programmatically short-circuits its
|
|
38
|
+
* animate prop when useReducedMotion() returns true (the contract is
|
|
39
|
+
* enforced in two places: CSS --dur-*: 1ms collapse + JS short-circuit).
|
|
40
|
+
*/
|
|
41
|
+
import "../colors_and_type.css";
|
|
42
|
+
import "./_layout.css";
|
|
43
|
+
import "./motion.css";
|
|
44
|
+
import {
|
|
45
|
+
MotionDemo,
|
|
46
|
+
MotionTrack,
|
|
47
|
+
TokenPlayback,
|
|
48
|
+
ReducedMotionToggle,
|
|
49
|
+
useMotionTokens,
|
|
50
|
+
} from "@maude/canvas-lib";
|
|
51
|
+
|
|
52
|
+
export default function Motion() {
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<header className="specimen-hd">
|
|
56
|
+
<span className="sku">MDCC-DSN/01.motion</span>
|
|
57
|
+
<span className="crumbs">{{project_label}} · motion vocabulary · 8 roles · 4 tokens</span>
|
|
58
|
+
<span className="theme-toggle-slot">
|
|
59
|
+
<ReducedMotionToggle />
|
|
60
|
+
</span>
|
|
61
|
+
</header>
|
|
62
|
+
|
|
63
|
+
<main className="specimen">
|
|
64
|
+
<section className="specimen-title">
|
|
65
|
+
<h1>Motion</h1>
|
|
66
|
+
<p className="lede">
|
|
67
|
+
Eight roles. Four durations × two eases. Every animation in the
|
|
68
|
+
system maps to one role; <code><MotionDemo role="…"></code>{" "}
|
|
69
|
+
from <code>@maude/canvas-lib</code> is the only legal authoring
|
|
70
|
+
surface (CSS-only escape hatch via <code>.motion-*</code> classes).
|
|
71
|
+
Roles loop on first paint — hover not required.
|
|
72
|
+
</p>
|
|
73
|
+
</section>
|
|
74
|
+
|
|
75
|
+
<section className="motion-roles">
|
|
76
|
+
<h2>Roles</h2>
|
|
77
|
+
<div className="motion-grid">
|
|
78
|
+
<RoleTile name="Flip" role="flip" token="--dur-flip" ease="--ease-out" note="Press-down, hover lift, single-card flip." />
|
|
79
|
+
<RoleTile name="Panel slide" role="panel" token="--dur-panel" ease="--ease-in-out" note="Drawer / sidebar / segmented." />
|
|
80
|
+
<RoleTile name="Route enter" role="route" token="--dur-route" ease="--ease-out" note="Page transition. Opacity + tiny scale." />
|
|
81
|
+
<RoleTile name="Soft fade" role="soft" token="--dur-soft" ease="--ease-out" note="Toast, tooltip, soft reveal." />
|
|
82
|
+
<RoleTile name="Spring snap" role="spring" token="--dur-panel" ease="spring" note="Use only when brief asks for tactile/playful." />
|
|
83
|
+
<RoleTile name="Scroll link" role="scroll" token="--dur-route" ease="--ease-in-out" note="Scroll-progress-bound entry." />
|
|
84
|
+
<RoleTile name="Drag spring" role="drag" token="--dur-flip" ease="--ease-out" note="Pick up + release rotational settle." />
|
|
85
|
+
<RoleTile name="Presence" role="presence" token="--dur-soft" ease="--ease-out" sparkle note="Sparkle demo — 32×32 chip ONLY." />
|
|
86
|
+
</div>
|
|
87
|
+
</section>
|
|
88
|
+
|
|
89
|
+
<section className="motion-tokens">
|
|
90
|
+
<h2>Token playback (click to replay)</h2>
|
|
91
|
+
<p className="lede">
|
|
92
|
+
Each chip fires its token verbatim once. The numeric ms value
|
|
93
|
+
is the live <code>getComputedStyle</code> read, so token edits to{" "}
|
|
94
|
+
<code>colors_and_type.css</code> reflect here without a rebuild.
|
|
95
|
+
</p>
|
|
96
|
+
<MotionTrack>
|
|
97
|
+
<TokenPlayback duration="--dur-flip" easing="--ease-out" label="--dur-flip" />
|
|
98
|
+
<TokenPlayback duration="--dur-soft" easing="--ease-out" label="--dur-soft" />
|
|
99
|
+
<TokenPlayback duration="--dur-panel" easing="--ease-in-out" label="--dur-panel" />
|
|
100
|
+
<TokenPlayback duration="--dur-route" easing="--ease-out" label="--dur-route" />
|
|
101
|
+
</MotionTrack>
|
|
102
|
+
</section>
|
|
103
|
+
|
|
104
|
+
<section className="motion-curves">
|
|
105
|
+
<h2>Easing curves</h2>
|
|
106
|
+
<p className="lede">
|
|
107
|
+
Both curves derived from the token's live{" "}
|
|
108
|
+
<code>cubic-bezier(x1, y1, x2, y2)</code> value — not hand-drawn.
|
|
109
|
+
Edit the token in <code>colors_and_type.css</code>; the curve
|
|
110
|
+
redraws.
|
|
111
|
+
</p>
|
|
112
|
+
<div className="motion-curves__row">
|
|
113
|
+
<EasingCurve label="--ease-out" cssVar="--ease-out" />
|
|
114
|
+
<EasingCurve label="--ease-in-out" cssVar="--ease-in-out" />
|
|
115
|
+
</div>
|
|
116
|
+
</section>
|
|
117
|
+
|
|
118
|
+
<section className="motion-a11y">
|
|
119
|
+
<h2>Reduced motion</h2>
|
|
120
|
+
<p className="lede">
|
|
121
|
+
OS-level <code>@media (prefers-reduced-motion: reduce)</code>{" "}
|
|
122
|
+
collapses every <code>--dur-*</code> to <code>1ms</code> at the CSS
|
|
123
|
+
layer. <code><MotionDemo></code> additionally short-circuits
|
|
124
|
+
its <code>animate</code> prop via{" "}
|
|
125
|
+
<code>useReducedMotion()</code> from <code>motion/react</code>{" "}
|
|
126
|
+
(belt + suspenders — the a11y invariant deserves both). The toggle
|
|
127
|
+
on the chrome row above flips{" "}
|
|
128
|
+
<code>data-reduced-motion="true"</code> on <code><html></code>{" "}
|
|
129
|
+
for in-browser inspection without OS settings; specimen chrome is
|
|
130
|
+
the documented exception to OS-level honor.
|
|
131
|
+
</p>
|
|
132
|
+
</section>
|
|
133
|
+
</main>
|
|
134
|
+
</>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
interface RoleTileProps {
|
|
139
|
+
name: string;
|
|
140
|
+
role:
|
|
141
|
+
| "flip"
|
|
142
|
+
| "panel"
|
|
143
|
+
| "route"
|
|
144
|
+
| "soft"
|
|
145
|
+
| "spring"
|
|
146
|
+
| "scroll"
|
|
147
|
+
| "drag"
|
|
148
|
+
| "presence";
|
|
149
|
+
token: string;
|
|
150
|
+
ease: string;
|
|
151
|
+
note: string;
|
|
152
|
+
sparkle?: boolean;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function RoleTile({ name, role, token, ease, note, sparkle = false }: RoleTileProps) {
|
|
156
|
+
return (
|
|
157
|
+
<div className="motion-card">
|
|
158
|
+
<strong>{name}</strong>
|
|
159
|
+
<div className="motion-card__stage">
|
|
160
|
+
<MotionDemo role={role} loop="always" small={sparkle} label={`${role} demo`} />
|
|
161
|
+
</div>
|
|
162
|
+
<code className="motion-card__tokens">
|
|
163
|
+
{token} · {ease}
|
|
164
|
+
</code>
|
|
165
|
+
<span className="motion-card__note">{note}</span>
|
|
166
|
+
</div>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Derives a Bezier path from a CSS easing token's live cubic-bezier(x1, y1,
|
|
172
|
+
* x2, y2) value. Falls back to a sane default when the token isn't readable
|
|
173
|
+
* (SSR, detached). The path is fitted to a 100×100 viewBox; y-axis is
|
|
174
|
+
* flipped so progress goes bottom-left to top-right the way curves are read
|
|
175
|
+
* in editor previews.
|
|
176
|
+
*/
|
|
177
|
+
function EasingCurve({ label, cssVar }: { label: string; cssVar: string }) {
|
|
178
|
+
const tokens = useMotionTokens();
|
|
179
|
+
const live = tokens.easings[cssVar] ?? "";
|
|
180
|
+
const match = live.match(/cubic-bezier\(([^)]+)\)/);
|
|
181
|
+
const [x1, y1, x2, y2] = match
|
|
182
|
+
? match[1].split(",").map((s) => parseFloat(s.trim()))
|
|
183
|
+
: cssVar === "--ease-in-out"
|
|
184
|
+
? [0.4, 0, 0.2, 1]
|
|
185
|
+
: [0, 0, 0.2, 1];
|
|
186
|
+
const path = `M 0 100 C ${x1 * 100} ${100 - y1 * 100} ${x2 * 100} ${100 - y2 * 100} 100 0`;
|
|
187
|
+
return (
|
|
188
|
+
<figure className="motion-curve">
|
|
189
|
+
<svg viewBox="0 0 100 100" width="120" height="120" aria-hidden="true">
|
|
190
|
+
<rect x="0" y="0" width="100" height="100" fill="var(--bg-1)" />
|
|
191
|
+
<path
|
|
192
|
+
d="M 0 100 L 100 100 M 0 100 L 0 0"
|
|
193
|
+
stroke="var(--border-default, currentColor)"
|
|
194
|
+
strokeWidth="1"
|
|
195
|
+
fill="none"
|
|
196
|
+
opacity="0.4"
|
|
197
|
+
/>
|
|
198
|
+
<path d={path} stroke="var(--accent)" strokeWidth="2" fill="none" />
|
|
199
|
+
</svg>
|
|
200
|
+
<figcaption>
|
|
201
|
+
<code>{label}</code>
|
|
202
|
+
<span className="motion-curve__values">
|
|
203
|
+
{x1.toFixed(2)}, {y1.toFixed(2)}, {x2.toFixed(2)}, {y2.toFixed(2)}
|
|
204
|
+
</span>
|
|
205
|
+
</figcaption>
|
|
206
|
+
</figure>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
File without changes
|