@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.
@@ -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
- // A top-layer popover is positioned against the viewport regardless of any
93
- // transformed ancestor, so its coordinates are used as-is. A non-top-layer
94
- // fixed panel (the in-dialog mode) is positioned against its containing
95
- // block, which can be a transformed ancestor on WebKit — compensate for its
96
- // measured viewport offset so the same coordinates land correctly there too.
97
- if (isTopLayerPopover(floating))
98
- return { x, y };
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.14",
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.3.14",
95
- "@urbicon-ui/shared-types": "6.3.14",
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",