@burdenoff/website-sdk 2026.829.6 → 2026.829.8

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
@@ -7706,6 +7706,7 @@ function ExplorePage({
7706
7706
  const fileInputRef = useRef(null);
7707
7707
  const stagedRef = useRef([]);
7708
7708
  stagedRef.current = staged;
7709
+ const pickQueueRef = useRef(Promise.resolve());
7709
7710
  const [shareLabel, setShareLabel] = useState("Share");
7710
7711
  const [shareUrl, setShareUrl] = useState(null);
7711
7712
  const scrollRef = useRef(null);
@@ -7771,35 +7772,42 @@ function ExplorePage({
7771
7772
  setTimeout(() => setShareLabel("Share"), 2500);
7772
7773
  return;
7773
7774
  }
7774
- const base = (pageUrl ?? window.location.href).split("?")[0];
7775
- const url = `${base}?c=${encodeURIComponent(token)}`;
7775
+ const url = new URL(pageUrl ?? window.location.href);
7776
+ url.search = "";
7777
+ url.hash = "";
7778
+ url.searchParams.set("c", token);
7779
+ const shareable = url.toString();
7776
7780
  try {
7777
- await navigator.clipboard.writeText(url);
7781
+ await navigator.clipboard.writeText(shareable);
7778
7782
  setShareLabel("Copied");
7779
7783
  setTimeout(() => setShareLabel("Share"), 2500);
7780
7784
  } catch {
7781
- setShareUrl(url);
7785
+ setShareUrl(shareable);
7782
7786
  setShareLabel("Share");
7783
7787
  }
7784
7788
  }, [createShareLink, pageUrl]);
7785
7789
  const handleFilesPicked = useCallback(
7786
- async (picked) => {
7787
- if (!picked || picked.length === 0) return;
7788
- const { accepted, rejected } = await stageFiles(
7789
- Array.from(picked),
7790
- stagedRef.current
7791
- );
7792
- setStaged((prev) => [...prev, ...accepted]);
7793
- const first = rejected[0];
7794
- setAttachmentNotice(
7795
- first ? first.reason === "too-large" ? fill(T.attachmentTooLarge, {
7796
- name: first.name,
7797
- size: String(MAX_ATTACHMENT_BYTES / (1024 * 1024))
7798
- }) : fill(T.attachmentTooMany, {
7799
- name: first.name,
7800
- max: String(MAX_ATTACHMENTS)
7801
- }) : null
7802
- );
7790
+ (picked) => {
7791
+ if (!picked || picked.length === 0) return pickQueueRef.current;
7792
+ const files = Array.from(picked);
7793
+ pickQueueRef.current = pickQueueRef.current.then(async () => {
7794
+ const { accepted, rejected } = await stageFiles(
7795
+ files,
7796
+ stagedRef.current
7797
+ );
7798
+ setStaged((prev) => [...prev, ...accepted]);
7799
+ const first = rejected[0];
7800
+ setAttachmentNotice(
7801
+ first ? first.reason === "too-large" ? fill(T.attachmentTooLarge, {
7802
+ name: first.name,
7803
+ size: String(MAX_ATTACHMENT_BYTES / (1024 * 1024))
7804
+ }) : fill(T.attachmentTooMany, {
7805
+ name: first.name,
7806
+ max: String(MAX_ATTACHMENTS)
7807
+ }) : null
7808
+ );
7809
+ });
7810
+ return pickQueueRef.current;
7803
7811
  },
7804
7812
  [T]
7805
7813
  );