sa2kit 1.6.70 → 1.6.72

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.
Files changed (43) hide show
  1. package/dist/festivalCard/core/index.d.mts +1 -1
  2. package/dist/festivalCard/core/index.d.ts +1 -1
  3. package/dist/festivalCard/core/index.js +4 -2
  4. package/dist/festivalCard/core/index.js.map +1 -1
  5. package/dist/festivalCard/core/index.mjs +4 -2
  6. package/dist/festivalCard/core/index.mjs.map +1 -1
  7. package/dist/festivalCard/index.d.mts +2 -2
  8. package/dist/festivalCard/index.d.ts +2 -2
  9. package/dist/festivalCard/index.js +79 -139
  10. package/dist/festivalCard/index.js.map +1 -1
  11. package/dist/festivalCard/index.mjs +79 -139
  12. package/dist/festivalCard/index.mjs.map +1 -1
  13. package/dist/festivalCard/miniapp/index.d.mts +3 -3
  14. package/dist/festivalCard/miniapp/index.d.ts +3 -3
  15. package/dist/festivalCard/miniapp/index.js +21 -15
  16. package/dist/festivalCard/miniapp/index.js.map +1 -1
  17. package/dist/festivalCard/miniapp/index.mjs +21 -15
  18. package/dist/festivalCard/miniapp/index.mjs.map +1 -1
  19. package/dist/festivalCard/routes/index.d.mts +1 -1
  20. package/dist/festivalCard/routes/index.d.ts +1 -1
  21. package/dist/festivalCard/routes/index.js +4 -2
  22. package/dist/festivalCard/routes/index.js.map +1 -1
  23. package/dist/festivalCard/routes/index.mjs +4 -2
  24. package/dist/festivalCard/routes/index.mjs.map +1 -1
  25. package/dist/festivalCard/server/index.d.mts +1 -1
  26. package/dist/festivalCard/server/index.d.ts +1 -1
  27. package/dist/festivalCard/web/index.d.mts +3 -3
  28. package/dist/festivalCard/web/index.d.ts +3 -3
  29. package/dist/festivalCard/web/index.js +79 -139
  30. package/dist/festivalCard/web/index.js.map +1 -1
  31. package/dist/festivalCard/web/index.mjs +79 -139
  32. package/dist/festivalCard/web/index.mjs.map +1 -1
  33. package/dist/{festivalCardService-CgNBOjjO.d.mts → festivalCardService-CqBTVC6x.d.mts} +1 -1
  34. package/dist/{festivalCardService-ClJiAP6P.d.ts → festivalCardService-iFKu0k9q.d.ts} +1 -1
  35. package/dist/index.d.mts +2 -2
  36. package/dist/index.d.ts +2 -2
  37. package/dist/index.js +79 -139
  38. package/dist/index.js.map +1 -1
  39. package/dist/index.mjs +79 -139
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/{types-COyg0XDw.d.mts → types-D2WetAPc.d.mts} +1 -0
  42. package/dist/{types-COyg0XDw.d.ts → types-D2WetAPc.d.ts} +1 -0
  43. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7210,7 +7210,8 @@ var DEFAULT_FESTIVAL_CARD_CONFIG = {
7210
7210
  src: "https://images.unsplash.com/photo-1512389142860-9c449e58a543?auto=format&fit=crop&w=1200&q=80",
7211
7211
  fit: "cover",
7212
7212
  borderRadius: 16,
7213
- alt: "holiday"
7213
+ alt: "holiday",
7214
+ isBackground: false
7214
7215
  }
7215
7216
  ]
7216
7217
  },
@@ -7269,7 +7270,8 @@ var DEFAULT_FESTIVAL_CARD_CONFIG = {
7269
7270
  src: "https://images.unsplash.com/photo-1456324504439-367cee3b3c32?auto=format&fit=crop&w=1200&q=80",
7270
7271
  fit: "cover",
7271
7272
  borderRadius: 14,
7272
- alt: "gift"
7273
+ alt: "gift",
7274
+ isBackground: false
7273
7275
  },
7274
7276
  {
7275
7277
  id: "p3-text-1",
@@ -7335,9 +7337,10 @@ var useFestivalCardConfig = (options) => {
7335
7337
  const [loading, setLoading] = React42.useState(Boolean(options?.fetchConfig));
7336
7338
  const [saving, setSaving] = React42.useState(false);
7337
7339
  React42.useEffect(() => {
7338
- if (!options?.fetchConfig) return;
7340
+ const fetchConfig = options?.fetchConfig;
7341
+ if (!fetchConfig) return;
7339
7342
  let active = true;
7340
- void options.fetchConfig().then((value) => {
7343
+ void fetchConfig().then((value) => {
7341
7344
  if (!active) return;
7342
7345
  setConfig(normalizeFestivalCardConfig(value));
7343
7346
  }).finally(() => {
@@ -7346,16 +7349,17 @@ var useFestivalCardConfig = (options) => {
7346
7349
  return () => {
7347
7350
  active = false;
7348
7351
  };
7349
- }, [options]);
7352
+ }, [options?.fetchConfig]);
7350
7353
  const save = React42.useCallback(async () => {
7351
- if (!options?.onSave) return;
7354
+ const onSave = options?.onSave;
7355
+ if (!onSave) return;
7352
7356
  setSaving(true);
7353
7357
  try {
7354
- await options.onSave(config);
7358
+ await onSave(config);
7355
7359
  } finally {
7356
7360
  setSaving(false);
7357
7361
  }
7358
- }, [config, options]);
7362
+ }, [config, options?.onSave]);
7359
7363
  return React42.useMemo(
7360
7364
  () => ({
7361
7365
  config,
@@ -7369,6 +7373,7 @@ var useFestivalCardConfig = (options) => {
7369
7373
  };
7370
7374
  var elementStyle = (element) => ({
7371
7375
  position: "absolute",
7376
+ zIndex: 2,
7372
7377
  left: `${element.x}%`,
7373
7378
  top: `${element.y}%`,
7374
7379
  width: `${element.width ?? 70}%`,
@@ -7411,22 +7416,23 @@ var renderElement = (element) => {
7411
7416
  );
7412
7417
  };
7413
7418
  var FestivalCardPageRenderer = ({ page }) => {
7419
+ const backgroundElement = page.elements.find(
7420
+ (element) => element.type === "image" && Boolean(element.isBackground)
7421
+ );
7422
+ const foregroundElements = page.elements.filter((element) => !(element.type === "image" && element.isBackground));
7414
7423
  return /* @__PURE__ */ React42__namespace.default.createElement(
7415
7424
  "div",
7416
7425
  {
7426
+ className: "relative h-full w-full overflow-hidden rounded-2xl",
7417
7427
  style: {
7418
- position: "relative",
7419
- width: "100%",
7420
- height: "100%",
7421
- overflow: "hidden",
7422
- borderRadius: 16,
7423
7428
  backgroundColor: page.background?.color || "#0f172a",
7424
- backgroundImage: page.background?.image ? `url(${page.background.image})` : void 0,
7429
+ backgroundImage: backgroundElement ? `url(${backgroundElement.src})` : page.background?.image ? `url(${page.background.image})` : void 0,
7425
7430
  backgroundSize: "cover",
7426
7431
  backgroundPosition: "center"
7427
7432
  }
7428
7433
  },
7429
- page.elements.map(renderElement)
7434
+ /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "absolute inset-0 bg-slate-950/20" }),
7435
+ foregroundElements.map(renderElement)
7430
7436
  );
7431
7437
  };
7432
7438
 
@@ -7440,100 +7446,31 @@ var FestivalCardBook3D = ({ config, className }) => {
7440
7446
  return /* @__PURE__ */ React42__namespace.default.createElement("div", { className }, /* @__PURE__ */ React42__namespace.default.createElement(
7441
7447
  "div",
7442
7448
  {
7449
+ className: "w-full min-h-[560px] rounded-3xl p-6 shadow-2xl shadow-slate-900/50",
7443
7450
  style: {
7444
- width: "100%",
7445
- minHeight: 560,
7446
- borderRadius: 24,
7447
- padding: 24,
7448
- background: `linear-gradient(145deg, ${normalized.background?.colorA || "#0c1a34"} 0%, ${normalized.background?.colorB || "#1f4f8a"} 100%)`,
7449
- boxShadow: "0 26px 70px rgba(2, 6, 23, 0.45)"
7451
+ background: `linear-gradient(145deg, ${normalized.background?.colorA || "#0c1a34"} 0%, ${normalized.background?.colorB || "#1f4f8a"} 100%)`
7450
7452
  }
7451
7453
  },
7452
- /* @__PURE__ */ React42__namespace.default.createElement(
7453
- "div",
7454
- {
7455
- style: {
7456
- marginBottom: 14,
7457
- color: "#f8fafc",
7458
- fontSize: 14,
7459
- opacity: 0.9,
7460
- textAlign: "center"
7461
- }
7462
- },
7463
- normalized.coverTitle || "Festival Card",
7464
- " \xB7 \u7B2C ",
7465
- currentPage + 1,
7466
- " / ",
7467
- pages.length,
7468
- " \u9875"
7469
- ),
7470
- /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { perspective: 1400, width: "100%", maxWidth: 920, margin: "0 auto" } }, /* @__PURE__ */ React42__namespace.default.createElement(
7454
+ /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "mx-auto w-full max-w-5xl text-center text-slate-100" }, /* @__PURE__ */ React42__namespace.default.createElement("h3", { className: "mb-4 text-lg font-semibold" }, normalized.coverTitle || "Festival Card")),
7455
+ /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "mx-auto w-full max-w-5xl" }, /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "relative h-[460px]" }, pages.map((page, index) => /* @__PURE__ */ React42__namespace.default.createElement(
7471
7456
  "div",
7472
7457
  {
7458
+ key: page.id,
7459
+ className: "absolute inset-0 transition-opacity duration-500 ease-out",
7473
7460
  style: {
7474
- position: "relative",
7475
- height: 460,
7476
- transformStyle: "preserve-3d"
7461
+ opacity: index === currentPage ? 1 : 0,
7462
+ pointerEvents: index === currentPage ? "auto" : "none"
7477
7463
  }
7478
7464
  },
7479
- pages.map((page, index) => {
7480
- const isFlipped = index < currentPage;
7481
- const zIndex = pages.length - index;
7482
- return /* @__PURE__ */ React42__namespace.default.createElement(
7483
- "div",
7484
- {
7485
- key: page.id,
7486
- style: {
7487
- position: "absolute",
7488
- inset: 0,
7489
- transformStyle: "preserve-3d",
7490
- transformOrigin: "left center",
7491
- transform: `rotateY(${isFlipped ? -170 : 0}deg)`,
7492
- transition: "transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1)",
7493
- zIndex
7494
- }
7495
- },
7496
- /* @__PURE__ */ React42__namespace.default.createElement(
7497
- "div",
7498
- {
7499
- style: {
7500
- position: "absolute",
7501
- inset: 0,
7502
- backfaceVisibility: "hidden"
7503
- }
7504
- },
7505
- /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardPageRenderer, { page })
7506
- ),
7507
- /* @__PURE__ */ React42__namespace.default.createElement(
7508
- "div",
7509
- {
7510
- style: {
7511
- position: "absolute",
7512
- inset: 0,
7513
- transform: "rotateY(180deg)",
7514
- backfaceVisibility: "hidden",
7515
- borderRadius: 16,
7516
- background: "#0f172a"
7517
- }
7518
- }
7519
- )
7520
- );
7521
- })
7522
- )),
7523
- /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "flex", justifyContent: "center", gap: 12, marginTop: 18 } }, /* @__PURE__ */ React42__namespace.default.createElement(
7465
+ /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardPageRenderer, { page })
7466
+ )))),
7467
+ /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "mt-5 flex justify-center gap-3" }, /* @__PURE__ */ React42__namespace.default.createElement(
7524
7468
  "button",
7525
7469
  {
7526
7470
  type: "button",
7527
7471
  disabled: !canPrev,
7528
7472
  onClick: () => setCurrentPage((p) => Math.max(0, p - 1)),
7529
- style: {
7530
- border: "none",
7531
- borderRadius: 999,
7532
- padding: "9px 16px",
7533
- fontSize: 14,
7534
- cursor: canPrev ? "pointer" : "not-allowed",
7535
- opacity: canPrev ? 1 : 0.4
7536
- }
7473
+ className: "rounded-full bg-white px-5 py-2 text-sm font-medium text-slate-900 disabled:cursor-not-allowed disabled:opacity-45"
7537
7474
  },
7538
7475
  "\u4E0A\u4E00\u9875"
7539
7476
  ), /* @__PURE__ */ React42__namespace.default.createElement(
@@ -7542,14 +7479,7 @@ var FestivalCardBook3D = ({ config, className }) => {
7542
7479
  type: "button",
7543
7480
  disabled: !canNext,
7544
7481
  onClick: () => setCurrentPage((p) => Math.min(pages.length - 1, p + 1)),
7545
- style: {
7546
- border: "none",
7547
- borderRadius: 999,
7548
- padding: "9px 16px",
7549
- fontSize: 14,
7550
- cursor: canNext ? "pointer" : "not-allowed",
7551
- opacity: canNext ? 1 : 0.4
7552
- }
7482
+ className: "rounded-full bg-sky-300 px-5 py-2 text-sm font-medium text-slate-900 disabled:cursor-not-allowed disabled:opacity-45"
7553
7483
  },
7554
7484
  "\u4E0B\u4E00\u9875"
7555
7485
  ))
@@ -7560,7 +7490,7 @@ var FestivalCardBook3D = ({ config, className }) => {
7560
7490
  autoPlay: normalized.backgroundMusic.autoPlay,
7561
7491
  loop: normalized.backgroundMusic.loop,
7562
7492
  controls: true,
7563
- style: { width: "100%", marginTop: 10 }
7493
+ className: "mt-3 w-full"
7564
7494
  }
7565
7495
  ) : null);
7566
7496
  };
@@ -7602,16 +7532,17 @@ var FestivalCardConfigEditor = ({ value, onChange }) => {
7602
7532
  )
7603
7533
  });
7604
7534
  };
7605
- return /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { borderRadius: 16, background: "#0f172a", color: "#e2e8f0", padding: 16 } }, /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "grid", gap: 12 } }, /* @__PURE__ */ React42__namespace.default.createElement("label", { style: { display: "grid", gap: 6 } }, /* @__PURE__ */ React42__namespace.default.createElement("span", null, "\u9875\u9762\u6570\u91CF"), /* @__PURE__ */ React42__namespace.default.createElement(
7535
+ return /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "rounded-2xl border border-slate-200 bg-white p-4 text-slate-900 shadow-sm" }, /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "grid gap-3" }, /* @__PURE__ */ React42__namespace.default.createElement("label", { className: "grid gap-1.5" }, /* @__PURE__ */ React42__namespace.default.createElement("span", { className: "text-sm font-medium text-slate-700" }, "\u9875\u9762\u6570\u91CF"), /* @__PURE__ */ React42__namespace.default.createElement(
7606
7536
  "input",
7607
7537
  {
7608
7538
  type: "number",
7609
7539
  min: 1,
7610
7540
  max: 12,
7611
7541
  value: value.pages.length,
7612
- onChange: (event) => onChange(resizeFestivalCardPages(value, Number(event.target.value)))
7542
+ onChange: (event) => onChange(resizeFestivalCardPages(value, Number(event.target.value))),
7543
+ className: "rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 outline-none focus:border-sky-400 focus:ring-2 focus:ring-sky-100"
7613
7544
  }
7614
- )), /* @__PURE__ */ React42__namespace.default.createElement("label", { style: { display: "grid", gap: 6 } }, /* @__PURE__ */ React42__namespace.default.createElement("span", null, "\u80CC\u666F\u97F3\u4E50 URL"), /* @__PURE__ */ React42__namespace.default.createElement(
7545
+ )), /* @__PURE__ */ React42__namespace.default.createElement("label", { className: "grid gap-1.5" }, /* @__PURE__ */ React42__namespace.default.createElement("span", { className: "text-sm font-medium text-slate-700" }, "\u80CC\u666F\u97F3\u4E50 URL"), /* @__PURE__ */ React42__namespace.default.createElement(
7615
7546
  "input",
7616
7547
  {
7617
7548
  type: "url",
@@ -7622,9 +7553,18 @@ var FestivalCardConfigEditor = ({ value, onChange }) => {
7622
7553
  ...value.backgroundMusic,
7623
7554
  src: event.target.value
7624
7555
  }
7625
- })
7556
+ }),
7557
+ className: "rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 outline-none focus:border-sky-400 focus:ring-2 focus:ring-sky-100"
7626
7558
  }
7627
- )), /* @__PURE__ */ React42__namespace.default.createElement("label", { style: { display: "grid", gap: 6 } }, /* @__PURE__ */ React42__namespace.default.createElement("span", null, "\u7F16\u8F91\u9875\u9762"), /* @__PURE__ */ React42__namespace.default.createElement("select", { value: activePageIndex, onChange: (event) => setActivePageIndex(Number(event.target.value)) }, pageOptions.map((index) => /* @__PURE__ */ React42__namespace.default.createElement("option", { key: index, value: index }, "\u7B2C ", index + 1, " \u9875"))))), canEditPage ? /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "flex", gap: 8, marginBottom: 12 } }, /* @__PURE__ */ React42__namespace.default.createElement(
7559
+ )), /* @__PURE__ */ React42__namespace.default.createElement("label", { className: "grid gap-1.5" }, /* @__PURE__ */ React42__namespace.default.createElement("span", { className: "text-sm font-medium text-slate-700" }, "\u7F16\u8F91\u9875\u9762"), /* @__PURE__ */ React42__namespace.default.createElement(
7560
+ "select",
7561
+ {
7562
+ value: activePageIndex,
7563
+ onChange: (event) => setActivePageIndex(Number(event.target.value)),
7564
+ className: "rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 outline-none focus:border-sky-400 focus:ring-2 focus:ring-sky-100"
7565
+ },
7566
+ pageOptions.map((index) => /* @__PURE__ */ React42__namespace.default.createElement("option", { key: index, value: index }, "\u7B2C ", index + 1, " \u9875"))
7567
+ ))), canEditPage ? /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "mt-4" }, /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "mb-3 flex gap-2" }, /* @__PURE__ */ React42__namespace.default.createElement(
7628
7568
  "button",
7629
7569
  {
7630
7570
  type: "button",
@@ -7633,7 +7573,8 @@ var FestivalCardConfigEditor = ({ value, onChange }) => {
7633
7573
  pages: value.pages.map(
7634
7574
  (p, index) => index === activePageIndex ? { ...p, elements: [...p.elements, createTextElement(index)] } : p
7635
7575
  )
7636
- })
7576
+ }),
7577
+ className: "rounded-lg bg-slate-900 px-3 py-2 text-sm font-medium text-white"
7637
7578
  },
7638
7579
  "+ \u6587\u5B57"
7639
7580
  ), /* @__PURE__ */ React42__namespace.default.createElement(
@@ -7645,26 +7586,35 @@ var FestivalCardConfigEditor = ({ value, onChange }) => {
7645
7586
  pages: value.pages.map(
7646
7587
  (p, index) => index === activePageIndex ? { ...p, elements: [...p.elements, createImageElement(index)] } : p
7647
7588
  )
7648
- })
7589
+ }),
7590
+ className: "rounded-lg bg-sky-600 px-3 py-2 text-sm font-medium text-white"
7649
7591
  },
7650
7592
  "+ \u56FE\u7247"
7651
- )), /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "grid", gap: 10, maxHeight: 340, overflow: "auto" } }, (page?.elements ?? []).map((element) => /* @__PURE__ */ React42__namespace.default.createElement("div", { key: element.id, style: { border: "1px solid #334155", borderRadius: 10, padding: 10 } }, /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { marginBottom: 8 } }, element.type.toUpperCase()), element.type === "text" ? /* @__PURE__ */ React42__namespace.default.createElement(
7593
+ )), /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "grid max-h-[340px] gap-2.5 overflow-auto pr-1" }, (page?.elements ?? []).map((element) => /* @__PURE__ */ React42__namespace.default.createElement("div", { key: element.id, className: "rounded-xl border border-slate-200 bg-slate-50 p-3" }, /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "mb-2 text-xs font-semibold tracking-wide text-slate-500" }, element.type.toUpperCase()), element.type === "text" ? /* @__PURE__ */ React42__namespace.default.createElement(
7652
7594
  "textarea",
7653
7595
  {
7654
7596
  value: element.content,
7655
7597
  onChange: (event) => updateElement(element.id, { content: event.target.value }),
7656
7598
  rows: 3,
7657
- style: { width: "100%" }
7599
+ className: "w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm text-slate-900 outline-none focus:border-sky-400 focus:ring-2 focus:ring-sky-100"
7658
7600
  }
7659
- ) : /* @__PURE__ */ React42__namespace.default.createElement(
7601
+ ) : /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "grid gap-2" }, /* @__PURE__ */ React42__namespace.default.createElement(
7660
7602
  "input",
7661
7603
  {
7662
7604
  type: "url",
7663
7605
  value: element.src,
7664
7606
  onChange: (event) => updateElement(element.id, { src: event.target.value }),
7665
- style: { width: "100%" }
7607
+ className: "w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm text-slate-900 outline-none focus:border-sky-400 focus:ring-2 focus:ring-sky-100"
7608
+ }
7609
+ ), /* @__PURE__ */ React42__namespace.default.createElement("label", { className: "inline-flex items-center gap-2 text-sm text-slate-700" }, /* @__PURE__ */ React42__namespace.default.createElement(
7610
+ "input",
7611
+ {
7612
+ type: "checkbox",
7613
+ checked: Boolean(element.isBackground),
7614
+ onChange: (event) => updateElement(element.id, { isBackground: event.target.checked }),
7615
+ className: "h-4 w-4 rounded border-slate-300 text-sky-600"
7666
7616
  }
7667
- ))))) : null);
7617
+ ), "\u4F5C\u4E3A\u672C\u9875\u80CC\u666F\u56FE")))))) : null);
7668
7618
  };
7669
7619
 
7670
7620
  // src/festivalCard/components/FestivalCardStudio.tsx
@@ -7675,13 +7625,13 @@ var FestivalCardStudio = ({ initialConfig, fetchConfig, onSave }) => {
7675
7625
  onSave
7676
7626
  });
7677
7627
  if (loading) return /* @__PURE__ */ React42__namespace.default.createElement("div", null, "\u52A0\u8F7D\u4E2D...");
7678
- return /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "grid", gridTemplateColumns: "1.4fr 1fr", gap: 16 } }, /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardBook3D, { config }), /* @__PURE__ */ React42__namespace.default.createElement("div", null, /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardConfigEditor, { value: config, onChange: setConfig }), onSave ? /* @__PURE__ */ React42__namespace.default.createElement(
7628
+ return /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "grid gap-4 lg:grid-cols-[1.45fr_1fr]" }, /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardBook3D, { config, className: "h-full" }), /* @__PURE__ */ React42__namespace.default.createElement("div", null, /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardConfigEditor, { value: config, onChange: setConfig }), onSave ? /* @__PURE__ */ React42__namespace.default.createElement(
7679
7629
  "button",
7680
7630
  {
7681
7631
  type: "button",
7682
7632
  onClick: () => void save(),
7683
7633
  disabled: saving,
7684
- style: { marginTop: 12, width: "100%", padding: "10px 16px" }
7634
+ className: "mt-3 w-full rounded-lg bg-slate-900 px-4 py-2.5 text-sm font-medium text-white disabled:opacity-60"
7685
7635
  },
7686
7636
  saving ? "\u4FDD\u5B58\u4E2D..." : "\u4FDD\u5B58\u914D\u7F6E"
7687
7637
  ) : null));
@@ -7745,7 +7695,15 @@ var FestivalCardConfigPage = ({
7745
7695
  await reloadList();
7746
7696
  };
7747
7697
  const mainLink = React42.useMemo(() => `${mainPagePath}?cardId=${encodeURIComponent(selectedId)}`, [mainPagePath, selectedId]);
7748
- return /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "grid", gap: 12 } }, /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "flex", gap: 10, alignItems: "center" } }, /* @__PURE__ */ React42__namespace.default.createElement("select", { value: selectedId, onChange: (event) => setSelectedId(event.target.value) }, list.map((item) => /* @__PURE__ */ React42__namespace.default.createElement("option", { key: item.id, value: item.id }, item.name || item.id))), /* @__PURE__ */ React42__namespace.default.createElement("button", { type: "button", onClick: () => void createNew() }, "\u65B0\u5EFA\u5361\u7247"), /* @__PURE__ */ React42__namespace.default.createElement("a", { href: mainLink, style: { color: "#2563eb", fontSize: 14 } }, "\u6253\u5F00\u4E3B\u9875\u9762")), /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardStudio, { fetchConfig, onSave: saveConfig }));
7698
+ return /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "grid gap-3" }, /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "flex flex-wrap items-center gap-2" }, /* @__PURE__ */ React42__namespace.default.createElement(
7699
+ "select",
7700
+ {
7701
+ value: selectedId,
7702
+ onChange: (event) => setSelectedId(event.target.value),
7703
+ className: "min-w-[200px] rounded-lg border border-slate-300 bg-white px-3 py-2 text-sm text-slate-900 outline-none focus:border-sky-400 focus:ring-2 focus:ring-sky-100"
7704
+ },
7705
+ list.map((item) => /* @__PURE__ */ React42__namespace.default.createElement("option", { key: item.id, value: item.id }, item.name || item.id))
7706
+ ), /* @__PURE__ */ React42__namespace.default.createElement("button", { type: "button", onClick: () => void createNew(), className: "rounded-lg bg-slate-900 px-3 py-2 text-sm font-medium text-white" }, "\u65B0\u5EFA\u5361\u7247"), /* @__PURE__ */ React42__namespace.default.createElement("a", { href: mainLink, className: "rounded-lg border border-sky-200 bg-sky-50 px-3 py-2 text-sm text-sky-700" }, "\u6253\u5F00\u4E3B\u9875\u9762")), /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardStudio, { fetchConfig, onSave: saveConfig }));
7749
7707
  };
7750
7708
  var isSummary = (value) => {
7751
7709
  if (!value || typeof value !== "object") return false;
@@ -7769,7 +7727,6 @@ var FestivalCardManagedPage = ({
7769
7727
  cardId,
7770
7728
  configPagePath = "/festivalCard/config"
7771
7729
  }) => {
7772
- const [list, setList] = React42.useState([]);
7773
7730
  const [currentCardId, setCurrentCardId] = React42.useState(cardId || "");
7774
7731
  const [config, setConfig] = React42.useState(null);
7775
7732
  const [loading, setLoading] = React42.useState(true);
@@ -7778,7 +7735,6 @@ var FestivalCardManagedPage = ({
7778
7735
  const response = await fetch(apiBase, { cache: "no-store" });
7779
7736
  const data = await response.json();
7780
7737
  const items = parseListResponse(data);
7781
- setList(items);
7782
7738
  const first = items[0];
7783
7739
  if (!currentCardId && first) {
7784
7740
  setCurrentCardId(first.id);
@@ -7795,23 +7751,7 @@ var FestivalCardManagedPage = ({
7795
7751
  if (!currentCardId) return configPagePath;
7796
7752
  return `${configPagePath}?cardId=${encodeURIComponent(currentCardId)}`;
7797
7753
  }, [configPagePath, currentCardId]);
7798
- return /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "grid", gridTemplateColumns: "240px 1fr", gap: 14 } }, /* @__PURE__ */ React42__namespace.default.createElement("aside", { style: { borderRadius: 16, padding: 12, background: "#0f172a", color: "#e2e8f0" } }, /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { fontSize: 14, marginBottom: 8 } }, "\u5361\u7247\u5217\u8868"), /* @__PURE__ */ React42__namespace.default.createElement("div", { style: { display: "grid", gap: 8 } }, list.map((item) => /* @__PURE__ */ React42__namespace.default.createElement(
7799
- "button",
7800
- {
7801
- key: item.id,
7802
- type: "button",
7803
- onClick: () => setCurrentCardId(item.id),
7804
- style: {
7805
- borderRadius: 8,
7806
- border: "1px solid #334155",
7807
- padding: "8px 10px",
7808
- textAlign: "left",
7809
- background: currentCardId === item.id ? "#1e293b" : "#0b1220",
7810
- color: "#e2e8f0"
7811
- }
7812
- },
7813
- item.name || item.id
7814
- ))), /* @__PURE__ */ React42__namespace.default.createElement("a", { href: configLink, style: { display: "inline-block", marginTop: 12, color: "#93c5fd", fontSize: 13 } }, "\u8FDB\u5165\u914D\u7F6E\u9875")), /* @__PURE__ */ React42__namespace.default.createElement("div", null, loading || !config ? /* @__PURE__ */ React42__namespace.default.createElement("div", null, "\u52A0\u8F7D\u4E2D...") : /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardBook3D, { config })));
7754
+ return /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "flex justify-end" }, /* @__PURE__ */ React42__namespace.default.createElement("a", { href: configLink, className: "rounded-lg border border-slate-700 bg-slate-900 px-3 py-1.5 text-sm text-sky-300" }, "\u8FDB\u5165\u914D\u7F6E\u9875")), /* @__PURE__ */ React42__namespace.default.createElement("div", null, loading || !config ? /* @__PURE__ */ React42__namespace.default.createElement("div", { className: "py-12 text-center text-slate-400" }, "\u52A0\u8F7D\u4E2D...") : /* @__PURE__ */ React42__namespace.default.createElement(FestivalCardBook3D, { config })));
7815
7755
  };
7816
7756
 
7817
7757
  // src/festivalCard/server/db.ts