-
-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathshow.blade.php
More file actions
754 lines (691 loc) · 47.7 KB
/
show.blade.php
File metadata and controls
754 lines (691 loc) · 47.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
<div>
<div class="mb-6">
<a href="{{ route('customer.plugins.index') }}" class="inline-flex items-center gap-2 text-sm text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400">
<x-heroicon-s-arrow-left class="size-4" />
<span class="font-medium">Plugins</span>
</a>
<flux:heading size="xl" class="mt-4">
@if ($plugin->isDraft())
Edit Draft Plugin
@elseif ($plugin->isPending())
Plugin Under Review
@elseif ($plugin->isRejected())
Plugin Rejected
@elseif ($plugin->isApproved())
Manage Plugin
@endif
</flux:heading>
<div class="mt-1 flex items-center gap-3">
<flux:text class="font-mono">{{ $plugin->display_name ?? $plugin->name }}</flux:text>
<a href="{{ route('plugins.show', $plugin->routeParams()) }}" target="_blank" class="inline-flex items-center gap-1 text-sm font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300">
Preview Listing
<x-heroicon-o-arrow-top-right-on-square class="size-3.5" />
</a>
</div>
</div>
<div class="mx-auto max-w-3xl">
{{-- Success/Error Messages --}}
@if (session('success'))
<flux:callout variant="success" icon="check-circle" class="mb-6">
<flux:callout.text>{{ session('success') }}</flux:callout.text>
</flux:callout>
@endif
@if (session('error'))
<flux:callout variant="danger" icon="x-circle" class="mb-6">
<flux:callout.text>{{ session('error') }}</flux:callout.text>
</flux:callout>
@endif
{{-- Status-specific banners --}}
@if ($plugin->isDraft())
<flux:callout variant="info" icon="information-circle" class="mb-6">
<flux:callout.heading>Draft Plugin</flux:callout.heading>
<flux:callout.text>This plugin is a draft. Edit the details below, then submit for review when ready.</flux:callout.text>
</flux:callout>
@elseif ($plugin->isPending())
<flux:callout variant="warning" icon="clock" class="mb-6">
<flux:callout.heading>Under Review</flux:callout.heading>
<flux:callout.text>Your plugin is currently being reviewed. You can withdraw it to make changes.</flux:callout.text>
<x-slot name="actions">
<flux:button variant="ghost" wire:click="withdrawFromReview" wire:confirm="Are you sure you want to withdraw this plugin from review? It will return to draft status.">Withdraw from Review</flux:button>
</x-slot>
</flux:callout>
@elseif ($plugin->isRejected() && $plugin->rejection_reason)
<flux:callout variant="danger" icon="x-circle" class="mb-6">
<flux:callout.heading>Rejection Reason</flux:callout.heading>
<flux:callout.text>{{ $plugin->rejection_reason }}</flux:callout.text>
<x-slot name="actions">
<flux:button variant="danger" wire:click="returnToDraft">Return to Draft</flux:button>
</x-slot>
</flux:callout>
@elseif ($plugin->isApproved())
<flux:card class="mb-6">
<div class="flex items-center justify-between">
<div>
<flux:heading size="lg">Listing Status</flux:heading>
<flux:text class="mt-1">
@if ($plugin->is_active)
Your plugin is publicly listed in the directory.
@else
Your plugin is de-listed and hidden from the directory.
@endif
</flux:text>
</div>
<flux:switch wire:click="toggleListing" :checked="$plugin->is_active" />
</div>
</flux:card>
@endif
{{-- Review Checks (show for Pending, Rejected, Approved — not Draft) --}}
@if (! $plugin->isDraft() && $plugin->review_checks)
<flux:card class="mb-6">
<flux:heading size="lg">Review Checks</flux:heading>
<flux:text class="mt-1">Automated checks run against your repository.</flux:text>
@php
$requiredChecks = [
['key' => 'has_license_file', 'label' => 'License file (LICENSE or LICENSE.md)'],
['key' => 'has_release_version', 'label' => 'Release version'],
['key' => 'webhook_configured', 'label' => 'Webhook configured'],
];
$optionalChecks = [
['key' => 'supports_ios', 'label' => 'iOS support (resources/ios/)'],
['key' => 'supports_android', 'label' => 'Android support (resources/android/)'],
['key' => 'supports_js', 'label' => 'JavaScript support (resources/js/)'],
['key' => 'requires_mobile_sdk', 'label' => 'Requires nativephp/mobile SDK'],
];
@endphp
<flux:text class="mt-3 text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400">Required for approval</flux:text>
<ul class="mt-2 space-y-3">
@foreach ($requiredChecks as $check)
@php
$isPassing = $check['key'] === 'webhook_configured'
? $plugin->webhook_installed
: ($plugin->review_checks[$check['key']] ?? false);
@endphp
<li>
<div class="flex items-center gap-2">
@if ($isPassing)
<x-heroicon-s-check-circle class="size-5 shrink-0 text-green-500" />
<span class="text-sm text-gray-700 dark:text-gray-300">
{{ $check['label'] }}
@if ($check['key'] === 'has_release_version' && ($plugin->review_checks['release_version'] ?? null))
<code class="ml-1 rounded bg-gray-100 px-1 text-xs dark:bg-gray-700">{{ $plugin->review_checks['release_version'] }}</code>
@endif
</span>
@else
<x-heroicon-s-x-circle class="size-5 shrink-0 text-red-400 dark:text-red-500" />
<span class="text-sm text-gray-700 dark:text-gray-300">{{ $check['label'] }}</span>
@endif
</div>
@if ($check['key'] === 'webhook_configured' && ! $isPassing && $plugin->webhook_secret)
<div class="ml-7 mt-2 rounded-md border border-amber-200 bg-amber-50 p-4 dark:border-amber-900/50 dark:bg-amber-900/20">
<p class="text-sm text-amber-800 dark:text-amber-200">
We couldn't automatically install the webhook. Please set it up manually:
</p>
<div class="mt-2">
<label class="text-xs font-medium text-amber-900 dark:text-amber-100">Webhook URL</label>
<div class="mt-1 flex items-center gap-2">
<code class="block flex-1 overflow-x-auto rounded-md bg-white px-3 py-2 font-mono text-xs dark:bg-gray-800">{{ $plugin->getWebhookUrl() }}</code>
<flux:button size="xs" variant="ghost" x-on:click="navigator.clipboard.writeText('{{ $plugin->getWebhookUrl() }}')">
<x-heroicon-o-clipboard class="size-3" />
</flux:button>
</div>
</div>
<ol class="mt-3 list-inside list-decimal space-y-1 text-xs text-amber-700 dark:text-amber-300">
<li>Go to your repository's <strong>Settings → Webhooks</strong></li>
<li>Click <strong>Add webhook</strong></li>
<li>Paste the URL above into the <strong>Payload URL</strong> field</li>
<li>Set <strong>Content type</strong> to <code class="rounded bg-amber-100 px-1 dark:bg-amber-800">application/json</code></li>
<li>Select events: <strong>Pushes</strong> and <strong>Releases</strong></li>
<li>Click <strong>Add webhook</strong></li>
</ol>
</div>
@endif
</li>
@endforeach
</ul>
<flux:text class="mt-5 text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400">Additional checks</flux:text>
<ul class="mt-2 space-y-3">
@foreach ($optionalChecks as $check)
<li class="flex items-center gap-2">
@if ($plugin->review_checks[$check['key']] ?? false)
<x-heroicon-s-check-circle class="size-5 shrink-0 text-green-500" />
@else
<x-heroicon-s-x-circle class="size-5 shrink-0 text-gray-300 dark:text-gray-600" />
@endif
<span class="text-sm text-gray-700 dark:text-gray-300">{{ $check['label'] }}</span>
</li>
@endforeach
</ul>
@if ($plugin->review_checks['mobile_sdk_constraint'] ?? null)
<flux:text class="mt-1 text-xs">
SDK constraint: <code class="rounded bg-gray-100 px-1 dark:bg-gray-700">{{ $plugin->review_checks['mobile_sdk_constraint'] }}</code>
</flux:text>
@endif
@if ($plugin->reviewed_at)
<flux:text class="mt-3 text-xs text-gray-400 dark:text-gray-500">
Last checked {{ $plugin->reviewed_at->diffForHumans() }}
</flux:text>
@endif
</flux:card>
@endif
{{-- Editable fields for Draft plugins (with tabs) --}}
@if ($plugin->isDraft())
<flux:tab.group>
<flux:tabs wire:model="activeTab">
<flux:tab name="details">Details</flux:tab>
<flux:tab name="submit">Submit for Review</flux:tab>
</flux:tabs>
<flux:tab.panel name="details">
{{-- GitHub Repo --}}
<a href="{{ $plugin->repository_url }}" target="_blank" rel="noopener noreferrer" class="block">
<flux:card class="mb-6 transition hover:bg-gray-50 dark:hover:bg-gray-700/50">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<x-icons.github class="size-5 text-gray-400 dark:text-gray-500" />
<span class="font-mono text-sm font-medium text-gray-900 dark:text-white">{{ $plugin->name }}</span>
</div>
<x-heroicon-o-arrow-top-right-on-square class="size-4 text-gray-400 dark:text-gray-500" />
</div>
</flux:card>
</a>
<form wire:submit="save" class="space-y-6">
{{-- Plugin Type --}}
@feature(App\Features\AllowPaidPlugins::class)
<flux:card>
<flux:heading size="lg">Type</flux:heading>
<flux:text class="mt-1">Is your plugin free or paid?</flux:text>
<div class="mt-6 space-y-4">
<label class="relative flex cursor-pointer rounded-lg border p-4 transition focus:outline-none"
:class="$wire.pluginType === 'free' ? 'border-indigo-500 bg-indigo-50 dark:border-indigo-400 dark:bg-indigo-950/30' : 'border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700/50'">
<input type="radio" wire:model.live="pluginType" value="free" class="sr-only" />
<span class="flex flex-1 flex-col">
<span class="text-sm font-medium text-gray-900 dark:text-white">Free Plugin</span>
<span class="mt-1 text-sm text-gray-500 dark:text-gray-400">Open source, hosted on Packagist</span>
</span>
</label>
<label class="relative flex rounded-lg border p-4 transition focus:outline-none {{ $this->hasCompletedDeveloperOnboarding ? 'cursor-pointer' : 'cursor-not-allowed opacity-60' }}"
:class="$wire.pluginType === 'paid' ? 'border-indigo-500 bg-indigo-50 dark:border-indigo-400 dark:bg-indigo-950/30' : 'border-gray-200 dark:border-gray-700 {{ $this->hasCompletedDeveloperOnboarding ? 'hover:bg-gray-50 dark:hover:bg-gray-700/50' : '' }}'">
<input type="radio" wire:model.live="pluginType" value="paid" class="sr-only" {{ $this->hasCompletedDeveloperOnboarding ? '' : 'disabled' }} />
<span class="flex flex-1 flex-col">
<span class="text-sm font-medium text-gray-900 dark:text-white">Paid Plugin</span>
<span class="mt-1 text-sm text-gray-500 dark:text-gray-400">Commercial plugin, hosted on plugins.nativephp.com</span>
</span>
</label>
@if (! $this->hasCompletedDeveloperOnboarding)
<flux:text class="text-sm text-gray-500 dark:text-gray-400">
To create paid plugins, you need to <a href="{{ route('customer.developer.onboarding') }}" class="font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400" wire:navigate>complete developer onboarding</a>.
</flux:text>
@endif
</div>
</flux:card>
{{-- Pricing Tier (only when paid) --}}
@if ($pluginType === 'paid')
<flux:card :class="$errors->has('tier') ? '!border-red-500 dark:!border-red-400' : ''">
<flux:heading size="lg">Pricing Tier</flux:heading>
<flux:text class="mt-1">Choose a pricing tier for your plugin.</flux:text>
<div class="mt-6 space-y-4">
@foreach (\App\Enums\PluginTier::cases() as $pluginTier)
@php
$regularPrice = $pluginTier->getPrices()[\App\Enums\PriceTier::Regular->value] / 100;
@endphp
<label class="relative flex cursor-pointer rounded-lg border p-4 transition focus:outline-none"
:class="$wire.tier === '{{ $pluginTier->value }}' ? 'border-indigo-500 bg-indigo-50 dark:border-indigo-400 dark:bg-indigo-950/30' : 'border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700/50'">
<input type="radio" wire:model.live="tier" value="{{ $pluginTier->value }}" class="sr-only" />
<span class="flex flex-1 items-center justify-between">
<span class="text-sm font-medium text-gray-900 dark:text-white">{{ $pluginTier->label() }}</span>
<span class="text-lg font-semibold text-gray-900 dark:text-white">${{ number_format($regularPrice) }}</span>
</span>
</label>
@endforeach
</div>
@error('tier')
<flux:text class="mt-4 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
<flux:text class="mt-4 text-xs text-gray-500 dark:text-gray-400">
Actual sale price may vary due to discounts and offers. You keep 70% of the sale price. If a NativePHP Ultra subscriber purchases your plugin, you receive 100% of the sale price. Additional payment processing fees may apply.
</flux:text>
</flux:card>
@endif
@endfeature
{{-- Display Name --}}
<flux:card>
<flux:heading size="lg">Name <span class="text-sm font-normal text-gray-400 dark:text-gray-500">(optional)</span></flux:heading>
<flux:text class="mt-1">A display name for your plugin. If not set, your Composer package name will be used.</flux:text>
<div class="mt-4">
<flux:input
wire:model="displayName"
placeholder="{{ $plugin->name }}"
maxlength="250"
/>
<flux:text class="mt-2 text-xs">Maximum 250 characters</flux:text>
</div>
</flux:card>
{{-- Description --}}
<flux:card>
<flux:heading size="lg">Description</flux:heading>
<flux:text class="mt-1">Describe what your plugin does. This will be displayed in the plugin directory.</flux:text>
<div class="mt-4">
<flux:textarea
wire:model="description"
rows="5"
placeholder="Describe what your plugin does, its key features, and how developers can use it..."
/>
@error('description')
<flux:text class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
<flux:text class="mt-2 text-xs">Maximum 1000 characters</flux:text>
</div>
</flux:card>
{{-- Icon --}}
<flux:card x-data="{ mode: @entangle('iconMode') }">
<flux:heading size="lg">Icon</flux:heading>
<flux:text class="mt-1">Choose a gradient and icon, or upload your own logo.</flux:text>
<div class="mt-4">
{{-- Current Icon Preview --}}
@if ($plugin->hasCustomIcon())
<div class="mb-4 flex items-center gap-4">
@if ($plugin->hasLogo())
<img src="{{ $plugin->getLogoUrl() }}" alt="{{ $plugin->name }} logo" class="size-16 rounded-lg object-cover shadow-sm" />
@elseif ($plugin->hasGradientIcon())
<div class="grid size-16 place-items-center rounded-lg bg-gradient-to-br {{ $plugin->getGradientClasses() }} text-white shadow-sm">
<x-dynamic-component :component="'heroicon-o-' . $plugin->icon_name" class="size-8" />
</div>
@endif
<flux:button size="sm" variant="danger" icon="trash" wire:click="deleteIcon" type="button">Remove icon</flux:button>
</div>
@endif
{{-- Gradient Icon Picker --}}
<div x-show="mode === 'gradient'" x-cloak>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300">Choose a gradient</label>
<div class="mt-2 grid grid-cols-4 gap-3 sm:grid-cols-8">
@foreach (\App\Models\Plugin::gradientPresets() as $key => $classes)
<label class="relative cursor-pointer">
<input
type="radio"
wire:model="iconGradient"
value="{{ $key }}"
class="peer sr-only"
/>
<div class="size-12 rounded-lg bg-gradient-to-br {{ $classes }} ring-2 ring-transparent ring-offset-2 transition-all peer-checked:ring-indigo-500 peer-focus:ring-indigo-500 hover:scale-105 dark:ring-offset-gray-800"></div>
</label>
@endforeach
</div>
@error('iconGradient')
<flux:text class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
</div>
<flux:input
wire:model="iconName"
label="Heroicon name"
placeholder="cube"
description="Enter a Heroicon outline name, e.g., cube, sparkles, bolt."
/>
@error('iconName')
<flux:text class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
<flux:button wire:click="updateIcon" variant="filled" type="button">Save Icon</flux:button>
</div>
<flux:separator class="my-4" />
<button type="button" @click="mode = 'upload'" class="text-sm font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400">
Or upload your own logo instead
</button>
</div>
{{-- Custom Logo Upload --}}
<div x-show="mode === 'upload'" x-cloak>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300">Upload a logo</label>
<div class="mt-2 flex items-center gap-4">
<input
type="file"
wire:model="logo"
accept="image/png,image/jpeg,image/jpg,image/svg+xml,image/webp"
class="block text-sm text-gray-500 file:mr-4 file:rounded-md file:border-0 file:bg-indigo-50 file:px-4 file:py-2 file:text-sm file:font-medium file:text-indigo-700 hover:file:bg-indigo-100 dark:text-gray-400 dark:file:bg-indigo-900/50 dark:file:text-indigo-300 dark:hover:file:bg-indigo-900/70"
/>
<flux:button wire:click="uploadLogo" variant="filled" type="button">Upload</flux:button>
</div>
@error('logo')
<flux:text class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
<flux:text class="mt-2 text-xs">PNG, JPG, SVG, or WebP. Max 1MB. Recommended: 256x256 pixels, square.</flux:text>
</div>
</div>
<flux:separator class="my-4" />
<button type="button" @click="mode = 'gradient'" class="text-sm font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400">
Or choose a gradient icon instead
</button>
</div>
</div>
</flux:card>
{{-- Support Channel --}}
<flux:card>
<flux:heading size="lg">Support</flux:heading>
<flux:text class="mt-1">How can users get support for your plugin? Provide an email address or a URL.</flux:text>
<div class="mt-4">
<flux:input
wire:model="supportChannel"
placeholder="support@example.com or https://..."
/>
@error('supportChannel')
<flux:text class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
</div>
</flux:card>
{{-- Save Button --}}
<div class="flex items-center justify-end">
<flux:button type="submit" variant="primary">Save Changes</flux:button>
</div>
</form>
</flux:tab.panel>
<flux:tab.panel name="submit">
<div class="space-y-6">
{{-- Plugin Summary --}}
<flux:card>
<div class="flex items-start justify-between">
<div class="flex items-start gap-4">
@if ($plugin->hasLogo())
<img src="{{ $plugin->getLogoUrl() }}" alt="{{ $plugin->name }} logo" class="size-16 shrink-0 rounded-lg object-cover shadow-sm" />
@elseif ($plugin->hasGradientIcon())
<div class="grid size-16 shrink-0 place-items-center rounded-lg bg-gradient-to-br {{ $plugin->getGradientClasses() }} text-white shadow-sm">
<x-dynamic-component :component="'heroicon-o-' . $plugin->icon_name" class="size-8" />
</div>
@else
<div class="grid size-16 shrink-0 place-items-center rounded-lg bg-gradient-to-br from-indigo-500 to-purple-600 text-white shadow-sm">
<x-vaadin-plug class="size-8" />
</div>
@endif
<div>
<flux:heading size="lg">{{ $plugin->display_name ?? $plugin->name }}</flux:heading>
@if ($plugin->display_name)
<flux:text class="font-mono text-xs">{{ $plugin->name }}</flux:text>
@endif
@if ($plugin->description)
<flux:text class="mt-2">{{ $plugin->description }}</flux:text>
@else
<flux:text class="mt-2 text-gray-400 dark:text-gray-500">No description provided</flux:text>
@endif
</div>
</div>
@if ($plugin->isPaid() && $plugin->tier)
<span class="inline-flex shrink-0 items-center text-center rounded-full bg-emerald-100 px-2.5 py-0.5 text-xs font-medium text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-400">
{{ $plugin->tier->label() }}
</span>
@elseif ($plugin->isPaid())
<span class="inline-flex shrink-0 items-center text-center rounded-full bg-emerald-100 px-2.5 py-0.5 text-xs font-medium text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-400">
Paid
</span>
@else
<span class="inline-flex shrink-0 items-center text-center rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-800 dark:bg-gray-700 dark:text-gray-300">
Free
</span>
@endif
</div>
<flux:separator class="my-4" />
<div class="space-y-3">
<div>
<flux:heading size="sm">Support Channel</flux:heading>
@if ($plugin->support_channel)
<flux:text class="mt-1">{{ $plugin->support_channel }}</flux:text>
@else
<flux:text class="mt-1 text-gray-400 dark:text-gray-500">No support channel set</flux:text>
@endif
</div>
<div>
<flux:heading size="sm">Repository</flux:heading>
<a href="{{ $plugin->repository_url }}" target="_blank" rel="noopener noreferrer" class="mt-1 inline-flex items-center gap-1 text-sm text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300">
{{ $plugin->repository_url }}
<x-heroicon-o-arrow-top-right-on-square class="size-3.5" />
</a>
</div>
</div>
</flux:card>
{{-- Notes --}}
<flux:card>
<flux:heading size="lg">Notes</flux:heading>
<flux:text class="mt-1">Any notes for the review team? These won't be displayed on your plugin listing.</flux:text>
<div class="mt-4">
<flux:textarea
wire:model="notes"
rows="4"
placeholder="Optional notes for the review team..."
/>
</div>
</flux:card>
{{-- Submit Button --}}
<div class="flex items-center justify-end">
<flux:button variant="primary" wire:click="submitForReview">Submit for Review</flux:button>
</div>
</div>
</flux:tab.panel>
</flux:tab.group>
@elseif ($plugin->isApproved())
{{-- Editable fields for Approved plugins (no tabs) --}}
{{-- GitHub Repo --}}
<a href="{{ $plugin->repository_url }}" target="_blank" rel="noopener noreferrer" class="block">
<flux:card class="mb-6 transition hover:bg-gray-50 dark:hover:bg-gray-700/50">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<x-icons.github class="size-5 text-gray-400 dark:text-gray-500" />
<span class="font-mono text-sm font-medium text-gray-900 dark:text-white">{{ $plugin->name }}</span>
</div>
<x-heroicon-o-arrow-top-right-on-square class="size-4 text-gray-400 dark:text-gray-500" />
</div>
</flux:card>
</a>
{{-- Read-only Type & Tier --}}
<flux:card class="mb-6">
<div class="flex items-center justify-between">
<div>
<flux:heading size="lg">Type</flux:heading>
<flux:text class="mt-1">
@if ($plugin->isPaid() && $plugin->tier)
Paid — {{ $plugin->tier->label() }}
@elseif ($plugin->isPaid())
Paid
@else
Free
@endif
</flux:text>
</div>
</div>
</flux:card>
<form wire:submit="save" class="space-y-6">
{{-- Display Name --}}
<flux:card>
<flux:heading size="lg">Name <span class="text-sm font-normal text-gray-400 dark:text-gray-500">(optional)</span></flux:heading>
<flux:text class="mt-1">A display name for your plugin. If not set, your Composer package name will be used.</flux:text>
<div class="mt-4">
<flux:input
wire:model="displayName"
placeholder="{{ $plugin->name }}"
maxlength="250"
/>
<flux:text class="mt-2 text-xs">Maximum 250 characters</flux:text>
</div>
</flux:card>
{{-- Description --}}
<flux:card>
<flux:heading size="lg">Description</flux:heading>
<flux:text class="mt-1">Describe what your plugin does. This will be displayed in the plugin directory.</flux:text>
<div class="mt-4">
<flux:textarea
wire:model="description"
rows="5"
placeholder="Describe what your plugin does, its key features, and how developers can use it..."
/>
@error('description')
<flux:text class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
<flux:text class="mt-2 text-xs">Maximum 1000 characters</flux:text>
</div>
</flux:card>
{{-- Icon --}}
<flux:card x-data="{ mode: @entangle('iconMode') }">
<flux:heading size="lg">Icon</flux:heading>
<flux:text class="mt-1">Choose a gradient and icon, or upload your own logo.</flux:text>
<div class="mt-4">
{{-- Current Icon Preview --}}
@if ($plugin->hasCustomIcon())
<div class="mb-4 flex items-center gap-4">
@if ($plugin->hasLogo())
<img src="{{ $plugin->getLogoUrl() }}" alt="{{ $plugin->name }} logo" class="size-16 rounded-lg object-cover shadow-sm" />
@elseif ($plugin->hasGradientIcon())
<div class="grid size-16 place-items-center rounded-lg bg-gradient-to-br {{ $plugin->getGradientClasses() }} text-white shadow-sm">
<x-dynamic-component :component="'heroicon-o-' . $plugin->icon_name" class="size-8" />
</div>
@endif
<flux:button size="sm" variant="danger" icon="trash" wire:click="deleteIcon" type="button">Remove icon</flux:button>
</div>
@endif
{{-- Gradient Icon Picker --}}
<div x-show="mode === 'gradient'" x-cloak>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300">Choose a gradient</label>
<div class="mt-2 grid grid-cols-4 gap-3 sm:grid-cols-8">
@foreach (\App\Models\Plugin::gradientPresets() as $key => $classes)
<label class="relative cursor-pointer">
<input
type="radio"
wire:model="iconGradient"
value="{{ $key }}"
class="peer sr-only"
/>
<div class="size-12 rounded-lg bg-gradient-to-br {{ $classes }} ring-2 ring-transparent ring-offset-2 transition-all peer-checked:ring-indigo-500 peer-focus:ring-indigo-500 hover:scale-105 dark:ring-offset-gray-800"></div>
</label>
@endforeach
</div>
@error('iconGradient')
<flux:text class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
</div>
<flux:input
wire:model="iconName"
label="Heroicon name"
placeholder="cube"
description="Enter a Heroicon outline name, e.g., cube, sparkles, bolt."
/>
@error('iconName')
<flux:text class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
<flux:button wire:click="updateIcon" variant="filled" type="button">Save Icon</flux:button>
</div>
<flux:separator class="my-4" />
<button type="button" @click="mode = 'upload'" class="text-sm font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400">
Or upload your own logo instead
</button>
</div>
{{-- Custom Logo Upload --}}
<div x-show="mode === 'upload'" x-cloak>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300">Upload a logo</label>
<div class="mt-2 flex items-center gap-4">
<input
type="file"
wire:model="logo"
accept="image/png,image/jpeg,image/jpg,image/svg+xml,image/webp"
class="block text-sm text-gray-500 file:mr-4 file:rounded-md file:border-0 file:bg-indigo-50 file:px-4 file:py-2 file:text-sm file:font-medium file:text-indigo-700 hover:file:bg-indigo-100 dark:text-gray-400 dark:file:bg-indigo-900/50 dark:file:text-indigo-300 dark:hover:file:bg-indigo-900/70"
/>
<flux:button wire:click="uploadLogo" variant="filled" type="button">Upload</flux:button>
</div>
@error('logo')
<flux:text class="mt-2 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
<flux:text class="mt-2 text-xs">PNG, JPG, SVG, or WebP. Max 1MB. Recommended: 256x256 pixels, square.</flux:text>
</div>
</div>
<flux:separator class="my-4" />
<button type="button" @click="mode = 'gradient'" class="text-sm font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400">
Or choose a gradient icon instead
</button>
</div>
</div>
</flux:card>
{{-- Support Channel --}}
<flux:card>
<flux:heading size="lg">Support</flux:heading>
<flux:text class="mt-1">How can users get support for your plugin? Provide an email address or a URL.</flux:text>
<div class="mt-4">
<flux:input
wire:model="supportChannel"
placeholder="support@example.com or https://..."
/>
@error('supportChannel')
<flux:text class="mt-1 text-sm text-red-600 dark:text-red-400">{{ $message }}</flux:text>
@enderror
</div>
</flux:card>
{{-- Save Button --}}
<div class="flex items-center justify-end">
<flux:button type="submit" variant="primary">Save Changes</flux:button>
</div>
</form>
@else
{{-- Read-only display for Pending/Rejected --}}
<flux:card class="mb-6">
<div class="flex items-start justify-between">
<div class="flex items-start gap-4">
@if ($plugin->hasLogo())
<img src="{{ $plugin->getLogoUrl() }}" alt="{{ $plugin->name }} logo" class="size-16 shrink-0 rounded-lg object-cover shadow-sm" />
@elseif ($plugin->hasGradientIcon())
<div class="grid size-16 shrink-0 place-items-center rounded-lg bg-gradient-to-br {{ $plugin->getGradientClasses() }} text-white shadow-sm">
<x-dynamic-component :component="'heroicon-o-' . $plugin->icon_name" class="size-8" />
</div>
@else
<div class="grid size-16 shrink-0 place-items-center rounded-lg bg-gradient-to-br from-indigo-500 to-purple-600 text-white shadow-sm">
<x-vaadin-plug class="size-8" />
</div>
@endif
<div>
<flux:heading size="lg">{{ $plugin->display_name ?? $plugin->name }}</flux:heading>
@if ($plugin->description)
<flux:text class="mt-2">{{ $plugin->description }}</flux:text>
@else
<flux:text class="mt-2 text-gray-400 dark:text-gray-500">No description provided</flux:text>
@endif
</div>
</div>
@if ($plugin->isPaid() && $plugin->tier)
<span class="inline-flex shrink-0 items-center text-center rounded-full bg-emerald-100 px-2.5 py-0.5 text-xs font-medium text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-400">
{{ $plugin->tier->label() }}
</span>
@elseif ($plugin->isPaid())
<span class="inline-flex shrink-0 items-center text-center rounded-full bg-emerald-100 px-2.5 py-0.5 text-xs font-medium text-emerald-800 dark:bg-emerald-900/30 dark:text-emerald-400">
Paid
</span>
@else
<span class="inline-flex shrink-0 items-center text-center rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-800 dark:bg-gray-700 dark:text-gray-300">
Free
</span>
@endif
</div>
<flux:separator class="my-4" />
<div class="space-y-3">
<div>
<flux:heading size="sm">Support Channel</flux:heading>
@if ($plugin->support_channel)
<flux:text class="mt-1">{{ $plugin->support_channel }}</flux:text>
@else
<flux:text class="mt-1 text-gray-400 dark:text-gray-500">No support channel set</flux:text>
@endif
</div>
<div>
<flux:heading size="sm">Repository</flux:heading>
<a href="{{ $plugin->repository_url }}" target="_blank" rel="noopener noreferrer" class="mt-1 inline-flex items-center gap-1 text-sm text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300">
{{ $plugin->repository_url }}
<x-heroicon-o-arrow-top-right-on-square class="size-3.5" />
</a>
</div>
</div>
</flux:card>
@if ($plugin->notes)
<flux:card class="mb-6">
<flux:heading size="lg">Submission Notes</flux:heading>
<flux:text class="mt-2">{{ $plugin->notes }}</flux:text>
</flux:card>
@endif
@endif
</div>
</div>