vane-waterfall 2.0.1 → 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 (134) hide show
  1. package/README.md +4 -4
  2. package/dist/chunks/WaterfallCore-EdAZuWAY.js +695 -0
  3. package/dist/chunks/doc-BAhVW3g8.js +150 -0
  4. package/dist/chunks/doc-BU0CKW63.js +156 -0
  5. package/dist/chunks/doc-BrEd0oZB.js +100 -0
  6. package/dist/chunks/{doc-bTHwfIVb.js → doc-Bud0hbaz.js} +39 -25
  7. package/dist/chunks/{doc-DukOmDCo.js → doc-C-B3zK2o.js} +52 -23
  8. package/dist/chunks/{doc-DElLNjIc.js → doc-C206ZwYC.js} +33 -24
  9. package/dist/chunks/doc-C2L8kkeI.js +112 -0
  10. package/dist/chunks/doc-CE1DGMBV.js +166 -0
  11. package/dist/chunks/{doc-BXSy2aPP.js → doc-CHbQXLwY.js} +33 -19
  12. package/dist/chunks/{doc-BfWnfTst.js → doc-CInpKZNU.js} +38 -24
  13. package/dist/chunks/{doc-gTAsLjVx.js → doc-CYxwSuG6.js} +30 -16
  14. package/dist/chunks/{doc-DzvTrZ13.js → doc-CaJ02INP.js} +25 -16
  15. package/dist/chunks/{doc-BXElhF2h.js → doc-CiCso5Ti.js} +44 -30
  16. package/dist/chunks/doc-CkuMr8Ca.js +118 -0
  17. package/dist/chunks/{doc-3Fpag2G8.js → doc-D7m1OFCW.js} +38 -24
  18. package/dist/chunks/doc-DEN2WTDh.js +153 -0
  19. package/dist/chunks/{doc-C5xrHNoC.js → doc-DhICh9S2.js} +37 -23
  20. package/dist/chunks/doc-DlJICsyN.js +100 -0
  21. package/dist/chunks/{doc-BtzhgTYj.js → doc-DtxS1-P0.js} +35 -26
  22. package/dist/chunks/{doc-BIzjYAZW.js → doc-DudYCn_-.js} +25 -16
  23. package/dist/chunks/doc-HoyAFR_m.js +101 -0
  24. package/dist/chunks/doc-RlBMCMNs.js +170 -0
  25. package/dist/chunks/doc-RwKQqySd.js +102 -0
  26. package/dist/chunks/{doc-CTUoMe7o.js → doc-eYhNJy97.js} +31 -22
  27. package/dist/chunks/{doc-CcPFavOs.js → doc-i6FY1We1.js} +27 -13
  28. package/dist/chunks/doc-skPl6ZMP.js +101 -0
  29. package/dist/chunks/index-8gEIzUxi.js +15 -0
  30. package/dist/chunks/index-B96I5CKE.js +21 -0
  31. package/dist/chunks/index-Bjmhy8jW.js +11 -0
  32. package/dist/chunks/index-Cuq0ofv-.js +13 -0
  33. package/dist/chunks/{index-BAWlVYr3.js → index-Cz4YEqRF.js} +1 -1
  34. package/dist/chunks/{index-wLI6UXkY.js → index-FBJVUYmH.js} +1 -1
  35. package/dist/chunks/withPlugins-BOeDFhof.js +743 -0
  36. package/dist/components/WaterfallPlugin/WaterfallCore.d.ts +19 -0
  37. package/dist/components/WaterfallPlugin/WaterfallCore.d.ts.map +1 -1
  38. package/dist/components/WaterfallPlugin/layout.d.ts +7 -0
  39. package/dist/components/WaterfallPlugin/layout.d.ts.map +1 -1
  40. package/dist/components/WaterfallPlugin/plugins/types.d.ts +3 -0
  41. package/dist/components/WaterfallPlugin/plugins/types.d.ts.map +1 -1
  42. package/dist/components/WaterfallPlugin/withPlugins.d.ts.map +1 -1
  43. package/dist/custom-plugins/A11yPlugin/create.d.ts.map +1 -1
  44. package/dist/custom-plugins/A11yPlugin/doc.json.d.ts +64 -40
  45. package/dist/custom-plugins/A11yPlugin/index.js +1 -1
  46. package/dist/custom-plugins/AlignmentPlugin/doc.json.d.ts +42 -28
  47. package/dist/custom-plugins/AlignmentPlugin/index.js +1 -1
  48. package/dist/custom-plugins/AutoColumnPlugin/doc.json.d.ts +53 -44
  49. package/dist/custom-plugins/AutoColumnPlugin/index.js +1 -1
  50. package/dist/custom-plugins/BookmarkPlugin/create.d.ts.map +1 -1
  51. package/dist/custom-plugins/BookmarkPlugin/doc.json.d.ts +44 -35
  52. package/dist/custom-plugins/BookmarkPlugin/index.js +1 -1
  53. package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts +2 -0
  54. package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts.map +1 -1
  55. package/dist/custom-plugins/ClickAnalyticsPlugin/doc.json.d.ts +29 -0
  56. package/dist/custom-plugins/ClickAnalyticsPlugin/index.js +1 -1
  57. package/dist/custom-plugins/DebounceLayoutPlugin/doc.json.d.ts +37 -28
  58. package/dist/custom-plugins/DebounceLayoutPlugin/index.js +1 -1
  59. package/dist/custom-plugins/DragReorderPlugin/doc.json.d.ts +14 -0
  60. package/dist/custom-plugins/DragReorderPlugin/index.js +1 -1
  61. package/dist/custom-plugins/FilterPlugin/doc.json.d.ts +53 -39
  62. package/dist/custom-plugins/FilterPlugin/index.js +1 -1
  63. package/dist/custom-plugins/FixedHeightPlugin/doc.json.d.ts +42 -28
  64. package/dist/custom-plugins/FixedHeightPlugin/index.js +1 -1
  65. package/dist/custom-plugins/GapPlugin/create.d.ts.map +1 -1
  66. package/dist/custom-plugins/GapPlugin/doc.json.d.ts +61 -37
  67. package/dist/custom-plugins/GapPlugin/index.js +1 -1
  68. package/dist/custom-plugins/GroupingPlugin/create.d.ts.map +1 -1
  69. package/dist/custom-plugins/GroupingPlugin/doc.json.d.ts +61 -32
  70. package/dist/custom-plugins/GroupingPlugin/index.js +1 -1
  71. package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts +2 -0
  72. package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts.map +1 -1
  73. package/dist/custom-plugins/HeatmapAnalyticsPlugin/doc.json.d.ts +24 -0
  74. package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.js +1 -1
  75. package/dist/custom-plugins/InfiniteScrollPlugin/create.d.ts.map +1 -1
  76. package/dist/custom-plugins/InfiniteScrollPlugin/doc.json.d.ts +55 -36
  77. package/dist/custom-plugins/InfiniteScrollPlugin/index.js +1 -1
  78. package/dist/custom-plugins/PaginationPlugin/create.d.ts.map +1 -1
  79. package/dist/custom-plugins/PaginationPlugin/doc.json.d.ts +56 -42
  80. package/dist/custom-plugins/PaginationPlugin/index.js +1 -1
  81. package/dist/custom-plugins/PinItemPlugin/doc.json.d.ts +49 -35
  82. package/dist/custom-plugins/PinItemPlugin/index.js +1 -1
  83. package/dist/custom-plugins/RecyclePlugin/create.d.ts.map +1 -1
  84. package/dist/custom-plugins/RecyclePlugin/doc.json.d.ts +57 -28
  85. package/dist/custom-plugins/RecyclePlugin/index.js +1 -1
  86. package/dist/custom-plugins/ReducedMotionPlugin/doc.json.d.ts +29 -0
  87. package/dist/custom-plugins/ReducedMotionPlugin/index.js +1 -1
  88. package/dist/custom-plugins/ResponsiveColumnsPlugin/doc.json.d.ts +40 -31
  89. package/dist/custom-plugins/ResponsiveColumnsPlugin/index.js +1 -1
  90. package/dist/custom-plugins/ScrollAnchorPlugin/doc.json.d.ts +42 -28
  91. package/dist/custom-plugins/ScrollAnchorPlugin/index.js +1 -1
  92. package/dist/custom-plugins/SearchPlugin/doc.json.d.ts +53 -39
  93. package/dist/custom-plugins/SearchPlugin/index.js +1 -1
  94. package/dist/custom-plugins/SortPlugin/doc.json.d.ts +52 -38
  95. package/dist/custom-plugins/SortPlugin/index.js +1 -1
  96. package/dist/custom-plugins/StatePersistencePlugin/create.d.ts.map +1 -1
  97. package/dist/custom-plugins/StatePersistencePlugin/doc.json.d.ts +71 -37
  98. package/dist/custom-plugins/StatePersistencePlugin/index.js +1 -1
  99. package/dist/custom-plugins/StickyHeaderPlugin/create.d.ts.map +1 -1
  100. package/dist/custom-plugins/StickyHeaderPlugin/doc.json.d.ts +43 -34
  101. package/dist/custom-plugins/StickyHeaderPlugin/index.js +1 -1
  102. package/dist/custom-plugins/ThrottlePlugin/doc.json.d.ts +43 -34
  103. package/dist/custom-plugins/ThrottlePlugin/index.js +1 -1
  104. package/dist/custom-plugins/TransitionPlugin/doc.json.d.ts +49 -35
  105. package/dist/custom-plugins/TransitionPlugin/index.js +1 -1
  106. package/dist/custom-plugins/URLSyncPlugin/create.d.ts.map +1 -1
  107. package/dist/custom-plugins/URLSyncPlugin/doc.json.d.ts +57 -33
  108. package/dist/custom-plugins/URLSyncPlugin/index.js +1 -1
  109. package/dist/custom-plugins/index.js +6 -6
  110. package/dist/entries/core.js +1 -1
  111. package/dist/entries/plugins.js +7 -7
  112. package/dist/index.js +2 -2
  113. package/dist/presets/dashboard/index.js +2 -2
  114. package/dist/presets/photo-feed/index.js +3 -3
  115. package/dist/presets/product-feed/index.js +2 -2
  116. package/package.json +16 -8
  117. package/dist/chunks/WaterfallCore-BSXw7bl_.js +0 -581
  118. package/dist/chunks/doc-78xF08vt.js +0 -82
  119. package/dist/chunks/doc-B-7dugGv.js +0 -79
  120. package/dist/chunks/doc-B6kLfMPv.js +0 -121
  121. package/dist/chunks/doc-BCGQ8Cp5.js +0 -114
  122. package/dist/chunks/doc-BP0DmB7-.js +0 -91
  123. package/dist/chunks/doc-CBHjiDG7.js +0 -88
  124. package/dist/chunks/doc-CraXjOaA.js +0 -68
  125. package/dist/chunks/doc-DJjxOYzW.js +0 -111
  126. package/dist/chunks/doc-NhL4Ux8q.js +0 -125
  127. package/dist/chunks/doc-f4Uijujv.js +0 -102
  128. package/dist/chunks/doc-j4W9SUrY.js +0 -76
  129. package/dist/chunks/doc-kTbJE7rY.js +0 -92
  130. package/dist/chunks/index-COaun3nf.js +0 -15
  131. package/dist/chunks/index-DXAtA2f6.js +0 -11
  132. package/dist/chunks/index-DsRLmBW-.js +0 -13
  133. package/dist/chunks/index-gjoCq0yC.js +0 -21
  134. package/dist/chunks/withPlugins-DLoKg4AP.js +0 -559
@@ -0,0 +1,102 @@
1
+ function b(n = {}) {
2
+ const l = n.fields ?? [];
3
+ return {
4
+ name: "SearchPlugin",
5
+ priority: 20,
6
+ enabled: !0,
7
+ hooks: {
8
+ transformProps: (e) => {
9
+ const t = String(e.searchQuery ?? "").trim(), o = Array.isArray(e.items) ? e.items : [];
10
+ if (!t) return e;
11
+ const r = t.toLowerCase(), a = o.filter((s) => {
12
+ if (typeof s != "object" || s === null) return !1;
13
+ const i = l.length > 0 ? l : Object.keys(s);
14
+ for (const c of i) {
15
+ const u = s[c];
16
+ if (u != null && String(u).toLowerCase().includes(r)) return !0;
17
+ }
18
+ return !1;
19
+ });
20
+ return { ...e, items: a };
21
+ },
22
+ onPropsChange: (e, t, o) => {
23
+ const r = String(t?.searchQuery ?? ""), a = String(o?.searchQuery ?? "");
24
+ if (((typeof o?.scrollToTopOnSearchChange == "boolean" ? o.scrollToTopOnSearchChange : void 0) ?? !!n.scrollToTop) && r !== a) {
25
+ const c = o?.scrollToTopBehavior ?? n.scrollBehavior ?? "auto";
26
+ e.scrollToTop?.({ behavior: c });
27
+ }
28
+ }
29
+ }
30
+ };
31
+ }
32
+ const d = "SearchPlugin", h = "读取 `props.searchQuery`,在指定字段上做大小写不敏感的 `includes` 匹配。没指定字段就对对象的全部自有字段匹配。", f = "2.0.0", p = [
33
+ "data",
34
+ "数据管线",
35
+ "搜索"
36
+ ], m = [
37
+ {
38
+ name: "onPropsChange",
39
+ when: "props 变化后",
40
+ description: "数据或配置变化时请求重排"
41
+ },
42
+ {
43
+ name: "transformProps",
44
+ when: "渲染前链式改写瀑布流 props",
45
+ description: "补 gap / columns 默认值、按断点覆盖配置"
46
+ }
47
+ ], y = [], g = "只读取 context 字段(props / state / data),不调用上下文方法", T = [
48
+ {
49
+ name: "fields",
50
+ type: "(keyof T)[]",
51
+ default: "[]",
52
+ description: "参与匹配的字段;空则匹配全部自有字段"
53
+ },
54
+ {
55
+ name: "scrollToTop",
56
+ type: "boolean",
57
+ default: "false",
58
+ description: "关键词变化后回顶"
59
+ },
60
+ {
61
+ name: "scrollBehavior",
62
+ type: '"auto" | "smooth"',
63
+ default: '"auto"',
64
+ description: "回顶行为"
65
+ }
66
+ ], S = `// 按 props.searchQuery 做大小写不敏感的多字段包含匹配。
67
+ const Waterfall = withPlugins(WaterfallCore, [
68
+ createSearchPlugin({
69
+ fields: [],
70
+ scrollToTop: false,
71
+ scrollBehavior: "auto",
72
+ }),
73
+ ]);
74
+
75
+ <Waterfall items={items} renderItem={(item) => <Card data={item} />} />;`, v = [
76
+ "大小写不敏感",
77
+ "多字段 OR 匹配",
78
+ "空关键词直接放行(不触发过滤)"
79
+ ], C = [
80
+ "站内搜索结果页",
81
+ "后台列表即时搜索",
82
+ "商品名 / 店铺名联合搜索"
83
+ ], P = [
84
+ "纯前端 `includes`,不排序也不做拼音;要相关性排序请在 Search 之后接 SortPlugin。"
85
+ ], Q = {
86
+ name: d,
87
+ description: h,
88
+ since: f,
89
+ tags: p,
90
+ events: m,
91
+ methods: y,
92
+ methodsNote: g,
93
+ config: T,
94
+ example: S,
95
+ features: v,
96
+ useCases: C,
97
+ notes: P
98
+ };
99
+ export {
100
+ b as c,
101
+ Q as d
102
+ };
@@ -1,4 +1,4 @@
1
- function b(n) {
1
+ function w(n) {
2
2
  if (!(n.minColumnWidth > 0))
3
3
  throw new Error("[vane-waterfall] AutoColumnPlugin 需要正数的 minColumnWidth");
4
4
  return {
@@ -6,14 +6,14 @@ function b(n) {
6
6
  priority: 55,
7
7
  enabled: !0,
8
8
  hooks: {
9
- calculateColumns: (s, i) => {
10
- const t = s.props, e = t.columnGap ?? t.gap ?? 0, o = t.padding, l = typeof o == "number" ? o * 2 : (o?.left ?? 0) + (o?.right ?? 0), a = Math.max(0, i - l);
11
- if (!a) return t.columns ?? 1;
12
- const m = Math.max(
9
+ calculateColumns: (a, m) => {
10
+ const t = a.props, e = t.columnGap ?? t.gap ?? 0, o = t.padding, i = typeof o == "number" ? o * 2 : (o?.left ?? 0) + (o?.right ?? 0), s = Math.max(0, m - i);
11
+ if (!s) return t.columns ?? 1;
12
+ const l = Math.max(
13
13
  1,
14
- Math.floor((a + e) / (n.minColumnWidth + e))
14
+ Math.floor((s + e) / (n.minColumnWidth + e))
15
15
  ), u = Math.max(1, n.minColumns ?? 1), c = n.maxColumns ?? Number.POSITIVE_INFINITY;
16
- return Math.min(Math.max(m, u), c);
16
+ return Math.min(Math.max(l, u), c);
17
17
  }
18
18
  }
19
19
  };
@@ -22,7 +22,13 @@ const r = "AutoColumnPlugin", d = "按「容器可用宽度 ÷ 最小列宽」
22
22
  "layout",
23
23
  "layout-hook",
24
24
  "响应式"
25
- ], f = [
25
+ ], h = [
26
+ {
27
+ name: "calculateColumns",
28
+ when: "每次布局前,询问列数",
29
+ description: "返回列数则覆盖 props.columns;返回 undefined 沿用配置"
30
+ }
31
+ ], f = [], g = "只读取 context 字段(props / state / data),不调用上下文方法", x = [
26
32
  {
27
33
  name: "minColumnWidth",
28
34
  type: "number",
@@ -41,7 +47,7 @@ const r = "AutoColumnPlugin", d = "按「容器可用宽度 ÷ 最小列宽」
41
47
  default: "1",
42
48
  description: "列数下限"
43
49
  }
44
- ], h = `// 按容器宽与最小列宽自动算列数,窄屏自动降列。
50
+ ], P = `// 按容器宽与最小列宽自动算列数,窄屏自动降列。
45
51
  const Waterfall = withPlugins(WaterfallCore, [
46
52
  createAutoColumnPlugin({
47
53
  maxColumns: "Infinity",
@@ -49,31 +55,34 @@ const Waterfall = withPlugins(WaterfallCore, [
49
55
  }),
50
56
  ]);
51
57
 
52
- <Waterfall items={items} renderItem={(item) => <Card data={item} />} />;`, g = [
58
+ <Waterfall items={items} renderItem={(item) => <Card data={item} />} />;`, y = [
53
59
  "ResponsiveColumnsPlugin"
54
- ], x = [
60
+ ], b = [
55
61
  "按容器宽度(不是视口宽度)算列数",
56
62
  "列数上下限可夹",
57
63
  "与 Gap / Padding 一起算,留白不吞列宽"
58
- ], P = [
64
+ ], I = [
59
65
  "响应式信息流",
60
66
  "侧边栏宽度可拖动的后台看板",
61
67
  "移动端 → 桌面端同一套代码"
62
- ], y = [
68
+ ], W = [
63
69
  "与 ResponsiveColumnsPlugin 同时装会互相覆盖列数,只选一个。"
64
- ], I = {
70
+ ], v = {
65
71
  name: r,
66
72
  description: d,
67
73
  since: p,
68
74
  tags: C,
69
- config: f,
70
- example: h,
71
- conflicts: g,
72
- features: x,
73
- useCases: P,
74
- notes: y
75
+ events: h,
76
+ methods: f,
77
+ methodsNote: g,
78
+ config: x,
79
+ example: P,
80
+ conflicts: y,
81
+ features: b,
82
+ useCases: I,
83
+ notes: W
75
84
  };
76
85
  export {
77
- b as c,
78
- I as d
86
+ w as c,
87
+ v as d
79
88
  };
@@ -1,12 +1,12 @@
1
- function d(n) {
1
+ function x(n) {
2
2
  return {
3
3
  name: "FixedHeightPlugin",
4
4
  priority: 45,
5
5
  enabled: !0,
6
6
  hooks: {
7
7
  transformProps: (t) => {
8
- const { itemHeight: i } = n, s = (t.items || []).map((e) => typeof e == "object" && e !== null && "height" in e ? { ...e, height: i } : e);
9
- return { ...t, items: s };
8
+ const { itemHeight: s } = n, o = (t.items || []).map((e) => typeof e == "object" && e !== null && "height" in e ? { ...e, height: s } : e);
9
+ return { ...t, items: o };
10
10
  },
11
11
  onResize: (t) => {
12
12
  t.relayout?.();
@@ -14,10 +14,21 @@ function d(n) {
14
14
  }
15
15
  };
16
16
  }
17
- const o = "FixedHeightPlugin", a = "把数据里带 height 字段的项统一改写为固定高度,瀑布流变成等高网格。适合「图少字多」的卡片流——等高反而更好扫读。", r = "2.0.0", c = [
17
+ const i = "FixedHeightPlugin", a = "把数据里带 height 字段的项统一改写为固定高度,瀑布流变成等高网格。适合「图少字多」的卡片流——等高反而更好扫读。", r = "2.0.0", c = [
18
18
  "layout",
19
19
  "网格"
20
- ], g = [
20
+ ], h = [
21
+ {
22
+ name: "onResize",
23
+ when: "容器宽度变化触发重排前",
24
+ description: "按新宽度调整列数或卡片密度"
25
+ },
26
+ {
27
+ name: "transformProps",
28
+ when: "渲染前链式改写瀑布流 props",
29
+ description: "补 gap / columns 默认值、按断点覆盖配置"
30
+ }
31
+ ], m = [], d = "只读取 context 字段(props / state / data),不调用上下文方法", g = [
21
32
  {
22
33
  name: "itemHeight",
23
34
  type: "number",
@@ -33,24 +44,27 @@ const Waterfall = withPlugins(WaterfallCore, [
33
44
  "等高网格(严格对齐)",
34
45
  "只改数据里已有的 height 字段",
35
46
  "与 Pagination / Filter 组合仍然成立"
36
- ], h = [
47
+ ], p = [
37
48
  "商品列表(图固定比例)",
38
49
  "后台看板卡片",
39
50
  "需要严格栅格对齐的页面"
40
- ], m = [
51
+ ], f = [
41
52
  "数据里没有 height 字段时不会生效——高度由 renderItem 自己的内容决定。"
42
- ], f = {
43
- name: o,
53
+ ], P = {
54
+ name: i,
44
55
  description: a,
45
56
  since: r,
46
57
  tags: c,
58
+ events: h,
59
+ methods: m,
60
+ methodsNote: d,
47
61
  config: g,
48
62
  example: l,
49
63
  features: u,
50
- useCases: h,
51
- notes: m
64
+ useCases: p,
65
+ notes: f
52
66
  };
53
67
  export {
54
- d as c,
55
- f as d
68
+ x as c,
69
+ P as d
56
70
  };
@@ -0,0 +1,101 @@
1
+ function y(s) {
2
+ const n = /* @__PURE__ */ new Set(), o = (i) => {
3
+ if (n.size <= s.poolSize) return;
4
+ const e = n.values().next().value;
5
+ if (typeof e == "number") {
6
+ n.delete(e);
7
+ const t = i.getItemRef(e);
8
+ t && (t.style.visibility = "hidden");
9
+ }
10
+ };
11
+ return {
12
+ name: "RecyclePlugin",
13
+ enabled: !0,
14
+ hooks: {
15
+ onItemEnterViewport: (i, e) => {
16
+ const t = i.getItemRef(e);
17
+ t && (t.style.visibility = "visible"), n.add(e), o(i);
18
+ },
19
+ onItemLeaveViewport: (i, e) => {
20
+ const t = i.getItemRef(e);
21
+ t && (t.style.visibility = "hidden"), n.delete(e);
22
+ },
23
+ onItemUnmount: (i, e) => {
24
+ n.delete(e);
25
+ },
26
+ onUnmount: () => {
27
+ n.clear();
28
+ }
29
+ }
30
+ };
31
+ }
32
+ const c = "RecyclePlugin", l = "纯绘制层优化:项离开视口就 `visibility: hidden`,回来再显示。DOM 节点不销毁,滚动位置与已加载的图片都保留,适合「项里有视频/Canvas,重建代价高」的场景。", a = "2.0.0", r = [
33
+ "interaction",
34
+ "性能"
35
+ ], m = [
36
+ {
37
+ name: "onUnmount",
38
+ when: "瀑布流卸载前",
39
+ description: "断开观察器、移除滚动监听"
40
+ },
41
+ {
42
+ name: "onItemUnmount",
43
+ when: "单个卡片卸载时",
44
+ description: "解绑该卡片的监听与观察器"
45
+ },
46
+ {
47
+ name: "onItemEnterViewport",
48
+ when: "单个卡片进入视口",
49
+ description: "卡片级曝光、视频自动播放等"
50
+ },
51
+ {
52
+ name: "onItemLeaveViewport",
53
+ when: "单个卡片离开视口",
54
+ description: "暂停播放、回收资源"
55
+ }
56
+ ], d = [
57
+ {
58
+ name: "getItemRef",
59
+ signature: "ctx.getItemRef(index: number): HTMLElement | null",
60
+ description: "取第 index 张卡片的 DOM 引用,可能为 null(尚未挂载 / 已回收)"
61
+ }
62
+ ], u = [
63
+ {
64
+ name: "poolSize",
65
+ type: "number",
66
+ default: "—",
67
+ description: "同时保持可见的项数上限(超出则回收最早的)"
68
+ }
69
+ ], f = `// 视口外的项设 \`visibility: hidden\`,降低长列表的绘制压力。
70
+ const Waterfall = withPlugins(WaterfallCore, [
71
+ createRecyclePlugin(),
72
+ ]);
73
+
74
+ <Waterfall items={items} renderItem={(item) => <Card data={item} />} />;`, p = [
75
+ "不销毁 DOM,只隐藏",
76
+ "项内媒体不重新加载",
77
+ "与虚拟化正交(一个省绘制、一个省节点)"
78
+ ], v = [
79
+ "项内含视频 / canvas",
80
+ "长列表滚动发虚",
81
+ "低端设备省电"
82
+ ], g = [
83
+ "与 Core 的 `virtualize` 同开会让项被卸载又隐藏,收益互相抵消,建议只选一个。",
84
+ "只改 visibility 不改布局,所以不会引起重排。"
85
+ ], b = {
86
+ name: c,
87
+ description: l,
88
+ since: a,
89
+ tags: r,
90
+ events: m,
91
+ methods: d,
92
+ config: u,
93
+ example: f,
94
+ features: p,
95
+ useCases: v,
96
+ notes: g
97
+ };
98
+ export {
99
+ y as c,
100
+ b as d
101
+ };
@@ -0,0 +1,15 @@
1
+ import { c as a, d as e } from "./doc-C206ZwYC.js";
2
+ import { c as t, d as s } from "./doc-i6FY1We1.js";
3
+ import { c, d as i } from "./doc-D7m1OFCW.js";
4
+ import { c as n, d as o } from "./doc-CInpKZNU.js";
5
+ import { c as r, d as g } from "./doc-DlJICsyN.js";
6
+ import { c as l, d as m } from "./doc-DEN2WTDh.js";
7
+ const f = Object.assign(a, { meta: e }), j = Object.assign(t, { meta: s }), O = Object.assign(c, { meta: i }), C = Object.assign(n, { meta: o }), F = Object.assign(r, { meta: g }), x = Object.assign(l, { meta: m });
8
+ export {
9
+ O as a,
10
+ j as b,
11
+ x as c,
12
+ F as d,
13
+ f as e,
14
+ C as f
15
+ };
@@ -0,0 +1,21 @@
1
+ import { c as a, d as e } from "./doc-CYxwSuG6.js";
2
+ import { c, d as t } from "./doc-Bud0hbaz.js";
3
+ import { c as s, d as r } from "./doc-RwKQqySd.js";
4
+ import { c as n, d as i } from "./doc-CE1DGMBV.js";
5
+ import { c as o, d as g } from "./doc-CiCso5Ti.js";
6
+ import { c as m, d as l } from "./doc-CHbQXLwY.js";
7
+ import { c as d, d as u } from "./doc-BU0CKW63.js";
8
+ import { c as P, d as $ } from "./doc-DtxS1-P0.js";
9
+ import { c as p, d as b } from "./doc-BAhVW3g8.js";
10
+ const k = Object.assign(a, { meta: e }), D = Object.assign(c, { meta: t }), G = Object.assign(s, { meta: r }), I = Object.assign(n, { meta: i }), L = Object.assign(o, { meta: g }), U = Object.assign(m, { meta: l }), x = Object.assign(d, { meta: u }), q = Object.assign(P, { meta: $ }), v = Object.assign(p, { meta: b });
11
+ export {
12
+ L as a,
13
+ x as b,
14
+ k as c,
15
+ I as d,
16
+ D as e,
17
+ U as f,
18
+ G as g,
19
+ q as h,
20
+ v as i
21
+ };
@@ -0,0 +1,11 @@
1
+ import { c as a, d as e } from "./doc-eYhNJy97.js";
2
+ import { c as t, d as c } from "./doc-C2L8kkeI.js";
3
+ import { c as o, d as n } from "./doc-C-B3zK2o.js";
4
+ import { c as s, d as i } from "./doc-HoyAFR_m.js";
5
+ const d = Object.assign(a, { meta: e }), g = Object.assign(t, { meta: c }), P = Object.assign(o, { meta: n }), p = Object.assign(s, { meta: i });
6
+ export {
7
+ g as a,
8
+ p as b,
9
+ d as c,
10
+ P as d
11
+ };
@@ -0,0 +1,13 @@
1
+ import { c as e, d as t } from "./doc-CaJ02INP.js";
2
+ import { c as a, d as c } from "./doc-DudYCn_-.js";
3
+ import { c as s, d as o } from "./doc-skPl6ZMP.js";
4
+ import { c as r, d as n } from "./doc-BrEd0oZB.js";
5
+ import { c as i, d as m } from "./doc-RlBMCMNs.js";
6
+ const $ = Object.assign(e, { meta: t }), b = Object.assign(a, { meta: c }), p = Object.assign(s, { meta: o }), f = Object.assign(r, { meta: n }), j = Object.assign(i, { meta: m });
7
+ export {
8
+ b as a,
9
+ p as b,
10
+ f as c,
11
+ j as d,
12
+ $ as e
13
+ };
@@ -1,4 +1,4 @@
1
- import { c as a, d as t } from "./doc-C5xrHNoC.js";
1
+ import { c as a, d as t } from "./doc-DhICh9S2.js";
2
2
  const n = Object.assign(a, { meta: t });
3
3
  export {
4
4
  n as c
@@ -1,4 +1,4 @@
1
- import { c as a, d as c } from "./doc-kTbJE7rY.js";
1
+ import { c as a, d as c } from "./doc-CkuMr8Ca.js";
2
2
  const t = Object.assign(a, { meta: c });
3
3
  export {
4
4
  t as c