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.mjs CHANGED
@@ -38876,8 +38876,6 @@ var PresentationJobCard = ({
38876
38876
  const [copied, setCopied] = useState10(false);
38877
38877
  const [currentSlide, setCurrentSlide] = useState10(1);
38878
38878
  const [previewScale, setPreviewScale] = useState10(1);
38879
- const [iframeReady, setIframeReady] = useState10(false);
38880
- const [pendingSlide, setPendingSlide] = useState10(null);
38881
38879
  const intervalRef = useRef5(null);
38882
38880
  const previewRef = useRef5(null);
38883
38881
  const iframeRef = useRef5(null);
@@ -38891,10 +38889,6 @@ var PresentationJobCard = ({
38891
38889
  if (previewRef.current) ro.observe(previewRef.current);
38892
38890
  return () => ro.disconnect();
38893
38891
  }, [updateScale, formats.html_url]);
38894
- useEffect6(() => {
38895
- setIframeReady(false);
38896
- setPendingSlide(null);
38897
- }, [formats.html_url]);
38898
38892
  useEffect6(() => {
38899
38893
  const handler = (e) => {
38900
38894
  if (e.data?.type === "slideChanged") {
@@ -38905,25 +38899,9 @@ var PresentationJobCard = ({
38905
38899
  window.addEventListener("message", handler);
38906
38900
  return () => window.removeEventListener("message", handler);
38907
38901
  }, [slideCount]);
38908
- useEffect6(() => {
38909
- if (!iframeReady || pendingSlide === null) return;
38910
- iframeRef.current?.contentWindow?.postMessage({ type: "goToSlide", slide: pendingSlide }, "*");
38911
- setPendingSlide(null);
38912
- }, [iframeReady, pendingSlide]);
38913
38902
  const sendSlideCommand = (command) => {
38914
- if (!iframeReady) return;
38915
38903
  iframeRef.current?.contentWindow?.postMessage({ type: command }, "*");
38916
38904
  };
38917
- const goToSlide = (n) => {
38918
- const total2 = slideCount || 1;
38919
- const target = (n - 1 + total2) % total2 + 1;
38920
- setCurrentSlide(target);
38921
- if (iframeReady) {
38922
- iframeRef.current?.contentWindow?.postMessage({ type: "goToSlide", slide: target }, "*");
38923
- return;
38924
- }
38925
- setPendingSlide(target);
38926
- };
38927
38905
  const isTerminal = status === "complete" || status === "failed";
38928
38906
  const onCompleteRef = useRef5(onComplete);
38929
38907
  const onFailedRef = useRef5(onFailed);
@@ -39084,7 +39062,6 @@ var PresentationJobCard = ({
39084
39062
  ref: iframeRef,
39085
39063
  src: formats.html_url,
39086
39064
  title,
39087
- onLoad: () => setIframeReady(true),
39088
39065
  sandbox: "allow-same-origin allow-scripts",
39089
39066
  style: {
39090
39067
  width: 1280,
@@ -39110,7 +39087,7 @@ var PresentationJobCard = ({
39110
39087
  {
39111
39088
  onClick: (e) => {
39112
39089
  e.stopPropagation();
39113
- slideCount > 1 ? goToSlide(currentSlide - 1) : sendSlideCommand("prevSlide");
39090
+ sendSlideCommand("prevSlide");
39114
39091
  },
39115
39092
  disabled: !hasHtml,
39116
39093
  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",
@@ -39128,7 +39105,7 @@ var PresentationJobCard = ({
39128
39105
  {
39129
39106
  onClick: (e) => {
39130
39107
  e.stopPropagation();
39131
- slideCount > 1 ? goToSlide(currentSlide + 1) : sendSlideCommand("nextSlide");
39108
+ sendSlideCommand("nextSlide");
39132
39109
  },
39133
39110
  disabled: !hasHtml,
39134
39111
  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",