@ai-matrx/design-system 0.61.14 → 0.61.16

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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.61.16 — a pill panned past a chart's viewport is not an overflowing pill
4
+
5
+ - Pill guard: when a transformed layer sits between a pill and its nearest clipping ancestor (a
6
+ pan/zoom world inside a chart or canvas viewport), the pill is flagged against that clip only
7
+ when it is wider than the clip. 0.61.15 still compared position, so every chip on a card panned
8
+ out of view logged "overflows its clipping container" (measured on /agents/org-chart: 2460px).
9
+ Guard case red on 0.61.15.
10
+
11
+ No consumer action.
12
+
13
+ ## 0.61.15 — a pill in a panned tile is not an overflowing pill
14
+
15
+ - Pill guard: the viewport judges only the part of the pill its clipping ancestors leave drawn, and
16
+ never a pill inside a transformed (translate/scale/rotate) ancestor or one wholly off screen.
17
+ A pill wider than its nearest clipping ancestor (overflow hidden/auto/scroll/clip) is now
18
+ reported as overflowing its clipping container. Measured: /board tiles panned off the canvas
19
+ logged "overflows the viewport". Guard cases added (off-screen and half-off-screen pill in a
20
+ translated tile: none; pill wider than its clipping tile: flagged).
21
+
22
+ No consumer action.
23
+
3
24
  ## 0.61.14 — a page that scrolls down never hides an overflowing pill
4
25
 
5
26
  - Pill guard: only a sideways TRACK (an ancestor that scrolls horizontally and not vertically)
package/dist/index.cjs CHANGED
@@ -744,9 +744,50 @@ function overflowPast(el, rect, view) {
744
744
  if (by > 0.5) return { what: "its container", by };
745
745
  }
746
746
  }
747
- const vw = el.ownerDocument.documentElement.clientWidth || view.innerWidth;
747
+ let clip = null;
748
+ let transformed = false;
749
+ let pannedInsideClip = false;
750
+ const root = el.ownerDocument.documentElement;
751
+ for (let p = el.parentElement; p && p !== root; p = p.parentElement) {
752
+ const pcs = view.getComputedStyle(p);
753
+ if (!clip && pcs.overflowX !== "visible" && pcs.overflowX !== "") clip = p;
754
+ if (pcs.transform && pcs.transform !== "none" || pcs.translate && pcs.translate !== "none" || pcs.scale && pcs.scale !== "none" || pcs.rotate && pcs.rotate !== "none") {
755
+ transformed = true;
756
+ if (!clip) pannedInsideClip = true;
757
+ }
758
+ }
759
+ if (clip && !pinned && clip !== parent) {
760
+ const cr = clip.getBoundingClientRect();
761
+ if (cr.width > 0) {
762
+ const by = pannedInsideClip ? rect.width - cr.width : Math.max(rect.right - cr.right, cr.left - rect.left);
763
+ if (by > 0.5) return { what: "its clipping container", by };
764
+ }
765
+ }
766
+ let left = rect.left;
767
+ let right = rect.right;
768
+ let top = rect.top;
769
+ let bottom = rect.bottom;
770
+ for (let p = el.parentElement; p && p !== root; p = p.parentElement) {
771
+ const pcs = view.getComputedStyle(p);
772
+ if (pcs.overflowX === "visible" && pcs.overflowY === "visible") continue;
773
+ const cr = p.getBoundingClientRect();
774
+ if (cr.width === 0 && cr.height === 0) continue;
775
+ if (pcs.overflowX !== "visible") {
776
+ left = Math.max(left, cr.left);
777
+ right = Math.min(right, cr.right);
778
+ }
779
+ if (pcs.overflowY !== "visible") {
780
+ top = Math.max(top, cr.top);
781
+ bottom = Math.min(bottom, cr.bottom);
782
+ }
783
+ }
784
+ const vw = root.clientWidth || view.innerWidth;
785
+ const vh = root.clientHeight || view.innerHeight;
786
+ if (transformed) return null;
787
+ if (vw > 0 && (right <= left || right <= 0 || left >= vw)) return null;
788
+ if (vh > 0 && (bottom <= top || bottom <= 0 || top >= vh)) return null;
748
789
  if (vw > 0) {
749
- const by = Math.max(rect.right - vw, -rect.left);
790
+ const by = Math.max(right - vw, -left);
750
791
  if (by > 0.5) return { what: "the viewport", by };
751
792
  }
752
793
  return null;