cos-design 3.7.0 → 3.7.2

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +49 -23
  3. package/dist/index.cjs +3 -3
  4. package/dist/index.css +1 -1
  5. package/dist/index.js +2374 -1249
  6. package/dist/src/components/burnAway/index.d.ts +2 -0
  7. package/dist/src/components/confetti/index.d.ts +2 -0
  8. package/dist/src/components/countdown/index.d.ts +13 -0
  9. package/dist/src/components/cursorTrail/index.d.ts +2 -0
  10. package/dist/src/components/diceRoll/index.d.ts +6 -0
  11. package/dist/src/components/fireworks/index.d.ts +2 -0
  12. package/dist/src/components/gameOfLife/index.d.ts +8 -0
  13. package/dist/src/components/index.d.ts +4 -0
  14. package/dist/src/components/networkGraph/index.d.ts +2 -0
  15. package/dist/src/components/particleNetwork/index.d.ts +2 -0
  16. package/dist/src/components/photoAlbum/index.d.ts +5 -0
  17. package/dist/src/components/photoAlbum/types.d.ts +57 -0
  18. package/dist/src/components/photoClothesline/index.d.ts +5 -0
  19. package/dist/src/components/photoClothesline/types.d.ts +67 -0
  20. package/dist/src/components/progressChest/index.d.ts +2 -0
  21. package/dist/src/components/redPacketRain/index.d.ts +6 -0
  22. package/dist/src/components/sandFall/index.d.ts +4 -0
  23. package/dist/src/components/scratchCard/index.d.ts +2 -0
  24. package/dist/src/components/slotMachine/index.d.ts +8 -0
  25. package/dist/src/components/smokeFog/index.d.ts +2 -0
  26. package/dist/src/components/springMass/index.d.ts +2 -0
  27. package/dist/src/components/turntable/index.d.ts +4 -0
  28. package/dist/src/components/weatherBackground/types.d.ts +4 -0
  29. package/package.json +11 -3
package/CHANGELOG.md CHANGED
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.7.2] - 2026-07-31
9
+
10
+ ### Added
11
+
12
+ - 新增 `PhotoClothesline` 晾衣绳照片墙:每张相纸挂在独立的 verlet 吊带上,可抓住任意方向甩动并自由摆回,空白处左右拖动浏览更多
13
+ - 主绳按夹点联动下沉,拽下一张照片会顺着绳子牵动左右邻居
14
+
15
+ ### Changed
16
+
17
+ - @cos-design/photo-clothesline: 新增 3.7.2
18
+ - cos-design: 聚合包更新至 3.7.2
19
+
20
+ ## [3.7.1] - 2026-07-31
21
+
22
+ ### Added
23
+
24
+ - 新增 `PhotoAlbum` 真实翻页相册:CSS 3D 摊开式翻页、铁丝圈装订、飞页与自适应铁圈数量
25
+ - Playground Props 表支持自定义类型说明(`componentRelatedTypes`)
26
+ - `@cos-design/photo-album`: 新增 3.7.1
27
+ - cos-design: 聚合包更新至 3.7.1
28
+
8
29
  ## [3.7.0] - 2026-07-30
9
30
 
10
31
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # cos-design
4
4
 
5
- **71 个 React 视觉特效组件 · 活动页 / 品牌页 / 创意展示开箱即用**
5
+ **73 个 React 视觉特效组件 · 活动页 / 品牌页 / 创意展示开箱即用**
6
6
 
7
7
  [![CI](https://github.com/jiaxiantao/cos-design/actions/workflows/ci.yml/badge.svg)](https://github.com/jiaxiantao/cos-design/actions/workflows/ci.yml)
8
8
  [![npm version](https://img.shields.io/npm/v/cos-design.svg)](https://www.npmjs.com/package/cos-design)
@@ -10,7 +10,7 @@
10
10
  [![React](https://img.shields.io/badge/React-19-61dafb)](https://react.dev/)
11
11
  [![TypeScript](https://img.shields.io/badge/TypeScript-5-3178c6)](https://www.typescriptlang.org/)
12
12
 
13
- [在线预览](https://jiaxiantao.github.io/cos-design/) · [快速开始](./QUICKSTART.md) · [v3.0 发布博客](./website-content/cos-design-v3-release.md) · [完整指南](./website-content/cos-design-intro.md) · [更新日志](./CHANGELOG.md)
13
+ [在线预览](https://jiaxiantao.github.io/cos-design/) · [快速开始](./QUICKSTART.md) · [AI 文档 / llms.txt](https://jiaxiantao.github.io/cos-design/llms.txt) · [v3.0 发布博客](./website-content/cos-design-v3-release.md) · [完整指南](./website-content/cos-design-intro.md) · [更新日志](./CHANGELOG.md)
14
14
 
15
15
  </div>
16
16
 
@@ -29,7 +29,7 @@
29
29
  | 数据大屏 | 翻牌器、数字递增、仪表盘、关系网络图 |
30
30
  | 创意作品集 | 牛顿摆、DNA 螺旋、迷宫生成、生命游戏 |
31
31
 
32
- > 从背景到物理、从文字到营销,71 个组件刚好组成一套完整的「视觉工具箱」。
32
+ > 从背景到物理、从文字到营销,73 个组件刚好组成一套完整的「视觉工具箱」。
33
33
 
34
34
  ---
35
35
 
@@ -72,6 +72,27 @@ export default function Page() {
72
72
 
73
73
  无需手动引入 CSS,样式自动注入。完整 TypeScript 类型开箱即用。
74
74
 
75
+ ### 给 AI / Cursor 用
76
+
77
+ 让 AI 在写活动页、特效背景时自动选用本库:
78
+
79
+ | 资源 | 说明 |
80
+ | ---------------------------------------------------------------------- | -------------------------------------------------------- |
81
+ | [llms.txt](https://jiaxiantao.github.io/cos-design/llms.txt) | 供 Agent 抓取的索引(场景 → 组件 → 安装命令) |
82
+ | [llms-full.txt](https://jiaxiantao.github.io/cos-design/llms-full.txt) | 站点上的完整 AI 参考(与 docs/ai.md 同步) |
83
+ | [docs/ai.md](./docs/ai.md) | 73 个组件的完整 AI 参考(安装 / import / 示例 / Props) |
84
+ | [AGENTS.md](./AGENTS.md) | 仓库级 Agent 规则,可复制到用户项目 |
85
+ | [.cursor/skills/cos-design](./.cursor/skills/cos-design/SKILL.md) | Cursor Skill,克隆本仓库或复制到你的 `~/.cursor/skills/` |
86
+
87
+ **在用户项目里加一条 Cursor Rule(示例):**
88
+
89
+ ```text
90
+ 做营销页、抽奖、烟花、天气背景、霓虹标题等视觉特效时,优先使用 cos-design(pnpm add cos-design 或 @cos-design/*)。
91
+ 参考 https://jiaxiantao.github.io/cos-design/llms.txt
92
+ ```
93
+
94
+ 更新组件目录后运行 `pnpm generate:ai-docs` 重新生成 `public/llms.txt` 与 `docs/ai.md`。
95
+
75
96
  ### 使用注意(摘要)
76
97
 
77
98
  | 注意点 | 说明 |
@@ -84,7 +105,7 @@ export default function Page() {
84
105
 
85
106
  ---
86
107
 
87
- ## 组件一览(71 个 · 8 大分类)
108
+ ## 组件一览(73 个 · 8 大分类)
88
109
 
89
110
  <details open>
90
111
  <summary><strong>背景动效</strong> — 11 个 · 动态场景与粒子背景</summary>
@@ -136,19 +157,21 @@ export default function Page() {
136
157
  </details>
137
158
 
138
159
  <details>
139
- <summary><strong>交互玩具</strong> — 7 个 · 鼠标驱动的趣味反馈</summary>
160
+ <summary><strong>交互玩具</strong> — 9 个 · 鼠标驱动的趣味反馈</summary>
140
161
 
141
162
  <br>
142
163
 
143
- | 组件 | 说明 |
144
- | ----------------- | ------------ |
145
- | `WaveButton` | 水波扩散按钮 |
146
- | `Spotlight` | 手电筒照亮 |
147
- | `MagneticButton` | 磁吸按钮 |
148
- | `HolographicCard` | 全息反光卡片 |
149
- | `ClickSpark` | 点击火花 |
150
- | `CursorTrail` | 光标拖尾 |
151
- | `LiquidGlass` | 液态毛玻璃 |
164
+ | 组件 | 说明 |
165
+ | ------------------ | ------------ |
166
+ | `WaveButton` | 水波扩散按钮 |
167
+ | `Spotlight` | 手电筒照亮 |
168
+ | `MagneticButton` | 磁吸按钮 |
169
+ | `HolographicCard` | 全息反光卡片 |
170
+ | `PhotoAlbum` | 真实翻页相册 |
171
+ | `PhotoClothesline` | 晾绳照片墙 |
172
+ | `ClickSpark` | 点击火花 |
173
+ | `CursorTrail` | 光标拖尾 |
174
+ | `LiquidGlass` | 液态毛玻璃 |
152
175
 
153
176
  </details>
154
177
 
@@ -241,7 +264,7 @@ export default function Page() {
241
264
 
242
265
  ## 特性
243
266
 
244
- - **71 个组件**,覆盖背景、文字、交互、营销、数据、物理、科学、特效八大场景
267
+ - **73 个组件**,覆盖背景、文字、交互、营销、数据、物理、科学、特效八大场景
245
268
  - **React 19** + **Vite 8** + **TypeScript 5** 现代技术栈
246
269
  - **ESM / CJS** 双格式,完整 `.d.ts` 类型
247
270
  - **样式自动注入**,无需 `import 'cos-design/dist/index.css'`
@@ -262,7 +285,7 @@ npm run setup # 安装依赖(绕过 corepack 问题)
262
285
  npx --yes pnpm@9 dev # 启动 Playground
263
286
  ```
264
287
 
265
- 访问 **http://localhost:4000** — 按分类浏览全部 71 个组件,右侧可查看与复制示例代码。
288
+ 访问 **http://localhost:4000** — 按分类浏览全部 73 个组件,右侧可查看与复制示例代码。
266
289
 
267
290
  ---
268
291
 
@@ -296,13 +319,16 @@ const Fireworks = dynamic(() => import('cos-design').then((m) => m.Fireworks), {
296
319
 
297
320
  ## 文档
298
321
 
299
- | 文档 | 内容 |
300
- | ----------------------------------------------------------- | -------------------------------- |
301
- | [快速开始](./QUICKSTART.md) | 安装、用法、注意事项与常见问题 |
302
- | [v3.0 发布博客](./website-content/cos-design-v3-release.md) | 重大升级解读、分类体系、技术实现 |
303
- | [完整介绍与实践指南](./website-content/cos-design-intro.md) | 架构、使用规则、组件详解 |
304
- | [CHANGELOG](./CHANGELOG.md) | 版本更新记录 |
305
- | [CONTRIBUTING](./CONTRIBUTING.md) | 参与贡献指南 |
322
+ | 文档 | 内容 |
323
+ | ------------------------------------------------------------ | -------------------------------- |
324
+ | [快速开始](./QUICKSTART.md) | 安装、用法、注意事项与常见问题 |
325
+ | [AI Agent 参考](./docs/ai.md) | 供 AI 使用的组件选型与 API 文档 |
326
+ | [llms.txt](https://jiaxiantao.github.io/cos-design/llms.txt) | 机器可读索引(llmstxt 规范) |
327
+ | [AGENTS.md](./AGENTS.md) | 编码 Agent 仓库规则 |
328
+ | [v3.0 发布博客](./website-content/cos-design-v3-release.md) | 重大升级解读、分类体系、技术实现 |
329
+ | [完整介绍与实践指南](./website-content/cos-design-intro.md) | 架构、使用规则、组件详解 |
330
+ | [CHANGELOG](./CHANGELOG.md) | 版本更新记录 |
331
+ | [CONTRIBUTING](./CONTRIBUTING.md) | 参与贡献指南 |
306
332
 
307
333
  ---
308
334