Skip to content

Commit 038beca

Browse files
committed
feat: extend webTypes with expressions
1 parent f1f9488 commit 038beca

File tree

1 file changed

+169
-0
lines changed

1 file changed

+169
-0
lines changed

src/main/resources/META-INF/webTypes.json

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,31 @@
1212
"pattern": {
1313
"regex": "x-.+"
1414
},
15+
"attributes": [
16+
{
17+
"name": "Component Attribute Expression",
18+
"pattern": {
19+
"regex": ":.+"
20+
},
21+
"inject-language": "InjectablePHP",
22+
"value": {
23+
"type": "string",
24+
"required": false
25+
},
26+
"virtual": true
27+
},
28+
{
29+
"name": "Component Attribute",
30+
"pattern": {
31+
"regex": ".+"
32+
},
33+
"value": {
34+
"type": "string",
35+
"required": false
36+
},
37+
"virtual": true
38+
}
39+
],
1540
"doc-url": "https://tempestphp.com/1.x/internals/view-spec",
1641
"virtual": true
1742
},
@@ -20,6 +45,15 @@
2045
"description": "<p>A base template you can install into your own project as a starting point. This one includes the <strong>Tailwind CDN</strong> for quick prototyping.</p><p><strong>Available named slots:</strong></p><ul><li><code>head</code></li><li><code>scripts</code></li></ul>",
2146
"doc-url": "https://tempestphp.com/1.x/internals/view-spec#x-base",
2247
"attributes": [
48+
{
49+
"name": ":title",
50+
"description": "The webpage's title",
51+
"inject-language": "InjectablePHP",
52+
"value": {
53+
"type": "string",
54+
"required": false
55+
}
56+
},
2357
{
2458
"name": "title",
2559
"description": "The webpage's title",
@@ -35,6 +69,15 @@
3569
"description": "<p>This component provides a form element that will post by default and includes the csrf token out of the box.</p>",
3670
"doc-url": "https://tempestphp.com/1.x/internals/view-spec#x-form",
3771
"attributes": [
72+
{
73+
"name": ":action",
74+
"description": "",
75+
"inject-language": "InjectablePHP",
76+
"value": {
77+
"type": "string",
78+
"required": false
79+
}
80+
},
3881
{
3982
"name": "action",
4083
"description": "",
@@ -43,6 +86,15 @@
4386
"required": false
4487
}
4588
},
89+
{
90+
"name": ":method",
91+
"description": "",
92+
"inject-language": "InjectablePHP",
93+
"value": {
94+
"type": "string",
95+
"required": false
96+
}
97+
},
4698
{
4799
"name": "method",
48100
"description": "",
@@ -51,6 +103,15 @@
51103
"required": false
52104
}
53105
},
106+
{
107+
"name": ":enctype",
108+
"description": "",
109+
"inject-language": "InjectablePHP",
110+
"value": {
111+
"type": "string",
112+
"required": false
113+
}
114+
},
54115
{
55116
"name": "enctype",
56117
"description": "",
@@ -66,6 +127,15 @@
66127
"description": "<p>A versatile input component that will render labels and validation errors automatically.</p>",
67128
"doc-url": "https://tempestphp.com/1.x/internals/view-spec#x-input",
68129
"attributes": [
130+
{
131+
"name": ":name",
132+
"description": "",
133+
"inject-language": "InjectablePHP",
134+
"value": {
135+
"type": "string",
136+
"required": true
137+
}
138+
},
69139
{
70140
"name": "name",
71141
"description": "",
@@ -74,6 +144,15 @@
74144
"required": true
75145
}
76146
},
147+
{
148+
"name": ":label",
149+
"description": "",
150+
"inject-language": "InjectablePHP",
151+
"value": {
152+
"type": "string",
153+
"required": false
154+
}
155+
},
77156
{
78157
"name": "label",
79158
"description": "",
@@ -82,6 +161,15 @@
82161
"required": false
83162
}
84163
},
164+
{
165+
"name": ":id",
166+
"description": "",
167+
"inject-language": "InjectablePHP",
168+
"value": {
169+
"type": "string",
170+
"required": false
171+
}
172+
},
85173
{
86174
"name": "id",
87175
"description": "",
@@ -90,6 +178,15 @@
90178
"required": false
91179
}
92180
},
181+
{
182+
"name": ":type",
183+
"description": "",
184+
"inject-language": "InjectablePHP",
185+
"value": {
186+
"type": "string",
187+
"required": false
188+
}
189+
},
93190
{
94191
"name": "type",
95192
"description": "",
@@ -98,6 +195,15 @@
98195
"required": false
99196
}
100197
},
198+
{
199+
"name": ":default",
200+
"description": "",
201+
"inject-language": "InjectablePHP",
202+
"value": {
203+
"type": "string",
204+
"required": false
205+
}
206+
},
101207
{
102208
"name": "default",
103209
"description": "",
@@ -123,6 +229,15 @@
123229
"description": "<p>This component provides the ability to inject any icon from the Iconify project in your templates.</p>",
124230
"doc-url": "https://tempestphp.com/1.x/internals/view-spec#x-icon",
125231
"attributes": [
232+
{
233+
"name": ":name",
234+
"description": "",
235+
"inject-language": "InjectablePHP",
236+
"value": {
237+
"type": "string",
238+
"required": true
239+
}
240+
},
126241
{
127242
"name": "name",
128243
"description": "",
@@ -131,6 +246,15 @@
131246
"required": true
132247
}
133248
},
249+
{
250+
"name": ":class",
251+
"description": "",
252+
"inject-language": "InjectablePHP",
253+
"value": {
254+
"type": "string",
255+
"required": false
256+
}
257+
},
134258
{
135259
"name": "class",
136260
"description": "",
@@ -146,6 +270,15 @@
146270
"description": "<p>Tempest has built-in support for Vite, the most popular front-end development server and build tool. This component simply inject registered entrypoints where it is called.</p>",
147271
"doc-url": "https://tempestphp.com/1.x/internals/view-spec#x-vite-tags",
148272
"attributes": [
273+
{
274+
"name": ":entrypoints",
275+
"description": "",
276+
"inject-language": "InjectablePHP",
277+
"value": {
278+
"type": "array",
279+
"required": false
280+
}
281+
},
149282
{
150283
"name": "entrypoints",
151284
"description": "",
@@ -154,6 +287,15 @@
154287
"required": false
155288
}
156289
},
290+
{
291+
"name": ":entrypoint",
292+
"description": "",
293+
"inject-language": "InjectablePHP",
294+
"value": {
295+
"type": "string",
296+
"required": false
297+
}
298+
},
157299
{
158300
"name": "entrypoint",
159301
"description": "",
@@ -174,6 +316,15 @@
174316
"description": "",
175317
"doc-url": "https://tempestphp.com/1.x/internals/view-spec#x-slot",
176318
"attributes": [
319+
{
320+
"name": ":name",
321+
"description": "The name of the slot",
322+
"inject-language": "InjectablePHP",
323+
"value": {
324+
"type": "string",
325+
"required": false
326+
}
327+
},
177328
{
178329
"name": "name",
179330
"description": "The name of the slot",
@@ -189,6 +340,15 @@
189340
"description": "",
190341
"doc-url": "https://tempestphp.com/1.x/internals/view-spec#x-markdown",
191342
"attributes": [
343+
{
344+
"name": ":content",
345+
"description": "The markdown content from a variable",
346+
"inject-language": "InjectablePHP",
347+
"value": {
348+
"type": "string",
349+
"required": false
350+
}
351+
},
192352
{
193353
"name": "content",
194354
"description": "The markdown content from a variable",
@@ -204,6 +364,15 @@
204364
"description": "",
205365
"doc-url": "https://tempestphp.com/1.x/internals/view-spec#x-component",
206366
"attributes": [
367+
{
368+
"name": ":is",
369+
"description": "",
370+
"inject-language": "InjectablePHP",
371+
"value": {
372+
"type": "string",
373+
"required": true
374+
}
375+
},
207376
{
208377
"name": "is",
209378
"description": "",

0 commit comments

Comments
 (0)