pxengine 0.1.131 → 0.1.133
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 +16 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.mjs +16 -52
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -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") {
|
|
@@ -16788,7 +16778,11 @@ var PresentationJobCard = ({
|
|
|
16788
16778
|
onCompleteRef.current({
|
|
16789
16779
|
title: newTitle,
|
|
16790
16780
|
slide_count: newSlideCount,
|
|
16791
|
-
formats: newFormats
|
|
16781
|
+
formats: newFormats,
|
|
16782
|
+
status: newStatus,
|
|
16783
|
+
review_status: output.review_status,
|
|
16784
|
+
generation_mode: output.generation_mode,
|
|
16785
|
+
template_id: output.template_id
|
|
16792
16786
|
});
|
|
16793
16787
|
}
|
|
16794
16788
|
}
|
|
@@ -16833,10 +16827,14 @@ var PresentationJobCard = ({
|
|
|
16833
16827
|
onCompleteRef.current({
|
|
16834
16828
|
title: out.title ?? title,
|
|
16835
16829
|
slide_count: out.slide_count ?? slideCount,
|
|
16836
|
-
formats: out.formats ?? formats
|
|
16830
|
+
formats: out.formats ?? formats,
|
|
16831
|
+
status: "complete",
|
|
16832
|
+
review_status: out.review_status || "pending_review",
|
|
16833
|
+
generation_mode: out.generation_mode ?? generationMode,
|
|
16834
|
+
template_id: out.template_id ?? templateId
|
|
16837
16835
|
});
|
|
16838
16836
|
}
|
|
16839
|
-
}, [title, slideCount, formats]);
|
|
16837
|
+
}, [title, slideCount, formats, generationMode, templateId]);
|
|
16840
16838
|
const refetchSourceAndApply = (0, import_react80.useCallback)(async () => {
|
|
16841
16839
|
if (!pollUrl) return;
|
|
16842
16840
|
try {
|
|
@@ -17501,10 +17499,8 @@ var PresentationJobCard = ({
|
|
|
17501
17499
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(
|
|
17502
17500
|
"div",
|
|
17503
17501
|
{
|
|
17504
|
-
ref: previewRef,
|
|
17505
17502
|
onClick: () => setShowFullscreen(true),
|
|
17506
|
-
className: "group relative overflow-hidden rounded-xl bg-zinc-950 border border-zinc-800/50 cursor-pointer",
|
|
17507
|
-
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",
|
|
17508
17504
|
title: "Click to open fullscreen",
|
|
17509
17505
|
children: [
|
|
17510
17506
|
/* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
|
|
@@ -17515,15 +17511,7 @@ var PresentationJobCard = ({
|
|
|
17515
17511
|
title,
|
|
17516
17512
|
sandbox: "allow-same-origin allow-scripts",
|
|
17517
17513
|
onLoad: () => setIframeReady(true),
|
|
17518
|
-
|
|
17519
|
-
width: 1280,
|
|
17520
|
-
height: 720,
|
|
17521
|
-
transform: `scale(${previewScale})`,
|
|
17522
|
-
transformOrigin: "top left",
|
|
17523
|
-
border: "none",
|
|
17524
|
-
pointerEvents: "none",
|
|
17525
|
-
display: "block"
|
|
17526
|
-
}
|
|
17514
|
+
className: "absolute inset-0 block h-full w-full border-0 pointer-events-none"
|
|
17527
17515
|
}
|
|
17528
17516
|
),
|
|
17529
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: [
|
|
@@ -17821,7 +17809,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17821
17809
|
const [progress, setProgress] = (0, import_react81.useState)(initialProgress);
|
|
17822
17810
|
const [showPreview, setShowPreview] = (0, import_react81.useState)(false);
|
|
17823
17811
|
const [showExport, setShowExport] = (0, import_react81.useState)(false);
|
|
17824
|
-
const [previewScale, setPreviewScale] = (0, import_react81.useState)(1);
|
|
17825
17812
|
const [copied, setCopied] = (0, import_react81.useState)(false);
|
|
17826
17813
|
const [approving, setApproving] = (0, import_react81.useState)(false);
|
|
17827
17814
|
const [regenerating, setRegenerating] = (0, import_react81.useState)(false);
|
|
@@ -17832,7 +17819,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17832
17819
|
const [rowError, setRowError] = (0, import_react81.useState)(null);
|
|
17833
17820
|
const [outlineWritePollUrl, setOutlineWritePollUrl] = (0, import_react81.useState)(null);
|
|
17834
17821
|
const [regenPollUrl, setRegenPollUrl] = (0, import_react81.useState)(null);
|
|
17835
|
-
const previewRef = (0, import_react81.useRef)(null);
|
|
17836
17822
|
const onCompleteRef = (0, import_react81.useRef)(onComplete);
|
|
17837
17823
|
const onFailedRef = (0, import_react81.useRef)(onFailed);
|
|
17838
17824
|
const hasNotifiedRef = (0, import_react81.useRef)(false);
|
|
@@ -17895,18 +17881,6 @@ var ResearchReportJobCard = (props) => {
|
|
|
17895
17881
|
const primaryColor = theme?.primary || DEFAULT_THEME.primary;
|
|
17896
17882
|
const hasHTML = Boolean(htmlUrl);
|
|
17897
17883
|
const building = Boolean(outlineWritePollUrl) || approvingOutline;
|
|
17898
|
-
const updateScale = (0, import_react81.useCallback)(() => {
|
|
17899
|
-
if (previewRef.current) {
|
|
17900
|
-
setPreviewScale(previewRef.current.offsetWidth / 800);
|
|
17901
|
-
}
|
|
17902
|
-
}, []);
|
|
17903
|
-
(0, import_react81.useEffect)(() => {
|
|
17904
|
-
updateScale();
|
|
17905
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
17906
|
-
const ro = new ResizeObserver(updateScale);
|
|
17907
|
-
if (previewRef.current) ro.observe(previewRef.current);
|
|
17908
|
-
return () => ro.disconnect();
|
|
17909
|
-
}, [updateScale, htmlUrl]);
|
|
17910
17884
|
useSharedPoll(
|
|
17911
17885
|
{
|
|
17912
17886
|
key: !isTerminal && pollUrl ? pollUrl : null,
|
|
@@ -18694,10 +18668,8 @@ var ResearchReportJobCard = (props) => {
|
|
|
18694
18668
|
hasHTML && !compact && /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(
|
|
18695
18669
|
"div",
|
|
18696
18670
|
{
|
|
18697
|
-
ref: previewRef,
|
|
18698
18671
|
onClick: () => setShowPreview(true),
|
|
18699
|
-
className: "group relative overflow-hidden rounded-xl bg-white border border-zinc-800/50 cursor-pointer",
|
|
18700
|
-
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",
|
|
18701
18673
|
title: "Click to open fullscreen",
|
|
18702
18674
|
children: [
|
|
18703
18675
|
/* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
|
|
@@ -18706,15 +18678,7 @@ var ResearchReportJobCard = (props) => {
|
|
|
18706
18678
|
src: htmlUrl,
|
|
18707
18679
|
title,
|
|
18708
18680
|
sandbox: "allow-same-origin",
|
|
18709
|
-
|
|
18710
|
-
width: 800,
|
|
18711
|
-
height: 400,
|
|
18712
|
-
transform: `scale(${previewScale})`,
|
|
18713
|
-
transformOrigin: "top left",
|
|
18714
|
-
border: "none",
|
|
18715
|
-
pointerEvents: "none",
|
|
18716
|
-
display: "block"
|
|
18717
|
-
}
|
|
18681
|
+
className: "absolute inset-0 block h-full w-full border-0 pointer-events-none"
|
|
18718
18682
|
}
|
|
18719
18683
|
),
|
|
18720
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: [
|