windmill-components 1.613.0 → 1.613.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.
@@ -30,7 +30,8 @@ import ToggleButtonGroup from './common/toggleButton-v2/ToggleButtonGroup.svelte
30
30
  import ToggleButton from './common/toggleButton-v2/ToggleButton.svelte';
31
31
  import Select from './select/Select.svelte';
32
32
  import AnimatedPane from './splitPanes/AnimatedPane.svelte';
33
- import { useSearchParams, StaleWhileLoading } from '../svelte5Utils.svelte';
33
+ import { useSearchParams } from '../svelte5UtilsKit.svelte';
34
+ import { StaleWhileLoading } from '../svelte5Utils.svelte';
34
35
  let { initialPath } = $props();
35
36
  let filters = useSearchParams(runsFiltersSchema);
36
37
  // Initialize path filter from route param if provided and not already set via query params
@@ -5,7 +5,6 @@ import MqttIcon from '../icons/MqttIcon.svelte';
5
5
  import AwsIcon from '../icons/AwsIcon.svelte';
6
6
  import GoogleCloudIcon from '../icons/GoogleCloudIcon.svelte';
7
7
  import SchedulePollIcon from '../icons/SchedulePollIcon.svelte';
8
- import {} from './';
9
8
  import { saveScheduleFromCfg } from '../flows/scheduleUtils';
10
9
  import { saveHttpRouteFromCfg } from './http/utils';
11
10
  import { saveWebsocketTriggerFromCfg } from './websocket/utils';
@@ -1,6 +1,4 @@
1
- import { type StateStore } from './utils';
2
- import * as runed from 'runed/kit';
3
- import type z from 'zod';
1
+ import type { StateStore } from './utils';
4
2
  export declare function withProps<Component, Props>(component: Component, props: Props): {
5
3
  component: Component;
6
4
  props: Props;
@@ -71,7 +69,6 @@ export declare class ChangeOnDeepInequality<T> {
71
69
  constructor(compute: () => T);
72
70
  get value(): T;
73
71
  }
74
- export declare function useSearchParams<S extends z.ZodType>(schema: S, options?: runed.SearchParamsOptions): runed.ReturnUseSearchParams<S>;
75
72
  export declare class StaleWhileLoading<T> {
76
73
  private _current;
77
74
  private _currentTimeout;
@@ -1,9 +1,7 @@
1
1
  // https://github.com/sveltejs/svelte/issues/14600
2
2
  import { untrack } from 'svelte';
3
3
  import { deepEqual } from 'fast-equals';
4
- import {} from './utils';
5
4
  import { resource, watch } from 'runed';
6
- import * as runed from 'runed/kit';
7
5
  export function withProps(component, props) {
8
6
  const ret = $state({
9
7
  component,
@@ -148,33 +146,6 @@ export class ChangeOnDeepInequality {
148
146
  return this._cached;
149
147
  }
150
148
  }
151
- // The original from runed has a weird behavior with dedup reads causing duplicate effect runs
152
- // (Every field has to be derived to avoid it : https://runed.dev/docs/utilities/use-search-params)
153
- export function useSearchParams(schema, options) {
154
- let params = runed.useSearchParams(schema, options);
155
- let keys = Object.keys(schema.shape ?? {});
156
- let obj = { ...params };
157
- for (const key of keys) {
158
- // Somehow using $derived does not trigger reactivity sometimes ...
159
- // (e.g: filters.arg in RunsPage.svelte updates in the URL but does not trigger reactivity)
160
- let derivedVal = $state(params[key]);
161
- Object.defineProperty(obj, key, {
162
- get: () => {
163
- if (typeof derivedVal === 'string')
164
- return decodeURIComponent(derivedVal);
165
- return derivedVal;
166
- },
167
- set: (v) => {
168
- const val = typeof v === 'string' ? encodeURIComponent(v) : v;
169
- params[key] = val;
170
- derivedVal = val;
171
- },
172
- enumerable: true,
173
- configurable: true
174
- });
175
- }
176
- return obj;
177
- }
178
149
  // Prevents flickering when data is unloaded (undefined) then reloaded quickly
179
150
  // But still becomes undefined if data is not reloaded within the timeout
180
151
  // so the user has feedback that the data is not available anymore.
@@ -0,0 +1,3 @@
1
+ import * as runed from 'runed/kit';
2
+ import type z from 'zod';
3
+ export declare function useSearchParams<S extends z.ZodType>(schema: S, options?: runed.SearchParamsOptions): runed.ReturnUseSearchParams<S>;
@@ -0,0 +1,30 @@
1
+ // SvelteKit-specific utilities
2
+ // This file should only be imported in SvelteKit apps as it depends on $app/environment
3
+ import * as runed from 'runed/kit';
4
+ // The original from runed has a weird behavior with dedup reads causing duplicate effect runs
5
+ // (Every field has to be derived to avoid it : https://runed.dev/docs/utilities/use-search-params)
6
+ export function useSearchParams(schema, options) {
7
+ let params = runed.useSearchParams(schema, options);
8
+ let keys = Object.keys(schema.shape ?? {});
9
+ let obj = { ...params };
10
+ for (const key of keys) {
11
+ // Somehow using $derived does not trigger reactivity sometimes ...
12
+ // (e.g: filters.arg in RunsPage.svelte updates in the URL but does not trigger reactivity)
13
+ let derivedVal = $state(params[key]);
14
+ Object.defineProperty(obj, key, {
15
+ get: () => {
16
+ if (typeof derivedVal === 'string')
17
+ return decodeURIComponent(derivedVal);
18
+ return derivedVal;
19
+ },
20
+ set: (v) => {
21
+ const val = typeof v === 'string' ? encodeURIComponent(v) : v;
22
+ params[key] = val;
23
+ derivedVal = val;
24
+ },
25
+ enumerable: true,
26
+ configurable: true
27
+ });
28
+ }
29
+ return obj;
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.613.0",
3
+ "version": "1.613.2",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",