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,47 +1,61 @@
1
- declare const _default: {
2
- "name": "FilterPlugin",
3
- "description": "用谓词函数过滤数据,优先读 `props.filterFn`,没有就用工厂里传入的 predicate。过滤条件变了可以自动滚回顶部(默认不开)。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "data",
7
- "数据管线"
8
- ],
9
- "config": [
10
- {
11
- "name": "predicate",
12
- "type": "(item, index) => boolean",
13
- "default": "—",
14
- "description": "默认谓词,可被 props.filterFn 覆盖"
15
- },
1
+ declare const _default: {
2
+ "name": "FilterPlugin",
3
+ "description": "用谓词函数过滤数据,优先读 `props.filterFn`,没有就用工厂里传入的 predicate。过滤条件变了可以自动滚回顶部(默认不开)。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "data",
7
+ "数据管线"
8
+ ],
9
+ "events": [
16
10
  {
17
- "name": "scrollToTop",
18
- "type": "boolean",
19
- "default": "false",
20
- "description": "条件变化后回顶"
11
+ "name": "onPropsChange",
12
+ "when": "props 变化后",
13
+ "description": "数据或配置变化时请求重排"
21
14
  },
22
15
  {
23
- "name": "scrollBehavior",
24
- "type": "\"auto\" | \"smooth\"",
25
- "default": "\"auto\"",
26
- "description": "回顶行为"
16
+ "name": "transformProps",
17
+ "when": "渲染前链式改写瀑布流 props",
18
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
27
19
  }
28
20
  ],
29
- "example": "// 按谓词过滤 items,参数变化可自动回顶。\nconst Waterfall = withPlugins(WaterfallCore, [\n createFilterPlugin({\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
30
- "features": [
31
- "谓词抛错时按「保留」处理,不会整表消失",
32
- "props.filterFn 优先,便于页面动态换过滤条件",
33
- "可与 Sort / Search / Pagination 串联"
34
- ],
35
- "useCases": [
36
- "分类 Tab 切换",
37
- "只看有货 / 只看促销",
38
- "价格区间筛选"
39
- ],
40
- "notes": [
41
- "数据管线的执行顺序由 priority 决定:Filter(40) → Sort(30) → Search(20) → Pagination(10)。",
42
- "先过滤再分页,页码总数才是过滤后的总数——顺序反了会出现「第 2 页空」。"
43
- ]
44
- }
21
+ "methods": [],
22
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
23
+ "config": [
24
+ {
25
+ "name": "predicate",
26
+ "type": "(item, index) => boolean",
27
+ "default": "—",
28
+ "description": "默认谓词,可被 props.filterFn 覆盖"
29
+ },
30
+ {
31
+ "name": "scrollToTop",
32
+ "type": "boolean",
33
+ "default": "false",
34
+ "description": "条件变化后回顶"
35
+ },
36
+ {
37
+ "name": "scrollBehavior",
38
+ "type": "\"auto\" | \"smooth\"",
39
+ "default": "\"auto\"",
40
+ "description": "回顶行为"
41
+ }
42
+ ],
43
+ "example": "// 按谓词过滤 items,参数变化可自动回顶。\nconst Waterfall = withPlugins(WaterfallCore, [\n createFilterPlugin({\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
44
+ "features": [
45
+ "谓词抛错时按「保留」处理,不会整表消失",
46
+ "props.filterFn 优先,便于页面动态换过滤条件",
47
+ "可与 Sort / Search / Pagination 串联"
48
+ ],
49
+ "useCases": [
50
+ "分类 Tab 切换",
51
+ "只看有货 / 只看促销",
52
+ "价格区间筛选"
53
+ ],
54
+ "notes": [
55
+ "数据管线的执行顺序由 priority 决定:Filter(40) → Sort(30) → Search(20) → Pagination(10)。",
56
+ "先过滤再分页,页码总数才是过滤后的总数——顺序反了会出现「第 2 页空」。"
57
+ ]
58
+ }
45
59
  ;
46
60
 
47
61
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as t } from "../../chunks/doc-3Fpag2G8.js";
1
+ import { c as e, d as t } from "../../chunks/doc-D7m1OFCW.js";
2
2
  const a = Object.assign(e, { meta: t });
3
3
  export {
4
4
  a as createFilterPlugin
@@ -1,34 +1,48 @@
1
- declare const _default: {
2
- "name": "FixedHeightPlugin",
3
- "description": "把数据里带 height 字段的项统一改写为固定高度,瀑布流变成等高网格。适合「图少字多」的卡片流——等高反而更好扫读。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "layout",
7
- "网格"
8
- ],
9
- "config": [
1
+ declare const _default: {
2
+ "name": "FixedHeightPlugin",
3
+ "description": "把数据里带 height 字段的项统一改写为固定高度,瀑布流变成等高网格。适合「图少字多」的卡片流——等高反而更好扫读。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "layout",
7
+ "网格"
8
+ ],
9
+ "events": [
10
+ {
11
+ "name": "onResize",
12
+ "when": "容器宽度变化触发重排前",
13
+ "description": "按新宽度调整列数或卡片密度"
14
+ },
10
15
  {
11
- "name": "itemHeight",
12
- "type": "number",
13
- "default": "—",
14
- "description": "统一项高 px(必填)"
16
+ "name": "transformProps",
17
+ "when": "渲染前链式改写瀑布流 props",
18
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
15
19
  }
16
20
  ],
17
- "example": "// 把项高度统一成固定值,瀑布流退化为等高网格。\nconst Waterfall = withPlugins(WaterfallCore, [\n createFixedHeightPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
18
- "features": [
19
- "等高网格(严格对齐)",
20
- "只改数据里已有的 height 字段",
21
- "与 Pagination / Filter 组合仍然成立"
22
- ],
23
- "useCases": [
24
- "商品列表(图固定比例)",
25
- "后台看板卡片",
26
- "需要严格栅格对齐的页面"
27
- ],
28
- "notes": [
29
- "数据里没有 height 字段时不会生效——高度由 renderItem 自己的内容决定。"
30
- ]
31
- }
21
+ "methods": [],
22
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
23
+ "config": [
24
+ {
25
+ "name": "itemHeight",
26
+ "type": "number",
27
+ "default": "—",
28
+ "description": "统一项高 px(必填)"
29
+ }
30
+ ],
31
+ "example": "// 把项高度统一成固定值,瀑布流退化为等高网格。\nconst Waterfall = withPlugins(WaterfallCore, [\n createFixedHeightPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
32
+ "features": [
33
+ "等高网格(严格对齐)",
34
+ "只改数据里已有的 height 字段",
35
+ "与 Pagination / Filter 组合仍然成立"
36
+ ],
37
+ "useCases": [
38
+ "商品列表(图固定比例)",
39
+ "后台看板卡片",
40
+ "需要严格栅格对齐的页面"
41
+ ],
42
+ "notes": [
43
+ "数据里没有 height 字段时不会生效——高度由 renderItem 自己的内容决定。"
44
+ ]
45
+ }
32
46
  ;
33
47
 
34
48
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as t } from "../../chunks/doc-CcPFavOs.js";
1
+ import { c as e, d as t } from "../../chunks/doc-i6FY1We1.js";
2
2
  const a = Object.assign(e, { meta: t });
3
3
  export {
4
4
  a as createFixedHeightPlugin
@@ -1,47 +1,71 @@
1
- declare const _default: {
2
- "name": "GapPlugin",
3
- "description": "把 rowGap / columnGap 收敛到一处配置,并支持按窗口宽度切换间距(窄屏 8px、宽屏 16px 这类)。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "layout",
7
- "间距"
8
- ],
9
- "config": [
1
+ declare const _default: {
2
+ "name": "GapPlugin",
3
+ "description": "把 rowGap / columnGap 收敛到一处配置,并支持按窗口宽度切换间距(窄屏 8px、宽屏 16px 这类)。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "layout",
7
+ "间距"
8
+ ],
9
+ "events": [
10
+ {
11
+ "name": "onMount",
12
+ "when": "瀑布流挂载完成",
13
+ "description": "初始化观察器与滚动监听,返回清理函数"
14
+ },
10
15
  {
11
- "name": "columnGap",
12
- "type": "number",
13
- "default": "props.columnGap",
14
- "description": "列间距 px"
16
+ "name": "onResize",
17
+ "when": "容器宽度变化触发重排前",
18
+ "description": "按新宽度调整列数或卡片密度"
15
19
  },
16
20
  {
17
- "name": "rowGap",
18
- "type": "number",
19
- "default": "props.rowGap",
20
- "description": "行间距 px"
21
+ "name": "transformProps",
22
+ "when": "渲染前链式改写瀑布流 props",
23
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
21
24
  },
22
25
  {
23
- "name": "responsive",
24
- "type": "{ sm?, md?, lg?, xl? }",
25
- "default": "—",
26
- "description": "断点覆盖(按 window 宽度)"
26
+ "name": "props:invalidate",
27
+ "when": "内部布局参数变更需要重排时",
28
+ "description": "通知宿主刷新 props 触发重新布局"
27
29
  }
28
30
  ],
29
- "example": "// 统一控制行/列间距,支持按断点给不同间距。\nconst Waterfall = withPlugins(WaterfallCore, [\n createGapPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
30
- "features": [
31
- "行列间距一处配置",
32
- "断点覆盖(sm/md/lg/xl)",
33
- "不填则回退到 props"
34
- ],
35
- "useCases": [
36
- "设计规范里间距随断点变化",
37
- "同一组件在不同页面用不同密度"
38
- ],
39
- "notes": [
40
- "断点判断用的是 window.innerWidth(间距通常跟视口走,与列数按容器算不一样)。",
41
- "断点是「命中即覆盖」:桌面窗口 ≥1200 又配了 responsive.lg,那就一直是 lg 的值,config.columnGap/rowGap 在这档不起作用;想让手写值生效就别给该档位配 responsive。",
42
- "sm 只在小屏(<768)生效,不会被当成兜底档套到桌面端。"
43
- ]
44
- }
31
+ "methods": [],
32
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
33
+ "config": [
34
+ {
35
+ "name": "columnGap",
36
+ "type": "number",
37
+ "default": "props.columnGap",
38
+ "description": "列间距 px"
39
+ },
40
+ {
41
+ "name": "rowGap",
42
+ "type": "number",
43
+ "default": "props.rowGap",
44
+ "description": "行间距 px"
45
+ },
46
+ {
47
+ "name": "responsive",
48
+ "type": "{ sm?, md?, lg?, xl? }",
49
+ "default": "—",
50
+ "description": "断点覆盖(按 window 宽度)"
51
+ }
52
+ ],
53
+ "example": "// 统一控制行/列间距,支持按断点给不同间距。\nconst Waterfall = withPlugins(WaterfallCore, [\n createGapPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
54
+ "features": [
55
+ "行列间距一处配置",
56
+ "断点覆盖(sm/md/lg/xl)",
57
+ "不填则回退到 props"
58
+ ],
59
+ "useCases": [
60
+ "设计规范里间距随断点变化",
61
+ "同一组件在不同页面用不同密度"
62
+ ],
63
+ "notes": [
64
+ "断点判断用的是 window.innerWidth(间距通常跟视口走,与列数按容器算不一样)。",
65
+ "断点是「命中即覆盖」:桌面窗口 ≥1200 又配了 responsive.lg,那就一直是 lg 的值,config.columnGap/rowGap 在这档不起作用;想让手写值生效就别给该档位配 responsive。",
66
+ "sm 只在小屏(<768)生效,不会被当成兜底档套到桌面端。"
67
+ ]
68
+ }
45
69
  ;
46
70
 
47
71
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as a, d as e } from "../../chunks/doc-BSnWbrkH.js";
1
+ import { c as a, d as e } from "../../chunks/doc-C2L8kkeI.js";
2
2
  const c = Object.assign(a, { meta: e });
3
3
  export {
4
4
  c as createGapPlugin
@@ -1,40 +1,69 @@
1
- declare const _default: {
2
- "name": "GroupingPlugin",
3
- "description": "用 groupBy 把项按业务字段分组,结果放进 sharedData 的 `GROUPS`(Map<组键, 索引数组>),供 StickyHeaderPlugin、分组统计条等消费。挂载即算一次,之后 props 变化重算。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "ui",
7
- "分组"
8
- ],
9
- "config": [
1
+ declare const _default: {
2
+ "name": "GroupingPlugin",
3
+ "description": "用 groupBy 把项按业务字段分组,结果放进 sharedData 的 `GROUPS`(Map<组键, 索引数组>),供 StickyHeaderPlugin、分组统计条等消费。挂载即算一次,之后 props 变化重算。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "ui",
7
+ "分组"
8
+ ],
9
+ "events": [
10
+ {
11
+ "name": "onMount",
12
+ "when": "瀑布流挂载完成",
13
+ "description": "初始化观察器与滚动监听,返回清理函数"
14
+ },
15
+ {
16
+ "name": "onPropsChange",
17
+ "when": "props 变化后",
18
+ "description": "数据或配置变化时请求重排"
19
+ },
10
20
  {
11
- "name": "groupBy",
12
- "type": "(item, index) => string | number",
13
- "default": "item.category ?? \"default\"",
14
- "description": "分组函数"
21
+ "name": "onLayoutComplete",
22
+ "when": "DOM 落位完成(可安全测量)",
23
+ "description": "测量真实高度、懒加载判定、曝光上报"
15
24
  },
16
25
  {
17
- "name": "showOverlay",
18
- "type": "boolean",
19
- "default": "false",
20
- "description": "是否显示分组统计角标"
26
+ "name": "renderOverlay",
27
+ "when": "每次渲染,滚动容器内的内容层之上",
28
+ "description": "回到顶部、加载提示、浮层工具"
29
+ },
30
+ {
31
+ "name": "grouping:change",
32
+ "when": "分组结果变化时",
33
+ "description": "广播 { groups } 分组结构"
21
34
  }
22
35
  ],
23
- "example": "// 按字段把项分组,结果写进 sharedData(GROUPS) 供吸顶条 / 统计用。\nconst Waterfall = withPlugins(WaterfallCore, [\n createGroupingPlugin({\n groupBy: \"item.category ?? \\\"default\\\"\",\n showOverlay: false,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
24
- "features": [
25
- "挂载即计算(旧版只在 props 变化时算,首屏永远拿不到分组)",
26
- "结果写 sharedData,跨插件可读",
27
- "统计角标默认关闭"
28
- ],
29
- "useCases": [
30
- "按分类分组的信息流",
31
- "按日期分组的时间线",
32
- "吸顶条显示当前分组"
33
- ],
34
- "notes": [
35
- "分组只产出索引映射,不改变渲染顺序;要视觉分组请自己按分组建行。"
36
- ]
37
- }
36
+ "methods": [],
37
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
38
+ "config": [
39
+ {
40
+ "name": "groupBy",
41
+ "type": "(item, index) => string | number",
42
+ "default": "item.category ?? \"default\"",
43
+ "description": "分组函数"
44
+ },
45
+ {
46
+ "name": "showOverlay",
47
+ "type": "boolean",
48
+ "default": "false",
49
+ "description": "是否显示分组统计角标"
50
+ }
51
+ ],
52
+ "example": "// 按字段把项分组,结果写进 sharedData(GROUPS) 供吸顶条 / 统计用。\nconst Waterfall = withPlugins(WaterfallCore, [\n createGroupingPlugin({\n groupBy: \"item.category ?? \\\"default\\\"\",\n showOverlay: false,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
53
+ "features": [
54
+ "挂载即计算(旧版只在 props 变化时算,首屏永远拿不到分组)",
55
+ "结果写 sharedData,跨插件可读",
56
+ "统计角标默认关闭"
57
+ ],
58
+ "useCases": [
59
+ "按分类分组的信息流",
60
+ "按日期分组的时间线",
61
+ "吸顶条显示当前分组"
62
+ ],
63
+ "notes": [
64
+ "分组只产出索引映射,不改变渲染顺序;要视觉分组请自己按分组建行。"
65
+ ]
66
+ }
38
67
  ;
39
68
 
40
69
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as o } from "../../chunks/doc-BXaJl1By.js";
1
+ import { c as e, d as o } from "../../chunks/doc-BU0CKW63.js";
2
2
  const t = Object.assign(e, { meta: o });
3
3
  export {
4
4
  t as createGroupingPlugin
@@ -7,6 +7,30 @@ declare const _default: {
7
7
  "埋点",
8
8
  "曝光"
9
9
  ],
10
+ "events": [
11
+ {
12
+ "name": "onItemClick",
13
+ "when": "单个卡片被点击",
14
+ "description": "卡片级跳转与点击埋点"
15
+ },
16
+ {
17
+ "name": "onItemEnterViewport",
18
+ "when": "单个卡片进入视口",
19
+ "description": "卡片级曝光、视频自动播放等"
20
+ },
21
+ {
22
+ "name": "onLayoutComplete",
23
+ "when": "DOM 落位完成(可安全测量)",
24
+ "description": "测量真实高度、懒加载判定、曝光上报"
25
+ },
26
+ {
27
+ "name": "renderOverlay",
28
+ "when": "每次渲染,滚动容器内的内容层之上",
29
+ "description": "回到顶部、加载提示、浮层工具"
30
+ }
31
+ ],
32
+ "methods": [],
33
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
10
34
  "config": [
11
35
  {
12
36
  "name": "showOverlay",
@@ -1,4 +1,4 @@
1
- import { c as a, d as t } from "../../chunks/doc-a0MK2S3n.js";
1
+ import { c as a, d as t } from "../../chunks/doc-CE1DGMBV.js";
2
2
  const c = Object.assign(a, { meta: t });
3
3
  export {
4
4
  c as createHeatmapAnalyticsPlugin
@@ -1,44 +1,63 @@
1
- declare const _default: {
2
- "name": "InfiniteScrollPlugin",
3
- "description": "监听 Core 的 onReachBottom,在距底部 `threshold` 像素内触发 onLoadMore。自带并发锁:上一次还没结束不会重复触发。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "data",
7
- "加载更多"
8
- ],
9
- "config": [
1
+ declare const _default: {
2
+ "name": "InfiniteScrollPlugin",
3
+ "description": "监听 Core 的 onReachBottom,在距底部 `threshold` 像素内触发 onLoadMore。自带并发锁:上一次还没结束不会重复触发。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "data",
7
+ "加载更多"
8
+ ],
9
+ "events": [
10
+ {
11
+ "name": "onUnmount",
12
+ "when": "瀑布流卸载前",
13
+ "description": "断开观察器、移除滚动监听"
14
+ },
10
15
  {
11
- "name": "threshold",
12
- "type": "number",
13
- "default": "300",
14
- "description": "触发距离 px"
16
+ "name": "onReachBottom",
17
+ "when": "滚动触底(distance 为距底像素)",
18
+ "description": "加载更多、预取下一页"
15
19
  },
16
20
  {
17
- "name": "onLoadMore",
18
- "type": "() => void | Promise<void>",
19
- "default": "props.onLoadMore",
20
- "description": "加载回调"
21
+ "name": "transformProps",
22
+ "when": "渲染前链式改写瀑布流 props",
23
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
21
24
  }
22
25
  ],
23
- "example": "// 滚动到距底部阈值内触发加载更多,带并发锁防重复请求。\nconst Waterfall = withPlugins(WaterfallCore, [\n createInfiniteScrollPlugin({\n threshold: 300,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
24
- "conflicts": [
25
- "PaginationPlugin"
26
- ],
27
- "features": [
28
- "距底 300px 预加载,滚到底时数据已就位",
29
- "并发锁:加载中不重复触发",
30
- "context.hasMore 为 false 时自动停"
31
- ],
32
- "useCases": [
33
- "信息流无限滚动",
34
- "画廊继续加载",
35
- "搜索结果瀑布流"
36
- ],
37
- "notes": [
38
- "阈值不要小于一屏(约 600px),否则用户滚到底会看到空白等待。",
39
- "翻页类场景请用 PaginationPlugin,两者不要同装。"
40
- ]
41
- }
26
+ "methods": [],
27
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
28
+ "config": [
29
+ {
30
+ "name": "threshold",
31
+ "type": "number",
32
+ "default": "300",
33
+ "description": "触发距离 px"
34
+ },
35
+ {
36
+ "name": "onLoadMore",
37
+ "type": "() => void | Promise<void>",
38
+ "default": "props.onLoadMore",
39
+ "description": "加载回调"
40
+ }
41
+ ],
42
+ "example": "// 滚动到距底部阈值内触发加载更多,带并发锁防重复请求。\nconst Waterfall = withPlugins(WaterfallCore, [\n createInfiniteScrollPlugin({\n threshold: 300,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
43
+ "conflicts": [
44
+ "PaginationPlugin"
45
+ ],
46
+ "features": [
47
+ "距底 300px 预加载,滚到底时数据已就位",
48
+ "并发锁:加载中不重复触发",
49
+ "context.hasMore 为 false 时自动停"
50
+ ],
51
+ "useCases": [
52
+ "信息流无限滚动",
53
+ "画廊继续加载",
54
+ "搜索结果瀑布流"
55
+ ],
56
+ "notes": [
57
+ "阈值不要小于一屏(约 600px),否则用户滚到底会看到空白等待。",
58
+ "翻页类场景请用 PaginationPlugin,两者不要同装。"
59
+ ]
60
+ }
42
61
  ;
43
62
 
44
63
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as t } from "../../chunks/doc-BmoijI6q.js";
1
+ import { c as e, d as t } from "../../chunks/doc-HoyAFR_m.js";
2
2
  const i = Object.assign(e, { meta: t });
3
3
  export {
4
4
  i as createInfiniteScrollPlugin