mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-08-30 10:47:26 +00:00
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.
This commit is contained in:
parent
44d3becc86
commit
db5df367dd
1 changed files with 4 additions and 0 deletions
|
@ -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', [])
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue