zyzz 0.0.8 → 0.0.11
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 +8 -8
- package/dist/Style.d.ts +2 -2
- package/dist/Style.d.ts.map +1 -1
- package/dist/Style.js +6 -6
- package/dist/Style.js.map +1 -1
- package/dist/Vars.d.ts +2 -2
- package/dist/Vars.d.ts.map +1 -1
- package/dist/Vars.js.map +1 -1
- package/dist/compiler/Source.d.ts.map +1 -1
- package/dist/compiler/Source.js +10 -0
- package/dist/compiler/Source.js.map +1 -1
- package/dist/compiler/internal/Contract.d.ts.map +1 -1
- package/dist/compiler/internal/Contract.js +11 -6
- package/dist/compiler/internal/Contract.js.map +1 -1
- package/dist/compiler/internal/Contributions.d.ts.map +1 -1
- package/dist/compiler/internal/Contributions.js +592 -556
- package/dist/compiler/internal/Contributions.js.map +1 -1
- package/dist/compiler/internal/Expression.d.ts +4 -0
- package/dist/compiler/internal/Expression.d.ts.map +1 -1
- package/dist/compiler/internal/Expression.js +45 -0
- package/dist/compiler/internal/Expression.js.map +1 -1
- package/dist/compiler/internal/RecipeConditions.js +2 -2
- package/dist/compiler/internal/RecipeConditions.js.map +1 -1
- package/dist/compiler/internal/Themes.d.ts.map +1 -1
- package/dist/compiler/internal/Themes.js +2 -0
- package/dist/compiler/internal/Themes.js.map +1 -1
- package/dist/default.d.ts +75 -19
- package/dist/default.d.ts.map +1 -1
- package/dist/default.js +76 -11
- package/dist/default.js.map +2 -2
- package/dist/default.js.zyzz.json +1 -1
- package/dist/internal/Condition.d.ts +1 -1
- package/dist/internal/Condition.d.ts.map +1 -1
- package/dist/internal/Configuration.js +2 -2
- package/dist/internal/Configuration.js.map +1 -1
- package/dist/internal/Query.d.ts +2 -2
- package/dist/internal/Query.d.ts.map +1 -1
- package/dist/internal/Query.js +1 -1
- package/dist/internal/Query.js.map +1 -1
- package/dist/internal/Theme.d.ts +4 -4
- package/dist/internal/Theme.d.ts.map +1 -1
- package/dist/internal/Theme.js +6 -6
- package/dist/internal/Theme.js.map +1 -1
- package/dist/internal/Token.d.ts +185 -2
- package/dist/internal/Token.d.ts.map +1 -1
- package/dist/internal/Token.js +236 -23
- package/dist/internal/Token.js.map +1 -1
- package/dist/internal/Value.d.ts +5 -5
- package/dist/internal/Value.d.ts.map +1 -1
- package/dist/internal/Value.js +18 -64
- package/dist/internal/Value.js.map +1 -1
- package/dist/internal/VariableSets.d.ts.map +1 -1
- package/dist/internal/VariableSets.js +9 -6
- package/dist/internal/VariableSets.js.map +1 -1
- package/dist/unplugin/index.d.ts.map +1 -1
- package/dist/unplugin/index.js +17 -4
- package/dist/unplugin/index.js.map +1 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +112 -24
- package/dist/vite/index.js.map +1 -1
- package/dist/web/colorProfile.d.ts +9 -5
- package/dist/web/colorProfile.d.ts.map +1 -1
- package/dist/web/colorProfile.js.map +1 -1
- package/dist/web/counterStyle.d.ts +13 -9
- package/dist/web/counterStyle.d.ts.map +1 -1
- package/dist/web/counterStyle.js.map +1 -1
- package/dist/web/cssFunction.d.ts +19 -14
- package/dist/web/cssFunction.d.ts.map +1 -1
- package/dist/web/cssFunction.js.map +1 -1
- package/dist/web/fontFace.d.ts +6 -1
- package/dist/web/fontFace.d.ts.map +1 -1
- package/dist/web/fontFace.js.map +1 -1
- package/dist/web/fontFeatureValues.d.ts +11 -7
- package/dist/web/fontFeatureValues.d.ts.map +1 -1
- package/dist/web/fontFeatureValues.js.map +1 -1
- package/dist/web/fontPaletteValues.d.ts +8 -3
- package/dist/web/fontPaletteValues.d.ts.map +1 -1
- package/dist/web/fontPaletteValues.js.map +1 -1
- package/dist/web/internal/Context.d.ts +3 -3
- package/dist/web/internal/Context.d.ts.map +1 -1
- package/dist/web/keyframes.d.ts +7 -3
- package/dist/web/keyframes.d.ts.map +1 -1
- package/dist/web/keyframes.js.map +1 -1
- package/dist/web/page.d.ts +11 -4
- package/dist/web/page.d.ts.map +1 -1
- package/dist/web/page.js.map +1 -1
- package/dist/web/positionTry.d.ts +6 -1
- package/dist/web/positionTry.d.ts.map +1 -1
- package/dist/web/positionTry.js.map +1 -1
- package/dist/web/property.d.ts +10 -5
- package/dist/web/property.d.ts.map +1 -1
- package/dist/web/property.js.map +1 -1
- package/dist/web/viewTransition.d.ts +10 -6
- package/dist/web/viewTransition.d.ts.map +1 -1
- package/dist/web/viewTransition.js.map +1 -1
- package/package.json +1 -1
- package/src/Style.ts +8 -8
- package/src/Vars.ts +2 -3
- package/src/compiler/Source.ts +19 -0
- package/src/compiler/internal/Contract.ts +19 -8
- package/src/compiler/internal/Contributions.ts +734 -685
- package/src/compiler/internal/Expression.ts +57 -0
- package/src/compiler/internal/RecipeConditions.ts +2 -2
- package/src/compiler/internal/Themes.ts +2 -0
- package/src/default.ts +175 -30
- package/src/internal/Condition.ts +3 -3
- package/src/internal/Configuration.ts +2 -2
- package/src/internal/Query.ts +3 -3
- package/src/internal/Theme.ts +12 -12
- package/src/internal/Token.ts +253 -33
- package/src/internal/Value.ts +40 -88
- package/src/internal/VariableSets.ts +28 -25
- package/src/unplugin/index.ts +16 -3
- package/src/vite/index.ts +138 -32
- package/src/web/colorProfile.ts +25 -10
- package/src/web/counterStyle.ts +29 -14
- package/src/web/cssFunction.ts +47 -24
- package/src/web/fontFace.ts +16 -3
- package/src/web/fontFeatureValues.ts +35 -18
- package/src/web/fontPaletteValues.ts +25 -11
- package/src/web/internal/Context.ts +9 -3
- package/src/web/keyframes.ts +24 -9
- package/src/web/page.ts +22 -5
- package/src/web/positionTry.ts +20 -5
- package/src/web/property.ts +23 -9
- package/src/web/viewTransition.ts +28 -13
package/src/web/keyframes.ts
CHANGED
|
@@ -7,15 +7,7 @@ import type * as Value from '../internal/Value.js'
|
|
|
7
7
|
|
|
8
8
|
/** Compiles ordered frame stops and returns a fixed animation name. */
|
|
9
9
|
export function keyframes<const frames extends Record<string, unknown>>(
|
|
10
|
-
frames: frames &
|
|
11
|
-
NoInfer<{
|
|
12
|
-
[key in keyof frames]: key extends string
|
|
13
|
-
? Stops<Lexical.Fold<Lexical.Normalized<key>>> extends true
|
|
14
|
-
? Value.Accepted<frames[key], Style.DeclarationProperties> &
|
|
15
|
-
Value.Checked<frames[key]>
|
|
16
|
-
: never
|
|
17
|
-
: never
|
|
18
|
-
}>,
|
|
10
|
+
frames: frames & NoInfer<Accepted<frames>>,
|
|
19
11
|
context: Context.Options = {},
|
|
20
12
|
): string {
|
|
21
13
|
void context
|
|
@@ -41,3 +33,26 @@ type Stops<value extends string> = value extends `${infer first},${infer rest}`
|
|
|
41
33
|
| `${'contain' | 'cover' | 'entry' | 'entry-crossing' | 'exit' | 'exit-crossing'}${Space}${number}%`
|
|
42
34
|
? true
|
|
43
35
|
: false
|
|
36
|
+
|
|
37
|
+
type Accepted<input> = {
|
|
38
|
+
[key in keyof input as key extends Context.Group ? key : never]: Accepted<
|
|
39
|
+
input[key]
|
|
40
|
+
>
|
|
41
|
+
} & (keyof input extends never
|
|
42
|
+
? Definition<input>
|
|
43
|
+
: Exclude<keyof input, Context.Group> extends never
|
|
44
|
+
? unknown
|
|
45
|
+
: Definition<Omit<input, Context.Group>>)
|
|
46
|
+
|
|
47
|
+
type Definition<frames> =
|
|
48
|
+
frames extends Record<string, unknown>
|
|
49
|
+
? frames &
|
|
50
|
+
NoInfer<{
|
|
51
|
+
[key in keyof frames]: key extends string
|
|
52
|
+
? Stops<Lexical.Fold<Lexical.Normalized<key>>> extends true
|
|
53
|
+
? Value.Accepted<frames[key], Style.DeclarationProperties> &
|
|
54
|
+
Value.Checked<frames[key]>
|
|
55
|
+
: never
|
|
56
|
+
: never
|
|
57
|
+
}>
|
|
58
|
+
: never
|
package/src/web/page.ts
CHANGED
|
@@ -5,11 +5,8 @@ import type * as Literal from '../internal/Literal.js'
|
|
|
5
5
|
import type * as Style from '../Style.js'
|
|
6
6
|
|
|
7
7
|
/** Emits an eager page rule, optionally selecting named pages or page pseudo-classes. */
|
|
8
|
-
export function page<const
|
|
9
|
-
options:
|
|
10
|
-
readonly descriptors: descriptors & NoInfer<page.Body<descriptors>>
|
|
11
|
-
readonly selector?: string | undefined
|
|
12
|
-
},
|
|
8
|
+
export function page<const options extends Record<string, unknown>>(
|
|
9
|
+
options: options & NoInfer<Accepted<options>>,
|
|
13
10
|
context: Context.Options = {},
|
|
14
11
|
): void {
|
|
15
12
|
void options
|
|
@@ -138,3 +135,23 @@ type Keyword<value extends string> =
|
|
|
138
135
|
: value extends `${infer rest}${' ' | '\t' | '\n' | '\r' | '\f'}`
|
|
139
136
|
? Keyword<rest>
|
|
140
137
|
: Lexical.Fold<Lexical.Normalized<value>>
|
|
138
|
+
|
|
139
|
+
type Accepted<input> = {
|
|
140
|
+
[key in keyof input as key extends Context.Group ? key : never]: Accepted<
|
|
141
|
+
input[key]
|
|
142
|
+
>
|
|
143
|
+
} & (keyof input extends never
|
|
144
|
+
? Definition<input>
|
|
145
|
+
: Exclude<keyof input, Context.Group> extends never
|
|
146
|
+
? unknown
|
|
147
|
+
: Definition<Omit<input, Context.Group>>)
|
|
148
|
+
|
|
149
|
+
type Definition<input> = input extends {
|
|
150
|
+
readonly descriptors: infer descriptors
|
|
151
|
+
readonly selector?: string | undefined
|
|
152
|
+
}
|
|
153
|
+
? {
|
|
154
|
+
readonly descriptors: descriptors & NoInfer<page.Body<descriptors>>
|
|
155
|
+
readonly selector?: string | undefined
|
|
156
|
+
} & Record<Exclude<keyof input, 'descriptors' | 'selector'>, never>
|
|
157
|
+
: never
|
package/src/web/positionTry.ts
CHANGED
|
@@ -7,11 +7,7 @@ import type * as Context from './internal/Context.js'
|
|
|
7
7
|
|
|
8
8
|
/** Emits the restricted position-try declaration set and returns its CSS name. */
|
|
9
9
|
export function positionTry<const declarations extends Record<string, unknown>>(
|
|
10
|
-
declarations: declarations &
|
|
11
|
-
NoInfer<
|
|
12
|
-
Value.Accepted<declarations, positionTry.Declarations> &
|
|
13
|
-
Value.Checked<declarations>
|
|
14
|
-
>,
|
|
10
|
+
declarations: declarations & NoInfer<Accepted<declarations>>,
|
|
15
11
|
context: Context.Options = {},
|
|
16
12
|
): positionTry.Reference {
|
|
17
13
|
void declarations
|
|
@@ -69,3 +65,22 @@ export declare namespace positionTry {
|
|
|
69
65
|
/** Compiler-owned position fallback name. */
|
|
70
66
|
type Reference = RuleReference.Reference<'positionTry'>
|
|
71
67
|
}
|
|
68
|
+
|
|
69
|
+
type Accepted<input> = {
|
|
70
|
+
[key in keyof input as key extends Context.Group ? key : never]: Accepted<
|
|
71
|
+
input[key]
|
|
72
|
+
>
|
|
73
|
+
} & (keyof input extends never
|
|
74
|
+
? Definition<input>
|
|
75
|
+
: Exclude<keyof input, Context.Group> extends never
|
|
76
|
+
? unknown
|
|
77
|
+
: Definition<Omit<input, Context.Group>>)
|
|
78
|
+
|
|
79
|
+
type Definition<declarations> =
|
|
80
|
+
declarations extends Record<string, unknown>
|
|
81
|
+
? declarations &
|
|
82
|
+
NoInfer<
|
|
83
|
+
Value.Accepted<declarations, positionTry.Declarations> &
|
|
84
|
+
Value.Checked<declarations>
|
|
85
|
+
>
|
|
86
|
+
: never
|
package/src/web/property.ts
CHANGED
|
@@ -3,15 +3,8 @@ import type * as Context from './internal/Context.js'
|
|
|
3
3
|
import type * as FunctionSyntax from '../internal/FunctionSyntax.js'
|
|
4
4
|
|
|
5
5
|
/** Emits an eager registration; initial values are checked by the compiler. */
|
|
6
|
-
export function property<const options extends
|
|
7
|
-
options: options &
|
|
8
|
-
Record<Exclude<keyof options, keyof property.Options>, never> & {
|
|
9
|
-
readonly syntax: FunctionSyntax.Checked<`type(${options['syntax']})`> extends never
|
|
10
|
-
? never
|
|
11
|
-
: options['syntax']
|
|
12
|
-
} & (options['syntax'] extends '*'
|
|
13
|
-
? unknown
|
|
14
|
-
: { readonly initialValue: string | number }),
|
|
6
|
+
export function property<const options extends Record<string, unknown>>(
|
|
7
|
+
options: options & NoInfer<Accepted<options>>,
|
|
15
8
|
context: Context.Options = {},
|
|
16
9
|
): void {
|
|
17
10
|
void options
|
|
@@ -33,3 +26,24 @@ export declare namespace property {
|
|
|
33
26
|
readonly syntax: string
|
|
34
27
|
}
|
|
35
28
|
}
|
|
29
|
+
|
|
30
|
+
type Accepted<input> = {
|
|
31
|
+
[key in keyof input as key extends Context.Group ? key : never]: Accepted<
|
|
32
|
+
input[key]
|
|
33
|
+
>
|
|
34
|
+
} & (keyof input extends never
|
|
35
|
+
? Definition<input>
|
|
36
|
+
: Exclude<keyof input, Context.Group> extends never
|
|
37
|
+
? unknown
|
|
38
|
+
: Definition<Omit<input, Context.Group>>)
|
|
39
|
+
|
|
40
|
+
type Definition<options> = options extends property.Options
|
|
41
|
+
? options &
|
|
42
|
+
Record<Exclude<keyof options, keyof property.Options>, never> & {
|
|
43
|
+
readonly syntax: FunctionSyntax.Checked<`type(${options['syntax']})`> extends never
|
|
44
|
+
? never
|
|
45
|
+
: options['syntax']
|
|
46
|
+
} & (options['syntax'] extends '*'
|
|
47
|
+
? unknown
|
|
48
|
+
: { readonly initialValue: string | number })
|
|
49
|
+
: never
|
|
@@ -3,19 +3,8 @@ import type * as Context from './internal/Context.js'
|
|
|
3
3
|
import type * as Lexical from '../internal/Lexical.js'
|
|
4
4
|
|
|
5
5
|
/** Emits an eager view-transition rule; browser navigation owns transition execution. */
|
|
6
|
-
export function viewTransition<
|
|
7
|
-
|
|
8
|
-
readonly navigation?: string | undefined
|
|
9
|
-
},
|
|
10
|
-
>(
|
|
11
|
-
options: options &
|
|
12
|
-
Record<Exclude<keyof options, keyof viewTransition.Options>, never> & {
|
|
13
|
-
readonly types?: NoInfer<Types<options['types']>>
|
|
14
|
-
readonly navigation?: Checked<
|
|
15
|
-
options['navigation'],
|
|
16
|
-
Exclude<viewTransition.Options['navigation'], undefined>
|
|
17
|
-
>
|
|
18
|
-
},
|
|
6
|
+
export function viewTransition<const options extends Record<string, unknown>>(
|
|
7
|
+
options: options & NoInfer<Accepted<options>>,
|
|
19
8
|
context: Context.Options = {},
|
|
20
9
|
): void {
|
|
21
10
|
void options
|
|
@@ -87,3 +76,29 @@ type Name<value extends string> = value extends
|
|
|
87
76
|
| 'unset'
|
|
88
77
|
? false
|
|
89
78
|
: true
|
|
79
|
+
|
|
80
|
+
type Accepted<input> = {
|
|
81
|
+
[key in keyof input as key extends Context.Group ? key : never]: Accepted<
|
|
82
|
+
input[key]
|
|
83
|
+
>
|
|
84
|
+
} & (keyof input extends never
|
|
85
|
+
? Definition<input>
|
|
86
|
+
: Exclude<keyof input, Context.Group> extends never
|
|
87
|
+
? unknown
|
|
88
|
+
: Definition<Omit<input, Context.Group>>)
|
|
89
|
+
|
|
90
|
+
type Definition<options> = options extends Omit<
|
|
91
|
+
viewTransition.Options,
|
|
92
|
+
'navigation'
|
|
93
|
+
> & {
|
|
94
|
+
readonly navigation?: string | undefined
|
|
95
|
+
}
|
|
96
|
+
? options &
|
|
97
|
+
Record<Exclude<keyof options, keyof viewTransition.Options>, never> & {
|
|
98
|
+
readonly types?: NoInfer<Types<options['types']>>
|
|
99
|
+
readonly navigation?: Checked<
|
|
100
|
+
options['navigation'],
|
|
101
|
+
Exclude<viewTransition.Options['navigation'], undefined>
|
|
102
|
+
>
|
|
103
|
+
}
|
|
104
|
+
: never
|