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.
- package/dist/chunks/doc-BAhVW3g8.js +150 -0
- package/dist/chunks/{doc-BXaJl1By.js → doc-BU0CKW63.js} +64 -35
- package/dist/chunks/{doc-D_ozEn0Q.js → doc-BrEd0oZB.js} +41 -32
- package/dist/chunks/{doc-bTHwfIVb.js → doc-Bud0hbaz.js} +39 -25
- package/dist/chunks/{doc-DukOmDCo.js → doc-C-B3zK2o.js} +52 -23
- package/dist/chunks/{doc-DElLNjIc.js → doc-C206ZwYC.js} +33 -24
- package/dist/chunks/{doc-BSnWbrkH.js → doc-C2L8kkeI.js} +49 -25
- package/dist/chunks/{doc-a0MK2S3n.js → doc-CE1DGMBV.js} +62 -38
- package/dist/chunks/{doc-BXSy2aPP.js → doc-CHbQXLwY.js} +33 -19
- package/dist/chunks/{doc-BfWnfTst.js → doc-CInpKZNU.js} +38 -24
- package/dist/chunks/{doc-gTAsLjVx.js → doc-CYxwSuG6.js} +30 -16
- package/dist/chunks/{doc-DzvTrZ13.js → doc-CaJ02INP.js} +25 -16
- package/dist/chunks/{doc-BXElhF2h.js → doc-CiCso5Ti.js} +44 -30
- package/dist/chunks/{doc-BCmEnh39.js → doc-CkuMr8Ca.js} +49 -25
- package/dist/chunks/{doc-3Fpag2G8.js → doc-D7m1OFCW.js} +38 -24
- package/dist/chunks/doc-DEN2WTDh.js +153 -0
- package/dist/chunks/{doc-C5xrHNoC.js → doc-DhICh9S2.js} +37 -23
- package/dist/chunks/{doc-DAieSXLy.js → doc-DlJICsyN.js} +41 -27
- package/dist/chunks/{doc-CN4edvn_.js → doc-DtxS1-P0.js} +32 -23
- package/dist/chunks/{doc-BIzjYAZW.js → doc-DudYCn_-.js} +25 -16
- package/dist/chunks/{doc-BmoijI6q.js → doc-HoyAFR_m.js} +43 -24
- package/dist/chunks/doc-RlBMCMNs.js +170 -0
- package/dist/chunks/doc-RwKQqySd.js +102 -0
- package/dist/chunks/{doc-CTUoMe7o.js → doc-eYhNJy97.js} +31 -22
- package/dist/chunks/{doc-CcPFavOs.js → doc-i6FY1We1.js} +27 -13
- package/dist/chunks/doc-skPl6ZMP.js +101 -0
- package/dist/chunks/index-8gEIzUxi.js +15 -0
- package/dist/chunks/index-B96I5CKE.js +21 -0
- package/dist/chunks/index-Bjmhy8jW.js +11 -0
- package/dist/chunks/index-Cuq0ofv-.js +13 -0
- package/dist/chunks/{index-BAWlVYr3.js → index-Cz4YEqRF.js} +1 -1
- package/dist/chunks/{index-CF0tYRop.js → index-FBJVUYmH.js} +1 -1
- package/dist/chunks/withPlugins-BOeDFhof.js +743 -0
- package/dist/custom-plugins/A11yPlugin/doc.json.d.ts +64 -40
- package/dist/custom-plugins/A11yPlugin/index.js +1 -1
- package/dist/custom-plugins/AlignmentPlugin/doc.json.d.ts +42 -28
- package/dist/custom-plugins/AlignmentPlugin/index.js +1 -1
- package/dist/custom-plugins/AutoColumnPlugin/doc.json.d.ts +53 -44
- package/dist/custom-plugins/AutoColumnPlugin/index.js +1 -1
- package/dist/custom-plugins/BookmarkPlugin/doc.json.d.ts +44 -35
- package/dist/custom-plugins/BookmarkPlugin/index.js +1 -1
- package/dist/custom-plugins/ClickAnalyticsPlugin/doc.json.d.ts +29 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/index.js +1 -1
- package/dist/custom-plugins/DebounceLayoutPlugin/doc.json.d.ts +37 -28
- package/dist/custom-plugins/DebounceLayoutPlugin/index.js +1 -1
- package/dist/custom-plugins/DragReorderPlugin/doc.json.d.ts +14 -0
- package/dist/custom-plugins/DragReorderPlugin/index.js +1 -1
- package/dist/custom-plugins/FilterPlugin/doc.json.d.ts +53 -39
- package/dist/custom-plugins/FilterPlugin/index.js +1 -1
- package/dist/custom-plugins/FixedHeightPlugin/doc.json.d.ts +42 -28
- package/dist/custom-plugins/FixedHeightPlugin/index.js +1 -1
- package/dist/custom-plugins/GapPlugin/doc.json.d.ts +61 -37
- package/dist/custom-plugins/GapPlugin/index.js +1 -1
- package/dist/custom-plugins/GroupingPlugin/doc.json.d.ts +61 -32
- package/dist/custom-plugins/GroupingPlugin/index.js +1 -1
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/doc.json.d.ts +24 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.js +1 -1
- package/dist/custom-plugins/InfiniteScrollPlugin/doc.json.d.ts +55 -36
- package/dist/custom-plugins/InfiniteScrollPlugin/index.js +1 -1
- package/dist/custom-plugins/PaginationPlugin/doc.json.d.ts +56 -42
- package/dist/custom-plugins/PaginationPlugin/index.js +1 -1
- package/dist/custom-plugins/PinItemPlugin/doc.json.d.ts +49 -35
- package/dist/custom-plugins/PinItemPlugin/index.js +1 -1
- package/dist/custom-plugins/RecyclePlugin/doc.json.d.ts +57 -28
- package/dist/custom-plugins/RecyclePlugin/index.js +1 -1
- package/dist/custom-plugins/ReducedMotionPlugin/doc.json.d.ts +29 -0
- package/dist/custom-plugins/ReducedMotionPlugin/index.js +1 -1
- package/dist/custom-plugins/ResponsiveColumnsPlugin/doc.json.d.ts +40 -31
- package/dist/custom-plugins/ResponsiveColumnsPlugin/index.js +1 -1
- package/dist/custom-plugins/ScrollAnchorPlugin/doc.json.d.ts +42 -28
- package/dist/custom-plugins/ScrollAnchorPlugin/index.js +1 -1
- package/dist/custom-plugins/SearchPlugin/doc.json.d.ts +53 -39
- package/dist/custom-plugins/SearchPlugin/index.js +1 -1
- package/dist/custom-plugins/SortPlugin/doc.json.d.ts +52 -38
- package/dist/custom-plugins/SortPlugin/index.js +1 -1
- package/dist/custom-plugins/StatePersistencePlugin/doc.json.d.ts +71 -37
- package/dist/custom-plugins/StatePersistencePlugin/index.js +1 -1
- package/dist/custom-plugins/StickyHeaderPlugin/doc.json.d.ts +43 -34
- package/dist/custom-plugins/StickyHeaderPlugin/index.js +1 -1
- package/dist/custom-plugins/ThrottlePlugin/doc.json.d.ts +43 -34
- package/dist/custom-plugins/ThrottlePlugin/index.js +1 -1
- package/dist/custom-plugins/TransitionPlugin/doc.json.d.ts +49 -35
- package/dist/custom-plugins/TransitionPlugin/index.js +1 -1
- package/dist/custom-plugins/URLSyncPlugin/doc.json.d.ts +57 -33
- package/dist/custom-plugins/URLSyncPlugin/index.js +1 -1
- package/dist/custom-plugins/index.js +6 -6
- package/dist/entries/plugins.js +7 -7
- package/dist/index.js +1 -1
- package/dist/presets/dashboard/index.js +2 -2
- package/dist/presets/photo-feed/index.js +3 -3
- package/dist/presets/product-feed/index.js +2 -2
- package/package.json +26 -26
- package/dist/chunks/doc-BQQoKNto.js +0 -126
- package/dist/chunks/doc-BindRMfO.js +0 -72
- package/dist/chunks/doc-CBHjiDG7.js +0 -88
- package/dist/chunks/doc-CkU5GtLw.js +0 -136
- package/dist/chunks/doc-KN6Bvmty.js +0 -124
- package/dist/chunks/index-B8o6R4RZ.js +0 -15
- package/dist/chunks/index-BFyYpEY_.js +0 -11
- package/dist/chunks/index-CJR0Buju.js +0 -21
- package/dist/chunks/index-DHTB3QEP.js +0 -13
- package/dist/chunks/withPlugins-DG3YpSgL.js +0 -655
|
@@ -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
|
-
"
|
|
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": "
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"description": "排序变化后回顶"
|
|
11
|
+
"name": "onPropsChange",
|
|
12
|
+
"when": "props 变化后",
|
|
13
|
+
"description": "数据或配置变化时请求重排"
|
|
21
14
|
},
|
|
22
15
|
{
|
|
23
|
-
"name": "
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"description": "回顶行为"
|
|
16
|
+
"name": "transformProps",
|
|
17
|
+
"when": "渲染前链式改写瀑布流 props",
|
|
18
|
+
"description": "补 gap / columns 默认值、按断点覆盖配置"
|
|
27
19
|
}
|
|
28
20
|
],
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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,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
|
-
"
|
|
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": "
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"description": "localStorage 键名"
|
|
21
|
+
"name": "onPropsChange",
|
|
22
|
+
"when": "props 变化后",
|
|
23
|
+
"description": "数据或配置变化时请求重排"
|
|
15
24
|
},
|
|
16
25
|
{
|
|
17
|
-
"name": "
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"description": "是否持久化滚动位置"
|
|
26
|
+
"name": "onLayoutComplete",
|
|
27
|
+
"when": "DOM 落位完成(可安全测量)",
|
|
28
|
+
"description": "测量真实高度、懒加载判定、曝光上报"
|
|
21
29
|
},
|
|
22
30
|
{
|
|
23
|
-
"name": "
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
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
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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,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
|
-
"
|
|
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": "
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"description": "是否显示「向下滚动观察」提示"
|
|
11
|
+
"name": "renderOverlay",
|
|
12
|
+
"when": "每次渲染,滚动容器内的内容层之上",
|
|
13
|
+
"description": "回到顶部、加载提示、浮层工具"
|
|
21
14
|
}
|
|
22
15
|
],
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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,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
|
-
"
|
|
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": "
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"description": "布局防抖 ms"
|
|
11
|
+
"name": "transformProps",
|
|
12
|
+
"when": "渲染前链式改写瀑布流 props",
|
|
13
|
+
"description": "补 gap / columns 默认值、按断点覆盖配置"
|
|
21
14
|
}
|
|
22
15
|
],
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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,43 +1,57 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
"name": "TransitionPlugin",
|
|
3
|
-
"description": "给每个项挂上 transform + opacity 的 CSS 过渡,布局重排、分页切换、筛选后重新排列时位置变化是滑过去的,不是瞬移。",
|
|
4
|
-
"since": "2.0.0",
|
|
5
|
-
"tags": [
|
|
6
|
-
"perf",
|
|
7
|
-
"动效"
|
|
8
|
-
],
|
|
9
|
-
"
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "TransitionPlugin",
|
|
3
|
+
"description": "给每个项挂上 transform + opacity 的 CSS 过渡,布局重排、分页切换、筛选后重新排列时位置变化是滑过去的,不是瞬移。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"perf",
|
|
7
|
+
"动效"
|
|
8
|
+
],
|
|
9
|
+
"events": [
|
|
10
10
|
{
|
|
11
|
-
"name": "
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"description": "过渡时长 ms"
|
|
11
|
+
"name": "onItemMount",
|
|
12
|
+
"when": "单个卡片挂载并拿到 DOM 元素时",
|
|
13
|
+
"description": "按卡片绑定监听、观察器、埋点"
|
|
15
14
|
},
|
|
16
15
|
{
|
|
17
|
-
"name": "
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"description": "缓动函数"
|
|
16
|
+
"name": "onLayout",
|
|
17
|
+
"when": "布局计算完成、结果已确定",
|
|
18
|
+
"description": "读取每列高度、做二次修正或上报"
|
|
21
19
|
}
|
|
22
20
|
],
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]
|
|
40
|
-
|
|
21
|
+
"methods": [],
|
|
22
|
+
"methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
|
|
23
|
+
"config": [
|
|
24
|
+
{
|
|
25
|
+
"name": "duration",
|
|
26
|
+
"type": "number",
|
|
27
|
+
"default": "300",
|
|
28
|
+
"description": "过渡时长 ms"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "easing",
|
|
32
|
+
"type": "string",
|
|
33
|
+
"default": "ease",
|
|
34
|
+
"description": "缓动函数"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"example": "// 布局变化时给项加 transform/opacity 过渡,插入新数据不「闪现」。\nconst Waterfall = withPlugins(WaterfallCore, [\n createTransitionPlugin({\n duration: 300,\n easing: \"ease\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
38
|
+
"conflicts": [
|
|
39
|
+
"ReducedMotionPlugin"
|
|
40
|
+
],
|
|
41
|
+
"features": [
|
|
42
|
+
"项位置变化平滑过渡",
|
|
43
|
+
"挂载时即生效(onItemMount)",
|
|
44
|
+
"与 ReducedMotionPlugin 互斥"
|
|
45
|
+
],
|
|
46
|
+
"useCases": [
|
|
47
|
+
"筛选 / 排序后重排",
|
|
48
|
+
"分页切换",
|
|
49
|
+
"动态插入卡片"
|
|
50
|
+
],
|
|
51
|
+
"notes": [
|
|
52
|
+
"首屏大量项同时过渡会有一次「整体滑入」,想要更克制可以把 duration 降到 150ms。"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
41
55
|
;
|
|
42
56
|
|
|
43
57
|
export default _default;
|
|
@@ -1,41 +1,65 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
"name": "URLSyncPlugin",
|
|
3
|
-
"description": "props 变化时把指定键写进 URL(hash 或 search),挂载时读出来广播 `urlsync:init`。刷新与分享都能还原筛选状态。",
|
|
4
|
-
"since": "2.0.0",
|
|
5
|
-
"tags": [
|
|
6
|
-
"ui",
|
|
7
|
-
"URL",
|
|
8
|
-
"可分享"
|
|
9
|
-
],
|
|
10
|
-
"
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "URLSyncPlugin",
|
|
3
|
+
"description": "props 变化时把指定键写进 URL(hash 或 search),挂载时读出来广播 `urlsync:init`。刷新与分享都能还原筛选状态。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"ui",
|
|
7
|
+
"URL",
|
|
8
|
+
"可分享"
|
|
9
|
+
],
|
|
10
|
+
"events": [
|
|
11
|
+
{
|
|
12
|
+
"name": "onMount",
|
|
13
|
+
"when": "瀑布流挂载完成",
|
|
14
|
+
"description": "初始化观察器与滚动监听,返回清理函数"
|
|
15
|
+
},
|
|
11
16
|
{
|
|
12
|
-
"name": "
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"description": "写 hash 还是 search"
|
|
17
|
+
"name": "onPropsChange",
|
|
18
|
+
"when": "props 变化后",
|
|
19
|
+
"description": "数据或配置变化时请求重排"
|
|
16
20
|
},
|
|
17
21
|
{
|
|
18
|
-
"name": "
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
+
"name": "transformProps",
|
|
23
|
+
"when": "渲染前链式改写瀑布流 props",
|
|
24
|
+
"description": "补 gap / columns 默认值、按断点覆盖配置"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "urlsync:init",
|
|
28
|
+
"when": "从 URL 参数初始化完成后",
|
|
29
|
+
"description": "广播初始参数快照"
|
|
22
30
|
}
|
|
23
31
|
],
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
32
|
+
"methods": [],
|
|
33
|
+
"methodsNote": "只读取 context 字段(props / state / data),不调用上下文方法",
|
|
34
|
+
"config": [
|
|
35
|
+
{
|
|
36
|
+
"name": "mode",
|
|
37
|
+
"type": "\"hash\" | \"search\"",
|
|
38
|
+
"default": "\"hash\"",
|
|
39
|
+
"description": "写 hash 还是 search"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "keys",
|
|
43
|
+
"type": "string[]",
|
|
44
|
+
"default": "[\"pageIndex\",\"pageSize\",\"searchQuery\"]",
|
|
45
|
+
"description": "要同步的 props 键"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"example": "// 把分页/搜索/排序同步进 URL(hash 或 search),链接可分享。\nconst Waterfall = withPlugins(WaterfallCore, [\n createURLSyncPlugin({\n mode: \"hash\",\n keys: [\"pageIndex\",\"pageSize\",\"searchQuery\"],\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
49
|
+
"features": [
|
|
50
|
+
"hash 模式会保留已有路由路径",
|
|
51
|
+
"用 replaceState,不污染后退栈",
|
|
52
|
+
"SSR 安全:无 window 时直接跳过"
|
|
53
|
+
],
|
|
54
|
+
"useCases": [
|
|
55
|
+
"搜索结果可分享",
|
|
56
|
+
"后台筛选状态可刷新",
|
|
57
|
+
"带参数的深链"
|
|
58
|
+
],
|
|
59
|
+
"notes": [
|
|
60
|
+
"只做单向同步(props → URL)与初始读取;URL 前进后退的监听请页面自己做。"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
39
63
|
;
|
|
40
64
|
|
|
41
65
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as r, a as t, b as c, d as i, e as n, f as l, g as s, h as u, i as g } from "../chunks/index-
|
|
2
|
-
import { c as P, a as m, b as p, d } from "../chunks/index-
|
|
3
|
-
import { c as x, a as y, b as S, d as A, e as b, f as h } from "../chunks/index-
|
|
4
|
-
import { c as k, a as C, b as H, d as D, e as F } from "../chunks/index-
|
|
5
|
-
import { c as I } from "../chunks/index-
|
|
6
|
-
import { c as T } from "../chunks/index-
|
|
1
|
+
import { c as r, a as t, b as c, d as i, e as n, f as l, g as s, h as u, i as g } from "../chunks/index-B96I5CKE.js";
|
|
2
|
+
import { c as P, a as m, b as p, d } from "../chunks/index-Bjmhy8jW.js";
|
|
3
|
+
import { c as x, a as y, b as S, d as A, e as b, f as h } from "../chunks/index-8gEIzUxi.js";
|
|
4
|
+
import { c as k, a as C, b as H, d as D, e as F } from "../chunks/index-Cuq0ofv-.js";
|
|
5
|
+
import { c as I } from "../chunks/index-Cz4YEqRF.js";
|
|
6
|
+
import { c as T } from "../chunks/index-FBJVUYmH.js";
|
|
7
7
|
export {
|
|
8
8
|
T as createA11yPlugin,
|
|
9
9
|
r as createAlignmentPlugin,
|