@urbicon-ui/blocks 6.3.14 → 6.4.0
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/utils/floating.js +13 -23
- package/package.json +3 -3
package/dist/utils/floating.js
CHANGED
|
@@ -71,31 +71,21 @@ function fixedOriginOffset(floating) {
|
|
|
71
71
|
floating.style.top = prevTop;
|
|
72
72
|
return { x: origin.left, y: origin.top };
|
|
73
73
|
}
|
|
74
|
-
/**
|
|
75
|
-
* `true` when `floating` is a popover currently promoted to the browser top
|
|
76
|
-
* layer. Guarded: `:popover-open` predates the Popover API, so `matches()`
|
|
77
|
-
* throws `SyntaxError` on engines that lack it (Safari < 17) — there, no element
|
|
78
|
-
* can be in the top layer, so `false` is the correct answer (and never throwing
|
|
79
|
-
* keeps `computePosition` from aborting mid-flight, which would leave the panel
|
|
80
|
-
* unpositioned — Codeberg #23).
|
|
81
|
-
*/
|
|
82
|
-
function isTopLayerPopover(floating) {
|
|
83
|
-
try {
|
|
84
|
-
return floating.matches(':popover-open');
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
74
|
function viewportToLocal(floating, x, y, strategy) {
|
|
91
75
|
if (strategy === 'fixed') {
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
|
|
76
|
+
// Measure where the element's OWN containing block actually sits and
|
|
77
|
+
// compensate — never assume `position: fixed` (or the top layer) equals the
|
|
78
|
+
// viewport. The probe self-corrects for every case:
|
|
79
|
+
// • genuinely viewport-fixed (desktop) → origin (0,0), no-op
|
|
80
|
+
// • non-top-layer panel under a transformed ancestor → origin = ancestor
|
|
81
|
+
// • TOP-LAYER popover on iOS with the keyboard open → the popover is
|
|
82
|
+
// anchored to the LAYOUT viewport, which getBoundingClientRect reports
|
|
83
|
+
// offset by `visualViewport.offsetTop`; the probe reads (0, -offsetTop)
|
|
84
|
+
// and compensates, so the panel lands on its anchor instead of floating
|
|
85
|
+
// that far above the visible area (Codeberg #23).
|
|
86
|
+
// Earlier revisions special-cased `:popover-open` to skip this — that wrongly
|
|
87
|
+
// assumed top-layer == viewport-fixed and stranded keyboard-shifted popovers
|
|
88
|
+
// (and risked a SyntaxError on engines without `:popover-open`).
|
|
99
89
|
const origin = fixedOriginOffset(floating);
|
|
100
90
|
return { x: x - origin.x, y: y - origin.y };
|
|
101
91
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@urbicon-ui/blocks",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Svelte 5 UI component library with Tailwind CSS 4, OKLCH design tokens and zero runtime dependencies",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"@sveltejs/package": "^2.5.8",
|
|
92
92
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
93
93
|
"@tailwindcss/vite": "^4.3.1",
|
|
94
|
-
"@urbicon-ui/i18n": "6.
|
|
95
|
-
"@urbicon-ui/shared-types": "6.
|
|
94
|
+
"@urbicon-ui/i18n": "6.4.0",
|
|
95
|
+
"@urbicon-ui/shared-types": "6.4.0",
|
|
96
96
|
"prettier": "^3.8.4",
|
|
97
97
|
"prettier-plugin-svelte": "^4.1.1",
|
|
98
98
|
"prettier-plugin-tailwindcss": "^0.8.0",
|