Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s
- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3) - Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung - Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü - Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person - Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“ - Benutzerverwaltung im Admin, Zugang vorläufig über is_admin - vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/ - PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung - VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7197eaebf2
commit
9c0f8de791
15771 changed files with 1564103 additions and 5 deletions
203
vendor/nunomaduro/termwind/src/ValueObjects/Node.php
vendored
Normal file
203
vendor/nunomaduro/termwind/src/ValueObjects/Node.php
vendored
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Termwind\ValueObjects;
|
||||
|
||||
use Generator;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class Node
|
||||
{
|
||||
/**
|
||||
* A value object with helper methods for working with DOM node.
|
||||
*/
|
||||
public function __construct(private \DOMNode $node) {}
|
||||
|
||||
/**
|
||||
* Gets the value of the node.
|
||||
*/
|
||||
public function getValue(): string
|
||||
{
|
||||
return $this->node->nodeValue ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets child nodes of the node.
|
||||
*
|
||||
* @return Generator<Node>
|
||||
*/
|
||||
public function getChildNodes(): Generator
|
||||
{
|
||||
foreach ($this->node->childNodes as $node) {
|
||||
yield new self($node);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the node is a text.
|
||||
*/
|
||||
public function isText(): bool
|
||||
{
|
||||
return $this->node instanceof \DOMText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the node is a comment.
|
||||
*/
|
||||
public function isComment(): bool
|
||||
{
|
||||
return $this->node instanceof \DOMComment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares the current node name with a given name.
|
||||
*/
|
||||
public function isName(string $name): bool
|
||||
{
|
||||
return $this->getName() === $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current node type name.
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->node->nodeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns value of [class] attribute.
|
||||
*/
|
||||
public function getClassAttribute(): string
|
||||
{
|
||||
return $this->getAttribute('class');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns value of attribute with a given name.
|
||||
*/
|
||||
public function getAttribute(string $name): string
|
||||
{
|
||||
if ($this->node instanceof \DOMElement) {
|
||||
return $this->node->getAttribute($name);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the node is empty.
|
||||
*/
|
||||
public function isEmpty(): bool
|
||||
{
|
||||
return $this->isText() && preg_replace('/\s+/', '', $this->getValue()) === '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the previous sibling from the node.
|
||||
*/
|
||||
public function getPreviousSibling(): ?static
|
||||
{
|
||||
$node = $this->node;
|
||||
|
||||
while ($node = $node->previousSibling) {
|
||||
$node = new self($node);
|
||||
|
||||
if ($node->isEmpty()) {
|
||||
$node = $node->node;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! $node->isComment()) {
|
||||
return $node;
|
||||
}
|
||||
|
||||
$node = $node->node;
|
||||
}
|
||||
|
||||
return is_null($node) ? null : new self($node);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the next sibling from the node.
|
||||
*/
|
||||
public function getNextSibling(): ?static
|
||||
{
|
||||
$node = $this->node;
|
||||
|
||||
while ($node = $node->nextSibling) {
|
||||
$node = new self($node);
|
||||
|
||||
if ($node->isEmpty()) {
|
||||
$node = $node->node;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (! $node->isComment()) {
|
||||
return $node;
|
||||
}
|
||||
|
||||
$node = $node->node;
|
||||
}
|
||||
|
||||
return is_null($node) ? null : new self($node);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the node is the first child.
|
||||
*/
|
||||
public function isFirstChild(): bool
|
||||
{
|
||||
return is_null($this->getPreviousSibling());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the inner HTML representation of the node including child nodes.
|
||||
*/
|
||||
public function getHtml(): string
|
||||
{
|
||||
$html = '';
|
||||
foreach ($this->node->childNodes as $child) {
|
||||
if ($child->ownerDocument instanceof \DOMDocument) {
|
||||
$html .= $child->ownerDocument->saveXML($child);
|
||||
}
|
||||
}
|
||||
|
||||
return html_entity_decode($html);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the node to a string.
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
if ($this->isComment()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($this->getValue() === ' ') {
|
||||
return ' ';
|
||||
}
|
||||
|
||||
if ($this->isEmpty()) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$text = preg_replace('/\s+/', ' ', $this->getValue()) ?? '';
|
||||
|
||||
if (is_null($this->getPreviousSibling())) {
|
||||
$text = ltrim($text);
|
||||
}
|
||||
|
||||
if (is_null($this->getNextSibling())) {
|
||||
$text = rtrim($text);
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
70
vendor/nunomaduro/termwind/src/ValueObjects/Style.php
vendored
Normal file
70
vendor/nunomaduro/termwind/src/ValueObjects/Style.php
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Termwind\ValueObjects;
|
||||
|
||||
use Closure;
|
||||
use Termwind\Actions\StyleToMethod;
|
||||
use Termwind\Exceptions\InvalidColor;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class Style
|
||||
{
|
||||
/**
|
||||
* Creates a new value object instance.
|
||||
*
|
||||
* @param Closure(Styles $styles, string|int ...$argument): Styles $callback
|
||||
*/
|
||||
public function __construct(private Closure $callback, private string $color = '')
|
||||
{
|
||||
// ..
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the given set of styles to the styles.
|
||||
*/
|
||||
public function apply(string $styles): void
|
||||
{
|
||||
$callback = clone $this->callback;
|
||||
|
||||
$this->callback = static function (
|
||||
Styles $formatter,
|
||||
string|int ...$arguments
|
||||
) use ($callback, $styles): Styles {
|
||||
$formatter = $callback($formatter, ...$arguments);
|
||||
|
||||
return StyleToMethod::multiple($formatter, $styles);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the color to the style.
|
||||
*/
|
||||
public function color(string $color): void
|
||||
{
|
||||
if (preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $color) < 1) {
|
||||
throw new InvalidColor(sprintf('The color %s is invalid.', $color));
|
||||
}
|
||||
|
||||
$this->color = $color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the color.
|
||||
*/
|
||||
public function getColor(): string
|
||||
{
|
||||
return $this->color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Styles the given formatter with this style.
|
||||
*/
|
||||
public function __invoke(Styles $styles, string|int ...$arguments): Styles
|
||||
{
|
||||
return ($this->callback)($styles, ...$arguments);
|
||||
}
|
||||
}
|
||||
1061
vendor/nunomaduro/termwind/src/ValueObjects/Styles.php
vendored
Normal file
1061
vendor/nunomaduro/termwind/src/ValueObjects/Styles.php
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue