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
@@ -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
@@ -1,46 +1,60 @@
1
- declare const _default: {
2
- "name": "SortPlugin",
3
- "description": "用比较函数排序,优先读 `props.sortComparator`。排序总是在过滤之后、分页之前执行,保证「第 N 页」是排序后的第 N 页。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "data",
7
- "数据管线"
8
- ],
9
- "config": [
10
- {
11
- "name": "comparator",
12
- "type": "(a, b) => number",
13
- "default": "—",
14
- "description": "默认比较函数,可被 props.sortComparator 覆盖"
15
- },
1
+ declare const _default: {
2
+ "name": "SortPlugin",
3
+ "description": "用比较函数排序,优先读 `props.sortComparator`。排序总是在过滤之后、分页之前执行,保证「第 N 页」是排序后的第 N 页。",
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 createSortPlugin({\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
30
- "features": [
31
- "稳定排序(不改原数组)",
32
- "比较函数抛错按相等处理",
33
- "与 Filter / Search 顺序固定"
34
- ],
35
- "useCases": [
36
- "价格 / 时间排序",
37
- "热度排序",
38
- "手动置顶项优先"
39
- ],
40
- "notes": [
41
- "排序会复制数组(`[...items].sort`),不会改调用方传入的 items。"
42
- ]
43
- }
21
+ "methods": [],
22
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
23
+ "config": [
24
+ {
25
+ "name": "comparator",
26
+ "type": "(a, b) => number",
27
+ "default": "—",
28
+ "description": "默认比较函数,可被 props.sortComparator 覆盖"
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 createSortPlugin({\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
44
+ "features": [
45
+ "稳定排序(不改原数组)",
46
+ "比较函数抛错按相等处理",
47
+ "与 Filter / Search 顺序固定"
48
+ ],
49
+ "useCases": [
50
+ "价格 / 时间排序",
51
+ "热度排序",
52
+ "手动置顶项优先"
53
+ ],
54
+ "notes": [
55
+ "排序会复制数组(`[...items].sort`),不会改调用方传入的 items。"
56
+ ]
57
+ }
44
58
  ;
45
59
 
46
60
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as t, d as e } from "../../chunks/doc-BfWnfTst.js";
1
+ import { c as t, d as e } from "../../chunks/doc-CInpKZNU.js";
2
2
  const r = Object.assign(t, { meta: e });
3
3
  export {
4
4
  r as createSortPlugin
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/StatePersistencePlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,sBAAsB,GAAG;IACnC,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,sBAA2B,GAAG,eAAe,CAAC,CAAC,CAAC,CAiG7G"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/StatePersistencePlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,sBAAsB,GAAG;IACnC,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,sBAA2B,GAAG,eAAe,CAAC,CAAC,CAAC,CAoH7G"}
@@ -1,47 +1,81 @@
1
- declare const _default: {
2
- "name": "StatePersistencePlugin",
3
- "description": "三个时机各做一件事:首次渲染把快照里的 pageIndex / searchQuery 注入 props;挂载后恢复 scrollTop;props 变化与卸载时写回快照。刷新页面不丢进度。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "ui",
7
- "持久化"
8
- ],
9
- "config": [
1
+ declare const _default: {
2
+ "name": "StatePersistencePlugin",
3
+ "description": "三个时机各做一件事:首次渲染把快照里的 pageIndex / searchQuery 注入 props;挂载后恢复 scrollTop;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": "onUnmount",
17
+ "when": "瀑布流卸载前",
18
+ "description": "断开观察器、移除滚动监听"
19
+ },
10
20
  {
11
- "name": "storageKey",
12
- "type": "string",
13
- "default": "\"waterfall-state\"",
14
- "description": "localStorage 键名"
21
+ "name": "onPropsChange",
22
+ "when": "props 变化后",
23
+ "description": "数据或配置变化时请求重排"
15
24
  },
16
25
  {
17
- "name": "persistScroll",
18
- "type": "boolean",
19
- "default": "true",
20
- "description": "是否持久化滚动位置"
26
+ "name": "onLayoutComplete",
27
+ "when": "DOM 落位完成(可安全测量)",
28
+ "description": "测量真实高度、懒加载判定、曝光上报"
21
29
  },
22
30
  {
23
- "name": "persistKeys",
24
- "type": "string[]",
25
- "default": "[\"pageIndex\",\"pageSize\",\"searchQuery\"]",
26
- "description": "要持久化的 props 键"
31
+ "name": "transformProps",
32
+ "when": "渲染前链式改写瀑布流 props",
33
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
34
+ },
35
+ {
36
+ "name": "state:restored",
37
+ "when": "从持久化恢复滚动位置 / 顺序后",
38
+ "description": "广播恢复后的状态快照"
27
39
  }
28
40
  ],
29
- "example": "// 把滚动位置与分页/查询状态存 localStorage,回来时恢复。\nconst Waterfall = withPlugins(WaterfallCore, [\n createStatePersistencePlugin({\n storageKey: \"waterfall-state\",\n persistScroll: true,\n persistKeys: [\"pageIndex\",\"pageSize\",\"searchQuery\"],\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
30
- "features": [
31
- "滚动位置 + 分页/查询一起存",
32
- "首帧注入只做一次,不会覆盖用户操作",
33
- "SSR / 隐私模式下降级为不持久化"
34
- ],
35
- "useCases": [
36
- "后台列表刷新不丢页",
37
- "搜索结果返回定位",
38
- "移动端来回切换页面"
39
- ],
40
- "notes": [
41
- "只能恢复「值」,不能替你把它写回 React state——页面应订阅 `state:restored` 事件或读 bus。",
42
- "localStorage 不可用(隐私模式/配额满)时静默跳过,不会抛错。"
43
- ]
44
- }
41
+ "methods": [],
42
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
43
+ "config": [
44
+ {
45
+ "name": "storageKey",
46
+ "type": "string",
47
+ "default": "\"waterfall-state\"",
48
+ "description": "localStorage 键名"
49
+ },
50
+ {
51
+ "name": "persistScroll",
52
+ "type": "boolean",
53
+ "default": "true",
54
+ "description": "是否持久化滚动位置"
55
+ },
56
+ {
57
+ "name": "persistKeys",
58
+ "type": "string[]",
59
+ "default": "[\"pageIndex\",\"pageSize\",\"searchQuery\"]",
60
+ "description": "要持久化的 props 键"
61
+ }
62
+ ],
63
+ "example": "// 把滚动位置与分页/查询状态存 localStorage,回来时恢复。\nconst Waterfall = withPlugins(WaterfallCore, [\n createStatePersistencePlugin({\n storageKey: \"waterfall-state\",\n persistScroll: true,\n persistKeys: [\"pageIndex\",\"pageSize\",\"searchQuery\"],\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
64
+ "features": [
65
+ "滚动位置 + 分页/查询一起存",
66
+ "首帧注入只做一次,不会覆盖用户操作",
67
+ "SSR / 隐私模式下降级为不持久化"
68
+ ],
69
+ "useCases": [
70
+ "后台列表刷新不丢页",
71
+ "搜索结果返回定位",
72
+ "移动端来回切换页面"
73
+ ],
74
+ "notes": [
75
+ "只能恢复「值」,不能替你把它写回 React state——页面应订阅 `state:restored` 事件或读 bus。",
76
+ "localStorage 不可用(隐私模式/配额满)时静默跳过,不会抛错。"
77
+ ]
78
+ }
45
79
  ;
46
80
 
47
81
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as t } from "../../chunks/doc-NhL4Ux8q.js";
1
+ import { c as e, d as t } from "../../chunks/doc-RlBMCMNs.js";
2
2
  const a = Object.assign(e, { meta: t });
3
3
  export {
4
4
  a as createStatePersistencePlugin
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/StickyHeaderPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,kBAAuB,GAAG,eAAe,CAAC,CAAC,CAAC,CAoCrG"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/StickyHeaderPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,kBAAuB,GAAG,eAAe,CAAC,CAAC,CAAC,CA6CrG"}
@@ -1,40 +1,49 @@
1
- declare const _default: {
2
- "name": "StickyHeaderPlugin",
3
- "description": "在滚动容器内渲染一条 `position: sticky` 的标题条,始终贴住容器顶部。装了 GroupingPlugin 时自动显示第一个分组名,也可用 title 写死。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "ui",
7
- "吸顶"
8
- ],
9
- "config": [
10
- {
11
- "name": "title",
12
- "type": "string",
13
- "default": "\"分组标题\"",
14
- "description": "标题文案"
15
- },
1
+ declare const _default: {
2
+ "name": "StickyHeaderPlugin",
3
+ "description": "在滚动容器内渲染一条 `position: sticky` 的标题条,始终贴住容器顶部。装了 GroupingPlugin 时自动显示第一个分组名,也可用 title 写死。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "ui",
7
+ "吸顶"
8
+ ],
9
+ "events": [
16
10
  {
17
- "name": "showHint",
18
- "type": "boolean",
19
- "default": "false",
20
- "description": "是否显示「向下滚动观察」提示"
11
+ "name": "renderOverlay",
12
+ "when": "每次渲染,滚动容器内的内容层之上",
13
+ "description": "回到顶部、加载提示、浮层工具"
21
14
  }
22
15
  ],
23
- "example": "// 滚动容器内的吸顶标题条,可与分组联动显示当前组。\nconst Waterfall = withPlugins(WaterfallCore, [\n createStickyHeaderPlugin({\n title: \"分组标题\",\n showHint: false,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
24
- "features": [
25
- "sticky 吸顶,不依赖额外容器",
26
- "与 Grouping 联动显示当前组",
27
- "提示文案默认关闭"
28
- ],
29
- "useCases": [
30
- "分组信息流",
31
- "按日期分组的时间线",
32
- "长列表的上下文提示"
33
- ],
34
- "notes": [
35
- "sticky 生效要求它作为滚动容器的直接子元素——由 composeSlots 保证,单测已锁。"
36
- ]
37
- }
16
+ "methods": [],
17
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
18
+ "config": [
19
+ {
20
+ "name": "title",
21
+ "type": "string",
22
+ "default": "\"分组标题\"",
23
+ "description": "标题文案"
24
+ },
25
+ {
26
+ "name": "showHint",
27
+ "type": "boolean",
28
+ "default": "false",
29
+ "description": "是否显示「向下滚动观察」提示"
30
+ }
31
+ ],
32
+ "example": "// 滚动容器内的吸顶标题条,可与分组联动显示当前组。\nconst Waterfall = withPlugins(WaterfallCore, [\n createStickyHeaderPlugin({\n title: \"分组标题\",\n showHint: false,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
33
+ "features": [
34
+ "sticky 吸顶,不依赖额外容器",
35
+ "与 Grouping 联动显示当前组",
36
+ "提示文案默认关闭"
37
+ ],
38
+ "useCases": [
39
+ "分组信息流",
40
+ "按日期分组的时间线",
41
+ "长列表的上下文提示"
42
+ ],
43
+ "notes": [
44
+ "sticky 生效要求它作为滚动容器的直接子元素——由 composeSlots 保证,单测已锁。"
45
+ ]
46
+ }
38
47
  ;
39
48
 
40
49
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as e, d as t } from "../../chunks/doc-BtzhgTYj.js";
1
+ import { c as e, d as t } from "../../chunks/doc-DtxS1-P0.js";
2
2
  const c = Object.assign(e, { meta: t });
3
3
  export {
4
4
  c as createStickyHeaderPlugin
@@ -1,40 +1,49 @@
1
- declare const _default: {
2
- "name": "ThrottlePlugin",
3
- "description": "接管 Core 的 throttleDelay(滚动回调节流)与 debounceDelay(尺寸变化后多久重排)。默认 16ms / 150ms,长列表滚动卡顿时可以放宽到 32 / 300。",
4
- "since": "2.0.0",
5
- "tags": [
6
- "perf",
7
- "性能"
8
- ],
9
- "config": [
10
- {
11
- "name": "scroll",
12
- "type": "number",
13
- "default": "—",
14
- "description": "滚动节流 ms(必填)"
15
- },
1
+ declare const _default: {
2
+ "name": "ThrottlePlugin",
3
+ "description": "接管 Core 的 throttleDelay(滚动回调节流)与 debounceDelay(尺寸变化后多久重排)。默认 16ms / 150ms,长列表滚动卡顿时可以放宽到 32 / 300。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "perf",
7
+ "性能"
8
+ ],
9
+ "events": [
16
10
  {
17
- "name": "resize",
18
- "type": "number",
19
- "default": "props.debounceDelay",
20
- "description": "布局防抖 ms"
11
+ "name": "transformProps",
12
+ "when": "渲染前链式改写瀑布流 props",
13
+ "description": "补 gap / columns 默认值、按断点覆盖配置"
21
14
  }
22
15
  ],
23
- "example": "// 调整滚动节流与尺寸防抖,弱网/低端机可放宽。\nconst Waterfall = withPlugins(WaterfallCore, [\n createThrottlePlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
24
- "features": [
25
- "滚动节流与布局防抖分开调",
26
- "只改 props,不改算法",
27
- "与 DebounceLayoutPlugin 叠加时后者优先"
28
- ],
29
- "useCases": [
30
- "低端安卓机长列表",
31
- "滚动时 CPU 占用过高",
32
- "拖拽侧栏时减少重排"
33
- ],
34
- "notes": [
35
- "scroll 低于 16ms 没有意义(浏览器帧率上限)。"
36
- ]
37
- }
16
+ "methods": [],
17
+ "methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
18
+ "config": [
19
+ {
20
+ "name": "scroll",
21
+ "type": "number",
22
+ "default": "—",
23
+ "description": "滚动节流 ms(必填)"
24
+ },
25
+ {
26
+ "name": "resize",
27
+ "type": "number",
28
+ "default": "props.debounceDelay",
29
+ "description": "布局防抖 ms"
30
+ }
31
+ ],
32
+ "example": "// 调整滚动节流与尺寸防抖,弱网/低端机可放宽。\nconst Waterfall = withPlugins(WaterfallCore, [\n createThrottlePlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
33
+ "features": [
34
+ "滚动节流与布局防抖分开调",
35
+ "只改 props,不改算法",
36
+ "与 DebounceLayoutPlugin 叠加时后者优先"
37
+ ],
38
+ "useCases": [
39
+ "低端安卓机长列表",
40
+ "滚动时 CPU 占用过高",
41
+ "拖拽侧栏时减少重排"
42
+ ],
43
+ "notes": [
44
+ "scroll 低于 16ms 没有意义(浏览器帧率上限)。"
45
+ ]
46
+ }
38
47
  ;
39
48
 
40
49
  export default _default;
@@ -1,4 +1,4 @@
1
- import { c as t, d as e } from "../../chunks/doc-DzvTrZ13.js";
1
+ import { c as t, d as e } from "../../chunks/doc-CaJ02INP.js";
2
2
  const r = Object.assign(t, { meta: e });
3
3
  export {
4
4
  r as createThrottlePlugin