@bug-on/m3-expressive 1.3.2 → 1.3.4
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 +14 -0
- package/README.md +25 -0
- package/dist/{core-DyEy8H9Z.d.ts → core-COvZHQ_k.d.ts} +1 -4
- package/dist/{core-D8FdHY6I.d.mts → core-CRkixy1y.d.mts} +1 -4
- package/dist/core.d.mts +1 -2
- package/dist/core.d.ts +1 -2
- package/dist/core.js +10 -9
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +11 -9
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.d.mts +2 -1
- package/dist/feedback.d.ts +2 -1
- package/dist/feedback.js +10 -7
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +10 -8
- package/dist/feedback.mjs.map +1 -1
- package/dist/index.d.mts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +193 -77
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +193 -77
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +16 -5
- package/dist/layout.d.ts +16 -5
- package/dist/layout.js +38 -18
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +38 -18
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +24 -8
- package/dist/navigation.d.ts +24 -8
- package/dist/navigation.js +416 -293
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +408 -286
- package/dist/navigation.mjs.map +1 -1
- package/llms-full.txt +255 -0
- package/llms.txt +102 -0
- package/package.json +25 -20
package/dist/layout.mjs
CHANGED
|
@@ -5861,12 +5861,15 @@ Text.displayName = "Text";
|
|
|
5861
5861
|
function TableOfContents({
|
|
5862
5862
|
items,
|
|
5863
5863
|
className,
|
|
5864
|
-
scrollAreaProps
|
|
5864
|
+
scrollAreaProps,
|
|
5865
|
+
scrollContainerRef
|
|
5865
5866
|
}) {
|
|
5866
5867
|
const [activeId, setActiveId] = useState("");
|
|
5867
5868
|
const itemIds = useMemo(() => items.map((i) => i.id), [items]);
|
|
5868
5869
|
useEffect(() => {
|
|
5870
|
+
var _a;
|
|
5869
5871
|
if (typeof IntersectionObserver === "undefined") return;
|
|
5872
|
+
const root = (_a = scrollContainerRef == null ? void 0 : scrollContainerRef.current) != null ? _a : null;
|
|
5870
5873
|
const observer = new IntersectionObserver(
|
|
5871
5874
|
(entries) => {
|
|
5872
5875
|
for (const entry of entries) {
|
|
@@ -5874,19 +5877,20 @@ function TableOfContents({
|
|
|
5874
5877
|
}
|
|
5875
5878
|
},
|
|
5876
5879
|
// rootMargin: top offset ~100px (fixed header), bottom -80% (early switch)
|
|
5877
|
-
{ rootMargin: "-100px 0% -80% 0%" }
|
|
5880
|
+
{ root, rootMargin: "-100px 0% -80% 0%" }
|
|
5878
5881
|
);
|
|
5879
5882
|
for (const id of itemIds) {
|
|
5880
5883
|
const el = document.getElementById(id);
|
|
5881
5884
|
if (el) observer.observe(el);
|
|
5882
5885
|
}
|
|
5883
5886
|
return () => observer.disconnect();
|
|
5884
|
-
}, [itemIds]);
|
|
5887
|
+
}, [itemIds, scrollContainerRef]);
|
|
5885
5888
|
const handleClick = useCallback(
|
|
5886
5889
|
(e, id) => {
|
|
5887
|
-
var _a;
|
|
5888
5890
|
e.preventDefault();
|
|
5889
|
-
|
|
5891
|
+
const target = document.getElementById(id);
|
|
5892
|
+
if (!target) return;
|
|
5893
|
+
target.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
5890
5894
|
},
|
|
5891
5895
|
[]
|
|
5892
5896
|
);
|
|
@@ -5903,19 +5907,35 @@ function TableOfContents({
|
|
|
5903
5907
|
type: "hover"
|
|
5904
5908
|
}, scrollAreaProps), {
|
|
5905
5909
|
className: cn("flex-1 min-h-0", scrollAreaProps == null ? void 0 : scrollAreaProps.className),
|
|
5906
|
-
children: /* @__PURE__ */ jsx("ul", { className: "space-y-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
"
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5910
|
+
children: /* @__PURE__ */ jsx("ul", { className: "space-y-2 pr-4", children: items.map((item) => {
|
|
5911
|
+
var _a;
|
|
5912
|
+
const depth = (_a = item.depth) != null ? _a : 1;
|
|
5913
|
+
const isSubItem = depth > 1;
|
|
5914
|
+
return /* @__PURE__ */ jsx(
|
|
5915
|
+
"li",
|
|
5916
|
+
{
|
|
5917
|
+
className: cn(
|
|
5918
|
+
isSubItem && "pl-3.5 border-l border-m3-outline-variant/40 ml-1"
|
|
5919
|
+
),
|
|
5920
|
+
children: /* @__PURE__ */ jsx(
|
|
5921
|
+
"a",
|
|
5922
|
+
{
|
|
5923
|
+
href: `#${item.id}`,
|
|
5924
|
+
onClick: (e) => handleClick(e, item.id),
|
|
5925
|
+
"aria-current": activeId === item.id ? "true" : void 0,
|
|
5926
|
+
className: cn(
|
|
5927
|
+
"transition-colors hover:text-m3-primary block truncate",
|
|
5928
|
+
isSubItem ? "text-xs py-0.5 leading-relaxed" : "text-sm py-1 font-medium leading-snug",
|
|
5929
|
+
activeId === item.id ? "text-m3-primary font-bold" : "text-m3-on-surface-variant"
|
|
5930
|
+
),
|
|
5931
|
+
title: item.label,
|
|
5932
|
+
children: item.label
|
|
5933
|
+
}
|
|
5934
|
+
)
|
|
5935
|
+
},
|
|
5936
|
+
item.id
|
|
5937
|
+
);
|
|
5938
|
+
}) })
|
|
5919
5939
|
})
|
|
5920
5940
|
)
|
|
5921
5941
|
]
|