From 5185caa7f3eb18679d8fa7db4d6e52725af65b43 Mon Sep 17 00:00:00 2001 From: Casey Dwyer Date: Mon, 9 Oct 2023 14:47:28 -0500 Subject: [PATCH 01/36] [4.x] Bug: Fix Section fieldtype first-child's top-margin (#8822) --- resources/css/components/fieldtypes/section.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/css/components/fieldtypes/section.css b/resources/css/components/fieldtypes/section.css index dca53e719f..5600d19185 100644 --- a/resources/css/components/fieldtypes/section.css +++ b/resources/css/components/fieldtypes/section.css @@ -9,11 +9,11 @@ &.form-group { position: relative; &:first-child { - @apply rounded-t-md border-t-0; + @apply mt-0 rounded-t-md border-t-0; } &:last-child { - @apply rounded-b-md mt-0; + @apply rounded-b-md; } .field-inner > label { From 20f159e2d7f6205ee345ca4e6ab022a9cf4e132f Mon Sep 17 00:00:00 2001 From: John Koster Date: Mon, 9 Oct 2023 15:02:57 -0500 Subject: [PATCH 02/36] [4.x] Makes using the Icon fieldtype with the SVG tag simpler (#8815) --- src/Fieldtypes/Icon.php | 4 +++- src/Tags/Svg.php | 6 ++++++ tests/Fieldtypes/IconTest.php | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/Fieldtypes/IconTest.php diff --git a/src/Fieldtypes/Icon.php b/src/Fieldtypes/Icon.php index 362bf7bb47..33ab650204 100644 --- a/src/Fieldtypes/Icon.php +++ b/src/Fieldtypes/Icon.php @@ -9,6 +9,8 @@ class Icon extends Fieldtype { + public const DEFAULT_FOLDER = 'regular'; + protected $categories = ['media']; protected $icon = 'icon_picker'; @@ -71,7 +73,7 @@ private function resolveParts() $folder = $this->config( 'folder', - $hasConfiguredDirectory ? null : 'regular' // Only apply a default folder if using Statamic icons. + $hasConfiguredDirectory ? null : self::DEFAULT_FOLDER // Only apply a default folder if using Statamic icons. ); $path = Path::tidy($directory.'/'.$folder); diff --git a/src/Tags/Svg.php b/src/Tags/Svg.php index 212ff3999b..8ac9d502ce 100644 --- a/src/Tags/Svg.php +++ b/src/Tags/Svg.php @@ -5,6 +5,7 @@ use Rhukster\DomSanitizer\DOMSanitizer; use Statamic\Facades\File; use Statamic\Facades\URL; +use Statamic\Fieldtypes\Icon; use Statamic\Support\Str; use Stringy\StaticStringy; @@ -28,6 +29,7 @@ public function index() resource_path(), public_path('svg'), public_path(), + statamic_path('resources/svg/icons/'.Icon::DEFAULT_FOLDER), ]; $svg = null; @@ -42,6 +44,10 @@ public function index() } } + if (! $svg && Str::startsWith(mb_strtolower(trim($name)), 'params->get('src'); + } + $attributes = $this->renderAttributesFromParams(['src', 'title', 'desc']); if ($this->params->get('title') || $this->params->get('desc')) { diff --git a/tests/Fieldtypes/IconTest.php b/tests/Fieldtypes/IconTest.php new file mode 100644 index 0000000000..9600b1c876 --- /dev/null +++ b/tests/Fieldtypes/IconTest.php @@ -0,0 +1,33 @@ + new Value('add', $this->fieldtype())]); + + $this->assertStringContainsString(' new Value('add', $this->fieldtype())]); + + $this->assertStringContainsString('setField(new Field('test', array_merge(['type' => 'icon'], $config))); + } +} From a44049705eab98c659422f11d88d83e52da32c51 Mon Sep 17 00:00:00 2001 From: Jack Sleight Date: Mon, 9 Oct 2023 21:03:58 +0100 Subject: [PATCH 03/36] [4.x] Bard link email, phone and relationship options (#8777) Co-authored-by: Jason Varga --- .../fieldtypes/bard/LinkToolbar.vue | 202 ++++++++++++------ .../fieldtypes/bard/LinkToolbarButton.vue | 2 +- src/Fieldtypes/Bard/LinkMark.php | 7 + 3 files changed, 148 insertions(+), 63 deletions(-) diff --git a/resources/js/components/fieldtypes/bard/LinkToolbar.vue b/resources/js/components/fieldtypes/bard/LinkToolbar.vue index 448ac259b5..46b12e46ed 100644 --- a/resources/js/components/fieldtypes/bard/LinkToolbar.vue +++ b/resources/js/components/fieldtypes/bard/LinkToolbar.vue @@ -2,68 +2,93 @@