@1agh/maude 1.8.1 → 1.9.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/apps/studio/acp/bridge.ts +14 -2
- package/apps/studio/acp/probe.ts +51 -1
- package/apps/studio/api.ts +19 -4
- package/apps/studio/bin/_curl-local.mjs +7 -0
- package/apps/studio/bin/annotate.mjs +16 -7
- package/apps/studio/bin/read-annotations.mjs +62 -4
- package/apps/studio/client/app.jsx +428 -15977
- 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/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/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 +13 -0
- package/apps/studio/dist/client.bundle.js +1337 -1337
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/exporters/_browser-bundles.ts +21 -2
- package/apps/studio/exporters/jobs.ts +75 -15
- package/apps/studio/exporters/scope.ts +15 -12
- package/apps/studio/format.ts +296 -0
- package/apps/studio/http.ts +217 -23
- package/apps/studio/server.ts +141 -30
- 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 +134 -10
- package/apps/studio/sync/journal-client.ts +25 -5
- package/apps/studio/sync/migrate-seed.ts +8 -1
- package/apps/studio/sync/status.ts +2 -0
- package/apps/studio/sync/transaction-client.ts +130 -13
- package/apps/studio/ui-prefs.ts +95 -10
- package/apps/studio/whats-new.json +9 -0
- package/apps/studio/ws.ts +19 -4
- package/cli/bin/claude-design-server.mjs +0 -0
- package/package.json +10 -8
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// inspector/color.js — moved verbatim out of client/app.jsx (Maude v2 plan V2-0.2, move-only split).
|
|
2
|
+
|
|
3
|
+
export let _cssColorCtx = null;
|
|
4
|
+
|
|
5
|
+
// Normalize any CSS color string to #rrggbb for the native color input via a
|
|
6
|
+
// throwaway canvas fillStyle round-trip (parses rgb/hsl/named). Unparseable
|
|
7
|
+
// values (some oklch) fall back to '' → picker defaults to #000000; the swatch
|
|
8
|
+
// still shows the true color string regardless.
|
|
9
|
+
export function cssColorToHex(c) {
|
|
10
|
+
if (!c) return '';
|
|
11
|
+
if (/^#[0-9a-f]{6}$/i.test(c)) return c.toLowerCase();
|
|
12
|
+
try {
|
|
13
|
+
if (!_cssColorCtx) _cssColorCtx = document.createElement('canvas').getContext('2d');
|
|
14
|
+
if (!_cssColorCtx) return '';
|
|
15
|
+
_cssColorCtx.fillStyle = '#000000';
|
|
16
|
+
_cssColorCtx.fillStyle = c;
|
|
17
|
+
const v = _cssColorCtx.fillStyle;
|
|
18
|
+
if (/^#[0-9a-f]{6}$/i.test(v)) return v.toLowerCase();
|
|
19
|
+
const m = v.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
|
|
20
|
+
if (m) {
|
|
21
|
+
return `#${[m[1], m[2], m[3]].map((n) => Number(n).toString(16).padStart(2, '0')).join('')}`;
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
/* canvas unavailable */
|
|
25
|
+
}
|
|
26
|
+
return '';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ---- Colour math for the HSV picker (#6 — Figma-style colour control) ----
|
|
30
|
+
export const clamp01 = (n) => Math.min(1, Math.max(0, n));
|
|
31
|
+
|
|
32
|
+
export function hexToRgb(hex) {
|
|
33
|
+
const m = /^#?([0-9a-f]{6})$/i.exec(hex || '');
|
|
34
|
+
if (!m) return { r: 0, g: 0, b: 0 };
|
|
35
|
+
const n = Number.parseInt(m[1], 16);
|
|
36
|
+
return { r: (n >> 16) & 255, g: (n >> 8) & 255, b: n & 255 };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function rgbToHex({ r, g, b }) {
|
|
40
|
+
return `#${[r, g, b].map((v) => Math.round(v).toString(16).padStart(2, '0')).join('')}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function rgbToHsv({ r, g, b }) {
|
|
44
|
+
r /= 255;
|
|
45
|
+
g /= 255;
|
|
46
|
+
b /= 255;
|
|
47
|
+
const max = Math.max(r, g, b);
|
|
48
|
+
const min = Math.min(r, g, b);
|
|
49
|
+
const d = max - min;
|
|
50
|
+
let h = 0;
|
|
51
|
+
if (d) {
|
|
52
|
+
if (max === r) h = ((g - b) / d) % 6;
|
|
53
|
+
else if (max === g) h = (b - r) / d + 2;
|
|
54
|
+
else h = (r - g) / d + 4;
|
|
55
|
+
h *= 60;
|
|
56
|
+
if (h < 0) h += 360;
|
|
57
|
+
}
|
|
58
|
+
return { h, s: max ? d / max : 0, v: max };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function hsvToRgb({ h, s, v }) {
|
|
62
|
+
const c = v * s;
|
|
63
|
+
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
64
|
+
const m = v - c;
|
|
65
|
+
let r = 0;
|
|
66
|
+
let g = 0;
|
|
67
|
+
let b = 0;
|
|
68
|
+
if (h < 60) [r, g, b] = [c, x, 0];
|
|
69
|
+
else if (h < 120) [r, g, b] = [x, c, 0];
|
|
70
|
+
else if (h < 180) [r, g, b] = [0, c, x];
|
|
71
|
+
else if (h < 240) [r, g, b] = [0, x, c];
|
|
72
|
+
else if (h < 300) [r, g, b] = [x, 0, c];
|
|
73
|
+
else [r, g, b] = [c, 0, x];
|
|
74
|
+
return { r: (r + m) * 255, g: (g + m) * 255, b: (b + m) * 255 };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Round bare px to whole numbers for the placeholder hint; pass other values through.
|
|
78
|
+
export function cssHint(v) {
|
|
79
|
+
if (!v) return '';
|
|
80
|
+
const m = /^(-?\d*\.?\d+)px$/.exec(v);
|
|
81
|
+
return m ? `${Math.round(Number.parseFloat(m[1]))}px` : v;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Split "16px" → { n:"16", unit:"px" }; "auto"→{n:"",unit:"auto"}; var()/raw → {n:raw,unit:""}.
|
|
85
|
+
export function cssSplitUnit(v) {
|
|
86
|
+
if (!v) return { n: '', unit: 'px' };
|
|
87
|
+
const t = v.trim();
|
|
88
|
+
const m = /^(-?\d*\.?\d+)\s*(px|rem|em|%|vw|vh)?$/.exec(t);
|
|
89
|
+
if (m) return { n: m[1], unit: m[2] || 'px' };
|
|
90
|
+
if (t === 'auto') return { n: '', unit: 'auto' };
|
|
91
|
+
return { n: t, unit: '' };
|
|
92
|
+
}
|