@morlay/dsh-client-ui-primitives 0.0.5 → 0.0.7
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 +3 -2
- package/dist/client.d.mts +52 -26
- package/dist/client.mjs +4576 -0
- package/dist/index.d.mts +2 -2
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +20 -29
- package/src/client/index.ts +7 -7
- package/src/client/schema-form/Editor.tsx +20 -12
- package/src/client/schema-form/TruncatedTooltip.tsx +60 -0
- package/src/client/schema-form/index.ts +11 -0
- package/src/client/schema-form/styles.ts +26 -3
- package/src/client/schema-form/testing/resize-observer-stub.ts +63 -0
- package/src/client/schema-form/value.tsx +10 -8
- package/src/client/styling/styling.ts +6 -1
- package/src/client/theme.generated.ts +14 -1
- package/dist/client.cjs +0 -17075
- package/dist/client.d.cts +0 -11656
- package/dist/index.d.cts +0 -5
- package/dist/reference-BX54bj6_.d.cts +0 -30
package/README.md
CHANGED
|
@@ -48,5 +48,6 @@ import { SettingsFormModel, settingsNumberField } from "@morlay/dsh-client-ui-pr
|
|
|
48
48
|
const form = new SettingsFormModel(scope, [settingsNumberField("timeoutMs")]);
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
装配:**不是装配行**——client 半随用到它的 client 行内联(清单里标 `dsh.client.inline`,devkit 因此不把它当
|
|
52
|
+
模块表里的行外置),装配入口 `apply` 由那些行各自调用、按服务在场与否幂等去重;`styling` 单例跨副本共享一份。
|
|
53
|
+
取舍见 [ADR 基础面暂时内联而不是装配行](./.agents/adrs/20261001-暂时内联而不是装配行.md)。
|
package/dist/client.d.mts
CHANGED
|
@@ -9352,7 +9352,7 @@ interface Sheet {
|
|
|
9352
9352
|
contents: string[];
|
|
9353
9353
|
selector: string | undefined;
|
|
9354
9354
|
}
|
|
9355
|
-
declare class Styling {
|
|
9355
|
+
export declare class Styling {
|
|
9356
9356
|
#private;
|
|
9357
9357
|
static create(): Styling;
|
|
9358
9358
|
static toRule(sheet: Sheet): string;
|
|
@@ -9362,7 +9362,7 @@ declare class Styling {
|
|
|
9362
9362
|
className: (...styles: (CSSProps | false | null | undefined)[]) => string;
|
|
9363
9363
|
sheets: () => string[];
|
|
9364
9364
|
}
|
|
9365
|
-
declare const styling: Styling;
|
|
9365
|
+
export declare const styling: Styling;
|
|
9366
9366
|
//#endregion
|
|
9367
9367
|
//#region src/client/styling/token.d.ts
|
|
9368
9368
|
interface CSSVarRef {
|
|
@@ -9372,7 +9372,7 @@ interface CSSVarRef {
|
|
|
9372
9372
|
}
|
|
9373
9373
|
type TokenVars<T> = (T extends string | true ? CSSVarRef : { readonly [K in keyof T]: TokenVars<T[K]>; }) & CSSVarRef;
|
|
9374
9374
|
type Tokens = Record<string, unknown>;
|
|
9375
|
-
declare class Token {
|
|
9375
|
+
export declare class Token {
|
|
9376
9376
|
readonly prefix: string;
|
|
9377
9377
|
static vars<T extends Tokens>(tokens: T, options?: {
|
|
9378
9378
|
prefix?: string;
|
|
@@ -9408,11 +9408,11 @@ declare const sxSymbol: unique symbol;
|
|
|
9408
9408
|
type StyledComponent<T extends ElementType> = ForwardRefExoticComponent<StyledProps<T> & RefAttributes<StyledRef<T>>> & {
|
|
9409
9409
|
readonly [sxSymbol]: CSSProps;
|
|
9410
9410
|
};
|
|
9411
|
-
declare function styled<T extends ElementType>(Component: T, defaultProps?: Partial<ComponentProps<T>>): (...styles: CSSProps[]) => StyledComponent<T>;
|
|
9412
|
-
declare function styleOf(component: StyledComponent<ElementType>): CSSProps;
|
|
9411
|
+
export declare function styled<T extends ElementType>(Component: T, defaultProps?: Partial<ComponentProps<T>>): (...styles: CSSProps[]) => StyledComponent<T>;
|
|
9412
|
+
export declare function styleOf(component: StyledComponent<ElementType>): CSSProps;
|
|
9413
9413
|
//#endregion
|
|
9414
9414
|
//#region src/client/theme.generated.d.ts
|
|
9415
|
-
declare const designTokens: {
|
|
9415
|
+
export declare const designTokens: {
|
|
9416
9416
|
readonly alias: {
|
|
9417
9417
|
readonly bg: {
|
|
9418
9418
|
readonly base: "var(--dsw-static-neutral-bluish-00)";
|
|
@@ -9579,6 +9579,11 @@ declare const designTokens: {
|
|
|
9579
9579
|
readonly tag: "var(--dsw-static-neutral-bluish-75)";
|
|
9580
9580
|
};
|
|
9581
9581
|
readonly menu: {
|
|
9582
|
+
readonly group: {
|
|
9583
|
+
readonly header: {
|
|
9584
|
+
readonly fill: "rgba(248, 249, 250, 0.94)";
|
|
9585
|
+
};
|
|
9586
|
+
};
|
|
9582
9587
|
readonly icon: "var(--dsw-static-neutral-bluish-800)";
|
|
9583
9588
|
};
|
|
9584
9589
|
readonly onboarding: {
|
|
@@ -9646,6 +9651,14 @@ declare const designTokens: {
|
|
|
9646
9651
|
readonly bg: "color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)";
|
|
9647
9652
|
};
|
|
9648
9653
|
};
|
|
9654
|
+
readonly turn: {
|
|
9655
|
+
readonly trigger: {
|
|
9656
|
+
readonly bg: {
|
|
9657
|
+
readonly $: "var(--dsw-alias-markdown-code-block)";
|
|
9658
|
+
readonly hover: "var(--dsw-alias-interactive-bg-hover)";
|
|
9659
|
+
};
|
|
9660
|
+
};
|
|
9661
|
+
};
|
|
9649
9662
|
};
|
|
9650
9663
|
readonly corner: {
|
|
9651
9664
|
readonly shape: "superellipse(1.5)";
|
|
@@ -10238,7 +10251,7 @@ declare const designTokens: {
|
|
|
10238
10251
|
};
|
|
10239
10252
|
//#endregion
|
|
10240
10253
|
//#region src/client/theme.d.ts
|
|
10241
|
-
declare const dsw: TokenVars<{
|
|
10254
|
+
export declare const dsw: TokenVars<{
|
|
10242
10255
|
readonly alias: {
|
|
10243
10256
|
readonly bg: {
|
|
10244
10257
|
readonly base: "var(--dsw-static-neutral-bluish-00)";
|
|
@@ -10405,6 +10418,11 @@ declare const dsw: TokenVars<{
|
|
|
10405
10418
|
readonly tag: "var(--dsw-static-neutral-bluish-75)";
|
|
10406
10419
|
};
|
|
10407
10420
|
readonly menu: {
|
|
10421
|
+
readonly group: {
|
|
10422
|
+
readonly header: {
|
|
10423
|
+
readonly fill: "rgba(248, 249, 250, 0.94)";
|
|
10424
|
+
};
|
|
10425
|
+
};
|
|
10408
10426
|
readonly icon: "var(--dsw-static-neutral-bluish-800)";
|
|
10409
10427
|
};
|
|
10410
10428
|
readonly onboarding: {
|
|
@@ -10472,6 +10490,14 @@ declare const dsw: TokenVars<{
|
|
|
10472
10490
|
readonly bg: "color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)";
|
|
10473
10491
|
};
|
|
10474
10492
|
};
|
|
10493
|
+
readonly turn: {
|
|
10494
|
+
readonly trigger: {
|
|
10495
|
+
readonly bg: {
|
|
10496
|
+
readonly $: "var(--dsw-alias-markdown-code-block)";
|
|
10497
|
+
readonly hover: "var(--dsw-alias-interactive-bg-hover)";
|
|
10498
|
+
};
|
|
10499
|
+
};
|
|
10500
|
+
};
|
|
10475
10501
|
};
|
|
10476
10502
|
readonly corner: {
|
|
10477
10503
|
readonly shape: "superellipse(1.5)";
|
|
@@ -11064,8 +11090,8 @@ declare const dsw: TokenVars<{
|
|
|
11064
11090
|
}>;
|
|
11065
11091
|
//#endregion
|
|
11066
11092
|
//#region src/client/markdown-labels.d.ts
|
|
11067
|
-
type MarkdownCopySeat = (key: "copy" | "copied" | "markdown.footnotes") => string;
|
|
11068
|
-
declare function markdownLabels(t: MarkdownCopySeat): MarkdownLabels;
|
|
11093
|
+
export type MarkdownCopySeat = (key: "copy" | "copied" | "markdown.footnotes") => string;
|
|
11094
|
+
export declare function markdownLabels(t: MarkdownCopySeat): MarkdownLabels;
|
|
11069
11095
|
//#endregion
|
|
11070
11096
|
//#region src/client/settings-form/form-model.d.ts
|
|
11071
11097
|
interface SettingsFormScopeSnapshot<T> {
|
|
@@ -11123,9 +11149,9 @@ interface SettingsFormActions {
|
|
|
11123
11149
|
save: () => void;
|
|
11124
11150
|
discard: () => void;
|
|
11125
11151
|
}
|
|
11126
|
-
declare function settingsNumberField(field: string): SettingsFieldSpec;
|
|
11127
|
-
declare function settingsTextField(field: string): SettingsFieldSpec;
|
|
11128
|
-
declare class SettingsFormModel<T> {
|
|
11152
|
+
export declare function settingsNumberField(field: string): SettingsFieldSpec;
|
|
11153
|
+
export declare function settingsTextField(field: string): SettingsFieldSpec;
|
|
11154
|
+
export declare class SettingsFormModel<T> {
|
|
11129
11155
|
private readonly scope;
|
|
11130
11156
|
private readonly specs;
|
|
11131
11157
|
private readonly secretSpecs;
|
|
@@ -11168,7 +11194,7 @@ interface SettingsFieldProps {
|
|
|
11168
11194
|
onEdit: (text: string) => void;
|
|
11169
11195
|
onReset: () => void;
|
|
11170
11196
|
}
|
|
11171
|
-
declare function SettingsValueField(props: Omit<SettingsFieldProps, "hint"> & {
|
|
11197
|
+
export declare function SettingsValueField(props: Omit<SettingsFieldProps, "hint"> & {
|
|
11172
11198
|
hint?: string;
|
|
11173
11199
|
help?: {
|
|
11174
11200
|
label: string;
|
|
@@ -11177,7 +11203,7 @@ declare function SettingsValueField(props: Omit<SettingsFieldProps, "hint"> & {
|
|
|
11177
11203
|
numeric?: boolean;
|
|
11178
11204
|
placeholder?: string;
|
|
11179
11205
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11180
|
-
declare function SettingsSecretField(props: Pick<SettingsFieldProps, "id" | "label" | "hint" | "text" | "disabled" | "onEdit"> & {
|
|
11206
|
+
export declare function SettingsSecretField(props: Pick<SettingsFieldProps, "id" | "label" | "hint" | "text" | "disabled" | "onEdit"> & {
|
|
11181
11207
|
configured: boolean;
|
|
11182
11208
|
stateLabel: string;
|
|
11183
11209
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11197,7 +11223,7 @@ interface SettingsFormProps {
|
|
|
11197
11223
|
onDiscard: () => void;
|
|
11198
11224
|
children: ReactNode;
|
|
11199
11225
|
}
|
|
11200
|
-
declare function SettingsForm(props: SettingsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
11226
|
+
export declare function SettingsForm(props: SettingsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
11201
11227
|
//#endregion
|
|
11202
11228
|
//#region src/client/schema-form/schema-node.d.ts
|
|
11203
11229
|
type ReadOnlyReason = "transform" | "function" | "constructor";
|
|
@@ -11280,7 +11306,7 @@ interface WalkedField {
|
|
|
11280
11306
|
interface SuggestedKeys {
|
|
11281
11307
|
keysFor(path: readonly string[]): readonly string[];
|
|
11282
11308
|
}
|
|
11283
|
-
declare function walkFields(root: FieldNode, value: unknown): WalkedField[];
|
|
11309
|
+
export declare function walkFields(root: FieldNode, value: unknown): WalkedField[];
|
|
11284
11310
|
interface VariantChoice {
|
|
11285
11311
|
label: string;
|
|
11286
11312
|
value: unknown;
|
|
@@ -11302,7 +11328,7 @@ interface ValidationFailure {
|
|
|
11302
11328
|
message: string;
|
|
11303
11329
|
path: readonly string[];
|
|
11304
11330
|
}
|
|
11305
|
-
declare function failureOf(error: unknown): ValidationFailure;
|
|
11331
|
+
export declare function failureOf(error: unknown): ValidationFailure;
|
|
11306
11332
|
interface DraftFieldState {
|
|
11307
11333
|
value: unknown;
|
|
11308
11334
|
text: string | undefined;
|
|
@@ -11337,7 +11363,7 @@ interface SchemaFormHintsFace {
|
|
|
11337
11363
|
sourceFor(name: string): SelectSpec | undefined;
|
|
11338
11364
|
selectFor(ns: string, path: readonly string[]): SelectSpec | undefined;
|
|
11339
11365
|
}
|
|
11340
|
-
declare class SchemaFormHints extends Service implements SchemaFormHintsFace {
|
|
11366
|
+
export declare class SchemaFormHints extends Service implements SchemaFormHintsFace {
|
|
11341
11367
|
#private;
|
|
11342
11368
|
constructor(ctx: Context);
|
|
11343
11369
|
keysFor(ns: string, path: readonly string[]): readonly string[];
|
|
@@ -11358,7 +11384,7 @@ declare module "@deepseek-ai/cordis" {
|
|
|
11358
11384
|
}
|
|
11359
11385
|
//#endregion
|
|
11360
11386
|
//#region src/client/schema-form/controller.d.ts
|
|
11361
|
-
declare function projectRoot(serialized: unknown, rehydrate: (serialized: unknown) => SchemaNode): {
|
|
11387
|
+
export declare function projectRoot(serialized: unknown, rehydrate: (serialized: unknown) => SchemaNode): {
|
|
11362
11388
|
schema: SchemaNode;
|
|
11363
11389
|
root: FieldNode;
|
|
11364
11390
|
} | undefined;
|
|
@@ -11410,7 +11436,7 @@ interface SchemaFormFace extends SchemaFormActions {
|
|
|
11410
11436
|
};
|
|
11411
11437
|
}
|
|
11412
11438
|
declare function optionsFor(node: FieldNode, path: readonly string[], value: unknown, hints: HintSources | undefined): readonly SelectOption[] | undefined;
|
|
11413
|
-
declare class SchemaFormController {
|
|
11439
|
+
export declare class SchemaFormController {
|
|
11414
11440
|
#private;
|
|
11415
11441
|
constructor(ns: string, deps: SchemaFormDeps);
|
|
11416
11442
|
face(): SchemaFormFace;
|
|
@@ -11555,7 +11581,7 @@ interface RowRegistrationPlan {
|
|
|
11555
11581
|
key: string;
|
|
11556
11582
|
ns: string;
|
|
11557
11583
|
}
|
|
11558
|
-
declare function rowRegistrations(namespaces: readonly SettingsNamespaceView[], bundles: readonly BundleInfo[]): RowRegistrationPlan[];
|
|
11584
|
+
export declare function rowRegistrations(namespaces: readonly SettingsNamespaceView[], bundles: readonly BundleInfo[]): RowRegistrationPlan[];
|
|
11559
11585
|
//#endregion
|
|
11560
11586
|
//#region src/client/schema-form/value.d.ts
|
|
11561
11587
|
declare function valueText(value: unknown): string;
|
|
@@ -11645,11 +11671,11 @@ interface ReferenceMarkdownProps {
|
|
|
11645
11671
|
readonly streaming?: boolean | undefined;
|
|
11646
11672
|
readonly pathImages?: MarkdownPathImages | undefined;
|
|
11647
11673
|
}
|
|
11648
|
-
declare function referenceMentions(actions?: ReferenceActions, tokens?: ReadonlyMap<string, Reference>): MarkdownFileMentions;
|
|
11649
|
-
declare const ReferenceMarkdown: import("react").MemoExoticComponent<({ text, labels, actions, streaming, pathImages }: ReferenceMarkdownProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11674
|
+
export declare function referenceMentions(actions?: ReferenceActions, tokens?: ReadonlyMap<string, Reference>): MarkdownFileMentions;
|
|
11675
|
+
export declare const ReferenceMarkdown: import("react").MemoExoticComponent<({ text, labels, actions, streaming, pathImages }: ReferenceMarkdownProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11650
11676
|
//#endregion
|
|
11651
11677
|
//#region src/client/index.d.ts
|
|
11652
|
-
declare const inject: readonly string[];
|
|
11653
|
-
declare function apply(ctx: Context): void;
|
|
11678
|
+
export declare const inject: readonly string[];
|
|
11679
|
+
export declare function apply(ctx: Context): void;
|
|
11654
11680
|
//#endregion
|
|
11655
|
-
export { type CSSObject, type CSSProps, type CSSSelector, type CSSValue, type CSSVar, type CSSVarRef, type FieldMeta, type FieldNode,
|
|
11681
|
+
export { type CSSObject, type CSSProps, type CSSSelector, type CSSValue, type CSSVar, type CSSVarRef, type FieldMeta, type FieldNode, type Reference, type ReferenceActions, type ReferenceMarkdownProps, type ReferenceSpan, NS as SCHEMA_FORM_NS, type SchemaFormActions, type SchemaFormFace, type SchemaFormLocaleKey, type SchemaFormState, type SelectOption, type SelectSpec, type SettingsFieldProps, type SettingsFieldSpec, type SettingsFieldState, type SettingsFieldWrite, type SettingsFormActions, type SettingsFormLabels, type SettingsFormPathOp, type SettingsFormProps, type SettingsFormScope, type SettingsFormScopeSnapshot, type SettingsFormShell, type SettingsSecretSpec, type StyledComponent, type SuggestedKeys, type TokenVars, type Tokens, type ValidationFailure, type WalkedField, findReferences, formatReference, formatReferenceMention, isLocalReference, parseReference, parseReferenceToken, index_d_exports as schemaForm };
|