diff --git a/src/lib/components/CommandDeeplinkConfirm.svelte b/src/lib/components/CommandDeeplinkConfirm.svelte index 257c113..d000fb5 100644 --- a/src/lib/components/CommandDeeplinkConfirm.svelte +++ b/src/lib/components/CommandDeeplinkConfirm.svelte @@ -2,67 +2,49 @@ import type { PluginInfo } from '@raycast-linux/protocol'; import { Button } from './ui/button'; import Icon from './Icon.svelte'; - import { createEventDispatcher } from 'svelte'; import path from 'path'; + import * as AlertDialog from '$lib/components/ui/alert-dialog'; type Props = { plugin: PluginInfo; + open?: boolean; + onconfirm: () => void; + oncancel: () => void; }; - let { plugin }: Props = $props(); - - const dispatch = createEventDispatcher<{ confirm: void; cancel: void }>(); + let { plugin, open = $bindable(true), onconfirm, oncancel }: Props = $props(); const assetsPath = $derived(path.dirname(plugin.pluginPath) + '/assets'); - - function handleConfirm() { - dispatch('confirm'); - } - - function handleCancel() { - dispatch('cancel'); - } - - function handleKeydown(e: KeyboardEvent) { - if (e.key === 'Escape') { - e.preventDefault(); - handleCancel(); - } - } - - -
{ - if (e.target === e.currentTarget) handleCancel(); - }} - role="dialog" - aria-modal="true" - aria-labelledby="dialog-title" - tabindex={0} -> - -
+ !isOpen && oncancel()}> + + + + + Request to open {plugin.title} + + + The command was triggered from outside of Raycast. If you did not do this, please cancel the + operation. + + + + + {#snippet child({ props })} + + {/snippet} + + + + + {#snippet child({ props })} + + {/snippet} + + + + diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 1a8888f..e1d7093 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -206,8 +206,8 @@ {#if commandToConfirm} {/if}