mirror of
https://github.com/YuzuZensai/Pien-Studio.git
synced 2026-09-02 14:18:35 +00:00
✨ feat: layer effects, bucket fill, simple brush
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { ToolDefinition } from "@pien-studio/editor-core";
|
||||
|
||||
export type ToolUiDefinition = ToolDefinition & {
|
||||
/** Lucide icon component name (resolved at render time) */
|
||||
iconName: string;
|
||||
/** CSS cursor when this tool is active */
|
||||
cursor: string;
|
||||
/** i18n key for the toolbar label */
|
||||
labelKey: string;
|
||||
};
|
||||
Reference in New Issue
Block a user