refac
This commit is contained in:
1 parent
934802e186
commit
bd250a0e24
6 files changed
+24
-19
No files matched your search
@@ -140,8 +140,8 @@
|
|||||||
class="{buttonClassName} cursor-pointer"
|
class="{buttonClassName} cursor-pointer"
|
||||||
on:click={(e) => {
|
on:click={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
toggleOpen();
|
||||||
}}
|
}}
|
||||||
on:pointerup={toggleOpen}
|
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class="flex items-start justify-between">
|
<div class="flex items-start justify-between">
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
{#if open && !hide}
|
{#if open && !hide}
|
||||||
<div
|
<div
|
||||||
transition:slide={{ duration: 300, easing: quintOut, axis: 'y' }}
|
transition:slide={{ duration: 300, easing: quintOut, axis: 'y' }}
|
||||||
on:pointerup={(e) => {
|
on:click={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -175,9 +175,6 @@
|
|||||||
{#if onAdd}
|
{#if onAdd}
|
||||||
<button
|
<button
|
||||||
class="absolute z-10 right-2 invisible group-hover:visible self-center flex items-center dark:text-gray-300"
|
class="absolute z-10 right-2 invisible group-hover:visible self-center flex items-center dark:text-gray-300"
|
||||||
on:pointerup={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
}}
|
|
||||||
on:click={(e) => {
|
on:click={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
onAdd();
|
onAdd();
|
||||||
|
|||||||
@@ -95,6 +95,19 @@
|
|||||||
|
|
||||||
$: parsedArgs = parseArguments(args);
|
$: parsedArgs = parseArguments(args);
|
||||||
$: parsedResult = parseJSONString(result);
|
$: parsedResult = parseJSONString(result);
|
||||||
|
|
||||||
|
const toggleOpen = () => {
|
||||||
|
open = !open;
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleOpenOnKeydown = (event: KeyboardEvent) => {
|
||||||
|
if (event.key !== 'Enter' && event.key !== ' ') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
toggleOpen();
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div {id} class={className}>
|
<div {id} class={className}>
|
||||||
@@ -119,12 +132,12 @@
|
|||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<!-- Tool call display -->
|
<!-- Tool call display -->
|
||||||
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
||||||
<div
|
<div
|
||||||
class="{buttonClassName} cursor-pointer"
|
class="{buttonClassName} cursor-pointer"
|
||||||
on:pointerup={() => {
|
role="button"
|
||||||
open = !open;
|
tabindex="0"
|
||||||
}}
|
on:click={toggleOpen}
|
||||||
|
on:keydown={toggleOpenOnKeydown}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="w-full max-w-full font-normal flex items-center gap-1.5 {isExecuting
|
class="w-full max-w-full font-normal flex items-center gap-1.5 {isExecuting
|
||||||
|
|||||||
@@ -1476,7 +1476,6 @@
|
|||||||
type="button"
|
type="button"
|
||||||
class="flex items-center justify-center w-7 h-7 rounded-lg text-gray-300 hover:text-gray-500 dark:text-gray-600 dark:hover:text-gray-400 transition-colors duration-100"
|
class="flex items-center justify-center w-7 h-7 rounded-lg text-gray-300 hover:text-gray-500 dark:text-gray-600 dark:hover:text-gray-400 transition-colors duration-100"
|
||||||
aria-label={$i18n.t('More')}
|
aria-label={$i18n.t('More')}
|
||||||
on:pointerup|stopPropagation
|
|
||||||
>
|
>
|
||||||
<MoreHorizontalIcon className="size-3.5" strokeWidth="2" />
|
<MoreHorizontalIcon className="size-3.5" strokeWidth="2" />
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -754,6 +754,7 @@
|
|||||||
role="button"
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
on:click={async (e) => {
|
on:click={async (e) => {
|
||||||
|
e.stopPropagation();
|
||||||
if (shouldIgnoreRowClick(e.target)) return;
|
if (shouldIgnoreRowClick(e.target)) return;
|
||||||
if (clickTimer) {
|
if (clickTimer) {
|
||||||
clearTimeout(clickTimer);
|
clearTimeout(clickTimer);
|
||||||
@@ -772,9 +773,6 @@
|
|||||||
openFolderHandler();
|
openFolderHandler();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:pointerup={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
class="text-gray-600 dark:text-gray-400 transition-all p-1 hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-lg"
|
class="text-gray-600 dark:text-gray-400 transition-all p-1 hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-lg"
|
||||||
|
|||||||
@@ -131,8 +131,6 @@
|
|||||||
class="group flex flex-1 h-full items-center gap-1 text-left text-xs text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400 transition-colors duration-100 {buttonClassName}"
|
class="group flex flex-1 h-full items-center gap-1 text-left text-xs text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400 transition-colors duration-100 {buttonClassName}"
|
||||||
aria-expanded={open}
|
aria-expanded={open}
|
||||||
aria-controls="{id}-content"
|
aria-controls="{id}-content"
|
||||||
on:pointerup|stopPropagation
|
|
||||||
on:click={() => setOpen(!open)}
|
|
||||||
>
|
>
|
||||||
<span>{name}</span>
|
<span>{name}</span>
|
||||||
<span
|
<span
|
||||||
@@ -143,16 +141,16 @@
|
|||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<slot name="action" />
|
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
|
||||||
|
<div class="contents" on:click={(e) => e.stopPropagation()}>
|
||||||
|
<slot name="action" />
|
||||||
|
</div>
|
||||||
|
|
||||||
{#if onAdd}
|
{#if onAdd}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="flex items-center justify-center w-7 h-7 rounded-lg text-gray-300 hover:text-gray-500 dark:text-gray-600 dark:hover:text-gray-400 transition-colors duration-100"
|
class="flex items-center justify-center w-7 h-7 rounded-lg text-gray-300 hover:text-gray-500 dark:text-gray-600 dark:hover:text-gray-400 transition-colors duration-100"
|
||||||
aria-label={onAddLabel}
|
aria-label={onAddLabel}
|
||||||
on:pointerup={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
}}
|
|
||||||
on:click={(e) => {
|
on:click={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
onAdd();
|
onAdd();
|
||||||
|
|||||||
Reference in new issue
Block a user