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.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,64 +38994,13 @@ var PresentationJobCard = ({
39034
38994
  }
39035
38995
  };
39036
38996
  if (status === "pending" || status === "running") {
39037
- const stageMessage = getStageMessage(progress);
39038
- return /* @__PURE__ */ jsx147("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxs108("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", children: [
39039
- /* @__PURE__ */ jsx147("div", { className: "h-1 bg-zinc-800", children: /* @__PURE__ */ jsx147(
39040
- "div",
39041
- {
39042
- className: "h-full bg-gradient-to-r from-indigo-500 via-violet-500 to-purple-500 transition-all duration-500 ease-out",
39043
- style: { width: `${progress}%` }
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__ */ jsx147("div", { className: "rounded-2xl border border-zinc-800/70 bg-zinc-950/80 p-3 sm:p-4 mb-4", children: /* @__PURE__ */ jsxs108("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: [
39055
- /* @__PURE__ */ jsx147("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))]" }),
39056
- /* @__PURE__ */ jsx147("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" }),
39057
- /* @__PURE__ */ jsx147("div", { className: "absolute right-0 top-0 h-full w-[36%] bg-zinc-950/95" }),
39058
- /* @__PURE__ */ jsx147("div", { className: "absolute left-[6%] top-[10%] h-24 w-24 rounded-full bg-white/8 blur-2xl" }),
39059
- /* @__PURE__ */ jsx147("div", { className: "absolute right-[7%] bottom-[10%] h-28 w-28 rounded-full bg-white/6 blur-2xl" }),
39060
- /* @__PURE__ */ jsx147("div", { className: "absolute left-[5%] top-[14%] h-5 w-32 rounded-full bg-white/10 animate-pulse" }),
39061
- /* @__PURE__ */ jsx147("div", { className: "absolute left-[5%] top-[33%] h-4 w-[42%] rounded-full bg-white/12 animate-pulse", style: { animationDelay: "120ms" } }),
39062
- /* @__PURE__ */ jsx147("div", { className: "absolute left-[5%] top-[40%] h-4 w-[35%] rounded-full bg-white/12 animate-pulse", style: { animationDelay: "220ms" } }),
39063
- /* @__PURE__ */ jsx147("div", { className: "absolute left-[5%] bottom-[24%] h-5 w-[18%] rounded-full bg-white/12 animate-pulse", style: { animationDelay: "320ms" } }),
39064
- /* @__PURE__ */ jsx147("div", { className: "absolute right-[6%] top-[14%] h-3 w-28 rounded-full bg-amber-300/70 animate-pulse", style: { animationDelay: "150ms" } }),
39065
- /* @__PURE__ */ jsx147("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" } }),
39066
- /* @__PURE__ */ jsx147("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" } }),
39067
- /* @__PURE__ */ jsx147("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" } }),
39068
- /* @__PURE__ */ jsxs108("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: [
39069
- /* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2", children: [
39070
- /* @__PURE__ */ jsx147("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__ */ jsx147(ChevronLeft2, {}) }),
39071
- /* @__PURE__ */ jsx147("span", { className: "text-sm text-zinc-300 font-medium tabular-nums", children: "1 / 1" }),
39072
- /* @__PURE__ */ jsx147("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__ */ jsx147(ChevronRight2, {}) })
39073
- ] }),
39074
- /* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2 text-xs text-zinc-400", children: [
39075
- /* @__PURE__ */ jsx147("span", { className: "inline-flex h-2 w-2 rounded-full bg-indigo-400 animate-pulse" }),
39076
- "Building preview"
39077
- ] })
39078
- ] }),
39079
- /* @__PURE__ */ jsx147("div", { className: "absolute inset-0 -translate-x-full animate-[shimmer_2s_infinite] bg-gradient-to-r from-transparent via-white/8 to-transparent" })
39080
- ] }) }),
39081
- /* @__PURE__ */ jsxs108("div", { className: "flex items-center justify-between pt-4 border-t border-zinc-800/60", children: [
39082
- /* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2.5", children: [
39083
- /* @__PURE__ */ jsxs108("span", { className: "relative flex h-2 w-2", children: [
39084
- /* @__PURE__ */ jsx147("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-indigo-500 opacity-75" }),
39085
- /* @__PURE__ */ jsx147("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-indigo-500" })
39086
- ] }),
39087
- /* @__PURE__ */ jsx147("span", { className: "text-xs text-indigo-400/80 font-medium", children: stageMessage })
39088
- ] }),
39089
- /* @__PURE__ */ jsxs108("span", { className: "text-xs text-zinc-500 tabular-nums font-medium", children: [
39090
- progress,
39091
- "%"
39092
- ] })
39093
- ] })
39094
- ] })
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" })
39095
39004
  ] }) });
39096
39005
  }
39097
39006
  if (status === "failed") {