pxengine 0.1.91 → 0.1.93
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 +44 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +44 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -34679,11 +34679,12 @@ ActionButton.displayName = "ActionButton";
|
|
|
34679
34679
|
// src/molecules/generic/FormCard/FormCard.tsx
|
|
34680
34680
|
var import_react57 = __toESM(require("react"), 1);
|
|
34681
34681
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
34682
|
+
var humanizeKey = (key) => key.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()).trim();
|
|
34682
34683
|
var FormCard = import_react57.default.memo(
|
|
34683
34684
|
({
|
|
34684
34685
|
title,
|
|
34685
|
-
fields,
|
|
34686
|
-
data,
|
|
34686
|
+
fields = [],
|
|
34687
|
+
data = {},
|
|
34687
34688
|
editingFields: externalEditingFields,
|
|
34688
34689
|
changedFields = {},
|
|
34689
34690
|
savingFields = {},
|
|
@@ -34720,6 +34721,9 @@ var FormCard = import_react57.default.memo(
|
|
|
34720
34721
|
const activeEditingFields = isExternallyControlled ? externalEditingFields || {} : internalEditingFields;
|
|
34721
34722
|
const resolvedSavingFields = Object.keys(savingFields).length > 0 ? savingFields : internalSavingFields;
|
|
34722
34723
|
const activeData = internalData;
|
|
34724
|
+
const effectiveFields = Array.isArray(fields) && fields.length > 0 ? fields : Object.keys(activeData || {}).filter(
|
|
34725
|
+
(k) => !k.startsWith("_") && activeData[k] != null && typeof activeData[k] !== "function"
|
|
34726
|
+
).map((key) => ({ key, label: humanizeKey(key) }));
|
|
34723
34727
|
const handleFieldEdit = (key) => {
|
|
34724
34728
|
if (externalOnFieldEdit) {
|
|
34725
34729
|
externalOnFieldEdit(key);
|
|
@@ -34770,7 +34774,7 @@ var FormCard = import_react57.default.memo(
|
|
|
34770
34774
|
const text = [
|
|
34771
34775
|
title,
|
|
34772
34776
|
"",
|
|
34773
|
-
...
|
|
34777
|
+
...effectiveFields.map((field) => {
|
|
34774
34778
|
const value = activeData[field.key];
|
|
34775
34779
|
return `${field.label}: ${flattenValue(value)}`;
|
|
34776
34780
|
})
|
|
@@ -34817,7 +34821,7 @@ var FormCard = import_react57.default.memo(
|
|
|
34817
34821
|
}
|
|
34818
34822
|
}
|
|
34819
34823
|
),
|
|
34820
|
-
|
|
34824
|
+
effectiveFields.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
34821
34825
|
EditableField,
|
|
34822
34826
|
{
|
|
34823
34827
|
label: field.label,
|
|
@@ -34836,7 +34840,7 @@ var FormCard = import_react57.default.memo(
|
|
|
34836
34840
|
renderEdit: field.renderEdit,
|
|
34837
34841
|
showIndex: showTimeline,
|
|
34838
34842
|
index,
|
|
34839
|
-
totalFields:
|
|
34843
|
+
totalFields: effectiveFields.length
|
|
34840
34844
|
},
|
|
34841
34845
|
field.key
|
|
34842
34846
|
))
|
|
@@ -39252,9 +39256,12 @@ var PresentationJobCard = ({
|
|
|
39252
39256
|
authToken,
|
|
39253
39257
|
shareUrl,
|
|
39254
39258
|
className,
|
|
39259
|
+
theme,
|
|
39255
39260
|
onComplete,
|
|
39256
39261
|
onFailed
|
|
39257
39262
|
}) => {
|
|
39263
|
+
const t = th(theme);
|
|
39264
|
+
const accentGradient = theme?.gradient;
|
|
39258
39265
|
const [status, setStatus] = (0, import_react76.useState)(initialStatus);
|
|
39259
39266
|
const [title, setTitle] = (0, import_react76.useState)(initialTitle);
|
|
39260
39267
|
const [slideCount, setSlideCount] = (0, import_react76.useState)(initialSlideCount ?? 0);
|
|
@@ -39418,22 +39425,30 @@ var PresentationJobCard = ({
|
|
|
39418
39425
|
}
|
|
39419
39426
|
};
|
|
39420
39427
|
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: [
|
|
39428
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", style: t.root, children: [
|
|
39422
39429
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39423
39430
|
"div",
|
|
39424
39431
|
{
|
|
39425
39432
|
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
39433
|
style: {
|
|
39427
39434
|
backgroundSize: "200% 100%",
|
|
39428
|
-
animation: "gradient-shift 2s ease-in-out infinite"
|
|
39435
|
+
animation: "gradient-shift 2s ease-in-out infinite",
|
|
39436
|
+
...accentGradient ? { backgroundImage: accentGradient } : {}
|
|
39429
39437
|
}
|
|
39430
39438
|
}
|
|
39431
39439
|
),
|
|
39432
39440
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "p-5", children: [
|
|
39433
39441
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
39434
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39442
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39443
|
+
"div",
|
|
39444
|
+
{
|
|
39445
|
+
className: "w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center flex-shrink-0",
|
|
39446
|
+
style: { ...t.accentSubtle(0.1), ...t.accentBorder },
|
|
39447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "text-lg", children: getPhaseIcon() })
|
|
39448
|
+
}
|
|
39449
|
+
),
|
|
39435
39450
|
/* @__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" }),
|
|
39451
|
+
/* @__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
39452
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("p", { className: "text-xs text-zinc-500 mt-0.5", children: [
|
|
39438
39453
|
slidesTotal > 0 ? `${slidesTotal} slides` : "Presentation",
|
|
39439
39454
|
" \xB7 In progress"
|
|
@@ -39446,7 +39461,10 @@ var PresentationJobCard = ({
|
|
|
39446
39461
|
"div",
|
|
39447
39462
|
{
|
|
39448
39463
|
className: "h-full bg-gradient-to-r from-indigo-500 to-purple-500 rounded-full transition-all duration-500 ease-out",
|
|
39449
|
-
style: {
|
|
39464
|
+
style: {
|
|
39465
|
+
width: `${Math.max(pct, 2)}%`,
|
|
39466
|
+
...accentGradient ? { backgroundImage: accentGradient } : t.accentBg
|
|
39467
|
+
}
|
|
39450
39468
|
}
|
|
39451
39469
|
) }),
|
|
39452
39470
|
/* @__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 +39473,7 @@ var PresentationJobCard = ({
|
|
|
39455
39473
|
] })
|
|
39456
39474
|
] }),
|
|
39457
39475
|
/* @__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" }),
|
|
39476
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "w-2 h-2 rounded-full bg-indigo-500 animate-pulse", style: t.accentBg }),
|
|
39459
39477
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "text-xs text-zinc-400", children: step })
|
|
39460
39478
|
] }),
|
|
39461
39479
|
phase === "ai_generation" && slidesTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-2 pt-1", children: [
|
|
@@ -39499,14 +39517,21 @@ var PresentationJobCard = ({
|
|
|
39499
39517
|
const total = slideCount || 1;
|
|
39500
39518
|
const hasHtml = Boolean(formats.html_url);
|
|
39501
39519
|
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)" } }),
|
|
39520
|
+
/* @__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: [
|
|
39521
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-[3px]", style: { background: accentGradient || "linear-gradient(90deg, #8B7D5E, #C0AE82, #DCC99B)" } }),
|
|
39504
39522
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "p-5", children: [
|
|
39505
39523
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
39506
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39524
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39525
|
+
"div",
|
|
39526
|
+
{
|
|
39527
|
+
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",
|
|
39528
|
+
style: { ...t.accentSubtle(0.1), ...t.accentBorder, ...t.accent },
|
|
39529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(SlidesIcon, {})
|
|
39530
|
+
}
|
|
39531
|
+
),
|
|
39507
39532
|
/* @__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: [
|
|
39533
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", style: t.text, children: title }),
|
|
39534
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("p", { className: "text-xs text-zinc-500 mt-0.5", style: t.muted, children: [
|
|
39510
39535
|
slideCount ? `${slideCount} slides` : "Presentation",
|
|
39511
39536
|
" \xB7 Ready to export"
|
|
39512
39537
|
] })
|
|
@@ -39544,6 +39569,7 @@ var PresentationJobCard = ({
|
|
|
39544
39569
|
{
|
|
39545
39570
|
onClick: () => setShowExport(true),
|
|
39546
39571
|
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",
|
|
39572
|
+
style: { ...t.accentBg, ...t.accentText },
|
|
39547
39573
|
children: [
|
|
39548
39574
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(DownloadIcon, {}),
|
|
39549
39575
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { children: "Export" })
|
|
@@ -40310,7 +40336,7 @@ var WebSearchJobCard = ({
|
|
|
40310
40336
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "w-2 h-2 rounded-full bg-amber-500 animate-pulse flex-shrink-0" }),
|
|
40311
40337
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "text-xs text-zinc-400", children: step })
|
|
40312
40338
|
] }),
|
|
40313
|
-
|
|
40339
|
+
searchesTotal > 0 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "pt-1", children: [
|
|
40314
40340
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("div", { className: "flex items-center justify-between mb-1.5", children: [
|
|
40315
40341
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsx)("span", { className: "text-xs text-zinc-500", children: "Web searches" }),
|
|
40316
40342
|
/* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { className: "text-xs text-zinc-500 tabular-nums", children: [
|
|
@@ -40324,7 +40350,7 @@ var WebSearchJobCard = ({
|
|
|
40324
40350
|
{
|
|
40325
40351
|
className: cn(
|
|
40326
40352
|
"flex-1 h-1 rounded-full transition-all duration-300",
|
|
40327
|
-
i < searchesCompleted ? "bg-amber-500" : i === searchesCompleted ? "bg-amber-500/50 animate-pulse" : "bg-zinc-700"
|
|
40353
|
+
i < searchesCompleted ? "bg-amber-500" : phase === "ai_generation" && i === searchesCompleted ? "bg-amber-500/50 animate-pulse" : "bg-zinc-700"
|
|
40328
40354
|
)
|
|
40329
40355
|
},
|
|
40330
40356
|
i
|