@animus-ui/system 0.1.11 → 0.1.12
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 +124 -51
- package/dist/Animus.d.ts +1 -1
- package/dist/Animus.d.ts.map +1 -1
- package/dist/AnimusExtended.d.ts +1 -1
- package/dist/AnimusExtended.d.ts.map +1 -1
- package/dist/SystemBuilder.d.ts +184 -155
- package/dist/SystemBuilder.d.ts.map +1 -1
- package/dist/appearance/index.d.ts +0 -68
- package/dist/appearance/index.d.ts.map +1 -1
- package/dist/appearance/index.js +0 -91
- package/dist/assert-root-slot-C3Lp9MNJ.js +10 -0
- package/dist/asset.d.ts +4 -13
- package/dist/asset.d.ts.map +1 -1
- package/dist/bootstrap/createAppearanceBootstrap.d.ts +0 -57
- package/dist/bootstrap/createAppearanceBootstrap.d.ts.map +1 -1
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js +4 -58
- package/dist/class-resolver.d.ts +2 -4
- package/dist/class-resolver.d.ts.map +1 -1
- package/dist/class-resolver.js +1 -1
- package/dist/compose.d.ts +2 -16
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +3 -17
- package/dist/composeWithContext.d.ts +4 -15
- package/dist/composeWithContext.d.ts.map +1 -1
- package/dist/composeWithContext.js +5 -16
- package/dist/conditions.d.ts +24 -141
- package/dist/conditions.d.ts.map +1 -1
- package/dist/{createClassResolver-BWyEQ5KZ.js → createClassResolver-EpwTL9Sa.js} +12 -113
- package/dist/{createComposedFamily-k5tTujGI.js → createComposedFamily-C4NovMcd.js} +11 -49
- package/dist/groups/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +318 -409
- package/dist/keyframes.d.ts +2 -23
- package/dist/keyframes.d.ts.map +1 -1
- package/dist/runtime/assert-root-slot.d.ts +2 -13
- package/dist/runtime/assert-root-slot.d.ts.map +1 -1
- package/dist/runtime/createClassResolver.d.ts +0 -8
- package/dist/runtime/createClassResolver.d.ts.map +1 -1
- package/dist/runtime/createComposedFamily.d.ts +2 -7
- package/dist/runtime/createComposedFamily.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +0 -16
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/is-dev.d.ts +2 -42
- package/dist/runtime/is-dev.d.ts.map +1 -1
- package/dist/runtime/resolveClasses.d.ts +8 -33
- package/dist/runtime/resolveClasses.d.ts.map +1 -1
- package/dist/runtime/witness.d.ts +0 -8
- package/dist/runtime/witness.d.ts.map +1 -1
- package/dist/runtime-entry.d.ts +1 -6
- package/dist/runtime-entry.d.ts.map +1 -1
- package/dist/runtime-entry.js +2 -2
- package/dist/selectors.d.ts +6 -45
- package/dist/selectors.d.ts.map +1 -1
- package/dist/{size-CcVEGaen.js → size-C6jqxiQy.js} +7 -34
- package/dist/theme/createTheme.d.ts +26 -95
- package/dist/theme/createTheme.d.ts.map +1 -1
- package/dist/theme/flattenScale.d.ts +4 -10
- package/dist/theme/flattenScale.d.ts.map +1 -1
- package/dist/theme/resolveReferences.d.ts +7 -35
- package/dist/theme/resolveReferences.d.ts.map +1 -1
- package/dist/theme/serializeTokens.d.ts +0 -3
- package/dist/theme/serializeTokens.d.ts.map +1 -1
- package/dist/theme/types.d.ts +4 -26
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/theme/utils.d.ts +1 -18
- package/dist/theme/utils.d.ts.map +1 -1
- package/dist/transforms/border.d.ts +1 -4
- package/dist/transforms/border.d.ts.map +1 -1
- package/dist/transforms/createTransform.d.ts +6 -31
- package/dist/transforms/createTransform.d.ts.map +1 -1
- package/dist/transforms/grid.d.ts +2 -12
- package/dist/transforms/grid.d.ts.map +1 -1
- package/dist/transforms/size.d.ts +2 -8
- package/dist/transforms/size.d.ts.map +1 -1
- package/dist/types/component.d.ts +9 -105
- package/dist/types/component.d.ts.map +1 -1
- package/dist/types/config.d.ts +12 -141
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/theme.d.ts +8 -165
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/utils/deepMerge.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/assert-root-slot-B73sDJ1Q.js +0 -21
package/dist/SystemBuilder.d.ts
CHANGED
|
@@ -7,23 +7,18 @@ import { NamedTransform } from './transforms/createTransform';
|
|
|
7
7
|
import { type BuiltInConditionAlias, type BuiltInSelectorAlias, Prop, ThemedCSSProps } from './types/config';
|
|
8
8
|
import { AbstractProps } from './types/props';
|
|
9
9
|
export type GlobalStyleMap = Record<string, Record<string, any>>;
|
|
10
|
-
/** One `src` descriptor of a font-face resource. */
|
|
11
10
|
export interface FontFaceSrc {
|
|
12
11
|
/**
|
|
13
|
-
* A literal string is emitted byte-exact
|
|
14
|
-
*
|
|
15
|
-
* extraction. An `AssetRef` (from `asset(specifier)`) rides through
|
|
16
|
-
* evaluation and emission as its placeholder string; the host plugin
|
|
17
|
-
* substitutes the bundler-resolved URL after extraction.
|
|
12
|
+
* A literal string is emitted byte-exact; an `AssetRef` emits its
|
|
13
|
+
* placeholder string, which the host plugin substitutes after extraction.
|
|
18
14
|
*/
|
|
19
15
|
url: string | AssetRef;
|
|
20
16
|
/** Format hint (`woff2`, `woff`, …), rendered as `format('…')`. */
|
|
21
17
|
format?: string;
|
|
22
18
|
}
|
|
23
19
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* literals only.
|
|
20
|
+
* `family` may use a font-scale token reference (`{fonts.body}`); the other
|
|
21
|
+
* descriptors take CSS literals only.
|
|
27
22
|
*/
|
|
28
23
|
export interface FontFace {
|
|
29
24
|
family: string;
|
|
@@ -55,21 +50,14 @@ export type CreateKeyframesFactory<PropReg extends Record<string, Prop> = Record
|
|
|
55
50
|
type IncludableSystem = {
|
|
56
51
|
toConfig(): SerializedConfig;
|
|
57
52
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* built by an older @animus-ui/system remain structurally acceptable
|
|
61
|
-
* during the deprecation window; `extend()` fails loud at runtime when it
|
|
62
|
-
* is absent (design D7 — no `SerializedConfig` reconstruction).
|
|
53
|
+
* Optional only so systems built by an older @animus-ui/system stay
|
|
54
|
+
* structurally acceptable; `extend()` throws when it is absent.
|
|
63
55
|
*/
|
|
64
56
|
getRegistrySnapshot?(): RegistrySnapshot;
|
|
65
57
|
};
|
|
66
58
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* the public `propRegistry`/`groupRegistry` fields affects neither. Containers
|
|
70
|
-
* and per-entry objects are frozen shallow copies. Transforms are immutable,
|
|
71
|
-
* cached forwarding wrappers so later mutation of function metadata cannot
|
|
72
|
-
* alter serialization while anonymous transform behavior is retained.
|
|
59
|
+
* Frozen at `build()`: `toConfig()` serializes and `extend()` merges from
|
|
60
|
+
* it, so post-build mutation of the public registries reaches neither.
|
|
73
61
|
*/
|
|
74
62
|
export interface RegistrySnapshot {
|
|
75
63
|
props: Record<string, Prop>;
|
|
@@ -78,174 +66,223 @@ export interface RegistrySnapshot {
|
|
|
78
66
|
conditions: ConditionAliasMap;
|
|
79
67
|
}
|
|
80
68
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* `createTheme().extend()`; each builder takes its half and ignores the rest.
|
|
84
|
-
* `tokens` is the pre-D9 name for the theme half — both spellings are
|
|
85
|
-
* accepted (design D9; removal horizon is DEF-8).
|
|
69
|
+
* The shape `registerKeyframes` accepts. The brand is structural: a
|
|
70
|
+
* hand-rolled object carrying it is admitted; provenance is not checked.
|
|
86
71
|
*/
|
|
87
|
-
export interface
|
|
72
|
+
export interface RegisterableKeyframes {
|
|
73
|
+
readonly __brand: 'Keyframes';
|
|
74
|
+
readonly __frames: object;
|
|
75
|
+
}
|
|
76
|
+
export interface RegisterableGlobalStyles {
|
|
77
|
+
readonly __brand: 'GlobalStyleBlock';
|
|
78
|
+
readonly styles: object;
|
|
79
|
+
}
|
|
80
|
+
export type KeyframesFrameData = Record<string, {
|
|
81
|
+
readonly name: string;
|
|
82
|
+
readonly frames: KeyframeFrameMap;
|
|
83
|
+
}>;
|
|
84
|
+
export interface VocabularyKeyframesEntry {
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly frames: KeyframesFrameData;
|
|
87
|
+
}
|
|
88
|
+
export interface VocabularyGlobalStyleEntry {
|
|
89
|
+
readonly name: string;
|
|
90
|
+
readonly styles: GlobalStyleMap;
|
|
91
|
+
readonly fontFaces?: readonly FontFace[];
|
|
92
|
+
}
|
|
93
|
+
export interface VocabularyCollisionEntry {
|
|
94
|
+
/** Stable machine code — the record, not the console, is the witness
|
|
95
|
+
* channel (the loader's evaluation host shims `console` to a no-op). */
|
|
96
|
+
readonly code: 'animus.vocabulary.collision';
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly winner: string;
|
|
99
|
+
readonly loser: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Names a sealed source's registered vocabulary that `from()` / `includes:`
|
|
103
|
+
* did not deliver — those verbs merge no registries; `.extend()` does.
|
|
104
|
+
*/
|
|
105
|
+
export interface VocabularyLegacyVerbEntry {
|
|
106
|
+
readonly code: 'animus.vocabulary.legacy-verb';
|
|
107
|
+
readonly verb: 'from' | 'includes';
|
|
108
|
+
/** Positional label (`includes source #1`) — a source has no knowable
|
|
109
|
+
* export name at this seam. */
|
|
110
|
+
readonly source: string;
|
|
111
|
+
readonly names: readonly string[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The registration record a sealed system carries, in declaration order.
|
|
115
|
+
* The loader reads registered collections exclusively from here.
|
|
116
|
+
*/
|
|
117
|
+
export interface VocabularyRecord {
|
|
118
|
+
readonly version: 1;
|
|
119
|
+
readonly keyframes: readonly VocabularyKeyframesEntry[];
|
|
120
|
+
readonly globalStyles: readonly VocabularyGlobalStyleEntry[];
|
|
121
|
+
readonly collisions: readonly VocabularyCollisionEntry[];
|
|
122
|
+
readonly legacyVerbs: readonly VocabularyLegacyVerbEntry[];
|
|
123
|
+
}
|
|
124
|
+
/** ONE name-space across both kinds: a global-style block and a keyframes
|
|
125
|
+
* collection cannot share a registered name. */
|
|
126
|
+
type VocabularyEntryState = {
|
|
127
|
+
kind: 'keyframes';
|
|
128
|
+
name: string;
|
|
129
|
+
frames: KeyframesFrameData;
|
|
130
|
+
origin: string;
|
|
131
|
+
} | {
|
|
132
|
+
kind: 'globalStyles';
|
|
133
|
+
name: string;
|
|
134
|
+
styles: GlobalStyleMap;
|
|
135
|
+
fontFaces?: readonly FontFace[];
|
|
136
|
+
origin: string;
|
|
137
|
+
};
|
|
138
|
+
declare const VOCABULARY_COLLISION_BRAND: unique symbol;
|
|
139
|
+
/**
|
|
140
|
+
* Impossible-to-satisfy marker so a colliding registration site reports the
|
|
141
|
+
* offending vocabulary name instead of a bare structural mismatch.
|
|
142
|
+
*/
|
|
143
|
+
export interface VocabularyNameCollision<Name extends string> {
|
|
144
|
+
readonly [VOCABULARY_COLLISION_BRAND]: `Vocabulary name "${Name}" is already registered on this system`;
|
|
145
|
+
}
|
|
146
|
+
declare const VOCABULARY_INDEX_SIGNATURE: unique symbol;
|
|
147
|
+
/**
|
|
148
|
+
* Rejects index-signature maps: they bypass the collision mapping
|
|
149
|
+
* (`Extract<string, Vocab>` is `never`) and widen the axis to `string`.
|
|
150
|
+
*/
|
|
151
|
+
export interface VocabularyIndexSignatureRejected {
|
|
152
|
+
readonly [VOCABULARY_INDEX_SIGNATURE]: 'vocabulary registration requires literal keys — an index-signature map cannot prove its names';
|
|
153
|
+
}
|
|
154
|
+
type LiteralKeyMap<M> = string extends keyof M ? VocabularyIndexSignatureRejected : unknown;
|
|
155
|
+
declare const VOCABULARY_BRAND: unique symbol;
|
|
156
|
+
/**
|
|
157
|
+
* What `seal()` returns. The registered names ride as phantom type state so
|
|
158
|
+
* `.extend()` can make a collision a compile error in a consumer's chain.
|
|
159
|
+
*/
|
|
160
|
+
export type SealedSystemInstance<PropReg extends Record<string, Prop>, GroupReg extends Record<string, (keyof PropReg)[]>, Conds extends string = never, Sels extends string = never, Vocab extends string = never> = SystemInstance<PropReg, GroupReg, Conds, Sels> & {
|
|
161
|
+
getVocabularyRecord(): VocabularyRecord;
|
|
162
|
+
readonly [VOCABULARY_BRAND]?: Vocab;
|
|
163
|
+
};
|
|
164
|
+
export type VocabularyOf<S> = S extends {
|
|
165
|
+
readonly [VOCABULARY_BRAND]?: infer V;
|
|
166
|
+
} ? Extract<V, string> : never;
|
|
167
|
+
/**
|
|
168
|
+
* The `build()` return. Registration is linear — chain the returned bundle;
|
|
169
|
+
* one `seal()` per bundle, and later registering or re-sealing throws.
|
|
170
|
+
*/
|
|
171
|
+
export interface SystemBundle<PropReg extends Record<string, Prop>, GroupReg extends Record<string, (keyof PropReg)[]>, Conds extends string = never, Sels extends string = never, Vocab extends string = never> {
|
|
172
|
+
system: SystemInstance<PropReg, GroupReg, Conds, Sels>;
|
|
173
|
+
createGlobalStyles: GlobalStylesFactory<PropReg>;
|
|
174
|
+
createKeyframes: CreateKeyframesFactory<PropReg>;
|
|
175
|
+
/**
|
|
176
|
+
* The registration key must equal the collection's module-scope export
|
|
177
|
+
* name — references resolve by export name. Registration is linear.
|
|
178
|
+
*/
|
|
179
|
+
registerKeyframes<M extends Record<string, RegisterableKeyframes>>(map: M & LiteralKeyMap<M> & {
|
|
180
|
+
[K in Extract<keyof M, Vocab>]: VocabularyNameCollision<K & string>;
|
|
181
|
+
}): SystemBundle<PropReg, GroupReg, Conds, Sels, Vocab | (keyof M & string)>;
|
|
182
|
+
/**
|
|
183
|
+
* Keys equal the block's module-scope export name. Blocks and keyframes
|
|
184
|
+
* collections share ONE vocabulary name-space.
|
|
185
|
+
*/
|
|
186
|
+
registerGlobalStyles<M extends Record<string, RegisterableGlobalStyles>>(map: M & LiteralKeyMap<M> & {
|
|
187
|
+
[K in Extract<keyof M, Vocab>]: VocabularyNameCollision<K & string>;
|
|
188
|
+
}): SystemBundle<PropReg, GroupReg, Conds, Sels, Vocab | (keyof M & string)>;
|
|
189
|
+
seal(): SealedSystemInstance<PropReg, GroupReg, Conds, Sels, Vocab>;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Publishable bundle type whose vocabulary axis is read off the sealed
|
|
193
|
+
* system; a hand-written `LibraryBundle<'…'>` axis is unchecked.
|
|
194
|
+
*/
|
|
195
|
+
export type LibraryBundleFor<S> = LibraryBundle<VocabularyOf<S>>;
|
|
196
|
+
/**
|
|
197
|
+
* One export for both builders: `createSystem().extend()` takes the system
|
|
198
|
+
* half, `createTheme().extend()` the theme half (`tokens` is accepted too).
|
|
199
|
+
*/
|
|
200
|
+
export interface LibraryBundle<Vocab extends string = never> {
|
|
88
201
|
system: IncludableSystem;
|
|
89
202
|
theme?: unknown;
|
|
90
203
|
tokens?: unknown;
|
|
204
|
+
/** Phantom vocabulary axis — never present at runtime. */
|
|
205
|
+
readonly __vocabulary?: Vocab;
|
|
91
206
|
}
|
|
92
207
|
/**
|
|
93
|
-
*
|
|
94
|
-
* being callable
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* script in the Rust system-loader mirrors it by necessity (it cannot
|
|
98
|
-
* import TS) and points back here.
|
|
208
|
+
* A built system also carries a `.system()` chain method, so only
|
|
209
|
+
* `system.toConfig` being callable discriminates a bundle from an instance.
|
|
210
|
+
* The QuickJS capture script in the Rust system-loader reimplements the same
|
|
211
|
+
* discriminator — it cannot import this file, so change both together.
|
|
99
212
|
*/
|
|
100
213
|
export declare function isLibraryBundle(value: unknown): value is LibraryBundle;
|
|
101
214
|
export interface CreateSystemConfig {
|
|
102
215
|
/**
|
|
103
|
-
* @deprecated Use `createSystem().extend(source)
|
|
104
|
-
*
|
|
105
|
-
* The alias keeps its frozen pre-existing semantics (discovery membership
|
|
106
|
-
* via the same source list, NO registry merge, no type-surface admission)
|
|
107
|
-
* for at least one minor release after `extend()` ships.
|
|
216
|
+
* @deprecated Use `createSystem().extend(source)`, which merges the
|
|
217
|
+
* source's registries. `includes` adds discovery membership only.
|
|
108
218
|
*/
|
|
109
219
|
includes?: readonly IncludableSystem[];
|
|
110
220
|
}
|
|
111
221
|
declare const STAGE_BRAND: unique symbol;
|
|
112
222
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* `'inherit'` stage; every extension call (`addGroup`, `addProps`,
|
|
116
|
-
* `addSelectors`, `addConditions`) advances to `'extend'`, making "inherit
|
|
117
|
-
* first, then extend" a compile error rather than a lint. Phantom — never
|
|
118
|
-
* present at runtime.
|
|
223
|
+
* Phantom type-state: `extend()` / `from()` are callable only in
|
|
224
|
+
* `'inherit'`, and every `add*` call advances the builder to `'extend'`.
|
|
119
225
|
*/
|
|
120
226
|
export type SystemBuilderStage = 'inherit' | 'extend';
|
|
121
|
-
export declare class SystemBuilder<PropReg extends Record<string, Prop> = {}, GroupReg extends Record<string, (keyof PropReg)[]> = {}, Conds extends string = never, Sels extends string = never, Stage extends SystemBuilderStage = 'inherit'> {
|
|
227
|
+
export declare class SystemBuilder<PropReg extends Record<string, Prop> = {}, GroupReg extends Record<string, (keyof PropReg)[]> = {}, Conds extends string = never, Sels extends string = never, Stage extends SystemBuilderStage = 'inherit', Vocab extends string = never> {
|
|
122
228
|
#private;
|
|
123
229
|
readonly [STAGE_BRAND]?: Stage;
|
|
124
|
-
constructor(propRegistry?: PropReg, groupRegistry?: GroupReg, selectorRegistry?: SelectorAliasMap, includesRegistry?: readonly IncludableSystem[], conditionRegistry?: ConditionAliasMap, extendProvenance?: ReadonlyMap<string, number>, extendCount?: number);
|
|
230
|
+
constructor(propRegistry?: PropReg, groupRegistry?: GroupReg, selectorRegistry?: SelectorAliasMap, includesRegistry?: readonly IncludableSystem[], conditionRegistry?: ConditionAliasMap, extendProvenance?: ReadonlyMap<string, number>, extendCount?: number, vocabularyRegistry?: readonly VocabularyEntryState[], vocabularyCollisions?: readonly VocabularyCollisionEntry[], legacyVerbWitnesses?: readonly VocabularyLegacyVerbEntry[]);
|
|
125
231
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* joins extraction discovery membership. NO registry merge — consumer
|
|
129
|
-
* configuration remains the singular authority, so props, groups,
|
|
130
|
-
* selectors, and conditions the source registered do not enter this
|
|
131
|
-
* builder's runtime registries. Chainable and repeatable, but only before
|
|
132
|
-
* extension calls ("inherit first, then extend" — enforced by the phantom
|
|
133
|
-
* builder stage). Accepts a built system instance or a library bundle
|
|
134
|
-
* (`{ system, tokens }`), taking the system half and ignoring the rest.
|
|
135
|
-
*
|
|
136
|
-
* @deprecated Use `extend(source)` — the single extension verb on both
|
|
137
|
-
* builders, whose type admission is backed by a real registry merge.
|
|
138
|
-
* `from()` keeps these frozen semantics (type admission + discovery
|
|
139
|
-
* membership, no merge) for at least one minor release.
|
|
232
|
+
* @deprecated Use `extend(source)`, which merges the source's registries.
|
|
233
|
+
* `from()` admits types and discovery membership only — no merge.
|
|
140
234
|
*/
|
|
141
|
-
from<SrcProps extends Record<string, Prop>, SrcGroups extends Record<string, (keyof SrcProps)[]>, SrcConds extends string = never, SrcSels extends string = never>(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit'>, source: SystemInstance<SrcProps, SrcGroups, SrcConds, SrcSels> | {
|
|
235
|
+
from<SrcProps extends Record<string, Prop>, SrcGroups extends Record<string, (keyof SrcProps)[]>, SrcConds extends string = never, SrcSels extends string = never>(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>, source: SystemInstance<SrcProps, SrcGroups, SrcConds, SrcSels> | {
|
|
142
236
|
system: SystemInstance<SrcProps, SrcGroups, SrcConds, SrcSels>;
|
|
143
237
|
theme?: unknown;
|
|
144
238
|
tokens?: unknown;
|
|
145
|
-
}): SystemBuilder<PropReg & SrcProps, GroupReg & SrcGroups, Conds | SrcConds, Sels | SrcSels, 'inherit'>;
|
|
239
|
+
}): SystemBuilder<PropReg & SrcProps, GroupReg & SrcGroups, Conds | SrcConds, Sels | SrcSels, 'inherit', Vocab>;
|
|
146
240
|
/**
|
|
147
|
-
*
|
|
148
|
-
* already erased
|
|
149
|
-
* so there is no type surface to admit — discovery and runtime semantics
|
|
150
|
-
* are identical, and the builder's own type state passes through unchanged.
|
|
151
|
-
*
|
|
152
|
-
* @deprecated Use `extend(source)` — the single extension verb on both
|
|
153
|
-
* builders, whose type admission is backed by a real registry merge.
|
|
154
|
-
* `from()` keeps these frozen semantics (type admission + discovery
|
|
155
|
-
* membership, no merge) for at least one minor release.
|
|
241
|
+
* @deprecated Use `extend(source)`. A `LibraryBundle` annotation has
|
|
242
|
+
* already erased the system half's generics — no type surface to admit.
|
|
156
243
|
*/
|
|
157
|
-
from(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit'>, source: LibraryBundle): SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit'>;
|
|
244
|
+
from(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>, source: LibraryBundle<string>): SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>;
|
|
158
245
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* the built system's type surface, `toConfig()` output, and extraction
|
|
162
|
-
* reachability describe the same configuration. Identical definitions
|
|
163
|
-
* coalesce; divergent definitions fail loud naming the entry and both
|
|
164
|
-
* origins (design D3), including a post-extend attempt to redefine an
|
|
165
|
-
* inherited prop. Local calls may add new entries and may replace inherited
|
|
166
|
-
* group membership, selectors, or conditions; prop definitions never rebind
|
|
167
|
-
* silently. Chainable and repeatable, but only before extension calls ("inherit first, then
|
|
168
|
-
* extend" — enforced by the phantom builder stage). Accepts a built system
|
|
169
|
-
* instance or a library bundle (`{ system, theme }`), taking the system
|
|
170
|
-
* half and ignoring the rest. The merge consumes the source's registry
|
|
171
|
-
* snapshot captured at its `build()` (design D7), never a serialized
|
|
172
|
-
* round-trip.
|
|
246
|
+
* Merges the source's prop, group, selector, and condition registries;
|
|
247
|
+
* identical entries coalesce, divergent ones throw naming both origins.
|
|
173
248
|
*/
|
|
174
|
-
extend<SrcProps extends Record<string, Prop>, SrcGroups extends Record<string, (keyof SrcProps)[]>, SrcConds extends string = never, SrcSels extends string = never>(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit'>, source: SystemInstance<SrcProps, SrcGroups, SrcConds, SrcSels>
|
|
175
|
-
|
|
249
|
+
extend<SrcProps extends Record<string, Prop>, SrcGroups extends Record<string, (keyof SrcProps)[]>, SrcConds extends string = never, SrcSels extends string = never, SrcVocab extends string = never>(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>, source: (SystemInstance<SrcProps, SrcGroups, SrcConds, SrcSels> & {
|
|
250
|
+
readonly [VOCABULARY_BRAND]?: SrcVocab;
|
|
251
|
+
}) | {
|
|
252
|
+
system: SystemInstance<SrcProps, SrcGroups, SrcConds, SrcSels> & {
|
|
253
|
+
readonly [VOCABULARY_BRAND]?: SrcVocab;
|
|
254
|
+
};
|
|
176
255
|
theme?: unknown;
|
|
177
256
|
tokens?: unknown;
|
|
178
|
-
}): SystemBuilder<PropReg & SrcProps, GroupReg & SrcGroups, Conds | SrcConds, Sels | SrcSels, 'inherit'>;
|
|
257
|
+
}): SystemBuilder<PropReg & SrcProps, GroupReg & SrcGroups, Conds | SrcConds, Sels | SrcSels, 'inherit', Vocab | SrcVocab>;
|
|
179
258
|
/**
|
|
180
|
-
* A
|
|
181
|
-
*
|
|
182
|
-
* so no source types are admitted — the runtime merge is identical, and
|
|
183
|
-
* the builder's own type state passes through unchanged.
|
|
259
|
+
* A `LibraryBundle` annotation has erased the system half's generics: the
|
|
260
|
+
* runtime merge is identical, but no source types are admitted.
|
|
184
261
|
*/
|
|
185
|
-
extend(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit'>, source: LibraryBundle): SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit'>;
|
|
262
|
+
extend<SrcVocab extends string = never>(this: SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab>, source: LibraryBundle<SrcVocab>): SystemBuilder<PropReg, GroupReg, Conds, Sels, 'inherit', Vocab | SrcVocab>;
|
|
186
263
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
* CONDITION registry (built-in or registered earlier in this chain) maps to
|
|
190
|
-
* the branded `ReservedByConditionRegistry` instead of its selector string —
|
|
191
|
-
* the compile-time complement of the cross-registry throw below. The clash is
|
|
192
|
-
* checked in VALUE position so `S` stays a naked inference site; subtracting
|
|
193
|
-
* the reserved names from the KEY position is impossible — `Exclude` is a
|
|
194
|
-
* silent no-op against a template-literal pattern. `NarrowedAliases` keeps a
|
|
195
|
-
* widened `Conds` from swallowing the whole `_` namespace.
|
|
196
|
-
*
|
|
197
|
-
* It wraps the ACCUMULATION too: a widened registration contributes nothing
|
|
198
|
-
* to `Sels` rather than widening it, so the pattern can never reach the
|
|
199
|
-
* published `RegistryBrand` — see `addConditions` for the full argument.
|
|
264
|
+
* Registers `_` aliases → `&`-relative selectors. The cross-registry clash
|
|
265
|
+
* is checked in VALUE position: `Exclude` on a `_${string}` key is a no-op.
|
|
200
266
|
*/
|
|
201
267
|
addSelectors<S extends Record<`_${string}`, string>>(selectors: S & {
|
|
202
268
|
[K in keyof S]: K extends BuiltInConditionAlias | NarrowedAliases<Conds> ? ReservedByConditionRegistry<K & string> : S[K];
|
|
203
|
-
}): SystemBuilder<PropReg, GroupReg, Conds, Sels | NarrowedAliases<Extract<keyof S, string>>, 'extend'>;
|
|
269
|
+
}): SystemBuilder<PropReg, GroupReg, Conds, Sels | NarrowedAliases<Extract<keyof S, string>>, 'extend', Vocab>;
|
|
204
270
|
/**
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
* Recognized as block keys in style objects; user aliases override built-ins
|
|
208
|
-
* of the same name (design D3). Keys are constrained to `_`-prefixed aliases
|
|
209
|
-
* and values to `@`-prefixed at-rule strings — a value that does not begin
|
|
210
|
-
* with an at-rule name is a compile-time type error (design D9; the runtime
|
|
211
|
-
* `inferConditionKind` throw is defense-in-depth). The registered keys are
|
|
212
|
-
* accumulated into the phantom `Conds` union and surfaced on `build()`.
|
|
213
|
-
*
|
|
214
|
-
* A key owned by the SELECTOR registry (built-in or registered earlier in
|
|
215
|
-
* this chain) maps to the branded `ReservedBySelectorRegistry` — see
|
|
216
|
-
* `addSelectors` for why the clash is checked in value position. Overriding a
|
|
217
|
-
* built-in CONDITION alias stays legal (design D3); only the OPPOSITE
|
|
218
|
-
* registry is subtracted.
|
|
219
|
-
*
|
|
220
|
-
* `NarrowedAliases` wraps the ACCUMULATION, not just the gate: a widened
|
|
221
|
-
* registration (`Record<`_${string}`, …>`) contributes nothing to `Conds`.
|
|
222
|
-
* Accumulating the pattern instead would carry it out through `build()`'s
|
|
223
|
-
* `RegistryBrand`, and a consumer publishing `ConditionsOf` into the
|
|
224
|
-
* augmentable `Conditions` interface would then have every `_` key type as
|
|
225
|
-
* registered — `UnknownConditionAlias` would never fire again, anywhere in
|
|
226
|
-
* that project. The gate keeps its own `NarrowedAliases` regardless:
|
|
227
|
-
* `extend()`-sourced unions can still arrive widened from a system built
|
|
228
|
-
* before this narrowing.
|
|
271
|
+
* Registers `_` aliases → at-rule strings; user aliases override built-ins
|
|
272
|
+
* of the same name. A selector-owned key maps to the branded rejection.
|
|
229
273
|
*/
|
|
230
274
|
addConditions<C extends Record<`_${string}`, AtRuleValue>>(conditions: C & {
|
|
231
275
|
[K in keyof C]: K extends BuiltInSelectorAlias | NarrowedAliases<Sels> ? ReservedBySelectorRegistry<K & string> : C[K];
|
|
232
|
-
}): SystemBuilder<PropReg, GroupReg, Conds | NarrowedAliases<Extract<keyof C, string>>, Sels, 'extend'>;
|
|
233
|
-
addGroup<Name extends string, Conf extends Record<string, Prop>>(name: Name extends keyof PropReg ? never : Name, config: Conf): SystemBuilder<PropReg & Conf, GroupReg & Record<Name, (keyof Conf)[]>, Conds, Sels, 'extend'>;
|
|
234
|
-
addProps<Conf extends Record<string, Prop> & Partial<Record<Extract<keyof GroupReg, string>, never>>>(config: Conf): SystemBuilder<PropReg & Conf, GroupReg, Conds, Sels, 'extend'>;
|
|
235
|
-
build():
|
|
236
|
-
system: SystemInstance<PropReg, GroupReg, Conds, Sels>;
|
|
237
|
-
createGlobalStyles: GlobalStylesFactory<PropReg>;
|
|
238
|
-
createKeyframes: CreateKeyframesFactory<PropReg>;
|
|
239
|
-
};
|
|
276
|
+
}): SystemBuilder<PropReg, GroupReg, Conds | NarrowedAliases<Extract<keyof C, string>>, Sels, 'extend', Vocab>;
|
|
277
|
+
addGroup<Name extends string, Conf extends Record<string, Prop>>(name: Name extends keyof PropReg ? never : Name, config: Conf): SystemBuilder<PropReg & Conf, GroupReg & Record<Name, (keyof Conf)[]>, Conds, Sels, 'extend', Vocab>;
|
|
278
|
+
addProps<Conf extends Record<string, Prop> & Partial<Record<Extract<keyof GroupReg, string>, never>>>(config: Conf): SystemBuilder<PropReg & Conf, GroupReg, Conds, Sels, 'extend', Vocab>;
|
|
279
|
+
build(): SystemBundle<PropReg, GroupReg, Conds, Sels, Vocab>;
|
|
240
280
|
}
|
|
241
281
|
export type SystemInstance<PropReg extends Record<string, Prop>, GroupReg extends Record<string, (keyof PropReg)[]>, Conds extends string = never, Sels extends string = never> = Animus<PropReg, GroupReg> & {
|
|
242
282
|
toConfig(): SerializedConfig;
|
|
243
283
|
/**
|
|
244
|
-
* Frozen registry state captured at `build()` (
|
|
245
|
-
*
|
|
246
|
-
* version; optional in the type so systems built by an older
|
|
247
|
-
* @animus-ui/system stay structurally acceptable to `from()` during the
|
|
248
|
-
* deprecation window.
|
|
284
|
+
* Frozen registry state captured at `build()` — what `extend()` merges
|
|
285
|
+
* from. Optional only for systems built by an older @animus-ui/system.
|
|
249
286
|
*/
|
|
250
287
|
getRegistrySnapshot?(): RegistrySnapshot;
|
|
251
288
|
} & RegistryBrand<Conds, Sels>;
|
|
@@ -254,20 +291,12 @@ export interface SerializedConfig {
|
|
|
254
291
|
groupRegistry: string;
|
|
255
292
|
transforms: Record<string, NamedTransform>;
|
|
256
293
|
/**
|
|
257
|
-
* `{ transformName: sourceText }`
|
|
258
|
-
*
|
|
259
|
-
* transforms shipped inside a package (rather than declared via a
|
|
260
|
-
* `createTransform()` call the extractor can parse out of a project file)
|
|
261
|
-
* reach the build-time evaluator.
|
|
294
|
+
* `{ transformName: sourceText }` — the only channel by which transforms
|
|
295
|
+
* shipped inside a package reach the build-time evaluator.
|
|
262
296
|
*/
|
|
263
297
|
transformSources: string;
|
|
264
298
|
selectorAliases: string;
|
|
265
|
-
/**
|
|
266
|
-
* Condition alias map JSON (inc 03 — NEW field): `alias → { value, order,
|
|
267
|
-
* kind }`. `"{}"` when the system registers no conditions (built-ins are
|
|
268
|
-
* empty this increment). Distinct from `selectorAliases`, which stays
|
|
269
|
-
* byte-for-byte unchanged.
|
|
270
|
-
*/
|
|
299
|
+
/** Condition alias map JSON: `alias → { value, order, kind }`. */
|
|
271
300
|
conditionAliases: string;
|
|
272
301
|
}
|
|
273
302
|
export declare function createSystem(config?: CreateSystemConfig): SystemBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemBuilder.d.ts","sourceRoot":"","sources":["../src/SystemBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAEhC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAEf,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,cAAc,EAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,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,kBAAkB,GAAG,aAAa,CAmBvE"}
|
|
@@ -1,75 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Appearance record write path — the CLIENT half of the contract the generated
|
|
3
|
-
* bootstrap reads (openspec: color-mode-bootstrap, "Appearance record
|
|
4
|
-
* contract").
|
|
5
|
-
*
|
|
6
|
-
* This module is runtime application code: it ships in client bundles and owns
|
|
7
|
-
* only the record WRITE path. It deliberately imports nothing from
|
|
8
|
-
* `@animus-ui/system/bootstrap` — that subpath is build tooling, reaches
|
|
9
|
-
* `node:crypto`, and must never enter an application bundle — so the two
|
|
10
|
-
* modules re-state the key and shape they agree on, and the round-trip tests
|
|
11
|
-
* pin the agreement (a record written here is restored by the generated
|
|
12
|
-
* snippet).
|
|
13
|
-
*
|
|
14
|
-
* Record: `animus:appearance` → `{"v":1,"mode":…,"theme":…}`.
|
|
15
|
-
*
|
|
16
|
-
* Two axes share one record. A writer that changes ONE axis reads, modifies
|
|
17
|
-
* and writes back, so fields it does not own (`theme`, plus anything a future
|
|
18
|
-
* version adds) survive untouched.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Mode value meaning "follow the OS". It is never a declared mode and never
|
|
22
|
-
* reaches `data-color-mode` — the OS is followed by the attribute's ABSENCE,
|
|
23
|
-
* which the generated bootstrap restores when it reads this value.
|
|
24
|
-
*/
|
|
25
1
|
export declare const SYSTEM_MODE = "system";
|
|
26
2
|
export interface AppearanceStorageOptions {
|
|
27
|
-
/**
|
|
28
|
-
* Overrides the record key. MUST match the `storageKey` the bootstrap
|
|
29
|
-
* artifact was generated with, or the snippet restores from a key this
|
|
30
|
-
* module never writes. Defaults to `animus:appearance`.
|
|
31
|
-
*/
|
|
32
3
|
storageKey?: string;
|
|
33
4
|
}
|
|
34
|
-
/**
|
|
35
|
-
* Persists the mode axis, preserving every field this call does not own
|
|
36
|
-
* (`v`, `theme`, and any additional keys already in the record).
|
|
37
|
-
*
|
|
38
|
-
* Pass {@link SYSTEM_MODE} to persist "follow the OS" — the generated
|
|
39
|
-
* bootstrap restores it as attribute absence. Applying the mode to the
|
|
40
|
-
* document (setting or removing `data-color-mode`) stays the caller's job:
|
|
41
|
-
* this module is storage-only and never touches the DOM.
|
|
42
|
-
*
|
|
43
|
-
* REFUSAL RULE: when the stored record carries a version this code does not
|
|
44
|
-
* understand, NOTHING is written. Downgrading it to a v1 shape would drop
|
|
45
|
-
* whatever fields the newer writer keeps there, and this axis is not worth
|
|
46
|
-
* that. A caller that has already updated the attribute keeps the user's
|
|
47
|
-
* choice for the session — only its persistence is skipped.
|
|
48
|
-
*
|
|
49
|
-
* Storage failures are likewise swallowed: persistence is a convenience, and
|
|
50
|
-
* the attribute write that accompanies it has already taken effect.
|
|
51
|
-
*/
|
|
52
5
|
export declare function persistColorMode(mode: string, options?: AppearanceStorageOptions): void;
|
|
53
|
-
/**
|
|
54
|
-
* One-shot migration of an application's OWN historical mode key into the
|
|
55
|
-
* record.
|
|
56
|
-
*
|
|
57
|
-
* The generated bootstrap only knows the record and the contract's `color-mode`
|
|
58
|
-
* key — an app that persisted under its own key before adopting the record
|
|
59
|
-
* would silently drop every returning visitor's mode without this. Run it
|
|
60
|
-
* post-paint from the app entry: the visit on which it migrates still paints
|
|
61
|
-
* in the OS-resolved mode before correcting itself — one accepted flash, once
|
|
62
|
-
* — and every later load restores pre-paint through the bootstrap.
|
|
63
|
-
*
|
|
64
|
-
* It writes only when there is nothing to lose (no record) and something worth
|
|
65
|
-
* keeping (a value in `declaredModes`), then DELETES the old key so the
|
|
66
|
-
* migration cannot run twice or resurrect a stale value. Deleting is
|
|
67
|
-
* legitimate precisely because the key is the application's own; the
|
|
68
|
-
* contract's `color-mode` key may belong to another app on this origin and is
|
|
69
|
-
* refused, as is the record key itself.
|
|
70
|
-
*
|
|
71
|
-
* @returns the migrated mode name, so the caller can apply it to the document
|
|
72
|
-
* for this one visit, or `null` when nothing was migrated.
|
|
73
|
-
*/
|
|
74
6
|
export declare function migrateLegacyModeKey(legacyKey: string, declaredModes: readonly string[], options?: AppearanceStorageOptions): string | null;
|
|
75
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appearance/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/appearance/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,WAAW,CAAC;AAQpC,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkDD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,wBAAwB,GACjC,IAAI,CASN;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,OAAO,CAAC,EAAE,wBAAwB,GACjC,MAAM,GAAG,IAAI,CA6Cf"}
|