@zero-library/common 2.3.12 → 2.4.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 +43 -0
- package/dist/index.cjs.js +192 -255
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +0 -92
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +61 -56
- package/dist/index.d.ts +61 -56
- package/dist/index.esm.js +164 -225
- package/dist/index.esm.js.map +1 -1
- package/package.json +14 -2
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @zero-library/common
|
|
2
|
+
|
|
3
|
+
通用组件、Hooks 与工具函数集合包。用于在业务项目与其它组件库(如 chat-agent)中复用基础能力。
|
|
4
|
+
|
|
5
|
+
该文档只维护稳定信息(安装、入口、模块边界、开发方式)。所有具体 API 以源码类型与注释为准,避免重复维护导致漂移。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @zero-library/common
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
样式(建议在应用入口引入一次):
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import '@zero-library/common/style'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 导出结构
|
|
20
|
+
|
|
21
|
+
包入口:[src/index.ts](file:///c:/work/lgbh/zero-library/packages/common/src/index.ts)
|
|
22
|
+
|
|
23
|
+
- components:UI 组件集合(文件预览、Markdown 编辑、渲染控制等)
|
|
24
|
+
- hooks:通用 hooks(WebSocket、iframe bridge、valtio context 等)
|
|
25
|
+
- utils:工具函数与基础能力(request/storage/is/date 等)
|
|
26
|
+
|
|
27
|
+
## 开发
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm --filter=common run build
|
|
31
|
+
pnpm --filter=common run dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
目录结构:
|
|
35
|
+
|
|
36
|
+
- src/components:组件集合与入口导出
|
|
37
|
+
- src/hooks:hooks 集合与入口导出
|
|
38
|
+
- src/utils:工具函数与基础能力
|
|
39
|
+
|
|
40
|
+
注意事项:
|
|
41
|
+
|
|
42
|
+
- 样式需显式引入 `@zero-library/common/style`
|
|
43
|
+
- 目前以单入口聚合导出为主;如需更细粒度按需分发,可在构建与 exports 层做进一步拆分(结构性改造)
|