gf-components 0.1.163 → 0.1.164
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/index.cjs.js +7 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +32 -20
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -41251,12 +41251,12 @@ const za = 12, d1 = 14, Rs = Bt.tspan`
|
|
|
41251
41251
|
/* @__PURE__ */ m.jsx(u, {})
|
|
41252
41252
|
] });
|
|
41253
41253
|
}, P7e = Bt.span`
|
|
41254
|
-
|
|
41255
|
-
|
|
41256
|
-
|
|
41257
|
-
|
|
41258
|
-
|
|
41259
|
-
|
|
41254
|
+
font: var(--gf-label-md-default);
|
|
41255
|
+
font-size: 14px;
|
|
41256
|
+
line-height: 22px;
|
|
41257
|
+
font-weight: 400;
|
|
41258
|
+
color: var(--gf-color-button-primary);
|
|
41259
|
+
transition: color 150ms ease, font-weight 150ms ease;
|
|
41260
41260
|
`, fhe = ({
|
|
41261
41261
|
items: e,
|
|
41262
41262
|
width: t = 226,
|
|
@@ -41277,29 +41277,41 @@ const za = 12, d1 = 14, Rs = Bt.tspan`
|
|
|
41277
41277
|
window.scrollTo({ top: h, behavior: "smooth" });
|
|
41278
41278
|
};
|
|
41279
41279
|
return Ne.useEffect(() => {
|
|
41280
|
-
const d = (e || []).map((
|
|
41281
|
-
var
|
|
41282
|
-
return { key:
|
|
41283
|
-
}).filter((
|
|
41280
|
+
const d = (e || []).map((p, g) => {
|
|
41281
|
+
var v;
|
|
41282
|
+
return { key: g, el: (v = p.href) == null ? void 0 : v.current };
|
|
41283
|
+
}).filter((p) => p.el);
|
|
41284
41284
|
if (!d.length) return;
|
|
41285
|
-
const f = new IntersectionObserver(
|
|
41286
|
-
(
|
|
41285
|
+
const f = /* @__PURE__ */ new Map(), h = new IntersectionObserver(
|
|
41286
|
+
(p) => {
|
|
41287
41287
|
if (s.current) return;
|
|
41288
|
-
|
|
41289
|
-
|
|
41290
|
-
|
|
41291
|
-
|
|
41288
|
+
for (const b of p)
|
|
41289
|
+
f.set(b.target, {
|
|
41290
|
+
is: b.isIntersecting,
|
|
41291
|
+
top: b.boundingClientRect.top,
|
|
41292
|
+
ratio: b.intersectionRatio
|
|
41293
|
+
});
|
|
41294
|
+
const g = [];
|
|
41295
|
+
for (const { key: b, el: y } of d) {
|
|
41296
|
+
const x = f.get(y);
|
|
41297
|
+
x != null && x.is && g.push({ key: b, el: y, ...x });
|
|
41298
|
+
}
|
|
41299
|
+
if (!g.length) return;
|
|
41300
|
+
const v = g.sort(
|
|
41301
|
+
(b, y) => Math.abs(b.top - n) - Math.abs(y.top - n) || y.ratio - b.ratio
|
|
41302
|
+
)[0];
|
|
41303
|
+
v && v.key !== o && a(v.key);
|
|
41292
41304
|
},
|
|
41293
41305
|
{
|
|
41294
41306
|
root: null,
|
|
41295
|
-
threshold: [0.
|
|
41307
|
+
threshold: [0, 0.01, 0.1, 0.2],
|
|
41296
41308
|
rootMargin: `-${n}px 0px -${r}% 0px`
|
|
41297
41309
|
}
|
|
41298
41310
|
);
|
|
41299
|
-
return d.forEach(({ el:
|
|
41300
|
-
|
|
41311
|
+
return d.forEach(({ el: p }) => h.observe(p)), () => {
|
|
41312
|
+
h.disconnect(), l.current && clearTimeout(l.current);
|
|
41301
41313
|
};
|
|
41302
|
-
}, [e]), /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
|
|
41314
|
+
}, [e, n, o]), /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
|
|
41303
41315
|
/* @__PURE__ */ m.jsx($n, {}),
|
|
41304
41316
|
/* @__PURE__ */ m.jsxs(tn, { align: "stretch", children: [
|
|
41305
41317
|
/* @__PURE__ */ m.jsxs(
|