dshmarket 1.20.1 → 1.20.3
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/client/client.js +25 -1
- package/client/client.js.map +1 -1
- package/lib/pnpm-compat.js +22 -0
- package/lib/types/pnpm-compat.d.ts +1 -1
- package/package.json +1 -1
- package/src/client/MarketSection.tsx +57 -5
- package/src/pnpm-compat.ts +23 -1
package/client/client.js
CHANGED
|
@@ -3672,7 +3672,31 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
|
|
|
3672
3672
|
})
|
|
3673
3673
|
] })
|
|
3674
3674
|
]
|
|
3675
|
-
}),
|
|
3675
|
+
}), marketPortalHost());
|
|
3676
|
+
}
|
|
3677
|
+
/**
|
|
3678
|
+
* The one DOM node this package portals into, created on first use and kept
|
|
3679
|
+
* for the life of the page.
|
|
3680
|
+
*
|
|
3681
|
+
* Created imperatively rather than rendered, and never removed: the point is
|
|
3682
|
+
* that `document.body`'s child list stops being shared state between two
|
|
3683
|
+
* React roots. A container that came and went would put the same churn back
|
|
3684
|
+
* into body, just less often — and "less often" is what made this bug
|
|
3685
|
+
* intermittent and hard to believe in the first place.
|
|
3686
|
+
*
|
|
3687
|
+
* Re-appended on every open so it stays last among body's children. That is
|
|
3688
|
+
* what keeps the lightbox above the host's own portalled dialog, which is
|
|
3689
|
+
* why the portal exists at all; moving a node we own is not something the
|
|
3690
|
+
* host's root tracks, so it cannot disturb it.
|
|
3691
|
+
*/
|
|
3692
|
+
let portalHost = null;
|
|
3693
|
+
function marketPortalHost() {
|
|
3694
|
+
if (portalHost === null) {
|
|
3695
|
+
portalHost = document.createElement("div");
|
|
3696
|
+
portalHost.setAttribute("data-dsh-market-portal", "");
|
|
3697
|
+
}
|
|
3698
|
+
document.body.appendChild(portalHost);
|
|
3699
|
+
return portalHost;
|
|
3676
3700
|
}
|
|
3677
3701
|
/**
|
|
3678
3702
|
* Official-style market glyph: the shared block-grid brand mark converted to
|