@1agh/maude 0.29.0 → 0.31.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/README.md +6 -6
- package/apps/studio/acp/bridge.ts +285 -0
- package/apps/studio/acp/env.ts +48 -0
- package/apps/studio/acp/index.ts +132 -0
- package/apps/studio/acp/probe.ts +112 -0
- package/apps/studio/acp/transcript.ts +149 -0
- package/apps/studio/ai-banner.tsx +0 -1
- package/apps/studio/annotations-align.ts +149 -0
- package/apps/studio/annotations-bindings.ts +197 -0
- package/apps/studio/annotations-context-toolbar.tsx +436 -186
- package/apps/studio/annotations-groups.ts +270 -0
- package/apps/studio/annotations-layer.tsx +1714 -1661
- package/apps/studio/annotations-model.ts +2077 -0
- package/apps/studio/annotations-snap.ts +125 -0
- package/apps/studio/api.ts +433 -182
- package/apps/studio/bin/_png-playwright.mjs +1 -1
- package/apps/studio/bin/annotate.mjs +732 -0
- package/apps/studio/bin/annotate.sh +17 -0
- package/apps/studio/bin/chat-open.sh +44 -0
- package/apps/studio/bin/read-annotations.mjs +152 -17
- package/apps/studio/build.ts +1 -1
- package/apps/studio/canvas-arrowheads.ts +78 -9
- package/apps/studio/canvas-cursors.ts +2 -0
- package/apps/studio/canvas-edit.ts +257 -7
- package/apps/studio/canvas-icons.tsx +105 -0
- package/apps/studio/canvas-lib.tsx +112 -19
- package/apps/studio/canvas-list-watch.ts +177 -0
- package/apps/studio/canvas-shell.tsx +326 -9
- package/apps/studio/client/app.jsx +3579 -250
- package/apps/studio/client/canvas-url.js +5 -0
- package/apps/studio/client/github.js +99 -0
- package/apps/studio/client/index.html +1 -1
- package/apps/studio/client/panels/ChatPanel.jsx +770 -0
- package/apps/studio/client/panels/CollabModelInfographic.jsx +71 -0
- package/apps/studio/client/panels/CreateProject.jsx +334 -0
- package/apps/studio/client/panels/DiffView.jsx +590 -0
- package/apps/studio/client/panels/GitPanel.jsx +767 -0
- package/apps/studio/client/panels/IdentityBar.jsx +294 -0
- package/apps/studio/client/panels/OnboardingWizard.jsx +563 -0
- package/apps/studio/client/panels/RepoBranchSwitcher.jsx +349 -0
- package/apps/studio/client/panels/acp-runtime.js +286 -0
- package/apps/studio/client/panels/chat-markdown.jsx +138 -0
- package/apps/studio/client/panels/git-grouping.js +86 -0
- package/apps/studio/client/styles/0-reset.css +4 -0
- package/apps/studio/client/styles/3-shell-maude.css +1326 -14
- package/apps/studio/client/styles/4-components.css +39 -0
- package/apps/studio/client/styles/5-maude-overrides.css +41 -2
- package/apps/studio/client/styles/6-acp-chat.css +771 -0
- package/apps/studio/client/styles/_index.css +2 -0
- package/apps/studio/client/tour/collab-tour.js +61 -0
- package/apps/studio/client/tour/overlay.jsx +116 -18
- package/apps/studio/client/tour/usage-tour.js +23 -10
- package/apps/studio/client/whats-new.jsx +25 -10
- package/apps/studio/collab/registry.ts +13 -0
- package/apps/studio/collab/room.ts +36 -0
- package/apps/studio/commands/annotation-strokes-command.ts +1 -1
- package/apps/studio/commands/move-artboards-command.ts +1 -1
- package/apps/studio/comments-overlay.tsx +7 -5
- package/apps/studio/context-menu.tsx +4 -3
- package/apps/studio/contextual-toolbar.tsx +14 -0
- package/apps/studio/cursors-overlay.tsx +37 -21
- package/apps/studio/dist/client.bundle.js +31795 -1829
- package/apps/studio/dist/comment-mount.js +97 -9
- package/apps/studio/dist/styles.css +7938 -1599
- package/apps/studio/dom-selection.ts +115 -0
- package/apps/studio/export-dialog.tsx +3 -3
- package/apps/studio/git/endpoints.ts +338 -0
- package/apps/studio/git/service.ts +1334 -0
- package/apps/studio/git/watch.ts +97 -0
- package/apps/studio/github/endpoints.ts +358 -0
- package/apps/studio/github/service.ts +231 -0
- package/apps/studio/github/token.ts +53 -0
- package/apps/studio/history.ts +20 -3
- package/apps/studio/hmr-broadcast.ts +9 -2
- package/apps/studio/http.ts +508 -6
- package/apps/studio/input-router.tsx +7 -0
- package/apps/studio/inspect.ts +37 -8
- package/apps/studio/participants-chrome.tsx +70 -16
- package/apps/studio/paths.ts +12 -0
- package/apps/studio/scaffold-design.ts +57 -0
- package/apps/studio/server.ts +70 -4
- package/apps/studio/sync/agent.ts +311 -57
- package/apps/studio/sync/codec.ts +69 -0
- package/apps/studio/sync/cold-start.ts +198 -0
- package/apps/studio/sync/connection-state.ts +58 -2
- package/apps/studio/sync/hub-link.ts +137 -0
- package/apps/studio/sync/index.ts +563 -221
- package/apps/studio/sync/journal.ts +190 -0
- package/apps/studio/sync/migrate-seed.ts +202 -44
- package/apps/studio/sync/projection.ts +22 -3
- package/apps/studio/sync/status.ts +15 -4
- package/apps/studio/test/acp-bridge.test.ts +127 -0
- package/apps/studio/test/acp-env.test.ts +65 -0
- package/apps/studio/test/acp-origin-gate.test.ts +78 -0
- package/apps/studio/test/acp-transcript.test.ts +112 -0
- package/apps/studio/test/activity.test.ts +1 -7
- package/apps/studio/test/annotate-write.test.ts +184 -0
- package/apps/studio/test/annotations-align.test.ts +88 -0
- package/apps/studio/test/annotations-bindings.test.ts +124 -0
- package/apps/studio/test/annotations-groups.test.ts +231 -0
- package/apps/studio/test/annotations-snap.test.ts +79 -0
- package/apps/studio/test/canvas-create-api.test.ts +72 -0
- package/apps/studio/test/canvas-edit.test.ts +181 -1
- package/apps/studio/test/canvas-list-watch.test.ts +322 -0
- package/apps/studio/test/canvas-meta-api.test.ts +161 -27
- package/apps/studio/test/canvas-origin-gate.test.ts +43 -0
- package/apps/studio/test/chat-markdown.test.tsx +58 -0
- package/apps/studio/test/collab-bridge.test.ts +0 -2
- package/apps/studio/test/collab-room.test.ts +2 -7
- package/apps/studio/test/collab-session-survival.test.tsx +176 -0
- package/apps/studio/test/csp-canvas-shell.test.ts +5 -0
- package/apps/studio/test/csrf-write-guard.test.ts +78 -0
- package/apps/studio/test/editing-presence.test.ts +103 -0
- package/apps/studio/test/figjam-v3-model.test.ts +342 -0
- package/apps/studio/test/fixtures/figjam-v3-groups-bindings.svg +1 -0
- package/apps/studio/test/fixtures/mock-acp-agent.mjs +45 -0
- package/apps/studio/test/git-api.test.ts +0 -0
- package/apps/studio/test/git-branches.test.ts +106 -0
- package/apps/studio/test/git-grouping.test.ts +106 -0
- package/apps/studio/test/git-watch.test.ts +97 -0
- package/apps/studio/test/github-api.test.ts +465 -0
- package/apps/studio/test/hub-link.test.ts +69 -0
- package/apps/studio/test/participants-chrome.test.ts +36 -1
- package/apps/studio/test/shared-doc-migrate.test.ts +224 -14
- package/apps/studio/test/sync-agent.test.ts +272 -2
- package/apps/studio/test/sync-codec.test.ts +65 -0
- package/apps/studio/test/sync-cold-seed-dedup.test.ts +187 -0
- package/apps/studio/test/sync-cold-start.test.ts +304 -0
- package/apps/studio/test/sync-connection-state.test.ts +68 -0
- package/apps/studio/test/sync-hardening.test.ts +0 -8
- package/apps/studio/test/sync-hubs-config.test.ts +0 -1
- package/apps/studio/test/sync-incident-replay.test.ts +211 -0
- package/apps/studio/test/sync-journal.test.ts +176 -0
- package/apps/studio/test/sync-runtime.test.ts +360 -5
- package/apps/studio/test/sync-status.test.ts +66 -0
- package/apps/studio/test/tour-overlay.test.tsx +18 -0
- package/apps/studio/test/use-annotation-resize.test.ts +159 -0
- package/apps/studio/test/use-artboard-drag.test.ts +0 -1
- package/apps/studio/test/use-collab.test.ts +0 -0
- package/apps/studio/test/use-tool-mode.test.tsx +5 -2
- package/apps/studio/tool-palette.tsx +30 -11
- package/apps/studio/undo-hud.tsx +0 -1
- package/apps/studio/use-agent-presence.tsx +4 -2
- package/apps/studio/use-annotation-resize.tsx +484 -54
- package/apps/studio/use-annotation-selection.tsx +16 -4
- package/apps/studio/use-canvas-activity.tsx +2 -2
- package/apps/studio/use-chrome-visibility.tsx +66 -0
- package/apps/studio/use-collab.tsx +434 -202
- package/apps/studio/use-selection-set.tsx +9 -0
- package/apps/studio/use-tool-mode.tsx +5 -1
- package/apps/studio/whats-new.json +208 -10
- package/apps/studio/whats-new.schema.json +18 -2
- package/apps/studio/ws.ts +44 -1
- package/cli/commands/design-link.test.mjs +84 -0
- package/cli/commands/design.mjs +3 -1
- package/cli/commands/design.test.mjs +5 -1
- package/cli/lib/design-link.mjs +51 -1
- package/cli/lib/gitignore-block.mjs +16 -3
- package/cli/lib/gitignore-block.test.mjs +13 -1
- package/package.json +11 -9
- package/plugins/design/dependencies.json +17 -0
- package/plugins/design/templates/_shell.html +58 -12
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file annotations-snap.ts — FigJam v3 drag snapping + smart guides
|
|
3
|
+
* @scope apps/studio/annotations-snap.ts
|
|
4
|
+
* @purpose Pure math (no React, no DOM) for edge/center snapping while
|
|
5
|
+
* dragging annotation strokes. Candidates are the bboxes of the
|
|
6
|
+
* non-moved strokes plus the artboard rects; per axis the nearest
|
|
7
|
+
* candidate line within the threshold wins and contributes one
|
|
8
|
+
* guide line for the overlay to paint. Hold ⌘ to suppress
|
|
9
|
+
* (handled by the caller — Figma/FigJam convention).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export interface SnapBox {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
w: number;
|
|
16
|
+
h: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface SnapGuide {
|
|
20
|
+
/** `x` = a vertical guide at x=`at`; `y` = a horizontal guide at y=`at`. */
|
|
21
|
+
axis: 'x' | 'y';
|
|
22
|
+
at: number;
|
|
23
|
+
from: number;
|
|
24
|
+
to: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface SnapResult {
|
|
28
|
+
dx: number;
|
|
29
|
+
dy: number;
|
|
30
|
+
guides: SnapGuide[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Snap threshold in world px at zoom 1 (callers scale by 1/zoom). */
|
|
34
|
+
export const SNAP_THRESHOLD_PX = 6;
|
|
35
|
+
|
|
36
|
+
/** Dot-grid pitch in world px — mirrors the DS `--canvas-grid` token (24px). */
|
|
37
|
+
export const GRID_PITCH_PX = 24;
|
|
38
|
+
|
|
39
|
+
const NO_SNAP: SnapResult = { dx: 0, dy: 0, guides: [] };
|
|
40
|
+
|
|
41
|
+
function lines(b: SnapBox, axis: 'x' | 'y'): [number, number, number] {
|
|
42
|
+
return axis === 'x' ? [b.x, b.x + b.w / 2, b.x + b.w] : [b.y, b.y + b.h / 2, b.y + b.h];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Nearest grid-line correction for one axis position. The dot grid is a
|
|
47
|
+
* world-space lattice at `pitch`; the stroke's leading edge snaps to it.
|
|
48
|
+
*/
|
|
49
|
+
function gridDelta(pos: number, pitch: number, threshold: number): number | null {
|
|
50
|
+
const nearest = Math.round(pos / pitch) * pitch;
|
|
51
|
+
const d = nearest - pos;
|
|
52
|
+
return Math.abs(d) <= threshold ? d : null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Best snap correction for the moving bbox against the candidates. The two
|
|
57
|
+
* axes resolve independently (FigJam: a drag can snap horizontally to one
|
|
58
|
+
* neighbour and vertically to another). Edges AND centers participate.
|
|
59
|
+
*
|
|
60
|
+
* Grid snapping (`opts.grid`): when an axis finds NO stroke/artboard snap, its
|
|
61
|
+
* leading edge falls back to the canvas dot grid — weaker than smart guides
|
|
62
|
+
* (geometry alignment wins over the lattice) and silent (no guide line, the
|
|
63
|
+
* dots themselves are the visual). ⌘ suppresses both via the caller.
|
|
64
|
+
*/
|
|
65
|
+
export function computeSnap(
|
|
66
|
+
moving: SnapBox,
|
|
67
|
+
candidates: readonly SnapBox[],
|
|
68
|
+
threshold: number,
|
|
69
|
+
opts?: { grid?: number }
|
|
70
|
+
): SnapResult {
|
|
71
|
+
const grid = opts?.grid ?? 0;
|
|
72
|
+
if (threshold <= 0 || (candidates.length === 0 && grid <= 0)) return NO_SNAP;
|
|
73
|
+
let bestX: { d: number; at: number; cand: SnapBox } | null = null;
|
|
74
|
+
let bestY: { d: number; at: number; cand: SnapBox } | null = null;
|
|
75
|
+
const mx = lines(moving, 'x');
|
|
76
|
+
const my = lines(moving, 'y');
|
|
77
|
+
for (const c of candidates) {
|
|
78
|
+
const cx = lines(c, 'x');
|
|
79
|
+
const cy = lines(c, 'y');
|
|
80
|
+
for (const m of mx) {
|
|
81
|
+
for (const v of cx) {
|
|
82
|
+
const d = v - m;
|
|
83
|
+
if (Math.abs(d) <= threshold && (!bestX || Math.abs(d) < Math.abs(bestX.d))) {
|
|
84
|
+
bestX = { d, at: v, cand: c };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
for (const m of my) {
|
|
89
|
+
for (const v of cy) {
|
|
90
|
+
const d = v - m;
|
|
91
|
+
if (Math.abs(d) <= threshold && (!bestY || Math.abs(d) < Math.abs(bestY.d))) {
|
|
92
|
+
bestY = { d, at: v, cand: c };
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Grid fallback per axis — only where no smart-guide candidate won.
|
|
98
|
+
let gridDx: number | null = null;
|
|
99
|
+
let gridDy: number | null = null;
|
|
100
|
+
if (grid > 0) {
|
|
101
|
+
if (!bestX) gridDx = gridDelta(moving.x, grid, threshold);
|
|
102
|
+
if (!bestY) gridDy = gridDelta(moving.y, grid, threshold);
|
|
103
|
+
}
|
|
104
|
+
if (!bestX && !bestY && gridDx == null && gridDy == null) return NO_SNAP;
|
|
105
|
+
const dx = bestX?.d ?? gridDx ?? 0;
|
|
106
|
+
const dy = bestY?.d ?? gridDy ?? 0;
|
|
107
|
+
const guides: SnapGuide[] = [];
|
|
108
|
+
if (bestX) {
|
|
109
|
+
guides.push({
|
|
110
|
+
axis: 'x',
|
|
111
|
+
at: bestX.at,
|
|
112
|
+
from: Math.min(moving.y + dy, bestX.cand.y),
|
|
113
|
+
to: Math.max(moving.y + moving.h + dy, bestX.cand.y + bestX.cand.h),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (bestY) {
|
|
117
|
+
guides.push({
|
|
118
|
+
axis: 'y',
|
|
119
|
+
at: bestY.at,
|
|
120
|
+
from: Math.min(moving.x + dx, bestY.cand.x),
|
|
121
|
+
to: Math.max(moving.x + moving.w + dx, bestY.cand.x + bestY.cand.w),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return { dx, dy, guides };
|
|
125
|
+
}
|