cos-design 3.7.1 → 3.7.3

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 (45) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +30 -8
  3. package/dist/index.cjs +3 -3
  4. package/dist/index.css +1 -1
  5. package/dist/index.js +5601 -2229
  6. package/dist/src/components/index.d.ts +24 -0
  7. package/dist/src/components/photoCarousel/index.d.ts +9 -0
  8. package/dist/src/components/photoCarousel/types.d.ts +47 -0
  9. package/dist/src/components/photoClothesline/constants.d.ts +44 -0
  10. package/dist/src/components/photoClothesline/index.d.ts +5 -0
  11. package/dist/src/components/photoClothesline/layout.d.ts +23 -0
  12. package/dist/src/components/photoClothesline/math.d.ts +6 -0
  13. package/dist/src/components/photoClothesline/model.d.ts +110 -0
  14. package/dist/src/components/photoClothesline/ropePath.d.ts +5 -0
  15. package/dist/src/components/photoClothesline/simulation.d.ts +46 -0
  16. package/dist/src/components/photoClothesline/types.d.ts +67 -0
  17. package/dist/src/components/photoFilmstrip/index.d.ts +5 -0
  18. package/dist/src/components/photoFilmstrip/types.d.ts +43 -0
  19. package/dist/src/components/photoFridge/index.d.ts +5 -0
  20. package/dist/src/components/photoFridge/types.d.ts +41 -0
  21. package/dist/src/components/photoLantern/accessories.d.ts +4 -0
  22. package/dist/src/components/photoLantern/constants.d.ts +5 -0
  23. package/dist/src/components/photoLantern/dispose.d.ts +4 -0
  24. package/dist/src/components/photoLantern/geometry.d.ts +5 -0
  25. package/dist/src/components/photoLantern/index.d.ts +5 -0
  26. package/dist/src/components/photoLantern/materials.d.ts +9 -0
  27. package/dist/src/components/photoLantern/scene.d.ts +32 -0
  28. package/dist/src/components/photoLantern/textures.d.ts +9 -0
  29. package/dist/src/components/photoLantern/types.d.ts +59 -0
  30. package/dist/src/components/photoLightbox/index.d.ts +5 -0
  31. package/dist/src/components/photoLightbox/types.d.ts +39 -0
  32. package/dist/src/components/photoPolaroid/index.d.ts +5 -0
  33. package/dist/src/components/photoPolaroid/types.d.ts +39 -0
  34. package/dist/src/components/photoPostcard/index.d.ts +8 -0
  35. package/dist/src/components/photoPostcard/types.d.ts +45 -0
  36. package/dist/src/components/photoPrism/index.d.ts +9 -0
  37. package/dist/src/components/photoPrism/types.d.ts +39 -0
  38. package/dist/src/components/photoScroll/index.d.ts +9 -0
  39. package/dist/src/components/photoScroll/types.d.ts +43 -0
  40. package/dist/src/components/photoTunnel/index.d.ts +9 -0
  41. package/dist/src/components/photoTunnel/types.d.ts +43 -0
  42. package/dist/src/components/photoViewMaster/index.d.ts +9 -0
  43. package/dist/src/components/photoViewMaster/types.d.ts +47 -0
  44. package/dist/src/components/slotMachine/index.d.ts +2 -0
  45. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,57 @@ 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.3] - 2026-08-03
9
+
10
+ ### Added
11
+
12
+ - 新增图片预览分类 `photo`,并将 `PhotoAlbum` / `PhotoLantern` / `PhotoClothesline` 归入该类
13
+ - 新增 `PhotoFilmstrip` 胶卷条:横向齿孔胶卷、拖拽惯性与整帧吸附
14
+ - 新增 `PhotoPolaroid` 拍立得堆:桌面散落、拖拽置顶、松手留位
15
+ - 新增 `PhotoLightbox` 灯箱透片:发光灯箱上横向拖出切换
16
+ - 新增 `PhotoCarousel` 旋转木马托盘:环形立照、拖拽环绕与空闲自转
17
+ - 新增 `PhotoPrism` 棱镜立方:CSS 3D 六面贴图、拖拽翻滚与空闲自转
18
+ - 新增 `PhotoScroll` 卷轴照片:中式手卷、横向拖拽惯性与整帧吸附
19
+ - 新增 `PhotoPostcard` 旅行明信片:正反面翻转、横向拖拽切换
20
+ - 新增 `PhotoViewMaster` 观景器圆盘:玩具圆盘旋转、惯性吸附与空闲自转
21
+ - 新增 `PhotoFridge` 冰箱磁贴墙:散落磁贴、拖拽置顶并留位
22
+ - 新增 `PhotoTunnel` 纵深隧道:Z 轴穿行、惯性吸附与景深虚化
23
+ - 新增 `PhotoLantern` 走马灯图片预览:基于 Three.js 的六面灯笼、空闲顺时针自转、拖拽跟手旋转与惯性、灯芯暖光自然摆动
24
+
25
+ ### Changed
26
+
27
+ - `PhotoLantern` 由 CSS 3D 改为 Three.js 实现,立体感与光照更真实;`three` 为 peer 依赖
28
+ - `PhotoClothesline` 拆分为 layout / simulation 等模块,交互与视觉保持不变
29
+ - `SlotMachine` 支持 `spinDuration`,并加固滚轮错峰停轮
30
+ - `Turntable` 小幅交互修正
31
+ - @cos-design/photo-carousel: 新增 3.7.3
32
+ - @cos-design/photo-clothesline: 3.7.2 → 3.7.3
33
+ - @cos-design/photo-filmstrip: 新增 3.7.3
34
+ - @cos-design/photo-fridge: 新增 3.7.3
35
+ - @cos-design/photo-lantern: 新增 3.7.3
36
+ - @cos-design/photo-lightbox: 新增 3.7.3
37
+ - @cos-design/photo-polaroid: 新增 3.7.3
38
+ - @cos-design/photo-postcard: 新增 3.7.3
39
+ - @cos-design/photo-prism: 新增 3.7.3
40
+ - @cos-design/photo-scroll: 新增 3.7.3
41
+ - @cos-design/photo-tunnel: 新增 3.7.3
42
+ - @cos-design/photo-view-master: 新增 3.7.3
43
+ - @cos-design/slot-machine: 3.5.3 → 3.5.4
44
+ - @cos-design/turntable: 3.5.3 → 3.5.4
45
+ - cos-design: 聚合包更新至 3.7.3
46
+
47
+ ## [3.7.2] - 2026-07-31
48
+
49
+ ### Added
50
+
51
+ - 新增 `PhotoClothesline` 晾衣绳照片墙:每张相纸挂在独立的 verlet 吊带上,可抓住任意方向甩动并自由摆回,空白处左右拖动浏览更多
52
+ - 主绳按夹点联动下沉,拽下一张照片会顺着绳子牵动左右邻居
53
+
54
+ ### Changed
55
+
56
+ - @cos-design/photo-clothesline: 新增 3.7.2
57
+ - cos-design: 聚合包更新至 3.7.2
58
+
8
59
  ## [3.7.1] - 2026-07-31
9
60
 
10
61
  ### Added
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # cos-design
4
4
 
5
- **72 个 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)
@@ -29,7 +29,7 @@
29
29
  | 数据大屏 | 翻牌器、数字递增、仪表盘、关系网络图 |
30
30
  | 创意作品集 | 牛顿摆、DNA 螺旋、迷宫生成、生命游戏 |
31
31
 
32
- > 从背景到物理、从文字到营销,72 个组件刚好组成一套完整的「视觉工具箱」。
32
+ > 从背景到物理、从文字到营销,84 个组件刚好组成一套完整的「视觉工具箱」。
33
33
 
34
34
  ---
35
35
 
@@ -80,7 +80,7 @@ export default function Page() {
80
80
  | ---------------------------------------------------------------------- | -------------------------------------------------------- |
81
81
  | [llms.txt](https://jiaxiantao.github.io/cos-design/llms.txt) | 供 Agent 抓取的索引(场景 → 组件 → 安装命令) |
82
82
  | [llms-full.txt](https://jiaxiantao.github.io/cos-design/llms-full.txt) | 站点上的完整 AI 参考(与 docs/ai.md 同步) |
83
- | [docs/ai.md](./docs/ai.md) | 72 个组件的完整 AI 参考(安装 / import / 示例 / Props) |
83
+ | [docs/ai.md](./docs/ai.md) | 84 个组件的完整 AI 参考(安装 / import / 示例 / Props) |
84
84
  | [AGENTS.md](./AGENTS.md) | 仓库级 Agent 规则,可复制到用户项目 |
85
85
  | [.cursor/skills/cos-design](./.cursor/skills/cos-design/SKILL.md) | Cursor Skill,克隆本仓库或复制到你的 `~/.cursor/skills/` |
86
86
 
@@ -105,7 +105,7 @@ export default function Page() {
105
105
 
106
106
  ---
107
107
 
108
- ## 组件一览(72 个 · 8 大分类)
108
+ ## 组件一览(73 个 · 8 大分类)
109
109
 
110
110
  <details open>
111
111
  <summary><strong>背景动效</strong> — 11 个 · 动态场景与粒子背景</summary>
@@ -157,7 +157,30 @@ export default function Page() {
157
157
  </details>
158
158
 
159
159
  <details>
160
- <summary><strong>交互玩具</strong> — 8 个 · 鼠标驱动的趣味反馈</summary>
160
+ <summary><strong>图片预览</strong> — 13 个 · 物件隐喻式图片浏览</summary>
161
+
162
+ <br>
163
+
164
+ | 组件 | 说明 |
165
+ | ------------------ | ------------------ |
166
+ | `PhotoAlbum` | 真实翻页相册 |
167
+ | `PhotoLantern` | 走马灯(Three.js) |
168
+ | `PhotoClothesline` | 晾绳照片墙 |
169
+ | `PhotoFilmstrip` | 胶卷条 |
170
+ | `PhotoPolaroid` | 拍立得堆 |
171
+ | `PhotoLightbox` | 灯箱透片 |
172
+ | `PhotoCarousel` | 旋转木马托盘 |
173
+ | `PhotoPrism` | 棱镜立方 |
174
+ | `PhotoScroll` | 卷轴照片 |
175
+ | `PhotoPostcard` | 旅行明信片 |
176
+ | `PhotoViewMaster` | 观景器圆盘 |
177
+ | `PhotoFridge` | 冰箱磁贴墙 |
178
+ | `PhotoTunnel` | 纵深隧道 |
179
+
180
+ </details>
181
+
182
+ <details>
183
+ <summary><strong>交互玩具</strong> — 7 个 · 鼠标驱动的趣味反馈</summary>
161
184
 
162
185
  <br>
163
186
 
@@ -167,7 +190,6 @@ export default function Page() {
167
190
  | `Spotlight` | 手电筒照亮 |
168
191
  | `MagneticButton` | 磁吸按钮 |
169
192
  | `HolographicCard` | 全息反光卡片 |
170
- | `PhotoAlbum` | 真实翻页相册 |
171
193
  | `ClickSpark` | 点击火花 |
172
194
  | `CursorTrail` | 光标拖尾 |
173
195
  | `LiquidGlass` | 液态毛玻璃 |
@@ -263,7 +285,7 @@ export default function Page() {
263
285
 
264
286
  ## 特性
265
287
 
266
- - **72 个组件**,覆盖背景、文字、交互、营销、数据、物理、科学、特效八大场景
288
+ - **84 个组件**,覆盖背景、文字、交互、营销、数据、物理、科学、特效八大场景
267
289
  - **React 19** + **Vite 8** + **TypeScript 5** 现代技术栈
268
290
  - **ESM / CJS** 双格式,完整 `.d.ts` 类型
269
291
  - **样式自动注入**,无需 `import 'cos-design/dist/index.css'`
@@ -284,7 +306,7 @@ npm run setup # 安装依赖(绕过 corepack 问题)
284
306
  npx --yes pnpm@9 dev # 启动 Playground
285
307
  ```
286
308
 
287
- 访问 **http://localhost:4000** — 按分类浏览全部 72 个组件,右侧可查看与复制示例代码。
309
+ 访问 **http://localhost:4000** — 按分类浏览全部 84 个组件,右侧可查看与复制示例代码。
288
310
 
289
311
  ---
290
312