1616 :state-path =" $getStatePath()"
1717 :arguments =" ['row' => -1]"
1818 :shown =" count($state) === 0"
19- :label =" count($state) === 0 ? 'Start from scratch' : 'Insert block'"
19+ :label =" count($state) === 0 ? __('filament-architect::admin.start from scratch') : __('filament-architect::admin.insert block') "
2020 :aligned =" count($state) === 0 ? 'left' : 'center'"
2121 >
2222 @if (count ($state ) === 0 && $getHasTemplates () )
@@ -34,73 +34,76 @@ class="w-full flex flex-col gap-2"
3434 >
3535 @foreach ($state ?? [] as $rowKey => $row )
3636 <div
37- class =" w-full flex gap-2 px-2 items-center "
37+ class =" @container "
3838 x-sortable-item =" {{ $rowKey } }"
3939 >
40- <div class =" grow flex flex-col gap-2" >
41- <div class =" grow flex gap-2 items-center" >
42- <div class =" flex flex-col gap-2" >
43- @if (count ($row ) < $getMaxFieldsPerRow () )
44- <x-filament-architect::icon-button
45- :action =" $getAction('addBlockBetween')"
46- :state-path =" $getStatePath()"
47- :arguments =" ['row' => $rowKey, 'insertAfter' => 0]"
48- />
49- @endif
40+ <div class =" w-full flex gap-2 @sm :px-2 items-center" >
41+ <div class =" grow flex flex-col gap-2" >
42+ <div class =" grow flex gap-2 items-center" >
43+ <div class =" flex flex-col gap-2" >
44+ @if (count ($row ) < $getMaxFieldsPerRow () )
45+ <x-filament-architect::icon-button
46+ :action =" $getAction('addBlockBetween')"
47+ :state-path =" $getStatePath()"
48+ :arguments =" ['row' => $rowKey, 'insertAfter' => 0]"
49+ />
50+ @endif
5051
51- @if (count ($state ) > 1 )
52- <x-filament::icon-button
53- color =" gray"
54- icon =" heroicon-o-arrows-up-down"
55- class =" border-2 dark:bg-white/5 dark:hover:bg-white/10 dark:border-gray-700 cursor-move m-0"
56- :size =" Size ::Small"
57- :icon-size =" IconSize::Small"
58- x-sortable-handle
59- />
60- @endif
61- </div >
52+ @if (count ($state ) > 1 )
53+ <x-filament::icon-button
54+ color =" gray"
55+ icon =" heroicon-o-arrows-up-down"
56+ class =" border-2 dark:bg-white/5 dark:hover:bg-white/10 dark:border-gray-700 cursor-move m-0"
57+ :size =" ActionSize ::Small"
58+ :icon-size =" IconSize::Small"
59+ x-sortable-handle
60+ />
61+ @endif
62+ </div >
6263
63- <div
64- class =" grow w-full grid gap-2 grid-cols-12"
65- x-sortable
66- x-on:end.stop =" $wire.callSchemaComponentMethod(@js ($key ), 'reorderColumn', {
67- newKeys: $event.target.sortable.toArray(),
68- row: '{{ $rowKey } } ',
69- })"
70- >
71- @foreach ($row as $uuid => $block )
72- <x-filament-architect::input-row
73- :uuid =" $uuid"
74- :row =" $row"
75- :row-key =" $rowKey"
76- :block =" $block"
77- :blocks =" $getBlocks()"
78- :locales =" $locales"
79- :state-path =" $statePath"
80- :get-action =" $getAction"
81- :can-add-fields =" count($row) < $getMaxFieldsPerRow()"
82- :has-duplicate-action =" $getHasDuplicateAction()"
83- :loop =" $loop"
84- :has-shown-button =" $getHasShownButton()"
85- />
86- @endforeach
64+ <div
65+ class =" grow w-full grid gap-2 grid-cols-12"
66+ x-sortable
67+ x-on:end.stop =" $wire.callSchemaComponentMethod(@js ($key ), 'reorder-column', {
68+ newKeys: $event.target.sortable.toArray(),
69+ row: '{{ $rowKey } } ',
70+ })"
71+ >
72+ @foreach ($row as $uuid => $block )
73+ <x-filament-architect::input-row
74+ :uuid =" $uuid"
75+ :row =" $row"
76+ :row-key =" $rowKey"
77+ :block =" $block"
78+ :blocks =" $getBlocks()"
79+ :locales =" $locales"
80+ :state-path =" $statePath"
81+ :get-action =" $getAction"
82+ :can-add-fields =" count($row) < $getMaxFieldsPerRow()"
83+ :has-duplicate-action =" $getHasDuplicateAction()"
84+ :loop =" $loop"
85+ :has-shown-button =" $getHasShownButton()"
86+ />
87+ @endforeach
88+ </div >
8789 </div >
88- </div >
8990
90- <x-filament-architect::add-row-button
91- :action =" $getAction('addBlock')"
92- :state-path =" $getStatePath()"
93- :arguments =" ['row' => $rowKey]"
94- :shown =" $loop->last"
95- >
96- @if ($loop -> last && $getHasPreview () )
97- {{ $getAction (' architectPreview' ) } }
98- @endif
91+ <x-filament-architect::add-row-button
92+ :action =" $getAction('addBlock')"
93+ :state-path =" $getStatePath()"
94+ :arguments =" ['row' => $rowKey]"
95+ :shown =" $loop->last"
96+ @class ([' h-0' => ! $loop -> last ] )
97+ >
98+ @if ($loop -> last && $getHasPreview () )
99+ {{ $getAction (' architectPreview' ) } }
100+ @endif
99101
100- @if ($loop -> last && $getHasTemplates () )
101- {{ $getAction (' saveAsTemplate' ) } }
102- @endif
103- </x-filament-architect::add-row-button >
102+ @if ($loop -> last && $getHasTemplates () )
103+ {{ $getAction (' saveAsTemplate' ) } }
104+ @endif
105+ </x-filament-architect::add-row-button >
106+ </div >
104107 </div >
105108 </div >
106109 @endforeach
0 commit comments