koishi-plugin-media-luna 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,14 +24,7 @@
24
24
 
25
25
  <div class="form-item">
26
26
  <div class="label">预设模板</div>
27
- <el-select v-model="presetId" placeholder="选择预设模板 (可选)" style="width: 100%" clearable @change="applyPreset">
28
- <el-option
29
- v-for="preset in presets"
30
- :key="preset.id"
31
- :label="preset.name"
32
- :value="preset.id"
33
- />
34
- </el-select>
27
+ <PresetPicker v-model="presetId" :presets="presets" />
35
28
  </div>
36
29
  </div>
37
30
 
@@ -213,6 +206,7 @@ import { ChannelConfig, PresetData, GenerationResult, ClientFileData } from '../
213
206
  import { channelApi, presetApi, generateApi, taskApi } from '../api'
214
207
  import HistoryGallery from './HistoryGallery.vue'
215
208
  import ImageLightbox from './ImageLightbox.vue'
209
+ import PresetPicker from './PresetPicker.vue'
216
210
 
217
211
  /** 本地文件项 */
218
212
  interface LocalFile {
@@ -303,12 +297,6 @@ const fetchData = async () => {
303
297
  }
304
298
  }
305
299
 
306
- const applyPreset = () => {
307
- // Logic to pre-fill prompt or params based on preset could go here
308
- // But mostly the backend handles preset logic via ID or name
309
- // The API 'media-luna/generate' accepts parameters.preset name
310
- }
311
-
312
300
  // 文件转 base64
313
301
  const fileToBase64 = (file: File): Promise<string> => {
314
302
  return new Promise((resolve, reject) => {
@@ -551,7 +539,7 @@ onUnmounted(() => {
551
539
  }
552
540
 
553
541
  .config-panel {
554
- width: 380px;
542
+ width: 320px;
555
543
  flex-shrink: 0;
556
544
  display: flex;
557
545
  flex-direction: column;
@@ -559,7 +547,7 @@ onUnmounted(() => {
559
547
  }
560
548
 
561
549
  .config-card {
562
- padding: 1.5rem;
550
+ padding: 1.25rem;
563
551
  flex: 1 1 0;
564
552
  min-height: 0;
565
553
  overflow-y: auto;
@@ -598,7 +586,11 @@ onUnmounted(() => {
598
586
  }
599
587
 
600
588
  .form-section {
601
- margin-bottom: 1.5rem;
589
+ margin-bottom: 1.25rem;
590
+ }
591
+
592
+ .form-section:last-of-type {
593
+ margin-bottom: 0;
602
594
  }
603
595
 
604
596
  .form-section.flex-grow {
@@ -617,12 +609,12 @@ onUnmounted(() => {
617
609
 
618
610
  .section-title {
619
611
  font-weight: 600;
620
- margin-bottom: 0.75rem;
612
+ margin-bottom: 0.5rem;
621
613
  color: var(--k-color-text);
622
- font-size: 0.95rem;
614
+ font-size: 0.9rem;
623
615
  display: flex;
624
616
  align-items: center;
625
- gap: 0.5rem;
617
+ gap: 0.4rem;
626
618
  }
627
619
 
628
620
  .section-title .k-icon {
@@ -630,23 +622,29 @@ onUnmounted(() => {
630
622
  }
631
623
 
632
624
  .form-item {
633
- margin-bottom: 1rem;
625
+ margin-bottom: 0.75rem;
626
+ }
627
+
628
+ .form-item:last-child {
629
+ margin-bottom: 0;
634
630
  }
635
631
 
636
632
  .label {
637
- font-size: 0.85rem;
633
+ font-size: 0.8rem;
638
634
  color: var(--k-color-text-description);
639
- margin-bottom: 0.35rem;
635
+ margin-bottom: 0.25rem;
640
636
  }
641
637
 
642
638
  .form-actions {
643
- margin-top: 1.5rem;
639
+ margin-top: 1.25rem;
640
+ padding-top: 1rem;
641
+ border-top: 1px solid var(--k-color-border);
644
642
  }
645
643
 
646
644
  .generate-btn {
647
645
  width: 100%;
648
- height: 44px;
649
- font-size: 1rem;
646
+ height: 40px;
647
+ font-size: 0.95rem;
650
648
  font-weight: 600;
651
649
  transition: all 0.2s;
652
650
  background: linear-gradient(135deg, var(--k-color-primary) 0%, var(--k-color-primary-dark, var(--k-color-primary)) 100%);
@@ -939,7 +937,7 @@ onUnmounted(() => {
939
937
 
940
938
  /* Upload Area */
941
939
  .upload-area {
942
- margin-top: 0.5rem;
940
+ margin-top: 0.25rem;
943
941
  }
944
942
 
945
943
  .upload-list {
@@ -951,9 +949,9 @@ onUnmounted(() => {
951
949
 
952
950
  .upload-item {
953
951
  position: relative;
954
- width: 64px;
955
- height: 64px;
956
- border-radius: 8px;
952
+ width: 56px;
953
+ height: 56px;
954
+ border-radius: 6px;
957
955
  overflow: hidden;
958
956
  border: 1px solid var(--k-color-border);
959
957
  background-color: var(--k-color-bg-2);
@@ -983,10 +981,10 @@ onUnmounted(() => {
983
981
  }
984
982
 
985
983
  .upload-trigger {
986
- width: 64px;
987
- height: 64px;
984
+ width: 56px;
985
+ height: 56px;
988
986
  border: 2px dashed var(--k-color-border);
989
- border-radius: 8px;
987
+ border-radius: 6px;
990
988
  display: flex;
991
989
  align-items: center;
992
990
  justify-content: center;
@@ -1011,9 +1009,10 @@ onUnmounted(() => {
1011
1009
  }
1012
1010
 
1013
1011
  .upload-tip {
1014
- font-size: 0.75rem;
1012
+ font-size: 0.7rem;
1015
1013
  color: var(--k-color-text-description);
1016
- margin-top: 0.5rem;
1014
+ margin-top: 0.35rem;
1015
+ opacity: 0.8;
1017
1016
  }
1018
1017
 
1019
1018
  /* Text output */