@dickpy/dsh-imagegen 1.0.7 → 1.0.19
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.
- package/README.md +28 -9
- package/docs/images/prompt-template-library.png +0 -0
- package/lib/client.js +1739 -408
- package/lib/client.js.map +1 -1
- package/lib/index.js +797 -38
- package/package.json +5 -4
- package/src/client/ImageGenPanel.tsx +476 -61
- package/src/client/TemplateLibrary.tsx +336 -0
- package/src/client/api.ts +58 -1
- package/src/client/locales.ts +127 -22
- package/src/client/mount.tsx +11 -6
- package/src/client/panel.module.css +245 -8
- package/src/client/templates.module.css +453 -0
- package/src/engine.ts +78 -11
- package/src/gallery-store.ts +266 -0
- package/src/index.ts +3 -1
- package/src/protocol.ts +79 -5
- package/src/routes.ts +191 -1
- package/src/templates/cases.json +10196 -0
- package/src/templates-store.ts +278 -0
|
@@ -10,7 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
/* --- center-column takeover (global rules, attribute-scoped) ----------------- */
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/* The panel container rides inside the conversation grid item as an extra
|
|
14
|
+
trailing child; hidden unless the panel is active. The position rule covers
|
|
15
|
+
both shells: the legacy `[data-pane="conversation"]` and the rc.6+
|
|
16
|
+
AppFrame class-based column ([class*="centerCol"]) — without a positioned
|
|
17
|
+
ancestor the absolutely-positioned view resolves against the frame. */
|
|
18
|
+
[data-pane='conversation'],
|
|
19
|
+
[class*='centerCol'] {
|
|
14
20
|
position: relative;
|
|
15
21
|
}
|
|
16
22
|
|
|
@@ -107,6 +113,7 @@ html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ss
|
|
|
107
113
|
}
|
|
108
114
|
|
|
109
115
|
.panel {
|
|
116
|
+
position: relative;
|
|
110
117
|
display: flex;
|
|
111
118
|
flex-direction: column;
|
|
112
119
|
height: 100%;
|
|
@@ -143,12 +150,23 @@ html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ss
|
|
|
143
150
|
white-space: nowrap;
|
|
144
151
|
}
|
|
145
152
|
|
|
146
|
-
.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
/* GitHub icon button next to the title (opens the repo). */
|
|
154
|
+
.githubLink {
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
flex: none;
|
|
159
|
+
width: 22px;
|
|
160
|
+
height: 22px;
|
|
161
|
+
border-radius: 6px;
|
|
162
|
+
color: var(--dsw-alias-label-secondary);
|
|
163
|
+
text-decoration: none;
|
|
164
|
+
transition: color 0.12s, background 0.12s;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.githubLink:hover {
|
|
168
|
+
color: var(--dsw-alias-label-primary);
|
|
169
|
+
background: var(--dsw-alias-bg-layer-2);
|
|
152
170
|
}
|
|
153
171
|
|
|
154
172
|
/* --- connection status and update notice -------------------------------------- */
|
|
@@ -606,10 +624,45 @@ html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ss
|
|
|
606
624
|
|
|
607
625
|
.promptFooter {
|
|
608
626
|
display: flex;
|
|
609
|
-
|
|
627
|
+
align-items: center;
|
|
628
|
+
justify-content: space-between;
|
|
629
|
+
gap: 8px;
|
|
610
630
|
margin-top: -6px;
|
|
611
631
|
}
|
|
612
632
|
|
|
633
|
+
.templatesButton {
|
|
634
|
+
display: inline-flex;
|
|
635
|
+
align-items: center;
|
|
636
|
+
gap: 6px;
|
|
637
|
+
height: 26px;
|
|
638
|
+
padding: 0 12px;
|
|
639
|
+
border: 1px solid var(--dsw-alias-brand-primary);
|
|
640
|
+
border-radius: 999px;
|
|
641
|
+
background: linear-gradient(135deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent), color-mix(in srgb, var(--dsw-alias-brand-primary) 5%, transparent));
|
|
642
|
+
color: var(--dsw-alias-brand-primary);
|
|
643
|
+
font-size: 12px;
|
|
644
|
+
font-weight: 600;
|
|
645
|
+
font-family: inherit;
|
|
646
|
+
cursor: pointer;
|
|
647
|
+
box-shadow: 0 1px 0 color-mix(in srgb, var(--dsw-alias-brand-primary) 22%, transparent);
|
|
648
|
+
transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.templatesButton svg {
|
|
652
|
+
flex: none;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.templatesButton:hover {
|
|
656
|
+
background: linear-gradient(135deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 24%, transparent), color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, transparent));
|
|
657
|
+
color: var(--dsw-alias-brand-primary);
|
|
658
|
+
transform: translateY(-1px);
|
|
659
|
+
box-shadow: 0 2px 6px color-mix(in srgb, var(--dsw-alias-brand-primary) 30%, transparent);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.templatesButton:active {
|
|
663
|
+
transform: translateY(0);
|
|
664
|
+
}
|
|
665
|
+
|
|
613
666
|
.promptCount {
|
|
614
667
|
font-size: 11px;
|
|
615
668
|
color: var(--dsw-alias-label-tertiary);
|
|
@@ -680,6 +733,10 @@ html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ss
|
|
|
680
733
|
.modelSelect {
|
|
681
734
|
width: 100%;
|
|
682
735
|
height: 36px;
|
|
736
|
+
display: flex;
|
|
737
|
+
align-items: center;
|
|
738
|
+
justify-content: space-between;
|
|
739
|
+
gap: 8px;
|
|
683
740
|
padding: 0 12px;
|
|
684
741
|
font-size: 13px;
|
|
685
742
|
color: var(--dsw-alias-label-primary);
|
|
@@ -689,6 +746,7 @@ html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ss
|
|
|
689
746
|
outline: none;
|
|
690
747
|
font-family: inherit;
|
|
691
748
|
cursor: pointer;
|
|
749
|
+
text-align: left;
|
|
692
750
|
}
|
|
693
751
|
|
|
694
752
|
.modelSelect:focus-visible {
|
|
@@ -697,6 +755,59 @@ html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ss
|
|
|
697
755
|
|
|
698
756
|
.modelSelect:disabled {
|
|
699
757
|
opacity: 0.55;
|
|
758
|
+
cursor: default;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/* Model dropdown trigger + upward-opening menu. */
|
|
762
|
+
.modelMenu {
|
|
763
|
+
position: relative;
|
|
764
|
+
display: block;
|
|
765
|
+
min-width: 0;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/* The list opens UPWARD (absolute above the trigger) so it never hides
|
|
769
|
+
behind the footer edge below. */
|
|
770
|
+
.modelMenuList {
|
|
771
|
+
position: absolute;
|
|
772
|
+
left: 0;
|
|
773
|
+
right: 0;
|
|
774
|
+
bottom: calc(100% + 6px);
|
|
775
|
+
z-index: 40;
|
|
776
|
+
display: flex;
|
|
777
|
+
flex-direction: column;
|
|
778
|
+
padding: 4px;
|
|
779
|
+
background: var(--dsw-alias-bg-layer-2);
|
|
780
|
+
border: 1px solid var(--dsw-alias-border-l2);
|
|
781
|
+
border-radius: 12px;
|
|
782
|
+
box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
|
|
783
|
+
overflow: hidden;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.modelMenuItem {
|
|
787
|
+
display: block;
|
|
788
|
+
width: 100%;
|
|
789
|
+
padding: 7px 10px;
|
|
790
|
+
font: inherit;
|
|
791
|
+
font-size: 13px;
|
|
792
|
+
color: var(--dsw-alias-label-primary);
|
|
793
|
+
background: transparent;
|
|
794
|
+
border: none;
|
|
795
|
+
border-radius: 8px;
|
|
796
|
+
cursor: pointer;
|
|
797
|
+
text-align: left;
|
|
798
|
+
white-space: nowrap;
|
|
799
|
+
overflow: hidden;
|
|
800
|
+
text-overflow: ellipsis;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.modelMenuItem:hover {
|
|
804
|
+
background: var(--dsw-alias-bg-hover);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.modelMenuItem[data-selected] {
|
|
808
|
+
color: var(--dsw-alias-brand-primary);
|
|
809
|
+
font-weight: 600;
|
|
810
|
+
background: var(--dsw-alias-bg-layer-1);
|
|
700
811
|
}
|
|
701
812
|
|
|
702
813
|
.generateButton {
|
|
@@ -873,6 +984,42 @@ html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ss
|
|
|
873
984
|
background: var(--dsw-alias-bg-base);
|
|
874
985
|
}
|
|
875
986
|
|
|
987
|
+
/* Add-to-gallery pill (top-left, mirrors .download; shows on card hover). */
|
|
988
|
+
.galleryAdd {
|
|
989
|
+
position: absolute;
|
|
990
|
+
top: 8px;
|
|
991
|
+
left: 8px;
|
|
992
|
+
display: inline-flex;
|
|
993
|
+
align-items: center;
|
|
994
|
+
gap: 5px;
|
|
995
|
+
padding: 2px 10px;
|
|
996
|
+
font: inherit;
|
|
997
|
+
font-size: 12px;
|
|
998
|
+
line-height: 20px;
|
|
999
|
+
font-weight: 500;
|
|
1000
|
+
color: var(--dsw-alias-label-primary);
|
|
1001
|
+
background: var(--dsw-alias-bg-mask-1);
|
|
1002
|
+
border: 1px solid var(--dsw-alias-border-l2);
|
|
1003
|
+
border-radius: 999px;
|
|
1004
|
+
cursor: pointer;
|
|
1005
|
+
opacity: 0;
|
|
1006
|
+
transition: opacity 0.12s;
|
|
1007
|
+
backdrop-filter: blur(4px);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
.imageCard:hover .galleryAdd {
|
|
1011
|
+
opacity: 1;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
.galleryAdd:hover {
|
|
1015
|
+
background: var(--dsw-alias-bg-base);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.galleryAdd:disabled {
|
|
1019
|
+
opacity: 0.4;
|
|
1020
|
+
cursor: default;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
876
1023
|
/* Hover hint for the click-to-zoom behavior. */
|
|
877
1024
|
.zoomHint {
|
|
878
1025
|
position: absolute;
|
|
@@ -1176,9 +1323,99 @@ html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ss
|
|
|
1176
1323
|
to { transform: rotate(360deg); }
|
|
1177
1324
|
}
|
|
1178
1325
|
|
|
1326
|
+
/* Transient "added to gallery" toast, centered above the canvas bottom. */
|
|
1327
|
+
.galleryToast {
|
|
1328
|
+
position: absolute;
|
|
1329
|
+
left: 50%;
|
|
1330
|
+
bottom: 24px;
|
|
1331
|
+
transform: translateX(-50%);
|
|
1332
|
+
z-index: 30;
|
|
1333
|
+
display: inline-flex;
|
|
1334
|
+
align-items: center;
|
|
1335
|
+
gap: 7px;
|
|
1336
|
+
padding: 6px 16px;
|
|
1337
|
+
font-size: 13px;
|
|
1338
|
+
font-weight: 500;
|
|
1339
|
+
color: var(--dsw-alias-label-primary);
|
|
1340
|
+
background: var(--dsw-alias-bg-mask-1);
|
|
1341
|
+
border: 1px solid var(--dsw-alias-border-l2);
|
|
1342
|
+
border-radius: 999px;
|
|
1343
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
|
|
1344
|
+
backdrop-filter: blur(6px);
|
|
1345
|
+
pointer-events: none;
|
|
1346
|
+
animation: dshImageGenToastIn 160ms ease-out;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
@keyframes dshImageGenToastIn {
|
|
1350
|
+
from { opacity: 0; transform: translate(-50%, 6px); }
|
|
1351
|
+
to { opacity: 1; transform: translate(-50%, 0); }
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1179
1354
|
@media (prefers-reduced-motion: reduce) {
|
|
1180
1355
|
.download, .spinner, .bigSpinner {
|
|
1181
1356
|
transition: none;
|
|
1182
1357
|
animation-duration: 1.5s;
|
|
1183
1358
|
}
|
|
1184
1359
|
}
|
|
1360
|
+
|
|
1361
|
+
/* --- gallery workspace -------------------------------------------------------- */
|
|
1362
|
+
.config[data-gallery='true'] .configScroll > *:not(:first-child),
|
|
1363
|
+
.config[data-gallery='true'] .footer,
|
|
1364
|
+
.canvas[data-gallery='true'] > .canvasState,
|
|
1365
|
+
.canvas[data-gallery='true'] > .canvasError,
|
|
1366
|
+
.canvas[data-gallery='true'] > .canvasBody,
|
|
1367
|
+
.studio:has(.config[data-gallery='true']) > .history { display: none; }
|
|
1368
|
+
.config[data-gallery='true'] .configScroll { display: flex; flex: none; overflow: visible; order: 1; }
|
|
1369
|
+
.config[data-gallery='true'] .galleryFilters { order: 2; flex: 1; min-height: 0; }
|
|
1370
|
+
.galleryFilters { padding: 18px 14px; overflow-y: auto; overflow-x: hidden; }
|
|
1371
|
+
.galleryFilterHeading { margin: 0 4px 10px; color: var(--dsw-alias-label-tertiary); font-size: 12px; font-weight: 600; }
|
|
1372
|
+
.galleryFilter { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; color: var(--dsw-alias-label-secondary); background: transparent; cursor: pointer; text-align: left; }
|
|
1373
|
+
.galleryFilter:hover, .galleryFilter[data-active] { color: var(--dsw-alias-brand-primary); background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent); }
|
|
1374
|
+
.galleryFilterCount { min-width: 20px; padding: 1px 6px; border-radius: 999px; color: var(--dsw-alias-label-tertiary); background: var(--dsw-alias-bg-layer-2); font-size: 11px; text-align: center; }
|
|
1375
|
+
.galleryFilterDivider { height: 1px; margin: 18px 4px; background: var(--dsw-alias-border-l1); }
|
|
1376
|
+
.galleryRatioList { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
1377
|
+
.galleryRatio { padding: 6px 10px; border: 0; border-radius: 999px; color: var(--dsw-alias-label-secondary); background: var(--dsw-alias-bg-layer-2); cursor: pointer; font-size: 12px; }
|
|
1378
|
+
.galleryRatio[data-active] { color: var(--dsw-alias-brand-primary); background: color-mix(in srgb, var(--dsw-alias-brand-primary) 13%, transparent); }
|
|
1379
|
+
.galleryFilterNote { margin: 20px 4px 0; color: var(--dsw-alias-label-quaternary); font-size: 11px; line-height: 1.5; }
|
|
1380
|
+
.galleryWorkspace { position: absolute; inset: 0; display: flex; width: 100%; height: 100%; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; padding: 22px 24px 26px; box-sizing: border-box; }
|
|
1381
|
+
.galleryToolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; min-width: 0; margin-bottom: 18px; }
|
|
1382
|
+
.galleryHeading { display: inline; margin: 0; color: var(--dsw-alias-label-primary); font-size: 20px; font-weight: 700; }
|
|
1383
|
+
.galleryCount { margin-left: 8px; color: var(--dsw-alias-label-tertiary); font-size: 13px; }
|
|
1384
|
+
.galleryToolbarActions { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
|
|
1385
|
+
.galleryViewToggle { display: flex; padding: 3px; border: 1px solid var(--dsw-alias-border-l1); border-radius: 9px; background: var(--dsw-alias-bg-layer-1); }
|
|
1386
|
+
.galleryViewToggle button, .gallerySort, .galleryClear { min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--dsw-alias-label-secondary); background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
|
|
1387
|
+
.galleryViewToggle button[data-active], .galleryViewToggle button:hover, .gallerySort:hover, .galleryClear:hover { color: var(--dsw-alias-brand-primary); background: color-mix(in srgb, var(--dsw-alias-brand-primary) 11%, transparent); }
|
|
1388
|
+
.gallerySort { border: 1px solid var(--dsw-alias-border-l1); background: var(--dsw-alias-bg-layer-1); }
|
|
1389
|
+
.galleryClear { border: 1px solid var(--dsw-alias-border-l1); }
|
|
1390
|
+
.galleryMasonry { display: grid; flex: 1 1 auto; width: 100%; height: 0; max-width: 100%; min-width: 0; min-height: 0; box-sizing: border-box; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 16px; overflow-y: scroll; overflow-x: hidden; overscroll-behavior: contain; padding: 2px 8px 16px 2px; scrollbar-width: thin; scrollbar-color: var(--dsw-alias-border-l2) transparent; }
|
|
1391
|
+
.galleryMasonry::-webkit-scrollbar { width: 8px; }
|
|
1392
|
+
.galleryMasonry::-webkit-scrollbar-thumb { background: var(--dsw-alias-border-l2); border-radius: 999px; }
|
|
1393
|
+
.galleryCard { display: block; width: 100%; margin: 0; overflow: hidden; border: 1px solid var(--dsw-alias-border-l1); border-radius: 14px; background: var(--dsw-alias-bg-layer-1); box-shadow: 0 5px 18px rgb(24 32 54 / 7%); }
|
|
1394
|
+
.galleryImageButton { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--dsw-alias-bg-base); cursor: zoom-in; }
|
|
1395
|
+
.galleryImage { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
|
|
1396
|
+
.galleryMasonry[data-view='masonry'] .galleryCard:nth-child(3n + 1) .galleryImage { aspect-ratio: 4 / 5; }
|
|
1397
|
+
.galleryMasonry[data-view='masonry'] .galleryCard:nth-child(3n + 2) .galleryImage { aspect-ratio: 4 / 3; }
|
|
1398
|
+
.galleryMasonry[data-view='masonry'] .galleryCard:nth-child(3n) .galleryImage { aspect-ratio: 3 / 4; }
|
|
1399
|
+
.galleryBadge { position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 999px; color: #fff; background: rgb(18 23 36 / 76%); font-size: 11px; backdrop-filter: blur(4px); }
|
|
1400
|
+
.galleryCardFooter { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 12px; }
|
|
1401
|
+
.galleryAvatar { display: grid; flex: none; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: #fff; background: var(--dsw-alias-brand-primary); font-size: 12px; font-weight: 700; }
|
|
1402
|
+
.galleryCardInfo { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
|
|
1403
|
+
.galleryCardInfo strong, .galleryCardInfo small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1404
|
+
.galleryCardInfo strong { color: var(--dsw-alias-label-primary); font-size: 12px; }
|
|
1405
|
+
.galleryCardInfo small { color: var(--dsw-alias-label-tertiary); font-size: 10px; }
|
|
1406
|
+
.galleryRemove { flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; color: var(--dsw-alias-label-tertiary); background: transparent; cursor: pointer; font-size: 18px; }
|
|
1407
|
+
.galleryRemove:hover { color: var(--dsw-alias-state-error); background: var(--dsw-alias-bg-layer-2); }
|
|
1408
|
+
|
|
1409
|
+
@media (max-width: 1100px) {
|
|
1410
|
+
.galleryMasonry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
@media (max-width: 760px) {
|
|
1414
|
+
.studio { flex-direction: column; overflow: auto; }
|
|
1415
|
+
.config { width: auto; max-width: none; height: auto; min-height: 0; }
|
|
1416
|
+
.config[data-gallery='true'] { flex: none; }
|
|
1417
|
+
.canvas { min-height: 560px; }
|
|
1418
|
+
.galleryToolbar { align-items: flex-start; flex-direction: column; }
|
|
1419
|
+
.galleryToolbarActions { width: 100%; flex-wrap: wrap; }
|
|
1420
|
+
.galleryMasonry { grid-template-columns: 1fr; }
|
|
1421
|
+
}
|