@dickpy/dsh-imagegen 1.5.9 → 1.5.10

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.
@@ -920,21 +920,17 @@ html[data-dsh-imagegen-active] .sidebarHistoryHost {
920
920
  padding: 10px 8px 18px;
921
921
  }
922
922
 
923
- /* Flat sections in the CapyAI style: plain headings, no card boxes. */
923
+ /* Config cards in the 参考布局 style: elevated white cards, head row with a
924
+ * count chip, hint line under the title. */
924
925
  .ecommerceSection {
925
926
  display: flex;
926
927
  flex-direction: column;
927
928
  gap: 10px;
928
- padding: 0 0 16px;
929
- border: none;
930
- border-bottom: 1px solid var(--dsw-alias-border-l1);
931
- border-radius: 0;
932
- background: transparent;
933
- }
934
-
935
- .ecommerceSection:last-of-type {
936
- padding-bottom: 4px;
937
- border-bottom: none;
929
+ padding: 14px 16px 16px;
930
+ border: 1px solid var(--dsw-alias-border-l1);
931
+ border-radius: 14px;
932
+ background: var(--dsw-alias-bg-layer-1);
933
+ box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
938
934
  }
939
935
 
940
936
  .ecommerceSection h3 {
@@ -944,12 +940,46 @@ html[data-dsh-imagegen-active] .sidebarHistoryHost {
944
940
  display: flex;
945
941
  align-items: baseline;
946
942
  gap: 7px;
943
+ min-width: 0;
947
944
  }
948
945
 
949
946
  .ecommerceSectionHint {
950
947
  font-size: 11px;
951
948
  font-weight: 400;
952
949
  color: var(--dsw-alias-label-tertiary);
950
+ white-space: nowrap;
951
+ overflow: hidden;
952
+ text-overflow: ellipsis;
953
+ }
954
+
955
+ .ecommerceCardHead {
956
+ display: flex;
957
+ align-items: center;
958
+ justify-content: space-between;
959
+ gap: 8px;
960
+ min-width: 0;
961
+ }
962
+
963
+ .ecommerceCardHead h3 {
964
+ flex: 1;
965
+ min-width: 0;
966
+ }
967
+
968
+ .ecommerceCardCount {
969
+ flex: none;
970
+ font-size: 11px;
971
+ line-height: 16px;
972
+ padding: 1px 8px;
973
+ border-radius: 999px;
974
+ background: var(--dsw-alias-bg-layer-3);
975
+ color: var(--dsw-alias-label-secondary);
976
+ }
977
+
978
+ .ecommerceCardHint {
979
+ margin: -4px 0 0;
980
+ font-size: 11.5px;
981
+ line-height: 1.5;
982
+ color: var(--dsw-alias-label-tertiary);
953
983
  }
954
984
 
955
985
  .ecommerceSection input:not([type="checkbox"]), .ecommerceSection select, .ecommerceSection textarea { box-sizing: border-box; width: 100%; padding: 9px 11px; color: var(--dsw-alias-label-primary); background: var(--dsw-alias-bg-layer-3); border: 1px solid var(--dsw-alias-border-l2); border-radius: 9px; font: inherit; }
@@ -1321,6 +1351,25 @@ html[data-dsh-imagegen-active] .sidebarHistoryHost {
1321
1351
  gap: 16px;
1322
1352
  }
1323
1353
 
1354
+ /* 套图结果左右布局:主图组独占左侧大图,其余分组纵排在右侧。 */
1355
+ .ecommerceGroups[data-split] {
1356
+ display: grid;
1357
+ grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
1358
+ gap: 14px;
1359
+ align-items: start;
1360
+ }
1361
+
1362
+ .ecommerceGroupsSide {
1363
+ display: flex;
1364
+ flex-direction: column;
1365
+ gap: 16px;
1366
+ min-width: 0;
1367
+ }
1368
+
1369
+ .ecommerceGroup[data-main] .ecommerceGroupGrid {
1370
+ grid-template-columns: 1fr;
1371
+ }
1372
+
1324
1373
  .ecommerceGroup {
1325
1374
  display: flex;
1326
1375
  flex-direction: column;
@@ -1357,6 +1406,32 @@ html[data-dsh-imagegen-active] .sidebarHistoryHost {
1357
1406
  gap: 12px;
1358
1407
  }
1359
1408
 
1409
+ /* AI 帮写 icon button, floats at the 参数信息 card's top-right. */
1410
+ .ecommerceAiButton {
1411
+ flex: none;
1412
+ display: inline-flex;
1413
+ align-items: center;
1414
+ gap: 4px;
1415
+ padding: 3px 9px;
1416
+ border: 1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 45%, transparent);
1417
+ border-radius: 999px;
1418
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent);
1419
+ color: var(--dsw-alias-brand-primary);
1420
+ font-size: 11px;
1421
+ line-height: 16px;
1422
+ cursor: pointer;
1423
+ font-weight: 600;
1424
+ }
1425
+
1426
+ .ecommerceAiButton:hover {
1427
+ background: color-mix(in srgb, var(--dsw-alias-brand-primary) 20%, transparent);
1428
+ }
1429
+
1430
+ .ecommerceAiButton:disabled {
1431
+ opacity: 0.55;
1432
+ cursor: default;
1433
+ }
1434
+
1360
1435
  .ecommerceTaskCard {
1361
1436
  position: relative;
1362
1437
  display: flex;
@@ -0,0 +1,20 @@
1
+ /** Walk up from an element to the first opaque surface and decide
2
+ * light vs dark, so ported reactbits visuals can pick their ink. Non-browser
3
+ * environments (jsdom smoke) have no computed styles and default to dark. */
4
+ export function detectLightSurface(element: HTMLElement): boolean {
5
+ if (typeof globalThis.getComputedStyle !== 'function') return false
6
+ let node: HTMLElement | null = element
7
+ while (node !== null) {
8
+ const color = getComputedStyle(node).backgroundColor
9
+ const match = color.match(/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,]+([\d.]+))?\s*\)/)
10
+ if (match !== null) {
11
+ const alpha = match[4] !== undefined ? Number(match[4]) : 1
12
+ if (alpha >= 0.5) {
13
+ const luminance = (0.2126 * Number(match[1]) + 0.7152 * Number(match[2]) + 0.0722 * Number(match[3])) / 255
14
+ return luminance > 0.55
15
+ }
16
+ }
17
+ node = node.parentElement
18
+ }
19
+ return false
20
+ }