@wisdomgarden/torque-knowledge 1.0.8 → 1.0.10

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/.meta.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "knowledge": "1.0.8",
3
- "torque": "0.2.3",
4
- "generatedAt": "2026-09-28T09:01:40.077Z"
2
+ "knowledge": "1.0.10",
3
+ "torque": "0.3.3",
4
+ "generatedAt": "2026-10-20T03:14:55.281Z"
5
5
  }
Binary file
@@ -6,7 +6,7 @@ keywords: torque, component, ui, mantine, layout, button, icon-button, link-butt
6
6
 
7
7
  # Torque UI 组件库
8
8
 
9
- > 由 `@wisdomgarden/torque-knowledge@1.0.8` 生成,对应 `@wisdomgarden/torque@0.2.3`。
9
+ > 由 `@wisdomgarden/torque-knowledge@1.0.10` 生成,对应 `@wisdomgarden/torque@0.3.3`。
10
10
  > 不要手改 —— 它是 npm 包解包出来的,下次装依赖就被覆盖。
11
11
 
12
12
  ## 导入方式
@@ -40,13 +40,11 @@ Server Component 序列化不了。
40
40
  | 自定义点击区(整卡可点、图片热区) | `UnstyledButton` |
41
41
  | 有明确按钮样式变体 | `Button`;纯图标 `IconButton`;跳转 `LinkButton` / `LinkIconButton` |
42
42
 
43
- `Box` 替代 `<div>`;`Text` 替代 `<span>` / `<p>`,用 `component` 选语义标签
44
- (`h1`–`h6` / `p` / `span`);`UnstyledButton` 替代 `<button>`。
45
- `Paper` 不参与布局 —— 内部要排版就在里面嵌 `Flex` / `Group` / `Stack`。
43
+ `Box` / `Text` / `UnstyledButton` 分别替代裸 `<div>`、文本标签、`<button>`;
44
+ `Text.component` 选语义标签。`Paper` 只管表面,内部排版用布局组件。
46
45
 
47
- `Group` / `Stack` 是 `Flex` 的预设,只是默认值不同:`Group` = `align: center` +
48
- `wrap` + `gap: md`;`Stack` = `align: stretch` + `nowrap` + `gap: md`;
49
- `Flex` = `align: stretch` + `nowrap` + 无 gap。**默认值合适就别用 `Flex`。**
46
+ `Group` / `Stack` 是 `Flex` 的预设:默认分别为 `center` + `wrap` + `gap: md`
47
+ 和 `stretch` + `nowrap` + `gap: md`;`Flex` 默认无 gap。**优先用预设。**
50
48
 
51
49
  **下拉与选择** —— 标准表单字段用 `Select`(单选)/ `MultiSelect`(多选,值是
52
50
  `string[]`);要自定义触发器外观或富选项内容(头像、标签)才用 `Combobox`;
@@ -59,6 +57,8 @@ Server Component 序列化不了。
59
57
  侧边抽屉优先指令式 `drawers.open()`,需要复杂局部状态联动才用声明式 `<Drawer>`;
60
58
  移动端底部抽屉用 `BottomDrawer`(**只在移动端**);悬停提示 `Tooltip`;
61
59
  需要交互内容的浮层 `Popover`;操作菜单 `Menu`。
60
+ 对话框:事件中打开用 `modals.open()` / `openConfirmModal()`;局部受控用 `<Modal>`;
61
+ 自定义结构或全屏用 `Modal.Root`。新代码不用 `ModalDeprecated`。
62
62
 
63
63
  **多态(`component` prop)** —— 自建布局组件**只接受 HTML 标签字符串**,Server 和
64
64
  Client Component 都安全。Mantine 的 `component={ReactComponent}` 只能在 Client
@@ -80,7 +80,7 @@ Component 里用(函数跨 Server/Client 边界无法序列化)。
80
80
  | popover | `Popover`, `PopoverTarget`, `PopoverDropdown` |
81
81
  | drawer | `Drawer`, `DrawerManager`, `drawers` |
82
82
  | bottom-drawer | `BottomDrawer` |
83
- | modal | `Modal` |
83
+ | modal | `Modal`, `ModalRoot`, `ModalBody`, `ModalTitle` |
84
84
  | modal-deprecated | `ModalDeprecated` |
85
85
  | overlay-layer | `useOverlayLayer`, `OVERLAY_BASE`, `OVERLAY_TOP_MIN`, `OverlayTierScope` |
86
86
  | menu | `Menu` |
@@ -148,6 +148,8 @@ Component 里用(函数跨 Server/Client 边界无法序列化)。
148
148
 
149
149
  ### 浮层与移动端
150
150
 
151
+ - **命令式 `modals` 须在根部挂一次 `ModalManager`**;`open()` 返回 id,
152
+ `close(id)` 定向关闭,`closeAll()` 全关;确认 / 取消先关弹窗再调用回调。
151
153
  - **`DataFilter` 里的下拉控件(`Select` / `MultiSelect` / `TreeSelect` / `DatePicker`)
152
154
  保持 `withinPortal` 默认的 `true`,不要设 `false`** —— 设了下拉层会被 DataFilter 的
153
155
  滚动容器裁剪。嵌套浮层的层级与关闭规则由 `overlay-layer` 统一处理。
@@ -163,10 +165,9 @@ Component 里用(函数跨 Server/Client 边界无法序列化)。
163
165
  再放交互元素会触发 a11y 的 `nested-interactive` 违规。
164
166
  - **不要给 `Filter` / `IconFilter` 的 `buttonProps` / `iconButtonProps` 传 `onClick`**,
165
167
  会覆盖内置的弹层开关,导致弹不出来。
166
- - **`Popover` 的三个静默陷阱**:受控(传了 `opened`)漏传 `onOpenChange`,所有内部触发连同两个
167
- hover 延迟一起失效(`trigger="none"` 除外,开发环境有 warn);开关按钮在浮层外时要
168
- `closeOnClickOutside={false}`,否则 `mousedown` 捕获阶段的关闭早于按钮自己的 `click`;子元素上
169
- 与 `trigger` 同名的 handler 会被 `Popover.Target` 覆盖丢弃,要保留就传给 `<Popover.Target>` 自身。
168
+ - **`Popover` 三个陷阱**:受控时须传 `onOpenChange`(`trigger="none"` 除外);
169
+ 外部开关按钮须设 `closeOnClickOutside={false}`,避免 mousedown 先关、click 又打开;
170
+ 子元素上与 `trigger` 同名的 handler 须传给 `<Popover.Target>`,否则会被覆盖。
170
171
 
171
172
  ### 文本与截断
172
173
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wisdomgarden/torque-knowledge",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Machine-readable knowledge artifact for @wisdomgarden/torque — component catalog (SQLite) and AI coding rules (Markdown). Consumed by CI code review and local AI tooling, not by application runtime.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",