@pactor-app/chat 1.0.0 → 1.2.0

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/README.md CHANGED
@@ -21,7 +21,7 @@ import '@pactor-app/chat/styles.css';
21
21
  ## 示例
22
22
 
23
23
  ```tsx
24
- import { createShadcnComponentRegistry } from '@pactor-app/ui/components';
24
+ import { createComponentRegistry } from '@pactor-app/ui/components';
25
25
  import {
26
26
  ChatView,
27
27
  ConversationStore,
@@ -31,7 +31,7 @@ import {
31
31
 
32
32
  const store = new ConversationStore();
33
33
  // Safe Registry:LLM 生成的 DSL 只渲染白名单内的组件
34
- const safeRegistry = createSafeRegistry(createShadcnComponentRegistry(), [
34
+ const safeRegistry = createSafeRegistry(createComponentRegistry(), [
35
35
  'Statistic',
36
36
  'Card',
37
37
  ]);
@@ -78,6 +78,7 @@ driver.complete();
78
78
  - **`<AppShell sidebar brand? locationKey? className?>`**:应用外壳——侧栏插槽 + 主区。桌面(≥768px)侧栏与主区 flex 同行;移动端(<768px)侧栏退出文档流变为覆盖抽屉(遮罩 + 顶栏菜单按钮 + `brand` 品牌区),断点由 CSS 媒体查询表达,JS 只管开合。抽屉打开时 Escape / 遮罩点击关闭;`locationKey` 变化(路由 / 会话切换)渲染期自动关闭;移动端关闭时侧栏容器 `inert`。侧栏内容经 `useSidebarDrawer()` 取 `{ close }`(壳外返回 null),导航后可关闭抽屉。
79
79
  - **`registerChatLayout(layoutRegistry)`**:注册 `chat` 布局(header 标题区 + ChatView 区,V1 无会话历史侧栏),`resolveLayout(registry, 'chat')` 命中。
80
80
  - **`Chat` / `registerChatComponent(registry)`**:一等 DSL 聊天工作区组件,见下节。
81
+ - **`createChatComponentRegistry()`**:便捷工厂——创建含全部内置组件 + Chat / ChatShell 的组件注册表,直接作为 `createPactorApplication` 的 `componentRegistry` 选项。
81
82
  - **`createChatWorkspace(services)`**:React 直连路径的工作区工厂(内部与 Chat 共用同一组合),见下文「DSL 页面:createChatWorkspace」。
82
83
 
83
84
  ## Chat:一等 DSL 组件