pxengine 0.1.90 → 0.1.92

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/dist/index.cjs CHANGED
@@ -39252,9 +39252,12 @@ var PresentationJobCard = ({
39252
39252
  authToken,
39253
39253
  shareUrl,
39254
39254
  className,
39255
+ theme,
39255
39256
  onComplete,
39256
39257
  onFailed
39257
39258
  }) => {
39259
+ const t = th(theme);
39260
+ const accentGradient = theme?.gradient;
39258
39261
  const [status, setStatus] = (0, import_react76.useState)(initialStatus);
39259
39262
  const [title, setTitle] = (0, import_react76.useState)(initialTitle);
39260
39263
  const [slideCount, setSlideCount] = (0, import_react76.useState)(initialSlideCount ?? 0);
@@ -39418,22 +39421,30 @@ var PresentationJobCard = ({
39418
39421
  }
39419
39422
  };
39420
39423
  return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: cn("w-full", className), children: [
39421
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", children: [
39424
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", style: t.root, children: [
39422
39425
  /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
39423
39426
  "div",
39424
39427
  {
39425
39428
  className: "h-[3px] bg-gradient-to-r from-indigo-500 via-purple-500 to-indigo-500 bg-[length:200%_100%] animate-[gradient-shift_2s_ease-in-out_infinite]",
39426
39429
  style: {
39427
39430
  backgroundSize: "200% 100%",
39428
- animation: "gradient-shift 2s ease-in-out infinite"
39431
+ animation: "gradient-shift 2s ease-in-out infinite",
39432
+ ...accentGradient ? { backgroundImage: accentGradient } : {}
39429
39433
  }
39430
39434
  }
39431
39435
  ),
39432
39436
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "p-5", children: [
39433
39437
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-start gap-3", children: [
39434
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "text-lg", children: getPhaseIcon() }) }),
39438
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
39439
+ "div",
39440
+ {
39441
+ className: "w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center flex-shrink-0",
39442
+ style: { ...t.accentSubtle(0.1), ...t.accentBorder },
39443
+ children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "text-lg", children: getPhaseIcon() })
39444
+ }
39445
+ ),
39435
39446
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex-1 min-w-0", children: [
39436
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", children: title || "Creating Presentation" }),
39447
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", style: t.text, children: title || "Creating Presentation" }),
39437
39448
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("p", { className: "text-xs text-zinc-500 mt-0.5", children: [
39438
39449
  slidesTotal > 0 ? `${slidesTotal} slides` : "Presentation",
39439
39450
  " \xB7 In progress"
@@ -39446,7 +39457,10 @@ var PresentationJobCard = ({
39446
39457
  "div",
39447
39458
  {
39448
39459
  className: "h-full bg-gradient-to-r from-indigo-500 to-purple-500 rounded-full transition-all duration-500 ease-out",
39449
- style: { width: `${Math.max(pct, 2)}%` }
39460
+ style: {
39461
+ width: `${Math.max(pct, 2)}%`,
39462
+ ...accentGradient ? { backgroundImage: accentGradient } : t.accentBg
39463
+ }
39450
39464
  }
39451
39465
  ) }),
39452
39466
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("span", { className: "absolute right-0 -top-5 text-xs text-zinc-500 font-medium tabular-nums", children: [
@@ -39455,7 +39469,7 @@ var PresentationJobCard = ({
39455
39469
  ] })
39456
39470
  ] }),
39457
39471
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-2", children: [
39458
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "w-2 h-2 rounded-full bg-indigo-500 animate-pulse" }),
39472
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "w-2 h-2 rounded-full bg-indigo-500 animate-pulse", style: t.accentBg }),
39459
39473
  /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "text-xs text-zinc-400", children: step })
39460
39474
  ] }),
39461
39475
  phase === "ai_generation" && slidesTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-2 pt-1", children: [
@@ -39499,14 +39513,21 @@ var PresentationJobCard = ({
39499
39513
  const total = slideCount || 1;
39500
39514
  const hasHtml = Boolean(formats.html_url);
39501
39515
  return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_jsx_runtime147.Fragment, { children: [
39502
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", children: [
39503
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-[3px]", style: { background: "linear-gradient(90deg, #8B7D5E, #C0AE82, #DCC99B)" } }),
39516
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", style: t.root, children: [
39517
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-[3px]", style: { background: accentGradient || "linear-gradient(90deg, #8B7D5E, #C0AE82, #DCC99B)" } }),
39504
39518
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "p-5", children: [
39505
39519
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-start gap-3", children: [
39506
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center flex-shrink-0 text-indigo-400", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(SlidesIcon, {}) }),
39520
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
39521
+ "div",
39522
+ {
39523
+ className: "w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center flex-shrink-0 text-indigo-400",
39524
+ style: { ...t.accentSubtle(0.1), ...t.accentBorder, ...t.accent },
39525
+ children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(SlidesIcon, {})
39526
+ }
39527
+ ),
39507
39528
  /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex-1 min-w-0", children: [
39508
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", children: title }),
39509
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("p", { className: "text-xs text-zinc-500 mt-0.5", children: [
39529
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", style: t.text, children: title }),
39530
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("p", { className: "text-xs text-zinc-500 mt-0.5", style: t.muted, children: [
39510
39531
  slideCount ? `${slideCount} slides` : "Presentation",
39511
39532
  " \xB7 Ready to export"
39512
39533
  ] })
@@ -39544,6 +39565,7 @@ var PresentationJobCard = ({
39544
39565
  {
39545
39566
  onClick: () => setShowExport(true),
39546
39567
  className: "flex items-center gap-1.5 px-2.5 h-7 bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white text-xs font-medium rounded-lg transition-colors",
39568
+ style: { ...t.accentBg, ...t.accentText },
39547
39569
  children: [
39548
39570
  /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(DownloadIcon, {}),
39549
39571
  /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { children: "Export" })
@@ -41424,6 +41446,7 @@ var MCQCard = import_react82.default.memo(
41424
41446
  onAction,
41425
41447
  disabled = false,
41426
41448
  disableContinueInDiscovery,
41449
+ theme,
41427
41450
  // Self-contained props
41428
41451
  sessionId,
41429
41452
  sendMessage,
@@ -41433,8 +41456,7 @@ var MCQCard = import_react82.default.memo(
41433
41456
  }) => {
41434
41457
  const resolvedQuestion = question || allProps.Question || allProps.q || "";
41435
41458
  const resolvedOptions = options || allProps.Options || allProps.opts || {};
41436
- const resolvedRecommended = recommended || allProps.Recommended || allProps.rec;
41437
- console.log("[MCQCard] FULL PROPS:", { allProps, resolvedQuestion, resolvedOptions: Object.keys(resolvedOptions || {}), resolvedRecommended });
41459
+ const t = th(theme);
41438
41460
  const [selectedOption, setSelectedOption] = import_react82.default.useState(propsSelectedOption);
41439
41461
  const [isProceeded, setIsProceeded] = import_react82.default.useState(false);
41440
41462
  const fetchedSessionRef = import_react82.default.useRef("");
@@ -41459,24 +41481,20 @@ var MCQCard = import_react82.default.memo(
41459
41481
  if (propsSelectedOption) return;
41460
41482
  fetchedSessionRef.current = fetchKey;
41461
41483
  const questionKey = buildQuestionKey(sessionId, resolvedQuestion);
41462
- console.log("[MCQCard] Fetching with key:", questionKey, "(question:", resolvedQuestion, ")");
41463
41484
  fetchSelections(sessionId).then((selections) => {
41464
- console.log("[MCQCard] Got selections:", selections);
41465
41485
  const stored = selections[questionKey] || selections[resolvedQuestion] || selections[`mcq_${sessionId}`];
41466
41486
  if (stored) {
41467
- console.log("[MCQCard] Setting selected:", stored);
41468
41487
  setSelectedOption(stored);
41469
41488
  setIsProceeded(true);
41470
41489
  }
41471
- }).catch((err) => console.error("[MCQCard] Fetch error:", err));
41490
+ }).catch(() => {
41491
+ });
41472
41492
  }, [sessionId, propsSelectedOption, resolvedQuestion, buildQuestionKey]);
41473
41493
  const isDiscovery = disableContinueInDiscovery !== void 0 ? disableContinueInDiscovery : typeof window !== "undefined" && window.location.pathname.includes("creator-discovery");
41474
41494
  const handleOptionClick = (key, e) => {
41475
41495
  e.preventDefault();
41476
41496
  e.stopPropagation();
41477
- console.log("[MCQCard] Option clicked:", key, "Can select:", isLatestMessage && !isLoading && !disabled && !isProceeded);
41478
41497
  if (isLatestMessage && !isLoading && !disabled && !isProceeded) {
41479
- console.log("[MCQCard] Setting selected to:", key);
41480
41498
  setSelectedOption(key);
41481
41499
  onSelect?.(key);
41482
41500
  }
@@ -41494,7 +41512,6 @@ var MCQCard = import_react82.default.memo(
41494
41512
  setIsProceeded(true);
41495
41513
  if (sessionId && resolvedQuestion) {
41496
41514
  const questionKey = buildQuestionKey(sessionId, resolvedQuestion);
41497
- console.log("[MCQCard] Persisting:", questionKey, result);
41498
41515
  await persistSelection(sessionId, questionKey, result);
41499
41516
  }
41500
41517
  if (sendMessage) {
@@ -41522,8 +41539,9 @@ A: ${label}`);
41522
41539
  "p-4 rounded-lg border border-gray400 bg-cardSurface w-full",
41523
41540
  className
41524
41541
  ),
41542
+ style: t.root,
41525
41543
  children: [
41526
- /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", children: resolvedQuestion || "Select an option:" }) }),
41544
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", style: t.text, children: resolvedQuestion || "Select an option:" }) }),
41527
41545
  /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "space-y-2.5 mb-4", children: optionsEntries.map(([key, label]) => {
41528
41546
  const isSelected = selectedOption === key;
41529
41547
  const isRecommended = key === recommended;
@@ -41538,6 +41556,7 @@ A: ${label}`);
41538
41556
  !selectedOption && !isOptionsDisabled && "hover:border-gray500",
41539
41557
  (isLoading || isOptionsDisabled) && "opacity-50 cursor-not-allowed"
41540
41558
  ),
41559
+ style: isSelected ? { ...t.surface, ...t.accentBorder } : t.surface,
41541
41560
  children: /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex items-start gap-3", children: [
41542
41561
  /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "mt-0.5 flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
41543
41562
  "div",
@@ -41549,12 +41568,13 @@ A: ${label}`);
41549
41568
  !selectedOption && !isOptionsDisabled && "hover:border-gold"
41550
41569
  )
41551
41570
  ),
41552
- children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "w-2 h-2 rounded-full bg-gold" })
41571
+ style: isSelected ? t.accentBorder : void 0,
41572
+ children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "w-2 h-2 rounded-full bg-gold", style: t.accentBg })
41553
41573
  }
41554
41574
  ) }),
41555
41575
  /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "flex-1 min-w-0", children: [
41556
- isRecommended && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-xs font-semibold text-gold mb-1", children: "Recommended" }),
41557
- /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", children: label })
41576
+ isRecommended && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-xs font-semibold text-gold mb-1", style: t.accent, children: "Recommended" }),
41577
+ /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("p", { className: "text-sm text-cardText", style: t.text, children: label })
41558
41578
  ] })
41559
41579
  ] })
41560
41580
  },
@@ -41571,6 +41591,7 @@ A: ${label}`);
41571
41591
  "disabled:opacity-50 disabled:cursor-not-allowed",
41572
41592
  "bg-cardSurface hover:bg-cardSurface/80 text-gold border-cardBorder"
41573
41593
  ),
41594
+ style: { ...t.surface, ...t.accent },
41574
41595
  children: isLoading ? "Sending..." : "Continue"
41575
41596
  }
41576
41597
  ) })