@nocopypaste/vue-grid 0.3.0 → 0.3.1

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1 — 2026-11-24
4
+
5
+ Releases are published from GitHub Actions with npm trusted publishing, so every version from
6
+ now on carries npm provenance (a signed link to the commit and workflow that built it). CI runs
7
+ the unit tests and the browser tests in Chromium, Firefox and WebKit on every push.
8
+
9
+ Fix (Safari): an open menu (row actions, cell and header menus) now hides when its trigger is
10
+ scrolled out of the grid. WebKit accepts CSS `position-visibility: anchor-visible` but didn't hide
11
+ it there; the grid's JavaScript fallback now always runs next to the CSS.
12
+
3
13
  ## 0.3.0 — 2026-11-24
4
14
 
5
15
  **Row grouping** (`rowGroupingFeature`): `v-model:group-by` groups the rows by one or more
package/README.md CHANGED
@@ -1035,7 +1035,7 @@ small JS fallback runs only when a feature check (`CSS.supports`) says the brows
1035
1035
  | Behaviour | Done with | JS fallback when unsupported |
1036
1036
  |---|---|---|
1037
1037
  | Menu / popover placement, flipping, following the anchor on scroll | Popover API + CSS anchor positioning | measured placement, re-run on scroll / resize |
1038
- | Hiding a popover once its anchor scrolls out of view | `position-visibility: anchor-visible` | IntersectionObserver (e.g. Firefox 159) |
1038
+ | Hiding a popover once its anchor scrolls out of view | `position-visibility: anchor-visible` | IntersectionObserver, always on as well (Firefox 159 parses only an older value; WebKit / Safari 27 accepts it but keeps a popover whose anchor is clipped by the grid) |
1039
1039
  | Sticky offsets of pinned columns | `calc()` sums of the declared widths | ResizeObserver, only for content-sized pinned columns |
1040
1040
  | Which pinned column gets the edge shadow | `:has()` / sibling selectors | a class |
1041
1041
  | Shadow only while content is scrolled under pinned columns | `@container scroll-state(scrollable: …)` | scroll listener sets `data-vg-scrollable` |
package/agent/api.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@nocopypaste/vue-grid",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "component": "VGrid",
5
5
  "props": [
6
6
  {
package/agent/api.md CHANGED
@@ -1,4 +1,4 @@
1
- # @nocopypaste/vue-grid 0.3.0 — API reference
1
+ # @nocopypaste/vue-grid 0.3.1 — API reference
2
2
 
3
3
  > Generated from the TypeScript sources (`scripts/gen-agent.mjs`). Machine-readable: `agent/api.json`, `agent/grid-config.schema.json`.
4
4
 
package/dist/agent/api.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/agent/api.json
2
- var e = "0.3.0", t = "VGrid", n = [
2
+ var e = "0.3.1", t = "VGrid", n = [
3
3
  {
4
4
  name: "rows",
5
5
  type: "readonly T[]",
@@ -1,41 +1,40 @@
1
- import { supportsAnchorVisibility as e } from "./supports.js";
2
1
  // src/internal/anchor.ts
3
- var t;
4
- function n() {
5
- return t ??= typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --vg"), t;
2
+ var e;
3
+ function t() {
4
+ return e ??= typeof CSS < "u" && typeof CSS.supports == "function" && CSS.supports("anchor-name: --vg"), e;
6
5
  }
7
- function r(e) {
6
+ function n(e) {
8
7
  return `--vg-anchor-${e.replace(/[^\w-]/g, "_")}`;
9
8
  }
10
- function i(e, t, n) {
9
+ function r(e, t, n) {
11
10
  let r = t instanceof HTMLElement ? t.getBoundingClientRect() : new DOMRect(t.x, t.y, 0, 0), i = e.getBoundingClientRect(), a = window.innerWidth, o = window.innerHeight, s = n === "bottom-end" ? r.right - i.width : r.left;
12
11
  s + i.width > a - 4 && (s = n === "point" ? r.left - i.width : a - 4 - i.width), s = Math.max(4, s);
13
12
  let c = r.bottom + (n === "point" ? 0 : 4);
14
13
  c + i.height > o - 4 && (c = r.top - (n === "point" ? 0 : 4) - i.height), c = Math.max(4, c), e.style.left = `${s}px`, e.style.top = `${c}px`;
15
14
  }
16
- function a(t, r, a) {
17
- let o = [];
18
- if (!n()) {
19
- let e = 0, n = () => {
20
- cancelAnimationFrame(e), e = requestAnimationFrame(() => i(t, r, a));
15
+ function i(e, n, i) {
16
+ let a = [];
17
+ if (!t()) {
18
+ let t = 0, o = () => {
19
+ cancelAnimationFrame(t), t = requestAnimationFrame(() => r(e, n, i));
21
20
  };
22
- i(t, r, a), window.addEventListener("scroll", n, {
21
+ r(e, n, i), window.addEventListener("scroll", o, {
23
22
  capture: !0,
24
23
  passive: !0
25
- }), window.addEventListener("resize", n, { passive: !0 }), o.push(() => {
26
- cancelAnimationFrame(e), window.removeEventListener("scroll", n, { capture: !0 }), window.removeEventListener("resize", n);
24
+ }), window.addEventListener("resize", o, { passive: !0 }), a.push(() => {
25
+ cancelAnimationFrame(t), window.removeEventListener("scroll", o, { capture: !0 }), window.removeEventListener("resize", o);
27
26
  });
28
27
  }
29
- if (!e() && r instanceof HTMLElement && typeof IntersectionObserver < "u") {
30
- let e = new IntersectionObserver(([e]) => {
31
- t.toggleAttribute("data-vg-anchor-hidden", !!e && !e.isIntersecting);
28
+ if (n instanceof HTMLElement && typeof IntersectionObserver < "u") {
29
+ let t = new IntersectionObserver(([t]) => {
30
+ e.toggleAttribute("data-vg-anchor-hidden", !!t && !t.isIntersecting);
32
31
  });
33
- e.observe(r), o.push(() => {
34
- e.disconnect(), t.removeAttribute("data-vg-anchor-hidden");
32
+ t.observe(n), a.push(() => {
33
+ t.disconnect(), e.removeAttribute("data-vg-anchor-hidden");
35
34
  });
36
35
  }
37
- return () => o.splice(0).forEach((e) => e());
36
+ return () => a.splice(0).forEach((e) => e());
38
37
  }
39
- export { r as anchorNameFor, i as placeWithoutAnchorSupport, n as supportsAnchorPositioning, a as trackAnchor };
38
+ export { n as anchorNameFor, r as placeWithoutAnchorSupport, t as supportsAnchorPositioning, i as trackAnchor };
40
39
 
41
40
  //# sourceMappingURL=anchor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"anchor.js","names":["supported","supportsAnchorPositioning","anchorNameFor","id","placeWithoutAnchorSupport","rect","target","pop","floating","vw","vh","left","placement","top","trackAnchor","cleanups","frame","place","supportsAnchorVisibility","io","entry","fn"],"sources":["../../src/internal/anchor.ts"],"sourcesContent":["/**\n * Helpers for CSS anchor positioning. Popovers are placed purely in CSS (`position-anchor` +\n * `position-area` + `position-try-fallbacks`); this module only provides unique anchor names and a\n * JS fallback for browsers without anchor positioning.\n */\nimport { supportsAnchorVisibility } from './supports'\n\nlet supported: boolean | undefined\n\nexport function supportsAnchorPositioning(): boolean {\n supported ??= typeof CSS !== 'undefined' && typeof CSS.supports === 'function' && CSS.supports('anchor-name: --vg')\n return supported\n}\n\n/** A dashed-ident anchor name derived from a Vue `useId()` value. */\nexport function anchorNameFor(id: string): string {\n return `--vg-anchor-${id.replace(/[^\\w-]/g, '_')}`\n}\n\nexport type AnchorTarget = HTMLElement | { x: number; y: number }\n\nexport type Placement = 'bottom-start' | 'bottom-end' | 'point'\n\n/** JS placement used only when CSS anchor positioning is unavailable. Flips to stay in the viewport. */\nexport function placeWithoutAnchorSupport(floating: HTMLElement, target: AnchorTarget, placement: Placement) {\n const gap = 4\n const rect =\n target instanceof HTMLElement\n ? target.getBoundingClientRect()\n : new DOMRect(target.x, target.y, 0, 0)\n const pop = floating.getBoundingClientRect()\n const vw = window.innerWidth\n const vh = window.innerHeight\n\n let left = placement === 'bottom-end' ? rect.right - pop.width : placement === 'point' ? rect.left : rect.left\n if (left + pop.width > vw - gap) left = placement === 'point' ? rect.left - pop.width : vw - gap - pop.width\n left = Math.max(gap, left)\n\n let top = rect.bottom + (placement === 'point' ? 0 : gap)\n if (top + pop.height > vh - gap) top = rect.top - (placement === 'point' ? 0 : gap) - pop.height\n top = Math.max(gap, top)\n\n floating.style.left = `${left}px`\n floating.style.top = `${top}px`\n}\n\n/**\n * JS fallbacks for an open anchored popover, each only where CSS can't do the job:\n * - no CSS anchor positioning → place it now and again on scroll / resize, so it follows its anchor;\n * - no working `position-visibility: anchor-visible` → hide it (`data-vg-anchor-hidden`) while the\n * anchor element is clipped by a scroll container (IntersectionObserver applies ancestor clipping).\n * Returns a cleanup function; call it when the popover closes.\n */\nexport function trackAnchor(floating: HTMLElement, target: AnchorTarget, placement: Placement): () => void {\n const cleanups: (() => void)[] = []\n\n if (!supportsAnchorPositioning()) {\n let frame = 0\n const place = () => {\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(() => placeWithoutAnchorSupport(floating, target, placement))\n }\n placeWithoutAnchorSupport(floating, target, placement)\n window.addEventListener('scroll', place, { capture: true, passive: true })\n window.addEventListener('resize', place, { passive: true })\n cleanups.push(() => {\n cancelAnimationFrame(frame)\n window.removeEventListener('scroll', place, { capture: true })\n window.removeEventListener('resize', place)\n })\n }\n\n if (!supportsAnchorVisibility() && target instanceof HTMLElement && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver(([entry]) => {\n floating.toggleAttribute('data-vg-anchor-hidden', !!entry && !entry.isIntersecting)\n })\n io.observe(target)\n cleanups.push(() => {\n io.disconnect()\n floating.removeAttribute('data-vg-anchor-hidden')\n })\n }\n\n return () => cleanups.splice(0).forEach((fn) => fn())\n}\n"],"mappings":";;AAOA,IAAIA;AAEJ,SAAgBC,IAAqC;CAEnD,OADA,MAAc,OAAO,MAAQ,OAAe,OAAO,IAAI,YAAa,cAAc,IAAI,SAAS,mBAAmB,GAC3GD;AACT;AAGA,SAAgBE,EAAc,GAAoB;CAChD,OAAO,eAAeC,EAAG,QAAQ,WAAW,GAAG;AACjD;AAOA,SAAgBC,EAA0B,GAAuB,GAAsB,GAAsB;CAC3G,IACMC,IACJC,aAAkB,cACdA,EAAO,sBAAsB,IAC7B,IAAI,QAAQA,EAAO,GAAGA,EAAO,GAAG,GAAG,CAAC,GACpCC,IAAMC,EAAS,sBAAsB,GACrCC,IAAK,OAAO,YACZC,IAAK,OAAO,aAEdC,IAAOC,MAAc,eAAeP,EAAK,QAAQE,EAAI,QAAgCF,EAAK;CAE9F,AADIM,IAAOJ,EAAI,QAAQE,IAAK,MAAK,IAAOG,MAAc,UAAUP,EAAK,OAAOE,E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,CAAC,CAAC,CAAC,SAAS,MAAOM,EAAG,CAAC;AACtD"}
1
+ {"version":3,"file":"anchor.js","names":["supported","supportsAnchorPositioning","anchorNameFor","id","placeWithoutAnchorSupport","rect","target","pop","floating","vw","vh","left","placement","top","trackAnchor","cleanups","frame","place","io","entry","fn"],"sources":["../../src/internal/anchor.ts"],"sourcesContent":["/**\n * Helpers for CSS anchor positioning. Popovers are placed purely in CSS (`position-anchor` +\n * `position-area` + `position-try-fallbacks`); this module only provides unique anchor names and a\n * JS fallback for browsers without anchor positioning.\n */\n\nlet supported: boolean | undefined\n\nexport function supportsAnchorPositioning(): boolean {\n supported ??= typeof CSS !== 'undefined' && typeof CSS.supports === 'function' && CSS.supports('anchor-name: --vg')\n return supported\n}\n\n/** A dashed-ident anchor name derived from a Vue `useId()` value. */\nexport function anchorNameFor(id: string): string {\n return `--vg-anchor-${id.replace(/[^\\w-]/g, '_')}`\n}\n\nexport type AnchorTarget = HTMLElement | { x: number; y: number }\n\nexport type Placement = 'bottom-start' | 'bottom-end' | 'point'\n\n/** JS placement used only when CSS anchor positioning is unavailable. Flips to stay in the viewport. */\nexport function placeWithoutAnchorSupport(floating: HTMLElement, target: AnchorTarget, placement: Placement) {\n const gap = 4\n const rect =\n target instanceof HTMLElement\n ? target.getBoundingClientRect()\n : new DOMRect(target.x, target.y, 0, 0)\n const pop = floating.getBoundingClientRect()\n const vw = window.innerWidth\n const vh = window.innerHeight\n\n let left = placement === 'bottom-end' ? rect.right - pop.width : placement === 'point' ? rect.left : rect.left\n if (left + pop.width > vw - gap) left = placement === 'point' ? rect.left - pop.width : vw - gap - pop.width\n left = Math.max(gap, left)\n\n let top = rect.bottom + (placement === 'point' ? 0 : gap)\n if (top + pop.height > vh - gap) top = rect.top - (placement === 'point' ? 0 : gap) - pop.height\n top = Math.max(gap, top)\n\n floating.style.left = `${left}px`\n floating.style.top = `${top}px`\n}\n\n/**\n * JS fallbacks for an open anchored popover, each only where CSS can't do the job:\n * - no CSS anchor positioning → place it now and again on scroll / resize, so it follows its anchor;\n * - hide it (`data-vg-anchor-hidden`) while the anchor element is clipped by a scroll container\n * (IntersectionObserver applies ancestor clipping). Always, next to CSS\n * `position-visibility: anchor-visible`: Firefox 159 only parses an older value, and WebKit\n * (Safari 27) reports support but doesn't hide a popover whose anchor is clipped by the grid's\n * own scroll container — feature detection can't tell.\n * Returns a cleanup function; call it when the popover closes.\n */\nexport function trackAnchor(floating: HTMLElement, target: AnchorTarget, placement: Placement): () => void {\n const cleanups: (() => void)[] = []\n\n if (!supportsAnchorPositioning()) {\n let frame = 0\n const place = () => {\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(() => placeWithoutAnchorSupport(floating, target, placement))\n }\n placeWithoutAnchorSupport(floating, target, placement)\n window.addEventListener('scroll', place, { capture: true, passive: true })\n window.addEventListener('resize', place, { passive: true })\n cleanups.push(() => {\n cancelAnimationFrame(frame)\n window.removeEventListener('scroll', place, { capture: true })\n window.removeEventListener('resize', place)\n })\n }\n\n if (target instanceof HTMLElement && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver(([entry]) => {\n floating.toggleAttribute('data-vg-anchor-hidden', !!entry && !entry.isIntersecting)\n })\n io.observe(target)\n cleanups.push(() => {\n io.disconnect()\n floating.removeAttribute('data-vg-anchor-hidden')\n })\n }\n\n return () => cleanups.splice(0).forEach((fn) => fn())\n}\n"],"mappings":";AAMA,IAAIA;AAEJ,SAAgBC,IAAqC;CAEnD,OADA,MAAc,OAAO,MAAQ,OAAe,OAAO,IAAI,YAAa,cAAc,IAAI,SAAS,mBAAmB,GAC3GD;AACT;AAGA,SAAgBE,EAAc,GAAoB;CAChD,OAAO,eAAeC,EAAG,QAAQ,WAAW,GAAG;AACjD;AAOA,SAAgBC,EAA0B,GAAuB,GAAsB,GAAsB;CAC3G,IACMC,IACJC,aAAkB,cACdA,EAAO,sBAAsB,IAC7B,IAAI,QAAQA,EAAO,GAAGA,EAAO,GAAG,GAAG,CAAC,GACpCC,IAAM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AS,CAACA,EAAM,cAAc;EACpF,CAAC;EAED,AADAD,EAAG,QAAQZ,CAAM,GACjBS,EAAS,WAAW;GAElB,AADAG,EAAG,WAAW,GACdV,EAAS,gBAAgB,uBAAuB;EAClD,CAAC;CACH;CAEA,aAAaO,EAAS,OAAO,CAAC,CAAC,CAAC,SAAS,MAAOK,EAAG,CAAC;AACtD"}
@@ -4,7 +4,7 @@ function t(t, n) {
4
4
  let r = e.get(t);
5
5
  return r === void 0 && (r = typeof CSS > "u" || typeof CSS.supports != "function" || n(), e.set(t, r)), r;
6
6
  }
7
- var n = () => t("has", () => CSS.supports("selector(:has(+ *))")), r = () => t("scroll-state", () => CSS.supports("container-type: scroll-state")), i = () => t("anchor-visible", () => CSS.supports("position-visibility: anchor-visible")), a = () => t("relative-color", () => CSS.supports("color: oklch(from red l c h)"));
8
- export { i as supportsAnchorVisibility, n as supportsHas, a as supportsRelativeColor, r as supportsScrollState };
7
+ var n = () => t("has", () => CSS.supports("selector(:has(+ *))")), r = () => t("scroll-state", () => CSS.supports("container-type: scroll-state")), i = () => t("relative-color", () => CSS.supports("color: oklch(from red l c h)"));
8
+ export { n as supportsHas, i as supportsRelativeColor, r as supportsScrollState };
9
9
 
10
10
  //# sourceMappingURL=supports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"supports.js","names":["cache","check","v","id","test","supportsHas","supportsScrollState","supportsAnchorVisibility","supportsRelativeColor"],"sources":["../../src/internal/supports.ts"],"sourcesContent":["/**\n * CSS feature checks deciding when a JS fallback is needed. Everything the grid can do in CSS it does\n * in CSS; these only gate the fallbacks. All return `true` during SSR (no `CSS` global), so the\n * server never renders fallback state.\n */\nconst cache = new Map<string, boolean>()\n\nfunction check(id: string, test: () => boolean): boolean {\n let v = cache.get(id)\n if (v === undefined) {\n v = typeof CSS === 'undefined' || typeof CSS.supports !== 'function' ? true : test()\n cache.set(id, v)\n }\n return v\n}\n\n/** `:has()` — used to find the pinned-column edge in CSS. */\nexport const supportsHas = () => check('has', () => CSS.supports('selector(:has(+ *))'))\n\n/** Scroll-state container queries — show pin shadows only while content is scrolled under them. */\nexport const supportsScrollState = () =>\n check('scroll-state', () => CSS.supports('container-type: scroll-state'))\n\n/**\n * Hiding an anchored popover once its anchor is clipped. Checked via the current value name: engines\n * that only parse the old `anchors-visible` (Firefox 159) parse it without hiding anything.\n */\nexport const supportsAnchorVisibility = () =>\n check('anchor-visible', () => CSS.supports('position-visibility: anchor-visible'))\n\n/** Relative colour syntax — picks readable chip text in CSS. */\nexport const supportsRelativeColor = () =>\n check('relative-color', () => CSS.supports('color: oklch(from red l c h)'))\n"],"mappings":";AAKA,IAAMA,oBAAQ,IAAI,IAAqB;AAEvC,SAASC,EAAM,GAAY,GAA8B;CACvD,IAAIC,IAAIF,EAAM,IAAIG,CAAE;CAKpB,OAJID,MAAM,KAAA,MACR,IAAI,OAAO,MAAQ,OAAe,OAAO,IAAI,YAAa,cAAoBE,EAAK,GACnFJ,EAAM,IAAIG,GAAID,CAAC,IAEVA;AACT;AAGA,IAAaG,UAAoBJ,EAAM,aAAa,IAAI,SAAS,qBAAqB,CAAC,GAG1EK,UACXL,EAAM,sBAAsB,IAAI,SAAS,8BAA8B,CAAC,GAM7DM,UACXN,EAAM,wBAAwB,IAAI,SAAS,qCAAqC,CAAC,GAGtEO,UACXP,EAAM,wBAAwB,IAAI,SAAS,8BAA8B,CAAC"}
1
+ {"version":3,"file":"supports.js","names":["cache","check","v","id","test","supportsHas","supportsScrollState","supportsRelativeColor"],"sources":["../../src/internal/supports.ts"],"sourcesContent":["/**\n * CSS feature checks deciding when a JS fallback is needed. Everything the grid can do in CSS it does\n * in CSS; these only gate the fallbacks. All return `true` during SSR (no `CSS` global), so the\n * server never renders fallback state.\n */\nconst cache = new Map<string, boolean>()\n\nfunction check(id: string, test: () => boolean): boolean {\n let v = cache.get(id)\n if (v === undefined) {\n v = typeof CSS === 'undefined' || typeof CSS.supports !== 'function' ? true : test()\n cache.set(id, v)\n }\n return v\n}\n\n/** `:has()` — used to find the pinned-column edge in CSS. */\nexport const supportsHas = () => check('has', () => CSS.supports('selector(:has(+ *))'))\n\n/** Scroll-state container queries — show pin shadows only while content is scrolled under them. */\nexport const supportsScrollState = () =>\n check('scroll-state', () => CSS.supports('container-type: scroll-state'))\n\n\n/** Relative colour syntax — picks readable chip text in CSS. */\nexport const supportsRelativeColor = () =>\n check('relative-color', () => CSS.supports('color: oklch(from red l c h)'))\n"],"mappings":";AAKA,IAAMA,oBAAQ,IAAI,IAAqB;AAEvC,SAASC,EAAM,GAAY,GAA8B;CACvD,IAAIC,IAAIF,EAAM,IAAIG,CAAE;CAKpB,OAJID,MAAM,KAAA,MACR,IAAI,OAAO,MAAQ,OAAe,OAAO,IAAI,YAAa,cAAoBE,EAAK,GACnFJ,EAAM,IAAIG,GAAID,CAAC,IAEVA;AACT;AAGA,IAAaG,UAAoBJ,EAAM,aAAa,IAAI,SAAS,qBAAqB,CAAC,GAG1EK,UACXL,EAAM,sBAAsB,IAAI,SAAS,8BAA8B,CAAC,GAI7DM,UACXN,EAAM,wBAAwB,IAAI,SAAS,8BAA8B,CAAC"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Helpers for CSS anchor positioning. Popovers are placed purely in CSS (`position-anchor` +
3
+ * `position-area` + `position-try-fallbacks`); this module only provides unique anchor names and a
4
+ * JS fallback for browsers without anchor positioning.
5
+ */
1
6
  export declare function supportsAnchorPositioning(): boolean;
2
7
  /** A dashed-ident anchor name derived from a Vue `useId()` value. */
3
8
  export declare function anchorNameFor(id: string): string;
@@ -11,8 +16,11 @@ export declare function placeWithoutAnchorSupport(floating: HTMLElement, target:
11
16
  /**
12
17
  * JS fallbacks for an open anchored popover, each only where CSS can't do the job:
13
18
  * - no CSS anchor positioning → place it now and again on scroll / resize, so it follows its anchor;
14
- * - no working `position-visibility: anchor-visible` → hide it (`data-vg-anchor-hidden`) while the
15
- * anchor element is clipped by a scroll container (IntersectionObserver applies ancestor clipping).
19
+ * - hide it (`data-vg-anchor-hidden`) while the anchor element is clipped by a scroll container
20
+ * (IntersectionObserver applies ancestor clipping). Always, next to CSS
21
+ * `position-visibility: anchor-visible`: Firefox 159 only parses an older value, and WebKit
22
+ * (Safari 27) reports support but doesn't hide a popover whose anchor is clipped by the grid's
23
+ * own scroll container — feature detection can't tell.
16
24
  * Returns a cleanup function; call it when the popover closes.
17
25
  */
18
26
  export declare function trackAnchor(floating: HTMLElement, target: AnchorTarget, placement: Placement): () => void;
@@ -2,10 +2,5 @@
2
2
  export declare const supportsHas: () => boolean;
3
3
  /** Scroll-state container queries — show pin shadows only while content is scrolled under them. */
4
4
  export declare const supportsScrollState: () => boolean;
5
- /**
6
- * Hiding an anchored popover once its anchor is clipped. Checked via the current value name: engines
7
- * that only parse the old `anchors-visible` (Firefox 159) parse it without hiding anything.
8
- */
9
- export declare const supportsAnchorVisibility: () => boolean;
10
5
  /** Relative colour syntax — picks readable chip text in CSS. */
11
6
  export declare const supportsRelativeColor: () => boolean;
package/llms-full.txt CHANGED
@@ -351,7 +351,7 @@ Tokens: `--vg-*` (see README → Theming). Dark mode follows `color-scheme`. Den
351
351
 
352
352
  ---
353
353
 
354
- # @nocopypaste/vue-grid 0.3.0 — API reference
354
+ # @nocopypaste/vue-grid 0.3.1 — API reference
355
355
 
356
356
  > Generated from the TypeScript sources (`scripts/gen-agent.mjs`). Machine-readable: `agent/api.json`, `agent/grid-config.schema.json`.
357
357
 
@@ -2040,7 +2040,7 @@ small JS fallback runs only when a feature check (`CSS.supports`) says the brows
2040
2040
  | Behaviour | Done with | JS fallback when unsupported |
2041
2041
  |---|---|---|
2042
2042
  | Menu / popover placement, flipping, following the anchor on scroll | Popover API + CSS anchor positioning | measured placement, re-run on scroll / resize |
2043
- | Hiding a popover once its anchor scrolls out of view | `position-visibility: anchor-visible` | IntersectionObserver (e.g. Firefox 159) |
2043
+ | Hiding a popover once its anchor scrolls out of view | `position-visibility: anchor-visible` | IntersectionObserver, always on as well (Firefox 159 parses only an older value; WebKit / Safari 27 accepts it but keeps a popover whose anchor is clipped by the grid) |
2044
2044
  | Sticky offsets of pinned columns | `calc()` sums of the declared widths | ResizeObserver, only for content-sized pinned columns |
2045
2045
  | Which pinned column gets the edge shadow | `:has()` / sibling selectors | a class |
2046
2046
  | Shadow only while content is scrolled under pinned columns | `@container scroll-state(scrollable: …)` | scroll listener sets `data-vg-scrollable` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocopypaste/vue-grid",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "CSS-Grid based data grid for Vue 3 with opt-in features, pluggable cell renderers, sub-grids and CSS-variable theming — documented for coding agents (AGENTS.md, llms.txt, JSON Schema, validator).",
5
5
  "license": "MIT",
6
6
  "type": "module",