windmill-components 1.408.1 → 1.408.2

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.
@@ -3,7 +3,7 @@ import { ScriptService } from '../../gen';
3
3
  import { Wand2, Loader2 } from 'lucide-svelte';
4
4
  import SearchItems from '../SearchItems.svelte';
5
5
  import { emptyString } from '../../utils';
6
- import { onMount } from 'svelte';
6
+ import { createEventDispatcher, onMount } from 'svelte';
7
7
  export let funcDesc;
8
8
  export let trigger = false;
9
9
  export let loading = false;
@@ -12,6 +12,7 @@ export let disableAi = false;
12
12
  let scripts = undefined;
13
13
  export let filteredItems = [];
14
14
  $: prefilteredItems = scripts ?? [];
15
+ const dispatch = createEventDispatcher();
15
16
  async function loadScripts() {
16
17
  const loadedScripts = await ScriptService.listScripts({
17
18
  workspace: $workspaceStore,
@@ -43,6 +44,11 @@ onMount(() => {
43
44
  <input
44
45
  bind:this={input}
45
46
  type="text"
47
+ on:keydown={(e) => {
48
+ if (e.key === 'Escape') {
49
+ dispatch('escape')
50
+ }
51
+ }}
46
52
  bind:value={funcDesc}
47
53
  placeholder="Search {trigger ? 'triggers' : 'scripts'} {disableAi ? '' : 'or AI gen'}"
48
54
  />
@@ -12,6 +12,8 @@ declare const __propDef: {
12
12
  })[] | undefined;
13
13
  };
14
14
  events: {
15
+ escape: CustomEvent<any>;
16
+ } & {
15
17
  [evt: string]: CustomEvent<any>;
16
18
  };
17
19
  slots: {};
@@ -82,7 +82,14 @@ shouldUsePortal={true} -->
82
82
  role="none"
83
83
  >
84
84
  <div class="flex flex-row items-center gap-2">
85
- <StepGenQuick {disableAi} on:insert bind:funcDesc {preFilter} {loading} />
85
+ <StepGenQuick
86
+ on:escape={() => close(null)}
87
+ {disableAi}
88
+ on:insert
89
+ bind:funcDesc
90
+ {preFilter}
91
+ {loading}
92
+ />
86
93
  {#if selectedKind != 'preprocessor' && selectedKind != 'flow'}
87
94
  <ToggleHubWorkspaceQuick bind:selected={preFilter} />
88
95
  {/if}
@@ -210,7 +210,7 @@ let yamlEditorDrawer = undefined;
210
210
  {:else}
211
211
  <SvelteFlow
212
212
  on:paneclick={(e) => {
213
- window.dispatchEvent(new Event('focus'))
213
+ document.dispatchEvent(new Event('focus'))
214
214
  }}
215
215
  {nodes}
216
216
  {edges}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.408.1",
3
+ "version": "1.408.2",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",