@cloudcrane/app-spec 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +22 -2
- package/dist/src/a2ui.d.ts +12 -0
- package/dist/src/a2ui.js +89 -0
- package/dist/src/blueprint.d.ts +27 -0
- package/dist/src/blueprint.js +62 -0
- package/dist/src/canonical.d.ts +2 -0
- package/dist/src/canonical.js +8 -0
- package/dist/src/catalog.d.ts +7 -0
- package/dist/src/catalog.js +83 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.js +11 -0
- package/dist/src/jsonschema.d.ts +2 -0
- package/dist/src/jsonschema.js +11 -0
- package/dist/src/leak.d.ts +3 -0
- package/dist/src/leak.js +138 -0
- package/dist/src/logic.d.ts +36 -0
- package/dist/src/logic.js +197 -0
- package/dist/src/schema.d.ts +418 -0
- package/dist/src/schema.js +137 -0
- package/dist/src/validate.d.ts +6 -0
- package/dist/src/validate.js +54 -0
- package/dist/vendor/a2ui/v0_9_1/catalogs/basic/catalog.json +1383 -0
- package/dist/vendor/a2ui/v0_9_1/common_types.json +305 -0
- package/dist/vendor/a2ui/v0_9_1/server_to_client.json +131 -0
- package/package.json +78 -3
- package/schema/app-spec.v1.json +460 -0
- package/vendor/a2ui/v0_9_1/LICENSE +227 -0
- package/vendor/a2ui/v0_9_1/VENDOR.json +6 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/catalog.json +1383 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_complex-layout.json +65 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_formatted-text.json +56 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_incremental.json +134 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_interactive-button.json +51 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_row-layout.json +40 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_simple-login-form.json +77 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/00_simple-text.json +27 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/01_flight-status.json +201 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/02_email-compose.json +185 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/03_calendar-day.json +166 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/04_weather-current.json +168 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/05_product-card.json +151 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/06_music-player.json +165 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/07_task-card.json +107 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/08_user-profile.json +190 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/09_login-form.json +214 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/10_notification-permission.json +105 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/11_purchase-complete.json +169 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/12_chat-message.json +144 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/13_coffee-order.json +253 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/14_sports-player.json +177 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/15_account-balance.json +126 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/16_workout-summary.json +160 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/17_event-detail.json +144 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/18_track-list.json +152 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/19_software-purchase.json +194 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/20_restaurant-card.json +140 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/21_shipping-status.json +137 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/22_credit-card.json +117 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/23_step-counter.json +149 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/24_recipe-card.json +204 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/25_contact-card.json +175 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/26_podcast-episode.json +123 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/27_stats-card.json +106 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/28_countdown-timer.json +135 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/29_movie-card.json +156 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/30_live-invitation-builder.json +205 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/31_incremental-dashboard.json +128 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/32_advanced-form-validator.json +166 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/33_financial-data-grid.json +171 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/34_child-list-template.json +80 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/35_markdown-text.json +44 -0
- package/vendor/a2ui/v0_9_1/catalogs/basic/examples/36_modal.json +65 -0
- package/vendor/a2ui/v0_9_1/client_capabilities.json +89 -0
- package/vendor/a2ui/v0_9_1/client_data_model.json +22 -0
- package/vendor/a2ui/v0_9_1/client_to_server.json +98 -0
- package/vendor/a2ui/v0_9_1/client_to_server_list.json +10 -0
- package/vendor/a2ui/v0_9_1/client_to_server_list_wrapper.json +14 -0
- package/vendor/a2ui/v0_9_1/common_types.json +305 -0
- package/vendor/a2ui/v0_9_1/sample.json +22 -0
- package/vendor/a2ui/v0_9_1/server_capabilities.json +26 -0
- package/vendor/a2ui/v0_9_1/server_to_client.json +132 -0
- package/vendor/a2ui/v0_9_1/server_to_client_list.json +10 -0
- package/vendor/a2ui/v0_9_1/server_to_client_list_wrapper.json +14 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Sports Player",
|
|
3
|
+
"description": "Example of sports player",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"version": "v0.9",
|
|
7
|
+
"createSurface": {
|
|
8
|
+
"surfaceId": "gallery-sports-player",
|
|
9
|
+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
10
|
+
"sendDataModel": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"version": "v0.9",
|
|
15
|
+
"updateComponents": {
|
|
16
|
+
"surfaceId": "gallery-sports-player",
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"id": "root",
|
|
20
|
+
"component": "Card",
|
|
21
|
+
"child": "main-column"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "main-column",
|
|
25
|
+
"component": "Column",
|
|
26
|
+
"children": ["player-image", "player-info", "divider", "stats-row"],
|
|
27
|
+
"align": "center"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "player-image",
|
|
31
|
+
"component": "Image",
|
|
32
|
+
"url": {
|
|
33
|
+
"path": "/playerImage"
|
|
34
|
+
},
|
|
35
|
+
"fit": "cover"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "player-info",
|
|
39
|
+
"component": "Column",
|
|
40
|
+
"children": ["player-name", "player-details"],
|
|
41
|
+
"align": "center"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "player-name",
|
|
45
|
+
"component": "Text",
|
|
46
|
+
"text": {
|
|
47
|
+
"path": "/playerName"
|
|
48
|
+
},
|
|
49
|
+
"variant": "h2"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "player-details",
|
|
53
|
+
"component": "Row",
|
|
54
|
+
"children": ["player-number", "player-team"],
|
|
55
|
+
"align": "center"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "player-number",
|
|
59
|
+
"component": "Text",
|
|
60
|
+
"text": {
|
|
61
|
+
"path": "/number"
|
|
62
|
+
},
|
|
63
|
+
"variant": "h3"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "player-team",
|
|
67
|
+
"component": "Text",
|
|
68
|
+
"text": {
|
|
69
|
+
"path": "/team"
|
|
70
|
+
},
|
|
71
|
+
"variant": "caption"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "divider",
|
|
75
|
+
"component": "Divider"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "stats-row",
|
|
79
|
+
"component": "Row",
|
|
80
|
+
"children": ["stat1", "stat2", "stat3"],
|
|
81
|
+
"justify": "spaceAround"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "stat1",
|
|
85
|
+
"component": "Column",
|
|
86
|
+
"children": ["stat1-value", "stat1-label"],
|
|
87
|
+
"align": "center"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "stat1-value",
|
|
91
|
+
"component": "Text",
|
|
92
|
+
"text": {
|
|
93
|
+
"path": "/stat1/value"
|
|
94
|
+
},
|
|
95
|
+
"variant": "h3"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "stat1-label",
|
|
99
|
+
"component": "Text",
|
|
100
|
+
"text": {
|
|
101
|
+
"path": "/stat1/label"
|
|
102
|
+
},
|
|
103
|
+
"variant": "caption"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "stat2",
|
|
107
|
+
"component": "Column",
|
|
108
|
+
"children": ["stat2-value", "stat2-label"],
|
|
109
|
+
"align": "center"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "stat2-value",
|
|
113
|
+
"component": "Text",
|
|
114
|
+
"text": {
|
|
115
|
+
"path": "/stat2/value"
|
|
116
|
+
},
|
|
117
|
+
"variant": "h3"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": "stat2-label",
|
|
121
|
+
"component": "Text",
|
|
122
|
+
"text": {
|
|
123
|
+
"path": "/stat2/label"
|
|
124
|
+
},
|
|
125
|
+
"variant": "caption"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"id": "stat3",
|
|
129
|
+
"component": "Column",
|
|
130
|
+
"children": ["stat3-value", "stat3-label"],
|
|
131
|
+
"align": "center"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "stat3-value",
|
|
135
|
+
"component": "Text",
|
|
136
|
+
"text": {
|
|
137
|
+
"path": "/stat3/value"
|
|
138
|
+
},
|
|
139
|
+
"variant": "h3"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "stat3-label",
|
|
143
|
+
"component": "Text",
|
|
144
|
+
"text": {
|
|
145
|
+
"path": "/stat3/label"
|
|
146
|
+
},
|
|
147
|
+
"variant": "caption"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"version": "v0.9",
|
|
154
|
+
"updateDataModel": {
|
|
155
|
+
"surfaceId": "gallery-sports-player",
|
|
156
|
+
"value": {
|
|
157
|
+
"playerImage": "https://images.unsplash.com/photo-1546519638-68e109498ffc?w=200&h=200&fit=crop",
|
|
158
|
+
"playerName": "Marcus Johnson",
|
|
159
|
+
"number": "#23",
|
|
160
|
+
"team": "LA Lakers",
|
|
161
|
+
"stat1": {
|
|
162
|
+
"value": "28.4",
|
|
163
|
+
"label": "PPG"
|
|
164
|
+
},
|
|
165
|
+
"stat2": {
|
|
166
|
+
"value": "7.2",
|
|
167
|
+
"label": "RPG"
|
|
168
|
+
},
|
|
169
|
+
"stat3": {
|
|
170
|
+
"value": "6.8",
|
|
171
|
+
"label": "APG"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Account Balance",
|
|
3
|
+
"description": "Example of account balance demonstrating currency formatting.",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"version": "v0.9",
|
|
7
|
+
"createSurface": {
|
|
8
|
+
"surfaceId": "gallery-account-balance",
|
|
9
|
+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
10
|
+
"sendDataModel": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"version": "v0.9",
|
|
15
|
+
"updateComponents": {
|
|
16
|
+
"surfaceId": "gallery-account-balance",
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"id": "root",
|
|
20
|
+
"component": "Card",
|
|
21
|
+
"child": "main-column"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "main-column",
|
|
25
|
+
"component": "Column",
|
|
26
|
+
"children": ["header", "balance", "updated", "divider", "actions"]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "header",
|
|
30
|
+
"component": "Row",
|
|
31
|
+
"children": ["account-icon", "account-name"],
|
|
32
|
+
"align": "center"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "account-icon",
|
|
36
|
+
"component": "Icon",
|
|
37
|
+
"name": "payment"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "account-name",
|
|
41
|
+
"component": "Text",
|
|
42
|
+
"text": {
|
|
43
|
+
"path": "/accountName"
|
|
44
|
+
},
|
|
45
|
+
"variant": "h4"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "balance",
|
|
49
|
+
"component": "Text",
|
|
50
|
+
"text": {
|
|
51
|
+
"call": "formatCurrency",
|
|
52
|
+
"args": {
|
|
53
|
+
"value": {
|
|
54
|
+
"path": "/balance"
|
|
55
|
+
},
|
|
56
|
+
"currency": "USD"
|
|
57
|
+
},
|
|
58
|
+
"returnType": "string"
|
|
59
|
+
},
|
|
60
|
+
"variant": "h1"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "updated",
|
|
64
|
+
"component": "Text",
|
|
65
|
+
"text": {
|
|
66
|
+
"path": "/lastUpdated"
|
|
67
|
+
},
|
|
68
|
+
"variant": "caption"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "divider",
|
|
72
|
+
"component": "Divider"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "actions",
|
|
76
|
+
"component": "Row",
|
|
77
|
+
"children": ["transfer-btn", "pay-btn"]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "transfer-btn-text",
|
|
81
|
+
"component": "Text",
|
|
82
|
+
"text": "Transfer"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "transfer-btn",
|
|
86
|
+
"component": "Button",
|
|
87
|
+
"child": "transfer-btn-text",
|
|
88
|
+
"action": {
|
|
89
|
+
"event": {
|
|
90
|
+
"name": "transfer",
|
|
91
|
+
"context": {}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "pay-btn-text",
|
|
97
|
+
"component": "Text",
|
|
98
|
+
"text": "Pay Bill"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "pay-btn",
|
|
102
|
+
"component": "Button",
|
|
103
|
+
"child": "pay-btn-text",
|
|
104
|
+
"action": {
|
|
105
|
+
"event": {
|
|
106
|
+
"name": "pay_bill",
|
|
107
|
+
"context": {}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"version": "v0.9",
|
|
116
|
+
"updateDataModel": {
|
|
117
|
+
"surfaceId": "gallery-account-balance",
|
|
118
|
+
"value": {
|
|
119
|
+
"accountName": "Primary Checking",
|
|
120
|
+
"balance": 12458.32,
|
|
121
|
+
"lastUpdated": "Updated just now"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Workout Summary",
|
|
3
|
+
"description": "Example of workout summary demonstrating number and date formatting.",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"version": "v0.9",
|
|
7
|
+
"createSurface": {
|
|
8
|
+
"surfaceId": "gallery-workout-summary",
|
|
9
|
+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
10
|
+
"sendDataModel": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"version": "v0.9",
|
|
15
|
+
"updateComponents": {
|
|
16
|
+
"surfaceId": "gallery-workout-summary",
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"id": "root",
|
|
20
|
+
"component": "Card",
|
|
21
|
+
"child": "main-column"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "main-column",
|
|
25
|
+
"component": "Column",
|
|
26
|
+
"children": ["header", "divider", "metrics-row", "date"]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "header",
|
|
30
|
+
"component": "Row",
|
|
31
|
+
"children": ["workout-icon", "title"],
|
|
32
|
+
"align": "center"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "workout-icon",
|
|
36
|
+
"component": "Icon",
|
|
37
|
+
"name": {
|
|
38
|
+
"path": "/icon"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "title",
|
|
43
|
+
"component": "Text",
|
|
44
|
+
"text": "Workout Complete",
|
|
45
|
+
"variant": "h3"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "divider",
|
|
49
|
+
"component": "Divider"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "metrics-row",
|
|
53
|
+
"component": "Row",
|
|
54
|
+
"children": ["duration-col", "calories-col", "distance-col"],
|
|
55
|
+
"justify": "spaceAround"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "duration-col",
|
|
59
|
+
"component": "Column",
|
|
60
|
+
"children": ["duration-value", "duration-label"],
|
|
61
|
+
"align": "center"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "duration-value",
|
|
65
|
+
"component": "Text",
|
|
66
|
+
"text": {
|
|
67
|
+
"path": "/duration"
|
|
68
|
+
},
|
|
69
|
+
"variant": "h3"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "duration-label",
|
|
73
|
+
"component": "Text",
|
|
74
|
+
"text": "Duration",
|
|
75
|
+
"variant": "caption"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "calories-col",
|
|
79
|
+
"component": "Column",
|
|
80
|
+
"children": ["calories-value", "calories-label"],
|
|
81
|
+
"align": "center"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "calories-value",
|
|
85
|
+
"component": "Text",
|
|
86
|
+
"text": {
|
|
87
|
+
"call": "formatNumber",
|
|
88
|
+
"args": {
|
|
89
|
+
"value": {
|
|
90
|
+
"path": "/calories"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"returnType": "string"
|
|
94
|
+
},
|
|
95
|
+
"variant": "h3"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "calories-label",
|
|
99
|
+
"component": "Text",
|
|
100
|
+
"text": "Calories",
|
|
101
|
+
"variant": "caption"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "distance-col",
|
|
105
|
+
"component": "Column",
|
|
106
|
+
"children": ["distance-value", "distance-label"],
|
|
107
|
+
"align": "center"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "distance-value",
|
|
111
|
+
"component": "Text",
|
|
112
|
+
"text": {
|
|
113
|
+
"call": "formatString",
|
|
114
|
+
"args": {
|
|
115
|
+
"value": "${/distance} km"
|
|
116
|
+
},
|
|
117
|
+
"returnType": "string"
|
|
118
|
+
},
|
|
119
|
+
"variant": "h3"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"id": "distance-label",
|
|
123
|
+
"component": "Text",
|
|
124
|
+
"text": "Distance",
|
|
125
|
+
"variant": "caption"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"id": "date",
|
|
129
|
+
"component": "Text",
|
|
130
|
+
"text": {
|
|
131
|
+
"call": "formatDate",
|
|
132
|
+
"args": {
|
|
133
|
+
"value": {
|
|
134
|
+
"path": "/date"
|
|
135
|
+
},
|
|
136
|
+
"format": "EEEE, MMM d 'at' h:mm a"
|
|
137
|
+
},
|
|
138
|
+
"returnType": "string"
|
|
139
|
+
},
|
|
140
|
+
"variant": "caption"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"version": "v0.9",
|
|
147
|
+
"updateDataModel": {
|
|
148
|
+
"surfaceId": "gallery-workout-summary",
|
|
149
|
+
"value": {
|
|
150
|
+
"icon": "favorite",
|
|
151
|
+
"workoutType": "Morning Run",
|
|
152
|
+
"duration": "32:15",
|
|
153
|
+
"calories": 385,
|
|
154
|
+
"distance": 5.2,
|
|
155
|
+
"date": "2025-12-15T07:30:00Z"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Event Detail",
|
|
3
|
+
"description": "Example of event detail demonstrating date and string formatting.",
|
|
4
|
+
"messages": [
|
|
5
|
+
{
|
|
6
|
+
"version": "v0.9",
|
|
7
|
+
"createSurface": {
|
|
8
|
+
"surfaceId": "gallery-event-detail",
|
|
9
|
+
"catalogId": "https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json",
|
|
10
|
+
"sendDataModel": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"version": "v0.9",
|
|
15
|
+
"updateComponents": {
|
|
16
|
+
"surfaceId": "gallery-event-detail",
|
|
17
|
+
"components": [
|
|
18
|
+
{
|
|
19
|
+
"id": "root",
|
|
20
|
+
"component": "Card",
|
|
21
|
+
"child": "main-column"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "main-column",
|
|
25
|
+
"component": "Column",
|
|
26
|
+
"children": ["title", "time-row", "location-row", "description", "divider", "actions"]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "title",
|
|
30
|
+
"component": "Text",
|
|
31
|
+
"text": {
|
|
32
|
+
"path": "/title"
|
|
33
|
+
},
|
|
34
|
+
"variant": "h2"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "time-row",
|
|
38
|
+
"component": "Row",
|
|
39
|
+
"children": ["time-icon", "time-text"],
|
|
40
|
+
"align": "center"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "time-icon",
|
|
44
|
+
"component": "Icon",
|
|
45
|
+
"name": "calendarToday"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "time-text",
|
|
49
|
+
"component": "Text",
|
|
50
|
+
"text": {
|
|
51
|
+
"call": "formatString",
|
|
52
|
+
"args": {
|
|
53
|
+
"value": "${formatDate(value: ${/start}, format: 'E, MMM d')} • ${formatDate(value: ${/start}, format: 'h:mm a')} - ${formatDate(value: ${/end}, format: 'h:mm a')}"
|
|
54
|
+
},
|
|
55
|
+
"returnType": "string"
|
|
56
|
+
},
|
|
57
|
+
"variant": "body"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "location-row",
|
|
61
|
+
"component": "Row",
|
|
62
|
+
"children": ["location-icon", "location-text"],
|
|
63
|
+
"align": "center"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "location-icon",
|
|
67
|
+
"component": "Icon",
|
|
68
|
+
"name": "locationOn"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "location-text",
|
|
72
|
+
"component": "Text",
|
|
73
|
+
"text": {
|
|
74
|
+
"path": "/location"
|
|
75
|
+
},
|
|
76
|
+
"variant": "body"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "description",
|
|
80
|
+
"component": "Text",
|
|
81
|
+
"text": {
|
|
82
|
+
"path": "/description"
|
|
83
|
+
},
|
|
84
|
+
"variant": "body"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "divider",
|
|
88
|
+
"component": "Divider"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "actions",
|
|
92
|
+
"component": "Row",
|
|
93
|
+
"children": ["accept-btn", "decline-btn"]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "accept-btn-text",
|
|
97
|
+
"component": "Text",
|
|
98
|
+
"text": "Accept"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "accept-btn",
|
|
102
|
+
"component": "Button",
|
|
103
|
+
"child": "accept-btn-text",
|
|
104
|
+
"action": {
|
|
105
|
+
"event": {
|
|
106
|
+
"name": "accept",
|
|
107
|
+
"context": {}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "decline-btn-text",
|
|
113
|
+
"component": "Text",
|
|
114
|
+
"text": "Decline"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "decline-btn",
|
|
118
|
+
"component": "Button",
|
|
119
|
+
"child": "decline-btn-text",
|
|
120
|
+
"action": {
|
|
121
|
+
"event": {
|
|
122
|
+
"name": "decline",
|
|
123
|
+
"context": {}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"version": "v0.9",
|
|
132
|
+
"updateDataModel": {
|
|
133
|
+
"surfaceId": "gallery-event-detail",
|
|
134
|
+
"value": {
|
|
135
|
+
"title": "Product Launch Meeting",
|
|
136
|
+
"start": "2025-12-19T14:00:00Z",
|
|
137
|
+
"end": "2025-12-19T15:30:00Z",
|
|
138
|
+
"location": "Conference Room A, Building 2",
|
|
139
|
+
"description": "Review final product specs and marketing materials before the Q1 launch."
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|