Loading core/assets/schemas/v1/metadata-full.schema.json +5 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,11 @@ "obsolete" ] }, "noUi": { "type": "boolean", "title": "Exclude from UI", "description": "Use this property to exclude a component from the UI." }, "props": { "$ref": "#/$defs/propDefinition" }, Loading core/assets/schemas/v1/metadata.schema.json +5 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,11 @@ "obsolete" ] }, "noUi": { "type": "boolean", "title": "Exclude from UI", "description": "Use this property to exclude a component from the UI." }, "props": { "$ref": "#/$defs/propDefinition" }, Loading core/lib/Drupal/Core/Theme/Component/ComponentMetadata.php +6 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,11 @@ class ComponentMetadata { */ public readonly array $variants; /** * Internal component, hidden in ui. */ public readonly bool $noUi; /** * ComponentMetadata constructor. * Loading Loading @@ -140,6 +145,7 @@ public function __construct(array $metadata_info, string $app_root, bool $enforc $this->schema = $this->parseSchemaInfo($metadata_info); $this->slots = $metadata_info['slots'] ?? []; $this->variants = $metadata_info['variants'] ?? []; $this->noUi = $metadata_info['noUi'] ?? FALSE; } /** Loading core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php +10 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ public function testMetadata(array $metadata_info, array $expectations): void { $this->assertSame($expectations['status'], $metadata->status); $this->assertSame($expectations['thumbnail'], $metadata->getThumbnailPath()); $this->assertEquals($expectations['props'], $metadata->schema); $this->assertEquals($expectations['noUi'] ?? TRUE, $metadata->noUi); } /** Loading Loading @@ -62,12 +63,14 @@ public static function dataProviderMetadata(): array { 'libraryOverrides' => ['dependencies' => ['core/drupal']], 'group' => 'my-group', 'description' => 'My description', 'noUi' => TRUE, ], [ 'path' => 'bar/component-name', 'status' => 'stable', 'thumbnail' => '', 'props' => NULL, 'noUi' => TRUE, ], TRUE, ], Loading @@ -81,6 +84,7 @@ public static function dataProviderMetadata(): array { 'description' => 'JavaScript enhanced button that tracks the number of times a user clicked it.', 'libraryOverrides' => ['dependencies' => ['core/drupal']], 'group' => 'my-group', 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -110,6 +114,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -185,6 +190,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -248,6 +254,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -316,6 +323,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -392,6 +400,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -467,6 +476,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading
core/assets/schemas/v1/metadata-full.schema.json +5 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,11 @@ "obsolete" ] }, "noUi": { "type": "boolean", "title": "Exclude from UI", "description": "Use this property to exclude a component from the UI." }, "props": { "$ref": "#/$defs/propDefinition" }, Loading
core/assets/schemas/v1/metadata.schema.json +5 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,11 @@ "obsolete" ] }, "noUi": { "type": "boolean", "title": "Exclude from UI", "description": "Use this property to exclude a component from the UI." }, "props": { "$ref": "#/$defs/propDefinition" }, Loading
core/lib/Drupal/Core/Theme/Component/ComponentMetadata.php +6 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,11 @@ class ComponentMetadata { */ public readonly array $variants; /** * Internal component, hidden in ui. */ public readonly bool $noUi; /** * ComponentMetadata constructor. * Loading Loading @@ -140,6 +145,7 @@ public function __construct(array $metadata_info, string $app_root, bool $enforc $this->schema = $this->parseSchemaInfo($metadata_info); $this->slots = $metadata_info['slots'] ?? []; $this->variants = $metadata_info['variants'] ?? []; $this->noUi = $metadata_info['noUi'] ?? FALSE; } /** Loading
core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php +10 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ public function testMetadata(array $metadata_info, array $expectations): void { $this->assertSame($expectations['status'], $metadata->status); $this->assertSame($expectations['thumbnail'], $metadata->getThumbnailPath()); $this->assertEquals($expectations['props'], $metadata->schema); $this->assertEquals($expectations['noUi'] ?? TRUE, $metadata->noUi); } /** Loading Loading @@ -62,12 +63,14 @@ public static function dataProviderMetadata(): array { 'libraryOverrides' => ['dependencies' => ['core/drupal']], 'group' => 'my-group', 'description' => 'My description', 'noUi' => TRUE, ], [ 'path' => 'bar/component-name', 'status' => 'stable', 'thumbnail' => '', 'props' => NULL, 'noUi' => TRUE, ], TRUE, ], Loading @@ -81,6 +84,7 @@ public static function dataProviderMetadata(): array { 'description' => 'JavaScript enhanced button that tracks the number of times a user clicked it.', 'libraryOverrides' => ['dependencies' => ['core/drupal']], 'group' => 'my-group', 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -110,6 +114,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -185,6 +190,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -248,6 +254,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -316,6 +323,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -392,6 +400,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading Loading @@ -467,6 +476,7 @@ public static function dataProviderMetadata(): array { 'thumbnail' => '', 'group' => 'my-group', 'additionalProperties' => FALSE, 'noUi' => FALSE, 'props' => [ 'type' => 'object', 'required' => ['text'], Loading