pxengine 0.1.132 → 0.1.134
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 +7 -51
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7 -51
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -16515,7 +16515,7 @@ var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) =>
|
|
|
16515
16515
|
newSlide = currentSlide <= 1 ? totalSlides : currentSlide - 1;
|
|
16516
16516
|
}
|
|
16517
16517
|
setCurrentSlide(newSlide);
|
|
16518
|
-
iframe.contentWindow.postMessage({ type:
|
|
16518
|
+
iframe.contentWindow.postMessage({ type: "goToSlide", slide: newSlide }, "*");
|
|
16519
16519
|
};
|
|
16520
16520
|
return /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("div", { className: "fixed inset-0 z-50 bg-black flex flex-col", children: [
|
|
16521
16521
|
/* @__PURE__ */ (0, import_jsx_runtime151.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: [
|
|
@@ -16637,9 +16637,7 @@ var PresentationJobCard = ({
|
|
|
16637
16637
|
const [rowError, setRowError] = (0, import_react80.useState)(null);
|
|
16638
16638
|
const [regenPollUrl, setRegenPollUrl] = (0, import_react80.useState)(null);
|
|
16639
16639
|
const [currentSlide, setCurrentSlide] = (0, import_react80.useState)(1);
|
|
16640
|
-
const [previewScale, setPreviewScale] = (0, import_react80.useState)(1);
|
|
16641
16640
|
const [iframeReady, setIframeReady] = (0, import_react80.useState)(false);
|
|
16642
|
-
const previewRef = (0, import_react80.useRef)(null);
|
|
16643
16641
|
const iframeRef = (0, import_react80.useRef)(null);
|
|
16644
16642
|
(0, import_react80.useEffect)(() => {
|
|
16645
16643
|
setStatus(initialStatus);
|
|
@@ -16705,17 +16703,9 @@ var PresentationJobCard = ({
|
|
|
16705
16703
|
cancelled = true;
|
|
16706
16704
|
};
|
|
16707
16705
|
}, [reviewStatus, slideTemplateOptions, templatesUrl, authToken]);
|
|
16708
|
-
const updateScale = (0, import_react80.useCallback)(() => {
|
|
16709
|
-
if (previewRef.current) setPreviewScale(previewRef.current.offsetWidth / 1280);
|
|
16710
|
-
}, []);
|
|
16711
16706
|
(0, import_react80.useEffect)(() => {
|
|
16712
|
-
updateScale();
|
|
16713
16707
|
setIframeReady(false);
|
|
16714
|
-
|
|
16715
|
-
const ro = new ResizeObserver(updateScale);
|
|
16716
|
-
if (previewRef.current) ro.observe(previewRef.current);
|
|
16717
|
-
return () => ro.disconnect();
|
|
16718
|
-
}, [updateScale, formats.html_url]);
|
|
16708
|
+
}, [formats.html_url]);
|
|
16719
16709
|
(0, import_react80.useEffect)(() => {
|
|
16720
16710
|
const handler = (e) => {
|
|
16721
16711
|
if (e.data?.type === "slideChanged") {
|
|
@@ -16738,7 +16728,7 @@ var PresentationJobCard = ({
|
|
|
16738
16728
|
newSlide = currentSlide <= 1 ? totalSlides : currentSlide - 1;
|
|
16739
16729
|
}
|
|
16740
16730
|
setCurrentSlide(newSlide);
|
|
16741
|
-
iframe.contentWindow.postMessage({ type:
|
|
16731
|
+
iframe.contentWindow.postMessage({ type: "goToSlide", slide: newSlide }, "*");
|
|
16742
16732
|
};
|
|
16743
16733
|
const isTerminal = status === "complete" || status === "failed";
|
|
16744
16734
|
const building = Boolean(outlineWritePollUrl) || approvingOutline;
|
|
@@ -17509,10 +17499,8 @@ var PresentationJobCard = ({
|
|
|
17509
17499
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
|
|
17510
17500
|
"div",
|
|
17511
17501
|
{
|
|
17512
|
-
ref: previewRef,
|
|
17513
17502
|
onClick: () => setShowFullscreen(true),
|
|
17514
|
-
className: "group relative overflow-hidden rounded-xl bg-zinc-950 border border-zinc-800/50 cursor-pointer",
|
|
17515
|
-
style: { height: Math.round(previewScale * 720) },
|
|
17503
|
+
className: "group relative aspect-video w-full overflow-hidden rounded-xl bg-zinc-950 border border-zinc-800/50 cursor-pointer",
|
|
17516
17504
|
title: "Click to open fullscreen",
|
|
17517
17505
|
children: [
|
|
17518
17506
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
@@ -17523,15 +17511,7 @@ var PresentationJobCard = ({
|
|
|
17523
17511
|
title,
|
|
17524
17512
|
sandbox: "allow-same-origin allow-scripts",
|
|
17525
17513
|
onLoad: () => setIframeReady(true),
|
|
17526
|
-
|
|
17527
|
-
width: 1280,
|
|
17528
|
-
height: 720,
|
|
17529
|
-
transform: `scale(${previewScale})`,
|
|
17530
|
-
transformOrigin: "top left",
|
|
17531
|
-
border: "none",
|
|
17532
|
-
pointerEvents: "none",
|
|
17533
|
-
display: "block"
|
|
17534
|
-
}
|
|
17514
|
+
className: "absolute inset-0 block h-full w-full border-0 pointer-events-none"
|
|
17535
17515
|
}
|
|
17536
17516
|
),
|
|
17537
17517
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/30 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)("span", { className: "opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-2 bg-zinc-900/80 backdrop-blur-sm border border-zinc-700 rounded-lg px-3 py-1.5 text-xs text-zinc-200 font-medium", children: [
|
|
@@ -17829,7 +17809,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17829
17809
|
const [progress, setProgress] = (0, import_react81.useState)(initialProgress);
|
|
17830
17810
|
const [showPreview, setShowPreview] = (0, import_react81.useState)(false);
|
|
17831
17811
|
const [showExport, setShowExport] = (0, import_react81.useState)(false);
|
|
17832
|
-
const [previewScale, setPreviewScale] = (0, import_react81.useState)(1);
|
|
17833
17812
|
const [copied, setCopied] = (0, import_react81.useState)(false);
|
|
17834
17813
|
const [approving, setApproving] = (0, import_react81.useState)(false);
|
|
17835
17814
|
const [regenerating, setRegenerating] = (0, import_react81.useState)(false);
|
|
@@ -17840,7 +17819,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17840
17819
|
const [rowError, setRowError] = (0, import_react81.useState)(null);
|
|
17841
17820
|
const [outlineWritePollUrl, setOutlineWritePollUrl] = (0, import_react81.useState)(null);
|
|
17842
17821
|
const [regenPollUrl, setRegenPollUrl] = (0, import_react81.useState)(null);
|
|
17843
|
-
const previewRef = (0, import_react81.useRef)(null);
|
|
17844
17822
|
const onCompleteRef = (0, import_react81.useRef)(onComplete);
|
|
17845
17823
|
const onFailedRef = (0, import_react81.useRef)(onFailed);
|
|
17846
17824
|
const hasNotifiedRef = (0, import_react81.useRef)(false);
|
|
@@ -17903,18 +17881,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17903
17881
|
const primaryColor = theme?.primary || DEFAULT_THEME.primary;
|
|
17904
17882
|
const hasHTML = Boolean(htmlUrl);
|
|
17905
17883
|
const building = Boolean(outlineWritePollUrl) || approvingOutline;
|
|
17906
|
-
const updateScale = (0, import_react81.useCallback)(() => {
|
|
17907
|
-
if (previewRef.current) {
|
|
17908
|
-
setPreviewScale(previewRef.current.offsetWidth / 800);
|
|
17909
|
-
}
|
|
17910
|
-
}, []);
|
|
17911
|
-
(0, import_react81.useEffect)(() => {
|
|
17912
|
-
updateScale();
|
|
17913
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
17914
|
-
const ro = new ResizeObserver(updateScale);
|
|
17915
|
-
if (previewRef.current) ro.observe(previewRef.current);
|
|
17916
|
-
return () => ro.disconnect();
|
|
17917
|
-
}, [updateScale, htmlUrl]);
|
|
17918
17884
|
useSharedPoll(
|
|
17919
17885
|
{
|
|
17920
17886
|
key: !isTerminal && pollUrl ? pollUrl : null,
|
|
@@ -18702,10 +18668,8 @@ var ResearchReportJobCard = (props) => {
|
|
|
18702
18668
|
hasHTML && !compact && /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(
|
|
18703
18669
|
"div",
|
|
18704
18670
|
{
|
|
18705
|
-
ref: previewRef,
|
|
18706
18671
|
onClick: () => setShowPreview(true),
|
|
18707
|
-
className: "group relative overflow-hidden rounded-xl bg-white border border-zinc-800/50 cursor-pointer",
|
|
18708
|
-
style: { height: Math.round(previewScale * 400) },
|
|
18672
|
+
className: "group relative aspect-[2/1] w-full overflow-hidden rounded-xl bg-white border border-zinc-800/50 cursor-pointer",
|
|
18709
18673
|
title: "Click to open fullscreen",
|
|
18710
18674
|
children: [
|
|
18711
18675
|
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
@@ -18714,15 +18678,7 @@ var ResearchReportJobCard = (props) => {
|
|
|
18714
18678
|
src: htmlUrl,
|
|
18715
18679
|
title,
|
|
18716
18680
|
sandbox: "allow-same-origin",
|
|
18717
|
-
|
|
18718
|
-
width: 800,
|
|
18719
|
-
height: 400,
|
|
18720
|
-
transform: `scale(${previewScale})`,
|
|
18721
|
-
transformOrigin: "top left",
|
|
18722
|
-
border: "none",
|
|
18723
|
-
pointerEvents: "none",
|
|
18724
|
-
display: "block"
|
|
18725
|
-
}
|
|
18681
|
+
className: "absolute inset-0 block h-full w-full border-0 pointer-events-none"
|
|
18726
18682
|
}
|
|
18727
18683
|
),
|
|
18728
18684
|
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/30 transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("span", { className: "opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-2 bg-zinc-900/80 backdrop-blur-sm border border-zinc-700 rounded-lg px-3 py-1.5 text-xs text-zinc-200 font-medium", children: [
|