@1agh/maude 0.18.2 → 0.19.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/cli/bin/maude.mjs +16 -0
- package/cli/lib/update-check.mjs +145 -0
- package/cli/lib/update-check.test.mjs +32 -0
- package/package.json +8 -8
- package/plugins/design/dev-server/annotations-context-toolbar.tsx +14 -6
- package/plugins/design/dev-server/annotations-layer.tsx +144 -22
- package/plugins/design/dev-server/api.ts +72 -19
- package/plugins/design/dev-server/artboard-marquee.tsx +170 -0
- package/plugins/design/dev-server/canvas-lib-resolver.ts +10 -1
- package/plugins/design/dev-server/canvas-lib.tsx +190 -94
- package/plugins/design/dev-server/canvas-shell.tsx +478 -34
- package/plugins/design/dev-server/client/app.jsx +177 -56
- 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/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/dist/client.bundle.js +219 -107
- package/plugins/design/dev-server/dist/styles.css +38 -2
- package/plugins/design/dev-server/export-dialog.tsx +3 -3
- package/plugins/design/dev-server/http.ts +14 -2
- package/plugins/design/dev-server/input-router.tsx +22 -8
- package/plugins/design/dev-server/server.mjs +86 -20
- package/plugins/design/dev-server/server.ts +76 -30
- package/plugins/design/dev-server/test/context-resolve-tokens.test.ts +97 -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/tool-palette.tsx +71 -15
- package/plugins/design/dev-server/use-annotation-resize.tsx +295 -0
- package/plugins/design/dev-server/use-snap-guides.tsx +25 -1
- package/plugins/design/dev-server/use-tool-mode.tsx +31 -2
|
@@ -54,6 +54,13 @@ interface ToolContextValue {
|
|
|
54
54
|
tool: Tool;
|
|
55
55
|
setTool: (t: Tool) => void;
|
|
56
56
|
tools: readonly ToolDescriptor[];
|
|
57
|
+
/** T19 — sticky-tool double-click lock. When `sticky.locked === true` AND
|
|
58
|
+
* `sticky.tool === tool`, draw tools stay armed after each shape commit
|
|
59
|
+
* (T18 auto-flip is suppressed). Single-click on any other tool clears
|
|
60
|
+
* sticky; Esc clears + flips to Move. */
|
|
61
|
+
sticky: { tool: Tool | null; locked: boolean };
|
|
62
|
+
toggleSticky: (t: Tool) => void;
|
|
63
|
+
clearSticky: () => void;
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
const ToolContext = createContext<ToolContextValue | null>(null);
|
|
@@ -71,7 +78,26 @@ export function ToolProvider({
|
|
|
71
78
|
initial?: Tool;
|
|
72
79
|
}) {
|
|
73
80
|
const [tool, setToolState] = useState<Tool>(initial);
|
|
74
|
-
const
|
|
81
|
+
const [sticky, setSticky] = useState<{ tool: Tool | null; locked: boolean }>(() => ({
|
|
82
|
+
tool: null,
|
|
83
|
+
locked: false,
|
|
84
|
+
}));
|
|
85
|
+
const setTool = useCallback((t: Tool) => {
|
|
86
|
+
setToolState(t);
|
|
87
|
+
// Single-click on a different tool clears any sticky lock — sticky is
|
|
88
|
+
// a per-tool flag, not global.
|
|
89
|
+
setSticky((prev) => (prev.locked && prev.tool === t ? prev : { tool: null, locked: false }));
|
|
90
|
+
}, []);
|
|
91
|
+
const toggleSticky = useCallback((t: Tool) => {
|
|
92
|
+
setSticky((prev) => {
|
|
93
|
+
if (prev.locked && prev.tool === t) return { tool: null, locked: false };
|
|
94
|
+
return { tool: t, locked: true };
|
|
95
|
+
});
|
|
96
|
+
setToolState(t);
|
|
97
|
+
}, []);
|
|
98
|
+
const clearSticky = useCallback(() => {
|
|
99
|
+
setSticky({ tool: null, locked: false });
|
|
100
|
+
}, []);
|
|
75
101
|
|
|
76
102
|
// Body cursor sync — applied to the canvas iframe's body (this hook runs
|
|
77
103
|
// inside the iframe context). The viewport-controller still owns the
|
|
@@ -88,7 +114,10 @@ export function ToolProvider({
|
|
|
88
114
|
};
|
|
89
115
|
}, [tool, tools]);
|
|
90
116
|
|
|
91
|
-
const value = useMemo<ToolContextValue>(
|
|
117
|
+
const value = useMemo<ToolContextValue>(
|
|
118
|
+
() => ({ tool, setTool, tools, sticky, toggleSticky, clearSticky }),
|
|
119
|
+
[tool, setTool, tools, sticky, toggleSticky, clearSticky]
|
|
120
|
+
);
|
|
92
121
|
|
|
93
122
|
return <ToolContext.Provider value={value}>{children}</ToolContext.Provider>;
|
|
94
123
|
}
|