openuispec 0.2.12 → 0.2.14
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 -7
- package/cli/index.ts +18 -12
- package/cli/init.ts +78 -13
- package/docs/cli.md +81 -27
- package/docs/file-formats.md +52 -2
- package/drift/index.ts +7 -2
- package/examples/social-app/openuispec/README.md +2 -1
- package/examples/social-app/openuispec/mock/chat_detail.yaml +25 -0
- package/examples/social-app/openuispec/mock/discover.yaml +17 -0
- package/examples/social-app/openuispec/mock/edit_profile.yaml +9 -0
- package/examples/social-app/openuispec/mock/home_feed.yaml +32 -0
- package/examples/social-app/openuispec/mock/messages_inbox.yaml +15 -0
- package/examples/social-app/openuispec/mock/notifications.yaml +30 -0
- package/examples/social-app/openuispec/mock/post_detail.yaml +26 -0
- package/examples/social-app/openuispec/mock/profile_self.yaml +28 -0
- package/examples/social-app/openuispec/mock/profile_user.yaml +32 -0
- package/examples/social-app/openuispec/mock/search_results.yaml +17 -0
- package/examples/social-app/openuispec/mock/settings.yaml +7 -0
- package/examples/social-app/openuispec/openuispec.yaml +3 -2
- package/examples/taskflow/README.md +5 -3
- package/examples/taskflow/openuispec/README.md +2 -1
- package/examples/taskflow/openuispec/components/media_player.yaml +92 -0
- package/examples/taskflow/openuispec/contracts/README.md +2 -2
- package/examples/taskflow/openuispec/locales/en.json +1 -0
- package/examples/taskflow/openuispec/mock/home.yaml +64 -0
- package/examples/taskflow/openuispec/mock/profile_edit.yaml +6 -0
- package/examples/taskflow/openuispec/mock/project_detail.yaml +33 -0
- package/examples/taskflow/openuispec/mock/settings.yaml +13 -0
- package/examples/taskflow/openuispec/mock/task_detail.yaml +18 -0
- package/examples/taskflow/openuispec/openuispec.yaml +3 -4
- package/examples/taskflow/openuispec/platform/ios.yaml +0 -4
- package/examples/taskflow/openuispec/screens/task_detail.yaml +5 -8
- package/examples/taskflow/openuispec/tokens/icons.yaml +16 -0
- package/examples/todo-orbit/README.md +3 -2
- package/examples/todo-orbit/openuispec/README.md +2 -1
- package/examples/todo-orbit/openuispec/components/task_trend_chart.yaml +85 -0
- package/examples/todo-orbit/openuispec/locales/en.json +3 -0
- package/examples/todo-orbit/openuispec/locales/ru.json +3 -0
- package/examples/todo-orbit/openuispec/mock/analytics.yaml +26 -0
- package/examples/todo-orbit/openuispec/mock/home.yaml +33 -0
- package/examples/todo-orbit/openuispec/mock/settings.yaml +7 -0
- package/examples/todo-orbit/openuispec/mock/task_detail.yaml +14 -0
- package/examples/todo-orbit/openuispec/openuispec.yaml +3 -3
- package/examples/todo-orbit/openuispec/platform/android.yaml +0 -3
- package/examples/todo-orbit/openuispec/platform/ios.yaml +0 -3
- package/examples/todo-orbit/openuispec/platform/web.yaml +0 -3
- package/examples/todo-orbit/openuispec/screens/analytics.yaml +1 -4
- package/mcp-server/index.ts +80 -3
- package/mcp-server/preview-render.ts +1922 -0
- package/mcp-server/preview.ts +292 -0
- package/mcp-server/screenshot-shared.ts +38 -0
- package/mcp-server/screenshot.ts +3 -32
- package/package.json +1 -1
- package/prepare/index.ts +1 -1
- package/schema/component.schema.json +278 -0
- package/schema/custom-contract.schema.json +2 -2
- package/schema/openuispec.schema.json +18 -8
- package/schema/screen.schema.json +12 -1
- package/schema/semantic-lint.ts +24 -2
- package/schema/validate.ts +21 -0
- package/scripts/regenerate-previews.ts +136 -0
- package/spec/{openuispec-v0.1.md → openuispec-v0.2.md} +275 -17
- package/examples/taskflow/openuispec/contracts/x_media_player.yaml +0 -185
- package/examples/todo-orbit/openuispec/contracts/x_task_trend_chart.yaml +0 -139
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
x_task_trend_chart:
|
|
2
|
-
semantic: "Visualizes task creation and completion trends over time for productivity analysis"
|
|
3
|
-
|
|
4
|
-
props:
|
|
5
|
-
series: { type: "list<trend_point>", required: true, description: "Ordered trend points for the selected period" }
|
|
6
|
-
metric:
|
|
7
|
-
type: enum
|
|
8
|
-
values: [completed, created, completion_rate]
|
|
9
|
-
required: true
|
|
10
|
-
description: "Primary metric emphasized in the chart"
|
|
11
|
-
period:
|
|
12
|
-
type: enum
|
|
13
|
-
values: [week, month, quarter]
|
|
14
|
-
required: true
|
|
15
|
-
description: "Time range represented by the chart"
|
|
16
|
-
variant:
|
|
17
|
-
type: enum
|
|
18
|
-
values: [compact, detail]
|
|
19
|
-
default: compact
|
|
20
|
-
description: "Chart presentation density"
|
|
21
|
-
highlighted_index: { type: int, required: false, description: "Optional highlighted datapoint" }
|
|
22
|
-
show_legend: { type: bool, default: true, description: "Whether to render a legend for created/completed series" }
|
|
23
|
-
empty_message: { type: string, required: false, description: "Message to show when series is empty" }
|
|
24
|
-
|
|
25
|
-
states:
|
|
26
|
-
idle:
|
|
27
|
-
semantic: "Chart has not loaded data yet"
|
|
28
|
-
transitions_to: [loading]
|
|
29
|
-
visual: "Reserved chart frame with no plotted data"
|
|
30
|
-
loading:
|
|
31
|
-
semantic: "Trend data is loading"
|
|
32
|
-
transitions_to: [ready, empty, error]
|
|
33
|
-
feedback: "Skeleton chart and loading copy shown"
|
|
34
|
-
visual: "Placeholder bars or line skeleton"
|
|
35
|
-
ready:
|
|
36
|
-
semantic: "Trend data is available and rendered"
|
|
37
|
-
transitions_to: [highlighted, loading, error]
|
|
38
|
-
behavior: "Chart axes, series, and legend are visible"
|
|
39
|
-
highlighted:
|
|
40
|
-
semantic: "One datapoint is emphasized"
|
|
41
|
-
transitions_to: [ready]
|
|
42
|
-
behavior: "Highlighted datapoint shows stronger color and tooltip/callout"
|
|
43
|
-
empty:
|
|
44
|
-
semantic: "No trend points available"
|
|
45
|
-
transitions_to: [loading]
|
|
46
|
-
feedback: "Empty analytics message displayed"
|
|
47
|
-
visual: "Empty state in chart container"
|
|
48
|
-
error:
|
|
49
|
-
semantic: "Trend data failed to load"
|
|
50
|
-
transitions_to: [loading]
|
|
51
|
-
feedback: "Inline error with retry affordance"
|
|
52
|
-
visual: "Error indicator in chart container"
|
|
53
|
-
|
|
54
|
-
a11y:
|
|
55
|
-
role: "img"
|
|
56
|
-
label: "Analytics trend chart"
|
|
57
|
-
traits:
|
|
58
|
-
loading: { announces: "Loading analytics chart" }
|
|
59
|
-
empty: { announces: "No analytics data available" }
|
|
60
|
-
error: { announces: "Analytics chart failed to load" }
|
|
61
|
-
focus:
|
|
62
|
-
keyboard:
|
|
63
|
-
next_point: "ArrowRight"
|
|
64
|
-
previous_point: "ArrowLeft"
|
|
65
|
-
details: "Enter"
|
|
66
|
-
|
|
67
|
-
tokens:
|
|
68
|
-
compact:
|
|
69
|
-
min_height: 220
|
|
70
|
-
padding: "spacing.md"
|
|
71
|
-
background: "color.surface.secondary"
|
|
72
|
-
border: { width: 1, color: "color.border.default" }
|
|
73
|
-
radius: "spacing.sm"
|
|
74
|
-
axis_color: "color.text.tertiary"
|
|
75
|
-
completed_color: "color.brand.primary"
|
|
76
|
-
created_color: "color.brand.secondary"
|
|
77
|
-
grid_color: "color.border.default"
|
|
78
|
-
label_style: "typography.caption"
|
|
79
|
-
detail:
|
|
80
|
-
min_height: 320
|
|
81
|
-
padding: "spacing.lg"
|
|
82
|
-
background: "color.surface.primary"
|
|
83
|
-
border: { width: 1, color: "color.border.default" }
|
|
84
|
-
radius: "spacing.sm"
|
|
85
|
-
axis_color: "color.text.tertiary"
|
|
86
|
-
completed_color: "color.brand.primary"
|
|
87
|
-
created_color: "color.brand.secondary"
|
|
88
|
-
grid_color: "color.border.default"
|
|
89
|
-
label_style: "typography.body_sm"
|
|
90
|
-
|
|
91
|
-
platform_mapping:
|
|
92
|
-
ios:
|
|
93
|
-
compact: { component: "Chart", framework: "Swift Charts" }
|
|
94
|
-
detail: { component: "Chart", framework: "Swift Charts" }
|
|
95
|
-
android:
|
|
96
|
-
compact: { component: "Canvas chart composable", library: "custom compose drawing" }
|
|
97
|
-
detail: { component: "Canvas chart composable", library: "custom compose drawing" }
|
|
98
|
-
web:
|
|
99
|
-
compact: { component: "SVG chart component" }
|
|
100
|
-
detail: { component: "SVG chart component" }
|
|
101
|
-
|
|
102
|
-
dependencies:
|
|
103
|
-
ios:
|
|
104
|
-
frameworks: ["Charts"]
|
|
105
|
-
android:
|
|
106
|
-
libraries: []
|
|
107
|
-
web:
|
|
108
|
-
packages: []
|
|
109
|
-
|
|
110
|
-
generation:
|
|
111
|
-
must_handle:
|
|
112
|
-
- "Render completed and created series for the supplied period"
|
|
113
|
-
- "Respect compact and detail variants with different density"
|
|
114
|
-
- "Provide accessible summary text for the focused datapoint"
|
|
115
|
-
- "Handle loading, empty, and error states in the chart container"
|
|
116
|
-
should_handle:
|
|
117
|
-
- "Animate transitions when highlighted_index changes"
|
|
118
|
-
- "Render a legend when show_legend is true"
|
|
119
|
-
- "Support touch and pointer hover highlighting"
|
|
120
|
-
may_handle:
|
|
121
|
-
- "Tooltips for datapoints"
|
|
122
|
-
- "Trend delta badges and annotations"
|
|
123
|
-
|
|
124
|
-
test_cases:
|
|
125
|
-
- id: ready_state_renders_series
|
|
126
|
-
description: "Chart renders series lines or bars when data is present"
|
|
127
|
-
given: "Chart receives 7 trend points for period week"
|
|
128
|
-
when: "The component enters ready state"
|
|
129
|
-
then: "Both created and completed series are visible with labels and axes"
|
|
130
|
-
- id: empty_state_message
|
|
131
|
-
description: "Chart shows an empty message when no data exists"
|
|
132
|
-
given: "Chart receives an empty series"
|
|
133
|
-
when: "The component enters empty state"
|
|
134
|
-
then: "The empty_message or default empty copy is rendered in the chart frame"
|
|
135
|
-
- id: highlighted_point
|
|
136
|
-
description: "Highlighted point receives emphasis"
|
|
137
|
-
given: "Chart is in ready state with highlighted_index set"
|
|
138
|
-
when: "The highlighted datapoint is rendered"
|
|
139
|
-
then: "That datapoint is visually emphasized and exposed to accessibility"
|