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 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,46 +39317,13 @@ var PresentationJobCard = ({
39357
39317
  }
39358
39318
  };
39359
39319
  if (status === "pending" || status === "running") {
39360
- const stageMessage = getStageMessage(progress);
39361
- return /* @__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: [
39362
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-1 bg-zinc-800", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
39363
- "div",
39364
- {
39365
- className: "h-full bg-gradient-to-r from-indigo-500 via-violet-500 to-purple-500 transition-all duration-500 ease-out",
39366
- style: { width: `${progress}%` }
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.jsxs)("div", { className: "relative overflow-hidden rounded-xl bg-zinc-900 border border-zinc-800/70 aspect-[16/9]", 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.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))]" }),
39379
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "absolute inset-0 p-6 flex flex-col justify-center", children: [
39380
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-4 w-48 rounded-full bg-white/10 animate-pulse mb-4" }),
39381
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-3 w-72 rounded-full bg-white/8 animate-pulse mb-3", style: { animationDelay: "100ms" } }),
39382
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-3 w-56 rounded-full bg-white/8 animate-pulse", style: { animationDelay: "200ms" } })
39383
- ] }),
39384
- /* @__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/6 to-transparent" })
39385
- ] }),
39386
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center justify-between pt-4 border-t border-zinc-800/60", children: [
39387
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-2.5", children: [
39388
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("span", { className: "relative flex h-2 w-2", children: [
39389
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-indigo-500 opacity-75" }),
39390
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-indigo-500" })
39391
- ] }),
39392
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("span", { className: "text-xs text-indigo-400/80 font-medium", children: stageMessage })
39393
- ] }),
39394
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("span", { className: "text-xs text-zinc-500 tabular-nums font-medium", children: [
39395
- progress,
39396
- "%"
39397
- ] })
39398
- ] })
39399
- ] })
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" })
39400
39327
  ] }) });
39401
39328
  }
39402
39329
  if (status === "failed") {