@lls-a1/dsh-balance-float 1.1.45 → 1.1.47
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.js +15 -27
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -311,9 +311,12 @@ window.__ModuleLoader__.load({
|
|
|
311
311
|
'.dbf-version.has-update{color:var(--dsw-alias-state-error-primary)}',
|
|
312
312
|
'.dbf-version.has-update .dbf-version-glyph{opacity:1}',
|
|
313
313
|
'.dbf-modal{position:fixed;top:0;right:0;bottom:0;left:0;height:100dvh;z-index:10;display:flex;align-items:center;justify-content:center;padding:calc(12px + env(safe-area-inset-top,0px)) 12px calc(12px + env(safe-area-inset-bottom,0px));background:rgba(0,0,0,.45);overscroll-behavior:contain;touch-action:none}',
|
|
314
|
-
'.dbf-dialog{position:fixed;top:0;
|
|
314
|
+
'.dbf-dialog{position:fixed;top:0;left:0;width:100vw;height:100dvh;min-width:100vw;min-height:100dvh;max-width:none;max-height:none;margin:0;padding:calc(12px + env(safe-area-inset-top,0px)) 12px calc(12px + env(safe-area-inset-bottom,0px));border:0;box-sizing:border-box;background:transparent;color:inherit;display:flex;align-items:center;justify-content:center;overflow:hidden;overscroll-behavior:contain;outline:none}',
|
|
315
|
+
'.dbf-dialog:focus,.dbf-dialog:focus-visible{outline:none}',
|
|
316
|
+
'.dbf-modal-open{scrollbar-width:none}',
|
|
317
|
+
'.dbf-modal-open ::-webkit-scrollbar{width:0;height:0;display:none}',
|
|
315
318
|
'.dbf-dialog::backdrop{background:rgba(0,0,0,.45)}',
|
|
316
|
-
'.dbf-modal-card{width:min(308px,
|
|
319
|
+
'.dbf-modal-card{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(308px,calc(100vw - 24px));margin:0;max-height:calc(100dvh - 24px);overflow:auto;touch-action:auto;overscroll-behavior:contain;padding:16px;border-radius:14px;box-shadow:0 18px 48px rgba(0,0,0,calc(.34 * var(--dbf-shadow,1)));background:var(--dsw-alias-bg-layer-1,Canvas);color:var(--dsw-alias-label-primary,CanvasText)}',
|
|
317
320
|
'.dbf-modal-head{display:flex;align-items:center;gap:8px;margin-bottom:10px}',
|
|
318
321
|
'.dbf-modal-icon{width:22px;height:22px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-overlay));color:var(--dsw-alias-brand-primary,#4d6bfe);font-size:12px;line-height:1}',
|
|
319
322
|
'.dbf-modal-title{font-size:13px;font-weight:600}',
|
|
@@ -609,6 +612,13 @@ window.__ModuleLoader__.load({
|
|
|
609
612
|
// page header kept painting above the mask. showModal() moves the element
|
|
610
613
|
// into the browser top layer, where the ::backdrop always covers the
|
|
611
614
|
// whole viewport — no z-index can beat it.
|
|
615
|
+
useEffect(() => {
|
|
616
|
+
if (update === null || !updateOpen) return undefined;
|
|
617
|
+
const root = document.documentElement;
|
|
618
|
+
root.classList.add('dbf-modal-open');
|
|
619
|
+
return () => root.classList.remove('dbf-modal-open');
|
|
620
|
+
}, [update, updateOpen]);
|
|
621
|
+
|
|
612
622
|
useEffect(() => {
|
|
613
623
|
const element = modalRef.current;
|
|
614
624
|
if (element === null || typeof element.showModal !== 'function' || element.open) return;
|
|
@@ -619,30 +629,6 @@ window.__ModuleLoader__.load({
|
|
|
619
629
|
}
|
|
620
630
|
});
|
|
621
631
|
|
|
622
|
-
/** Copy the install spec so the user can update from the plugin manager. */
|
|
623
|
-
const copyInstallSpec = useCallback(async () => {
|
|
624
|
-
const spec = NPM_SPEC;
|
|
625
|
-
try {
|
|
626
|
-
await navigator.clipboard.writeText(spec);
|
|
627
|
-
} catch {
|
|
628
|
-
const area = document.createElement('textarea');
|
|
629
|
-
area.value = spec;
|
|
630
|
-
area.style.position = 'fixed';
|
|
631
|
-
area.style.opacity = '0';
|
|
632
|
-
document.body.appendChild(area);
|
|
633
|
-
area.select();
|
|
634
|
-
try {
|
|
635
|
-
document.execCommand('copy');
|
|
636
|
-
} finally {
|
|
637
|
-
document.body.removeChild(area);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
setCopied(true);
|
|
641
|
-
window.setTimeout(() => {
|
|
642
|
-
if (aliveRef.current) setCopied(false);
|
|
643
|
-
}, 2200);
|
|
644
|
-
}, [update]);
|
|
645
|
-
|
|
646
632
|
const flashAtRef = useRef(null);
|
|
647
633
|
const flashTimerRef = useRef(null);
|
|
648
634
|
const leaveTimerRef = useRef(null);
|
|
@@ -1759,7 +1745,9 @@ window.__ModuleLoader__.load({
|
|
|
1759
1745
|
h('style', { key: 'css' }, STYLE),
|
|
1760
1746
|
surface,
|
|
1761
1747
|
bubble,
|
|
1762
|
-
updateModal
|
|
1748
|
+
createPortal !== null && typeof document !== 'undefined' && updateModal !== null
|
|
1749
|
+
? createPortal(updateModal, document.body)
|
|
1750
|
+
: updateModal,
|
|
1763
1751
|
);
|
|
1764
1752
|
return createPortal !== null && typeof document !== 'undefined' ? createPortal(tree, document.body) : tree;
|
|
1765
1753
|
}
|