@invopop/popui 0.1.77 → 0.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
let items = $derived(
|
|
16
16
|
actions.map((a) => ({
|
|
17
17
|
label: a.label,
|
|
18
|
-
value: a,
|
|
18
|
+
value: a.slug || a.label,
|
|
19
19
|
icon: a.icon,
|
|
20
20
|
separator: a.separator,
|
|
21
21
|
destructive: a.destructive,
|
|
@@ -42,9 +42,11 @@
|
|
|
42
42
|
|
|
43
43
|
<BaseDropdown bind:isOpen bind:this={actionDropdown} {trigger}>
|
|
44
44
|
<DrawerContext
|
|
45
|
+
autofocus
|
|
45
46
|
{items}
|
|
46
47
|
onclick={(e) => {
|
|
47
|
-
|
|
48
|
+
const action = actions.find((a) => (a.slug || a.label) === e)
|
|
49
|
+
onclick?.(action)
|
|
48
50
|
actionDropdown?.toggle()
|
|
49
51
|
}}
|
|
50
52
|
/>
|
package/dist/GlobalSearch.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Icon } from '@steeze-ui/svelte-icon'
|
|
3
|
-
import { Search,
|
|
3
|
+
import { Search, Command } from '@invopop/ui-icons'
|
|
4
4
|
import { onDestroy, onMount } from 'svelte'
|
|
5
5
|
import clsx from 'clsx'
|
|
6
6
|
import ShortcutWrapper from './ShortcutWrapper.svelte'
|
|
@@ -25,11 +25,16 @@
|
|
|
25
25
|
return
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
if (!event.ctrlKey && !event.metaKey) {
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
// We allow to type the GLOBAL SEARCH KEY on text fields
|
|
29
33
|
if (isInputFocused()) {
|
|
30
34
|
return
|
|
31
35
|
}
|
|
32
36
|
|
|
37
|
+
event.preventDefault()
|
|
33
38
|
onOpen?.()
|
|
34
39
|
}
|
|
35
40
|
|
|
@@ -46,8 +51,13 @@
|
|
|
46
51
|
<Icon src={Search} class="size-4 text-foreground-inverse shrink-0" />
|
|
47
52
|
{#if !collapsed}
|
|
48
53
|
<span class="text-foreground-inverse-secondary text-base flex-1 text-left">Search</span>
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
|
|
54
|
+
<div class="flex items-center gap-1">
|
|
55
|
+
<ShortcutWrapper theme="navigation">
|
|
56
|
+
<Icon src={Command} class="size-3" />
|
|
57
|
+
</ShortcutWrapper>
|
|
58
|
+
<ShortcutWrapper theme="navigation">
|
|
59
|
+
<span class="text-sm font-semibold uppercase">{GLOBAL_SEARCH_KEY}</span>
|
|
60
|
+
</ShortcutWrapper>
|
|
61
|
+
</div>
|
|
52
62
|
{/if}
|
|
53
63
|
</button>
|
package/dist/MenuItem.svelte
CHANGED
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
|
|
105
105
|
<div class={wrapperStyles}>
|
|
106
106
|
{#if isFolderItem && (highlight || active)}
|
|
107
|
-
<div class="border-l border-white h-3 w-px absolute top-
|
|
107
|
+
<div class="border-l border-white h-3 w-px absolute top-3.5 left-0 -m-px"></div>
|
|
108
108
|
{/if}
|
|
109
109
|
<button
|
|
110
110
|
use:floatingRef
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
onmouseleave={handleBlur}
|
|
148
148
|
class="pt-4 z-30"
|
|
149
149
|
>
|
|
150
|
-
<DrawerContext onclick={handleClickChild} {items} />
|
|
150
|
+
<DrawerContext autofocus onclick={handleClickChild} {items} />
|
|
151
151
|
</div>
|
|
152
152
|
{/if}
|
|
153
153
|
{:else if open || !collapsable}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GLOBAL_SEARCH_KEY = "
|
|
1
|
+
export declare const GLOBAL_SEARCH_KEY = "k";
|
package/dist/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const GLOBAL_SEARCH_KEY = '
|
|
1
|
+
export const GLOBAL_SEARCH_KEY = 'k';
|