@a2uicatalog/mcp 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/README.md +93 -0
- package/data/a2ui-state-v1.json +731 -0
- package/data/artemis-roadmap.json +341 -0
- package/data/atoms-index.json +4612 -0
- package/data/expenses-demo.json +140 -0
- package/data/spec.json +14644 -0
- package/demo.mjs +63 -0
- package/package.json +25 -0
- package/scripts/sync-data.mjs +47 -0
- package/server.mjs +235 -0
- package/test.mjs +70 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"type": "a2ui_wired_surface",
|
|
4
|
+
"title": "Expense Requests",
|
|
5
|
+
"theme": "light",
|
|
6
|
+
|
|
7
|
+
"app": {
|
|
8
|
+
"id": "expenses-simple",
|
|
9
|
+
"name": "Expense Request",
|
|
10
|
+
"scope": "single_user",
|
|
11
|
+
"lifecycle": "persistent",
|
|
12
|
+
"auth": { "mode": "publisher" },
|
|
13
|
+
"storage": { "type": "my_drive", "sheet": "A2UI_Expenses" },
|
|
14
|
+
"data": { "isolation": "none" },
|
|
15
|
+
"access": "workspace_only"
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
"state_primitives": [
|
|
19
|
+
{ "id": "amount_mem", "primitive": "ValueStore", "props": { "initialValue": "" } },
|
|
20
|
+
{ "id": "category_mem", "primitive": "ValueStore", "props": { "initialValue": "" } },
|
|
21
|
+
{ "id": "desc_mem", "primitive": "ValueStore", "props": { "initialValue": "" } },
|
|
22
|
+
{ "id": "search_mem", "primitive": "ValueStore", "props": { "initialValue": "" } },
|
|
23
|
+
{
|
|
24
|
+
"id": "expense_filter",
|
|
25
|
+
"primitive": "ArrayFilter",
|
|
26
|
+
"props": { "filterKey": "description", "source": [] },
|
|
27
|
+
"wire": { "query": "#search_mem.value" }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "amount_check",
|
|
31
|
+
"primitive": "StringValidator",
|
|
32
|
+
"props": {
|
|
33
|
+
"source": "#amount_mem.value",
|
|
34
|
+
"pattern": "^\\d+(\\.\\d{0,2})?$",
|
|
35
|
+
"errorMessage": "Enter a valid amount, e.g. 25.50"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
|
|
40
|
+
"actions": [
|
|
41
|
+
{
|
|
42
|
+
"id": "load_expenses",
|
|
43
|
+
"type": "gas:sheet_query",
|
|
44
|
+
"trigger": "onLoad",
|
|
45
|
+
"props": { "sheet": "A2UI_Expenses" },
|
|
46
|
+
"wire": { "result": "#expense_filter.source" }
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "submit_expense",
|
|
50
|
+
"type": "gas:sheet_append",
|
|
51
|
+
"props": {
|
|
52
|
+
"sheet": "A2UI_Expenses",
|
|
53
|
+
"collect": {
|
|
54
|
+
"Date": "{{now}}",
|
|
55
|
+
"Category": "#category_mem.value",
|
|
56
|
+
"Description": "#desc_mem.value",
|
|
57
|
+
"Amount": "#amount_mem.value"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"onSuccess": ["load_expenses"]
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
|
|
64
|
+
"layout": [
|
|
65
|
+
{
|
|
66
|
+
"atom": "heading",
|
|
67
|
+
"props": { "text": "Expense Requests", "level": 2 }
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"atom": "text_input",
|
|
71
|
+
"id": "search-field",
|
|
72
|
+
"props": { "label": "Search expenses", "placeholder": "e.g. Travel" },
|
|
73
|
+
"wire": { "onChange": "#search_mem.setValue" }
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"atom": "data_table",
|
|
77
|
+
"id": "expense-table",
|
|
78
|
+
"props": {
|
|
79
|
+
"columns": ["date", "category", "description", "amount"],
|
|
80
|
+
"emptyMessage": "No expenses yet. Submit one below."
|
|
81
|
+
},
|
|
82
|
+
"wire": { "rows": "#expense_filter.output" }
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"atom": "heading",
|
|
86
|
+
"props": { "text": "New Expense", "level": 3 }
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"atom": "text_input",
|
|
90
|
+
"id": "category-field",
|
|
91
|
+
"props": { "label": "Category", "placeholder": "e.g. Travel, Software" },
|
|
92
|
+
"wire": { "onChange": "#category_mem.setValue" }
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"atom": "text_input",
|
|
96
|
+
"id": "desc-field",
|
|
97
|
+
"props": { "label": "Description", "placeholder": "e.g. Train to London" },
|
|
98
|
+
"wire": { "onChange": "#desc_mem.setValue" }
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"atom": "text_input",
|
|
102
|
+
"id": "amount-field",
|
|
103
|
+
"props": { "label": "Amount (£)", "placeholder": "e.g. 25.50" },
|
|
104
|
+
"wire": { "onChange": "#amount_mem.setValue" }
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"atom": "inline_feedback_message",
|
|
108
|
+
"id": "amount-error",
|
|
109
|
+
"props": { "type": "warning", "text": "Enter a valid amount, e.g. 25.50" },
|
|
110
|
+
"wire": { "visible": "#amount_check.isInvalid" }
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"atom": "inline_feedback_message",
|
|
114
|
+
"id": "submit-pending",
|
|
115
|
+
"props": { "type": "info", "text": "Submitting…" },
|
|
116
|
+
"wire": { "visible": "#submit_expense.isPending" }
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"atom": "inline_feedback_message",
|
|
120
|
+
"id": "submit-success",
|
|
121
|
+
"props": { "type": "success", "text": "Expense submitted. Table updated." },
|
|
122
|
+
"wire": { "visible": "#submit_expense.isSuccess" }
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"atom": "inline_feedback_message",
|
|
126
|
+
"id": "submit-error",
|
|
127
|
+
"props": { "type": "error", "text": "Submit failed." },
|
|
128
|
+
"wire": { "visible": "#submit_expense.isError", "text": "#submit_expense.error" }
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"atom": "ripple_button",
|
|
132
|
+
"id": "submit-btn",
|
|
133
|
+
"props": { "label": "Submit Expense", "accent": "#6366f1" },
|
|
134
|
+
"wire": {
|
|
135
|
+
"onClick": "#submit_expense.run",
|
|
136
|
+
"disabled": "#amount_check.isNotValid"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|