@1agh/maude 1.7.1 → 1.9.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/apps/studio/acp/bridge.ts +15 -2
- package/apps/studio/acp/login-state.ts +1 -0
- package/apps/studio/acp/probe.ts +52 -1
- package/apps/studio/api.ts +431 -39
- package/apps/studio/asset-upload.ts +174 -0
- package/apps/studio/assets-s3.ts +37 -2
- package/apps/studio/bin/_curl-local.mjs +7 -0
- package/apps/studio/bin/_pdf-playwright.mjs +22 -1
- package/apps/studio/bin/_png-playwright.mjs +20 -1
- package/apps/studio/bin/_region.mjs +92 -0
- package/apps/studio/bin/annotate.mjs +16 -7
- package/apps/studio/bin/read-annotations.mjs +62 -4
- package/apps/studio/canvas-build.ts +59 -4
- package/apps/studio/canvas-lib.tsx +48 -1
- package/apps/studio/canvas-shell.tsx +28 -4
- package/apps/studio/client/app.jsx +441 -15903
- package/apps/studio/client/canvas-url.js +9 -0
- package/apps/studio/client/dialogs/asset-picker.jsx +331 -0
- package/apps/studio/client/dialogs/command-palette.jsx +112 -0
- package/apps/studio/client/dialogs/export-dialog.jsx +782 -0
- package/apps/studio/client/dialogs/help-modal.jsx +324 -0
- package/apps/studio/client/dialogs/shortcuts-overlay.jsx +144 -0
- package/apps/studio/client/embed-view.jsx +284 -0
- package/apps/studio/client/embed.js +101 -0
- package/apps/studio/client/export-center.jsx +2 -0
- package/apps/studio/client/github.js +36 -3
- package/apps/studio/client/hooks/use-canvas-bridge.jsx +2150 -0
- package/apps/studio/client/hooks/use-git-actions.jsx +236 -0
- package/apps/studio/client/hooks/use-keyboard-shortcuts.jsx +297 -0
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +474 -0
- package/apps/studio/client/hooks/use-photo-and-timeline.jsx +901 -0
- package/apps/studio/client/hooks/use-project-data.jsx +90 -0
- package/apps/studio/client/hooks/use-shell-core.jsx +1212 -0
- package/apps/studio/client/hooks/use-tabs.jsx +723 -0
- package/apps/studio/client/hooks/use-web-socket.jsx +13 -0
- package/apps/studio/client/inspector/artboard-knobs.jsx +456 -0
- package/apps/studio/client/inspector/color-picker.jsx +196 -0
- package/apps/studio/client/inspector/color.js +92 -0
- package/apps/studio/client/inspector/css-knobs.jsx +1720 -0
- package/apps/studio/client/inspector/css-vocab.jsx +131 -0
- package/apps/studio/client/inspector/ds-tokens.js +90 -0
- package/apps/studio/client/inspector/grid-tracks-editor.jsx +97 -0
- package/apps/studio/client/inspector/inspect-computed.jsx +68 -0
- package/apps/studio/client/inspector/inspector-panel.jsx +769 -0
- package/apps/studio/client/inspector/layers.jsx +322 -0
- package/apps/studio/client/inspector/selection.js +65 -0
- package/apps/studio/client/inspector/token-popover.jsx +301 -0
- package/apps/studio/client/menus/menubar.jsx +856 -0
- package/apps/studio/client/report-bug.jsx +8 -2
- package/apps/studio/client/selection-scope.js +40 -0
- package/apps/studio/client/shell/banners.jsx +272 -0
- package/apps/studio/client/shell/collapsed-rail.jsx +23 -0
- package/apps/studio/client/shell/comments-panel.jsx +177 -0
- package/apps/studio/client/shell/constants.js +60 -0
- package/apps/studio/client/shell/dock.jsx +131 -0
- package/apps/studio/client/shell/icons.jsx +370 -0
- package/apps/studio/client/shell/status-bar.jsx +215 -0
- package/apps/studio/client/shell/util.js +332 -0
- package/apps/studio/client/shell/viewport.jsx +254 -0
- package/apps/studio/client/system/system-view.jsx +255 -0
- package/apps/studio/client/tree/tree.jsx +1243 -0
- package/apps/studio/comments-overlay.tsx +6 -4
- package/apps/studio/config.schema.json +5 -0
- package/apps/studio/context.ts +20 -0
- package/apps/studio/dist/client.bundle.js +2728 -2728
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/embed-origins.ts +52 -0
- package/apps/studio/export-dialog.tsx +55 -3
- package/apps/studio/exporters/_browser-bundles.ts +21 -2
- package/apps/studio/exporters/format-scopes.ts +11 -3
- package/apps/studio/exporters/index.ts +17 -2
- package/apps/studio/exporters/jobs.ts +91 -23
- package/apps/studio/exporters/pdf.ts +10 -2
- package/apps/studio/exporters/png.ts +10 -2
- package/apps/studio/exporters/scope.ts +89 -15
- package/apps/studio/format.ts +296 -0
- package/apps/studio/generation/runtime-probe.ts +1 -1
- package/apps/studio/git/service.ts +1 -0
- package/apps/studio/http.ts +399 -36
- package/apps/studio/input-router.tsx +7 -1
- package/apps/studio/path-containment.ts +72 -0
- package/apps/studio/paths.ts +14 -1
- package/apps/studio/read-only-mode.ts +53 -0
- package/apps/studio/server.ts +123 -25
- package/apps/studio/sync/accepted-link.ts +6 -0
- package/apps/studio/sync/agent.ts +9 -1
- package/apps/studio/sync/cold-start-apply.ts +29 -4
- package/apps/studio/sync/cold-start.ts +78 -0
- package/apps/studio/sync/file-plane.ts +61 -1
- package/apps/studio/sync/format-sync.ts +160 -0
- package/apps/studio/sync/index.ts +208 -23
- package/apps/studio/sync/journal-client.ts +25 -5
- package/apps/studio/sync/migrate-seed.ts +8 -1
- package/apps/studio/sync/park.ts +39 -0
- package/apps/studio/sync/presentation.ts +9 -3
- package/apps/studio/sync/status.ts +2 -0
- package/apps/studio/sync/transaction-client.ts +130 -13
- package/apps/studio/sync/writer-registry.ts +5 -0
- package/apps/studio/ui-prefs.ts +95 -10
- package/apps/studio/use-canvas-media-drop.tsx +8 -28
- package/apps/studio/whats-new.json +36 -0
- package/apps/studio/ws.ts +19 -4
- package/cli/bin/claude-design-server.mjs +0 -0
- package/cli/commands/design.mjs +9 -2
- package/cli/commands/hub-workspace.mjs +25 -0
- package/cli/lib/workspace-plan.mjs +51 -0
- package/package.json +11 -9
- package/plugins/design/templates/_shell.html +58 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// shell/dock.jsx — moved verbatim out of client/app.jsx (Maude v2 plan V2-0.2, move-only split).
|
|
2
|
+
|
|
3
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
+
|
|
5
|
+
// feature-configurable-panel-docking — the dockable shell panels. Each can live
|
|
6
|
+
// in the LEFT or RIGHT slot (persisted in UiPrefs.panelSides); each slot is a
|
|
7
|
+
// single-panel-at-a-time surface with a tab strip over the panels assigned to
|
|
8
|
+
// it. Order here = tab order within a slot. `assistant` is native-only.
|
|
9
|
+
export const DOCK_PANELS = [
|
|
10
|
+
{ id: 'tree', label: 'Files' },
|
|
11
|
+
{ id: 'layers', label: 'Layers' },
|
|
12
|
+
{ id: 'inspector', label: 'Inspector' },
|
|
13
|
+
{ id: 'comments', label: 'Comments' },
|
|
14
|
+
{ id: 'changes', label: 'Changes' },
|
|
15
|
+
{ id: 'sync', label: 'Sync' }, // feature-sync-progress-modal — linked projects only
|
|
16
|
+
{ id: 'assistant', label: 'Assistant' },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const PANEL_SIDES_DEFAULTS = {
|
|
20
|
+
tree: 'left',
|
|
21
|
+
layers: 'left',
|
|
22
|
+
inspector: 'right',
|
|
23
|
+
comments: 'right',
|
|
24
|
+
changes: 'right',
|
|
25
|
+
sync: 'right',
|
|
26
|
+
assistant: 'right',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// feature-configurable-panel-docking — one dock slot (left or right). Owns the
|
|
30
|
+
// resizable width + a tab strip over the panels assigned to the slot; renders
|
|
31
|
+
// the active panel (passed as children). Collapses to 0 width when nothing is
|
|
32
|
+
// visibly open (it may still host an always-mounted hidden ChatPanel).
|
|
33
|
+
export function DockSlot({ side, width, open, ids, activeId, onPick, children, labels = null }) {
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
className={'st-dockslot st-dockslot--' + side + (open ? '' : ' is-collapsed')}
|
|
37
|
+
style={{ width: open ? width : 0, flexBasis: open ? width : 0 }}
|
|
38
|
+
>
|
|
39
|
+
{open && ids.length > 1 && (
|
|
40
|
+
<div className="st-docktabs" role="tablist" aria-label={side + ' panels'}>
|
|
41
|
+
{ids.map((id) => (
|
|
42
|
+
<button
|
|
43
|
+
key={id}
|
|
44
|
+
type="button"
|
|
45
|
+
role="tab"
|
|
46
|
+
data-testid={`dock-tab-${id}`}
|
|
47
|
+
aria-selected={activeId === id}
|
|
48
|
+
className={'st-docktab' + (activeId === id ? ' is-active' : '')}
|
|
49
|
+
onClick={() => onPick(id)}
|
|
50
|
+
>
|
|
51
|
+
{labels?.[id] || (DOCK_PANELS.find((p) => p.id === id) || {}).label || id}
|
|
52
|
+
</button>
|
|
53
|
+
))}
|
|
54
|
+
</div>
|
|
55
|
+
)}
|
|
56
|
+
{children}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ───────── Resizable panel grip (DS components-resize-panels contract) ─────────
|
|
62
|
+
//
|
|
63
|
+
// 8px hit area on a 1px seam; grip dots + accent surface on hover/focus/drag;
|
|
64
|
+
// pointer drag (with capture, so moves keep arriving over the iframe), arrow-key
|
|
65
|
+
// nudge (8px, ⇧=24px), Home/End to min/max, double-click resets to default.
|
|
66
|
+
// Width persists per panel in localStorage.
|
|
67
|
+
|
|
68
|
+
export function usePanelSize(storeKey, { min, max, def }) {
|
|
69
|
+
const clamp = useCallback((v) => Math.min(max, Math.max(min, v)), [min, max]);
|
|
70
|
+
const [w, setWRaw] = useState(() => {
|
|
71
|
+
try {
|
|
72
|
+
const v = parseInt(localStorage.getItem(storeKey) || '', 10);
|
|
73
|
+
return Number.isFinite(v) ? clamp(v) : def;
|
|
74
|
+
} catch {
|
|
75
|
+
return def;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
try {
|
|
80
|
+
localStorage.setItem(storeKey, String(w));
|
|
81
|
+
} catch {}
|
|
82
|
+
}, [storeKey, w]);
|
|
83
|
+
const setW = useCallback(
|
|
84
|
+
(next) => setWRaw((prev) => clamp(typeof next === 'function' ? next(prev) : next)),
|
|
85
|
+
[clamp]
|
|
86
|
+
);
|
|
87
|
+
return { w, setW, min, max, def };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function PanelGrip({ label, size, onPointerDown, active, dir = 'ltr' }) {
|
|
91
|
+
const { w, setW, min, max, def } = size;
|
|
92
|
+
// `dir` is grip-relative: 'ltr' (left panel) → ArrowRight widens; 'rtl'
|
|
93
|
+
// (right dock) → ArrowRight narrows, since the seam moves toward the panel.
|
|
94
|
+
const grow = dir === 'rtl' ? -1 : 1;
|
|
95
|
+
return (
|
|
96
|
+
<div
|
|
97
|
+
className={'st-grip' + (active ? ' is-active' : '')}
|
|
98
|
+
role="separator"
|
|
99
|
+
tabIndex={0}
|
|
100
|
+
aria-orientation="vertical"
|
|
101
|
+
aria-label={label}
|
|
102
|
+
aria-valuemin={min}
|
|
103
|
+
aria-valuemax={max}
|
|
104
|
+
aria-valuenow={Math.round(w)}
|
|
105
|
+
onPointerDown={onPointerDown}
|
|
106
|
+
onDoubleClick={() => setW(def)}
|
|
107
|
+
onKeyDown={(e) => {
|
|
108
|
+
const step = e.shiftKey ? 24 : 8;
|
|
109
|
+
if (e.key === 'ArrowRight') {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
setW((v) => v + step * grow);
|
|
112
|
+
} else if (e.key === 'ArrowLeft') {
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
setW((v) => v - step * grow);
|
|
115
|
+
} else if (e.key === 'Home') {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
setW(min);
|
|
118
|
+
} else if (e.key === 'End') {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
setW(max);
|
|
121
|
+
}
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
<svg className="st-grip-dots" viewBox="0 0 6 18" aria-hidden="true">
|
|
125
|
+
<circle cx="3" cy="3" r="1.1" fill="currentColor" />
|
|
126
|
+
<circle cx="3" cy="9" r="1.1" fill="currentColor" />
|
|
127
|
+
<circle cx="3" cy="15" r="1.1" fill="currentColor" />
|
|
128
|
+
</svg>
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
// shell/icons.jsx — moved verbatim out of client/app.jsx (Maude v2 plan V2-0.2, move-only split).
|
|
2
|
+
|
|
3
|
+
// lucide wrapper — hairline stroke to match the shell's icon weight (handoff).
|
|
4
|
+
export const Lu = ({ as: C, size = 14 }) => <C size={size} strokeWidth={1.75} style={{ display: 'block' }} />;
|
|
5
|
+
|
|
6
|
+
// ---------- Components ----------
|
|
7
|
+
|
|
8
|
+
export function Icon({ d, size = 14, color }) {
|
|
9
|
+
return (
|
|
10
|
+
<svg
|
|
11
|
+
width={size}
|
|
12
|
+
height={size}
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
fill="none"
|
|
15
|
+
stroke={color || 'currentColor'}
|
|
16
|
+
strokeWidth="1.5"
|
|
17
|
+
strokeLinecap="round"
|
|
18
|
+
strokeLinejoin="round"
|
|
19
|
+
style={{ flex: 'none' }}
|
|
20
|
+
>
|
|
21
|
+
<path d={d} />
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// ───── maude DS icon set (Plan B) ─────
|
|
27
|
+
// Thin-stroke (1.4) 16×16 geometric glyphs lifted from .design/ui/Studio.tsx —
|
|
28
|
+
// the icon vocabulary the ported `.st-*` chrome composes with. Distinct from the
|
|
29
|
+
// legacy 24×24 single-path `Icon` above (kept for not-yet-ported chrome). Grown
|
|
30
|
+
// per slice; this slice (menubar/statusbar) needs sparkle/check/sun/moon plus a
|
|
31
|
+
// few the sidebar + panels reuse later.
|
|
32
|
+
export const STICONS = {
|
|
33
|
+
'chevron-down': <polyline points="3.5 6 8 10.5 12.5 6" />,
|
|
34
|
+
'chevron-right': <polyline points="6 3.5 10.5 8 6 12.5" />,
|
|
35
|
+
file: (
|
|
36
|
+
<>
|
|
37
|
+
<path d="M4 2h5l3 3v9H4z" />
|
|
38
|
+
<polyline points="9 2 9 5 12 5" />
|
|
39
|
+
</>
|
|
40
|
+
),
|
|
41
|
+
folder: <path d="M2 4.5h4l1.3 1.5H14V13H2z" />,
|
|
42
|
+
// feature-file-tree-drag-drop-folders (Task 9/12) — folder outline + a "+"
|
|
43
|
+
// mark, single-stroke family matching `folder`/`file`/`panel-left`.
|
|
44
|
+
'folder-plus': (
|
|
45
|
+
<>
|
|
46
|
+
<path d="M2 4.5h4l1.3 1.5H14V13H2z" />
|
|
47
|
+
<path d="M8 7.5v3.5M6.25 9.25h3.5" />
|
|
48
|
+
</>
|
|
49
|
+
),
|
|
50
|
+
// feature-4 T7b — Layers padlock (closed / open).
|
|
51
|
+
lock: (
|
|
52
|
+
<>
|
|
53
|
+
<rect x="3.5" y="7" width="9" height="6.5" rx="1" />
|
|
54
|
+
<path d="M5.5 7V5a2.5 2.5 0 015 0v2" />
|
|
55
|
+
</>
|
|
56
|
+
),
|
|
57
|
+
unlock: (
|
|
58
|
+
<>
|
|
59
|
+
<rect x="3.5" y="7" width="9" height="6.5" rx="1" />
|
|
60
|
+
<path d="M5.5 7V5a2.5 2.5 0 015-.7" />
|
|
61
|
+
</>
|
|
62
|
+
),
|
|
63
|
+
search: (
|
|
64
|
+
<>
|
|
65
|
+
<circle cx="7" cy="7" r="4" />
|
|
66
|
+
<line x1="10" y1="10" x2="13.5" y2="13.5" />
|
|
67
|
+
</>
|
|
68
|
+
),
|
|
69
|
+
plus: (
|
|
70
|
+
<>
|
|
71
|
+
<line x1="8" y1="3" x2="8" y2="13" />
|
|
72
|
+
<line x1="3" y1="8" x2="13" y2="8" />
|
|
73
|
+
</>
|
|
74
|
+
),
|
|
75
|
+
check: <polyline points="3 8.2 6.4 11.5 13 4.2" />,
|
|
76
|
+
x: (
|
|
77
|
+
<>
|
|
78
|
+
<line x1="4.3" y1="4.3" x2="11.7" y2="11.7" />
|
|
79
|
+
<line x1="11.7" y1="4.3" x2="4.3" y2="11.7" />
|
|
80
|
+
</>
|
|
81
|
+
),
|
|
82
|
+
sun: (
|
|
83
|
+
<>
|
|
84
|
+
<circle cx="8" cy="8" r="2.6" />
|
|
85
|
+
<line x1="8" y1="1.5" x2="8" y2="3" />
|
|
86
|
+
<line x1="8" y1="13" x2="8" y2="14.5" />
|
|
87
|
+
<line x1="1.5" y1="8" x2="3" y2="8" />
|
|
88
|
+
<line x1="13" y1="8" x2="14.5" y2="8" />
|
|
89
|
+
<line x1="3.4" y1="3.4" x2="4.4" y2="4.4" />
|
|
90
|
+
<line x1="11.6" y1="11.6" x2="12.6" y2="12.6" />
|
|
91
|
+
<line x1="12.6" y1="3.4" x2="11.6" y2="4.4" />
|
|
92
|
+
<line x1="4.4" y1="11.6" x2="3.4" y2="12.6" />
|
|
93
|
+
</>
|
|
94
|
+
),
|
|
95
|
+
moon: <path d="M12.5 9.6A5 5 0 1 1 7 3a4 4 0 0 0 5.5 6.6z" />,
|
|
96
|
+
sparkle: (
|
|
97
|
+
<path d="M8 1.8l1.4 4.8L14 8l-4.6 1.4L8 14.2l-1.4-4.8L2 8l4.6-1.4z" fill="currentColor" stroke="none" />
|
|
98
|
+
),
|
|
99
|
+
megaphone: (
|
|
100
|
+
<>
|
|
101
|
+
<path d="M2 6.7 11 4v8L2 9.3z" />
|
|
102
|
+
<path d="M11 5.2a2.4 2.4 0 0 1 0 5.6" />
|
|
103
|
+
<path d="M4.3 9.5v2.3a1.2 1.2 0 0 0 2.4 0v-1.7" />
|
|
104
|
+
</>
|
|
105
|
+
),
|
|
106
|
+
bug: (
|
|
107
|
+
<>
|
|
108
|
+
<circle cx="8" cy="9" r="3.6" />
|
|
109
|
+
<circle cx="8" cy="4.4" r="1.3" />
|
|
110
|
+
<path d="M6.2 3.4 5.2 2M9.8 3.4l1-1.4" />
|
|
111
|
+
<path d="M4.6 7.6H2.2M4.6 9H2.2M4.6 10.6H2.5M11.4 7.6h2.4M11.4 9h2.4M11.4 10.6h2.3" />
|
|
112
|
+
</>
|
|
113
|
+
),
|
|
114
|
+
'panel-left': (
|
|
115
|
+
<>
|
|
116
|
+
<rect x="2.5" y="3" width="11" height="10" rx="1.5" />
|
|
117
|
+
<line x1="6.4" y1="3" x2="6.4" y2="13" />
|
|
118
|
+
</>
|
|
119
|
+
),
|
|
120
|
+
resolve: (
|
|
121
|
+
<>
|
|
122
|
+
<circle cx="8" cy="8" r="5.6" />
|
|
123
|
+
<polyline points="5.4 8 7.2 9.9 10.6 6" />
|
|
124
|
+
</>
|
|
125
|
+
),
|
|
126
|
+
reopen: (
|
|
127
|
+
<>
|
|
128
|
+
<path d="M3.2 8a5 5 0 1 1 1.4 3.5" />
|
|
129
|
+
<polyline points="3.2 11.4 3.2 8 6.6 8" />
|
|
130
|
+
</>
|
|
131
|
+
),
|
|
132
|
+
layers: (
|
|
133
|
+
<>
|
|
134
|
+
<polygon points="8 2.2 13.8 5.5 8 8.8 2.2 5.5" />
|
|
135
|
+
<polyline points="2.2 9 8 12.3 13.8 9" />
|
|
136
|
+
</>
|
|
137
|
+
),
|
|
138
|
+
// Layer-type glyphs (Phase 12.3 W3.1) — one mark per LayerNode `type`.
|
|
139
|
+
box: <rect x="3" y="3" width="10" height="10" rx="1.2" />,
|
|
140
|
+
type: (
|
|
141
|
+
<>
|
|
142
|
+
<polyline points="4 4 12 4" />
|
|
143
|
+
<line x1="8" y1="4" x2="8" y2="12" />
|
|
144
|
+
</>
|
|
145
|
+
),
|
|
146
|
+
button: (
|
|
147
|
+
<>
|
|
148
|
+
<rect x="2.5" y="5" width="11" height="6" rx="3" />
|
|
149
|
+
<line x1="6" y1="8" x2="10" y2="8" />
|
|
150
|
+
</>
|
|
151
|
+
),
|
|
152
|
+
input: (
|
|
153
|
+
<>
|
|
154
|
+
<rect x="2.5" y="5" width="11" height="6" rx="1.2" />
|
|
155
|
+
<line x1="5" y1="8" x2="5" y2="8" />
|
|
156
|
+
</>
|
|
157
|
+
),
|
|
158
|
+
link: (
|
|
159
|
+
<>
|
|
160
|
+
<path d="M6.5 9.5a2.5 2.5 0 0 1 0-3.5l1.5-1.5a2.5 2.5 0 0 1 3.5 3.5l-1 1" />
|
|
161
|
+
<path d="M9.5 6.5a2.5 2.5 0 0 1 0 3.5l-1.5 1.5a2.5 2.5 0 0 1-3.5-3.5l1-1" />
|
|
162
|
+
</>
|
|
163
|
+
),
|
|
164
|
+
list: (
|
|
165
|
+
<>
|
|
166
|
+
<line x1="6" y1="4.5" x2="13" y2="4.5" />
|
|
167
|
+
<line x1="6" y1="8" x2="13" y2="8" />
|
|
168
|
+
<line x1="6" y1="11.5" x2="13" y2="11.5" />
|
|
169
|
+
<circle cx="3.2" cy="4.5" r="0.8" fill="currentColor" />
|
|
170
|
+
<circle cx="3.2" cy="8" r="0.8" fill="currentColor" />
|
|
171
|
+
<circle cx="3.2" cy="11.5" r="0.8" fill="currentColor" />
|
|
172
|
+
</>
|
|
173
|
+
),
|
|
174
|
+
eye: (
|
|
175
|
+
<>
|
|
176
|
+
<path d="M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8z" />
|
|
177
|
+
<circle cx="8" cy="8" r="2" />
|
|
178
|
+
</>
|
|
179
|
+
),
|
|
180
|
+
eyedropper: (
|
|
181
|
+
<>
|
|
182
|
+
<path d="M11 2.6a1.7 1.7 0 0 1 2.4 2.4l-1.2 1.2-2.4-2.4z" />
|
|
183
|
+
<path d="M9.5 4.6 4 10.1V12h1.9l5.5-5.5" />
|
|
184
|
+
</>
|
|
185
|
+
),
|
|
186
|
+
// Figma-style property prefix glyphs (#2) — small marks INSIDE numeric fields.
|
|
187
|
+
'p-corner': <path d="M3.5 12.5V7a3.5 3.5 0 0 1 3.5-3.5h5.5" />,
|
|
188
|
+
'p-opacity': (
|
|
189
|
+
<>
|
|
190
|
+
<rect x="3" y="3" width="10" height="10" rx="1.5" />
|
|
191
|
+
<path d="M3 8h10M8 3v10" strokeWidth="0.9" opacity="0.55" />
|
|
192
|
+
</>
|
|
193
|
+
),
|
|
194
|
+
'p-lineheight': (
|
|
195
|
+
<>
|
|
196
|
+
<line x1="6.5" y1="4" x2="13" y2="4" />
|
|
197
|
+
<line x1="6.5" y1="8" x2="13" y2="8" />
|
|
198
|
+
<line x1="6.5" y1="12" x2="13" y2="12" />
|
|
199
|
+
<path d="M3.2 4.6 3.2 11.4M2 6 3.2 4.5 4.4 6M2 10 3.2 11.5 4.4 10" />
|
|
200
|
+
</>
|
|
201
|
+
),
|
|
202
|
+
'p-letterspacing': (
|
|
203
|
+
<>
|
|
204
|
+
<path d="M3 4v8M13 4v8" />
|
|
205
|
+
<path d="M6 11.5 8 5l2 6.5M6.7 9.3h2.6" strokeWidth="1.1" />
|
|
206
|
+
</>
|
|
207
|
+
),
|
|
208
|
+
'p-gap': (
|
|
209
|
+
<>
|
|
210
|
+
<rect x="2" y="4.5" width="3.6" height="7" rx="0.6" />
|
|
211
|
+
<rect x="10.4" y="4.5" width="3.6" height="7" rx="0.6" />
|
|
212
|
+
<path d="M6.8 8h2.4M7.4 6.9 6.4 8l1 1.1M8.6 6.9 9.6 8l-1 1.1" strokeWidth="1" />
|
|
213
|
+
</>
|
|
214
|
+
),
|
|
215
|
+
'p-border': <rect x="3" y="3" width="10" height="10" rx="1" />,
|
|
216
|
+
'p-size': (
|
|
217
|
+
<>
|
|
218
|
+
<path d="M3 13 6.6 3l3.6 10" />
|
|
219
|
+
<path d="M4.3 9.6h4.6" />
|
|
220
|
+
</>
|
|
221
|
+
),
|
|
222
|
+
'eye-off': (
|
|
223
|
+
<>
|
|
224
|
+
<path d="M6.3 4A6.7 6.7 0 0 1 8 3.5C12 3.5 14.5 8 14.5 8a12 12 0 0 1-2 2.4M4.4 5.3A12 12 0 0 0 1.5 8S4 12.5 8 12.5a6.5 6.5 0 0 0 2.1-.35" />
|
|
225
|
+
<line x1="2.5" y1="2.5" x2="13.5" y2="13.5" />
|
|
226
|
+
</>
|
|
227
|
+
),
|
|
228
|
+
sliders: (
|
|
229
|
+
<>
|
|
230
|
+
<line x1="3" y1="5" x2="13" y2="5" />
|
|
231
|
+
<circle cx="6" cy="5" r="1.7" fill="currentColor" />
|
|
232
|
+
<line x1="3" y1="11" x2="13" y2="11" />
|
|
233
|
+
<circle cx="10" cy="11" r="1.7" fill="currentColor" />
|
|
234
|
+
</>
|
|
235
|
+
),
|
|
236
|
+
code: (
|
|
237
|
+
<>
|
|
238
|
+
<polyline points="6 5 3 8 6 11" />
|
|
239
|
+
<polyline points="10 5 13 8 10 11" />
|
|
240
|
+
</>
|
|
241
|
+
),
|
|
242
|
+
download: (
|
|
243
|
+
<>
|
|
244
|
+
<line x1="8" y1="2.5" x2="8" y2="10" />
|
|
245
|
+
<polyline points="4.5 7 8 10.5 11.5 7" />
|
|
246
|
+
<polyline points="3 12.8 3 13.6 13 13.6 13 12.8" />
|
|
247
|
+
</>
|
|
248
|
+
),
|
|
249
|
+
// lucide `rotate-cw`, scaled from the 24px source into our 16px viewBox.
|
|
250
|
+
reload: (
|
|
251
|
+
<>
|
|
252
|
+
<path d="M14 8a6 6 0 1 1-2-4.47L14 5.33" />
|
|
253
|
+
<path d="M14 2v3.33h-3.33" />
|
|
254
|
+
</>
|
|
255
|
+
),
|
|
256
|
+
help: (
|
|
257
|
+
<>
|
|
258
|
+
<circle cx="8" cy="8" r="6" />
|
|
259
|
+
<path d="M6.3 6.2a1.8 1.8 0 1 1 2.3 1.9c-.5.2-.6.5-.6 1v.3" />
|
|
260
|
+
<line x1="8" y1="11.4" x2="8" y2="11.5" />
|
|
261
|
+
</>
|
|
262
|
+
),
|
|
263
|
+
// Export-format glyphs (Plan C) — one distinct mark per format card.
|
|
264
|
+
image: (
|
|
265
|
+
<>
|
|
266
|
+
<rect x="2.5" y="3" width="11" height="10" rx="1.5" />
|
|
267
|
+
<circle cx="6" cy="6.3" r="1.1" />
|
|
268
|
+
<path d="M3 12l3-2.8 2.2 1.8 2.4-3L13.5 12" />
|
|
269
|
+
</>
|
|
270
|
+
),
|
|
271
|
+
vector: (
|
|
272
|
+
<>
|
|
273
|
+
<path d="M3.6 11.2C6 5 10 5 12.4 11.2" />
|
|
274
|
+
<rect x="1.7" y="9.8" width="2.6" height="2.6" rx="0.4" />
|
|
275
|
+
<rect x="11.7" y="9.8" width="2.6" height="2.6" rx="0.4" />
|
|
276
|
+
<rect x="6.7" y="2.6" width="2.6" height="2.6" rx="0.4" />
|
|
277
|
+
</>
|
|
278
|
+
),
|
|
279
|
+
presentation: (
|
|
280
|
+
<>
|
|
281
|
+
<rect x="2.5" y="3" width="11" height="7.4" rx="1" />
|
|
282
|
+
<line x1="8" y1="10.4" x2="8" y2="13" />
|
|
283
|
+
<line x1="5.6" y1="13.4" x2="10.4" y2="13.4" />
|
|
284
|
+
</>
|
|
285
|
+
),
|
|
286
|
+
archive: (
|
|
287
|
+
<>
|
|
288
|
+
<rect x="2.5" y="3" width="11" height="3" rx="0.8" />
|
|
289
|
+
<path d="M3.6 6v6.2a1 1 0 0 0 1 1h6.8a1 1 0 0 0 1-1V6" />
|
|
290
|
+
<line x1="6.6" y1="8.8" x2="9.4" y2="8.8" />
|
|
291
|
+
</>
|
|
292
|
+
),
|
|
293
|
+
external: (
|
|
294
|
+
<>
|
|
295
|
+
<path d="M11 8.5V12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3.5" />
|
|
296
|
+
<polyline points="9.5 3 13 3 13 6.5" />
|
|
297
|
+
<line x1="13" y1="3" x2="7.6" y2="8.4" />
|
|
298
|
+
</>
|
|
299
|
+
),
|
|
300
|
+
share: (
|
|
301
|
+
<>
|
|
302
|
+
<circle cx="4" cy="8" r="1.9" />
|
|
303
|
+
<circle cx="11.6" cy="3.6" r="1.9" />
|
|
304
|
+
<circle cx="11.6" cy="12.4" r="1.9" />
|
|
305
|
+
<line x1="5.7" y1="7" x2="9.9" y2="4.6" />
|
|
306
|
+
<line x1="5.7" y1="9" x2="9.9" y2="11.4" />
|
|
307
|
+
</>
|
|
308
|
+
),
|
|
309
|
+
pen: (
|
|
310
|
+
<>
|
|
311
|
+
<path d="M3 13l.8-3L10.6 3.2a1.1 1.1 0 0 1 1.6 0l.6.6a1.1 1.1 0 0 1 0 1.6L6 12.2z" />
|
|
312
|
+
<line x1="9.6" y1="4.2" x2="11.8" y2="6.4" />
|
|
313
|
+
</>
|
|
314
|
+
),
|
|
315
|
+
square: <rect x="3.5" y="3.5" width="9" height="9" rx="1" />,
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
export function StIcon({ name, size = 16, className }) {
|
|
319
|
+
return (
|
|
320
|
+
<svg
|
|
321
|
+
className={className}
|
|
322
|
+
width={size}
|
|
323
|
+
height={size}
|
|
324
|
+
viewBox="0 0 16 16"
|
|
325
|
+
fill="none"
|
|
326
|
+
stroke="currentColor"
|
|
327
|
+
strokeWidth="1.4"
|
|
328
|
+
strokeLinecap="round"
|
|
329
|
+
strokeLinejoin="round"
|
|
330
|
+
aria-hidden="true"
|
|
331
|
+
style={{ flex: 'none' }}
|
|
332
|
+
>
|
|
333
|
+
{STICONS[name]}
|
|
334
|
+
</svg>
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// P3 (Plan C) — menubar presence avatar (matches `.design/ui/Studio.tsx` Avatar).
|
|
339
|
+
// Up to two uppercase glyphs from a name; falls back to "?" for empties.
|
|
340
|
+
export function initialsOf(name) {
|
|
341
|
+
if (!name || typeof name !== 'string') return '?';
|
|
342
|
+
const parts = name.trim().split(/[\s._-]+/).filter(Boolean);
|
|
343
|
+
if (!parts.length) return '?';
|
|
344
|
+
// Single-token names (e.g. a git username "1aGh") → first two chars, so the
|
|
345
|
+
// avatar reads as initials rather than a lone count badge.
|
|
346
|
+
if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
|
|
347
|
+
return ((parts[0][0] || '') + (parts[parts.length - 1][0] || '')).toUpperCase() || '?';
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export function StAvatar({ initials, hue, title, pulse }) {
|
|
351
|
+
// Hue rides a custom property so CSS can mix it into the surface (DS avatar
|
|
352
|
+
// recipe: tinted bg + hue border + fg-0 text — solid fill + white text broke
|
|
353
|
+
// the accent-fg contrast rule and washed out in light theme). `pulse` plays
|
|
354
|
+
// the DS motion-presence role (scale+opacity ring) — the AI agent's "live"
|
|
355
|
+
// tell while it's editing.
|
|
356
|
+
return (
|
|
357
|
+
<span
|
|
358
|
+
className={'st-avatar' + (pulse ? ' is-pulsing' : '')}
|
|
359
|
+
style={{ '--av-hue': hue }}
|
|
360
|
+
data-tip={title}
|
|
361
|
+
aria-label={title}
|
|
362
|
+
>
|
|
363
|
+
{initials}
|
|
364
|
+
</span>
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export function Kbd({ children }) {
|
|
369
|
+
return <span className="kbd">{children}</span>;
|
|
370
|
+
}
|