pxengine 0.1.79 → 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 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15 -88
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -38676,6 +38676,14 @@ var ShareIcon = () => /* @__PURE__ */ jsxs108("svg", { width: "14", height: "14"
|
|
|
38676
38676
|
] });
|
|
38677
38677
|
var CheckIcon = () => /* @__PURE__ */ jsx147("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx147("polyline", { points: "20 6 9 17 4 12" }) });
|
|
38678
38678
|
var FORMATS = [
|
|
38679
|
+
{
|
|
38680
|
+
key: "pptx_url",
|
|
38681
|
+
label: "PowerPoint",
|
|
38682
|
+
ext: ".pptx",
|
|
38683
|
+
emoji: "\u{1F4CA}",
|
|
38684
|
+
desc: "Editable slides \u2014 open in PowerPoint, Keynote, or Google Slides",
|
|
38685
|
+
accent: { text: "text-orange-400", bg: "bg-orange-500/10 border-orange-500/20" }
|
|
38686
|
+
},
|
|
38679
38687
|
{
|
|
38680
38688
|
key: "pdf_url",
|
|
38681
38689
|
label: "PDF",
|
|
@@ -38844,23 +38852,6 @@ var FullscreenModal = ({ url, title, slideCount, onClose }) => {
|
|
|
38844
38852
|
) })
|
|
38845
38853
|
] });
|
|
38846
38854
|
};
|
|
38847
|
-
var PROCESSING_STAGES = [
|
|
38848
|
-
{ minProgress: 0, message: "Initializing..." },
|
|
38849
|
-
{ minProgress: 12, message: "Analyzing request..." },
|
|
38850
|
-
{ minProgress: 25, message: "Generating content..." },
|
|
38851
|
-
{ minProgress: 45, message: "Building slides..." },
|
|
38852
|
-
{ minProgress: 65, message: "Applying design..." },
|
|
38853
|
-
{ minProgress: 80, message: "Rendering outputs..." },
|
|
38854
|
-
{ minProgress: 92, message: "Finalizing..." }
|
|
38855
|
-
];
|
|
38856
|
-
function getStageMessage(progress) {
|
|
38857
|
-
for (let i = PROCESSING_STAGES.length - 1; i >= 0; i--) {
|
|
38858
|
-
if (progress >= PROCESSING_STAGES[i].minProgress) {
|
|
38859
|
-
return PROCESSING_STAGES[i].message;
|
|
38860
|
-
}
|
|
38861
|
-
}
|
|
38862
|
-
return PROCESSING_STAGES[0].message;
|
|
38863
|
-
}
|
|
38864
38855
|
var PresentationJobCard = ({
|
|
38865
38856
|
job_id: _job_id,
|
|
38866
38857
|
title: initialTitle,
|
|
@@ -38887,40 +38878,9 @@ var PresentationJobCard = ({
|
|
|
38887
38878
|
const [previewScale, setPreviewScale] = useState10(1);
|
|
38888
38879
|
const [iframeReady, setIframeReady] = useState10(false);
|
|
38889
38880
|
const [pendingSlide, setPendingSlide] = useState10(null);
|
|
38890
|
-
const [progress, setProgress] = useState10(0);
|
|
38891
|
-
const startTimeRef = useRef5(Date.now());
|
|
38892
38881
|
const intervalRef = useRef5(null);
|
|
38893
|
-
const progressIntervalRef = useRef5(null);
|
|
38894
38882
|
const previewRef = useRef5(null);
|
|
38895
38883
|
const iframeRef = useRef5(null);
|
|
38896
|
-
useEffect6(() => {
|
|
38897
|
-
const isLoading = status === "pending" || status === "running";
|
|
38898
|
-
if (!isLoading) {
|
|
38899
|
-
if (progressIntervalRef.current) {
|
|
38900
|
-
clearInterval(progressIntervalRef.current);
|
|
38901
|
-
progressIntervalRef.current = null;
|
|
38902
|
-
}
|
|
38903
|
-
if (status === "complete") setProgress(100);
|
|
38904
|
-
return;
|
|
38905
|
-
}
|
|
38906
|
-
startTimeRef.current = Date.now();
|
|
38907
|
-
progressIntervalRef.current = setInterval(() => {
|
|
38908
|
-
const elapsed = (Date.now() - startTimeRef.current) / 1e3;
|
|
38909
|
-
const estimated = Math.min(90, 90 * (1 - Math.exp(-elapsed / 60)));
|
|
38910
|
-
setProgress((prev) => Math.max(prev, Math.round(estimated)));
|
|
38911
|
-
}, 500);
|
|
38912
|
-
return () => {
|
|
38913
|
-
if (progressIntervalRef.current) {
|
|
38914
|
-
clearInterval(progressIntervalRef.current);
|
|
38915
|
-
progressIntervalRef.current = null;
|
|
38916
|
-
}
|
|
38917
|
-
};
|
|
38918
|
-
}, [status]);
|
|
38919
|
-
useEffect6(() => {
|
|
38920
|
-
if (status === "running") {
|
|
38921
|
-
setProgress((prev) => Math.max(prev, 15));
|
|
38922
|
-
}
|
|
38923
|
-
}, [status]);
|
|
38924
38884
|
const updateScale = useCallback4(() => {
|
|
38925
38885
|
if (previewRef.current) setPreviewScale(previewRef.current.offsetWidth / 1280);
|
|
38926
38886
|
}, []);
|
|
@@ -39034,46 +38994,13 @@ var PresentationJobCard = ({
|
|
|
39034
38994
|
}
|
|
39035
38995
|
};
|
|
39036
38996
|
if (status === "pending" || status === "running") {
|
|
39037
|
-
|
|
39038
|
-
|
|
39039
|
-
|
|
39040
|
-
"div",
|
|
39041
|
-
{
|
|
39042
|
-
|
|
39043
|
-
|
|
39044
|
-
}
|
|
39045
|
-
) }),
|
|
39046
|
-
/* @__PURE__ */ jsxs108("div", { className: "p-5", children: [
|
|
39047
|
-
/* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-3 mb-5", children: [
|
|
39048
|
-
/* @__PURE__ */ jsx147("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__ */ jsx147(SlidesIcon, {}) }),
|
|
39049
|
-
/* @__PURE__ */ jsxs108("div", { className: "flex-1 min-w-0", children: [
|
|
39050
|
-
/* @__PURE__ */ jsx147("p", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", children: title || "Generating presentation..." }),
|
|
39051
|
-
/* @__PURE__ */ jsx147("p", { className: "text-xs text-zinc-500 mt-0.5", children: "Creating slides..." })
|
|
39052
|
-
] })
|
|
39053
|
-
] }),
|
|
39054
|
-
/* @__PURE__ */ jsxs108("div", { className: "relative overflow-hidden rounded-xl bg-zinc-900 border border-zinc-800/70 aspect-[16/9]", children: [
|
|
39055
|
-
/* @__PURE__ */ jsx147("div", { className: "absolute inset-0 bg-[radial-gradient(circle_at_14%_16%,rgba(99,102,241,0.12),transparent_30%),radial-gradient(circle_at_86%_84%,rgba(168,85,247,0.10),transparent_28%),linear-gradient(135deg,rgba(30,32,48,0.98),rgba(18,18,24,0.99))]" }),
|
|
39056
|
-
/* @__PURE__ */ jsxs108("div", { className: "absolute inset-0 p-6 flex flex-col justify-center", children: [
|
|
39057
|
-
/* @__PURE__ */ jsx147("div", { className: "h-4 w-48 rounded-full bg-white/10 animate-pulse mb-4" }),
|
|
39058
|
-
/* @__PURE__ */ jsx147("div", { className: "h-3 w-72 rounded-full bg-white/8 animate-pulse mb-3", style: { animationDelay: "100ms" } }),
|
|
39059
|
-
/* @__PURE__ */ jsx147("div", { className: "h-3 w-56 rounded-full bg-white/8 animate-pulse", style: { animationDelay: "200ms" } })
|
|
39060
|
-
] }),
|
|
39061
|
-
/* @__PURE__ */ jsx147("div", { className: "absolute inset-0 -translate-x-full animate-[shimmer_2s_infinite] bg-gradient-to-r from-transparent via-white/6 to-transparent" })
|
|
39062
|
-
] }),
|
|
39063
|
-
/* @__PURE__ */ jsxs108("div", { className: "flex items-center justify-between pt-4 border-t border-zinc-800/60", children: [
|
|
39064
|
-
/* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2.5", children: [
|
|
39065
|
-
/* @__PURE__ */ jsxs108("span", { className: "relative flex h-2 w-2", children: [
|
|
39066
|
-
/* @__PURE__ */ jsx147("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-indigo-500 opacity-75" }),
|
|
39067
|
-
/* @__PURE__ */ jsx147("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-indigo-500" })
|
|
39068
|
-
] }),
|
|
39069
|
-
/* @__PURE__ */ jsx147("span", { className: "text-xs text-indigo-400/80 font-medium", children: stageMessage })
|
|
39070
|
-
] }),
|
|
39071
|
-
/* @__PURE__ */ jsxs108("span", { className: "text-xs text-zinc-500 tabular-nums font-medium", children: [
|
|
39072
|
-
progress,
|
|
39073
|
-
"%"
|
|
39074
|
-
] })
|
|
39075
|
-
] })
|
|
39076
|
-
] })
|
|
38997
|
+
return /* @__PURE__ */ jsx147("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxs108("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: [
|
|
38998
|
+
/* @__PURE__ */ jsxs108("div", { className: "absolute inset-0 p-[8%] flex flex-col justify-center", children: [
|
|
38999
|
+
/* @__PURE__ */ jsx147("div", { className: "h-[18px] w-[42%] rounded bg-zinc-300 dark:bg-zinc-700 animate-pulse mb-3" }),
|
|
39000
|
+
/* @__PURE__ */ jsx147("div", { className: "h-[11px] w-[65%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse mb-2", style: { animationDelay: "120ms" } }),
|
|
39001
|
+
/* @__PURE__ */ jsx147("div", { className: "h-[11px] w-[52%] rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse", style: { animationDelay: "240ms" } })
|
|
39002
|
+
] }),
|
|
39003
|
+
/* @__PURE__ */ jsx147("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" })
|
|
39077
39004
|
] }) });
|
|
39078
39005
|
}
|
|
39079
39006
|
if (status === "failed") {
|