pxengine 0.1.80 → 0.1.81

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
@@ -39199,8 +39199,6 @@ var PresentationJobCard = ({
39199
39199
  const [copied, setCopied] = (0, import_react75.useState)(false);
39200
39200
  const [currentSlide, setCurrentSlide] = (0, import_react75.useState)(1);
39201
39201
  const [previewScale, setPreviewScale] = (0, import_react75.useState)(1);
39202
- const [iframeReady, setIframeReady] = (0, import_react75.useState)(false);
39203
- const [pendingSlide, setPendingSlide] = (0, import_react75.useState)(null);
39204
39202
  const intervalRef = (0, import_react75.useRef)(null);
39205
39203
  const previewRef = (0, import_react75.useRef)(null);
39206
39204
  const iframeRef = (0, import_react75.useRef)(null);
@@ -39214,10 +39212,6 @@ var PresentationJobCard = ({
39214
39212
  if (previewRef.current) ro.observe(previewRef.current);
39215
39213
  return () => ro.disconnect();
39216
39214
  }, [updateScale, formats.html_url]);
39217
- (0, import_react75.useEffect)(() => {
39218
- setIframeReady(false);
39219
- setPendingSlide(null);
39220
- }, [formats.html_url]);
39221
39215
  (0, import_react75.useEffect)(() => {
39222
39216
  const handler = (e) => {
39223
39217
  if (e.data?.type === "slideChanged") {
@@ -39228,25 +39222,9 @@ var PresentationJobCard = ({
39228
39222
  window.addEventListener("message", handler);
39229
39223
  return () => window.removeEventListener("message", handler);
39230
39224
  }, [slideCount]);
39231
- (0, import_react75.useEffect)(() => {
39232
- if (!iframeReady || pendingSlide === null) return;
39233
- iframeRef.current?.contentWindow?.postMessage({ type: "goToSlide", slide: pendingSlide }, "*");
39234
- setPendingSlide(null);
39235
- }, [iframeReady, pendingSlide]);
39236
39225
  const sendSlideCommand = (command) => {
39237
- if (!iframeReady) return;
39238
39226
  iframeRef.current?.contentWindow?.postMessage({ type: command }, "*");
39239
39227
  };
39240
- const goToSlide = (n) => {
39241
- const total2 = slideCount || 1;
39242
- const target = (n - 1 + total2) % total2 + 1;
39243
- setCurrentSlide(target);
39244
- if (iframeReady) {
39245
- iframeRef.current?.contentWindow?.postMessage({ type: "goToSlide", slide: target }, "*");
39246
- return;
39247
- }
39248
- setPendingSlide(target);
39249
- };
39250
39228
  const isTerminal = status === "complete" || status === "failed";
39251
39229
  const onCompleteRef = (0, import_react75.useRef)(onComplete);
39252
39230
  const onFailedRef = (0, import_react75.useRef)(onFailed);
@@ -39407,7 +39385,6 @@ var PresentationJobCard = ({
39407
39385
  ref: iframeRef,
39408
39386
  src: formats.html_url,
39409
39387
  title,
39410
- onLoad: () => setIframeReady(true),
39411
39388
  sandbox: "allow-same-origin allow-scripts",
39412
39389
  style: {
39413
39390
  width: 1280,
@@ -39433,7 +39410,7 @@ var PresentationJobCard = ({
39433
39410
  {
39434
39411
  onClick: (e) => {
39435
39412
  e.stopPropagation();
39436
- slideCount > 1 ? goToSlide(currentSlide - 1) : sendSlideCommand("prevSlide");
39413
+ sendSlideCommand("prevSlide");
39437
39414
  },
39438
39415
  disabled: !hasHtml,
39439
39416
  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",
@@ -39451,7 +39428,7 @@ var PresentationJobCard = ({
39451
39428
  {
39452
39429
  onClick: (e) => {
39453
39430
  e.stopPropagation();
39454
- slideCount > 1 ? goToSlide(currentSlide + 1) : sendSlideCommand("nextSlide");
39431
+ sendSlideCommand("nextSlide");
39455
39432
  },
39456
39433
  disabled: !hasHtml,
39457
39434
  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",