mirror of
https://github.com/YuzuZensai/Pien-Studio.git
synced 2026-09-02 14:18:35 +00:00
67 lines
1.5 KiB
TypeScript
67 lines
1.5 KiB
TypeScript
import type { ToolUiDefinition } from "./types";
|
|||
|
|
|
||
|
|
const definitions: ToolUiDefinition[] = [
|
||
|
|
{
|
||
|
|
id: "pointer",
|
||
|
|
interactionMode: "select",
|
||
|
|
allowsLayerDrag: true,
|
||
|
|
allowsLayerResize: true,
|
||
|
|
allowsLayerRotate: true,
|
||
|
|
iconName: "MousePointer2",
|
||
|
|
cursor: "default",
|
||
|
|
labelKey: "editor.toolPointer",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: "hand",
|
||
|
|
interactionMode: "pan",
|
||
|
|
allowsLayerDrag: false,
|
||
|
|
allowsLayerResize: false,
|
||
|
|
allowsLayerRotate: false,
|
||
|
|
iconName: "Hand",
|
||
|
|
cursor: "grab",
|
||
|
|
labelKey: "editor.toolPan",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: "face",
|
||
|
|
interactionMode: "annotate",
|
||
|
|
allowsLayerDrag: false,
|
||
|
|
allowsLayerResize: false,
|
||
|
|
allowsLayerRotate: false,
|
||
|
|
iconName: "ScanFace",
|
||
|
|
cursor: "default",
|
||
|
|
labelKey: "editor.toolFace",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: "fill",
|
||
|
|
interactionMode: "paint",
|
||
|
|
allowsLayerDrag: false,
|
||
|
|
allowsLayerResize: false,
|
||
|
|
allowsLayerRotate: false,
|
||
|
|
iconName: "PaintBucket",
|
||
|
|
cursor: "crosshair",
|
||
|
|
labelKey: "editor.toolFill",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: "brush",
|
||
|
|
interactionMode: "paint",
|
||
|
|
allowsLayerDrag: false,
|
||
|
|
allowsLayerResize: false,
|
||
|
|
allowsLayerRotate: false,
|
||
|
|
iconName: "Brush",
|
||
|
|
cursor: "crosshair",
|
||
|
|
labelKey: "editor.toolBrush",
|
||
|
|
},
|
||
|
|
];
|
||
|
|
|
||
|
|
const toolUiRegistry = new Map<string, ToolUiDefinition>(
|
||
|
|
definitions.map((d) => [d.id, d]),
|
||
|
|
);
|
||
|
|
|
||
|
|
export function getToolUiDefinition(id: string): ToolUiDefinition | undefined {
|
||
|
|
return toolUiRegistry.get(id);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function getAllToolUiDefinitions(): ToolUiDefinition[] {
|
||
|
|
return definitions;
|
||
|
|
}
|