From db5df367ddd9f5b5738de43343f9af8428925a16 Mon Sep 17 00:00:00 2001 From: ByteAtATime Date: Fri, 11 Jul 2025 13:26:59 -0700 Subject: [PATCH] fix(actions): spread original props to action definition This update adds support for spreading additional properties into action definitions for 'Copy to Clipboard', 'Open in Browser', 'Submit Form', and default actions. --- src/lib/components/nodes/shared/actions.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/components/nodes/shared/actions.ts b/src/lib/components/nodes/shared/actions.ts index 9f57f8a..ff9eef2 100644 --- a/src/lib/components/nodes/shared/actions.ts +++ b/src/lib/components/nodes/shared/actions.ts @@ -18,6 +18,7 @@ export const nodeToActionDefinition = ( return { title: title ?? 'Copy to Clipboard', + ...copyProps, handler: () => { writeText(copyProps.content); onDispatch(node.id, 'onCopy', []); @@ -29,6 +30,7 @@ export const nodeToActionDefinition = ( return { title: 'Open in Browser', + ...openProps, handler: () => { openUrl(openProps.url); onDispatch(node.id, 'onOpenInBrowser', []); @@ -38,6 +40,7 @@ export const nodeToActionDefinition = ( case 'Action.SubmitForm': { return { title: title ?? 'Submit Form', + ...node.props, handler: () => onDispatch(node.id, 'onSubmit', []) }; } @@ -46,6 +49,7 @@ export const nodeToActionDefinition = ( default: { return { title: title!, + ...node.props, handler: () => onDispatch(node.id, 'onAction', []) }; }