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.mjs
CHANGED
|
@@ -16183,7 +16183,7 @@ var FullscreenModal = ({ url, title, slideCount, initialSlide = 1, onClose }) =>
|
|
|
16183
16183
|
newSlide = currentSlide <= 1 ? totalSlides : currentSlide - 1;
|
|
16184
16184
|
}
|
|
16185
16185
|
setCurrentSlide(newSlide);
|
|
16186
|
-
iframe.contentWindow.postMessage({ type:
|
|
16186
|
+
iframe.contentWindow.postMessage({ type: "goToSlide", slide: newSlide }, "*");
|
|
16187
16187
|
};
|
|
16188
16188
|
return /* @__PURE__ */ jsxs109("div", { className: "fixed inset-0 z-50 bg-black flex flex-col", children: [
|
|
16189
16189
|
/* @__PURE__ */ jsxs109("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: [
|
|
@@ -16305,9 +16305,7 @@ var PresentationJobCard = ({
|
|
|
16305
16305
|
const [rowError, setRowError] = useState10(null);
|
|
16306
16306
|
const [regenPollUrl, setRegenPollUrl] = useState10(null);
|
|
16307
16307
|
const [currentSlide, setCurrentSlide] = useState10(1);
|
|
16308
|
-
const [previewScale, setPreviewScale] = useState10(1);
|
|
16309
16308
|
const [iframeReady, setIframeReady] = useState10(false);
|
|
16310
|
-
const previewRef = useRef9(null);
|
|
16311
16309
|
const iframeRef = useRef9(null);
|
|
16312
16310
|
useEffect7(() => {
|
|
16313
16311
|
setStatus(initialStatus);
|
|
@@ -16373,17 +16371,9 @@ var PresentationJobCard = ({
|
|
|
16373
16371
|
cancelled = true;
|
|
16374
16372
|
};
|
|
16375
16373
|
}, [reviewStatus, slideTemplateOptions, templatesUrl, authToken]);
|
|
16376
|
-
const updateScale = useCallback4(() => {
|
|
16377
|
-
if (previewRef.current) setPreviewScale(previewRef.current.offsetWidth / 1280);
|
|
16378
|
-
}, []);
|
|
16379
16374
|
useEffect7(() => {
|
|
16380
|
-
updateScale();
|
|
16381
16375
|
setIframeReady(false);
|
|
16382
|
-
|
|
16383
|
-
const ro = new ResizeObserver(updateScale);
|
|
16384
|
-
if (previewRef.current) ro.observe(previewRef.current);
|
|
16385
|
-
return () => ro.disconnect();
|
|
16386
|
-
}, [updateScale, formats.html_url]);
|
|
16376
|
+
}, [formats.html_url]);
|
|
16387
16377
|
useEffect7(() => {
|
|
16388
16378
|
const handler = (e) => {
|
|
16389
16379
|
if (e.data?.type === "slideChanged") {
|
|
@@ -16406,7 +16396,7 @@ var PresentationJobCard = ({
|
|
|
16406
16396
|
newSlide = currentSlide <= 1 ? totalSlides : currentSlide - 1;
|
|
16407
16397
|
}
|
|
16408
16398
|
setCurrentSlide(newSlide);
|
|
16409
|
-
iframe.contentWindow.postMessage({ type:
|
|
16399
|
+
iframe.contentWindow.postMessage({ type: "goToSlide", slide: newSlide }, "*");
|
|
16410
16400
|
};
|
|
16411
16401
|
const isTerminal = status === "complete" || status === "failed";
|
|
16412
16402
|
const building = Boolean(outlineWritePollUrl) || approvingOutline;
|
|
@@ -17177,10 +17167,8 @@ var PresentationJobCard = ({
|
|
|
17177
17167
|
/* @__PURE__ */ jsxs109(
|
|
17178
17168
|
"div",
|
|
17179
17169
|
{
|
|
17180
|
-
ref: previewRef,
|
|
17181
17170
|
onClick: () => setShowFullscreen(true),
|
|
17182
|
-
className: "group relative overflow-hidden rounded-xl bg-zinc-950 border border-zinc-800/50 cursor-pointer",
|
|
17183
|
-
style: { height: Math.round(previewScale * 720) },
|
|
17171
|
+
className: "group relative aspect-video w-full overflow-hidden rounded-xl bg-zinc-950 border border-zinc-800/50 cursor-pointer",
|
|
17184
17172
|
title: "Click to open fullscreen",
|
|
17185
17173
|
children: [
|
|
17186
17174
|
/* @__PURE__ */ jsx151(
|
|
@@ -17191,15 +17179,7 @@ var PresentationJobCard = ({
|
|
|
17191
17179
|
title,
|
|
17192
17180
|
sandbox: "allow-same-origin allow-scripts",
|
|
17193
17181
|
onLoad: () => setIframeReady(true),
|
|
17194
|
-
|
|
17195
|
-
width: 1280,
|
|
17196
|
-
height: 720,
|
|
17197
|
-
transform: `scale(${previewScale})`,
|
|
17198
|
-
transformOrigin: "top left",
|
|
17199
|
-
border: "none",
|
|
17200
|
-
pointerEvents: "none",
|
|
17201
|
-
display: "block"
|
|
17202
|
-
}
|
|
17182
|
+
className: "absolute inset-0 block h-full w-full border-0 pointer-events-none"
|
|
17203
17183
|
}
|
|
17204
17184
|
),
|
|
17205
17185
|
/* @__PURE__ */ jsx151("div", { className: "absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/30 transition-colors", children: /* @__PURE__ */ jsxs109("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: [
|
|
@@ -17497,7 +17477,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17497
17477
|
const [progress, setProgress] = useState11(initialProgress);
|
|
17498
17478
|
const [showPreview, setShowPreview] = useState11(false);
|
|
17499
17479
|
const [showExport, setShowExport] = useState11(false);
|
|
17500
|
-
const [previewScale, setPreviewScale] = useState11(1);
|
|
17501
17480
|
const [copied, setCopied] = useState11(false);
|
|
17502
17481
|
const [approving, setApproving] = useState11(false);
|
|
17503
17482
|
const [regenerating, setRegenerating] = useState11(false);
|
|
@@ -17508,7 +17487,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17508
17487
|
const [rowError, setRowError] = useState11(null);
|
|
17509
17488
|
const [outlineWritePollUrl, setOutlineWritePollUrl] = useState11(null);
|
|
17510
17489
|
const [regenPollUrl, setRegenPollUrl] = useState11(null);
|
|
17511
|
-
const previewRef = useRef10(null);
|
|
17512
17490
|
const onCompleteRef = useRef10(onComplete);
|
|
17513
17491
|
const onFailedRef = useRef10(onFailed);
|
|
17514
17492
|
const hasNotifiedRef = useRef10(false);
|
|
@@ -17571,18 +17549,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17571
17549
|
const primaryColor = theme?.primary || DEFAULT_THEME.primary;
|
|
17572
17550
|
const hasHTML = Boolean(htmlUrl);
|
|
17573
17551
|
const building = Boolean(outlineWritePollUrl) || approvingOutline;
|
|
17574
|
-
const updateScale = useCallback5(() => {
|
|
17575
|
-
if (previewRef.current) {
|
|
17576
|
-
setPreviewScale(previewRef.current.offsetWidth / 800);
|
|
17577
|
-
}
|
|
17578
|
-
}, []);
|
|
17579
|
-
useEffect8(() => {
|
|
17580
|
-
updateScale();
|
|
17581
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
17582
|
-
const ro = new ResizeObserver(updateScale);
|
|
17583
|
-
if (previewRef.current) ro.observe(previewRef.current);
|
|
17584
|
-
return () => ro.disconnect();
|
|
17585
|
-
}, [updateScale, htmlUrl]);
|
|
17586
17552
|
useSharedPoll(
|
|
17587
17553
|
{
|
|
17588
17554
|
key: !isTerminal && pollUrl ? pollUrl : null,
|
|
@@ -18370,10 +18336,8 @@ var ResearchReportJobCard = (props) => {
|
|
|
18370
18336
|
hasHTML && !compact && /* @__PURE__ */ jsx152("div", { className: "mt-4", children: /* @__PURE__ */ jsxs110(
|
|
18371
18337
|
"div",
|
|
18372
18338
|
{
|
|
18373
|
-
ref: previewRef,
|
|
18374
18339
|
onClick: () => setShowPreview(true),
|
|
18375
|
-
className: "group relative overflow-hidden rounded-xl bg-white border border-zinc-800/50 cursor-pointer",
|
|
18376
|
-
style: { height: Math.round(previewScale * 400) },
|
|
18340
|
+
className: "group relative aspect-[2/1] w-full overflow-hidden rounded-xl bg-white border border-zinc-800/50 cursor-pointer",
|
|
18377
18341
|
title: "Click to open fullscreen",
|
|
18378
18342
|
children: [
|
|
18379
18343
|
/* @__PURE__ */ jsx152(
|
|
@@ -18382,15 +18346,7 @@ var ResearchReportJobCard = (props) => {
|
|
|
18382
18346
|
src: htmlUrl,
|
|
18383
18347
|
title,
|
|
18384
18348
|
sandbox: "allow-same-origin",
|
|
18385
|
-
|
|
18386
|
-
width: 800,
|
|
18387
|
-
height: 400,
|
|
18388
|
-
transform: `scale(${previewScale})`,
|
|
18389
|
-
transformOrigin: "top left",
|
|
18390
|
-
border: "none",
|
|
18391
|
-
pointerEvents: "none",
|
|
18392
|
-
display: "block"
|
|
18393
|
-
}
|
|
18349
|
+
className: "absolute inset-0 block h-full w-full border-0 pointer-events-none"
|
|
18394
18350
|
}
|
|
18395
18351
|
),
|
|
18396
18352
|
/* @__PURE__ */ jsx152("div", { className: "absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/30 transition-colors", children: /* @__PURE__ */ jsxs110("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: [
|