pxengine 0.1.83 → 0.1.85
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 +86 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +86 -19
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +7 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39096,8 +39096,9 @@ var ExportModal = ({ formats, title, onClose }) => {
|
|
|
39096
39096
|
] })
|
|
39097
39097
|
] });
|
|
39098
39098
|
};
|
|
39099
|
-
var FullscreenModal = ({ url, title, slideCount, onClose }) => {
|
|
39100
|
-
const [currentSlide, setCurrentSlide] = (0, import_react75.useState)(
|
|
39099
|
+
var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) => {
|
|
39100
|
+
const [currentSlide, setCurrentSlide] = (0, import_react75.useState)(initialSlide);
|
|
39101
|
+
const [iframeReady, setIframeReady] = (0, import_react75.useState)(false);
|
|
39101
39102
|
const iframeRef = (0, import_react75.useRef)(null);
|
|
39102
39103
|
(0, import_react75.useEffect)(() => {
|
|
39103
39104
|
const onKey = (e) => {
|
|
@@ -39105,7 +39106,10 @@ var FullscreenModal = ({ url, title, slideCount, onClose }) => {
|
|
|
39105
39106
|
};
|
|
39106
39107
|
const onMsg = (e) => {
|
|
39107
39108
|
if (e.data?.type === "presentationExit") onClose();
|
|
39108
|
-
if (e.data?.type === "slideChanged")
|
|
39109
|
+
if (e.data?.type === "slideChanged") {
|
|
39110
|
+
setCurrentSlide(e.data.slide);
|
|
39111
|
+
if (!iframeReady) setIframeReady(true);
|
|
39112
|
+
}
|
|
39109
39113
|
};
|
|
39110
39114
|
document.addEventListener("keydown", onKey);
|
|
39111
39115
|
window.addEventListener("message", onMsg);
|
|
@@ -39113,14 +39117,26 @@ var FullscreenModal = ({ url, title, slideCount, onClose }) => {
|
|
|
39113
39117
|
document.removeEventListener("keydown", onKey);
|
|
39114
39118
|
window.removeEventListener("message", onMsg);
|
|
39115
39119
|
};
|
|
39116
|
-
}, [onClose]);
|
|
39120
|
+
}, [onClose, iframeReady]);
|
|
39117
39121
|
(0, import_react75.useEffect)(() => {
|
|
39118
39122
|
document.body.style.overflow = "hidden";
|
|
39119
39123
|
return () => {
|
|
39120
39124
|
document.body.style.overflow = "";
|
|
39121
39125
|
};
|
|
39122
39126
|
}, []);
|
|
39123
|
-
const
|
|
39127
|
+
const sendSlideCommand = (command) => {
|
|
39128
|
+
const iframe = iframeRef.current;
|
|
39129
|
+
if (!iframe?.contentWindow) return;
|
|
39130
|
+
const totalSlides = slideCount || 1;
|
|
39131
|
+
let newSlide = currentSlide;
|
|
39132
|
+
if (command === "nextSlide") {
|
|
39133
|
+
newSlide = currentSlide >= totalSlides ? 1 : currentSlide + 1;
|
|
39134
|
+
} else {
|
|
39135
|
+
newSlide = currentSlide <= 1 ? totalSlides : currentSlide - 1;
|
|
39136
|
+
}
|
|
39137
|
+
setCurrentSlide(newSlide);
|
|
39138
|
+
iframe.contentWindow.postMessage({ type: command }, "*");
|
|
39139
|
+
};
|
|
39124
39140
|
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "fixed inset-0 z-50 bg-black flex flex-col", children: [
|
|
39125
39141
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center justify-between gap-4 px-4 h-11 bg-zinc-950/90 border-b border-zinc-800/60 flex-shrink-0", children: [
|
|
39126
39142
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
@@ -39136,8 +39152,9 @@ var FullscreenModal = ({ url, title, slideCount, onClose }) => {
|
|
|
39136
39152
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39137
39153
|
"button",
|
|
39138
39154
|
{
|
|
39139
|
-
onClick: () =>
|
|
39140
|
-
|
|
39155
|
+
onClick: () => sendSlideCommand("prevSlide"),
|
|
39156
|
+
disabled: !iframeReady,
|
|
39157
|
+
className: "w-7 h-7 rounded-full border border-zinc-700 bg-zinc-800 hover:border-indigo-500 hover:text-indigo-400 text-zinc-400 flex items-center justify-center transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
39141
39158
|
"aria-label": "Previous slide",
|
|
39142
39159
|
children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(ChevronLeft2, {})
|
|
39143
39160
|
}
|
|
@@ -39145,8 +39162,9 @@ var FullscreenModal = ({ url, title, slideCount, onClose }) => {
|
|
|
39145
39162
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
39146
39163
|
"button",
|
|
39147
39164
|
{
|
|
39148
|
-
onClick: () =>
|
|
39149
|
-
|
|
39165
|
+
onClick: () => sendSlideCommand("nextSlide"),
|
|
39166
|
+
disabled: !iframeReady,
|
|
39167
|
+
className: "w-7 h-7 rounded-full border border-zinc-700 bg-zinc-800 hover:border-indigo-500 hover:text-indigo-400 text-zinc-400 flex items-center justify-center transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
39150
39168
|
"aria-label": "Next slide",
|
|
39151
39169
|
children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(ChevronRight2, {})
|
|
39152
39170
|
}
|
|
@@ -39170,7 +39188,10 @@ var FullscreenModal = ({ url, title, slideCount, onClose }) => {
|
|
|
39170
39188
|
ref: iframeRef,
|
|
39171
39189
|
src: url,
|
|
39172
39190
|
title,
|
|
39173
|
-
onLoad: () =>
|
|
39191
|
+
onLoad: () => {
|
|
39192
|
+
setIframeReady(true);
|
|
39193
|
+
iframeRef.current?.contentWindow?.postMessage({ type: "goToSlide", slide: initialSlide }, "*");
|
|
39194
|
+
},
|
|
39174
39195
|
sandbox: "allow-same-origin allow-scripts allow-fullscreen",
|
|
39175
39196
|
className: "absolute inset-0 w-full h-full border-0"
|
|
39176
39197
|
}
|
|
@@ -39201,6 +39222,7 @@ var PresentationJobCard = ({
|
|
|
39201
39222
|
const [copied, setCopied] = (0, import_react75.useState)(false);
|
|
39202
39223
|
const [currentSlide, setCurrentSlide] = (0, import_react75.useState)(1);
|
|
39203
39224
|
const [previewScale, setPreviewScale] = (0, import_react75.useState)(1);
|
|
39225
|
+
const [iframeReady, setIframeReady] = (0, import_react75.useState)(false);
|
|
39204
39226
|
const intervalRef = (0, import_react75.useRef)(null);
|
|
39205
39227
|
const previewRef = (0, import_react75.useRef)(null);
|
|
39206
39228
|
const iframeRef = (0, import_react75.useRef)(null);
|
|
@@ -39209,6 +39231,7 @@ var PresentationJobCard = ({
|
|
|
39209
39231
|
}, []);
|
|
39210
39232
|
(0, import_react75.useEffect)(() => {
|
|
39211
39233
|
updateScale();
|
|
39234
|
+
setIframeReady(false);
|
|
39212
39235
|
if (typeof ResizeObserver === "undefined") return;
|
|
39213
39236
|
const ro = new ResizeObserver(updateScale);
|
|
39214
39237
|
if (previewRef.current) ro.observe(previewRef.current);
|
|
@@ -39219,13 +39242,24 @@ var PresentationJobCard = ({
|
|
|
39219
39242
|
if (e.data?.type === "slideChanged") {
|
|
39220
39243
|
setCurrentSlide(e.data.slide);
|
|
39221
39244
|
if (e.data.total && !slideCount) setSlideCount(e.data.total);
|
|
39245
|
+
if (!iframeReady) setIframeReady(true);
|
|
39222
39246
|
}
|
|
39223
39247
|
};
|
|
39224
39248
|
window.addEventListener("message", handler);
|
|
39225
39249
|
return () => window.removeEventListener("message", handler);
|
|
39226
|
-
}, [slideCount]);
|
|
39250
|
+
}, [slideCount, iframeReady]);
|
|
39227
39251
|
const sendSlideCommand = (command) => {
|
|
39228
|
-
iframeRef.current
|
|
39252
|
+
const iframe = iframeRef.current;
|
|
39253
|
+
if (!iframe?.contentWindow) return;
|
|
39254
|
+
const totalSlides = slideCount || 1;
|
|
39255
|
+
let newSlide = currentSlide;
|
|
39256
|
+
if (command === "nextSlide") {
|
|
39257
|
+
newSlide = currentSlide >= totalSlides ? 1 : currentSlide + 1;
|
|
39258
|
+
} else {
|
|
39259
|
+
newSlide = currentSlide <= 1 ? totalSlides : currentSlide - 1;
|
|
39260
|
+
}
|
|
39261
|
+
setCurrentSlide(newSlide);
|
|
39262
|
+
iframe.contentWindow.postMessage({ type: command }, "*");
|
|
39229
39263
|
};
|
|
39230
39264
|
const isTerminal = status === "complete" || status === "failed";
|
|
39231
39265
|
const onCompleteRef = (0, import_react75.useRef)(onComplete);
|
|
@@ -39319,7 +39353,7 @@ var PresentationJobCard = ({
|
|
|
39319
39353
|
const hasHtml = Boolean(formats.html_url);
|
|
39320
39354
|
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_jsx_runtime147.Fragment, { children: [
|
|
39321
39355
|
/* @__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: [
|
|
39322
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-[3px]
|
|
39356
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "h-[3px]", style: { background: "linear-gradient(90deg, #8B7D5E, #C0AE82, #DCC99B)" } }),
|
|
39323
39357
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "p-5", children: [
|
|
39324
39358
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
39325
39359
|
/* @__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 text-indigo-400", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(SlidesIcon, {}) }),
|
|
@@ -39388,6 +39422,7 @@ var PresentationJobCard = ({
|
|
|
39388
39422
|
src: formats.html_url,
|
|
39389
39423
|
title,
|
|
39390
39424
|
sandbox: "allow-same-origin allow-scripts",
|
|
39425
|
+
onLoad: () => setIframeReady(true),
|
|
39391
39426
|
style: {
|
|
39392
39427
|
width: 1280,
|
|
39393
39428
|
height: 720,
|
|
@@ -39414,7 +39449,7 @@ var PresentationJobCard = ({
|
|
|
39414
39449
|
e.stopPropagation();
|
|
39415
39450
|
sendSlideCommand("prevSlide");
|
|
39416
39451
|
},
|
|
39417
|
-
disabled: !hasHtml,
|
|
39452
|
+
disabled: !hasHtml || !iframeReady,
|
|
39418
39453
|
className: "w-7 h-7 rounded-full border border-zinc-700 bg-zinc-800 hover:border-indigo-500 hover:text-indigo-400 text-zinc-400 flex items-center justify-center transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
39419
39454
|
"aria-label": "Previous slide",
|
|
39420
39455
|
children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(ChevronLeft2, {})
|
|
@@ -39432,7 +39467,7 @@ var PresentationJobCard = ({
|
|
|
39432
39467
|
e.stopPropagation();
|
|
39433
39468
|
sendSlideCommand("nextSlide");
|
|
39434
39469
|
},
|
|
39435
|
-
disabled: !hasHtml,
|
|
39470
|
+
disabled: !hasHtml || !iframeReady,
|
|
39436
39471
|
className: "w-7 h-7 rounded-full border border-zinc-700 bg-zinc-800 hover:border-indigo-500 hover:text-indigo-400 text-zinc-400 flex items-center justify-center transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
39437
39472
|
"aria-label": "Next slide",
|
|
39438
39473
|
children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(ChevronRight2, {})
|
|
@@ -39449,6 +39484,7 @@ var PresentationJobCard = ({
|
|
|
39449
39484
|
url: formats.html_url,
|
|
39450
39485
|
title,
|
|
39451
39486
|
slideCount,
|
|
39487
|
+
initialSlide: currentSlide,
|
|
39452
39488
|
onClose: () => setShowFullscreen(false)
|
|
39453
39489
|
}
|
|
39454
39490
|
)
|
|
@@ -39546,7 +39582,8 @@ var ResearchReportJobCard = ({
|
|
|
39546
39582
|
authToken,
|
|
39547
39583
|
className,
|
|
39548
39584
|
onComplete,
|
|
39549
|
-
onFailed
|
|
39585
|
+
onFailed,
|
|
39586
|
+
compact = false
|
|
39550
39587
|
}) => {
|
|
39551
39588
|
const [status, setStatus] = (0, import_react76.useState)(initialStatus);
|
|
39552
39589
|
const [title, setTitle] = (0, import_react76.useState)(initialTitle);
|
|
@@ -39567,6 +39604,36 @@ var ResearchReportJobCard = ({
|
|
|
39567
39604
|
const hasNotifiedRef = (0, import_react76.useRef)(false);
|
|
39568
39605
|
onCompleteRef.current = onComplete;
|
|
39569
39606
|
onFailedRef.current = onFailed;
|
|
39607
|
+
(0, import_react76.useEffect)(() => {
|
|
39608
|
+
setStatus(initialStatus);
|
|
39609
|
+
}, [initialStatus]);
|
|
39610
|
+
(0, import_react76.useEffect)(() => {
|
|
39611
|
+
if (initialTitle) setTitle(initialTitle);
|
|
39612
|
+
}, [initialTitle]);
|
|
39613
|
+
(0, import_react76.useEffect)(() => {
|
|
39614
|
+
if (initialHtmlUrl) setHtmlUrl(initialHtmlUrl);
|
|
39615
|
+
}, [initialHtmlUrl]);
|
|
39616
|
+
(0, import_react76.useEffect)(() => {
|
|
39617
|
+
if (initialDepth) setDepth(initialDepth);
|
|
39618
|
+
}, [initialDepth]);
|
|
39619
|
+
(0, import_react76.useEffect)(() => {
|
|
39620
|
+
if (initialSectionCount !== void 0) setSectionCount(initialSectionCount);
|
|
39621
|
+
}, [initialSectionCount]);
|
|
39622
|
+
(0, import_react76.useEffect)(() => {
|
|
39623
|
+
if (initialSourceCount !== void 0) setSourceCount(initialSourceCount);
|
|
39624
|
+
}, [initialSourceCount]);
|
|
39625
|
+
(0, import_react76.useEffect)(() => {
|
|
39626
|
+
if (initialWordCount !== void 0) setWordCount(initialWordCount);
|
|
39627
|
+
}, [initialWordCount]);
|
|
39628
|
+
(0, import_react76.useEffect)(() => {
|
|
39629
|
+
if (initialSummary) setSummary(initialSummary);
|
|
39630
|
+
}, [initialSummary]);
|
|
39631
|
+
(0, import_react76.useEffect)(() => {
|
|
39632
|
+
if (initialTheme) setTheme(initialTheme);
|
|
39633
|
+
}, [initialTheme]);
|
|
39634
|
+
(0, import_react76.useEffect)(() => {
|
|
39635
|
+
if (initialError) setError(initialError);
|
|
39636
|
+
}, [initialError]);
|
|
39570
39637
|
const isTerminal = status === "complete" || status === "failed";
|
|
39571
39638
|
const primaryColor = theme?.primary || DEFAULT_THEME.primary;
|
|
39572
39639
|
const hasHTML = Boolean(htmlUrl);
|
|
@@ -39691,7 +39758,7 @@ var ResearchReportJobCard = ({
|
|
|
39691
39758
|
{
|
|
39692
39759
|
className: "h-[3px]",
|
|
39693
39760
|
style: {
|
|
39694
|
-
background:
|
|
39761
|
+
background: "linear-gradient(90deg, #8B7D5E, #C0AE82, #DCC99B)"
|
|
39695
39762
|
}
|
|
39696
39763
|
}
|
|
39697
39764
|
),
|
|
@@ -39751,7 +39818,7 @@ var ResearchReportJobCard = ({
|
|
|
39751
39818
|
)
|
|
39752
39819
|
] })
|
|
39753
39820
|
] }),
|
|
39754
|
-
hasHTML && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(
|
|
39821
|
+
hasHTML && !compact && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(
|
|
39755
39822
|
"div",
|
|
39756
39823
|
{
|
|
39757
39824
|
ref: previewRef,
|
|
@@ -39784,7 +39851,7 @@ var ResearchReportJobCard = ({
|
|
|
39784
39851
|
]
|
|
39785
39852
|
}
|
|
39786
39853
|
) }),
|
|
39787
|
-
!hasHTML && summary && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "mt-4 pt-4 border-t border-zinc-800/60", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "text-sm text-zinc-400 leading-relaxed line-clamp-3", children: summary }) })
|
|
39854
|
+
!hasHTML && !compact && summary && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("div", { className: "mt-4 pt-4 border-t border-zinc-800/60", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)("p", { className: "text-sm text-zinc-400 leading-relaxed line-clamp-3", children: summary }) })
|
|
39788
39855
|
] })
|
|
39789
39856
|
] }) }),
|
|
39790
39857
|
showPreview && hasHTML && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|