Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
5.2.4
=====

* (improvement) Pass `fullData` in all link variants.


5.2.3
=====

Expand Down
1 change: 1 addition & 0 deletions src/Field/Data/AssetLinkData.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public function __construct (
public readonly string $url,
public readonly ?int $width,
public readonly ?int $height,
public readonly array $fullData,
) {}
}
1 change: 1 addition & 0 deletions src/Field/Data/EmailLinkData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ final class EmailLinkData
{
public function __construct (
public readonly string $email,
public readonly array $fullData,
) {}
}
1 change: 1 addition & 0 deletions src/Field/Data/ExternalLinkData.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ final class ExternalLinkData
{
public function __construct (
public readonly string $url,
public readonly array $fullData,
) {}
}
1 change: 1 addition & 0 deletions src/Field/Data/RichTextAssetLinkData.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ public function __construct (
public readonly ?string $anchor,
public readonly ?string $target,
public readonly ?array $custom,
public readonly array $fullData,
) {}
}
1 change: 1 addition & 0 deletions src/Field/Data/RichTextEmailLinkData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public function __construct (
public readonly string $email,
public readonly ?string $anchor,
public readonly ?string $target,
public readonly array $fullData,
) {}
}
1 change: 1 addition & 0 deletions src/Field/Data/RichTextExternalLinkData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public function __construct (
public readonly string $href,
public readonly ?string $anchor,
public readonly ?string $target,
public readonly array $fullData,
) {}
}
1 change: 1 addition & 0 deletions src/Field/Data/RichTextStoryLinkData.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public function __construct (
public readonly ?string $uuid,
public readonly ?string $anchor,
public readonly ?string $target,
public readonly array $fullData,
) {}
}
6 changes: 3 additions & 3 deletions src/Field/Definition/LinkField.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private function transformDataToLink (
$email = $context->normalizeOptionalString($data["email"]);

return null !== $email
? new EmailLinkData($email)
? new EmailLinkData($email, $data)
: null;
}

Expand All @@ -193,14 +193,14 @@ private function transformDataToLink (

[$width, $height] = $context->extractImageDimensions($url);

return new AssetLinkData($url, $width, $height);
return new AssetLinkData($url, $width, $height, $data);
}

// "url" === $data["linktype"]
$url = $context->normalizeOptionalString($data["url"]);

return null !== $url
? new ExternalLinkData($url)
? new ExternalLinkData($url, $data)
: null;
}
}
4 changes: 4 additions & 0 deletions src/RichText/LinkMarksRichTextTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected function transformData (array $data) : mixed
uuid: $uuid,
anchor: $data["anchor"] ?? null,
target: $data["target"],
fullData: $data,
);
}

Expand All @@ -51,6 +52,7 @@ protected function transformData (array $data) : mixed
email: $email,
anchor: $data["anchor"] ?? null,
target: $data["target"],
fullData: $data,
)
: null;
}
Expand All @@ -70,6 +72,7 @@ protected function transformData (array $data) : mixed
anchor: $data["anchor"] ?? null,
target: $data["target"],
custom: $data["custom"] ?? null,
fullData: $data,
);
}

Expand All @@ -82,6 +85,7 @@ protected function transformData (array $data) : mixed
href: $href,
anchor: $data["anchor"] ?? null,
target: $data["target"],
fullData: $data,
)
: null;
}
Expand Down
Loading