svelte-ag 1.2.0 → 1.2.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.
- package/dist/api/form.svelte.d.ts +18 -4
- package/dist/api/form.svelte.d.ts.map +1 -1
- package/dist/api/form.svelte.js +14 -14
- package/dist/api/query/entrypoint.svelte.d.ts.map +1 -1
- package/dist/api/query/entrypoint.svelte.js +1 -1
- package/dist/api/query/entrypoint.unit.test.js +1 -1
- package/dist/api/query/query.svelte.d.ts.map +1 -1
- package/dist/api/query/query.svelte.js +1 -1
- package/dist/api/query/query.unit.test.js +3 -3
- package/dist/api/query/rate.unit.test.js +1 -1
- package/dist/bin/build-tailwind-manifest.js +1 -1
- package/dist/bin/build-tailwind-manifest.unit.test.js +3 -3
- package/dist/components/animated/animated.svelte +4 -3
- package/dist/components/animated/animated.svelte.d.ts +1 -1
- package/dist/components/animated/animated.svelte.d.ts.map +1 -1
- package/dist/components/carousel/carousel-content.svelte +3 -1
- package/dist/components/carousel/carousel-content.svelte.d.ts.map +1 -1
- package/dist/components/carousel/carousel-dots.svelte +4 -2
- package/dist/components/carousel/carousel-dots.svelte.d.ts.map +1 -1
- package/dist/components/carousel/carousel-item.svelte +3 -1
- package/dist/components/carousel/carousel-item.svelte.d.ts.map +1 -1
- package/dist/components/carousel/carousel-next.svelte +5 -3
- package/dist/components/carousel/carousel-next.svelte.d.ts +1 -1
- package/dist/components/carousel/carousel-next.svelte.d.ts.map +1 -1
- package/dist/components/carousel/carousel-previous.svelte +5 -3
- package/dist/components/carousel/carousel-previous.svelte.d.ts +1 -1
- package/dist/components/carousel/carousel-previous.svelte.d.ts.map +1 -1
- package/dist/components/carousel/carousel.svelte +4 -2
- package/dist/components/carousel/carousel.svelte.d.ts.map +1 -1
- package/dist/components/carousel/index.d.ts +35 -35
- package/dist/components/carousel/index.d.ts.map +1 -1
- package/dist/components/carousel/index.js +3 -3
- package/dist/components/dnd/DndContext.svelte +1 -0
- package/dist/components/dnd/DndContext.svelte.d.ts.map +1 -1
- package/dist/components/dnd/DndDroppable.svelte +1 -1
- package/dist/components/dnd/DndDroppable.svelte.d.ts +1 -1
- package/dist/components/dnd/DndDroppable.svelte.d.ts.map +1 -1
- package/dist/components/dnd/DndHandle.svelte +2 -1
- package/dist/components/dnd/DndHandle.svelte.d.ts.map +1 -1
- package/dist/components/dnd/DndItem.svelte +3 -2
- package/dist/components/dnd/DndItem.svelte.d.ts +1 -1
- package/dist/components/dnd/DndItem.svelte.d.ts.map +1 -1
- package/dist/components/dnd/DndOverlay.svelte +2 -0
- package/dist/components/dnd/DndOverlay.svelte.d.ts.map +1 -1
- package/dist/components/dnd/examples/SimpleSortable.svelte +1 -0
- package/dist/components/dnd/examples/SimpleSortable.svelte.d.ts.map +1 -1
- package/dist/components/dnd/recipies/SimpleSortable.svelte +4 -3
- package/dist/components/dnd/recipies/SimpleSortable.svelte.d.ts +1 -1
- package/dist/components/dnd/recipies/SimpleSortable.svelte.d.ts.map +1 -1
- package/dist/components/form/form-button.svelte +4 -1
- package/dist/components/form/form-button.svelte.d.ts +1 -1
- package/dist/components/form/form-button.svelte.d.ts.map +1 -1
- package/dist/components/form/form-control.svelte +2 -1
- package/dist/components/form/form-control.svelte.d.ts +1 -1
- package/dist/components/form/form-control.svelte.d.ts.map +1 -1
- package/dist/components/form/form-description.svelte +2 -1
- package/dist/components/form/form-description.svelte.d.ts.map +1 -1
- package/dist/components/form/form-element-field.svelte +3 -2
- package/dist/components/form/form-element-field.svelte.d.ts +2 -2
- package/dist/components/form/form-element-field.svelte.d.ts.map +1 -1
- package/dist/components/form/form-field-errors.svelte +2 -1
- package/dist/components/form/form-field-errors.svelte.d.ts.map +1 -1
- package/dist/components/form/form-field-full.svelte +12 -10
- package/dist/components/form/form-field-full.svelte.d.ts +3 -3
- package/dist/components/form/form-field-full.svelte.d.ts.map +1 -1
- package/dist/components/form/form-field.svelte +4 -2
- package/dist/components/form/form-field.svelte.d.ts +1 -1
- package/dist/components/form/form-field.svelte.d.ts.map +1 -1
- package/dist/components/form/form-fieldset.svelte +2 -1
- package/dist/components/form/form-fieldset.svelte.d.ts +1 -1
- package/dist/components/form/form-fieldset.svelte.d.ts.map +1 -1
- package/dist/components/form/form-label.svelte +2 -1
- package/dist/components/form/form-label.svelte.d.ts.map +1 -1
- package/dist/components/form/form-legend.svelte +2 -1
- package/dist/components/form/form-legend.svelte.d.ts.map +1 -1
- package/dist/components/form/form-message.svelte +3 -1
- package/dist/components/form/form-message.svelte.d.ts.map +1 -1
- package/dist/components/form/form.svelte +2 -1
- package/dist/components/form/form.svelte.d.ts.map +1 -1
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/gallery/gallery.svelte +3 -1
- package/dist/components/gallery/gallery.svelte.d.ts.map +1 -1
- package/dist/components/gradient/Gradient.svelte +3 -2
- package/dist/components/gradient/Gradient.svelte.d.ts +1 -1
- package/dist/components/gradient/Gradient.svelte.d.ts.map +1 -1
- package/dist/components/safe/safe.svelte +2 -1
- package/dist/components/safe/safe.svelte.d.ts +1 -1
- package/dist/components/safe/safe.svelte.d.ts.map +1 -1
- package/dist/components/search/combinations/searchPopover.svelte +4 -2
- package/dist/components/search/combinations/searchPopover.svelte.d.ts +1 -1
- package/dist/components/search/combinations/searchPopover.svelte.d.ts.map +1 -1
- package/dist/components/search/components/search-empty.svelte +5 -3
- package/dist/components/search/components/search-empty.svelte.d.ts.map +1 -1
- package/dist/components/search/components/search-input.svelte +5 -3
- package/dist/components/search/components/search-input.svelte.d.ts.map +1 -1
- package/dist/components/search/components/search-list.svelte +6 -4
- package/dist/components/search/components/search-list.svelte.d.ts.map +1 -1
- package/dist/components/search/components/search-pagnation.svelte +5 -3
- package/dist/components/search/components/search-pagnation.svelte.d.ts.map +1 -1
- package/dist/components/search/components/search.svelte +5 -3
- package/dist/components/search/components/search.svelte.d.ts.map +1 -1
- package/dist/components/search/search.svelte.d.ts.map +1 -1
- package/dist/components/search/search.svelte.js +2 -2
- package/dist/components/shader/BaseShader.svelte +2 -2
- package/dist/components/shader/WebGpuShader.svelte +2 -2
- package/dist/components/shader/intersectionObserver.d.ts.map +1 -1
- package/dist/components/sidebar/context.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/context.svelte.js +1 -1
- package/dist/components/sidebar/index.d.ts +3 -3
- package/dist/components/sidebar/index.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-content.svelte +2 -1
- package/dist/components/sidebar/sidebar-content.svelte.d.ts +1 -1
- package/dist/components/sidebar/sidebar-content.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-footer.svelte +2 -1
- package/dist/components/sidebar/sidebar-footer.svelte.d.ts +1 -1
- package/dist/components/sidebar/sidebar-footer.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-group-action.svelte +2 -1
- package/dist/components/sidebar/sidebar-group-action.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-group-content.svelte +2 -1
- package/dist/components/sidebar/sidebar-group-content.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-group-label.svelte +2 -1
- package/dist/components/sidebar/sidebar-group-label.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-group.svelte +2 -1
- package/dist/components/sidebar/sidebar-group.svelte.d.ts +1 -1
- package/dist/components/sidebar/sidebar-group.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-header.svelte +2 -1
- package/dist/components/sidebar/sidebar-header.svelte.d.ts +1 -1
- package/dist/components/sidebar/sidebar-header.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-input.svelte +1 -0
- package/dist/components/sidebar/sidebar-input.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-inset.svelte +2 -1
- package/dist/components/sidebar/sidebar-inset.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu-action.svelte +2 -1
- package/dist/components/sidebar/sidebar-menu-action.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu-badge.svelte +2 -1
- package/dist/components/sidebar/sidebar-menu-badge.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu-button.svelte +6 -5
- package/dist/components/sidebar/sidebar-menu-button.svelte.d.ts +2 -2
- package/dist/components/sidebar/sidebar-menu-button.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu-item.svelte +2 -1
- package/dist/components/sidebar/sidebar-menu-item.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu-skeleton.svelte +3 -2
- package/dist/components/sidebar/sidebar-menu-skeleton.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu-sub-button.svelte +2 -1
- package/dist/components/sidebar/sidebar-menu-sub-button.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu-sub-item.svelte +2 -1
- package/dist/components/sidebar/sidebar-menu-sub-item.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu-sub.svelte +2 -1
- package/dist/components/sidebar/sidebar-menu-sub.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-menu.svelte +2 -1
- package/dist/components/sidebar/sidebar-menu.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-provider.svelte +6 -4
- package/dist/components/sidebar/sidebar-provider.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-rail.svelte +3 -1
- package/dist/components/sidebar/sidebar-rail.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-separator.svelte +2 -1
- package/dist/components/sidebar/sidebar-separator.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-trigger.svelte +3 -1
- package/dist/components/sidebar/sidebar-trigger.svelte.d.ts +1 -1
- package/dist/components/sidebar/sidebar-trigger.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar.svelte +4 -2
- package/dist/components/sidebar/sidebar.svelte.d.ts.map +1 -1
- package/dist/components/utilities/arrow/arrow.svelte +2 -1
- package/dist/components/utilities/arrow/arrow.svelte.d.ts.map +1 -1
- package/dist/index.d.ts +17 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/vite/vite-plugin-component-source-collector.d.ts.map +1 -1
- package/dist/vite/vite-plugin-component-source-collector.js +3 -3
- package/dist/vite/vite-plugin-component-source-collector.unit.test.js +2 -2
- package/package.json +12 -14
- package/src/lib/api/form.svelte.ts +49 -25
- package/src/lib/api/query/cache.unit.test.ts +1 -0
- package/src/lib/api/query/entrypoint.svelte.ts +2 -1
- package/src/lib/api/query/entrypoint.unit.test.ts +1 -1
- package/src/lib/api/query/query.svelte.ts +2 -3
- package/src/lib/api/query/query.unit.test.ts +4 -3
- package/src/lib/api/query/rate.unit.test.ts +2 -1
- package/src/lib/bin/build-tailwind-manifest.ts +3 -1
- package/src/lib/bin/build-tailwind-manifest.unit.test.ts +5 -3
- package/src/lib/components/animated/animated.svelte +4 -3
- package/src/lib/components/carousel/carousel-content.svelte +3 -1
- package/src/lib/components/carousel/carousel-dots.svelte +4 -2
- package/src/lib/components/carousel/carousel-item.svelte +3 -1
- package/src/lib/components/carousel/carousel-next.svelte +5 -3
- package/src/lib/components/carousel/carousel-previous.svelte +5 -3
- package/src/lib/components/carousel/carousel.svelte +4 -2
- package/src/lib/components/carousel/index.ts +3 -3
- package/src/lib/components/dnd/DndContext.svelte +1 -0
- package/src/lib/components/dnd/DndDroppable.svelte +1 -1
- package/src/lib/components/dnd/DndHandle.svelte +2 -1
- package/src/lib/components/dnd/DndItem.svelte +3 -2
- package/src/lib/components/dnd/DndOverlay.svelte +2 -0
- package/src/lib/components/dnd/examples/SimpleSortable.svelte +1 -0
- package/src/lib/components/dnd/recipies/SimpleSortable.svelte +4 -3
- package/src/lib/components/form/form-button.svelte +4 -1
- package/src/lib/components/form/form-control.svelte +2 -1
- package/src/lib/components/form/form-description.svelte +2 -1
- package/src/lib/components/form/form-element-field.svelte +3 -2
- package/src/lib/components/form/form-field-errors.svelte +2 -1
- package/src/lib/components/form/form-field-full.svelte +12 -10
- package/src/lib/components/form/form-field.svelte +4 -2
- package/src/lib/components/form/form-fieldset.svelte +2 -1
- package/src/lib/components/form/form-label.svelte +2 -1
- package/src/lib/components/form/form-legend.svelte +2 -1
- package/src/lib/components/form/form-message.svelte +3 -1
- package/src/lib/components/form/form.svelte +2 -1
- package/src/lib/components/gallery/gallery.svelte +3 -1
- package/src/lib/components/gradient/Gradient.svelte +3 -2
- package/src/lib/components/safe/safe.svelte +2 -1
- package/src/lib/components/search/combinations/searchPopover.svelte +4 -2
- package/src/lib/components/search/components/search-empty.svelte +5 -3
- package/src/lib/components/search/components/search-input.svelte +5 -3
- package/src/lib/components/search/components/search-list.svelte +6 -4
- package/src/lib/components/search/components/search-pagnation.svelte +5 -3
- package/src/lib/components/search/components/search.svelte +5 -3
- package/src/lib/components/search/search.svelte.ts +4 -3
- package/src/lib/components/shader/BaseShader.svelte +2 -2
- package/src/lib/components/shader/WebGpuShader.svelte +2 -2
- package/src/lib/components/shader/intersectionObserver.ts +2 -1
- package/src/lib/components/sidebar/context.svelte.ts +3 -2
- package/src/lib/components/sidebar/sidebar-content.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-footer.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-group-action.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-group-content.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-group-label.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-group.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-header.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-input.svelte +1 -0
- package/src/lib/components/sidebar/sidebar-inset.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-menu-action.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-menu-badge.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-menu-button.svelte +6 -5
- package/src/lib/components/sidebar/sidebar-menu-item.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-menu-skeleton.svelte +3 -2
- package/src/lib/components/sidebar/sidebar-menu-sub-button.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-menu-sub-item.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-menu-sub.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-menu.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-provider.svelte +6 -4
- package/src/lib/components/sidebar/sidebar-rail.svelte +3 -1
- package/src/lib/components/sidebar/sidebar-separator.svelte +2 -1
- package/src/lib/components/sidebar/sidebar-trigger.svelte +3 -1
- package/src/lib/components/sidebar/sidebar.svelte +4 -2
- package/src/lib/components/utilities/arrow/arrow.svelte +2 -1
- package/src/lib/vite/vite-plugin-component-source-collector.ts +6 -4
- package/src/lib/vite/vite-plugin-component-source-collector.unit.test.ts +3 -2
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { dequal } from 'dequal';
|
|
2
|
+
import { watch } from 'runed';
|
|
3
|
+
import { get } from 'svelte/store';
|
|
1
4
|
import { superForm, defaults, setError, setMessage } from 'sveltekit-superforms';
|
|
2
|
-
import type { SuperForm
|
|
5
|
+
import type { SuperForm } from 'sveltekit-superforms';
|
|
3
6
|
import { valibot } from 'sveltekit-superforms/adapters';
|
|
4
7
|
import type {
|
|
5
8
|
ApiRequestFunction,
|
|
@@ -10,15 +13,41 @@ import type {
|
|
|
10
13
|
ApiErrorBody,
|
|
11
14
|
ApiSchema
|
|
12
15
|
} from 'ts-ag';
|
|
13
|
-
import { watch } from 'runed';
|
|
14
|
-
import { dequal } from 'dequal';
|
|
15
|
-
import { get } from 'svelte/store';
|
|
16
16
|
import { safeParse, safeParseAsync } from 'valibot';
|
|
17
17
|
|
|
18
18
|
export type ValidInput<E extends ApiEndpoints, P extends E['path'], M extends E['method']> = NonNullable<
|
|
19
19
|
ApiInput<E, P, M>
|
|
20
20
|
>;
|
|
21
21
|
|
|
22
|
+
type FormProps<T extends ApiEndpoints, P extends T['path'], M extends Extract<T, { path: P }>['method']> = NonNullable<
|
|
23
|
+
Parameters<typeof superForm<ValidInput<T, P, M>>>[1]
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
type FormOnUpdateArgs<
|
|
27
|
+
T extends ApiEndpoints,
|
|
28
|
+
P extends T['path'],
|
|
29
|
+
M extends Extract<T, { path: P }>['method']
|
|
30
|
+
> = Parameters<NonNullable<FormProps<T, P, M>['onUpdate']>>[0];
|
|
31
|
+
|
|
32
|
+
type FormActionArgs<
|
|
33
|
+
T extends ApiEndpoints,
|
|
34
|
+
P extends T['path'],
|
|
35
|
+
M extends Extract<T, { path: P }>['method'],
|
|
36
|
+
B = undefined
|
|
37
|
+
> = FormOnUpdateArgs<T, P, M> & { body: B };
|
|
38
|
+
|
|
39
|
+
type FormErrorBody<
|
|
40
|
+
T extends ApiEndpoints,
|
|
41
|
+
P extends T['path'],
|
|
42
|
+
M extends Extract<T, { path: P }>['method']
|
|
43
|
+
> = ApiErrorBody<T, P, M> & {
|
|
44
|
+
message: string;
|
|
45
|
+
field?: {
|
|
46
|
+
name: string;
|
|
47
|
+
value: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
22
51
|
/**
|
|
23
52
|
* Creates a strongly-typed form factory for an API schema.
|
|
24
53
|
*
|
|
@@ -44,17 +73,13 @@ export type ApiRequestForm<
|
|
|
44
73
|
* - `beforeRequest`: called before sending the api call
|
|
45
74
|
* - `onSuccess`: called after a successful response body is parsed.
|
|
46
75
|
* - `onFail`: called after an error response body is parsed and mapped to form errors/messages.
|
|
76
|
+
*
|
|
77
|
+
* Each hook receives the `onUpdate` event object plus a `body` field.
|
|
47
78
|
*/
|
|
48
79
|
actions?: {
|
|
49
|
-
beforeRequest?: (
|
|
50
|
-
onSuccess?: (
|
|
51
|
-
|
|
52
|
-
response: ApiSuccessBody<API, Path, Method>
|
|
53
|
-
) => void | Promise<void>;
|
|
54
|
-
onFail?: (
|
|
55
|
-
form: SuperValidated<ValidInput<API, Path, Method>>,
|
|
56
|
-
response: ApiErrorBody<API, Path, Method>
|
|
57
|
-
) => void | Promise<void>;
|
|
80
|
+
beforeRequest?: (args: FormActionArgs<API, Path, Method>) => void | Promise<void>;
|
|
81
|
+
onSuccess?: (args: FormActionArgs<API, Path, Method, ApiSuccessBody<API, Path, Method>>) => void | Promise<void>;
|
|
82
|
+
onFail?: (args: FormActionArgs<API, Path, Method, ApiErrorBody<API, Path, Method>>) => void | Promise<void>;
|
|
58
83
|
};
|
|
59
84
|
|
|
60
85
|
/**
|
|
@@ -156,32 +181,31 @@ export function createFormFunction<API extends ApiEndpoints>(
|
|
|
156
181
|
});
|
|
157
182
|
}
|
|
158
183
|
},
|
|
159
|
-
async onUpdate(
|
|
160
|
-
if (actions && actions.beforeRequest) await actions.beforeRequest(
|
|
161
|
-
|
|
162
|
-
if (!form.valid) return;
|
|
184
|
+
async onUpdate(props) {
|
|
185
|
+
if (actions && actions.beforeRequest) await actions.beforeRequest({ ...props, body: undefined });
|
|
186
|
+
if (!props.form.valid) return;
|
|
163
187
|
|
|
164
188
|
// console.log('onUpdate: sending data', form.data);
|
|
165
|
-
const res = await request(path, method, form.data);
|
|
189
|
+
const res = await request(path, method, props.form.data);
|
|
166
190
|
|
|
167
191
|
if (res.ok === false) {
|
|
168
|
-
const body = await res.json()
|
|
192
|
+
const body = (await res.json()) as FormErrorBody<API, typeof path, typeof method>;
|
|
169
193
|
|
|
170
194
|
// TODO set some kind of overall form error if there is no field
|
|
171
195
|
if (!body.field) {
|
|
172
|
-
setMessage(form, body.message);
|
|
196
|
+
setMessage(props.form, body.message);
|
|
173
197
|
// setError(form, '', body.message);
|
|
174
198
|
} else {
|
|
175
|
-
setError(form, body.field!.name as any, body.field.value, { status: res.status });
|
|
199
|
+
setError(props.form, body.field!.name as any, body.field.value, { status: res.status });
|
|
176
200
|
}
|
|
177
201
|
if (actions && actions.onFail) {
|
|
178
|
-
await actions.onFail(
|
|
202
|
+
await actions.onFail({ ...props, body });
|
|
179
203
|
}
|
|
180
204
|
} else {
|
|
181
|
-
setMessage(form, 'Success');
|
|
205
|
+
setMessage(props.form, 'Success');
|
|
182
206
|
if (actions && actions.onSuccess) {
|
|
183
|
-
const body = await res.json()
|
|
184
|
-
await actions.onSuccess(
|
|
207
|
+
const body = (await res.json()) as ApiSuccessBody<API, typeof path, typeof method>;
|
|
208
|
+
await actions.onSuccess({ ...props, body });
|
|
185
209
|
}
|
|
186
210
|
}
|
|
187
211
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SvelteMap } from 'svelte/reactivity';
|
|
2
2
|
import type { ApiEndpoints, ApiRequestFunction, ApiInput, ApiResponse } from 'ts-ag';
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import { Cache } from './cache.svelte.js';
|
|
5
|
+
import { Requestor, Query } from './query.svelte.js';
|
|
5
6
|
import { batchQueryKey, cacheKey } from './utils.svelte.js';
|
|
6
7
|
|
|
7
8
|
// ---------------- Global state ----------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
1
|
import { createApiRequest, type ApiEndpoints } from 'ts-ag';
|
|
3
2
|
import * as v from 'valibot';
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
4
4
|
|
|
5
5
|
type TestResponse = ApiEndpoints['response'];
|
|
6
6
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { stringify } from 'devalue';
|
|
1
2
|
import type { ApiEndpoints, ApiInput, ApiRequestFunction, ApiSuccessBody, ApiErrorBody, ApiResponse } from 'ts-ag';
|
|
2
3
|
|
|
3
|
-
import { stringify } from 'devalue';
|
|
4
4
|
import type { Cache } from './cache.svelte';
|
|
5
|
-
|
|
6
|
-
import { cacheKey } from './utils.svelte.js';
|
|
7
5
|
import type { BatchDetails } from './entrypoint.svelte';
|
|
8
6
|
import { RateLimiter } from './rate.svelte';
|
|
7
|
+
import { cacheKey } from './utils.svelte.js';
|
|
9
8
|
|
|
10
9
|
export type QueryStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
11
10
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { stringify } from 'devalue';
|
|
2
2
|
import { createApiRequest, type ApiEndpoints } from 'ts-ag';
|
|
3
|
+
import * as v from 'valibot';
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
|
|
3
6
|
import { Cache } from './cache.svelte.js';
|
|
4
7
|
import { Query, Requestor } from './query.svelte.js';
|
|
5
|
-
import { stringify } from 'devalue';
|
|
6
|
-
import * as v from 'valibot';
|
|
7
8
|
|
|
8
9
|
type PlainUserInput = { id: number };
|
|
9
10
|
type BatchedUserInput = { id: number; group?: string };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
1
|
import { sleep } from 'radash';
|
|
2
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
3
|
+
|
|
3
4
|
import { RateLimiter } from './rate.svelte.js';
|
|
4
5
|
|
|
5
6
|
describe('RateLimiter', () => {
|
|
@@ -2,10 +2,12 @@ import { existsSync, statSync } from 'node:fs';
|
|
|
2
2
|
import { glob, readFile, readdir, stat } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import process from 'node:process';
|
|
5
|
+
|
|
5
6
|
import { init, parse as parseEsm } from 'es-module-lexer';
|
|
6
7
|
import { parse as parseSvelte } from 'svelte/compiler';
|
|
7
|
-
import ts from 'typescript';
|
|
8
8
|
import { readPackageJson, writeIfDifferent } from 'ts-ag';
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
|
|
9
11
|
import {
|
|
10
12
|
ensureRelativeManifestSourcePath,
|
|
11
13
|
getTailwindSourcesManifestPath,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it } from 'vitest';
|
|
2
1
|
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'fs/promises';
|
|
3
|
-
import { join } from 'path';
|
|
4
2
|
import { tmpdir } from 'os';
|
|
5
|
-
import {
|
|
3
|
+
import { join } from 'path';
|
|
4
|
+
|
|
5
|
+
import { afterEach, describe, expect, it } from 'vitest';
|
|
6
|
+
|
|
6
7
|
import { parseTailwindSourceManifest } from '../vite/tailwind-sources-manifest.js';
|
|
8
|
+
import { main } from './build-tailwind-manifest.js';
|
|
7
9
|
|
|
8
10
|
const tempDirectories: string[] = [];
|
|
9
11
|
const originalWorkingDirectory = process.cwd();
|
|
@@ -50,10 +50,11 @@
|
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<script lang="ts">
|
|
53
|
-
import { cn, type HTMLDivAttributes } from '$utils';
|
|
54
|
-
import type { WithElementRef } from 'svelte-toolbelt';
|
|
55
|
-
import { tick } from 'svelte';
|
|
56
53
|
import { watch } from 'runed';
|
|
54
|
+
import { tick } from 'svelte';
|
|
55
|
+
import type { WithElementRef } from 'svelte-toolbelt';
|
|
56
|
+
|
|
57
|
+
import { cn, type HTMLDivAttributes } from '$utils';
|
|
57
58
|
|
|
58
59
|
export type Props = WithElementRef<HTMLDivAttributes> & {
|
|
59
60
|
visible: boolean;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { WithElementRef } from 'bits-ui';
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { cn } from '$utils/utils.js';
|
|
6
6
|
|
|
7
|
+
import { getEmblaContext } from './context.js';
|
|
8
|
+
|
|
7
9
|
let {
|
|
8
10
|
ref = $bindable(null),
|
|
9
11
|
class: className,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { WithoutChildren } from 'bits-ui';
|
|
3
|
-
|
|
4
|
-
import { cn } from '$utils/utils.js';
|
|
3
|
+
|
|
5
4
|
import { type Props } from '$shadcn/button/index.js';
|
|
5
|
+
import { cn } from '$utils/utils.js';
|
|
6
|
+
|
|
7
|
+
import { getEmblaContext } from './context.js';
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
ref = $bindable(null),
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { WithElementRef } from 'bits-ui';
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { cn } from '$utils/utils.js';
|
|
6
6
|
|
|
7
|
+
import { getEmblaContext } from './context.js';
|
|
8
|
+
|
|
7
9
|
let {
|
|
8
10
|
ref = $bindable(null),
|
|
9
11
|
class: className,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import ArrowRight from '@lucide/svelte/icons/arrow-right';
|
|
3
3
|
import type { WithoutChildren } from 'bits-ui';
|
|
4
|
-
import { getEmblaContext } from './context.js';
|
|
5
|
-
import { cn } from '$utils/utils.js';
|
|
6
|
-
import { Button, type Props } from '$shadcn/button/index.js';
|
|
7
4
|
import { tv, type VariantProps } from 'tailwind-variants';
|
|
8
5
|
|
|
6
|
+
import { Button, type Props } from '$shadcn/button/index.js';
|
|
7
|
+
import { cn } from '$utils/utils.js';
|
|
8
|
+
|
|
9
|
+
import { getEmblaContext } from './context.js';
|
|
10
|
+
|
|
9
11
|
let {
|
|
10
12
|
ref = $bindable(null),
|
|
11
13
|
class: className,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import ArrowLeft from '@lucide/svelte/icons/arrow-left';
|
|
3
3
|
import type { WithoutChildren } from 'bits-ui';
|
|
4
|
-
import { getEmblaContext } from './context.js';
|
|
5
|
-
import { cn } from '$utils/utils.js';
|
|
6
|
-
import { Button, type Props } from '$shadcn/button/index.js';
|
|
7
4
|
import { type VariantProps, tv } from 'tailwind-variants';
|
|
8
5
|
|
|
6
|
+
import { Button, type Props } from '$shadcn/button/index.js';
|
|
7
|
+
import { cn } from '$utils/utils.js';
|
|
8
|
+
|
|
9
|
+
import { getEmblaContext } from './context.js';
|
|
10
|
+
|
|
9
11
|
let {
|
|
10
12
|
ref = $bindable(null),
|
|
11
13
|
class: className,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { type CarouselAPI, type CarouselProps, type EmblaContext, setEmblaContext } from './context.js';
|
|
3
|
-
import { cn } from '$utils/utils.js';
|
|
4
2
|
import emblaCarouselSvelte from 'embla-carousel-svelte';
|
|
5
3
|
import { watch } from 'runed';
|
|
6
4
|
|
|
5
|
+
import { cn } from '$utils/utils.js';
|
|
6
|
+
|
|
7
|
+
import { type CarouselAPI, type CarouselProps, type EmblaContext, setEmblaContext } from './context.js';
|
|
8
|
+
|
|
7
9
|
let {
|
|
8
10
|
opts = {},
|
|
9
11
|
plugins = [],
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Root from './carousel.svelte';
|
|
2
1
|
import Content from './carousel-content.svelte';
|
|
2
|
+
import Dots from './carousel-dots.svelte';
|
|
3
3
|
import Item from './carousel-item.svelte';
|
|
4
|
-
import Previous from './carousel-previous.svelte';
|
|
5
4
|
import Next from './carousel-next.svelte';
|
|
6
|
-
import
|
|
5
|
+
import Previous from './carousel-previous.svelte';
|
|
6
|
+
import Root from './carousel.svelte';
|
|
7
7
|
|
|
8
8
|
export {
|
|
9
9
|
Root as Carousel,
|
|
@@ -25,6 +25,7 @@ It makes state handling and items sorting easier
|
|
|
25
25
|
import { DragDropProvider } from '@dnd-kit/svelte';
|
|
26
26
|
// import { move } from '@dnd-kit/helpers';
|
|
27
27
|
import { box } from 'svelte-toolbelt';
|
|
28
|
+
|
|
28
29
|
import { findItem } from './utils.svelte';
|
|
29
30
|
|
|
30
31
|
let { children, items = $bindable(), onDragOver, onDragEnd, onDragStart, ...rest }: DndContextProps<T> = $props();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createDroppable, type CreateDroppableInput } from '@dnd-kit/svelte';
|
|
3
|
-
import type { ClassValue } from 'svelte/elements';
|
|
4
3
|
import type { Snippet } from 'svelte';
|
|
4
|
+
import type { ClassValue } from 'svelte/elements';
|
|
5
5
|
|
|
6
6
|
interface DroppableProps extends CreateDroppableInput {
|
|
7
7
|
children: Snippet<[{ isDropTarget: boolean }]>;
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script lang="ts">
|
|
8
|
-
import { getItem } from './DndSortableItem.svelte';
|
|
9
8
|
import { cn } from '$utils/utils.js';
|
|
9
|
+
|
|
10
|
+
import { getItem } from './DndSortableItem.svelte';
|
|
10
11
|
let { class: className }: DragHandleProps = $props();
|
|
11
12
|
|
|
12
13
|
const item = $derived.by(() => {
|
|
@@ -37,9 +37,10 @@ Usage:
|
|
|
37
37
|
</script>
|
|
38
38
|
|
|
39
39
|
<script lang="ts">
|
|
40
|
-
import { setItem } from './DndSortableItem.svelte';
|
|
41
|
-
import type { Snippet } from 'svelte';
|
|
42
40
|
import { createDraggable, type CreateDraggableInput } from '@dnd-kit/svelte';
|
|
41
|
+
import type { Snippet } from 'svelte';
|
|
42
|
+
|
|
43
|
+
import { setItem } from './DndSortableItem.svelte';
|
|
43
44
|
|
|
44
45
|
let { id, child, ...rest }: DndItemProps = $props();
|
|
45
46
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import { type ComponentProps, type Snippet } from 'svelte';
|
|
3
|
+
|
|
3
4
|
import type { SortableItemChildProps } from './DndSortableItem.svelte';
|
|
4
5
|
|
|
5
6
|
export type OverlayChildProps<T> = { item: T } & SortableItemChildProps;
|
|
@@ -10,6 +11,7 @@
|
|
|
10
11
|
|
|
11
12
|
<script lang="ts" generics="T extends {id: string; children?: T[]}">
|
|
12
13
|
import { DragOverlay } from '@dnd-kit/svelte';
|
|
14
|
+
|
|
13
15
|
import { getDnd } from './DndContext.svelte';
|
|
14
16
|
import { findItem } from './utils.svelte.js';
|
|
15
17
|
|
|
@@ -47,12 +47,13 @@ Usage:
|
|
|
47
47
|
</script>
|
|
48
48
|
|
|
49
49
|
<script lang="ts" generics="T extends {id: string; children?: T[]}">
|
|
50
|
-
import type { ClassValue } from 'svelte/elements';
|
|
51
50
|
import type { Snippet } from 'svelte';
|
|
52
|
-
import type {
|
|
53
|
-
|
|
51
|
+
import type { ClassValue } from 'svelte/elements';
|
|
52
|
+
|
|
54
53
|
import DndContext, { type DndContextProps } from '../DndContext.svelte';
|
|
55
54
|
import DndOverlay, { type OverlayChildProps } from '../DndOverlay.svelte';
|
|
55
|
+
import type { SortableItemChildProps } from '../DndSortableItem.svelte';
|
|
56
|
+
import DndSortableItem from '../DndSortableItem.svelte';
|
|
56
57
|
|
|
57
58
|
let { class: className, item: itemSnippet, items = $bindable(), ...rest }: SimpleSortableProps<T> = $props();
|
|
58
59
|
</script>
|
|
@@ -7,10 +7,12 @@ Icons:
|
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
<script module lang="ts">
|
|
10
|
-
import type { FormFieldProps } from './form-field.svelte';
|
|
11
10
|
import type { FormPath } from 'sveltekit-superforms';
|
|
11
|
+
|
|
12
12
|
import type { Props as ButtonProps } from '$shadcn/button/index.js';
|
|
13
13
|
|
|
14
|
+
import type { FormFieldProps } from './form-field.svelte';
|
|
15
|
+
|
|
14
16
|
// eslint-disable-next-line
|
|
15
17
|
export type FormButtonProps<T extends Record<string, unknown> = {}, U extends FormPath<T> = any> = Omit<
|
|
16
18
|
ButtonProps,
|
|
@@ -24,6 +26,7 @@ Icons:
|
|
|
24
26
|
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
|
|
25
27
|
import { Button } from '$shadcn/button/index.js';
|
|
26
28
|
import { cn, flyAndScale } from '$utils/utils.js';
|
|
29
|
+
|
|
27
30
|
import { getFormContext } from './form.svelte';
|
|
28
31
|
|
|
29
32
|
let {
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
<script lang="ts">
|
|
7
7
|
import { Control } from 'formsnap';
|
|
8
|
-
import { getFormContext, type FormContext } from './form.svelte';
|
|
9
8
|
import type { Snippet } from 'svelte';
|
|
10
9
|
import type { Expand } from 'svelte-toolbelt';
|
|
11
10
|
|
|
11
|
+
import { getFormContext, type FormContext } from './form.svelte';
|
|
12
|
+
|
|
12
13
|
let {
|
|
13
14
|
children: childrenProp,
|
|
14
15
|
...restProps
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPathLeaves<T>">
|
|
2
|
+
import type { WithElementRef, WithoutChildren } from 'bits-ui';
|
|
2
3
|
import * as FormPrimitive from 'formsnap';
|
|
3
|
-
import type { FormPathLeaves } from 'sveltekit-superforms';
|
|
4
4
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
-
import type {
|
|
5
|
+
import type { FormPathLeaves } from 'sveltekit-superforms';
|
|
6
|
+
|
|
6
7
|
import { cn } from '$shadcn/utils.js';
|
|
7
8
|
|
|
8
9
|
let {
|
|
@@ -54,21 +54,23 @@ else is the same just bind the value prop as so:
|
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
|
|
57
|
-
import FormField, { type FormFieldProps } from './form-field.svelte';
|
|
58
|
-
import FormLabel from './form-label.svelte';
|
|
59
|
-
import Description from './form-description.svelte';
|
|
60
|
-
import FieldErrors from './form-field-errors.svelte';
|
|
61
|
-
import { Input } from '$shadcn/input/index.js';
|
|
62
57
|
import { Control as FormControl } from 'formsnap';
|
|
63
|
-
import { type FormPath } from 'sveltekit-superforms';
|
|
64
58
|
import { get, set } from 'radash';
|
|
59
|
+
import type { ComponentProps, Snippet } from 'svelte';
|
|
65
60
|
import { type WithElementRef, type WithoutChildren } from 'svelte-toolbelt';
|
|
66
|
-
import { cn } from '$utils/index.js';
|
|
67
|
-
import type { HTMLAttributes, HTMLInputAttributes } from 'svelte/elements';
|
|
68
61
|
import { mergeProps } from 'svelte-toolbelt';
|
|
69
|
-
import {
|
|
70
|
-
import
|
|
62
|
+
import type { HTMLAttributes, HTMLInputAttributes } from 'svelte/elements';
|
|
63
|
+
import { type FormPath } from 'sveltekit-superforms';
|
|
64
|
+
|
|
71
65
|
import { Checkbox } from '$shadcn/checkbox/index.js';
|
|
66
|
+
import { Input } from '$shadcn/input/index.js';
|
|
67
|
+
import { cn } from '$utils/index.js';
|
|
68
|
+
|
|
69
|
+
import Description from './form-description.svelte';
|
|
70
|
+
import FieldErrors from './form-field-errors.svelte';
|
|
71
|
+
import FormField, { type FormFieldProps } from './form-field.svelte';
|
|
72
|
+
import FormLabel from './form-label.svelte';
|
|
73
|
+
import { getFormContext } from './form.svelte';
|
|
72
74
|
|
|
73
75
|
let {
|
|
74
76
|
ref = $bindable(null),
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
|
|
11
11
|
import * as FormPrimitive from 'formsnap';
|
|
12
|
-
import type { FormPath } from 'sveltekit-superforms';
|
|
13
12
|
import { type WithElementRef, type WithoutChildren } from 'svelte-toolbelt';
|
|
14
|
-
import { cn } from '$utils/index.js';
|
|
15
13
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
14
|
+
import type { FormPath } from 'sveltekit-superforms';
|
|
15
|
+
|
|
16
|
+
import { cn } from '$utils/index.js';
|
|
17
|
+
|
|
16
18
|
import { getFormContext } from './form.svelte';
|
|
17
19
|
|
|
18
20
|
let {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends Record<string, unknown>, U extends FormPath<T>">
|
|
2
|
+
import type { WithoutChild } from 'bits-ui';
|
|
2
3
|
import * as FormPrimitive from 'formsnap';
|
|
3
4
|
import type { FormPath } from 'sveltekit-superforms';
|
|
4
|
-
|
|
5
|
+
|
|
5
6
|
import { cn } from '$utils/utils.js';
|
|
6
7
|
|
|
7
8
|
let {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as FormPrimitive from 'formsnap';
|
|
3
|
+
import type { WithoutChild } from 'svelte-toolbelt';
|
|
4
|
+
|
|
3
5
|
import { Label } from '$shadcn/label/index.js';
|
|
4
6
|
import { cn } from '$utils/utils.js';
|
|
5
|
-
import type { WithoutChild } from 'svelte-toolbelt';
|
|
6
7
|
|
|
7
8
|
let {
|
|
8
9
|
ref = $bindable(null),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import * as FormPrimitive from 'formsnap';
|
|
3
2
|
import type { WithoutChild } from 'bits-ui';
|
|
3
|
+
import * as FormPrimitive from 'formsnap';
|
|
4
|
+
|
|
4
5
|
import { cn } from '$shadcn/utils.js';
|
|
5
6
|
|
|
6
7
|
let { ref = $bindable(null), class: className, ...restProps }: WithoutChild<FormPrimitive.LegendProps> = $props();
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { cn } from '$shadcn/utils.js';
|
|
3
2
|
import { mergeProps, type WithChild, type WithoutChildren } from 'svelte-toolbelt';
|
|
3
|
+
|
|
4
|
+
import { cn } from '$shadcn/utils.js';
|
|
4
5
|
import { flyAndScale, type HTMLDivAttributes } from '$utils/index.js';
|
|
6
|
+
|
|
5
7
|
import { getFormContext } from './form.svelte';
|
|
6
8
|
|
|
7
9
|
let {
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<script lang="ts">
|
|
17
|
-
import { cn } from '$utils/utils.js';
|
|
18
17
|
import type { WithElementRef } from 'bits-ui';
|
|
19
18
|
import { getContext, setContext } from 'svelte';
|
|
20
19
|
import type { HTMLFormAttributes } from 'svelte/elements';
|
|
21
20
|
import type { SuperForm } from 'sveltekit-superforms';
|
|
22
21
|
|
|
22
|
+
import { cn } from '$utils/utils.js';
|
|
23
|
+
|
|
23
24
|
let { class: className, ref = $bindable(null), children, form, ...restProps }: FormRootProps = $props();
|
|
24
25
|
|
|
25
26
|
// svelte-ignore state_referenced_locally
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<!-- src/lib/components/pages/GALLERY.svelte -->
|
|
2
2
|
<script lang="ts" generics="Item">
|
|
3
|
+
import type { WithElementRef } from 'bits-ui';
|
|
3
4
|
import { onMount, type Snippet } from 'svelte';
|
|
5
|
+
|
|
4
6
|
import { containerSize, cn, type HTMLDivAttributes } from '$utils/index.js';
|
|
7
|
+
|
|
5
8
|
import type { Size } from './utils.js';
|
|
6
9
|
import { packGrid, styleForSize } from './utils.js';
|
|
7
|
-
import type { WithElementRef } from 'bits-ui';
|
|
8
10
|
|
|
9
11
|
let {
|
|
10
12
|
images = $bindable(),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type { BitsPrimitiveDivAttributes } from 'bits-ui';
|
|
3
|
+
|
|
2
4
|
import { WebGlShader } from '$components/shader/index.js';
|
|
3
|
-
import type { Vec2, Vec4 } from '$utils/glsl.js';
|
|
4
5
|
// import fragment from './gradient.frag';
|
|
5
6
|
import { cn } from '$utils';
|
|
6
|
-
import type {
|
|
7
|
+
import type { Vec2, Vec4 } from '$utils/glsl.js';
|
|
7
8
|
|
|
8
9
|
let {
|
|
9
10
|
class: className,
|