pxengine 0.1.78 → 0.1.80
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 +15 -106
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15 -106
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -38999,6 +38999,14 @@ var ShareIcon = () => /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("svg", { w
|
|
|
38999
38999
|
] });
|
|
39000
39000
|
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("polyline", { points: "20 6 9 17 4 12" }) });
|
|
39001
39001
|
var FORMATS = [
|
|
39002
|
+
{
|
|
39003
|
+
key: "pptx_url",
|
|
39004
|
+
label: "PowerPoint",
|
|
39005
|
+
ext: ".pptx",
|
|
39006
|
+
emoji: "\u{1F4CA}",
|
|
39007
|
+
desc: "Editable slides \u2014 open in PowerPoint, Keynote, or Google Slides",
|
|
39008
|
+
accent: { text: "text-orange-400", bg: "bg-orange-500/10 border-orange-500/20" }
|
|
39009
|
+
},
|
|
39002
39010
|
{
|
|
39003
39011
|
key: "pdf_url",
|
|
39004
39012
|
label: "PDF",
|
|
@@ -39167,23 +39175,6 @@ var FullscreenModal = ({ url, title, slideCount, onClose }) => {
|
|
|
39167
39175
|
) })
|
|
39168
39176
|
] });
|
|
39169
39177
|
};
|
|
39170
|
-
var PROCESSING_STAGES = [
|
|
39171
|
-
{ minProgress: 0, message: "Initializing..." },
|
|
39172
|
-
{ minProgress: 12, message: "Analyzing request..." },
|
|
39173
|
-
{ minProgress: 25, message: "Generating content..." },
|
|
39174
|
-
{ minProgress: 45, message: "Building slides..." },
|
|
39175
|
-
{ minProgress: 65, message: "Applying design..." },
|
|
39176
|
-
{ minProgress: 80, message: "Rendering outputs..." },
|
|
39177
|
-
{ minProgress: 92, message: "Finalizing..." }
|
|
39178
|
-
];
|
|
39179
|
-
function getStageMessage(progress) {
|
|
39180
|
-
for (let i = PROCESSING_STAGES.length - 1; i >= 0; i--) {
|
|
39181
|
-
if (progress >= PROCESSING_STAGES[i].minProgress) {
|
|
39182
|
-
return PROCESSING_STAGES[i].message;
|
|
39183
|
-
}
|
|
39184
|
-
}
|
|
39185
|
-
return PROCESSING_STAGES[0].message;
|
|
39186
|
-
}
|
|
39187
39178
|
var PresentationJobCard = ({
|
|
39188
39179
|
job_id: _job_id,
|
|
39189
39180
|
title: initialTitle,
|
|
@@ -39210,40 +39201,9 @@ var PresentationJobCard = ({
|
|
|
39210
39201
|
const [previewScale, setPreviewScale] = (0, import_react75.useState)(1);
|
|
39211
39202
|
const [iframeReady, setIframeReady] = (0, import_react75.useState)(false);
|
|
39212
39203
|
const [pendingSlide, setPendingSlide] = (0, import_react75.useState)(null);
|
|
39213
|
-
const [progress, setProgress] = (0, import_react75.useState)(0);
|
|
39214
|
-
const startTimeRef = (0, import_react75.useRef)(Date.now());
|
|
39215
39204
|
const intervalRef = (0, import_react75.useRef)(null);
|
|
39216
|
-
const progressIntervalRef = (0, import_react75.useRef)(null);
|
|
39217
39205
|
const previewRef = (0, import_react75.useRef)(null);
|
|
39218
39206
|
const iframeRef = (0, import_react75.useRef)(null);
|
|
39219
|
-
(0, import_react75.useEffect)(() => {
|
|
39220
|
-
const isLoading = status === "pending" || status === "running";
|
|
39221
|
-
if (!isLoading) {
|
|
39222
|
-
if (progressIntervalRef.current) {
|
|
39223
|
-
clearInterval(progressIntervalRef.current);
|
|
39224
|
-
progressIntervalRef.current = null;
|
|
39225
|
-
}
|
|
39226
|
-
if (status === "complete") setProgress(100);
|
|
39227
|
-
return;
|
|
39228
|
-
}
|
|
39229
|
-
startTimeRef.current = Date.now();
|
|
39230
|
-
progressIntervalRef.current = setInterval(() => {
|
|
39231
|
-
const elapsed = (Date.now() - startTimeRef.current) / 1e3;
|
|
39232
|
-
const estimated = Math.min(90, 90 * (1 - Math.exp(-elapsed / 60)));
|
|
39233
|
-
setProgress((prev) => Math.max(prev, Math.round(estimated)));
|
|
39234
|
-
}, 500);
|
|
39235
|
-
return () => {
|
|
39236
|
-
if (progressIntervalRef.current) {
|
|
39237
|
-
clearInterval(progressIntervalRef.current);
|
|
39238
|
-
progressIntervalRef.current = null;
|
|
39239
|
-
}
|
|
39240
|
-
};
|
|
39241
|
-
}, [status]);
|
|
39242
|
-
(0, import_react75.useEffect)(() => {
|
|
39243
|
-
if (status === "running") {
|
|
39244
|
-
setProgress((prev) => Math.max(prev, 15));
|
|
39245
|
-
}
|
|
39246
|
-
}, [status]);
|
|
39247
39207
|
const updateScale = (0, import_react75.useCallback)(() => {
|
|
39248
39208
|
if (previewRef.current) setPreviewScale(previewRef.current.offsetWidth / 1280);
|
|
39249
39209
|
}, []);
|
|
@@ -39357,64 +39317,13 @@ var PresentationJobCard = ({
|
|
|
39357
39317
|
}
|
|
39358
39318
|
};
|
|
39359
39319
|
if (status === "pending" || status === "running") {
|
|
39360
|
-
|
|
39361
|
-
|
|
39362
|
-
|
|
39363
|
-
"div",
|
|
39364
|
-
{
|
|
39365
|
-
|
|
39366
|
-
|
|
39367
|
-
}
|
|
39368
|
-
) }),
|
|
39369
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "p-5", children: [
|
|
39370
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-3 mb-5", children: [
|
|
39371
|
-
/* @__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)(SlidesIcon, {}) }),
|
|
39372
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
39373
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", children: title || "Generating presentation..." }),
|
|
39374
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-xs text-zinc-500 mt-0.5", children: "Creating slides..." })
|
|
39375
|
-
] })
|
|
39376
|
-
] }),
|
|
39377
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "rounded-2xl border border-zinc-800/70 bg-zinc-950/80 p-3 sm:p-4 mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "relative overflow-hidden rounded-xl bg-zinc-900 shadow-[0_0_0_1px_rgba(255,255,255,0.02)] aspect-[16/9] min-h-[320px] sm:min-h-[420px] lg:min-h-[500px]", children: [
|
|
39378
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute inset-0 bg-[radial-gradient(circle_at_14%_16%,rgba(99,102,241,0.18),transparent_30%),radial-gradient(circle_at_86%_84%,rgba(168,85,247,0.16),transparent_28%),linear-gradient(135deg,rgba(50,54,86,0.96),rgba(18,18,30,0.98))]" }),
|
|
39379
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute left-0 top-0 h-full w-[64%] bg-gradient-to-br from-indigo-500/90 via-violet-600/85 to-purple-700/90" }),
|
|
39380
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute right-0 top-0 h-full w-[36%] bg-zinc-950/95" }),
|
|
39381
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute left-[6%] top-[10%] h-24 w-24 rounded-full bg-white/8 blur-2xl" }),
|
|
39382
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute right-[7%] bottom-[10%] h-28 w-28 rounded-full bg-white/6 blur-2xl" }),
|
|
39383
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute left-[5%] top-[14%] h-5 w-32 rounded-full bg-white/10 animate-pulse" }),
|
|
39384
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute left-[5%] top-[33%] h-4 w-[42%] rounded-full bg-white/12 animate-pulse", style: { animationDelay: "120ms" } }),
|
|
39385
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute left-[5%] top-[40%] h-4 w-[35%] rounded-full bg-white/12 animate-pulse", style: { animationDelay: "220ms" } }),
|
|
39386
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute left-[5%] bottom-[24%] h-5 w-[18%] rounded-full bg-white/12 animate-pulse", style: { animationDelay: "320ms" } }),
|
|
39387
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute right-[6%] top-[14%] h-3 w-28 rounded-full bg-amber-300/70 animate-pulse", style: { animationDelay: "150ms" } }),
|
|
39388
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute right-[6%] top-[28%] h-[84px] w-[72%] rounded-xl border border-amber-300/15 bg-white/5 animate-pulse", style: { animationDelay: "220ms" } }),
|
|
39389
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute right-[6%] top-[50%] h-[84px] w-[72%] rounded-xl border border-violet-300/15 bg-white/5 animate-pulse", style: { animationDelay: "320ms" } }),
|
|
39390
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute right-[6%] top-[72%] h-[84px] w-[72%] rounded-xl border border-purple-300/15 bg-white/5 animate-pulse", style: { animationDelay: "420ms" } }),
|
|
39391
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "absolute inset-x-0 bottom-0 flex items-center justify-between px-4 py-3 bg-gradient-to-t from-black/30 to-transparent", children: [
|
|
39392
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
39393
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "h-8 w-8 rounded-full border border-zinc-600 bg-zinc-800/70 flex items-center justify-center text-zinc-400", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(ChevronLeft2, {}) }),
|
|
39394
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "text-sm text-zinc-300 font-medium tabular-nums", children: "1 / 1" }),
|
|
39395
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "h-8 w-8 rounded-full border border-zinc-700 bg-zinc-800/50 flex items-center justify-center text-zinc-500 opacity-70", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(ChevronRight2, {}) })
|
|
39396
|
-
] }),
|
|
39397
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-2 text-xs text-zinc-400", children: [
|
|
39398
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400 animate-pulse" }),
|
|
39399
|
-
"Building preview"
|
|
39400
|
-
] })
|
|
39401
|
-
] }),
|
|
39402
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute inset-0 -translate-x-full animate-[shimmer_2s_infinite] bg-gradient-to-r from-transparent via-white/8 to-transparent" })
|
|
39403
|
-
] }) }),
|
|
39404
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center justify-between pt-4 border-t border-zinc-800/60", children: [
|
|
39405
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
39406
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("span", { className: "relative flex h-2 w-2", children: [
|
|
39407
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-indigo-500 opacity-75" }),
|
|
39408
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-indigo-500" })
|
|
39409
|
-
] }),
|
|
39410
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "text-xs text-indigo-400/80 font-medium", children: stageMessage })
|
|
39411
|
-
] }),
|
|
39412
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("span", { className: "text-xs text-zinc-500 tabular-nums font-medium", children: [
|
|
39413
|
-
progress,
|
|
39414
|
-
"%"
|
|
39415
|
-
] })
|
|
39416
|
-
] })
|
|
39417
|
-
] })
|
|
39320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: cn("w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "relative overflow-hidden rounded-xl border border-zinc-200/70 dark:border-zinc-800/70 bg-zinc-100 dark:bg-zinc-900 aspect-[16/9]", children: [
|
|
39321
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "absolute inset-0 p-[8%] flex flex-col justify-center", children: [
|
|
39322
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-[18px] w-[42%] rounded bg-zinc-300 dark:bg-zinc-700 animate-pulse mb-3" }),
|
|
39323
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-[11px] w-[65%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse mb-2", style: { animationDelay: "120ms" } }),
|
|
39324
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-[11px] w-[52%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse", style: { animationDelay: "240ms" } })
|
|
39325
|
+
] }),
|
|
39326
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "absolute inset-0 -translate-x-full animate-[shimmer_2s_ease-in-out_infinite] bg-gradient-to-r from-transparent via-white/10 to-transparent" })
|
|
39418
39327
|
] }) });
|
|
39419
39328
|
}
|
|
39420
39329
|
if (status === "failed") {
|