cos-design 3.7.11 → 3.8.1

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 (30) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +13 -8
  3. package/dist/index.cjs +159 -3
  4. package/dist/index.css +1 -1
  5. package/dist/index.js +4461 -2013
  6. package/dist/src/components/auroraVeil/index.d.ts +19 -0
  7. package/dist/src/components/dandelionField/constants.d.ts +72 -0
  8. package/dist/src/components/dandelionField/draw.d.ts +33 -0
  9. package/dist/src/components/dandelionField/frame-cache.d.ts +22 -0
  10. package/dist/src/components/dandelionField/index.d.ts +5 -0
  11. package/dist/src/components/dandelionField/plant.d.ts +106 -0
  12. package/dist/src/components/dandelionField/scene.d.ts +13 -0
  13. package/dist/src/components/dandelionField/seed.d.ts +15 -0
  14. package/dist/src/components/dandelionField/types.d.ts +193 -0
  15. package/dist/src/components/dandelionField/utils.d.ts +18 -0
  16. package/dist/src/components/index.d.ts +10 -0
  17. package/dist/src/components/inkBloom/index.d.ts +21 -0
  18. package/dist/src/components/lavaBubble/gl.d.ts +3 -0
  19. package/dist/src/components/lavaBubble/index.d.ts +24 -0
  20. package/dist/src/components/lavaBubble/shaders.d.ts +2 -0
  21. package/dist/src/components/lavaBubble/sim.d.ts +60 -0
  22. package/dist/src/components/soapBubbles/draw-bubble.d.ts +20 -0
  23. package/dist/src/components/soapBubbles/film.d.ts +8 -0
  24. package/dist/src/components/soapBubbles/index.d.ts +20 -0
  25. package/dist/src/components/soapBubbles/lighting.d.ts +34 -0
  26. package/dist/src/components/soapBubbles/merge.d.ts +50 -0
  27. package/dist/src/components/soapBubbles/sky.d.ts +2 -0
  28. package/dist/src/components/soapBubbles/types.d.ts +40 -0
  29. package/dist/src/components/soapBubbles/utils.d.ts +12 -0
  30. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.8.1] - 2026-09-01
11
+
12
+ ### Added
13
+
14
+ - AI:`docs/campaign-recipes-ai.md` 活动页组合配方(签到抽奖 / 刮刮乐庆祝 / 服务端转盘);`llms.txt` / `docs/ai.md` 同步 Campaign recipes 章节
15
+ - Playwright smoke:ScratchCard 刮开、SlotMachine 旋转、Confetti 挂载
16
+ - ScratchCard:`data-testid="scratch-card-canvas"` 与 `aria-label`
17
+
18
+ ### Changed
19
+
20
+ - `Turntable` / `SlotMachine` / `NineGrid`:`prefers-reduced-motion: reduce` 时跳过旋转动画,直接展示结果
21
+ - Context7 rules 补充 campaign-recipes 与抽奖 reduced-motion 约定;`verify:context7` optional markers 扩展
22
+ - CONTRIBUTING 增加工程质量清单;AGENTS / Cursor Skill 指向 campaign-recipes-ai
23
+ - @cos-design/nine-grid: 3.7.10 → 3.7.11
24
+ - @cos-design/scratch-card: 3.5.4 → 3.5.5
25
+ - @cos-design/slot-machine: 3.5.6 → 3.5.7
26
+ - @cos-design/turntable: 3.5.6 → 3.5.7
27
+ - cos-design: 聚合包更新至 3.8.1
28
+
29
+ ## [3.8.0] - 2026-08-31
30
+
31
+ ### Added
32
+
33
+ - 背景动效:`AuroraVeil`(极光帷幕)、`DandelionField`(蒲公英播种)、`LavaBubble`(熔岩泡)、`InkBloom`(墨染清水)、`SoapBubbles`(肥皂泡)
34
+ - 对应 `@cos-design/*` 分包与 Playground 演示;Playwright smoke 覆盖新组件 canvas 挂载
35
+ - `@cos-design/shared`:`softSat` 等数学工具导出
36
+
37
+ ### Changed
38
+
39
+ - `DandelionField`:模块化拆分(scene / plant / seed / draw)与帧级性能优化(植株几何缓存、附着种子计数)
40
+ - cos-design: 聚合包更新至 3.8.0(91 components)
41
+
10
42
  ## [3.7.11] - 2026-08-27
11
43
 
12
44
  ### Removed
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  # cos-design
4
4
 
5
- **86 React visual-effect components** for marketing pages, brand landings, and creative showcases
6
- **86 个 React 视觉特效组件 · 活动页 / 品牌页 / 创意展示开箱即用**
5
+ **91 React visual-effect components** for marketing pages, brand landings, and creative showcases
6
+ **91 个 React 视觉特效组件 · 活动页 / 品牌页 / 创意展示开箱即用**
7
7
 
8
8
  [![CI](https://github.com/jiaxiantao/cos-design/actions/workflows/ci.yml/badge.svg)](https://github.com/jiaxiantao/cos-design/actions/workflows/ci.yml)
9
9
  [![npm version](https://img.shields.io/npm/v/cos-design.svg)](https://www.npmjs.com/package/cos-design)
@@ -63,7 +63,7 @@ export function Campaign() {
63
63
  | 数据大屏 | 翻牌器、数字递增、仪表盘、关系网络图 |
64
64
  | 创意作品集 | 牛顿摆、DNA 螺旋、迷宫生成、生命游戏 |
65
65
 
66
- > 从背景到物理、从文字到营销,86 个组件刚好组成一套完整的「视觉工具箱」。
66
+ > 从背景到物理、从文字到营销,91 个组件刚好组成一套完整的「视觉工具箱」。
67
67
 
68
68
  ---
69
69
 
@@ -114,7 +114,7 @@ export default function Page() {
114
114
  | ---------------------------------------------------------------------- | ------------------------------------------------------- |
115
115
  | [llms.txt](https://jiaxiantao.github.io/cos-design/llms.txt) | 供 Agent 抓取的索引(场景 → 组件 → 安装命令) |
116
116
  | [llms-full.txt](https://jiaxiantao.github.io/cos-design/llms-full.txt) | 站点上的完整 AI 参考(与 docs/ai.md 同步) |
117
- | [docs/ai.md](./docs/ai.md) | 86 个组件的完整 AI 参考(安装 / import / 示例 / Props) |
117
+ | [docs/ai.md](./docs/ai.md) | 91 个组件的完整 AI 参考(安装 / import / 示例 / Props) |
118
118
  | [docs/examples/next-app-router.md](./docs/examples/next-app-router.md) | Next.js App Router 接入说明(SSR + fill) |
119
119
  | [examples/next-app](./examples/next-app) | 可运行 Next.js 示例(`pnpm install && pnpm dev`) |
120
120
  | [docs/ai-discovery.md](./docs/ai-discovery.md) | Context7 提交、校验、Cursor Skill 安装、项目 Rule 片段 |
@@ -154,10 +154,10 @@ Context7: /jiaxiantao/cos-design
154
154
 
155
155
  ---
156
156
 
157
- ## 组件一览(86 个 · 9 大分类)
157
+ ## 组件一览(91 个 · 9 大分类)
158
158
 
159
159
  <details open>
160
- <summary><strong>背景动效</strong> — 11 个 · 动态场景与粒子背景</summary>
160
+ <summary><strong>背景动效</strong> — 16 个 · 动态场景与粒子背景</summary>
161
161
 
162
162
  <br>
163
163
 
@@ -167,6 +167,11 @@ Context7: /jiaxiantao/cos-design
167
167
  | `RippleWater` | WebGL 水面涟漪 |
168
168
  | `SmokeFog` | 烟雾雾气飘动(支持点击驱散) |
169
169
  | `BubbleField` | 深海气泡上升 · 自动融合 · 鼠标扰动水流 |
170
+ | `SoapBubbles` | 肥皂泡天空 · 虹彩飘飞 · 点击爆裂 |
171
+ | `DandelionField` | 蒲公英播种 · 风吹绒毛 · 点击炸开重生 |
172
+ | `LavaBubble` | 熔岩泡 · 搅动岩浆 · 点击喷发 |
173
+ | `InkBloom` | 墨染清水 · 滴墨溶开 · 拖拽搅动 |
174
+ | `AuroraVeil` | 极光帷幕 · 鼠标弯曲光带 · 点击能量脉冲 |
170
175
  | `MatrixRain` | 黑客帝国数字雨 |
171
176
  | `MeteorRain` | 流星雨穿越 |
172
177
  | `ParticleNetwork` | 粒子连线网络(支持触摸) |
@@ -334,7 +339,7 @@ Context7: /jiaxiantao/cos-design
334
339
 
335
340
  ## 特性
336
341
 
337
- - **86 个组件**,覆盖背景、文字、图片、交互、营销、数据、物理、科学、特效九大场景
342
+ - **91 个组件**,覆盖背景、文字、图片、交互、营销、数据、物理、科学、特效九大场景
338
343
  - **React 19** + **Vite 8** + **TypeScript 5** 现代技术栈
339
344
  - **ESM / CJS** 双格式,完整 `.d.ts` 类型
340
345
  - **样式自动注入**,无需 `import 'cos-design/dist/index.css'`
@@ -355,7 +360,7 @@ npm run setup # 安装依赖(绕过 corepack 问题)
355
360
  npx --yes pnpm@9 dev # 启动 Playground
356
361
  ```
357
362
 
358
- 访问 **http://localhost:4000** — 按分类浏览全部 86 个组件,右侧可查看与复制示例代码。
363
+ 访问 **http://localhost:4000** — 按分类浏览全部 91 个组件,右侧可查看与复制示例代码。
359
364
 
360
365
  ---
361
366