@svadmin/ui 0.111.0 → 0.112.0
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/app.css +9 -0
- package/dist/app.theme.css +9 -0
- package/dist/components/AboutSettings.svelte +1 -1
- package/dist/components/AutoForm.svelte +24 -35
- package/dist/components/Icon.svelte +57 -0
- package/dist/components/Icon.svelte.d.ts +10 -0
- package/dist/components/JsonSchemaForm.svelte +68 -10
- package/dist/components/auto-form-layout.d.ts +28 -0
- package/dist/components/auto-form-layout.js +70 -0
- package/dist/components/json-schema-form-state.d.ts +3 -1
- package/dist/icon-registry.d.ts +27 -0
- package/dist/icon-registry.js +52 -0
- package/dist/icons.d.ts +5 -1
- package/dist/icons.js +4 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -1
- package/dist/intent-preload.d.ts +28 -0
- package/dist/intent-preload.js +76 -0
- package/package.json +4 -4
package/dist/app.css
CHANGED
|
@@ -6677,6 +6677,9 @@
|
|
|
6677
6677
|
.gap-3 {
|
|
6678
6678
|
gap: calc(var(--spacing) * 3);
|
|
6679
6679
|
}
|
|
6680
|
+
.gap-3\.5 {
|
|
6681
|
+
gap: calc(var(--spacing) * 3.5);
|
|
6682
|
+
}
|
|
6680
6683
|
.gap-4 {
|
|
6681
6684
|
gap: calc(var(--spacing) * 4);
|
|
6682
6685
|
}
|
|
@@ -9095,6 +9098,12 @@
|
|
|
9095
9098
|
.lg\:col-span-2 {
|
|
9096
9099
|
grid-column: span 2 / span 2;
|
|
9097
9100
|
}
|
|
9101
|
+
.lg\:col-span-3 {
|
|
9102
|
+
grid-column: span 3 / span 3;
|
|
9103
|
+
}
|
|
9104
|
+
.lg\:col-span-4 {
|
|
9105
|
+
grid-column: span 4 / span 4;
|
|
9106
|
+
}
|
|
9098
9107
|
.lg\:flex {
|
|
9099
9108
|
display: flex;
|
|
9100
9109
|
}
|
package/dist/app.theme.css
CHANGED
|
@@ -6677,6 +6677,9 @@
|
|
|
6677
6677
|
.gap-3 {
|
|
6678
6678
|
gap: calc(var(--spacing) * 3);
|
|
6679
6679
|
}
|
|
6680
|
+
.gap-3\.5 {
|
|
6681
|
+
gap: calc(var(--spacing) * 3.5);
|
|
6682
|
+
}
|
|
6680
6683
|
.gap-4 {
|
|
6681
6684
|
gap: calc(var(--spacing) * 4);
|
|
6682
6685
|
}
|
|
@@ -9095,6 +9098,12 @@
|
|
|
9095
9098
|
.lg\:col-span-2 {
|
|
9096
9099
|
grid-column: span 2 / span 2;
|
|
9097
9100
|
}
|
|
9101
|
+
.lg\:col-span-3 {
|
|
9102
|
+
grid-column: span 3 / span 3;
|
|
9103
|
+
}
|
|
9104
|
+
.lg\:col-span-4 {
|
|
9105
|
+
grid-column: span 4 / span 4;
|
|
9106
|
+
}
|
|
9098
9107
|
.lg\:flex {
|
|
9099
9108
|
display: flex;
|
|
9100
9109
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
const resources = $derived(adminContext.resources.filter((resource) => resource.meta?.['aboutVisible'] !== false));
|
|
12
12
|
const providerNames = $derived(adminContext.getDataProviderNames());
|
|
13
13
|
let { version: suppliedVersion, headingLevel = 'h1' }: { version?: string; headingLevel?: 'h1' | 'h2' } = $props();
|
|
14
|
-
const buildVersion = "0.
|
|
14
|
+
const buildVersion = "0.112.0";
|
|
15
15
|
const version = $derived(suppliedVersion ?? (
|
|
16
16
|
buildVersion.startsWith('__')
|
|
17
17
|
? (i18n.locale === 'zh-CN' ? '开发构建(未提供版本)' : 'Development build (version unavailable)')
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { definedOptions } from '@svadmin/core/options';
|
|
6
6
|
|
|
7
7
|
import { captureAdminContext, captureAuthSession, useResourceContract, getContractFormFields, deriveValidator, useNavigation, useCan, useForm, parseQueryKey } from '@svadmin/core';
|
|
8
|
+
import { resolveDeclaredFieldLayout } from '@svadmin/core/schema-form';
|
|
8
9
|
import { useQueryClient } from '@tanstack/svelte-query';
|
|
9
10
|
import { slide } from 'svelte/transition';
|
|
10
11
|
import { untrack } from 'svelte';
|
|
@@ -17,6 +18,14 @@
|
|
|
17
18
|
import { Badge } from './ui/badge/index.js';
|
|
18
19
|
import { Save, ArrowLeft, Loader2, AlertCircle } from '@lucide/svelte';
|
|
19
20
|
import FieldRenderer from './FieldRenderer.svelte';
|
|
21
|
+
import {
|
|
22
|
+
buildFormGroups,
|
|
23
|
+
buildSpanByKey,
|
|
24
|
+
gridClassFor,
|
|
25
|
+
isFullWidthField,
|
|
26
|
+
spanClass,
|
|
27
|
+
type FormLayoutGroup,
|
|
28
|
+
} from './auto-form-layout.js';
|
|
20
29
|
import type { UploadCancelHandler, UploadHandler } from './file-upload-types.js';
|
|
21
30
|
import * as Alert from './ui/alert/index.js';
|
|
22
31
|
import { Skeleton } from './ui/skeleton/index.js';
|
|
@@ -132,38 +141,17 @@
|
|
|
132
141
|
return true;
|
|
133
142
|
}));
|
|
134
143
|
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
const order: string[] = [];
|
|
139
|
-
const map = new Map<string, FieldDefinition[]>();
|
|
140
|
-
for (const f of formFields) {
|
|
141
|
-
const g = f.group ?? '';
|
|
142
|
-
if (!map.has(g)) { order.push(g); map.set(g, []); }
|
|
143
|
-
(map.get(g) ?? []).push(f);
|
|
144
|
-
}
|
|
145
|
-
return order.map(g => ({ name: g, fields: map.get(g) ?? [] }));
|
|
146
|
-
})());
|
|
147
|
-
|
|
148
|
-
const gridClass = $derived(
|
|
149
|
-
columns === 4
|
|
150
|
-
? 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4'
|
|
151
|
-
: columns === 3
|
|
152
|
-
? 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4'
|
|
153
|
-
: columns === 2
|
|
154
|
-
? 'grid grid-cols-1 md:grid-cols-2 gap-4'
|
|
155
|
-
: 'space-y-5'
|
|
156
|
-
);
|
|
144
|
+
const declarativeLayout = $derived(resolveDeclaredFieldLayout(formFields));
|
|
145
|
+
const spanByKey = $derived(buildSpanByKey(declarativeLayout));
|
|
146
|
+
const effectiveColumns = $derived(declarativeLayout?.kind === 'flat' ? declarativeLayout.columns : columns);
|
|
157
147
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
);
|
|
166
|
-
}
|
|
148
|
+
const groups = $derived.by((): FormLayoutGroup[] => buildFormGroups({
|
|
149
|
+
layout: declarativeLayout,
|
|
150
|
+
fields: formFields,
|
|
151
|
+
columns,
|
|
152
|
+
}));
|
|
153
|
+
const hasGroups = $derived(groups.length > 0);
|
|
154
|
+
const gridClass = $derived(gridClassFor(effectiveColumns));
|
|
167
155
|
|
|
168
156
|
// ─── Default values from field metadata ───────────────────────────
|
|
169
157
|
function getDefaultForType(field: FieldDefinition): unknown {
|
|
@@ -639,10 +627,11 @@
|
|
|
639
627
|
{#if group.name}
|
|
640
628
|
<Card.Header>
|
|
641
629
|
<Card.Title class="text-lg">{group.name}</Card.Title>
|
|
630
|
+
{#if group.description}<p class="text-[11px] text-muted-foreground">{group.description}</p>{/if}
|
|
642
631
|
</Card.Header>
|
|
643
632
|
{/if}
|
|
644
633
|
<Card.Content class="px-4 sm:px-6 pb-4 sm:pb-6 pt-0">
|
|
645
|
-
<div class={
|
|
634
|
+
<div class={gridClassFor(group.columns)} data-svadmin-form-grid data-columns={group.columns}>
|
|
646
635
|
{#each group.fields as field (field.key)}
|
|
647
636
|
{@const customField = fields?.[field.key]}
|
|
648
637
|
<div
|
|
@@ -650,7 +639,7 @@
|
|
|
650
639
|
data-svadmin-field-key={field.key}
|
|
651
640
|
data-svadmin-field={field.key}
|
|
652
641
|
data-svadmin-field-type={field.type}
|
|
653
|
-
class={cn(columns > 1 && isFullWidthField(field) && 'col-span-full', !!form.errors[field.key] && 'border-destructive')}
|
|
642
|
+
class={cn(group.columns > 1 && isFullWidthField(field) && 'col-span-full', spanClass(spanByKey.get(field.key)), !!form.errors[field.key] && 'border-destructive')}
|
|
654
643
|
>
|
|
655
644
|
{#if customField}
|
|
656
645
|
{@render customField({
|
|
@@ -688,7 +677,7 @@
|
|
|
688
677
|
{:else}
|
|
689
678
|
<Card.Root class="border-border/40 shadow-sm">
|
|
690
679
|
<Card.Content class="px-4 pt-5 pb-4 sm:px-6 sm:pt-6 sm:pb-6">
|
|
691
|
-
<div class={gridClass} data-svadmin-form-grid data-columns={
|
|
680
|
+
<div class={gridClass} data-svadmin-form-grid data-columns={effectiveColumns}>
|
|
692
681
|
{#each formFields as field (field.key)}
|
|
693
682
|
{@const customField = fields?.[field.key]}
|
|
694
683
|
<div
|
|
@@ -696,7 +685,7 @@
|
|
|
696
685
|
data-svadmin-field-key={field.key}
|
|
697
686
|
data-svadmin-field={field.key}
|
|
698
687
|
data-svadmin-field-type={field.type}
|
|
699
|
-
class={cn(
|
|
688
|
+
class={cn(effectiveColumns > 1 && isFullWidthField(field) && 'col-span-full', spanClass(spanByKey.get(field.key)), !!form.errors[field.key] && 'border-destructive')}
|
|
700
689
|
>
|
|
701
690
|
{#if customField}
|
|
702
691
|
{@render customField({
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* `<Icon name>` renders, in order: a registered component, a sprite symbol, or
|
|
4
|
+
* a remote SVG. Sprite output is server-rendered `<svg><use>`, so SSR and CSP
|
|
5
|
+
* behave like any other inline SVG (no runtime style injection).
|
|
6
|
+
*/
|
|
7
|
+
import { resolveIcon, resolveIconSource } from '../icons.js';
|
|
8
|
+
import { cn } from '../utils.js';
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
name: string;
|
|
12
|
+
size?: number | string;
|
|
13
|
+
/** Accessible name; omit for decorative icons. */
|
|
14
|
+
label?: string;
|
|
15
|
+
class?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let { name, size = 16, label, class: className }: Props = $props();
|
|
19
|
+
|
|
20
|
+
const icon = $derived(resolveIcon(name));
|
|
21
|
+
const source = $derived(icon ? undefined : resolveIconSource(name));
|
|
22
|
+
const spriteHref = $derived(source?.type === 'sprite'
|
|
23
|
+
? `${source.url}#${source.symbolPrefix ?? ''}${name}`
|
|
24
|
+
: undefined);
|
|
25
|
+
const remoteUrl = $derived(source?.type === 'remote-svg'
|
|
26
|
+
? source.urlTemplate.replace('{name}', encodeURIComponent(name))
|
|
27
|
+
: undefined);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if icon}
|
|
31
|
+
{@const ResolvedIcon = icon}
|
|
32
|
+
<ResolvedIcon {size} class={className} aria-hidden={label ? undefined : 'true'} aria-label={label} />
|
|
33
|
+
{:else if spriteHref}
|
|
34
|
+
<svg
|
|
35
|
+
class={cn('inline-block shrink-0', className)}
|
|
36
|
+
width={size}
|
|
37
|
+
height={size}
|
|
38
|
+
viewBox="0 0 24 24"
|
|
39
|
+
role={label ? 'img' : undefined}
|
|
40
|
+
aria-label={label}
|
|
41
|
+
aria-hidden={label ? undefined : 'true'}
|
|
42
|
+
focusable="false"
|
|
43
|
+
>
|
|
44
|
+
<use href={spriteHref} />
|
|
45
|
+
</svg>
|
|
46
|
+
{:else if remoteUrl}
|
|
47
|
+
<img
|
|
48
|
+
class={cn('inline-block shrink-0', className)}
|
|
49
|
+
src={remoteUrl}
|
|
50
|
+
width={size}
|
|
51
|
+
height={size}
|
|
52
|
+
alt={label ?? ''}
|
|
53
|
+
aria-hidden={label ? undefined : 'true'}
|
|
54
|
+
loading="lazy"
|
|
55
|
+
decoding="async"
|
|
56
|
+
/>
|
|
57
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
name: string;
|
|
3
|
+
size?: number | string;
|
|
4
|
+
/** Accessible name; omit for decorative icons. */
|
|
5
|
+
label?: string;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Icon: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type Icon = ReturnType<typeof Icon>;
|
|
10
|
+
export default Icon;
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
assertSchemaFormSchema,
|
|
5
5
|
isSchemaFormNodeVisible,
|
|
6
6
|
prepareSchemaFormValue,
|
|
7
|
+
resolveSchemaFormLayout,
|
|
8
|
+
type SchemaFormLayoutGroup,
|
|
9
|
+
type SchemaFormLayoutPlan,
|
|
7
10
|
type SchemaFormSchema,
|
|
8
11
|
} from '@svadmin/core/schema-form';
|
|
9
12
|
import { tick } from 'svelte';
|
|
@@ -175,6 +178,48 @@
|
|
|
175
178
|
return undefined;
|
|
176
179
|
}
|
|
177
180
|
});
|
|
181
|
+
// Layout plans are pure and per-node; cache so re-renders stay cheap.
|
|
182
|
+
const layoutPlans = new WeakMap<SchemaFormSchema, SchemaFormLayoutPlan>();
|
|
183
|
+
function layoutPlan(node: JsonSchema): SchemaFormLayoutPlan | undefined {
|
|
184
|
+
if (!coreSchema) return undefined;
|
|
185
|
+
const key = node as SchemaFormSchema;
|
|
186
|
+
const cached = layoutPlans.get(key);
|
|
187
|
+
if (cached) return cached;
|
|
188
|
+
try {
|
|
189
|
+
const plan = resolveSchemaFormLayout(key);
|
|
190
|
+
layoutPlans.set(key, plan);
|
|
191
|
+
return plan;
|
|
192
|
+
} catch {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const gridClasses: Record<1 | 2 | 3 | 4, string> = {
|
|
197
|
+
1: 'space-y-3.5',
|
|
198
|
+
2: 'grid grid-cols-1 gap-3.5 md:grid-cols-2',
|
|
199
|
+
3: 'grid grid-cols-1 gap-3.5 md:grid-cols-2 lg:grid-cols-3',
|
|
200
|
+
4: 'grid grid-cols-1 gap-3.5 md:grid-cols-2 lg:grid-cols-4',
|
|
201
|
+
};
|
|
202
|
+
const spanClasses: Record<1 | 2 | 3 | 4, string> = {
|
|
203
|
+
1: '',
|
|
204
|
+
2: 'md:col-span-2',
|
|
205
|
+
3: 'md:col-span-2 lg:col-span-3',
|
|
206
|
+
4: 'md:col-span-2 lg:col-span-4',
|
|
207
|
+
};
|
|
208
|
+
function layoutGroups(node: JsonSchema): readonly SchemaFormLayoutGroup[] {
|
|
209
|
+
const plan = layoutPlan(node);
|
|
210
|
+
if (plan) return plan.groups;
|
|
211
|
+
return [{
|
|
212
|
+
key: '',
|
|
213
|
+
columns: 1,
|
|
214
|
+
fields: Object.keys(node.properties ?? {}).map((fieldKey) => ({ key: fieldKey, span: 1 })),
|
|
215
|
+
}];
|
|
216
|
+
}
|
|
217
|
+
function columnsClass(columns: number): string {
|
|
218
|
+
return gridClasses[(columns as 1 | 2 | 3 | 4)] ?? gridClasses[1];
|
|
219
|
+
}
|
|
220
|
+
function spanClass(span: number): string {
|
|
221
|
+
return spanClasses[(span as 1 | 2 | 3 | 4)] ?? '';
|
|
222
|
+
}
|
|
178
223
|
const locked = $derived(disabled || readonly || isSubmitting || !prepared.ok);
|
|
179
224
|
let reportedConfiguration = '';
|
|
180
225
|
let reportedSchema: JsonSchema | undefined;
|
|
@@ -520,11 +565,7 @@
|
|
|
520
565
|
<legend class="block font-medium">{title}</legend>
|
|
521
566
|
{#if error}<p id={errorId}>{i18n.t('validation.invalidFormat')}</p>{/if}
|
|
522
567
|
{#if node.description}<p id={descriptionId} class="text-[11px] text-muted-foreground">{node.description}</p>{/if}
|
|
523
|
-
|
|
524
|
-
{#each Object.entries(node.properties ?? {}) as [key, child] (key)}
|
|
525
|
-
{@render renderField(child, compiled?.kind === 'object' ? compiled.properties[key] : undefined, [...path, key], child.title ?? key, node.required?.includes(key) ?? false)}
|
|
526
|
-
{/each}
|
|
527
|
-
</div>
|
|
568
|
+
{@render renderObjectGroups(node, compiled, path)}
|
|
528
569
|
</fieldset>
|
|
529
570
|
{:else if type === 'array'}
|
|
530
571
|
{@const items = Array.isArray(current) ? current : []}
|
|
@@ -569,16 +610,33 @@
|
|
|
569
610
|
{/if}
|
|
570
611
|
{/snippet}
|
|
571
612
|
|
|
613
|
+
{#snippet renderObjectGroups(node: JsonSchema, compiled: RecursiveSchemaFormNode | undefined, path: string[])}
|
|
614
|
+
{#each layoutGroups(node) as group (group.key)}
|
|
615
|
+
<div class="space-y-2">
|
|
616
|
+
{#if group.title}
|
|
617
|
+
<h3 class="text-xs font-semibold uppercase tracking-wide text-muted-foreground">{group.title}</h3>
|
|
618
|
+
{#if group.description}<p class="text-[11px] text-muted-foreground">{group.description}</p>{/if}
|
|
619
|
+
{/if}
|
|
620
|
+
<div class={columnsClass(group.columns)} data-svadmin-form-group={group.key}>
|
|
621
|
+
{#each group.fields as field (field.key)}
|
|
622
|
+
{@const child = node.properties?.[field.key]}
|
|
623
|
+
{#if child}
|
|
624
|
+
<div class={spanClass(field.span)}>
|
|
625
|
+
{@render renderField(child, compiled?.kind === 'object' ? compiled.properties[field.key] : undefined, [...path, field.key], child.title ?? field.key, node.required?.includes(field.key) ?? false)}
|
|
626
|
+
</div>
|
|
627
|
+
{/if}
|
|
628
|
+
{/each}
|
|
629
|
+
</div>
|
|
630
|
+
</div>
|
|
631
|
+
{/each}
|
|
632
|
+
{/snippet}
|
|
633
|
+
|
|
572
634
|
<fieldset class="schema-form-fields space-y-4" disabled={locked}>
|
|
573
635
|
{#if prepared.ok}
|
|
574
636
|
{#if model.node?.kind === 'oneOf'}
|
|
575
637
|
{@render renderField(resolvedSchema as JsonSchema, model.node, [], resolvedSchema?.title ?? '', false)}
|
|
576
638
|
{:else}
|
|
577
|
-
|
|
578
|
-
{#each Object.entries(resolvedSchema?.properties ?? {}) as [key, node] (key)}
|
|
579
|
-
{@render renderField(node, model.node?.kind === 'object' ? model.node.properties[key] : undefined, [key], node.title ?? key, resolvedSchema?.required?.includes(key) ?? false)}
|
|
580
|
-
{/each}
|
|
581
|
-
</div>
|
|
639
|
+
{@render renderObjectGroups(resolvedSchema as JsonSchema, model.node?.kind === 'object' ? model.node : undefined, [])}
|
|
582
640
|
{/if}
|
|
583
641
|
{/if}
|
|
584
642
|
<div class="pt-4 border-t border-border/60 flex justify-end">
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout helpers for `AutoForm`.
|
|
3
|
+
*
|
|
4
|
+
* Kept out of the component so the form stays under the module-size budget and
|
|
5
|
+
* the grid/span mapping can be tested without rendering.
|
|
6
|
+
*/
|
|
7
|
+
import type { FieldDefinition } from '@svadmin/core';
|
|
8
|
+
import type { SchemaFormLayoutPlan } from '@svadmin/core/schema-form';
|
|
9
|
+
export declare function gridClassFor(count: number): string;
|
|
10
|
+
export declare function spanClass(span: number | undefined): string;
|
|
11
|
+
export interface FormLayoutGroup {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string | undefined;
|
|
14
|
+
columns: number;
|
|
15
|
+
fields: FieldDefinition[];
|
|
16
|
+
}
|
|
17
|
+
/** Map declarative layout spans into a lookup the field renderer can use. */
|
|
18
|
+
export declare function buildSpanByKey(layout: SchemaFormLayoutPlan | undefined): Map<string, number>;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve render groups: declarative sections/steps win, then `field.group`,
|
|
21
|
+
* then a single ungrouped list.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildFormGroups(input: {
|
|
24
|
+
layout: SchemaFormLayoutPlan | undefined;
|
|
25
|
+
fields: readonly FieldDefinition[];
|
|
26
|
+
columns: number;
|
|
27
|
+
}): FormLayoutGroup[];
|
|
28
|
+
export declare function isFullWidthField(field: Pick<FieldDefinition, 'type'>): boolean;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export function gridClassFor(count) {
|
|
2
|
+
if (count === 4)
|
|
3
|
+
return 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4';
|
|
4
|
+
if (count === 3)
|
|
5
|
+
return 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4';
|
|
6
|
+
if (count === 2)
|
|
7
|
+
return 'grid grid-cols-1 md:grid-cols-2 gap-4';
|
|
8
|
+
return 'space-y-5';
|
|
9
|
+
}
|
|
10
|
+
export function spanClass(span) {
|
|
11
|
+
if (span === 2)
|
|
12
|
+
return 'md:col-span-2';
|
|
13
|
+
if (span === 3)
|
|
14
|
+
return 'md:col-span-2 lg:col-span-3';
|
|
15
|
+
if (span !== undefined && span >= 4)
|
|
16
|
+
return 'md:col-span-2 lg:col-span-4';
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
/** Map declarative layout spans into a lookup the field renderer can use. */
|
|
20
|
+
export function buildSpanByKey(layout) {
|
|
21
|
+
const spans = new Map();
|
|
22
|
+
for (const group of layout?.groups ?? []) {
|
|
23
|
+
for (const field of group.fields)
|
|
24
|
+
spans.set(field.key, field.span);
|
|
25
|
+
}
|
|
26
|
+
return spans;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Resolve render groups: declarative sections/steps win, then `field.group`,
|
|
30
|
+
* then a single ungrouped list.
|
|
31
|
+
*/
|
|
32
|
+
export function buildFormGroups(input) {
|
|
33
|
+
const { layout, fields, columns } = input;
|
|
34
|
+
if (layout && (layout.kind === 'sections' || layout.kind === 'steps')) {
|
|
35
|
+
return layout.groups.map((group) => ({
|
|
36
|
+
name: group.step !== undefined ? `${group.step}. ${group.title ?? ''}`.trim() : (group.title ?? ''),
|
|
37
|
+
description: group.description,
|
|
38
|
+
columns: group.columns,
|
|
39
|
+
fields: group.fields.flatMap((item) => {
|
|
40
|
+
const field = fields.find((candidate) => candidate.key === item.key);
|
|
41
|
+
return field ? [field] : [];
|
|
42
|
+
}),
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
if (!fields.some((field) => field.group))
|
|
46
|
+
return [];
|
|
47
|
+
const order = [];
|
|
48
|
+
const map = new Map();
|
|
49
|
+
for (const field of fields) {
|
|
50
|
+
const name = field.group ?? '';
|
|
51
|
+
if (!map.has(name)) {
|
|
52
|
+
order.push(name);
|
|
53
|
+
map.set(name, []);
|
|
54
|
+
}
|
|
55
|
+
(map.get(name) ?? []).push(field);
|
|
56
|
+
}
|
|
57
|
+
return order.map((name) => ({
|
|
58
|
+
name,
|
|
59
|
+
description: undefined,
|
|
60
|
+
columns,
|
|
61
|
+
fields: map.get(name) ?? [],
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
export function isFullWidthField(field) {
|
|
65
|
+
return (field.type === 'textarea' ||
|
|
66
|
+
field.type === 'richtext' ||
|
|
67
|
+
field.type === 'json' ||
|
|
68
|
+
field.type === 'array' ||
|
|
69
|
+
field.type === 'images');
|
|
70
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SchemaFormComputed, SchemaFormCondition } from '@svadmin/core/schema-form';
|
|
1
|
+
import type { SchemaFormComputed, SchemaFormCondition, SchemaFormLayout } from '@svadmin/core/schema-form';
|
|
2
2
|
/** 嵌套表单的草稿与传输语义;不是替代服务端的 JSON Schema 校验器。 */
|
|
3
3
|
export interface JsonSchemaFormSchema {
|
|
4
4
|
$schema?: string;
|
|
@@ -36,6 +36,8 @@ export interface JsonSchemaFormSchema {
|
|
|
36
36
|
required?: string[];
|
|
37
37
|
visibleWhen?: SchemaFormCondition;
|
|
38
38
|
computed?: SchemaFormComputed;
|
|
39
|
+
/** 呈现分组。不参与草稿、传输或校验。 */
|
|
40
|
+
layout?: SchemaFormLayout;
|
|
39
41
|
}
|
|
40
42
|
export declare const SCHEMA_FORM_LIMITS: Readonly<{
|
|
41
43
|
depth: 32;
|
package/dist/icon-registry.d.ts
CHANGED
|
@@ -12,6 +12,26 @@
|
|
|
12
12
|
import type { Component } from 'svelte';
|
|
13
13
|
/** Minimal icon component contract used by navigation surfaces. */
|
|
14
14
|
export type IconComponent = Component<Record<string, unknown>>;
|
|
15
|
+
/**
|
|
16
|
+
* Non-component icon sources. Design systems that ship a sprite sheet or a CDN
|
|
17
|
+
* set can register names without generating one component per icon.
|
|
18
|
+
*/
|
|
19
|
+
export type IconSource = {
|
|
20
|
+
type: 'sprite';
|
|
21
|
+
url: string;
|
|
22
|
+
symbolPrefix?: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'remote-svg';
|
|
25
|
+
urlTemplate: string;
|
|
26
|
+
};
|
|
27
|
+
/** Public registration shape. `url` is a sprite URL or a `{name}` template. */
|
|
28
|
+
export interface IconSourceInput {
|
|
29
|
+
type: 'sprite' | 'remote-svg';
|
|
30
|
+
url: string;
|
|
31
|
+
symbolPrefix?: string;
|
|
32
|
+
/** Omit to use this source for every name that has no component. */
|
|
33
|
+
names?: readonly string[];
|
|
34
|
+
}
|
|
15
35
|
/** Handler invoked once per missing icon name. Keep it cheap: no throwing. */
|
|
16
36
|
export type IconMissHandler = (name: string) => void;
|
|
17
37
|
export interface IconRegistry {
|
|
@@ -21,6 +41,13 @@ export interface IconRegistry {
|
|
|
21
41
|
}): void;
|
|
22
42
|
/** Replace the built-in vocabulary as well as registrations (design-system swap). */
|
|
23
43
|
replaceIcons(icons: Readonly<Record<string, IconComponent>>): void;
|
|
44
|
+
/** Register sprite/remote sources for names that have no component. */
|
|
45
|
+
registerIconSources(sources: Readonly<Record<string, IconSource>>): void;
|
|
46
|
+
/** Register one sprite sheet or remote template, optionally limited to `names`. */
|
|
47
|
+
registerIconSource(source: IconSourceInput): void;
|
|
48
|
+
/** Last registered source wins; components always take precedence at render time. */
|
|
49
|
+
resolveIconSource(name: string | undefined): IconSource | undefined;
|
|
50
|
+
getIconSourceNames(): string[];
|
|
24
51
|
/** Resolve a name, optionally falling back to a caller-provided component. */
|
|
25
52
|
resolveIcon(name: string | undefined, fallback?: IconComponent): IconComponent | undefined;
|
|
26
53
|
hasIcon(name: string): boolean;
|
package/dist/icon-registry.js
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
|
+
function isIconSource(value) {
|
|
2
|
+
if (typeof value !== 'object' || value === null)
|
|
3
|
+
return false;
|
|
4
|
+
const type = Reflect.get(value, 'type');
|
|
5
|
+
if (type === 'sprite') {
|
|
6
|
+
const url = Reflect.get(value, 'url');
|
|
7
|
+
const prefix = Reflect.get(value, 'symbolPrefix');
|
|
8
|
+
return typeof url === 'string' && url.length > 0 && (prefix === undefined || typeof prefix === 'string');
|
|
9
|
+
}
|
|
10
|
+
if (type === 'remote-svg') {
|
|
11
|
+
const template = Reflect.get(value, 'urlTemplate');
|
|
12
|
+
return typeof template === 'string' && template.includes('{name}');
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
1
16
|
export function createIconRegistry(builtinIcons = {}) {
|
|
2
17
|
const original = new Map(Object.entries(builtinIcons));
|
|
3
18
|
let builtin = new Map(original);
|
|
4
19
|
const registered = new Map();
|
|
20
|
+
const sources = new Map();
|
|
21
|
+
let defaultSource;
|
|
5
22
|
const missing = new Set();
|
|
6
23
|
let fallback;
|
|
7
24
|
let onMiss;
|
|
@@ -40,6 +57,39 @@ export function createIconRegistry(builtinIcons = {}) {
|
|
|
40
57
|
builtin = new Map(Object.entries(icons).filter(([name, icon]) => name.trim() !== '' && typeof icon === 'function'));
|
|
41
58
|
registered.clear();
|
|
42
59
|
},
|
|
60
|
+
registerIconSources(next) {
|
|
61
|
+
for (const [name, source] of Object.entries(next)) {
|
|
62
|
+
if (name.trim() === '' || !isIconSource(source))
|
|
63
|
+
continue;
|
|
64
|
+
sources.set(name, source);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
registerIconSource(source) {
|
|
68
|
+
const normalized = source.type === 'sprite'
|
|
69
|
+
? (source.url.length > 0 ? {
|
|
70
|
+
type: 'sprite',
|
|
71
|
+
url: source.url,
|
|
72
|
+
...(source.symbolPrefix !== undefined ? { symbolPrefix: source.symbolPrefix } : {}),
|
|
73
|
+
} : undefined)
|
|
74
|
+
: (source.url.includes('{name}') ? { type: 'remote-svg', urlTemplate: source.url } : undefined);
|
|
75
|
+
if (normalized === undefined || !isIconSource(normalized))
|
|
76
|
+
return;
|
|
77
|
+
const names = source.names?.filter((name) => name.trim() !== '') ?? [];
|
|
78
|
+
if (names.length === 0) {
|
|
79
|
+
defaultSource = normalized;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
for (const name of names)
|
|
83
|
+
sources.set(name, normalized);
|
|
84
|
+
},
|
|
85
|
+
resolveIconSource(name) {
|
|
86
|
+
if (name === undefined || name === '')
|
|
87
|
+
return undefined;
|
|
88
|
+
return sources.get(name) ?? defaultSource;
|
|
89
|
+
},
|
|
90
|
+
getIconSourceNames() {
|
|
91
|
+
return [...sources.keys()];
|
|
92
|
+
},
|
|
43
93
|
resolveIcon(name, fallbackIcon) {
|
|
44
94
|
if (name === undefined || name === '')
|
|
45
95
|
return fallbackIcon ?? fallback;
|
|
@@ -66,6 +116,8 @@ export function createIconRegistry(builtinIcons = {}) {
|
|
|
66
116
|
resetIconRegistry() {
|
|
67
117
|
builtin = new Map(original);
|
|
68
118
|
registered.clear();
|
|
119
|
+
sources.clear();
|
|
120
|
+
defaultSource = undefined;
|
|
69
121
|
fallback = undefined;
|
|
70
122
|
onMiss = undefined;
|
|
71
123
|
missing.clear();
|
package/dist/icons.d.ts
CHANGED
|
@@ -8,7 +8,11 @@ export declare const registerIcons: (icons: Readonly<Record<string, IconComponen
|
|
|
8
8
|
export declare const resolveIcon: (name: string | undefined, fallback?: IconComponent) => IconComponent | undefined;
|
|
9
9
|
export declare const hasIcon: (name: string) => boolean;
|
|
10
10
|
export declare const getIconNames: () => string[];
|
|
11
|
+
export declare const registerIconSources: (sources: Readonly<Record<string, import("./icon-registry.js").IconSource>>) => void;
|
|
12
|
+
export declare const registerIconSource: (source: import("./icon-registry.js").IconSourceInput) => void;
|
|
13
|
+
export declare const resolveIconSource: (name: string | undefined) => import("./icon-registry.js").IconSource | undefined;
|
|
14
|
+
export declare const getIconSourceNames: () => string[];
|
|
11
15
|
export declare const setIconFallback: (icon: IconComponent | undefined) => void;
|
|
12
16
|
export declare const setIconMissHandler: (handler: import("./icon-registry.js").IconMissHandler | undefined) => void;
|
|
13
17
|
export declare const resetIconRegistry: () => void;
|
|
14
|
-
export type { IconComponent, IconMissHandler, IconRegistry } from './icon-registry.js';
|
|
18
|
+
export type { IconComponent, IconMissHandler, IconRegistry, IconSource, IconSourceInput } from './icon-registry.js';
|
package/dist/icons.js
CHANGED
|
@@ -58,6 +58,10 @@ export const registerIcons = registry.registerIcons;
|
|
|
58
58
|
export const resolveIcon = registry.resolveIcon;
|
|
59
59
|
export const hasIcon = registry.hasIcon;
|
|
60
60
|
export const getIconNames = registry.getIconNames;
|
|
61
|
+
export const registerIconSources = registry.registerIconSources;
|
|
62
|
+
export const registerIconSource = registry.registerIconSource;
|
|
63
|
+
export const resolveIconSource = registry.resolveIconSource;
|
|
64
|
+
export const getIconSourceNames = registry.getIconSourceNames;
|
|
61
65
|
export const setIconFallback = registry.setIconFallback;
|
|
62
66
|
export const setIconMissHandler = registry.setIconMissHandler;
|
|
63
67
|
export const resetIconRegistry = registry.resetIconRegistry;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export { surfaceDesignContract } from "./design-contract.js";
|
|
|
2
2
|
export type { AdminPageFamily, AdminPageState, SurfaceDensity, SurfaceTone } from "./design-contract.js";
|
|
3
3
|
export { designSystemComponents, type DesignComponentContract, type DesignComponentId, type DesignComponentState, } from "./design-system-components.js";
|
|
4
4
|
export { metricSurfaceClasses, tableSurfaceClasses } from "./design-system.js";
|
|
5
|
-
export { builtinIcons, getIconNames, hasIcon, registerIcons, replaceIcons, resetIconRegistry, resolveIcon, setIconFallback, setIconMissHandler, } from "./icons.js";
|
|
6
|
-
export type { IconComponent, IconMissHandler, IconRegistry } from "./icons.js";
|
|
5
|
+
export { builtinIcons, getIconNames, hasIcon, getIconSourceNames, registerIconSource, registerIconSources, registerIcons, replaceIcons, resetIconRegistry, resolveIcon, resolveIconSource, setIconFallback, setIconMissHandler, } from "./icons.js";
|
|
6
|
+
export type { IconComponent, IconMissHandler, IconRegistry, IconSource, IconSourceInput } from "./icons.js";
|
|
7
7
|
export { default as AdminApp } from './components/AdminApp.svelte';
|
|
8
8
|
export type { AdminPageRoute } from './components/AdminApp.svelte';
|
|
9
9
|
export { default as AutoTable } from './components/AutoTable.svelte';
|
|
@@ -35,6 +35,7 @@ export type { ListStateSnapshot } from './components/list-state.svelte.js';
|
|
|
35
35
|
export { default as AutoForm } from './components/AutoForm.svelte';
|
|
36
36
|
export { default as ShowPage } from './components/ShowPage.svelte';
|
|
37
37
|
export { default as ConfirmDialog } from './components/ConfirmDialog.svelte';
|
|
38
|
+
export { default as Icon } from './components/Icon.svelte';
|
|
38
39
|
export { default as Sidebar } from './components/Sidebar.svelte';
|
|
39
40
|
export { default as Layout } from './components/Layout.svelte';
|
|
40
41
|
export type { LayoutAIAssistantProps } from './components/Layout.svelte';
|
|
@@ -329,6 +330,8 @@ export { setComponentRegistry, getComponentRegistry, useComponent, type Componen
|
|
|
329
330
|
export { builtinDisplayComponents, registerDisplayComponent, getDisplayComponent, hasDisplayComponent, } from './components/fieldComponentMap';
|
|
330
331
|
export type { FieldComponentMap, FieldDisplayProps } from './components/fieldComponentMap';
|
|
331
332
|
export { clickOutside, shortcut, intersect, copyOnClick } from './actions';
|
|
333
|
+
export { intentPreload, preloadModule, resetIntentPreloads, INTENT_PRELOAD_BUDGET } from './intent-preload';
|
|
334
|
+
export type { IntentPreloadParams } from './intent-preload';
|
|
332
335
|
export { default as ProfileCard } from './components/profile/ProfileCard.svelte';
|
|
333
336
|
export { default as ProjectsGrid } from './components/profile/ProjectsGrid.svelte';
|
|
334
337
|
export { default as ActivityTimeline } from './components/profile/ActivityTimeline.svelte';
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export { surfaceDesignContract } from "./design-contract.js";
|
|
3
3
|
export { designSystemComponents, } from "./design-system-components.js";
|
|
4
4
|
export { metricSurfaceClasses, tableSurfaceClasses } from "./design-system.js";
|
|
5
|
-
export { builtinIcons, getIconNames, hasIcon, registerIcons, replaceIcons, resetIconRegistry, resolveIcon, setIconFallback, setIconMissHandler, } from "./icons.js";
|
|
5
|
+
export { builtinIcons, getIconNames, hasIcon, getIconSourceNames, registerIconSource, registerIconSources, registerIcons, replaceIcons, resetIconRegistry, resolveIcon, resolveIconSource, setIconFallback, setIconMissHandler, } from "./icons.js";
|
|
6
6
|
// Entry component
|
|
7
7
|
export { default as AdminApp } from './components/AdminApp.svelte';
|
|
8
8
|
// Admin components
|
|
@@ -27,6 +27,7 @@ export { cloneListFilter, cloneListStateSnapshot } from './components/list-state
|
|
|
27
27
|
export { default as AutoForm } from './components/AutoForm.svelte';
|
|
28
28
|
export { default as ShowPage } from './components/ShowPage.svelte';
|
|
29
29
|
export { default as ConfirmDialog } from './components/ConfirmDialog.svelte';
|
|
30
|
+
export { default as Icon } from './components/Icon.svelte';
|
|
30
31
|
export { default as Sidebar } from './components/Sidebar.svelte';
|
|
31
32
|
export { default as Layout } from './components/Layout.svelte';
|
|
32
33
|
export { default as Header } from './components/Header.svelte';
|
|
@@ -271,6 +272,7 @@ export { setComponentRegistry, getComponentRegistry, useComponent, } from './com
|
|
|
271
272
|
export { builtinDisplayComponents, registerDisplayComponent, getDisplayComponent, hasDisplayComponent, } from './components/fieldComponentMap';
|
|
272
273
|
// Svelte Actions
|
|
273
274
|
export { clickOutside, shortcut, intersect, copyOnClick } from './actions';
|
|
275
|
+
export { intentPreload, preloadModule, resetIntentPreloads, INTENT_PRELOAD_BUDGET } from './intent-preload';
|
|
274
276
|
// Public Profile
|
|
275
277
|
export { default as ProfileCard } from './components/profile/ProfileCard.svelte';
|
|
276
278
|
export { default as ProjectsGrid } from './components/profile/ProjectsGrid.svelte';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent preload: start a dynamic import on hover, focus, or viewport entry.
|
|
3
|
+
*
|
|
4
|
+
* This is the part of Arco's component lazy-load plugin worth keeping. It does
|
|
5
|
+
* not rewrite imports. SSR never calls the loader; the host renders its fallback
|
|
6
|
+
* until the client preloads.
|
|
7
|
+
*/
|
|
8
|
+
export declare const INTENT_PRELOAD_BUDGET: Readonly<{
|
|
9
|
+
maxInflight: 2;
|
|
10
|
+
/** Source budget for this module. Enforced by intent-preload.test.ts. */
|
|
11
|
+
maxModuleBytes: 4000;
|
|
12
|
+
}>;
|
|
13
|
+
export interface IntentPreloadParams {
|
|
14
|
+
key: string;
|
|
15
|
+
load: () => Promise<unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare function resetIntentPreloads(): void;
|
|
18
|
+
/** Returns the in-flight promise, or undefined when SSR or the budget is full. */
|
|
19
|
+
export declare function preloadModule(key: string, loader: () => Promise<unknown>, options?: {
|
|
20
|
+
ssr?: boolean;
|
|
21
|
+
}): Promise<unknown> | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Svelte action. On the server it is a no-op so the fallback markup stays put.
|
|
24
|
+
*/
|
|
25
|
+
export declare function intentPreload(node: HTMLElement, params: IntentPreloadParams): {
|
|
26
|
+
destroy: () => void;
|
|
27
|
+
update: (next: IntentPreloadParams) => void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent preload: start a dynamic import on hover, focus, or viewport entry.
|
|
3
|
+
*
|
|
4
|
+
* This is the part of Arco's component lazy-load plugin worth keeping. It does
|
|
5
|
+
* not rewrite imports. SSR never calls the loader; the host renders its fallback
|
|
6
|
+
* until the client preloads.
|
|
7
|
+
*/
|
|
8
|
+
export const INTENT_PRELOAD_BUDGET = Object.freeze({
|
|
9
|
+
maxInflight: 2,
|
|
10
|
+
/** Source budget for this module. Enforced by intent-preload.test.ts. */
|
|
11
|
+
maxModuleBytes: 4_000,
|
|
12
|
+
});
|
|
13
|
+
const inflight = new Map();
|
|
14
|
+
export function resetIntentPreloads() {
|
|
15
|
+
inflight.clear();
|
|
16
|
+
}
|
|
17
|
+
function onServer(ssr) {
|
|
18
|
+
return ssr ?? typeof window === 'undefined';
|
|
19
|
+
}
|
|
20
|
+
/** Returns the in-flight promise, or undefined when SSR or the budget is full. */
|
|
21
|
+
export function preloadModule(key, loader, options = {}) {
|
|
22
|
+
if (key.trim() === '' || onServer(options.ssr))
|
|
23
|
+
return undefined;
|
|
24
|
+
const existing = inflight.get(key);
|
|
25
|
+
if (existing)
|
|
26
|
+
return existing;
|
|
27
|
+
if (inflight.size >= INTENT_PRELOAD_BUDGET.maxInflight)
|
|
28
|
+
return undefined;
|
|
29
|
+
let pending;
|
|
30
|
+
try {
|
|
31
|
+
pending = Promise.resolve(loader());
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
pending = Promise.reject(error);
|
|
35
|
+
}
|
|
36
|
+
const settled = pending.finally(() => {
|
|
37
|
+
if (inflight.get(key) === settled)
|
|
38
|
+
inflight.delete(key);
|
|
39
|
+
});
|
|
40
|
+
inflight.set(key, settled);
|
|
41
|
+
return settled;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Svelte action. On the server it is a no-op so the fallback markup stays put.
|
|
45
|
+
*/
|
|
46
|
+
export function intentPreload(node, params) {
|
|
47
|
+
if (onServer(undefined))
|
|
48
|
+
return { destroy() { }, update() { } };
|
|
49
|
+
let current = params;
|
|
50
|
+
let started = false;
|
|
51
|
+
const start = () => {
|
|
52
|
+
if (started)
|
|
53
|
+
return;
|
|
54
|
+
started = true;
|
|
55
|
+
void preloadModule(current.key, current.load, { ssr: false });
|
|
56
|
+
};
|
|
57
|
+
node.addEventListener('pointerenter', start);
|
|
58
|
+
node.addEventListener('focus', start);
|
|
59
|
+
const observer = typeof IntersectionObserver === 'function'
|
|
60
|
+
? new IntersectionObserver((entries) => {
|
|
61
|
+
if (entries.some((entry) => entry.isIntersecting))
|
|
62
|
+
start();
|
|
63
|
+
})
|
|
64
|
+
: undefined;
|
|
65
|
+
observer?.observe(node);
|
|
66
|
+
return {
|
|
67
|
+
destroy() {
|
|
68
|
+
node.removeEventListener('pointerenter', start);
|
|
69
|
+
node.removeEventListener('focus', start);
|
|
70
|
+
observer?.disconnect();
|
|
71
|
+
},
|
|
72
|
+
update(next) {
|
|
73
|
+
current = next;
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svadmin/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.112.0",
|
|
4
4
|
"description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@codemirror/lang-json": "^6.0.0",
|
|
89
89
|
"@codemirror/lang-markdown": "^6.0.0",
|
|
90
90
|
"@codemirror/lang-sql": "^6.0.0",
|
|
91
|
-
"@svadmin/core": "^0.
|
|
91
|
+
"@svadmin/core": "^0.74.0",
|
|
92
92
|
"@tanstack/svelte-query": "^6.1.48",
|
|
93
93
|
"codemirror": "^6.0.0",
|
|
94
94
|
"dashjs": "^4.7.4",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
"dependencies": {
|
|
154
|
-
"@svadmin/devtools": "^0.6.
|
|
154
|
+
"@svadmin/devtools": "^0.6.3",
|
|
155
155
|
"@svadmin/devtools-contract": "^0.3.1",
|
|
156
156
|
"@vibeunion/devtools-devframe": "^0.1.0",
|
|
157
157
|
"typebox": "^1.3.34",
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"@codemirror/lang-markdown": "^6.5.2",
|
|
190
190
|
"@codemirror/lang-sql": "^6.10.0",
|
|
191
191
|
"@happy-dom/global-registrator": "^20.11.12",
|
|
192
|
-
"@svadmin/ai-elements": "^0.13.
|
|
192
|
+
"@svadmin/ai-elements": "^0.13.10",
|
|
193
193
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
194
194
|
"@tailwindcss/cli": "4.3.3",
|
|
195
195
|
"@testing-library/dom": "^10.4.1",
|