@robert-stackflow/oneui 0.6.42 → 0.6.43
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
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ Section 支持 headingLevel(2–6,默认 2)和 contentLayout="settings";
|
|
|
89
89
|
|
|
90
90
|
## 阅读与反馈(0.6.13 候选)
|
|
91
91
|
|
|
92
|
-
`TableOfContents`
|
|
92
|
+
`TableOfContents` 可通过 `scrollable={false}` 交由外层容器滚动,避免嵌套滚动条。使用 `contentRef` 发现标题,或接收 `{id,label,level?}[]`。`variant="tree"` 使用层级路径、高亮可见标题范围和沿路径移动的定位点;几何只在尺寸变化时测量,滚动由 IntersectionObserver 更新状态。设计参考 [Fumadocs TOC](https://github.com/fuma-nama/fumadocs/blob/dev/packages/base-ui/src/components/toc/default.tsx)。`variant="rail"` 是独立的沉浸式样式,只标记当前阅读位置,短线 hover 有局部伸展,旁边的卡片使用无层级、无编号的平面目录。短线本身是可点击的原生锚点链接。`hoverMode="single" | "nearby" | "all"` 控制悬浮卡片展示当前标题与摘要、附近目录或全部目录,`previewCount`(默认 5)控制附近目录的总条数,`depthBasedLength` 可按层级改变短线基准长度。显式 items 可提供 `description`,自动发现时提取标题后的段落摘要。浮层跟随当前 hover 的短线定位,支持自动定位、键盘焦点、Escape、视口翻转及全局滚动条;不会接管正文之外的滚动。
|
|
93
93
|
|
|
94
94
|
`Table`、`DataTable`、`TreeTable`、`TableMarkup` 共用 `TableAppearance`:`striped`、`density="comfortable" | "compact"`、`hoverable`、`bordered`、`stickyHeader`。选中行优先于交替行和 hover,层级表格只保留一层外框。
|
|
95
95
|
|
package/components/Lightbox.js
CHANGED
|
@@ -501,14 +501,7 @@ function Lightbox(props) {
|
|
|
501
501
|
);
|
|
502
502
|
}
|
|
503
503
|
),
|
|
504
|
-
status === "loading" && /* @__PURE__ */ jsx("div", { className: s.feedback, role: "status", "aria-label": t.loading, children: /* @__PURE__ */ jsx(
|
|
505
|
-
Skeleton,
|
|
506
|
-
{
|
|
507
|
-
width: "min(55vw, 560px)",
|
|
508
|
-
height: "min(45vh, 360px)",
|
|
509
|
-
rounded: true
|
|
510
|
-
}
|
|
511
|
-
) }),
|
|
504
|
+
status === "loading" && /* @__PURE__ */ jsx("div", { className: s.feedback, role: "status", "aria-label": t.loading, children: /* @__PURE__ */ jsx(Skeleton, { width: "min(55vw, 560px)", height: "min(45vh, 360px)" }) }),
|
|
512
505
|
status === "error" && /* @__PURE__ */ jsxs("div", { className: s.feedback, role: "status", children: [
|
|
513
506
|
/* @__PURE__ */ jsx("span", { children: t.error }),
|
|
514
507
|
/* @__PURE__ */ jsx(
|
|
@@ -20,6 +20,8 @@ export type TableOfContentsProps = {
|
|
|
20
20
|
onActiveChange?(id: string): void;
|
|
21
21
|
maxLevel?: number;
|
|
22
22
|
scrollOffset?: number;
|
|
23
|
+
/** Disable internal scrolling when a containing panel owns the scroll area. */
|
|
24
|
+
scrollable?: boolean;
|
|
23
25
|
className?: string;
|
|
24
26
|
};
|
|
25
|
-
export declare function TableOfContents({ items, contentRef, variant, hoverMode, railLayout, popoverSide, previewCount, depthBasedLength, label, activeId, onActiveChange, maxLevel, scrollOffset, className, }: TableOfContentsProps): import("react").JSX.Element | null;
|
|
27
|
+
export declare function TableOfContents({ items, contentRef, variant, hoverMode, railLayout, popoverSide, previewCount, depthBasedLength, label, activeId, onActiveChange, maxLevel, scrollOffset, scrollable, className, }: TableOfContentsProps): import("react").JSX.Element | null;
|
|
@@ -31,6 +31,7 @@ function TableOfContents({
|
|
|
31
31
|
onActiveChange,
|
|
32
32
|
maxLevel = 4,
|
|
33
33
|
scrollOffset = 24,
|
|
34
|
+
scrollable = true,
|
|
34
35
|
className = ""
|
|
35
36
|
}) {
|
|
36
37
|
const id = useId();
|
|
@@ -276,7 +277,7 @@ function TableOfContents({
|
|
|
276
277
|
/* @__PURE__ */ jsx(ListFilter, { size: 16, "aria-hidden": "true" }),
|
|
277
278
|
label
|
|
278
279
|
] }),
|
|
279
|
-
/* @__PURE__ */ jsx("div", { className: s.scroll
|
|
280
|
+
/* @__PURE__ */ jsx("div", { className: `${s.scroll} ${scrollable ? "" : s.unconstrained}`, children: /* @__PURE__ */ jsx("div", { ref: list, className: s.flatList, children: previewEntries.map((entry) => /* @__PURE__ */ jsx(
|
|
280
281
|
"a",
|
|
281
282
|
{
|
|
282
283
|
className: s.flatLink,
|
|
@@ -305,7 +306,7 @@ function TableOfContents({
|
|
|
305
306
|
/* @__PURE__ */ jsx(ListFilter, { size: 16, "aria-hidden": "true" }),
|
|
306
307
|
label
|
|
307
308
|
] }),
|
|
308
|
-
/* @__PURE__ */ jsx("div", { className: s.scroll
|
|
309
|
+
/* @__PURE__ */ jsx("div", { className: `${s.scroll} ${scrollable ? "" : s.unconstrained}`, children: /* @__PURE__ */ jsxs("div", { className: s.list, ref: list, children: [
|
|
309
310
|
/* @__PURE__ */ jsx(
|
|
310
311
|
"svg",
|
|
311
312
|
{
|