@tekton-ui/core 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +758 -0
- package/dist/blueprint.d.ts +44 -0
- package/dist/blueprint.d.ts.map +1 -0
- package/dist/blueprint.js +163 -0
- package/dist/blueprint.js.map +1 -0
- package/dist/component-schemas.d.ts +78 -0
- package/dist/component-schemas.d.ts.map +1 -0
- package/dist/component-schemas.js +1037 -0
- package/dist/component-schemas.js.map +1 -0
- package/dist/css-generator.d.ts +42 -0
- package/dist/css-generator.d.ts.map +1 -0
- package/dist/css-generator.js +339 -0
- package/dist/css-generator.js.map +1 -0
- package/dist/icon-library.d.ts +109 -0
- package/dist/icon-library.d.ts.map +1 -0
- package/dist/icon-library.js +204 -0
- package/dist/icon-library.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/layout-css-generator.d.ts +158 -0
- package/dist/layout-css-generator.d.ts.map +1 -0
- package/dist/layout-css-generator.js +901 -0
- package/dist/layout-css-generator.js.map +1 -0
- package/dist/layout-resolver.d.ts +92 -0
- package/dist/layout-resolver.d.ts.map +1 -0
- package/dist/layout-resolver.js +275 -0
- package/dist/layout-resolver.js.map +1 -0
- package/dist/layout-tokens/index.d.ts +16 -0
- package/dist/layout-tokens/index.d.ts.map +1 -0
- package/dist/layout-tokens/index.js +16 -0
- package/dist/layout-tokens/index.js.map +1 -0
- package/dist/layout-tokens/keyboard.d.ts +254 -0
- package/dist/layout-tokens/keyboard.d.ts.map +1 -0
- package/dist/layout-tokens/keyboard.js +407 -0
- package/dist/layout-tokens/keyboard.js.map +1 -0
- package/dist/layout-tokens/mobile-shells.d.ts +78 -0
- package/dist/layout-tokens/mobile-shells.d.ts.map +1 -0
- package/dist/layout-tokens/mobile-shells.js +635 -0
- package/dist/layout-tokens/mobile-shells.js.map +1 -0
- package/dist/layout-tokens/pages.d.ts +100 -0
- package/dist/layout-tokens/pages.d.ts.map +1 -0
- package/dist/layout-tokens/pages.js +576 -0
- package/dist/layout-tokens/pages.js.map +1 -0
- package/dist/layout-tokens/responsive.d.ts +109 -0
- package/dist/layout-tokens/responsive.d.ts.map +1 -0
- package/dist/layout-tokens/responsive.js +167 -0
- package/dist/layout-tokens/responsive.js.map +1 -0
- package/dist/layout-tokens/safe-area.d.ts +156 -0
- package/dist/layout-tokens/safe-area.d.ts.map +1 -0
- package/dist/layout-tokens/safe-area.js +316 -0
- package/dist/layout-tokens/safe-area.js.map +1 -0
- package/dist/layout-tokens/sections-advanced.d.ts +277 -0
- package/dist/layout-tokens/sections-advanced.d.ts.map +1 -0
- package/dist/layout-tokens/sections-advanced.js +593 -0
- package/dist/layout-tokens/sections-advanced.js.map +1 -0
- package/dist/layout-tokens/sections.d.ts +137 -0
- package/dist/layout-tokens/sections.d.ts.map +1 -0
- package/dist/layout-tokens/sections.js +694 -0
- package/dist/layout-tokens/sections.js.map +1 -0
- package/dist/layout-tokens/shells.d.ts +77 -0
- package/dist/layout-tokens/shells.d.ts.map +1 -0
- package/dist/layout-tokens/shells.js +408 -0
- package/dist/layout-tokens/shells.js.map +1 -0
- package/dist/layout-tokens/touch-target.d.ts +119 -0
- package/dist/layout-tokens/touch-target.d.ts.map +1 -0
- package/dist/layout-tokens/touch-target.js +156 -0
- package/dist/layout-tokens/touch-target.js.map +1 -0
- package/dist/layout-tokens/types.d.ts +632 -0
- package/dist/layout-tokens/types.d.ts.map +1 -0
- package/dist/layout-tokens/types.js +49 -0
- package/dist/layout-tokens/types.js.map +1 -0
- package/dist/layout-validation.d.ts +1547 -0
- package/dist/layout-validation.d.ts.map +1 -0
- package/dist/layout-validation.js +628 -0
- package/dist/layout-validation.js.map +1 -0
- package/dist/render.d.ts +23 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +244 -0
- package/dist/render.js.map +1 -0
- package/dist/schema-validation.d.ts +208 -0
- package/dist/schema-validation.d.ts.map +1 -0
- package/dist/schema-validation.js +205 -0
- package/dist/schema-validation.js.map +1 -0
- package/dist/screen-generation/generators/css-in-js-generator.d.ts +82 -0
- package/dist/screen-generation/generators/css-in-js-generator.d.ts.map +1 -0
- package/dist/screen-generation/generators/css-in-js-generator.js +335 -0
- package/dist/screen-generation/generators/css-in-js-generator.js.map +1 -0
- package/dist/screen-generation/generators/index.d.ts +13 -0
- package/dist/screen-generation/generators/index.d.ts.map +1 -0
- package/dist/screen-generation/generators/index.js +32 -0
- package/dist/screen-generation/generators/index.js.map +1 -0
- package/dist/screen-generation/generators/react-generator.d.ts +100 -0
- package/dist/screen-generation/generators/react-generator.d.ts.map +1 -0
- package/dist/screen-generation/generators/react-generator.js +379 -0
- package/dist/screen-generation/generators/react-generator.js.map +1 -0
- package/dist/screen-generation/generators/tailwind-generator.d.ts +105 -0
- package/dist/screen-generation/generators/tailwind-generator.d.ts.map +1 -0
- package/dist/screen-generation/generators/tailwind-generator.js +355 -0
- package/dist/screen-generation/generators/tailwind-generator.js.map +1 -0
- package/dist/screen-generation/generators/types.d.ts +136 -0
- package/dist/screen-generation/generators/types.d.ts.map +1 -0
- package/dist/screen-generation/generators/types.js +18 -0
- package/dist/screen-generation/generators/types.js.map +1 -0
- package/dist/screen-generation/generators/utils.d.ts +187 -0
- package/dist/screen-generation/generators/utils.d.ts.map +1 -0
- package/dist/screen-generation/generators/utils.js +312 -0
- package/dist/screen-generation/generators/utils.js.map +1 -0
- package/dist/screen-generation/index.d.ts +14 -0
- package/dist/screen-generation/index.d.ts.map +1 -0
- package/dist/screen-generation/index.js +33 -0
- package/dist/screen-generation/index.js.map +1 -0
- package/dist/screen-generation/resolver/component-resolver.d.ts +157 -0
- package/dist/screen-generation/resolver/component-resolver.d.ts.map +1 -0
- package/dist/screen-generation/resolver/component-resolver.js +295 -0
- package/dist/screen-generation/resolver/component-resolver.js.map +1 -0
- package/dist/screen-generation/resolver/index.d.ts +10 -0
- package/dist/screen-generation/resolver/index.d.ts.map +1 -0
- package/dist/screen-generation/resolver/index.js +46 -0
- package/dist/screen-generation/resolver/index.js.map +1 -0
- package/dist/screen-generation/resolver/layout-resolver.d.ts +155 -0
- package/dist/screen-generation/resolver/layout-resolver.d.ts.map +1 -0
- package/dist/screen-generation/resolver/layout-resolver.js +193 -0
- package/dist/screen-generation/resolver/layout-resolver.js.map +1 -0
- package/dist/screen-generation/resolver/screen-resolver.d.ts +174 -0
- package/dist/screen-generation/resolver/screen-resolver.d.ts.map +1 -0
- package/dist/screen-generation/resolver/screen-resolver.js +373 -0
- package/dist/screen-generation/resolver/screen-resolver.js.map +1 -0
- package/dist/screen-generation/resolver/token-resolver.d.ts +170 -0
- package/dist/screen-generation/resolver/token-resolver.d.ts.map +1 -0
- package/dist/screen-generation/resolver/token-resolver.js +260 -0
- package/dist/screen-generation/resolver/token-resolver.js.map +1 -0
- package/dist/screen-generation/types.d.ts +116 -0
- package/dist/screen-generation/types.d.ts.map +1 -0
- package/dist/screen-generation/types.js +33 -0
- package/dist/screen-generation/types.js.map +1 -0
- package/dist/screen-generation/validators.d.ts +286 -0
- package/dist/screen-generation/validators.d.ts.map +1 -0
- package/dist/screen-generation/validators.js +323 -0
- package/dist/screen-generation/validators.js.map +1 -0
- package/dist/screen-templates/__tests__/registry.test.d.ts +6 -0
- package/dist/screen-templates/__tests__/registry.test.d.ts.map +1 -0
- package/dist/screen-templates/__tests__/registry.test.js +247 -0
- package/dist/screen-templates/__tests__/registry.test.js.map +1 -0
- package/dist/screen-templates/__tests__/templates.test.d.ts +6 -0
- package/dist/screen-templates/__tests__/templates.test.d.ts.map +1 -0
- package/dist/screen-templates/__tests__/templates.test.js +179 -0
- package/dist/screen-templates/__tests__/templates.test.js.map +1 -0
- package/dist/screen-templates/index.d.ts +39 -0
- package/dist/screen-templates/index.d.ts.map +1 -0
- package/dist/screen-templates/index.js +79 -0
- package/dist/screen-templates/index.js.map +1 -0
- package/dist/screen-templates/registry.d.ts +177 -0
- package/dist/screen-templates/registry.d.ts.map +1 -0
- package/dist/screen-templates/registry.js +274 -0
- package/dist/screen-templates/registry.js.map +1 -0
- package/dist/screen-templates/templates/account/index.d.ts +6 -0
- package/dist/screen-templates/templates/account/index.d.ts.map +1 -0
- package/dist/screen-templates/templates/account/index.js +6 -0
- package/dist/screen-templates/templates/account/index.js.map +1 -0
- package/dist/screen-templates/templates/account/profile.d.ts +23 -0
- package/dist/screen-templates/templates/account/profile.d.ts.map +1 -0
- package/dist/screen-templates/templates/account/profile.js +249 -0
- package/dist/screen-templates/templates/account/profile.js.map +1 -0
- package/dist/screen-templates/templates/auth/forgot-password.d.ts +23 -0
- package/dist/screen-templates/templates/auth/forgot-password.d.ts.map +1 -0
- package/dist/screen-templates/templates/auth/forgot-password.js +203 -0
- package/dist/screen-templates/templates/auth/forgot-password.js.map +1 -0
- package/dist/screen-templates/templates/auth/index.d.ts +9 -0
- package/dist/screen-templates/templates/auth/index.d.ts.map +1 -0
- package/dist/screen-templates/templates/auth/index.js +9 -0
- package/dist/screen-templates/templates/auth/index.js.map +1 -0
- package/dist/screen-templates/templates/auth/login.d.ts +24 -0
- package/dist/screen-templates/templates/auth/login.d.ts.map +1 -0
- package/dist/screen-templates/templates/auth/login.js +254 -0
- package/dist/screen-templates/templates/auth/login.js.map +1 -0
- package/dist/screen-templates/templates/auth/signup.d.ts +24 -0
- package/dist/screen-templates/templates/auth/signup.d.ts.map +1 -0
- package/dist/screen-templates/templates/auth/signup.js +315 -0
- package/dist/screen-templates/templates/auth/signup.js.map +1 -0
- package/dist/screen-templates/templates/auth/verification.d.ts +23 -0
- package/dist/screen-templates/templates/auth/verification.d.ts.map +1 -0
- package/dist/screen-templates/templates/auth/verification.js +239 -0
- package/dist/screen-templates/templates/auth/verification.js.map +1 -0
- package/dist/screen-templates/templates/feedback/confirmation.d.ts +9 -0
- package/dist/screen-templates/templates/feedback/confirmation.d.ts.map +1 -0
- package/dist/screen-templates/templates/feedback/confirmation.js +107 -0
- package/dist/screen-templates/templates/feedback/confirmation.js.map +1 -0
- package/dist/screen-templates/templates/feedback/empty.d.ts +9 -0
- package/dist/screen-templates/templates/feedback/empty.d.ts.map +1 -0
- package/dist/screen-templates/templates/feedback/empty.js +90 -0
- package/dist/screen-templates/templates/feedback/empty.js.map +1 -0
- package/dist/screen-templates/templates/feedback/error.d.ts +9 -0
- package/dist/screen-templates/templates/feedback/error.d.ts.map +1 -0
- package/dist/screen-templates/templates/feedback/error.js +99 -0
- package/dist/screen-templates/templates/feedback/error.js.map +1 -0
- package/dist/screen-templates/templates/feedback/index.d.ts +10 -0
- package/dist/screen-templates/templates/feedback/index.d.ts.map +1 -0
- package/dist/screen-templates/templates/feedback/index.js +10 -0
- package/dist/screen-templates/templates/feedback/index.js.map +1 -0
- package/dist/screen-templates/templates/feedback/loading.d.ts +9 -0
- package/dist/screen-templates/templates/feedback/loading.d.ts.map +1 -0
- package/dist/screen-templates/templates/feedback/loading.js +77 -0
- package/dist/screen-templates/templates/feedback/loading.js.map +1 -0
- package/dist/screen-templates/templates/feedback/success.d.ts +9 -0
- package/dist/screen-templates/templates/feedback/success.d.ts.map +1 -0
- package/dist/screen-templates/templates/feedback/success.js +99 -0
- package/dist/screen-templates/templates/feedback/success.js.map +1 -0
- package/dist/screen-templates/templates/home/index.d.ts +6 -0
- package/dist/screen-templates/templates/home/index.d.ts.map +1 -0
- package/dist/screen-templates/templates/home/index.js +6 -0
- package/dist/screen-templates/templates/home/index.js.map +1 -0
- package/dist/screen-templates/templates/home/landing.d.ts +24 -0
- package/dist/screen-templates/templates/home/landing.d.ts.map +1 -0
- package/dist/screen-templates/templates/home/landing.js +197 -0
- package/dist/screen-templates/templates/home/landing.js.map +1 -0
- package/dist/screen-templates/templates/settings/index.d.ts +6 -0
- package/dist/screen-templates/templates/settings/index.d.ts.map +1 -0
- package/dist/screen-templates/templates/settings/index.js +6 -0
- package/dist/screen-templates/templates/settings/index.js.map +1 -0
- package/dist/screen-templates/templates/settings/preferences.d.ts +24 -0
- package/dist/screen-templates/templates/settings/preferences.d.ts.map +1 -0
- package/dist/screen-templates/templates/settings/preferences.js +265 -0
- package/dist/screen-templates/templates/settings/preferences.js.map +1 -0
- package/dist/screen-templates/types.d.ts +229 -0
- package/dist/screen-templates/types.d.ts.map +1 -0
- package/dist/screen-templates/types.js +7 -0
- package/dist/screen-templates/types.js.map +1 -0
- package/dist/theme-v2.d.ts +228 -0
- package/dist/theme-v2.d.ts.map +1 -0
- package/dist/theme-v2.js +158 -0
- package/dist/theme-v2.js.map +1 -0
- package/dist/theme.d.ts +60 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +76 -0
- package/dist/theme.js.map +1 -0
- package/dist/token-resolver.d.ts +69 -0
- package/dist/token-resolver.d.ts.map +1 -0
- package/dist/token-resolver.js +122 -0
- package/dist/token-resolver.js.map +1 -0
- package/dist/token-validation.d.ts +432 -0
- package/dist/token-validation.d.ts.map +1 -0
- package/dist/token-validation.js +140 -0
- package/dist/token-validation.js.map +1 -0
- package/dist/tokens.d.ts +158 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +10 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +77 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tekton-ui/core - Component Resolver
|
|
3
|
+
* Resolves component definitions to complete component structures with token bindings
|
|
4
|
+
* [SPEC-LAYOUT-002] [PHASE-2]
|
|
5
|
+
*/
|
|
6
|
+
import { type ComponentSchema } from '../../component-schemas.js';
|
|
7
|
+
import type { ComponentDefinition } from '../types.js';
|
|
8
|
+
import { type ResolvedTokenBindings } from './token-resolver.js';
|
|
9
|
+
/**
|
|
10
|
+
* Resolved component with complete schema and token bindings
|
|
11
|
+
* Ready for rendering with all properties and styles resolved
|
|
12
|
+
*/
|
|
13
|
+
export interface ResolvedComponent {
|
|
14
|
+
/** Component type (e.g., "Button", "Input") */
|
|
15
|
+
type: string;
|
|
16
|
+
/** Component schema with props definition and a11y requirements */
|
|
17
|
+
schema: ComponentSchema;
|
|
18
|
+
/** Original component props from definition */
|
|
19
|
+
props: Record<string, unknown>;
|
|
20
|
+
/** Resolved props with defaults and validation */
|
|
21
|
+
resolvedProps: Record<string, unknown>;
|
|
22
|
+
/** Resolved token bindings (property → CSS variable) */
|
|
23
|
+
tokenBindings: ResolvedTokenBindings;
|
|
24
|
+
/** Child components (recursively resolved) or text content */
|
|
25
|
+
children?: (ResolvedComponent | string)[];
|
|
26
|
+
/** Layout slot assignment (for section positioning) */
|
|
27
|
+
slot?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Component resolution context
|
|
31
|
+
* Provides theme and screen information for resolution
|
|
32
|
+
*/
|
|
33
|
+
export interface ComponentContext {
|
|
34
|
+
/** Theme ID for token resolution */
|
|
35
|
+
theme: string;
|
|
36
|
+
/** Screen ID for error messages */
|
|
37
|
+
screenId: string;
|
|
38
|
+
/** Section ID for error messages (if resolving within section) */
|
|
39
|
+
sectionId?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Clear component resolution cache
|
|
43
|
+
* Useful for testing or when component schemas change
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* clearComponentCache();
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function clearComponentCache(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve component definition to complete resolved component
|
|
53
|
+
*
|
|
54
|
+
* Process:
|
|
55
|
+
* 1. Validate component type exists
|
|
56
|
+
* 2. Get component schema
|
|
57
|
+
* 3. Merge props with defaults
|
|
58
|
+
* 4. Resolve token bindings with template variables
|
|
59
|
+
* 5. Recursively resolve children
|
|
60
|
+
*
|
|
61
|
+
* @param component - Component definition to resolve
|
|
62
|
+
* @param context - Resolution context with theme and screen info
|
|
63
|
+
* @returns Resolved component with schema, props, and token bindings
|
|
64
|
+
* @throws Error if component type not found or resolution fails
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const definition = {
|
|
69
|
+
* type: 'Button',
|
|
70
|
+
* props: { variant: 'primary', children: 'Click me' }
|
|
71
|
+
* };
|
|
72
|
+
*
|
|
73
|
+
* const context = {
|
|
74
|
+
* theme: 'default',
|
|
75
|
+
* screenId: 'dashboard-screen'
|
|
76
|
+
* };
|
|
77
|
+
*
|
|
78
|
+
* const resolved = resolveComponent(definition, context);
|
|
79
|
+
* console.log(resolved.schema.type); // → 'Button'
|
|
80
|
+
* console.log(resolved.tokenBindings.background); // → 'var(--component-button-primary-background)'
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare function resolveComponent(component: ComponentDefinition, context: ComponentContext): ResolvedComponent;
|
|
84
|
+
/**
|
|
85
|
+
* Resolve children components recursively
|
|
86
|
+
*
|
|
87
|
+
* Handles both component definitions and text content.
|
|
88
|
+
* Maintains order and structure from original definition.
|
|
89
|
+
*
|
|
90
|
+
* @param children - Array of component definitions or strings
|
|
91
|
+
* @param context - Resolution context
|
|
92
|
+
* @returns Array of resolved components or strings
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const children = [
|
|
97
|
+
* { type: 'Text', props: { children: 'Label' } },
|
|
98
|
+
* { type: 'Button', props: { variant: 'primary', children: 'Submit' } }
|
|
99
|
+
* ];
|
|
100
|
+
*
|
|
101
|
+
* const context = { theme: 'default', screenId: 'form-screen' };
|
|
102
|
+
* const resolved = resolveChildren(children, context);
|
|
103
|
+
* // → [ResolvedComponent<Text>, ResolvedComponent<Button>]
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare function resolveChildren(children: (ComponentDefinition | string)[], context: ComponentContext): (ResolvedComponent | string)[];
|
|
107
|
+
/**
|
|
108
|
+
* Validate component definition structure
|
|
109
|
+
*
|
|
110
|
+
* Checks:
|
|
111
|
+
* - type field is present and string
|
|
112
|
+
* - props field is present and object
|
|
113
|
+
* - children field (if present) is array
|
|
114
|
+
* - slot field (if present) is string
|
|
115
|
+
*
|
|
116
|
+
* @param component - Component definition to validate
|
|
117
|
+
* @returns True if valid, false otherwise
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```typescript
|
|
121
|
+
* isValidComponentDefinition({
|
|
122
|
+
* type: 'Button',
|
|
123
|
+
* props: { variant: 'primary' }
|
|
124
|
+
* }); // → true
|
|
125
|
+
*
|
|
126
|
+
* isValidComponentDefinition({
|
|
127
|
+
* props: { variant: 'primary' }
|
|
128
|
+
* }); // → false (missing type)
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export declare function isValidComponentDefinition(component: unknown): component is ComponentDefinition;
|
|
132
|
+
/**
|
|
133
|
+
* Extract all component types from component tree
|
|
134
|
+
*
|
|
135
|
+
* Recursively traverses component tree and collects unique types.
|
|
136
|
+
* Useful for validation and dependency analysis.
|
|
137
|
+
*
|
|
138
|
+
* @param component - Root component definition
|
|
139
|
+
* @returns Set of unique component types
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* const component = {
|
|
144
|
+
* type: 'Card',
|
|
145
|
+
* props: {},
|
|
146
|
+
* children: [
|
|
147
|
+
* { type: 'Heading', props: { children: 'Title' } },
|
|
148
|
+
* { type: 'Text', props: { children: 'Content' } }
|
|
149
|
+
* ]
|
|
150
|
+
* };
|
|
151
|
+
*
|
|
152
|
+
* extractComponentTypes(component);
|
|
153
|
+
* // → Set(['Card', 'Heading', 'Text'])
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export declare function extractComponentTypes(component: ComponentDefinition): Set<string>;
|
|
157
|
+
//# sourceMappingURL=component-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-resolver.d.ts","sourceRoot":"","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AAO,EAAE,gBAAgB,GACxB,CAAC,iBAAiB,GAAG,MAAM,CAAC,EAAE,CAkBhC;AAMD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,IAAI,mBAAmB,CAsB/F;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,mBAAmB,GAAG,GAAG,CAAC,MAAM,CAAC,CAcjF"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tekton-ui/core - Component Resolver
|
|
3
|
+
* Resolves component definitions to complete component structures with token bindings
|
|
4
|
+
* [SPEC-LAYOUT-002] [PHASE-2]
|
|
5
|
+
*/
|
|
6
|
+
import { getComponentSchema } from '../../component-schemas.js';
|
|
7
|
+
import { resolveBindings, } from './token-resolver.js';
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Cache
|
|
10
|
+
// ============================================================================
|
|
11
|
+
/**
|
|
12
|
+
* Component resolution cache
|
|
13
|
+
* Key: `${type}:${JSON.stringify(props)}:${theme}`
|
|
14
|
+
*/
|
|
15
|
+
const componentCache = new Map();
|
|
16
|
+
/**
|
|
17
|
+
* Clear component resolution cache
|
|
18
|
+
* Useful for testing or when component schemas change
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* clearComponentCache();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export function clearComponentCache() {
|
|
26
|
+
componentCache.clear();
|
|
27
|
+
}
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Props Resolution
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Merge component props with defaults from schema
|
|
33
|
+
*
|
|
34
|
+
* Process:
|
|
35
|
+
* 1. Start with default values from schema
|
|
36
|
+
* 2. Override with user-provided props
|
|
37
|
+
* 3. Validate required props
|
|
38
|
+
*
|
|
39
|
+
* @param props - User-provided component props
|
|
40
|
+
* @param schema - Component schema with prop definitions
|
|
41
|
+
* @returns Merged props with defaults applied
|
|
42
|
+
* @throws Error if required prop is missing
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* const schema = {
|
|
47
|
+
* props: [
|
|
48
|
+
* { name: 'variant', defaultValue: 'primary', required: false },
|
|
49
|
+
* { name: 'children', required: true }
|
|
50
|
+
* ]
|
|
51
|
+
* };
|
|
52
|
+
*
|
|
53
|
+
* mergePropsWithDefaults({ children: 'Click me' }, schema);
|
|
54
|
+
* // → { variant: 'primary', children: 'Click me' }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
function mergePropsWithDefaults(props, schema) {
|
|
58
|
+
const merged = {};
|
|
59
|
+
// Apply defaults first
|
|
60
|
+
for (const propDef of schema.props) {
|
|
61
|
+
if (propDef.defaultValue !== undefined) {
|
|
62
|
+
merged[propDef.name] = propDef.defaultValue;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Override with user props
|
|
66
|
+
Object.assign(merged, props);
|
|
67
|
+
// Validate required props
|
|
68
|
+
for (const propDef of schema.props) {
|
|
69
|
+
if (propDef.required && merged[propDef.name] === undefined) {
|
|
70
|
+
throw new Error(`Required prop '${propDef.name}' is missing for component '${schema.type}'. ` +
|
|
71
|
+
`Description: ${propDef.description}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return merged;
|
|
75
|
+
}
|
|
76
|
+
// ============================================================================
|
|
77
|
+
// Core Resolution Functions
|
|
78
|
+
// ============================================================================
|
|
79
|
+
/**
|
|
80
|
+
* Resolve component definition to complete resolved component
|
|
81
|
+
*
|
|
82
|
+
* Process:
|
|
83
|
+
* 1. Validate component type exists
|
|
84
|
+
* 2. Get component schema
|
|
85
|
+
* 3. Merge props with defaults
|
|
86
|
+
* 4. Resolve token bindings with template variables
|
|
87
|
+
* 5. Recursively resolve children
|
|
88
|
+
*
|
|
89
|
+
* @param component - Component definition to resolve
|
|
90
|
+
* @param context - Resolution context with theme and screen info
|
|
91
|
+
* @returns Resolved component with schema, props, and token bindings
|
|
92
|
+
* @throws Error if component type not found or resolution fails
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const definition = {
|
|
97
|
+
* type: 'Button',
|
|
98
|
+
* props: { variant: 'primary', children: 'Click me' }
|
|
99
|
+
* };
|
|
100
|
+
*
|
|
101
|
+
* const context = {
|
|
102
|
+
* theme: 'default',
|
|
103
|
+
* screenId: 'dashboard-screen'
|
|
104
|
+
* };
|
|
105
|
+
*
|
|
106
|
+
* const resolved = resolveComponent(definition, context);
|
|
107
|
+
* console.log(resolved.schema.type); // → 'Button'
|
|
108
|
+
* console.log(resolved.tokenBindings.background); // → 'var(--component-button-primary-background)'
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export function resolveComponent(component, context) {
|
|
112
|
+
// Generate cache key (include slot for uniqueness)
|
|
113
|
+
const cacheKey = `${component.type}:${JSON.stringify(component.props)}:${component.slot || ''}:${context.theme}`;
|
|
114
|
+
// Check cache (skip for components with children as they need recursive resolution)
|
|
115
|
+
if (!component.children && componentCache.has(cacheKey)) {
|
|
116
|
+
return componentCache.get(cacheKey);
|
|
117
|
+
}
|
|
118
|
+
// Get component schema
|
|
119
|
+
const schema = getComponentSchema(component.type);
|
|
120
|
+
if (!schema) {
|
|
121
|
+
throw new Error(`Unknown component type '${component.type}' in screen '${context.screenId}'. ` +
|
|
122
|
+
`Available types: Button, Input, Text, Heading, Checkbox, Radio, Switch, Slider, ` +
|
|
123
|
+
`Badge, Avatar, Card, Modal, Tabs, Table, Link, List, Image, Form, Dropdown, Progress`);
|
|
124
|
+
}
|
|
125
|
+
// Merge props with defaults and validate
|
|
126
|
+
// Special handling: if component has children array, map to props.children
|
|
127
|
+
const propsWithChildren = { ...component.props };
|
|
128
|
+
if (component.children && component.children.length > 0 && !propsWithChildren.children) {
|
|
129
|
+
// For components that accept children as prop (Card, Modal, etc.)
|
|
130
|
+
// Map ComponentDefinition.children to props.children
|
|
131
|
+
propsWithChildren.children = component.children;
|
|
132
|
+
}
|
|
133
|
+
let resolvedProps;
|
|
134
|
+
try {
|
|
135
|
+
resolvedProps = mergePropsWithDefaults(propsWithChildren, schema);
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
const sectionInfo = context.sectionId ? ` in section '${context.sectionId}'` : '';
|
|
139
|
+
throw new Error(`Failed to resolve props for component '${component.type}'${sectionInfo}: ${error instanceof Error ? error.message : String(error)}`);
|
|
140
|
+
}
|
|
141
|
+
// Resolve token bindings
|
|
142
|
+
const tokenBindingContext = {
|
|
143
|
+
props: resolvedProps,
|
|
144
|
+
theme: context.theme,
|
|
145
|
+
};
|
|
146
|
+
let tokenBindings;
|
|
147
|
+
try {
|
|
148
|
+
tokenBindings = resolveBindings(schema.tokenBindings, tokenBindingContext);
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
const sectionInfo = context.sectionId ? ` in section '${context.sectionId}'` : '';
|
|
152
|
+
throw new Error(`Failed to resolve token bindings for component '${component.type}'${sectionInfo}: ${error instanceof Error ? error.message : String(error)}`);
|
|
153
|
+
}
|
|
154
|
+
// Recursively resolve children
|
|
155
|
+
let children;
|
|
156
|
+
if (component.children && component.children.length > 0) {
|
|
157
|
+
children = resolveChildren(component.children, context);
|
|
158
|
+
}
|
|
159
|
+
const resolved = {
|
|
160
|
+
type: component.type,
|
|
161
|
+
schema,
|
|
162
|
+
props: component.props,
|
|
163
|
+
resolvedProps,
|
|
164
|
+
tokenBindings,
|
|
165
|
+
children,
|
|
166
|
+
slot: component.slot,
|
|
167
|
+
};
|
|
168
|
+
// Cache result (skip components with children as they contain references)
|
|
169
|
+
if (!component.children) {
|
|
170
|
+
componentCache.set(cacheKey, resolved);
|
|
171
|
+
}
|
|
172
|
+
return resolved;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Resolve children components recursively
|
|
176
|
+
*
|
|
177
|
+
* Handles both component definitions and text content.
|
|
178
|
+
* Maintains order and structure from original definition.
|
|
179
|
+
*
|
|
180
|
+
* @param children - Array of component definitions or strings
|
|
181
|
+
* @param context - Resolution context
|
|
182
|
+
* @returns Array of resolved components or strings
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* const children = [
|
|
187
|
+
* { type: 'Text', props: { children: 'Label' } },
|
|
188
|
+
* { type: 'Button', props: { variant: 'primary', children: 'Submit' } }
|
|
189
|
+
* ];
|
|
190
|
+
*
|
|
191
|
+
* const context = { theme: 'default', screenId: 'form-screen' };
|
|
192
|
+
* const resolved = resolveChildren(children, context);
|
|
193
|
+
* // → [ResolvedComponent<Text>, ResolvedComponent<Button>]
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
export function resolveChildren(children, context) {
|
|
197
|
+
return children.map((child, index) => {
|
|
198
|
+
if (typeof child === 'string') {
|
|
199
|
+
// Text content
|
|
200
|
+
return child;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
// Component definition - resolve recursively
|
|
204
|
+
try {
|
|
205
|
+
return resolveComponent(child, context);
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
throw new Error(`Failed to resolve child component at index ${index}: ${error instanceof Error ? error.message : String(error)}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
// ============================================================================
|
|
214
|
+
// Validation Utilities
|
|
215
|
+
// ============================================================================
|
|
216
|
+
/**
|
|
217
|
+
* Validate component definition structure
|
|
218
|
+
*
|
|
219
|
+
* Checks:
|
|
220
|
+
* - type field is present and string
|
|
221
|
+
* - props field is present and object
|
|
222
|
+
* - children field (if present) is array
|
|
223
|
+
* - slot field (if present) is string
|
|
224
|
+
*
|
|
225
|
+
* @param component - Component definition to validate
|
|
226
|
+
* @returns True if valid, false otherwise
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```typescript
|
|
230
|
+
* isValidComponentDefinition({
|
|
231
|
+
* type: 'Button',
|
|
232
|
+
* props: { variant: 'primary' }
|
|
233
|
+
* }); // → true
|
|
234
|
+
*
|
|
235
|
+
* isValidComponentDefinition({
|
|
236
|
+
* props: { variant: 'primary' }
|
|
237
|
+
* }); // → false (missing type)
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
export function isValidComponentDefinition(component) {
|
|
241
|
+
if (typeof component !== 'object' || component === null) {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
const obj = component;
|
|
245
|
+
// Check required fields
|
|
246
|
+
if (typeof obj.type !== 'string' || typeof obj.props !== 'object' || obj.props === null) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
// Check optional fields
|
|
250
|
+
if (obj.children !== undefined && !Array.isArray(obj.children)) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
if (obj.slot !== undefined && typeof obj.slot !== 'string') {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Extract all component types from component tree
|
|
260
|
+
*
|
|
261
|
+
* Recursively traverses component tree and collects unique types.
|
|
262
|
+
* Useful for validation and dependency analysis.
|
|
263
|
+
*
|
|
264
|
+
* @param component - Root component definition
|
|
265
|
+
* @returns Set of unique component types
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* ```typescript
|
|
269
|
+
* const component = {
|
|
270
|
+
* type: 'Card',
|
|
271
|
+
* props: {},
|
|
272
|
+
* children: [
|
|
273
|
+
* { type: 'Heading', props: { children: 'Title' } },
|
|
274
|
+
* { type: 'Text', props: { children: 'Content' } }
|
|
275
|
+
* ]
|
|
276
|
+
* };
|
|
277
|
+
*
|
|
278
|
+
* extractComponentTypes(component);
|
|
279
|
+
* // → Set(['Card', 'Heading', 'Text'])
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
export function extractComponentTypes(component) {
|
|
283
|
+
const types = new Set();
|
|
284
|
+
types.add(component.type);
|
|
285
|
+
if (component.children) {
|
|
286
|
+
for (const child of component.children) {
|
|
287
|
+
if (typeof child !== 'string') {
|
|
288
|
+
const childTypes = extractComponentTypes(child);
|
|
289
|
+
childTypes.forEach(type => types.add(type));
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return types;
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=component-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-resolver.js","sourceRoot":"","sources":["../../../src/screen-generation/resolver/component-resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAwB,MAAM,4BAA4B,CAAC;AAEtF,OAAO,EACL,eAAe,GAGhB,MAAM,qBAAqB,CAAC;AAgD7B,+EAA+E;AAC/E,QAAQ;AACR,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,EAA6B,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB;IACjC,cAAc,CAAC,KAAK,EAAE,CAAC;AACzB,CAAC;AAED,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAS,sBAAsB,CAC7B,KAA8B,EAC9B,MAAuB;IAEvB,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,uBAAuB;IACvB,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,2BAA2B;IAC3B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,CAAC;gBAC9B,MAAM,UAAU,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;gBAChD,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tekton-ui/core - Screen Resolver Module
|
|
3
|
+
* Barrel export for screen resolution pipeline
|
|
4
|
+
* [SPEC-LAYOUT-002] [PHASE-2]
|
|
5
|
+
*/
|
|
6
|
+
export { type TokenBindingContext, type ResolvedTokenBindings, resolveBinding, resolveBindings, substituteTemplateVariables, tokenRefToCSSVar, isValidTokenBinding, extractTemplateVariables, clearBindingCache, } from './token-resolver.js';
|
|
7
|
+
export { type LayoutContext, resolveShell, resolvePage, resolveSection, isValidShellToken, isValidPageToken, isValidSectionToken, parseLayoutType, } from './layout-resolver.js';
|
|
8
|
+
export { type ResolvedComponent, type ComponentContext, resolveComponent, resolveChildren, isValidComponentDefinition, extractComponentTypes, clearComponentCache, } from './component-resolver.js';
|
|
9
|
+
export { type ResolvedScreen, type ResolvedSection, type ComponentTree, type ComponentTreeNode, resolveScreen, isValidResolvedScreen, getScreenStats, clearScreenCache, } from './screen-resolver.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screen-generation/resolver/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAG1B,cAAc,EACd,eAAe,EACf,2BAA2B,EAC3B,gBAAgB,EAGhB,mBAAmB,EACnB,wBAAwB,EAGxB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAEL,KAAK,aAAa,EAGlB,YAAY,EACZ,WAAW,EACX,cAAc,EAGd,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGrB,gBAAgB,EAChB,eAAe,EAGf,0BAA0B,EAC1B,qBAAqB,EAGrB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAGtB,aAAa,EAGb,qBAAqB,EAGrB,cAAc,EAGd,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tekton-ui/core - Screen Resolver Module
|
|
3
|
+
* Barrel export for screen resolution pipeline
|
|
4
|
+
* [SPEC-LAYOUT-002] [PHASE-2]
|
|
5
|
+
*/
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// Token Resolver
|
|
8
|
+
// ============================================================================
|
|
9
|
+
export {
|
|
10
|
+
// Core Functions
|
|
11
|
+
resolveBinding, resolveBindings, substituteTemplateVariables, tokenRefToCSSVar,
|
|
12
|
+
// Validation
|
|
13
|
+
isValidTokenBinding, extractTemplateVariables,
|
|
14
|
+
// Cache Management
|
|
15
|
+
clearBindingCache, } from './token-resolver.js';
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// Layout Resolver
|
|
18
|
+
// ============================================================================
|
|
19
|
+
export {
|
|
20
|
+
// Core Functions
|
|
21
|
+
resolveShell, resolvePage, resolveSection,
|
|
22
|
+
// Validation
|
|
23
|
+
isValidShellToken, isValidPageToken, isValidSectionToken, parseLayoutType, } from './layout-resolver.js';
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// Component Resolver
|
|
26
|
+
// ============================================================================
|
|
27
|
+
export {
|
|
28
|
+
// Core Functions
|
|
29
|
+
resolveComponent, resolveChildren,
|
|
30
|
+
// Validation
|
|
31
|
+
isValidComponentDefinition, extractComponentTypes,
|
|
32
|
+
// Cache Management
|
|
33
|
+
clearComponentCache, } from './component-resolver.js';
|
|
34
|
+
// ============================================================================
|
|
35
|
+
// Screen Resolver (Main)
|
|
36
|
+
// ============================================================================
|
|
37
|
+
export {
|
|
38
|
+
// Core Functions
|
|
39
|
+
resolveScreen,
|
|
40
|
+
// Validation
|
|
41
|
+
isValidResolvedScreen,
|
|
42
|
+
// Statistics
|
|
43
|
+
getScreenStats,
|
|
44
|
+
// Cache Management
|
|
45
|
+
clearScreenCache, } from './screen-resolver.js';
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screen-generation/resolver/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,OAAO;AAKL,iBAAiB;AACjB,cAAc,EACd,eAAe,EACf,2BAA2B,EAC3B,gBAAgB;AAEhB,aAAa;AACb,mBAAmB,EACnB,wBAAwB;AAExB,mBAAmB;AACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E,OAAO;AAIL,iBAAiB;AACjB,YAAY,EACZ,WAAW,EACX,cAAc;AAEd,aAAa;AACb,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAE9B,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,OAAO;AAKL,iBAAiB;AACjB,gBAAgB,EAChB,eAAe;AAEf,aAAa;AACb,0BAA0B,EAC1B,qBAAqB;AAErB,mBAAmB;AACnB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E,OAAO;AAOL,iBAAiB;AACjB,aAAa;AAEb,aAAa;AACb,qBAAqB;AAErB,aAAa;AACb,cAAc;AAEd,mBAAmB;AACnB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
|