Skip to content

Commit 89fa6b8

Browse files
committed
fix: preserve blocks, remove content
1 parent 20c9729 commit 89fa6b8

100 files changed

Lines changed: 0 additions & 312 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/TemplateGenerator/TwigComponentsGenerator.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ public function renderComponentClass(HTMLElementDelegatorInterface $element): st
212212
}
213213
}
214214

215-
// Add content property for Block and Inline elements
216-
if ($level === 'block' || $level === 'inline') {
217-
$props['content'] = [
218-
'type' => 'string',
219-
'enumClass' => null,
220-
'allowedTypes' => ['string'],
221-
'needsNormalizer' => false,
222-
];
223-
}
224-
225215
// Get element metadata from class-level doc comment
226216
$docComment = $ref->getDocComment();
227217
$desc = '';
@@ -274,11 +264,6 @@ public function renderComponentClass(HTMLElementDelegatorInterface $element): st
274264
$typeDeclaration = '?' . $shortName;
275265
}
276266

277-
// Content property should default to empty string
278-
// if ($propName === 'content') {
279-
// $defaultValue = "''";
280-
// }
281-
282267
$php .= " public {$typeDeclaration} \${$propName} = {$defaultValue};\n";
283268
}
284269

templates/twig-component/src/Twig/Block/Article.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class Article
6060
public ?TranslateEnum $translate = null;
6161
public ?string $id = null;
6262
public ?string $class = null;
63-
public string $content = null;
6463

6564
#[PreMount]
6665
public function preMount(array $data): array
@@ -200,8 +199,6 @@ public function preMount(array $data): array
200199
$resolver->setAllowedTypes('id', ['null', 'string']);
201200
$resolver->setDefaults(['class' => null]);
202201
$resolver->setAllowedTypes('class', ['null', 'string']);
203-
$resolver->setDefined('content');
204-
$resolver->setAllowedTypes('content', ['string']);
205202

206203
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
207204
}

templates/twig-component/src/Twig/Block/Aside.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class Aside
6161
public ?TranslateEnum $translate = null;
6262
public ?string $id = null;
6363
public ?string $class = null;
64-
public string $content = null;
6564

6665
#[PreMount]
6766
public function preMount(array $data): array
@@ -203,8 +202,6 @@ public function preMount(array $data): array
203202
$resolver->setAllowedTypes('id', ['null', 'string']);
204203
$resolver->setDefaults(['class' => null]);
205204
$resolver->setAllowedTypes('class', ['null', 'string']);
206-
$resolver->setDefined('content');
207-
$resolver->setAllowedTypes('content', ['string']);
208205

209206
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
210207
}

templates/twig-component/src/Twig/Block/Audio.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class Audio
5757
public ?TranslateEnum $translate = null;
5858
public ?string $id = null;
5959
public ?string $class = null;
60-
public string $content = null;
6160

6261
#[PreMount]
6362
public function preMount(array $data): array
@@ -179,8 +178,6 @@ public function preMount(array $data): array
179178
$resolver->setAllowedTypes('id', ['null', 'string']);
180179
$resolver->setDefaults(['class' => null]);
181180
$resolver->setAllowedTypes('class', ['null', 'string']);
182-
$resolver->setDefined('content');
183-
$resolver->setAllowedTypes('content', ['string']);
184181

185182
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
186183
}

templates/twig-component/src/Twig/Block/Blockquote.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class Blockquote
6262
public ?TranslateEnum $translate = null;
6363
public ?string $id = null;
6464
public ?string $class = null;
65-
public string $content = null;
6665

6766
#[PreMount]
6867
public function preMount(array $data): array
@@ -210,8 +209,6 @@ public function preMount(array $data): array
210209
$resolver->setAllowedTypes('id', ['null', 'string']);
211210
$resolver->setDefaults(['class' => null]);
212211
$resolver->setAllowedTypes('class', ['null', 'string']);
213-
$resolver->setDefined('content');
214-
$resolver->setAllowedTypes('content', ['string']);
215212

216213
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
217214
}

templates/twig-component/src/Twig/Block/Body.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class Body
4747
public ?TranslateEnum $translate = null;
4848
public ?string $id = null;
4949
public ?string $class = null;
50-
public string $content = null;
5150

5251
#[PreMount]
5352
public function preMount(array $data): array
@@ -121,8 +120,6 @@ public function preMount(array $data): array
121120
$resolver->setAllowedTypes('id', ['null', 'string']);
122121
$resolver->setDefaults(['class' => null]);
123122
$resolver->setAllowedTypes('class', ['null', 'string']);
124-
$resolver->setDefined('content');
125-
$resolver->setAllowedTypes('content', ['string']);
126123

127124
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
128125
}

templates/twig-component/src/Twig/Block/Canvas.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class Canvas
6363
public ?TranslateEnum $translate = null;
6464
public ?string $id = null;
6565
public ?string $class = null;
66-
public string $content = null;
6766

6867
#[PreMount]
6968
public function preMount(array $data): array
@@ -213,8 +212,6 @@ public function preMount(array $data): array
213212
$resolver->setAllowedTypes('id', ['null', 'string']);
214213
$resolver->setDefaults(['class' => null]);
215214
$resolver->setAllowedTypes('class', ['null', 'string']);
216-
$resolver->setDefined('content');
217-
$resolver->setAllowedTypes('content', ['string']);
218215

219216
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
220217
}

templates/twig-component/src/Twig/Block/Caption.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class Caption
6161
public ?TranslateEnum $translate = null;
6262
public ?string $id = null;
6363
public ?string $class = null;
64-
public string $content = null;
6564

6665
#[PreMount]
6766
public function preMount(array $data): array
@@ -207,8 +206,6 @@ public function preMount(array $data): array
207206
$resolver->setAllowedTypes('id', ['null', 'string']);
208207
$resolver->setDefaults(['class' => null]);
209208
$resolver->setAllowedTypes('class', ['null', 'string']);
210-
$resolver->setDefined('content');
211-
$resolver->setAllowedTypes('content', ['string']);
212209

213210
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
214211
}

templates/twig-component/src/Twig/Block/Colgroup.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class Colgroup
2727
public ?string $style = null;
2828
public ?string $id = null;
2929
public ?string $class = null;
30-
public string $content = null;
3130

3231
#[PreMount]
3332
public function preMount(array $data): array
@@ -57,8 +56,6 @@ public function preMount(array $data): array
5756
$resolver->setAllowedTypes('id', ['null', 'string']);
5857
$resolver->setDefaults(['class' => null]);
5958
$resolver->setAllowedTypes('class', ['null', 'string']);
60-
$resolver->setDefined('content');
61-
$resolver->setAllowedTypes('content', ['string']);
6259

6360
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
6461
}

templates/twig-component/src/Twig/Block/Datalist.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class Datalist
6161
public ?TranslateEnum $translate = null;
6262
public ?string $id = null;
6363
public ?string $class = null;
64-
public string $content = null;
6564

6665
#[PreMount]
6766
public function preMount(array $data): array
@@ -207,8 +206,6 @@ public function preMount(array $data): array
207206
$resolver->setAllowedTypes('id', ['null', 'string']);
208207
$resolver->setDefaults(['class' => null]);
209208
$resolver->setAllowedTypes('class', ['null', 'string']);
210-
$resolver->setDefined('content');
211-
$resolver->setAllowedTypes('content', ['string']);
212209

213210
return $resolver->resolve($data) + ['blocks' => $data['blocks']];
214211
}

0 commit comments

Comments
 (0)