@morlay/dsh-client-ui-primitives 0.0.8 → 0.0.10
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/README.md +17 -18
- package/dist/client-B68ClH7Y.mjs +3730 -0
- package/dist/client-Bbcei33M.cjs +17197 -0
- package/dist/client.cjs +54 -0
- package/dist/client.d.cts +4 -0
- package/dist/client.d.mts +2 -664
- package/dist/client.mjs +2 -3728
- package/dist/index-AMHtcyMt.d.mts +647 -0
- package/dist/index.cjs +54 -0
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +4 -5
- package/dist/reference-hchCWm3z.cjs +482 -0
- package/dist/reference.cjs +4 -0
- package/dist/reference.d.mts +3 -0
- package/dist/reference.mjs +1 -0
- package/package.json +28 -30
- package/src/client/controls/IconButton.tsx +4 -2
- package/src/client/controls/ModelRouteList.module.css +1 -1
- package/src/client/controls/SeatButton.module.css +1 -1
- package/src/client/controls/SeatButton.tsx +1 -2
- package/src/client/controls/classes.ts +1 -3
- package/src/client/controls/index.ts +1 -7
- package/src/client/index.ts +7 -1
- package/src/client/layout/Row.tsx +20 -17
- package/src/client/layout/Stack.tsx +19 -16
- package/src/client/layout/Text.tsx +8 -1
- package/src/client/schema-form/Editor.tsx +26 -9
- package/src/client/schema-form/SchemaForm.tsx +6 -1
- package/src/client/schema-form/index.ts +5 -0
- package/src/client/schema-form/schema-form.module.css +16 -16
- package/src/client/schema-form/testing/fake-scope.ts +0 -1
- package/src/client/schema-form/value.tsx +8 -3
- package/src/client/settings-form/SettingsFieldRow.module.css +1 -1
- package/src/client/settings-form/SettingsFieldRow.tsx +4 -2
- package/src/index.ts +6 -2
- package/src/reference-markdown.tsx +2 -6
- package/dist/rolldown-runtime-EAsCxrDo.mjs +0 -14
- package/locale/en.json +0 -6
- package/locale/zh.json +0 -6
- package/src/client/controls/SearchInput.module.css +0 -11
- package/src/client/controls/SearchInput.tsx +0 -22
- package/src/client/controls/Tabs.module.css +0 -48
- package/src/client/controls/Tabs.tsx +0 -57
- /package/src/{client/markdown-text.ts → markdown-text.ts} +0 -0
package/dist/client.d.mts
CHANGED
|
@@ -1,666 +1,4 @@
|
|
|
1
|
+
import { $ as Bubble, A as SearchSelect, B as VisuallyHidden, C as SuggestedKeys, D as parseTagList, E as mergeTags, F as ModelRouteCandidate, G as SpinnerProps, H as TimeLabel, I as ModelRouteList, J as DisclosureRow, K as SeatButton, L as ModelRouteListProps, M as SearchSelectProps, N as MultilineField, O as TagInput, P as MultilineFieldProps, Q as ButtonTone, R as IconButton, S as FieldNode, T as walkFields, U as TimeLabelProps, V as VisuallyHiddenProps, W as Spinner, X as Button, Y as DisclosureRowProps, Z as ButtonProps, _ as SelectOption, a as ReferenceMarkdownProps, at as Stack, b as failureOf, c as index_d_exports, ct as RowProps, d as SchemaFormActions, dt as LayoutJustify, et as BubbleProps, f as SchemaFormController, ft as LayoutPad, g as SchemaFormHints, gt as markdownLabels, h as projectRoot, ht as MarkdownCopySeat, i as ReferenceMarkdown, it as TextProps, j as SearchSelectOption, k as TagInputProps, l as rowRegistrations, lt as LayoutAlign, m as SchemaFormState, mt as TextTone, n as inject, nt as SettingsFieldRowProps, o as referenceMentions, ot as StackProps, p as SchemaFormFace, pt as TextSize, q as SeatButtonProps, r as ReferenceActions, rt as Text, s as NS, st as Row, t as apply, tt as SettingsFieldRow, u as SchemaFormLocaleKey, ut as LayoutGap, v as SelectSpec, w as WalkedField, x as FieldMeta, y as ValidationFailure, z as IconButtonProps } from "./index-AMHtcyMt.mjs";
|
|
1
2
|
import { a as formatReferenceMention, c as parseReferenceToken, i as formatReference, n as ReferenceSpan, o as isLocalReference, r as findReferences, s as parseReference, t as Reference } from "./reference-BX54bj6_.mjs";
|
|
2
|
-
import { SnapshotStore } from "@deepseek-ai/dsh-client-store";
|
|
3
|
-
import { Context, Service } from "@deepseek-ai/cordis";
|
|
4
|
-
import { ButtonHTMLAttributes, ComponentProps, ElementType, HTMLAttributes, ReactNode, TextareaHTMLAttributes } from "react";
|
|
5
|
-
import { Button as Button$1, DisclosureRow as DisclosureRow$1, Input, MarkdownFileMentions, MarkdownLabels, MarkdownLabels as MarkdownLabels$1, MarkdownPathImages, SettingsFormShell } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
6
|
-
import { PropsRuntime, TranslateNS } from "@deepseek-ai/dsh-client-ui-slots";
|
|
7
|
-
import { BundleInfo, SettingsNamespaceView } from "@deepseek-ai/dsh-api-remotes/client";
|
|
8
|
-
import { ConfigForm, SchemaNode, SettingsDescribeFace } from "@deepseek-ai/dsh-client-ui-settings/client";
|
|
9
3
|
export * from "@deepseek-ai/dsh-client-ui-primitives";
|
|
10
|
-
|
|
11
|
-
export type MarkdownCopySeat = (key: "copy" | "copied" | "markdown.footnotes") => string;
|
|
12
|
-
export declare function markdownLabels(t: MarkdownCopySeat): MarkdownLabels;
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/client/layout/scales.d.ts
|
|
15
|
-
type LayoutGap = 0 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | "wide";
|
|
16
|
-
type LayoutAlign = "stretch" | "start" | "center" | "end";
|
|
17
|
-
type LayoutJustify = "start" | "center" | "between" | "end";
|
|
18
|
-
type LayoutPad = "none" | "card" | "body" | "page" | "row" | "blocking";
|
|
19
|
-
type TextSize = "xs" | "sm" | "md" | "base" | "lg";
|
|
20
|
-
type TextTone = "primary" | "secondary" | "tertiary" | "danger";
|
|
21
|
-
type TextWeight = "medium" | "strong";
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/client/layout/Row.d.ts
|
|
24
|
-
interface RowProps extends HTMLAttributes<HTMLDivElement> {
|
|
25
|
-
as?: ElementType;
|
|
26
|
-
gap?: LayoutGap;
|
|
27
|
-
align?: LayoutAlign;
|
|
28
|
-
justify?: LayoutJustify;
|
|
29
|
-
wrap?: boolean;
|
|
30
|
-
grow?: boolean;
|
|
31
|
-
boxed?: boolean;
|
|
32
|
-
fixed?: boolean;
|
|
33
|
-
narrow?: boolean;
|
|
34
|
-
push?: boolean;
|
|
35
|
-
plain?: boolean;
|
|
36
|
-
pad?: LayoutPad;
|
|
37
|
-
}
|
|
38
|
-
export declare const Row: import("react").ForwardRefExoticComponent<RowProps & import("react").RefAttributes<HTMLElement>>;
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/client/layout/Stack.d.ts
|
|
41
|
-
interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
42
|
-
as?: ElementType;
|
|
43
|
-
gap?: LayoutGap;
|
|
44
|
-
align?: LayoutAlign;
|
|
45
|
-
pad?: LayoutPad;
|
|
46
|
-
grow?: boolean;
|
|
47
|
-
boxed?: boolean;
|
|
48
|
-
fixed?: boolean;
|
|
49
|
-
narrow?: boolean;
|
|
50
|
-
fill?: boolean;
|
|
51
|
-
scroll?: boolean;
|
|
52
|
-
plain?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export declare const Stack: import("react").ForwardRefExoticComponent<StackProps & import("react").RefAttributes<HTMLElement>>;
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/client/layout/Text.d.ts
|
|
57
|
-
interface TextProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "color"> {
|
|
58
|
-
as?: ElementType;
|
|
59
|
-
size?: TextSize;
|
|
60
|
-
tone?: TextTone;
|
|
61
|
-
weight?: TextWeight;
|
|
62
|
-
mono?: boolean;
|
|
63
|
-
truncate?: boolean;
|
|
64
|
-
tabular?: boolean;
|
|
65
|
-
children?: ReactNode;
|
|
66
|
-
}
|
|
67
|
-
export declare function Text({ as: Element, size, tone, weight, mono, truncate, tabular, className, children }: TextProps): ReactNode;
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/client/settings-form/SettingsFieldRow.d.ts
|
|
70
|
-
interface SettingsFieldRowProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "color"> {
|
|
71
|
-
label: string;
|
|
72
|
-
hint: string;
|
|
73
|
-
layout?: "stack" | "inline";
|
|
74
|
-
divider?: boolean;
|
|
75
|
-
overriddenLabel?: string;
|
|
76
|
-
resetLabel?: string;
|
|
77
|
-
onReset?: () => void;
|
|
78
|
-
invalid?: string;
|
|
79
|
-
children: ReactNode;
|
|
80
|
-
}
|
|
81
|
-
export declare function SettingsFieldRow({ label, hint, layout, divider, overriddenLabel, resetLabel, onReset, invalid, children, className, ...rest }: SettingsFieldRowProps): ReactNode;
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/client/controls/Bubble.d.ts
|
|
84
|
-
type BubbleProps = HTMLAttributes<HTMLDivElement>;
|
|
85
|
-
export declare function Bubble({ className, children, ...rest }: BubbleProps): ReactNode;
|
|
86
|
-
//#endregion
|
|
87
|
-
//#region src/client/controls/Button.d.ts
|
|
88
|
-
type ButtonTone = "danger";
|
|
89
|
-
type ButtonProps = ComponentProps<typeof Button$1> & {
|
|
90
|
-
tone?: ButtonTone;
|
|
91
|
-
};
|
|
92
|
-
export declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/client/controls/DisclosureRow.d.ts
|
|
95
|
-
type DisclosureRowProps = ComponentProps<typeof DisclosureRow$1>;
|
|
96
|
-
export declare function DisclosureRow(props: DisclosureRowProps): ReactNode;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/client/controls/SearchInput.d.ts
|
|
99
|
-
type SearchInputWidth = "search" | "full";
|
|
100
|
-
type SearchInputProps = ComponentProps<typeof Input> & {
|
|
101
|
-
width?: SearchInputWidth;
|
|
102
|
-
};
|
|
103
|
-
export declare function SearchInput({ width, className, ...rest }: SearchInputProps): ReactNode;
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/client/controls/SeatButton.d.ts
|
|
106
|
-
interface SeatButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
107
|
-
icon: ReactNode;
|
|
108
|
-
label: string;
|
|
109
|
-
expanded?: boolean;
|
|
110
|
-
chevron?: ReactNode;
|
|
111
|
-
}
|
|
112
|
-
export declare function SeatButton({ icon, label, expanded, chevron, type, className, ...rest }: SeatButtonProps): ReactNode;
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/client/controls/Spinner.d.ts
|
|
115
|
-
interface SpinnerProps {
|
|
116
|
-
label: string;
|
|
117
|
-
}
|
|
118
|
-
export declare function Spinner({ label }: SpinnerProps): ReactNode;
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/client/controls/Tabs.d.ts
|
|
121
|
-
interface TabItem {
|
|
122
|
-
readonly value: string;
|
|
123
|
-
readonly label: string;
|
|
124
|
-
}
|
|
125
|
-
interface TabsProps {
|
|
126
|
-
label: string;
|
|
127
|
-
items: readonly TabItem[];
|
|
128
|
-
value: string;
|
|
129
|
-
onChange: (value: string) => void;
|
|
130
|
-
role?: "tablist" | "radiogroup";
|
|
131
|
-
disabled?: boolean;
|
|
132
|
-
}
|
|
133
|
-
export declare function Tabs({ label, items, value, onChange, role, disabled }: TabsProps): ReactNode;
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/client/controls/TimeLabel.d.ts
|
|
136
|
-
type TimeLabelProps = HTMLAttributes<HTMLSpanElement>;
|
|
137
|
-
export declare function TimeLabel({ className, children, ...rest }: TimeLabelProps): ReactNode;
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region src/client/controls/VisuallyHidden.d.ts
|
|
140
|
-
interface VisuallyHiddenProps extends HTMLAttributes<HTMLSpanElement> {
|
|
141
|
-
children: ReactNode;
|
|
142
|
-
}
|
|
143
|
-
export declare function VisuallyHidden({ children, ...rest }: VisuallyHiddenProps): ReactNode;
|
|
144
|
-
//#endregion
|
|
145
|
-
//#region src/client/controls/IconButton.d.ts
|
|
146
|
-
interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "aria-label"> {
|
|
147
|
-
label: string;
|
|
148
|
-
children: ReactNode;
|
|
149
|
-
shape?: "square" | "circle";
|
|
150
|
-
size?: "md" | "sm";
|
|
151
|
-
}
|
|
152
|
-
export declare function IconButton({ label, children, type, shape, size, className, ...rest }: IconButtonProps): ReactNode;
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/client/controls/ModelRouteList.d.ts
|
|
155
|
-
interface ModelRouteCandidate {
|
|
156
|
-
readonly key: string;
|
|
157
|
-
readonly provider: string;
|
|
158
|
-
readonly providerName: string;
|
|
159
|
-
readonly model: string;
|
|
160
|
-
readonly modelName: string;
|
|
161
|
-
}
|
|
162
|
-
interface ModelRouteListProps {
|
|
163
|
-
label: string;
|
|
164
|
-
candidates: readonly ModelRouteCandidate[];
|
|
165
|
-
selectedKey: string | undefined;
|
|
166
|
-
disabled?: boolean;
|
|
167
|
-
status: "loading" | "ready" | "error";
|
|
168
|
-
loadingLabel: string;
|
|
169
|
-
errorLabel: string;
|
|
170
|
-
emptyLabel: string;
|
|
171
|
-
onSelect: (candidate: ModelRouteCandidate) => void;
|
|
172
|
-
}
|
|
173
|
-
export declare function ModelRouteList({ label, candidates, selectedKey, disabled, status, loadingLabel, errorLabel, emptyLabel, onSelect }: ModelRouteListProps): ReactNode;
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/client/controls/MultilineField.d.ts
|
|
176
|
-
type MultilineFieldProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
177
|
-
export declare function MultilineField({ rows, className, ...rest }: MultilineFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region src/client/controls/SearchSelect.d.ts
|
|
180
|
-
interface SearchSelectOption {
|
|
181
|
-
readonly value: string;
|
|
182
|
-
readonly label?: string | undefined;
|
|
183
|
-
}
|
|
184
|
-
interface SearchSelectProps {
|
|
185
|
-
label: string;
|
|
186
|
-
value: string;
|
|
187
|
-
emptyLabel: string;
|
|
188
|
-
options: readonly SearchSelectOption[];
|
|
189
|
-
disabled?: boolean;
|
|
190
|
-
searchLabel: string;
|
|
191
|
-
noMatchLabel: string;
|
|
192
|
-
onSelect: (next: string) => void;
|
|
193
|
-
}
|
|
194
|
-
export declare function SearchSelect({ label, value, emptyLabel, options, disabled, searchLabel, noMatchLabel, onSelect }: SearchSelectProps): ReactNode;
|
|
195
|
-
//#endregion
|
|
196
|
-
//#region src/client/controls/TagInput.d.ts
|
|
197
|
-
interface TagInputProps {
|
|
198
|
-
value: readonly string[];
|
|
199
|
-
onChange: (next: string[]) => void;
|
|
200
|
-
options?: readonly SearchSelectOption[] | undefined;
|
|
201
|
-
placeholder: string;
|
|
202
|
-
label: string;
|
|
203
|
-
disabled?: boolean;
|
|
204
|
-
noMatchLabel?: string;
|
|
205
|
-
removeLabel: (name: string) => string;
|
|
206
|
-
}
|
|
207
|
-
export declare function TagInput({ value, onChange, options, placeholder, label, disabled, noMatchLabel, removeLabel }: TagInputProps): ReactNode;
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region src/client/controls/tags.d.ts
|
|
210
|
-
export declare function parseTagList(text: string): string[];
|
|
211
|
-
export declare function mergeTags(current: readonly string[], incoming: readonly string[]): string[];
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region src/client/schema-form/schema-node.d.ts
|
|
214
|
-
type ReadOnlyReason = "transform" | "function" | "constructor";
|
|
215
|
-
interface FieldMeta {
|
|
216
|
-
description: string | Readonly<Record<string, string>> | undefined;
|
|
217
|
-
comment: string | undefined;
|
|
218
|
-
link: string | undefined;
|
|
219
|
-
role: string | undefined;
|
|
220
|
-
secret: boolean;
|
|
221
|
-
required: boolean;
|
|
222
|
-
disabled: boolean;
|
|
223
|
-
collapse: boolean;
|
|
224
|
-
badges: readonly string[];
|
|
225
|
-
pattern: string | undefined;
|
|
226
|
-
min: number | undefined;
|
|
227
|
-
max: number | undefined;
|
|
228
|
-
step: number | undefined;
|
|
229
|
-
hasDefault: boolean;
|
|
230
|
-
defaultValue: unknown;
|
|
231
|
-
extra: unknown;
|
|
232
|
-
}
|
|
233
|
-
interface FieldNodeBase {
|
|
234
|
-
key: string;
|
|
235
|
-
path: readonly string[];
|
|
236
|
-
label: string | undefined;
|
|
237
|
-
meta: FieldMeta;
|
|
238
|
-
readOnly: ReadOnlyReason | null;
|
|
239
|
-
}
|
|
240
|
-
interface BitsEntry {
|
|
241
|
-
name: string;
|
|
242
|
-
bit: number;
|
|
243
|
-
}
|
|
244
|
-
type FieldNode = (FieldNodeBase & {
|
|
245
|
-
type: "object";
|
|
246
|
-
fields: readonly FieldNode[];
|
|
247
|
-
}) | (FieldNodeBase & {
|
|
248
|
-
type: "dict";
|
|
249
|
-
keyNode: FieldNode;
|
|
250
|
-
valueNode: FieldNode;
|
|
251
|
-
}) | (FieldNodeBase & {
|
|
252
|
-
type: "array";
|
|
253
|
-
item: FieldNode;
|
|
254
|
-
mergeKey: string | undefined;
|
|
255
|
-
}) | (FieldNodeBase & {
|
|
256
|
-
type: "tuple";
|
|
257
|
-
items: readonly FieldNode[];
|
|
258
|
-
}) | (FieldNodeBase & {
|
|
259
|
-
type: "union";
|
|
260
|
-
choices: readonly unknown[] | undefined;
|
|
261
|
-
variants: readonly FieldNode[];
|
|
262
|
-
tagKey: string | undefined;
|
|
263
|
-
}) | (FieldNodeBase & {
|
|
264
|
-
type: "intersect";
|
|
265
|
-
members: readonly FieldNode[];
|
|
266
|
-
}) | (FieldNodeBase & {
|
|
267
|
-
type: "bitset";
|
|
268
|
-
bits: readonly BitsEntry[];
|
|
269
|
-
}) | (FieldNodeBase & {
|
|
270
|
-
type: "const";
|
|
271
|
-
value: unknown;
|
|
272
|
-
}) | (FieldNodeBase & {
|
|
273
|
-
type: "lazy";
|
|
274
|
-
inner: FieldNode;
|
|
275
|
-
}) | (FieldNodeBase & {
|
|
276
|
-
type: "string" | "number" | "boolean" | "any" | "never" | "function";
|
|
277
|
-
}) | (FieldNodeBase & {
|
|
278
|
-
type: "recursive";
|
|
279
|
-
origin: string;
|
|
280
|
-
});
|
|
281
|
-
declare function projectNode(schema: SchemaNode, path?: readonly string[]): FieldNode;
|
|
282
|
-
interface WalkedField {
|
|
283
|
-
path: readonly string[];
|
|
284
|
-
node: FieldNode;
|
|
285
|
-
member?: {
|
|
286
|
-
parent: readonly string[];
|
|
287
|
-
key: string;
|
|
288
|
-
index: number | undefined;
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
interface SuggestedKeys {
|
|
292
|
-
keysFor(path: readonly string[]): readonly string[];
|
|
293
|
-
}
|
|
294
|
-
export declare function walkFields(root: FieldNode, value: unknown): WalkedField[];
|
|
295
|
-
interface VariantChoice {
|
|
296
|
-
label: string;
|
|
297
|
-
value: unknown;
|
|
298
|
-
}
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region src/client/schema-form/draft.d.ts
|
|
301
|
-
type Section = Record<string, unknown>;
|
|
302
|
-
type TextParseResult = {
|
|
303
|
-
kind: "value";
|
|
304
|
-
value: unknown;
|
|
305
|
-
} | {
|
|
306
|
-
kind: "skip";
|
|
307
|
-
} | {
|
|
308
|
-
kind: "invalid";
|
|
309
|
-
message: string;
|
|
310
|
-
};
|
|
311
|
-
type TextParse = (text: string) => TextParseResult;
|
|
312
|
-
interface ValidationFailure {
|
|
313
|
-
message: string;
|
|
314
|
-
path: readonly string[];
|
|
315
|
-
}
|
|
316
|
-
export declare function failureOf(error: unknown): ValidationFailure;
|
|
317
|
-
interface DraftFieldState {
|
|
318
|
-
value: unknown;
|
|
319
|
-
text: string | undefined;
|
|
320
|
-
invalid: string | undefined;
|
|
321
|
-
overridden: boolean;
|
|
322
|
-
staged: boolean;
|
|
323
|
-
}
|
|
324
|
-
type DraftScope = ConfigForm<Section>;
|
|
325
|
-
//#endregion
|
|
326
|
-
//#region src/client/schema-form/hints.d.ts
|
|
327
|
-
type SuggestedKeysReader = () => readonly string[];
|
|
328
|
-
interface FieldText {
|
|
329
|
-
label?: string | undefined;
|
|
330
|
-
hint?: string | undefined;
|
|
331
|
-
}
|
|
332
|
-
type FieldTextReader = () => FieldText;
|
|
333
|
-
interface SelectOption {
|
|
334
|
-
value: unknown;
|
|
335
|
-
label?: string | undefined;
|
|
336
|
-
}
|
|
337
|
-
interface SelectSpec {
|
|
338
|
-
dependsOn?: readonly (readonly string[])[] | undefined;
|
|
339
|
-
options: (read: (path: readonly string[]) => unknown) => readonly SelectOption[];
|
|
340
|
-
}
|
|
341
|
-
interface SchemaFormHintsFace {
|
|
342
|
-
suggestKeys(ns: string, path: readonly string[], read: SuggestedKeysReader): () => void;
|
|
343
|
-
keysFor(ns: string, path: readonly string[]): readonly string[];
|
|
344
|
-
describe(ns: string, path: readonly string[], read: FieldTextReader): () => void;
|
|
345
|
-
textFor(ns: string, path: readonly string[]): FieldText;
|
|
346
|
-
select(ns: string, path: readonly string[], spec: SelectSpec): () => void;
|
|
347
|
-
source(name: string, spec: SelectSpec): () => void;
|
|
348
|
-
sourceFor(name: string): SelectSpec | undefined;
|
|
349
|
-
selectFor(ns: string, path: readonly string[]): SelectSpec | undefined;
|
|
350
|
-
}
|
|
351
|
-
export declare class SchemaFormHints extends Service implements SchemaFormHintsFace {
|
|
352
|
-
#private;
|
|
353
|
-
constructor(ctx: Context);
|
|
354
|
-
keysFor(ns: string, path: readonly string[]): readonly string[];
|
|
355
|
-
textFor(ns: string, path: readonly string[]): FieldText;
|
|
356
|
-
select(ns: string, path: readonly string[], spec: SelectSpec): () => void;
|
|
357
|
-
selectFor(ns: string, path: readonly string[]): SelectSpec | undefined;
|
|
358
|
-
source(name: string, spec: SelectSpec): () => void;
|
|
359
|
-
sourceFor(name: string): SelectSpec | undefined;
|
|
360
|
-
describe(ns: string, path: readonly string[], read: FieldTextReader): () => void;
|
|
361
|
-
suggestKeys(ns: string, path: readonly string[], read: SuggestedKeysReader): () => void;
|
|
362
|
-
subscribe(listener: () => void): () => void;
|
|
363
|
-
refresh(): void;
|
|
364
|
-
}
|
|
365
|
-
declare module "@deepseek-ai/cordis" {
|
|
366
|
-
interface Context {
|
|
367
|
-
schemaFormHints: SchemaFormHints;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
//#endregion
|
|
371
|
-
//#region src/client/schema-form/controller.d.ts
|
|
372
|
-
export declare function projectRoot(serialized: unknown, rehydrate: (serialized: unknown) => SchemaNode): {
|
|
373
|
-
schema: SchemaNode;
|
|
374
|
-
root: FieldNode;
|
|
375
|
-
} | undefined;
|
|
376
|
-
declare function canRender(view: SettingsNamespaceView | undefined, rehydrate: (serialized: unknown) => SchemaNode): boolean;
|
|
377
|
-
interface HintSources extends SuggestedKeys {
|
|
378
|
-
textFor: (path: readonly string[]) => FieldText;
|
|
379
|
-
selectFor?: ((path: readonly string[]) => SelectSpec | undefined) | undefined;
|
|
380
|
-
sourceFor?: ((name: string) => SelectSpec | undefined) | undefined;
|
|
381
|
-
}
|
|
382
|
-
interface SchemaFormDeps {
|
|
383
|
-
form: DraftScope;
|
|
384
|
-
describe: SettingsDescribeFace;
|
|
385
|
-
rehydrate: (serialized: unknown) => SchemaNode;
|
|
386
|
-
validate: (schema: SchemaNode, value: unknown) => ValidationFailure | undefined;
|
|
387
|
-
t: SchemaFormTranslate;
|
|
388
|
-
hints?: HintSources | undefined;
|
|
389
|
-
}
|
|
390
|
-
interface AddableProperty {
|
|
391
|
-
key: string;
|
|
392
|
-
description: string | Readonly<Record<string, string>> | undefined;
|
|
393
|
-
}
|
|
394
|
-
interface SchemaFormState extends SettingsFormShell {
|
|
395
|
-
configured: boolean;
|
|
396
|
-
root: FieldNode;
|
|
397
|
-
walked: readonly WalkedField[];
|
|
398
|
-
fields: ReadonlyMap<string, DraftFieldState>;
|
|
399
|
-
secrets: ReadonlyMap<string, boolean>;
|
|
400
|
-
texts: ReadonlyMap<string, FieldText>;
|
|
401
|
-
options: ReadonlyMap<string, readonly SelectOption[]>;
|
|
402
|
-
addable: ReadonlyMap<string, readonly AddableProperty[]>;
|
|
403
|
-
violation: ValidationFailure | undefined;
|
|
404
|
-
invalidAt: ReadonlyMap<string, string>;
|
|
405
|
-
}
|
|
406
|
-
interface SchemaFormActions {
|
|
407
|
-
set: (path: readonly string[], value: unknown) => void;
|
|
408
|
-
setText: (path: readonly string[], text: string, parse: TextParse) => void;
|
|
409
|
-
clear: (path: readonly string[]) => void;
|
|
410
|
-
appendItem: (path: readonly string[]) => void;
|
|
411
|
-
removeItem: (path: readonly string[], index: number) => void;
|
|
412
|
-
addKey: (path: readonly string[], key: string) => void;
|
|
413
|
-
removeKey: (path: readonly string[], key: string) => void;
|
|
414
|
-
save: () => void;
|
|
415
|
-
revert: (path: readonly string[]) => void;
|
|
416
|
-
discard: () => void;
|
|
417
|
-
}
|
|
418
|
-
interface SchemaFormFace extends SchemaFormActions {
|
|
419
|
-
hooks: {
|
|
420
|
-
schemaForm: SnapshotStore<SchemaFormState>;
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
declare function optionsFor(node: FieldNode, path: readonly string[], value: unknown, hints: HintSources | undefined): readonly SelectOption[] | undefined;
|
|
424
|
-
export declare class SchemaFormController {
|
|
425
|
-
#private;
|
|
426
|
-
constructor(ns: string, deps: SchemaFormDeps);
|
|
427
|
-
face(): SchemaFormFace;
|
|
428
|
-
namespace(): string;
|
|
429
|
-
refresh(): void;
|
|
430
|
-
dispose(): void;
|
|
431
|
-
}
|
|
432
|
-
//#endregion
|
|
433
|
-
//#region src/client/schema-form/labels.d.ts
|
|
434
|
-
type ResolveText = (text: string | Readonly<Record<string, string>>) => string;
|
|
435
|
-
//#endregion
|
|
436
|
-
//#region src/client/schema-form/locales.d.ts
|
|
437
|
-
declare const zh: {
|
|
438
|
-
readonly unavailable: "该插件当前未加载,暂时无法配置。";
|
|
439
|
-
readonly readOnly: "本部署的设置为只读。";
|
|
440
|
-
readonly save: "保存";
|
|
441
|
-
readonly confirmEdit: "确认";
|
|
442
|
-
readonly cancelEdit: "取消";
|
|
443
|
-
readonly saving: "保存中…";
|
|
444
|
-
readonly saveFailed: "本部署没有接受这些值,已保留供你修改。";
|
|
445
|
-
readonly notSaved: "没有保存:{message}";
|
|
446
|
-
readonly noSchema: "这一行没有可自动生成的配置项。";
|
|
447
|
-
readonly reset: "恢复默认";
|
|
448
|
-
readonly revert: "撤回";
|
|
449
|
-
readonly invalid: "这个值不被接受。";
|
|
450
|
-
readonly invalidNumber: "需要一个数字。";
|
|
451
|
-
readonly invalidInteger: "需要一个整数。";
|
|
452
|
-
readonly invalidJson: "需要一段合法的 JSON。";
|
|
453
|
-
readonly invalidBoolean: "需要 true 或 false。";
|
|
454
|
-
readonly invalidConst: "这个字段只接受固定值。";
|
|
455
|
-
readonly invalidPattern: "要匹配 {pattern}。";
|
|
456
|
-
readonly invalidRange: "要在 {min} 与 {max} 之间。";
|
|
457
|
-
readonly invalidMin: "不能小于 {min}。";
|
|
458
|
-
readonly invalidMax: "不能大于 {max}。";
|
|
459
|
-
readonly invalidChoice: "只能是 {choices} 之一。";
|
|
460
|
-
readonly unknownProperty: "这一层没有这个字段:从上面的候选里选,或换个键名。";
|
|
461
|
-
readonly empty: "(空)";
|
|
462
|
-
readonly toggleGroup: "展开 / 收起这一层";
|
|
463
|
-
readonly switchVariant: "切换这一层的形状或分支";
|
|
464
|
-
readonly copyValue: "复制值";
|
|
465
|
-
readonly copied: "已复制";
|
|
466
|
-
readonly addProperty: "添加属性";
|
|
467
|
-
readonly addItemPaste: "添加数组项(可粘贴 JSON 字符串)";
|
|
468
|
-
readonly addItem: "添加一项";
|
|
469
|
-
readonly removeItem: "移除";
|
|
470
|
-
readonly addKey: "添加键(可粘贴 JSON 字符串)";
|
|
471
|
-
readonly keyName: "键名";
|
|
472
|
-
readonly noKeys: "还没有键。";
|
|
473
|
-
readonly noItems: "还没有项。";
|
|
474
|
-
readonly deprecated: "已废弃";
|
|
475
|
-
readonly experimental: "试验中";
|
|
476
|
-
readonly secretSet: "已配置";
|
|
477
|
-
readonly secretUnset: "未配置";
|
|
478
|
-
readonly secretHint: "留空即保留已存的值。";
|
|
479
|
-
readonly constValue: "固定值";
|
|
480
|
-
readonly notEditable: "这一项由插件在运行时提供,不能在页面上编辑。";
|
|
481
|
-
readonly recursive: "递归结构:展开到这一层为止。";
|
|
482
|
-
readonly fixedLength: "固定长度";
|
|
483
|
-
readonly bitsetHint: "可多选。";
|
|
484
|
-
readonly unconfigured: "未配置";
|
|
485
|
-
readonly readOnlyField: "只读";
|
|
486
|
-
readonly noDescription: "(无说明)";
|
|
487
|
-
readonly required: "必填";
|
|
488
|
-
readonly duplicateItem: "重复的 {key}:{value}";
|
|
489
|
-
readonly missingItem: "每一项都需要一个 {key}";
|
|
490
|
-
};
|
|
491
|
-
type SchemaFormLocaleKey = keyof typeof zh;
|
|
492
|
-
//#endregion
|
|
493
|
-
//#region src/client/schema-form/slot-contract.d.ts
|
|
494
|
-
interface SchemaFieldOwnerProps {
|
|
495
|
-
ns: string;
|
|
496
|
-
path: readonly string[];
|
|
497
|
-
node: FieldNode;
|
|
498
|
-
label: string;
|
|
499
|
-
hint: string | undefined;
|
|
500
|
-
value: unknown;
|
|
501
|
-
options: readonly SelectOption[] | undefined;
|
|
502
|
-
text: string | undefined;
|
|
503
|
-
secretConfigured: boolean;
|
|
504
|
-
depth: number;
|
|
505
|
-
overridden: boolean;
|
|
506
|
-
invalid: string | undefined;
|
|
507
|
-
disabled: boolean;
|
|
508
|
-
t: SchemaFormTranslate;
|
|
509
|
-
actions: SchemaFormActions;
|
|
510
|
-
group: {
|
|
511
|
-
collapsed: boolean;
|
|
512
|
-
toggle: () => void;
|
|
513
|
-
} | undefined;
|
|
514
|
-
member: {
|
|
515
|
-
parent: readonly string[];
|
|
516
|
-
key: string;
|
|
517
|
-
index: number | undefined;
|
|
518
|
-
pending?: boolean;
|
|
519
|
-
} | undefined;
|
|
520
|
-
onChange: (value: unknown) => void;
|
|
521
|
-
onEditText: (text: string, parse?: TextParse) => void;
|
|
522
|
-
onReset: () => void;
|
|
523
|
-
}
|
|
524
|
-
type SchemaFieldComponentProps<M extends SchemaFieldMatch = SchemaFieldMatch> = PropsRuntime<"settings.schema-form.field"> & {
|
|
525
|
-
matched: M;
|
|
526
|
-
};
|
|
527
|
-
type SchemaFieldSelect = (field: SchemaFieldOwnerProps) => SchemaFieldMatch | null;
|
|
528
|
-
interface SchemaFieldMatch {
|
|
529
|
-
label?: string;
|
|
530
|
-
hint?: string;
|
|
531
|
-
}
|
|
532
|
-
interface SchemaFormProps {
|
|
533
|
-
ns: string;
|
|
534
|
-
face: SchemaFormFace;
|
|
535
|
-
resolveText: ResolveText;
|
|
536
|
-
}
|
|
537
|
-
type SchemaFormTranslate = TranslateNS<"settings.schema-form">;
|
|
538
|
-
declare module "@deepseek-ai/dsh-client-ui-slots" {
|
|
539
|
-
interface LocaleNamespaceMap {
|
|
540
|
-
"settings.schema-form": SchemaFormLocaleKey;
|
|
541
|
-
}
|
|
542
|
-
interface SlotMap {
|
|
543
|
-
"settings.schema-form.field": {
|
|
544
|
-
kind: "chain";
|
|
545
|
-
scope: "root";
|
|
546
|
-
owner: SchemaFieldOwnerProps;
|
|
547
|
-
};
|
|
548
|
-
}
|
|
549
|
-
interface SlotFactoryMap {
|
|
550
|
-
"settings.schema-form.form": {
|
|
551
|
-
scope: "root";
|
|
552
|
-
props: SchemaFormProps;
|
|
553
|
-
locale: "settings.schema-form";
|
|
554
|
-
children: {
|
|
555
|
-
"settings.schema-form.field": {
|
|
556
|
-
kind: "chain";
|
|
557
|
-
scope: "root";
|
|
558
|
-
};
|
|
559
|
-
};
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
//#endregion
|
|
564
|
-
//#region src/client/schema-form/rows.d.ts
|
|
565
|
-
interface RowRegistrationPlan {
|
|
566
|
-
key: string;
|
|
567
|
-
ns: string;
|
|
568
|
-
}
|
|
569
|
-
export declare function rowRegistrations(namespaces: readonly SettingsNamespaceView[], bundles: readonly BundleInfo[]): RowRegistrationPlan[];
|
|
570
|
-
//#endregion
|
|
571
|
-
//#region src/client/schema-form/value.d.ts
|
|
572
|
-
declare function valueText(value: unknown): string;
|
|
573
|
-
declare function tokenText(value: unknown): string;
|
|
574
|
-
declare function tokenTone(value: unknown): "string" | "number" | "boolean" | "empty";
|
|
575
|
-
declare function InlineValue({ owner }: {
|
|
576
|
-
owner: SchemaFieldOwnerProps;
|
|
577
|
-
}): ReactNode;
|
|
578
|
-
declare function SchemaFieldDefault({ owner }: {
|
|
579
|
-
owner: SchemaFieldOwnerProps;
|
|
580
|
-
}): ReactNode;
|
|
581
|
-
//#endregion
|
|
582
|
-
//#region src/client/schema-form/fields.d.ts
|
|
583
|
-
declare function parseFor(node: FieldNode, t: SchemaFormTranslate): TextParse;
|
|
584
|
-
//#endregion
|
|
585
|
-
//#region src/client/schema-form/lines.d.ts
|
|
586
|
-
type AddLineSpec = {
|
|
587
|
-
kind: "item";
|
|
588
|
-
} | {
|
|
589
|
-
kind: "key";
|
|
590
|
-
options: readonly AddableProperty[];
|
|
591
|
-
} | {
|
|
592
|
-
kind: "prop";
|
|
593
|
-
options: readonly AddableProperty[];
|
|
594
|
-
};
|
|
595
|
-
interface VariantControl {
|
|
596
|
-
choices: readonly VariantChoice[];
|
|
597
|
-
selected: number;
|
|
598
|
-
}
|
|
599
|
-
type ContainerShape = "object" | "array";
|
|
600
|
-
type EditorLine = {
|
|
601
|
-
kind: "open";
|
|
602
|
-
path: readonly string[];
|
|
603
|
-
node: FieldNode;
|
|
604
|
-
shape: ContainerShape;
|
|
605
|
-
depth: number;
|
|
606
|
-
collapsed: boolean;
|
|
607
|
-
member: WalkedField["member"];
|
|
608
|
-
variants: VariantControl | undefined;
|
|
609
|
-
} | {
|
|
610
|
-
kind: "close";
|
|
611
|
-
path: readonly string[];
|
|
612
|
-
node: FieldNode;
|
|
613
|
-
shape: ContainerShape;
|
|
614
|
-
depth: number;
|
|
615
|
-
add: AddLineSpec | undefined;
|
|
616
|
-
member: WalkedField["member"];
|
|
617
|
-
} | {
|
|
618
|
-
kind: "field";
|
|
619
|
-
path: readonly string[];
|
|
620
|
-
node: FieldNode;
|
|
621
|
-
depth: number;
|
|
622
|
-
field: DraftFieldState;
|
|
623
|
-
member: WalkedField["member"];
|
|
624
|
-
variants: VariantControl | undefined;
|
|
625
|
-
variantsStandIn: boolean;
|
|
626
|
-
} | {
|
|
627
|
-
kind: "comment";
|
|
628
|
-
path: readonly string[];
|
|
629
|
-
depth: number;
|
|
630
|
-
text: string;
|
|
631
|
-
invalid: boolean;
|
|
632
|
-
};
|
|
633
|
-
declare function containerShape(node: FieldNode, value?: unknown): ContainerShape | undefined;
|
|
634
|
-
interface FoldState {
|
|
635
|
-
collapsed(path: readonly string[]): boolean;
|
|
636
|
-
toggle(path: readonly string[]): void;
|
|
637
|
-
}
|
|
638
|
-
declare function visibleFields(state: SchemaFormState, fold: FoldState): readonly WalkedField[];
|
|
639
|
-
declare function editorLines(state: SchemaFormState, fold: FoldState, resolveText: ResolveText, t: SchemaFormTranslate): EditorLine[];
|
|
640
|
-
declare namespace index_d_exports {
|
|
641
|
-
export { EditorLine, FieldMeta, FieldNode, FieldText, FoldState, InlineValue, NS, RowRegistrationPlan, SchemaFieldComponentProps, SchemaFieldDefault, SchemaFieldMatch, SchemaFieldOwnerProps, SchemaFieldSelect, SchemaFormActions, SchemaFormController, SchemaFormFace, SchemaFormHints, SchemaFormHintsFace, SchemaFormLocaleKey, SchemaFormProps, SchemaFormState, SelectOption, SelectSpec, SuggestedKeys, SuggestedKeysReader, ValidationFailure, WalkedField, apply$1 as apply, canRender, containerShape, editorLines, failureOf, inject$1 as inject, optionsFor, parseFor, projectNode, projectRoot, rowRegistrations, tokenText, tokenTone, valueText, visibleFields, walkFields };
|
|
642
|
-
}
|
|
643
|
-
declare const NS = "settings.schema-form";
|
|
644
|
-
declare const inject$1: string[];
|
|
645
|
-
declare function apply$1(ctx: Context): void;
|
|
646
|
-
//#endregion
|
|
647
|
-
//#region src/reference-markdown.d.ts
|
|
648
|
-
interface ReferenceActions {
|
|
649
|
-
readonly openFile: (path: string) => void;
|
|
650
|
-
readonly openSkill: (name: string) => void;
|
|
651
|
-
}
|
|
652
|
-
interface ReferenceMarkdownProps {
|
|
653
|
-
readonly text: string;
|
|
654
|
-
readonly labels: MarkdownLabels$1;
|
|
655
|
-
readonly actions?: ReferenceActions | undefined;
|
|
656
|
-
readonly streaming?: boolean | undefined;
|
|
657
|
-
readonly pathImages?: MarkdownPathImages | undefined;
|
|
658
|
-
}
|
|
659
|
-
export declare function referenceMentions(actions?: ReferenceActions, tokens?: ReadonlyMap<string, Reference>): MarkdownFileMentions;
|
|
660
|
-
export declare const ReferenceMarkdown: import("react").MemoExoticComponent<({ text, labels, actions, streaming, pathImages }: ReferenceMarkdownProps) => import("react/jsx-runtime").JSX.Element>;
|
|
661
|
-
//#endregion
|
|
662
|
-
//#region src/client/index.d.ts
|
|
663
|
-
export declare const inject: readonly string[];
|
|
664
|
-
export declare function apply(ctx: Context): void;
|
|
665
|
-
//#endregion
|
|
666
|
-
export { type BubbleProps, type ButtonProps, type ButtonTone, type DisclosureRowProps, type FieldMeta, type FieldNode, type IconButtonProps, type LayoutAlign, type LayoutGap, type LayoutJustify, type LayoutPad, type ModelRouteCandidate, type ModelRouteListProps, type MultilineFieldProps, type Reference, type ReferenceActions, type ReferenceMarkdownProps, type ReferenceSpan, type RowProps, NS as SCHEMA_FORM_NS, type SchemaFormActions, type SchemaFormFace, type SchemaFormLocaleKey, type SchemaFormState, type SearchInputProps, type SearchInputWidth, type SearchSelectOption, type SearchSelectProps, type SeatButtonProps, type SelectOption, type SelectSpec, type SettingsFieldRowProps, type SpinnerProps, type StackProps, type SuggestedKeys, type TabItem, type TabsProps, type TagInputProps, type TextProps, type TextSize, type TextTone, type TimeLabelProps, type ValidationFailure, type VisuallyHiddenProps, type WalkedField, findReferences, formatReference, formatReferenceMention, isLocalReference, parseReference, parseReferenceToken, index_d_exports as schemaForm };
|
|
4
|
+
export { Bubble, type BubbleProps, Button, type ButtonProps, type ButtonTone, DisclosureRow, type DisclosureRowProps, type FieldMeta, type FieldNode, IconButton, type IconButtonProps, type LayoutAlign, type LayoutGap, type LayoutJustify, type LayoutPad, MarkdownCopySeat, type ModelRouteCandidate, ModelRouteList, type ModelRouteListProps, MultilineField, type MultilineFieldProps, type Reference, type ReferenceActions, ReferenceMarkdown, type ReferenceMarkdownProps, type ReferenceSpan, Row, type RowProps, NS as SCHEMA_FORM_NS, type SchemaFormActions, SchemaFormController, type SchemaFormFace, SchemaFormHints, type SchemaFormLocaleKey, type SchemaFormState, SearchSelect, type SearchSelectOption, type SearchSelectProps, SeatButton, type SeatButtonProps, type SelectOption, type SelectSpec, SettingsFieldRow, type SettingsFieldRowProps, Spinner, type SpinnerProps, Stack, type StackProps, type SuggestedKeys, TagInput, type TagInputProps, Text, type TextProps, type TextSize, type TextTone, TimeLabel, type TimeLabelProps, type ValidationFailure, VisuallyHidden, type VisuallyHiddenProps, type WalkedField, apply, failureOf, findReferences, formatReference, formatReferenceMention, inject, isLocalReference, markdownLabels, mergeTags, parseReference, parseReferenceToken, parseTagList, projectRoot, referenceMentions, rowRegistrations, index_d_exports as schemaForm, walkFields };
|