vane-waterfall 2.0.2 → 2.0.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 (102) hide show
  1. package/dist/chunks/doc-BAhVW3g8.js +150 -0
  2. package/dist/chunks/{doc-BXaJl1By.js → doc-BU0CKW63.js} +64 -35
  3. package/dist/chunks/{doc-D_ozEn0Q.js → doc-BrEd0oZB.js} +41 -32
  4. package/dist/chunks/{doc-bTHwfIVb.js → doc-Bud0hbaz.js} +39 -25
  5. package/dist/chunks/{doc-DukOmDCo.js → doc-C-B3zK2o.js} +52 -23
  6. package/dist/chunks/{doc-DElLNjIc.js → doc-C206ZwYC.js} +33 -24
  7. package/dist/chunks/{doc-BSnWbrkH.js → doc-C2L8kkeI.js} +49 -25
  8. package/dist/chunks/{doc-a0MK2S3n.js → doc-CE1DGMBV.js} +62 -38
  9. package/dist/chunks/{doc-BXSy2aPP.js → doc-CHbQXLwY.js} +33 -19
  10. package/dist/chunks/{doc-BfWnfTst.js → doc-CInpKZNU.js} +38 -24
  11. package/dist/chunks/{doc-gTAsLjVx.js → doc-CYxwSuG6.js} +30 -16
  12. package/dist/chunks/{doc-DzvTrZ13.js → doc-CaJ02INP.js} +25 -16
  13. package/dist/chunks/{doc-BXElhF2h.js → doc-CiCso5Ti.js} +44 -30
  14. package/dist/chunks/{doc-BCmEnh39.js → doc-CkuMr8Ca.js} +49 -25
  15. package/dist/chunks/{doc-3Fpag2G8.js → doc-D7m1OFCW.js} +38 -24
  16. package/dist/chunks/doc-DEN2WTDh.js +153 -0
  17. package/dist/chunks/{doc-C5xrHNoC.js → doc-DhICh9S2.js} +37 -23
  18. package/dist/chunks/{doc-DAieSXLy.js → doc-DlJICsyN.js} +41 -27
  19. package/dist/chunks/{doc-CN4edvn_.js → doc-DtxS1-P0.js} +32 -23
  20. package/dist/chunks/{doc-BIzjYAZW.js → doc-DudYCn_-.js} +25 -16
  21. package/dist/chunks/{doc-BmoijI6q.js → doc-HoyAFR_m.js} +43 -24
  22. package/dist/chunks/doc-RlBMCMNs.js +170 -0
  23. package/dist/chunks/doc-RwKQqySd.js +102 -0
  24. package/dist/chunks/{doc-CTUoMe7o.js → doc-eYhNJy97.js} +31 -22
  25. package/dist/chunks/{doc-CcPFavOs.js → doc-i6FY1We1.js} +27 -13
  26. package/dist/chunks/doc-skPl6ZMP.js +101 -0
  27. package/dist/chunks/index-8gEIzUxi.js +15 -0
  28. package/dist/chunks/index-B96I5CKE.js +21 -0
  29. package/dist/chunks/index-Bjmhy8jW.js +11 -0
  30. package/dist/chunks/index-Cuq0ofv-.js +13 -0
  31. package/dist/chunks/{index-BAWlVYr3.js → index-Cz4YEqRF.js} +1 -1
  32. package/dist/chunks/{index-CF0tYRop.js → index-FBJVUYmH.js} +1 -1
  33. package/dist/chunks/withPlugins-BOeDFhof.js +743 -0
  34. package/dist/custom-plugins/A11yPlugin/doc.json.d.ts +64 -40
  35. package/dist/custom-plugins/A11yPlugin/index.js +1 -1
  36. package/dist/custom-plugins/AlignmentPlugin/doc.json.d.ts +42 -28
  37. package/dist/custom-plugins/AlignmentPlugin/index.js +1 -1
  38. package/dist/custom-plugins/AutoColumnPlugin/doc.json.d.ts +53 -44
  39. package/dist/custom-plugins/AutoColumnPlugin/index.js +1 -1
  40. package/dist/custom-plugins/BookmarkPlugin/doc.json.d.ts +44 -35
  41. package/dist/custom-plugins/BookmarkPlugin/index.js +1 -1
  42. package/dist/custom-plugins/ClickAnalyticsPlugin/doc.json.d.ts +29 -0
  43. package/dist/custom-plugins/ClickAnalyticsPlugin/index.js +1 -1
  44. package/dist/custom-plugins/DebounceLayoutPlugin/doc.json.d.ts +37 -28
  45. package/dist/custom-plugins/DebounceLayoutPlugin/index.js +1 -1
  46. package/dist/custom-plugins/DragReorderPlugin/doc.json.d.ts +14 -0
  47. package/dist/custom-plugins/DragReorderPlugin/index.js +1 -1
  48. package/dist/custom-plugins/FilterPlugin/doc.json.d.ts +53 -39
  49. package/dist/custom-plugins/FilterPlugin/index.js +1 -1
  50. package/dist/custom-plugins/FixedHeightPlugin/doc.json.d.ts +42 -28
  51. package/dist/custom-plugins/FixedHeightPlugin/index.js +1 -1
  52. package/dist/custom-plugins/GapPlugin/doc.json.d.ts +61 -37
  53. package/dist/custom-plugins/GapPlugin/index.js +1 -1
  54. package/dist/custom-plugins/GroupingPlugin/doc.json.d.ts +61 -32
  55. package/dist/custom-plugins/GroupingPlugin/index.js +1 -1
  56. package/dist/custom-plugins/HeatmapAnalyticsPlugin/doc.json.d.ts +24 -0
  57. package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.js +1 -1
  58. package/dist/custom-plugins/InfiniteScrollPlugin/doc.json.d.ts +55 -36
  59. package/dist/custom-plugins/InfiniteScrollPlugin/index.js +1 -1
  60. package/dist/custom-plugins/PaginationPlugin/doc.json.d.ts +56 -42
  61. package/dist/custom-plugins/PaginationPlugin/index.js +1 -1
  62. package/dist/custom-plugins/PinItemPlugin/doc.json.d.ts +49 -35
  63. package/dist/custom-plugins/PinItemPlugin/index.js +1 -1
  64. package/dist/custom-plugins/RecyclePlugin/doc.json.d.ts +57 -28
  65. package/dist/custom-plugins/RecyclePlugin/index.js +1 -1
  66. package/dist/custom-plugins/ReducedMotionPlugin/doc.json.d.ts +29 -0
  67. package/dist/custom-plugins/ReducedMotionPlugin/index.js +1 -1
  68. package/dist/custom-plugins/ResponsiveColumnsPlugin/doc.json.d.ts +40 -31
  69. package/dist/custom-plugins/ResponsiveColumnsPlugin/index.js +1 -1
  70. package/dist/custom-plugins/ScrollAnchorPlugin/doc.json.d.ts +42 -28
  71. package/dist/custom-plugins/ScrollAnchorPlugin/index.js +1 -1
  72. package/dist/custom-plugins/SearchPlugin/doc.json.d.ts +53 -39
  73. package/dist/custom-plugins/SearchPlugin/index.js +1 -1
  74. package/dist/custom-plugins/SortPlugin/doc.json.d.ts +52 -38
  75. package/dist/custom-plugins/SortPlugin/index.js +1 -1
  76. package/dist/custom-plugins/StatePersistencePlugin/doc.json.d.ts +71 -37
  77. package/dist/custom-plugins/StatePersistencePlugin/index.js +1 -1
  78. package/dist/custom-plugins/StickyHeaderPlugin/doc.json.d.ts +43 -34
  79. package/dist/custom-plugins/StickyHeaderPlugin/index.js +1 -1
  80. package/dist/custom-plugins/ThrottlePlugin/doc.json.d.ts +43 -34
  81. package/dist/custom-plugins/ThrottlePlugin/index.js +1 -1
  82. package/dist/custom-plugins/TransitionPlugin/doc.json.d.ts +49 -35
  83. package/dist/custom-plugins/TransitionPlugin/index.js +1 -1
  84. package/dist/custom-plugins/URLSyncPlugin/doc.json.d.ts +57 -33
  85. package/dist/custom-plugins/URLSyncPlugin/index.js +1 -1
  86. package/dist/custom-plugins/index.js +6 -6
  87. package/dist/entries/plugins.js +7 -7
  88. package/dist/index.js +1 -1
  89. package/dist/presets/dashboard/index.js +2 -2
  90. package/dist/presets/photo-feed/index.js +3 -3
  91. package/dist/presets/product-feed/index.js +2 -2
  92. package/package.json +26 -26
  93. package/dist/chunks/doc-BQQoKNto.js +0 -126
  94. package/dist/chunks/doc-BindRMfO.js +0 -72
  95. package/dist/chunks/doc-CBHjiDG7.js +0 -88
  96. package/dist/chunks/doc-CkU5GtLw.js +0 -136
  97. package/dist/chunks/doc-KN6Bvmty.js +0 -124
  98. package/dist/chunks/index-B8o6R4RZ.js +0 -15
  99. package/dist/chunks/index-BFyYpEY_.js +0 -11
  100. package/dist/chunks/index-CJR0Buju.js +0 -21
  101. package/dist/chunks/index-DHTB3QEP.js +0 -13
  102. package/dist/chunks/withPlugins-DG3YpSgL.js +0 -655
@@ -1,50 +1,64 @@
1
- declare const _default: {
2
- "name": "PaginationPlugin",
3
- "description": "读 `props.pageIndex`(1 基)与 `props.pageSize` 切片。放在数据管线最末端,保证切的是「过滤 + 排序 + 搜索」之后的结果。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "data",
7
- "数据管线",
8
- "分页"
9
- ],
10
- "config": [
11
- {
12
- "name": "pageSize",
13
- "type": "number",
14
- "default": "props.pageSize ?? 20",
15
- "description": "每页条数"
16
- },
1
+ declare const _default: {
2
+ "name": "PaginationPlugin",
3
+ "description": "读 `props.pageIndex`(1 基)与 `props.pageSize` 切片。放在数据管线最末端,保证切的是「过滤 + 排序 + 搜索」之后的结果。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "data",
7
+ "数据管线",
8
+ "分页"
9
+ ],
10
+ "events": [
17
11
  {
18
- "name": "scrollToTop",
19
- "type": "boolean",
20
- "default": "false",
21
- "description": "翻页后回顶"
12
+ "name": "onPropsChange",
13
+ "when": "props 变化后",
14
+ "description": "数据或配置变化时请求重排"
22
15
  },
23
16
  {
24
- "name": "scrollBehavior",
25
- "type": "\"auto\" | \"smooth\"",
26
- "default": "\"auto\"",
27
- "description": "回顶行为"
17
+ "name": "transformProps",
18
+ "when": "渲染前链式改写瀑布流 props",
19
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
28
20
  }
29
21
  ],
30
- "example": "// 按 props.pageIndex / pageSize 切片,页码从 1 开始。\nconst Waterfall = withPlugins(WaterfallCore, [\n createPaginationPlugin({\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
31
- "conflicts": [
32
- "InfiniteScrollPlugin"
33
- ],
34
- "features": [
35
- "1 基页码(与 UI 分页器一致)",
36
- "pageIndex 非法值自动夹到 1",
37
- "翻页自动回顶可选"
38
- ],
39
- "useCases": [
40
- "后台列表分页",
41
- "搜索结果分页",
42
- "与 URLSyncPlugin 配合做可分享链接"
43
- ],
44
- "notes": [
45
- "pageSize 优先级:props.pageSize > 工厂 config.pageSize > 20。"
46
- ]
47
- }
22
+ "methods": [],
23
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
24
+ "config": [
25
+ {
26
+ "name": "pageSize",
27
+ "type": "number",
28
+ "default": "props.pageSize ?? 20",
29
+ "description": "每页条数"
30
+ },
31
+ {
32
+ "name": "scrollToTop",
33
+ "type": "boolean",
34
+ "default": "false",
35
+ "description": "翻页后回顶"
36
+ },
37
+ {
38
+ "name": "scrollBehavior",
39
+ "type": "\"auto\" | \"smooth\"",
40
+ "default": "\"auto\"",
41
+ "description": "回顶行为"
42
+ }
43
+ ],
44
+ "example": "// 按 props.pageIndex / pageSize 切片,页码从 1 开始。\nconst Waterfall = withPlugins(WaterfallCore, [\n createPaginationPlugin({\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
45
+ "conflicts": [
46
+ "InfiniteScrollPlugin"
47
+ ],
48
+ "features": [
49
+ "1 基页码(与 UI 分页器一致)",
50
+ "pageIndex 非法值自动夹到 1",
51
+ "翻页自动回顶可选"
52
+ ],
53
+ "useCases": [
54
+ "后台列表分页",
55
+ "搜索结果分页",
56
+ "与 URLSyncPlugin 配合做可分享链接"
57
+ ],
58
+ "notes": [
59
+ "pageSize 优先级:props.pageSize > 工厂 config.pageSize > 20。"
60
+ ]
61
+ }
48
62
  ;
49
63
 
50
64
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as a, d as t } from "../../chunks/doc-DAieSXLy.js";
1
+ import { c as a, d as t } from "../../chunks/doc-DlJICsyN.js";
2
2
  const n = Object.assign(a, { meta: t });
3
3
  export {
4
4
  n as createPaginationPlugin
@@ -1,43 +1,57 @@
1
- declare const _default: {
2
- "name": "PinItemPlugin",
3
- "description": "把若干索引的项钉在顶部指定列,其余项从它们下方继续排。走 D1-A 布局钩子(calculateItemPosition),是旧版宣称但从未生效的能力。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "layout",
7
- "layout-hook",
8
- "置顶"
9
- ],
10
- "config": [
1
+ declare const _default: {
2
+ "name": "PinItemPlugin",
3
+ "description": "把若干索引的项钉在顶部指定列,其余项从它们下方继续排。走 D1-A 布局钩子(calculateItemPosition),是旧版宣称但从未生效的能力。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "layout",
7
+ "layout-hook",
8
+ "置顶"
9
+ ],
10
+ "events": [
11
11
  {
12
- "name": "pinnedIndices",
13
- "type": "number[]",
14
- "default": "[]",
15
- "description": "要钉住的项索引"
12
+ "name": "onBeforeLayout",
13
+ "when": "开始一次布局之前",
14
+ "description": "返回 false 可阻止本次布局(如数据仍在加载)"
16
15
  },
17
16
  {
18
- "name": "column",
19
- "type": "number",
20
- "default": "0",
21
- "description": "钉到第几列"
17
+ "name": "calculateItemPosition",
18
+ "when": "每个卡片参与布局时(拿到 index / item / columns)",
19
+ "description": "返回坐标片段可覆盖列分配结果(置顶、跨列、错位)"
22
20
  }
23
21
  ],
24
- "example": "// 把指定索引的项钉在顶部同一列,不参与常规列高推进(广告位 / 公告卡)。\nconst Waterfall = withPlugins(WaterfallCore, [\n createPinItemPlugin({\n pinnedIndices: [],\n column: 0,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
25
- "features": [
26
- "置顶项不占常规列高:后续项从置顶块下方开始",
27
- "支持多列分别置顶(column 可不同)",
28
- "每次布局前重置偏移,items 变化后不会累加错位"
29
- ],
30
- "useCases": [
31
- "信息流首位的推广卡",
32
- "公告 / 置顶帖",
33
- "需要固定在左上角的活动位"
34
- ],
35
- "notes": [
36
- "置顶项之间按 pinnedIndices 顺序纵向堆叠,同一列多条会依次往下排。",
37
- "置顶会挤掉该列的正常网格位置,pinnedIndices 建议控制在 1~2 条。",
38
- "换列后的 x 由布局引擎按本轮列宽补齐,插件只返回 column 即可 —— 自己用「列宽 + 间距」反推 x 会在间距由其它插件(GapPlugin)注入时算错。"
39
- ]
40
- }
22
+ "methods": [],
23
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
24
+ "config": [
25
+ {
26
+ "name": "pinnedIndices",
27
+ "type": "number[]",
28
+ "default": "[]",
29
+ "description": "要钉住的项索引"
30
+ },
31
+ {
32
+ "name": "column",
33
+ "type": "number",
34
+ "default": "0",
35
+ "description": "钉到第几列"
36
+ }
37
+ ],
38
+ "example": "// 把指定索引的项钉在顶部同一列,不参与常规列高推进(广告位 / 公告卡)。\nconst Waterfall = withPlugins(WaterfallCore, [\n createPinItemPlugin({\n pinnedIndices: [],\n column: 0,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
39
+ "features": [
40
+ "置顶项不占常规列高:后续项从置顶块下方开始",
41
+ "支持多列分别置顶(column 可不同)",
42
+ "每次布局前重置偏移,items 变化后不会累加错位"
43
+ ],
44
+ "useCases": [
45
+ "信息流首位的推广卡",
46
+ "公告 / 置顶帖",
47
+ "需要固定在左上角的活动位"
48
+ ],
49
+ "notes": [
50
+ "置顶项之间按 pinnedIndices 顺序纵向堆叠,同一列多条会依次往下排。",
51
+ "置顶会挤掉该列的正常网格位置,pinnedIndices 建议控制在 1~2 条。",
52
+ "换列后的 x 由布局引擎按本轮列宽补齐,插件只返回 column 即可 —— 自己用「列宽 + 间距」反推 x 会在间距由其它插件(GapPlugin)注入时算错。"
53
+ ]
54
+ }
41
55
  ;
42
56
 
43
57
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as t } from "../../chunks/doc-bTHwfIVb.js";
1
+ import { c as e, d as t } from "../../chunks/doc-Bud0hbaz.js";
2
2
  const c = Object.assign(e, { meta: t });
3
3
  export {
4
4
  c as createPinItemPlugin
@@ -1,35 +1,64 @@
1
- declare const _default: {
2
- "name": "RecyclePlugin",
3
- "description": "纯绘制层优化:项离开视口就 `visibility: hidden`,回来再显示。DOM 节点不销毁,滚动位置与已加载的图片都保留,适合「项里有视频/Canvas,重建代价高」的场景。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "interaction",
7
- "性能"
8
- ],
9
- "config": [
1
+ declare const _default: {
2
+ "name": "RecyclePlugin",
3
+ "description": "纯绘制层优化:项离开视口就 `visibility: hidden`,回来再显示。DOM 节点不销毁,滚动位置与已加载的图片都保留,适合「项里有视频/Canvas,重建代价高」的场景。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "interaction",
7
+ "性能"
8
+ ],
9
+ "events": [
10
+ {
11
+ "name": "onUnmount",
12
+ "when": "瀑布流卸载前",
13
+ "description": "断开观察器、移除滚动监听"
14
+ },
15
+ {
16
+ "name": "onItemUnmount",
17
+ "when": "单个卡片卸载时",
18
+ "description": "解绑该卡片的监听与观察器"
19
+ },
20
+ {
21
+ "name": "onItemEnterViewport",
22
+ "when": "单个卡片进入视口",
23
+ "description": "卡片级曝光、视频自动播放等"
24
+ },
10
25
  {
11
- "name": "poolSize",
12
- "type": "number",
13
- "default": "—",
14
- "description": "同时保持可见的项数上限(超出则回收最早的)"
26
+ "name": "onItemLeaveViewport",
27
+ "when": "单个卡片离开视口",
28
+ "description": "暂停播放、回收资源"
15
29
  }
16
30
  ],
17
- "example": "// 视口外的项设 `visibility: hidden`,降低长列表的绘制压力。\nconst Waterfall = withPlugins(WaterfallCore, [\n createRecyclePlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
18
- "features": [
19
- "不销毁 DOM,只隐藏",
20
- "项内媒体不重新加载",
21
- "与虚拟化正交(一个省绘制、一个省节点)"
22
- ],
23
- "useCases": [
24
- "项内含视频 / canvas",
25
- "长列表滚动发虚",
26
- "低端设备省电"
31
+ "methods": [
32
+ {
33
+ "name": "getItemRef",
34
+ "signature": "ctx.getItemRef(index: number): HTMLElement | null",
35
+ "description": "取第 index 张卡片的 DOM 引用,可能为 null(尚未挂载 / 已回收)"
36
+ }
27
37
  ],
28
- "notes": [
29
- "与 Core 的 `virtualize` 同开会让项被卸载又隐藏,收益互相抵消,建议只选一个。",
30
- "只改 visibility 不改布局,所以不会引起重排。"
31
- ]
32
- }
38
+ "config": [
39
+ {
40
+ "name": "poolSize",
41
+ "type": "number",
42
+ "default": "—",
43
+ "description": "同时保持可见的项数上限(超出则回收最早的)"
44
+ }
45
+ ],
46
+ "example": "// 视口外的项设 `visibility: hidden`,降低长列表的绘制压力。\nconst Waterfall = withPlugins(WaterfallCore, [\n createRecyclePlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
47
+ "features": [
48
+ "不销毁 DOM,只隐藏",
49
+ "项内媒体不重新加载",
50
+ "与虚拟化正交(一个省绘制、一个省节点)"
51
+ ],
52
+ "useCases": [
53
+ "项内含视频 / canvas",
54
+ "长列表滚动发虚",
55
+ "低端设备省电"
56
+ ],
57
+ "notes": [
58
+ "与 Core 的 `virtualize` 同开会让项被卸载又隐藏,收益互相抵消,建议只选一个。",
59
+ "只改 visibility 不改布局,所以不会引起重排。"
60
+ ]
61
+ }
33
62
  ;
34
63
 
35
64
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as c } from "../../chunks/doc-BindRMfO.js";
1
+ import { c as e, d as c } from "../../chunks/doc-skPl6ZMP.js";
2
2
  const a = Object.assign(e, { meta: c });
3
3
  export {
4
4
  a as createRecyclePlugin
@@ -6,6 +6,35 @@ declare const _default: {
6
6
  "perf",
7
7
  "a11y"
8
8
  ],
9
+ "events": [
10
+ {
11
+ "name": "onUnmount",
12
+ "when": "瀑布流卸载前",
13
+ "description": "断开观察器、移除滚动监听"
14
+ },
15
+ {
16
+ "name": "onItemMount",
17
+ "when": "单个卡片挂载并拿到 DOM 元素时",
18
+ "description": "按卡片绑定监听、观察器、埋点"
19
+ },
20
+ {
21
+ "name": "onItemUnmount",
22
+ "when": "单个卡片卸载时",
23
+ "description": "解绑该卡片的监听与观察器"
24
+ },
25
+ {
26
+ "name": "onLayoutComplete",
27
+ "when": "DOM 落位完成(可安全测量)",
28
+ "description": "测量真实高度、懒加载判定、曝光上报"
29
+ },
30
+ {
31
+ "name": "transformProps",
32
+ "when": "渲染前链式改写瀑布流 props",
33
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
34
+ }
35
+ ],
36
+ "methods": [],
37
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
9
38
  "config": [
10
39
  {
11
40
  "name": "disableTransform",
@@ -1,4 +1,4 @@
1
- import { c as e, d as o } from "../../chunks/doc-DukOmDCo.js";
1
+ import { c as e, d as o } from "../../chunks/doc-C-B3zK2o.js";
2
2
  const c = Object.assign(e, { meta: o });
3
3
  export {
4
4
  c as createReducedMotionPlugin
@@ -1,37 +1,46 @@
1
- declare const _default: {
2
- "name": "ResponsiveColumnsPlugin",
3
- "description": "用一张断点表控制列数,命中哪档用哪档。走 D1-A 布局钩子(calculateColumns),按容器宽度匹配断点。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "layout",
7
- "layout-hook",
8
- "响应式"
9
- ],
10
- "config": [
1
+ declare const _default: {
2
+ "name": "ResponsiveColumnsPlugin",
3
+ "description": "用一张断点表控制列数,命中哪档用哪档。走 D1-A 布局钩子(calculateColumns),按容器宽度匹配断点。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "layout",
7
+ "layout-hook",
8
+ "响应式"
9
+ ],
10
+ "events": [
11
11
  {
12
- "name": "breakpoints",
13
- "type": "Record<string, { width: number; columns: number }>",
14
- "default": "—",
15
- "description": "断点表,按 width 升序匹配"
12
+ "name": "calculateColumns",
13
+ "when": "每次布局前,询问列数",
14
+ "description": "返回列数则覆盖 props.columns;返回 undefined 沿用配置"
16
15
  }
17
16
  ],
18
- "example": "// 按断点表决定列数(如 640 → 2 列、1024 → 3 列、1440 → 4 列)。\nconst Waterfall = withPlugins(WaterfallCore, [\n createResponsiveColumnsPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
19
- "conflicts": [
20
- "AutoColumnPlugin"
21
- ],
22
- "features": [
23
- "断点表驱动,设计稿几档就写几档",
24
- "按容器宽度而非视口宽度匹配",
25
- "未命中任何断点时回退到 props.columns"
26
- ],
27
- "useCases": [
28
- "严格对齐设计断点的站点",
29
- "同一个组件嵌在不同宽度的容器里"
30
- ],
31
- "notes": [
32
- "与 AutoColumnPlugin 互斥。"
33
- ]
34
- }
17
+ "methods": [],
18
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
19
+ "config": [
20
+ {
21
+ "name": "breakpoints",
22
+ "type": "Record<string, { width: number; columns: number }>",
23
+ "default": "—",
24
+ "description": "断点表,按 width 升序匹配"
25
+ }
26
+ ],
27
+ "example": "// 按断点表决定列数(如 640 → 2 列、1024 → 3 列、1440 → 4 列)。\nconst Waterfall = withPlugins(WaterfallCore, [\n createResponsiveColumnsPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
28
+ "conflicts": [
29
+ "AutoColumnPlugin"
30
+ ],
31
+ "features": [
32
+ "断点表驱动,设计稿几档就写几档",
33
+ "按容器宽度而非视口宽度匹配",
34
+ "未命中任何断点时回退到 props.columns"
35
+ ],
36
+ "useCases": [
37
+ "严格对齐设计断点的站点",
38
+ "同一个组件嵌在不同宽度的容器里"
39
+ ],
40
+ "notes": [
41
+ "与 AutoColumnPlugin 互斥。"
42
+ ]
43
+ }
35
44
  ;
36
45
 
37
46
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as s } from "../../chunks/doc-DElLNjIc.js";
1
+ import { c as e, d as s } from "../../chunks/doc-C206ZwYC.js";
2
2
  const n = Object.assign(e, { meta: s });
3
3
  export {
4
4
  n as createResponsiveColumnsPlugin
@@ -1,34 +1,48 @@
1
- declare const _default: {
2
- "name": "ScrollAnchorPlugin",
3
- "description": "不需要自己算索引:外部只管 `bus.emit(\"anchor:scrollToId\", { id })`,插件用 getAnchorId 找到对应项并滚过去。适合「从消息跳到某条内容」。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "interaction",
7
- "滚动"
8
- ],
9
- "config": [
1
+ declare const _default: {
2
+ "name": "ScrollAnchorPlugin",
3
+ "description": "不需要自己算索引:外部只管 `bus.emit(\"anchor:scrollToId\", { id })`,插件用 getAnchorId 找到对应项并滚过去。适合「从消息跳到某条内容」。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "interaction",
7
+ "滚动"
8
+ ],
9
+ "events": [
10
+ {
11
+ "name": "onMount",
12
+ "when": "瀑布流挂载完成",
13
+ "description": "初始化观察器与滚动监听,返回清理函数"
14
+ },
10
15
  {
11
- "name": "getAnchorId",
12
- "type": "(item, index) => string | number | undefined",
13
- "default": "item.id",
14
- "description": "从项里取锚点 id"
16
+ "name": "onUnmount",
17
+ "when": "瀑布流卸载前",
18
+ "description": "断开观察器、移除滚动监听"
15
19
  }
16
20
  ],
17
- "example": "// 监听 `anchor:scrollToId` 事件,按业务 id 滚动到对应项。\nconst Waterfall = withPlugins(WaterfallCore, [\n createScrollAnchorPlugin({\n getAnchorId: \"item.id\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
18
- "features": [
19
- "按业务 id 定位,不用算下标",
20
- "onMount 订阅 / onUnmount 退订(不泄漏)",
21
- "平滑滚动"
22
- ],
23
- "useCases": [
24
- "从通知跳转到具体卡片",
25
- "目录点击定位",
26
- "外链深链定位"
27
- ],
28
- "notes": [
29
- "目标项必须已在 items 里;分页场景请先切到对应页再发事件。"
30
- ]
31
- }
21
+ "methods": [],
22
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
23
+ "config": [
24
+ {
25
+ "name": "getAnchorId",
26
+ "type": "(item, index) => string | number | undefined",
27
+ "default": "item.id",
28
+ "description": "从项里取锚点 id"
29
+ }
30
+ ],
31
+ "example": "// 监听 `anchor:scrollToId` 事件,按业务 id 滚动到对应项。\nconst Waterfall = withPlugins(WaterfallCore, [\n createScrollAnchorPlugin({\n getAnchorId: \"item.id\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
32
+ "features": [
33
+ "按业务 id 定位,不用算下标",
34
+ "onMount 订阅 / onUnmount 退订(不泄漏)",
35
+ "平滑滚动"
36
+ ],
37
+ "useCases": [
38
+ "从通知跳转到具体卡片",
39
+ "目录点击定位",
40
+ "外链深链定位"
41
+ ],
42
+ "notes": [
43
+ "目标项必须已在 items 里;分页场景请先切到对应页再发事件。"
44
+ ]
45
+ }
32
46
  ;
33
47
 
34
48
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c, d as o } from "../../chunks/doc-BXSy2aPP.js";
1
+ import { c, d as o } from "../../chunks/doc-CHbQXLwY.js";
2
2
  const e = Object.assign(c, { meta: o });
3
3
  export {
4
4
  e as createScrollAnchorPlugin
@@ -1,47 +1,61 @@
1
- declare const _default: {
2
- "name": "SearchPlugin",
3
- "description": "读取 `props.searchQuery`,在指定字段上做大小写不敏感的 `includes` 匹配。没指定字段就对对象的全部自有字段匹配。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "data",
7
- "数据管线",
8
- "搜索"
9
- ],
10
- "config": [
11
- {
12
- "name": "fields",
13
- "type": "(keyof T)[]",
14
- "default": "[]",
15
- "description": "参与匹配的字段;空则匹配全部自有字段"
16
- },
1
+ declare const _default: {
2
+ "name": "SearchPlugin",
3
+ "description": "读取 `props.searchQuery`,在指定字段上做大小写不敏感的 `includes` 匹配。没指定字段就对对象的全部自有字段匹配。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "data",
7
+ "数据管线",
8
+ "搜索"
9
+ ],
10
+ "events": [
17
11
  {
18
- "name": "scrollToTop",
19
- "type": "boolean",
20
- "default": "false",
21
- "description": "关键词变化后回顶"
12
+ "name": "onPropsChange",
13
+ "when": "props 变化后",
14
+ "description": "数据或配置变化时请求重排"
22
15
  },
23
16
  {
24
- "name": "scrollBehavior",
25
- "type": "\"auto\" | \"smooth\"",
26
- "default": "\"auto\"",
27
- "description": "回顶行为"
17
+ "name": "transformProps",
18
+ "when": "渲染前链式改写瀑布流 props",
19
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
28
20
  }
29
21
  ],
30
- "example": "// 按 props.searchQuery 做大小写不敏感的多字段包含匹配。\nconst Waterfall = withPlugins(WaterfallCore, [\n createSearchPlugin({\n fields: [],\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
31
- "features": [
32
- "大小写不敏感",
33
- "多字段 OR 匹配",
34
- "空关键词直接放行(不触发过滤)"
35
- ],
36
- "useCases": [
37
- "站内搜索结果页",
38
- "后台列表即时搜索",
39
- "商品名 / 店铺名联合搜索"
40
- ],
41
- "notes": [
42
- "纯前端 `includes`,不排序也不做拼音;要相关性排序请在 Search 之后接 SortPlugin。"
43
- ]
44
- }
22
+ "methods": [],
23
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
24
+ "config": [
25
+ {
26
+ "name": "fields",
27
+ "type": "(keyof T)[]",
28
+ "default": "[]",
29
+ "description": "参与匹配的字段;空则匹配全部自有字段"
30
+ },
31
+ {
32
+ "name": "scrollToTop",
33
+ "type": "boolean",
34
+ "default": "false",
35
+ "description": "关键词变化后回顶"
36
+ },
37
+ {
38
+ "name": "scrollBehavior",
39
+ "type": "\"auto\" | \"smooth\"",
40
+ "default": "\"auto\"",
41
+ "description": "回顶行为"
42
+ }
43
+ ],
44
+ "example": "// 按 props.searchQuery 做大小写不敏感的多字段包含匹配。\nconst Waterfall = withPlugins(WaterfallCore, [\n createSearchPlugin({\n fields: [],\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
45
+ "features": [
46
+ "大小写不敏感",
47
+ "多字段 OR 匹配",
48
+ "空关键词直接放行(不触发过滤)"
49
+ ],
50
+ "useCases": [
51
+ "站内搜索结果页",
52
+ "后台列表即时搜索",
53
+ "商品名 / 店铺名联合搜索"
54
+ ],
55
+ "notes": [
56
+ "纯前端 `includes`,不排序也不做拼音;要相关性排序请在 Search 之后接 SortPlugin。"
57
+ ]
58
+ }
45
59
  ;
46
60
 
47
61
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as a } from "../../chunks/doc-CBHjiDG7.js";
1
+ import { c as e, d as a } from "../../chunks/doc-RwKQqySd.js";
2
2
  const r = Object.assign(e, { meta: a });
3
3
  export {
4
4
  r as createSearchPlugin