feat: complete runtime and KAAK skin updates

This commit is contained in:
illusia committed 2026-10-12 23:06:55 +08:00
1 parent c994722016
commit 7fd1ea96fe
40 files changed
+3436 -1088

No files matched your search

+17 -10
View File
@@ -214,16 +214,23 @@ export default defineComponent({
const definition = component.actions[actionId];
if (!definition || !isSkinPluginComponentApproved(props.skinId, props.skinVersion, component)) return;
const args = resolveActionArgs(definition, context, state);
if (definition.type === "ui.setState") {
if (typeof args.key === "string" && component.state && Object.hasOwn(component.state, args.key) && "value" in args) state[args.key] = args.value;
return;
}
if (definition.type === "ui.toggleState") {
if (typeof args.key === "string" && component.state && Object.hasOwn(component.state, args.key) && typeof state[args.key] === "boolean") {
state[args.key] = !state[args.key];
}
return;
}
if (definition.type === "ui.setState") {
if (typeof args.key === "string" && component.state && Object.hasOwn(component.state, args.key) && "value" in args) {
state[args.key] = args.value;
refresh.value += 1;
}
return;
}
if (definition.type === "ui.toggleState") {
if (typeof args.key === "string" && component.state && Object.hasOwn(component.state, args.key) && typeof state[args.key] === "boolean") {
state[args.key] = !state[args.key];
if (typeof args.resetKey === "string" && component.state && Object.hasOwn(component.state, args.resetKey) && typeof state[args.resetKey] === "boolean") {
state[args.resetKey] = false;
}
refresh.value += 1;
}
return;
}
const handler = props.actions[definition.type];
if (handler) void Promise.resolve(handler(args, component)).catch(() => undefined);
}