@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
@@ -1,3 +1,8 @@
1
+ ## 0.6.43
2
+
3
+ - Lightbox 加载骨架保持矩形,避免百分比圆角形成椭圆。
4
+ - TableOfContents 新增 scrollable 属性,支持容器统一管理滚动区域。
5
+
1
6
  ## 0.6.42
2
7
 
3
8
  - Toast 采用轻叠卡片,支持数量按钮、悬停、键盘展开和 Escape 收起;展开按实际高度排列,保留独立关闭、原位更新与异步重试。
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` 使用 `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、视口翻转及全局滚动条;不会接管正文之外的滚动。
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
 
@@ -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, children: /* @__PURE__ */ jsx("div", { ref: list, className: s.flatList, children: previewEntries.map((entry) => /* @__PURE__ */ jsx(
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, children: /* @__PURE__ */ jsxs("div", { className: s.list, ref: list, children: [
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
  {
@@ -22,6 +22,10 @@
22
22
  position: relative;
23
23
  min-width: 0;
24
24
  }
25
+ .scroll.unconstrained {
26
+ max-height: none;
27
+ overflow: visible;
28
+ }
25
29
  .guides {
26
30
  position: absolute;
27
31
  left: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robert-stackflow/oneui",
3
- "version": "0.6.42",
3
+ "version": "0.6.43",
4
4
  "description": "OneUI React components, application shell and portable visual themes",
5
5
  "type": "module",
6
6
  "sideEffects": [