vane-waterfall 1.0.4 → 2.0.0
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/README.md +174 -365
- package/dist/chunks/WaterfallCore-BSXw7bl_.js +581 -0
- package/dist/chunks/doc-3Fpag2G8.js +84 -0
- package/dist/chunks/doc-78xF08vt.js +82 -0
- package/dist/chunks/doc-B-7dugGv.js +79 -0
- package/dist/chunks/doc-B6kLfMPv.js +121 -0
- package/dist/chunks/doc-BCGQ8Cp5.js +114 -0
- package/dist/chunks/doc-BIzjYAZW.js +50 -0
- package/dist/chunks/doc-BP0DmB7-.js +91 -0
- package/dist/chunks/doc-BXElhF2h.js +138 -0
- package/dist/chunks/doc-BXSy2aPP.js +59 -0
- package/dist/chunks/doc-BfWnfTst.js +83 -0
- package/dist/chunks/doc-BtzhgTYj.js +85 -0
- package/dist/chunks/doc-C5xrHNoC.js +70 -0
- package/dist/chunks/doc-CBHjiDG7.js +88 -0
- package/dist/chunks/doc-CTUoMe7o.js +79 -0
- package/dist/chunks/doc-CcPFavOs.js +56 -0
- package/dist/chunks/doc-CraXjOaA.js +68 -0
- package/dist/chunks/doc-DElLNjIc.js +61 -0
- package/dist/chunks/doc-DJjxOYzW.js +111 -0
- package/dist/chunks/doc-DukOmDCo.js +95 -0
- package/dist/chunks/doc-DzvTrZ13.js +60 -0
- package/dist/chunks/doc-NhL4Ux8q.js +125 -0
- package/dist/chunks/doc-bTHwfIVb.js +78 -0
- package/dist/chunks/doc-f4Uijujv.js +102 -0
- package/dist/chunks/doc-gTAsLjVx.js +55 -0
- package/dist/chunks/doc-j4W9SUrY.js +76 -0
- package/dist/chunks/doc-kTbJE7rY.js +92 -0
- package/dist/chunks/index-BAWlVYr3.js +5 -0
- package/dist/chunks/index-COaun3nf.js +15 -0
- package/dist/chunks/index-DXAtA2f6.js +11 -0
- package/dist/chunks/index-DsRLmBW-.js +13 -0
- package/dist/chunks/index-gjoCq0yC.js +21 -0
- package/dist/chunks/index-wLI6UXkY.js +5 -0
- package/dist/chunks/withPlugins-DLoKg4AP.js +559 -0
- package/dist/components/WaterfallPlugin/WaterfallCore.d.ts +124 -0
- package/dist/components/WaterfallPlugin/WaterfallCore.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/index.d.ts +9 -10
- package/dist/components/WaterfallPlugin/index.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/layout.d.ts +41 -0
- package/dist/components/WaterfallPlugin/layout.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/plugins/types.d.ts +76 -380
- package/dist/components/WaterfallPlugin/plugins/types.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/virtualize.d.ts +62 -0
- package/dist/components/WaterfallPlugin/virtualize.d.ts.map +1 -0
- package/dist/components/WaterfallPlugin/{plugins/withPlugins.d.ts → withPlugins.d.ts} +4 -2
- package/dist/components/WaterfallPlugin/withPlugins.d.ts.map +1 -0
- package/dist/custom-plugins/A11yPlugin/create.d.ts +23 -0
- package/dist/custom-plugins/A11yPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/A11yPlugin/doc.json.d.ts +52 -0
- package/dist/custom-plugins/A11yPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/A11yPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/A11yPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Alignment/index.d.ts → custom-plugins/AlignmentPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/AlignmentPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/AlignmentPlugin/doc.json.d.ts +34 -0
- package/dist/custom-plugins/AlignmentPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/AlignmentPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/AlignmentPlugin/index.js +5 -0
- package/dist/custom-plugins/AutoColumnPlugin/create.d.ts +18 -0
- package/dist/custom-plugins/AutoColumnPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/AutoColumnPlugin/doc.json.d.ts +50 -0
- package/dist/custom-plugins/AutoColumnPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/AutoColumnPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/AutoColumnPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Bookmark/index.d.ts → custom-plugins/BookmarkPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/BookmarkPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/BookmarkPlugin/doc.json.d.ts +41 -0
- package/dist/custom-plugins/BookmarkPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/BookmarkPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/BookmarkPlugin/index.js +5 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts +25 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/doc.json.d.ts +41 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ClickAnalyticsPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/DebounceLayout/index.d.ts → custom-plugins/DebounceLayoutPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/DebounceLayoutPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/DebounceLayoutPlugin/doc.json.d.ts +34 -0
- package/dist/custom-plugins/DebounceLayoutPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/DebounceLayoutPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/DebounceLayoutPlugin/index.js +5 -0
- package/dist/custom-plugins/DragReorderPlugin/create.d.ts +33 -0
- package/dist/custom-plugins/DragReorderPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/DragReorderPlugin/doc.json.d.ts +53 -0
- package/dist/custom-plugins/DragReorderPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/DragReorderPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/DragReorderPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Filter/index.d.ts → custom-plugins/FilterPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/FilterPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/FilterPlugin/doc.json.d.ts +47 -0
- package/dist/custom-plugins/FilterPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/FilterPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/FilterPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/FixedHeight/index.d.ts → custom-plugins/FixedHeightPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/FixedHeightPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/FixedHeightPlugin/doc.json.d.ts +34 -0
- package/dist/custom-plugins/FixedHeightPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/FixedHeightPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/FixedHeightPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Gap/index.d.ts → custom-plugins/GapPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/GapPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/GapPlugin/doc.json.d.ts +47 -0
- package/dist/custom-plugins/GapPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/GapPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/GapPlugin/index.js +5 -0
- package/dist/custom-plugins/GroupingPlugin/create.d.ts +16 -0
- package/dist/custom-plugins/GroupingPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/GroupingPlugin/doc.json.d.ts +40 -0
- package/dist/custom-plugins/GroupingPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/GroupingPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/GroupingPlugin/index.js +5 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts +31 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/doc.json.d.ts +43 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.js +5 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/create.d.ts +17 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/doc.json.d.ts +44 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/InfiniteScrollPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Pagination/index.d.ts → custom-plugins/PaginationPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/PaginationPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/PaginationPlugin/doc.json.d.ts +50 -0
- package/dist/custom-plugins/PaginationPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/PaginationPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/PaginationPlugin/index.js +5 -0
- package/dist/custom-plugins/PinItemPlugin/create.d.ts +23 -0
- package/dist/custom-plugins/PinItemPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/PinItemPlugin/doc.json.d.ts +43 -0
- package/dist/custom-plugins/PinItemPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/PinItemPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/PinItemPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Recycle/index.d.ts → custom-plugins/RecyclePlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/RecyclePlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/RecyclePlugin/doc.json.d.ts +35 -0
- package/dist/custom-plugins/RecyclePlugin/index.d.ts +11 -0
- package/dist/custom-plugins/RecyclePlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/RecyclePlugin/index.js +5 -0
- package/dist/custom-plugins/ReducedMotionPlugin/create.d.ts +25 -0
- package/dist/custom-plugins/ReducedMotionPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ReducedMotionPlugin/doc.json.d.ts +42 -0
- package/dist/custom-plugins/ReducedMotionPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/ReducedMotionPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ReducedMotionPlugin/index.js +5 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/create.d.ts +22 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/doc.json.d.ts +37 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/index.d.ts +10 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ResponsiveColumnsPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/ScrollAnchor/index.d.ts → custom-plugins/ScrollAnchorPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/ScrollAnchorPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ScrollAnchorPlugin/doc.json.d.ts +34 -0
- package/dist/custom-plugins/ScrollAnchorPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/ScrollAnchorPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ScrollAnchorPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Search/index.d.ts → custom-plugins/SearchPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/SearchPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/SearchPlugin/doc.json.d.ts +47 -0
- package/dist/custom-plugins/SearchPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/SearchPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/SearchPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Sort/index.d.ts → custom-plugins/SortPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/SortPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/SortPlugin/doc.json.d.ts +46 -0
- package/dist/custom-plugins/SortPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/SortPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/SortPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/StatePersistence/index.d.ts → custom-plugins/StatePersistencePlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/StatePersistencePlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/StatePersistencePlugin/doc.json.d.ts +47 -0
- package/dist/custom-plugins/StatePersistencePlugin/index.d.ts +11 -0
- package/dist/custom-plugins/StatePersistencePlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/StatePersistencePlugin/index.js +5 -0
- package/dist/custom-plugins/StickyHeaderPlugin/create.d.ts +13 -0
- package/dist/custom-plugins/StickyHeaderPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/StickyHeaderPlugin/doc.json.d.ts +40 -0
- package/dist/custom-plugins/StickyHeaderPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/StickyHeaderPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/StickyHeaderPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Throttle/index.d.ts → custom-plugins/ThrottlePlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/ThrottlePlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/ThrottlePlugin/doc.json.d.ts +40 -0
- package/dist/custom-plugins/ThrottlePlugin/index.d.ts +11 -0
- package/dist/custom-plugins/ThrottlePlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/ThrottlePlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/Transition/index.d.ts → custom-plugins/TransitionPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/TransitionPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/TransitionPlugin/doc.json.d.ts +43 -0
- package/dist/custom-plugins/TransitionPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/TransitionPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/TransitionPlugin/index.js +5 -0
- package/dist/{components/WaterfallPlugin/custom-plugins/URLSync/index.d.ts → custom-plugins/URLSyncPlugin/create.d.ts} +3 -3
- package/dist/custom-plugins/URLSyncPlugin/create.d.ts.map +1 -0
- package/dist/custom-plugins/URLSyncPlugin/doc.json.d.ts +41 -0
- package/dist/custom-plugins/URLSyncPlugin/index.d.ts +11 -0
- package/dist/custom-plugins/URLSyncPlugin/index.d.ts.map +1 -0
- package/dist/custom-plugins/URLSyncPlugin/index.js +5 -0
- package/dist/custom-plugins/index.d.ts +61 -0
- package/dist/custom-plugins/index.d.ts.map +1 -0
- package/dist/custom-plugins/index.js +34 -0
- package/dist/entries/core.d.ts +8 -0
- package/dist/entries/core.d.ts.map +1 -0
- package/dist/entries/core.js +7 -0
- package/dist/entries/plugins.d.ts +7 -0
- package/dist/entries/plugins.d.ts.map +1 -0
- package/dist/entries/plugins.js +36 -0
- package/dist/index.d.ts +14 -9
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/presets/dashboard/index.d.ts +13 -0
- package/dist/presets/dashboard/index.d.ts.map +1 -0
- package/dist/presets/dashboard/index.js +21 -0
- package/dist/presets/photo-feed/index.d.ts +13 -0
- package/dist/presets/photo-feed/index.d.ts.map +1 -0
- package/dist/presets/photo-feed/index.js +17 -0
- package/dist/presets/product-feed/index.d.ts +9 -0
- package/dist/presets/product-feed/index.d.ts.map +1 -0
- package/dist/presets/product-feed/index.js +23 -0
- package/package.json +222 -82
- package/dist/404.jpg +0 -0
- package/dist/components/WaterfallPlugin/core/WaterfallCore.d.ts +0 -174
- package/dist/components/WaterfallPlugin/custom-plugins/A11y/index.d.ts +0 -16
- package/dist/components/WaterfallPlugin/custom-plugins/AutoColumn/index.d.ts +0 -17
- package/dist/components/WaterfallPlugin/custom-plugins/ClickAnalytics/index.d.ts +0 -12
- package/dist/components/WaterfallPlugin/custom-plugins/DragReorder/index.d.ts +0 -13
- package/dist/components/WaterfallPlugin/custom-plugins/Grouping/index.d.ts +0 -12
- package/dist/components/WaterfallPlugin/custom-plugins/HeatmapAnalytics/index.d.ts +0 -14
- package/dist/components/WaterfallPlugin/custom-plugins/InfiniteScroll/index.d.ts +0 -13
- package/dist/components/WaterfallPlugin/custom-plugins/PinItem/index.d.ts +0 -13
- package/dist/components/WaterfallPlugin/custom-plugins/ReducedMotion/index.d.ts +0 -13
- package/dist/components/WaterfallPlugin/custom-plugins/ResponsiveColumns/index.d.ts +0 -10
- package/dist/components/WaterfallPlugin/custom-plugins/StickyHeader/index.d.ts +0 -11
- package/dist/components/WaterfallPlugin/custom-plugins/VirtualWaterfall/index.d.ts +0 -12
- package/dist/components/WaterfallPlugin/custom-plugins/index.d.ts +0 -30
- package/dist/components/WaterfallPlugin/plugins/PluginBus.d.ts +0 -2
- package/dist/components/WaterfallPlugin/plugins/PluginManager.d.ts +0 -2
- package/dist/components/WaterfallPlugin/plugins/index.d.ts +0 -8
- package/dist/index.es.js +0 -2382
- package/dist/index.umd.js +0 -30
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ItemPosition } from './plugins/types';
|
|
2
|
+
export interface VirtualizeOptions {
|
|
3
|
+
/** 视口上下各多渲染几屏,默认 1 */
|
|
4
|
+
overscan?: number;
|
|
5
|
+
/** 未测量项的兜底高度,默认 240。不设则虚拟化等于不开(未测量项不占位) */
|
|
6
|
+
estimateHeight?: number;
|
|
7
|
+
/**
|
|
8
|
+
* 是否允许高度动态变化(图片加载后重排),默认 true。
|
|
9
|
+
* 关掉后项一旦测量就不再重新监听尺寸,适合固定高度的商品卡。
|
|
10
|
+
*/
|
|
11
|
+
dynamicHeights?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 未测量项的高度估值是否跟随实测样本自适应,默认 **true**。
|
|
14
|
+
*
|
|
15
|
+
* 为什么要有:`estimateHeight` 是一个固定值,而真实项高必然是一个区间。
|
|
16
|
+
* 只要真实项比估值高,同一列里排在它后面的未测量项就会被压上去 —— 表现为
|
|
17
|
+
* 快速滚动时卡片重叠。改成跟实测样本的分位数走之后,估值天然贴着这份数据,
|
|
18
|
+
* 重叠幅度可以压到个位数像素(见 `resolveEstimateHeight`)。
|
|
19
|
+
*
|
|
20
|
+
* 设为 false 时严格用 `estimateHeight`:适合「所有项等高」的固定高卡片,
|
|
21
|
+
* 此时估值就是精确值,不需要样本。
|
|
22
|
+
*/
|
|
23
|
+
adaptiveEstimate?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 自适应时取样本的哪个分位,默认 0.5(中位数)。
|
|
26
|
+
*
|
|
27
|
+
* 为什么是中位数:总高是「所有项高度之和」决定的,中位数是使总高误差最小的
|
|
28
|
+
* 单值估计。重叠问题不靠抬高估值解决 —— 抬高估值只是把误差从「重叠」换成
|
|
29
|
+
* 「滚动条虚长」,后者更持久、更刺眼。真正压住重叠的是「测量到就立刻重排」
|
|
30
|
+
* (`scheduleLayoutNow`),它让估值误差只存在一帧、且通常落在视口外。
|
|
31
|
+
*
|
|
32
|
+
* 如果想更保守(例如项高分布极其离散),可以调到 0.9。
|
|
33
|
+
*/
|
|
34
|
+
estimateQuantile?: number;
|
|
35
|
+
}
|
|
36
|
+
/** 自适应估值至少要有这么多实测样本才敢用,否则仍走 `estimateHeight` */
|
|
37
|
+
export declare const MIN_ESTIMATE_SAMPLES = 8;
|
|
38
|
+
/**
|
|
39
|
+
* 算未测量项该用多高。
|
|
40
|
+
*
|
|
41
|
+
* @param samples 已测量到的项高(可为空)
|
|
42
|
+
* @param fallback `estimateHeight`,冷启动 / 关闭自适应时用
|
|
43
|
+
* @param quantile 分位,默认 0.5(中位数)
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveEstimateHeight(samples: Iterable<number>, fallback: number, quantile?: number): number;
|
|
46
|
+
export interface VisibleRange {
|
|
47
|
+
start: number;
|
|
48
|
+
end: number;
|
|
49
|
+
/** 命中范围之外还有多少项没渲染(调试面板用) */
|
|
50
|
+
hiddenCount: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 计算需要渲染的索引区间(闭区间)。
|
|
54
|
+
*
|
|
55
|
+
* @param positions 全量布局结果
|
|
56
|
+
* @param totalCount 数据总长(含尚未进入布局的新项)
|
|
57
|
+
* @param scrollTop 容器滚动偏移
|
|
58
|
+
* @param viewportHeight 容器可视高度
|
|
59
|
+
* @param overscan 上下各多渲染几屏
|
|
60
|
+
*/
|
|
61
|
+
export declare function computeVisibleRange(positions: Map<number, ItemPosition>, totalCount: number, scrollTop: number, viewportHeight: number, overscan?: number): VisibleRange;
|
|
62
|
+
//# sourceMappingURL=virtualize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtualize.d.ts","sourceRoot":"","sources":["../../../src/components/WaterfallPlugin/virtualize.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,EACzB,QAAQ,EAAE,MAAM,EAChB,QAAQ,SAAM,GACb,MAAM,CAWR;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EACpC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,QAAQ,SAAI,GACX,YAAY,CA+Cd"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { WaterfallPlugin } from './types';
|
|
2
1
|
import { default as React } from 'react';
|
|
3
|
-
import {
|
|
2
|
+
import { WaterfallPlugin } from './plugins/types';
|
|
3
|
+
import { WaterfallCoreProps, WaterfallCoreRef } from './WaterfallCore';
|
|
4
4
|
export interface WithPluginsConfig<T = any> {
|
|
5
5
|
plugins: WaterfallPlugin<T>[];
|
|
6
6
|
enableDebug?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare function withPlugins<T = any>(WrappedComponent: React.ForwardRefExoticComponent<React.PropsWithoutRef<WaterfallCoreProps<T>> & React.RefAttributes<WaterfallCoreRef>>, config: WithPluginsConfig<T> | WaterfallPlugin<T>[]): React.ForwardRefExoticComponent<WaterfallCoreProps<T> & React.RefAttributes<WaterfallCoreRef>>;
|
|
9
|
+
export default withPlugins;
|
|
10
|
+
//# sourceMappingURL=withPlugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withPlugins.d.ts","sourceRoot":"","sources":["../../../src/components/WaterfallPlugin/withPlugins.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAwE,MAAM,OAAO,CAAC;AAG7F,OAAO,KAAK,EAMV,eAAe,EAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,GAAG;IACxC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA2DD,wBAAgB,WAAW,CAAC,CAAC,GAAG,GAAG,EACjC,gBAAgB,EAAE,KAAK,CAAC,yBAAyB,CAC/C,KAAK,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAC1C,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,CACxC,EACD,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,kGAmYpD;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type A11yConfig = {
|
|
3
|
+
/** 为容器设置 ARIA role(默认 list) */
|
|
4
|
+
containerRole?: string;
|
|
5
|
+
/** 为项设置 ARIA role(默认 listitem) */
|
|
6
|
+
itemRole?: string;
|
|
7
|
+
/** 是否给项添加 tabindex 便于键盘焦点(默认 true) */
|
|
8
|
+
enableTabIndex?: boolean;
|
|
9
|
+
/** 容器 aria-label(默认 "Waterfall list") */
|
|
10
|
+
containerLabel?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A11yPlugin - 可访问性增强:容器 / 项的 ARIA 语义 + 键盘聚焦。
|
|
14
|
+
*
|
|
15
|
+
* 与旧版的两处差别:
|
|
16
|
+
* 1. 容器属性改在 `onMount` / `onLayoutComplete` 里写。旧版写在 `renderOverlay`
|
|
17
|
+
* 里——那是渲染期副作用,React 并发渲染下可能被丢弃或执行多次;
|
|
18
|
+
* 2. `renderItemWrapper` 的签名统一成 `(context, node, index)`。旧版写的是
|
|
19
|
+
* `(context, content, index)`,而 DragReorder 写的是 `(context, index, item, children)`,
|
|
20
|
+
* 同一个钩子两套参数顺序,靠"谁先装"决定传入什么,属于隐蔽的错位 bug。
|
|
21
|
+
*/
|
|
22
|
+
export declare function createA11yPlugin<T = any>(config?: A11yConfig): WaterfallPlugin<T>;
|
|
23
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/A11yPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,UAAU,GAAG;IACvB,+BAA+B;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,UAAe,GAAG,eAAe,CAAC,CAAC,CAAC,CAqCrF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "A11yPlugin",
|
|
3
|
+
"description": "把瀑布流补成读屏可理解的列表:容器 `role=list` + `aria-label`,每项 `role=listitem` + `aria-posinset` / `aria-setsize`,并可选加 `tabIndex` 让键盘能逐项聚焦。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"ui",
|
|
7
|
+
"a11y"
|
|
8
|
+
],
|
|
9
|
+
"config": [
|
|
10
|
+
{
|
|
11
|
+
"name": "containerRole",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"default": "\"list\"",
|
|
14
|
+
"description": "容器 role"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "itemRole",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": "\"listitem\"",
|
|
20
|
+
"description": "项 role"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "enableTabIndex",
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": "true",
|
|
26
|
+
"description": "项是否可 Tab 聚焦"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "containerLabel",
|
|
30
|
+
"type": "string",
|
|
31
|
+
"default": "\"Waterfall list\"",
|
|
32
|
+
"description": "容器 aria-label"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"example": "// 给容器与项补 ARIA role / label / posinset,支持键盘 Tab 遍历。\nconst Waterfall = withPlugins(WaterfallCore, [\n createA11yPlugin({\n containerRole: \"list\",\n itemRole: \"listitem\",\n enableTabIndex: true,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
36
|
+
"features": [
|
|
37
|
+
"容器 / 项 role 成对补齐",
|
|
38
|
+
"aria-posinset + aria-setsize 正确标注序号",
|
|
39
|
+
"键盘可逐项聚焦"
|
|
40
|
+
],
|
|
41
|
+
"useCases": [
|
|
42
|
+
"政务 / 金融等合规站点",
|
|
43
|
+
"读屏用户可用的信息流",
|
|
44
|
+
"键盘操作优先的桌面端"
|
|
45
|
+
],
|
|
46
|
+
"notes": [
|
|
47
|
+
"项数很多时 `tabIndex=0` 会让 Tab 变长,建议配合「跳转主内容」链接使用。"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
;
|
|
51
|
+
|
|
52
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createA11yPlugin as create, A11yConfig } from './create';
|
|
2
|
+
import { PluginDoc } from '@vane/plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createA11yPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { A11yConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/A11yPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAwD,OAAO,MAAM,GAAG;IACnG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
2
|
export type AlignmentMode = "shortest" | "balanced" | "sequential";
|
|
3
|
-
type AlignmentConfig = {
|
|
3
|
+
export type AlignmentConfig = {
|
|
4
4
|
/** 列分配策略 */
|
|
5
5
|
mode: AlignmentMode;
|
|
6
6
|
};
|
|
@@ -9,4 +9,4 @@ type AlignmentConfig = {
|
|
|
9
9
|
* 通过设置 props.alignmentMode 来影响核心布局算法的列选择逻辑
|
|
10
10
|
*/
|
|
11
11
|
export declare function createAlignmentPlugin<T = any>(config: AlignmentConfig): WaterfallPlugin<T>;
|
|
12
|
-
|
|
12
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/AlignmentPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;AAEnE,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY;IACZ,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,CAc1F"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "AlignmentPlugin",
|
|
3
|
+
"description": "设置瀑布流的列分配策略。shortest 让每列尽量等高(视觉最自然),balanced 让每列项数接近,sequential 按 index 轮转(可预测位置,适合需要与外部索引对齐的场景)。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"layout",
|
|
7
|
+
"布局"
|
|
8
|
+
],
|
|
9
|
+
"config": [
|
|
10
|
+
{
|
|
11
|
+
"name": "mode",
|
|
12
|
+
"type": "\"shortest\" | \"balanced\" | \"sequential\"",
|
|
13
|
+
"default": "shortest",
|
|
14
|
+
"description": "列分配策略"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"example": "// 指定列分配策略:最矮列优先(shortest)/ 项数均衡(balanced)/ 顺序轮转(sequential)。\nconst Waterfall = withPlugins(WaterfallCore, [\n createAlignmentPlugin({\n mode: \"shortest\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
18
|
+
"features": [
|
|
19
|
+
"三种列分配策略",
|
|
20
|
+
"只改 props.alignmentMode,不影响其他配置",
|
|
21
|
+
"与 ResponsiveColumns / AutoColumn 正交"
|
|
22
|
+
],
|
|
23
|
+
"useCases": [
|
|
24
|
+
"内容流:默认 shortest",
|
|
25
|
+
"等长卡片:balanced 更整齐",
|
|
26
|
+
"需要与后端顺序对齐:sequential"
|
|
27
|
+
],
|
|
28
|
+
"notes": [
|
|
29
|
+
"balanced 与 shortest 在列高相同时都取最左列,视觉上左偏是预期行为。"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
;
|
|
33
|
+
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createAlignmentPlugin as create, AlignmentConfig } from './create';
|
|
2
|
+
import { PluginDoc } from '@vane/plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createAlignmentPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { AlignmentConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/AlignmentPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,qBAAqB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAwD,OAAO,MAAM,GAAG;IACxG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type AutoColumnConfig = {
|
|
3
|
+
/** 每列最小宽度(含内容区,不含列间距) */
|
|
4
|
+
minColumnWidth: number;
|
|
5
|
+
/** 最大列数(可选) */
|
|
6
|
+
maxColumns?: number;
|
|
7
|
+
/** 最小列数(可选,默认 1) */
|
|
8
|
+
minColumns?: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* AutoColumnPlugin - 按「容器可用宽度 ÷ 最小列宽」自动决定列数。
|
|
12
|
+
*
|
|
13
|
+
* 走 D1-A 布局钩子 `calculateColumns`:容器宽度与 padding / columnGap 都由 Core
|
|
14
|
+
* 现算好传进来,不用再拿 window.innerWidth 近似(旧版那样在窄容器里会多排一列)。
|
|
15
|
+
* 公式:columns = floor((available + columnGap) / (minColumnWidth + columnGap))
|
|
16
|
+
*/
|
|
17
|
+
export declare function createAutoColumnPlugin<T = any>(config: AutoColumnConfig): WaterfallPlugin<T>;
|
|
18
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/AutoColumnPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yBAAyB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAC5C,MAAM,EAAE,gBAAgB,GACvB,eAAe,CAAC,CAAC,CAAC,CAgCpB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "AutoColumnPlugin",
|
|
3
|
+
"description": "按「容器可用宽度 ÷ 最小列宽」自动决定列数,取代写死 3 列。走 D1-A 布局钩子(calculateColumns),拿到的是真实容器宽度,不是 window.innerWidth。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"layout",
|
|
7
|
+
"layout-hook",
|
|
8
|
+
"响应式"
|
|
9
|
+
],
|
|
10
|
+
"config": [
|
|
11
|
+
{
|
|
12
|
+
"name": "minColumnWidth",
|
|
13
|
+
"type": "number",
|
|
14
|
+
"default": "—",
|
|
15
|
+
"description": "每列最小宽度 px(必填)"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "maxColumns",
|
|
19
|
+
"type": "number",
|
|
20
|
+
"default": "Infinity",
|
|
21
|
+
"description": "列数上限"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "minColumns",
|
|
25
|
+
"type": "number",
|
|
26
|
+
"default": "1",
|
|
27
|
+
"description": "列数下限"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"example": "// 按容器宽与最小列宽自动算列数,窄屏自动降列。\nconst Waterfall = withPlugins(WaterfallCore, [\n createAutoColumnPlugin({\n maxColumns: \"Infinity\",\n minColumns: 1,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
31
|
+
"conflicts": [
|
|
32
|
+
"ResponsiveColumnsPlugin"
|
|
33
|
+
],
|
|
34
|
+
"features": [
|
|
35
|
+
"按容器宽度(不是视口宽度)算列数",
|
|
36
|
+
"列数上下限可夹",
|
|
37
|
+
"与 Gap / Padding 一起算,留白不吞列宽"
|
|
38
|
+
],
|
|
39
|
+
"useCases": [
|
|
40
|
+
"响应式信息流",
|
|
41
|
+
"侧边栏宽度可拖动的后台看板",
|
|
42
|
+
"移动端 → 桌面端同一套代码"
|
|
43
|
+
],
|
|
44
|
+
"notes": [
|
|
45
|
+
"与 ResponsiveColumnsPlugin 同时装会互相覆盖列数,只选一个。"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
;
|
|
49
|
+
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createAutoColumnPlugin as create, AutoColumnConfig } from './create';
|
|
2
|
+
import { PluginDoc } from '@vane/plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createAutoColumnPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { AutoColumnConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/AutoColumnPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,sBAAsB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAwD,OAAO,MAAM,GAAG;IACzG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type BookmarkConfig = {
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type BookmarkConfig = {
|
|
3
3
|
/** localStorage 键名 */
|
|
4
4
|
storageKey?: string;
|
|
5
5
|
/** 滚动行为 */
|
|
@@ -12,4 +12,4 @@ type BookmarkConfig = {
|
|
|
12
12
|
* - 忽略输入框/可编辑元素中的按键
|
|
13
13
|
*/
|
|
14
14
|
export declare function createBookmarkPlugin<T = any>(config?: BookmarkConfig): WaterfallPlugin<T>;
|
|
15
|
-
|
|
15
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/BookmarkPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,cAAc,GAAG;IAC3B,sBAAsB;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW;IACX,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CACpC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,cAAmB,GAAG,eAAe,CAAC,CAAC,CAAC,CA8D7F"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "BookmarkPlugin",
|
|
3
|
+
"description": "长列表读到一半要跳走时按 **B** 存位置,回来按 **R** 复原。焦点在输入框/可编辑区域时不拦截按键。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"ui",
|
|
7
|
+
"滚动",
|
|
8
|
+
"快捷键"
|
|
9
|
+
],
|
|
10
|
+
"config": [
|
|
11
|
+
{
|
|
12
|
+
"name": "storageKey",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "\"waterfall-bookmark\"",
|
|
15
|
+
"description": "localStorage 键名"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "scrollBehavior",
|
|
19
|
+
"type": "\"auto\" | \"smooth\"",
|
|
20
|
+
"default": "\"smooth\"",
|
|
21
|
+
"description": "恢复时的滚动行为"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"example": "// 按 B 记录滚动位置、按 R 跳回(localStorage),忽略输入框按键。\nconst Waterfall = withPlugins(WaterfallCore, [\n createBookmarkPlugin({\n storageKey: \"waterfall-bookmark\",\n scrollBehavior: \"smooth\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
25
|
+
"features": [
|
|
26
|
+
"B 存 / R 取,零 UI 侵入",
|
|
27
|
+
"自动区分容器滚动与页面滚动",
|
|
28
|
+
"输入框内不误触"
|
|
29
|
+
],
|
|
30
|
+
"useCases": [
|
|
31
|
+
"长文列表阅读",
|
|
32
|
+
"后台大表格浏览",
|
|
33
|
+
"演示时快速复位"
|
|
34
|
+
],
|
|
35
|
+
"notes": [
|
|
36
|
+
"键名全局共用,一个页面里多处瀑布流请各自传不同的 storageKey。"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
;
|
|
40
|
+
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createBookmarkPlugin as create, BookmarkConfig } from './create';
|
|
2
|
+
import { PluginDoc } from '@vane/plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createBookmarkPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { BookmarkConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/BookmarkPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,oBAAoB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAwD,OAAO,MAAM,GAAG;IACvG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type ClickAnalyticsConfig = {
|
|
3
|
+
/** 是否在控制台打印每次点击(默认 false) */
|
|
4
|
+
log?: boolean;
|
|
5
|
+
/** 是否显示右上角计数角标(默认 false,生产版式应关闭) */
|
|
6
|
+
showOverlay?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** `getStats()` 的返回形状:够平,直接 `JSON.stringify` 就能上报 */
|
|
9
|
+
export type ClickAnalyticsStats = {
|
|
10
|
+
total: number;
|
|
11
|
+
byIndex: Array<{
|
|
12
|
+
index: number;
|
|
13
|
+
clicks: number;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* ClickAnalyticsPlugin - 点击分析(基础版)
|
|
18
|
+
* - 统计点击次数,向 bus 发送事件:analytics:click
|
|
19
|
+
* - 可选控制台输出日志
|
|
20
|
+
* - `getStats()` 把内存里的计数吐出来,方便接到自己的上报通道
|
|
21
|
+
*/
|
|
22
|
+
export declare function createClickAnalyticsPlugin<T = any>(config?: ClickAnalyticsConfig): WaterfallPlugin<T> & {
|
|
23
|
+
getStats: () => ClickAnalyticsStats;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/ClickAnalyticsPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,oBAAoB,GAAG;IACjC,6BAA6B;IAC7B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oCAAoC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,GAAG,GAAG,EAChD,MAAM,GAAE,oBAAyB,GAChC,eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;CAAE,CAgE9D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "ClickAnalyticsPlugin",
|
|
3
|
+
"description": "统计每次项点击并累计总数,向 bus 发 `analytics:click`(带 index / item / total),`getStats()` 可随时取出按 index 的计数。默认只上报不显示角标,接入真实版式时不会被调试面板盖住内容。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"interaction",
|
|
7
|
+
"埋点"
|
|
8
|
+
],
|
|
9
|
+
"config": [
|
|
10
|
+
{
|
|
11
|
+
"name": "log",
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"default": "false",
|
|
14
|
+
"description": "是否在控制台打印每次点击"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "showOverlay",
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": "false",
|
|
20
|
+
"description": "是否显示右上角计数角标"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"example": "// 统计项点击次数,发 `analytics:click` 事件,可选角标与日志。\nconst Waterfall = withPlugins(WaterfallCore, [\n createClickAnalyticsPlugin({\n log: false,\n showOverlay: false,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
24
|
+
"features": [
|
|
25
|
+
"点击总量 + 按 index 明细(getStats)",
|
|
26
|
+
"bus 事件可被外部订阅上报",
|
|
27
|
+
"角标默认关闭"
|
|
28
|
+
],
|
|
29
|
+
"useCases": [
|
|
30
|
+
"内容流点击率统计",
|
|
31
|
+
"AB 实验埋点",
|
|
32
|
+
"调试点击行为"
|
|
33
|
+
],
|
|
34
|
+
"notes": [
|
|
35
|
+
"生产环境请把数据从 bus 事件或 getStats() 接到自己的埋点 SDK,不要让插件直接打日志。",
|
|
36
|
+
"计数只在内存里,刷新即清零 —— 想持久化要自己定时取 getStats() 上报。"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
;
|
|
40
|
+
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createClickAnalyticsPlugin as create, ClickAnalyticsConfig, ClickAnalyticsStats } from './create';
|
|
2
|
+
import { PluginDoc } from '@vane/plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createClickAnalyticsPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { ClickAnalyticsConfig, ClickAnalyticsStats };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/ClickAnalyticsPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,0BAA0B,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAwD,OAAO,MAAM,GAAG;IAC7G,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type DebounceConfig = {
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type DebounceConfig = {
|
|
3
3
|
/** 布局防抖延迟(ms) */
|
|
4
4
|
delay: number;
|
|
5
5
|
};
|
|
@@ -7,4 +7,4 @@ type DebounceConfig = {
|
|
|
7
7
|
* DebounceLayoutPlugin - 调整核心布局的防抖延迟
|
|
8
8
|
*/
|
|
9
9
|
export declare function createDebounceLayoutPlugin<T = any>(config: DebounceConfig): WaterfallPlugin<T>;
|
|
10
|
-
|
|
10
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/DebounceLayoutPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,cAAc,GAAG;IAC3B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC,CAAC,CAW9F"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "DebounceLayoutPlugin",
|
|
3
|
+
"description": "只调 debounceDelay:容器宽度连续变化(抽屉展开、分栏拖拽)时,等变化停下来再算一次布局,避免每帧重排。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"perf",
|
|
7
|
+
"性能"
|
|
8
|
+
],
|
|
9
|
+
"config": [
|
|
10
|
+
{
|
|
11
|
+
"name": "delay",
|
|
12
|
+
"type": "number",
|
|
13
|
+
"default": "—",
|
|
14
|
+
"description": "布局防抖 ms(必填)"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"example": "// 单独放大布局防抖,容器频繁变宽时(抽屉/侧栏动画)不抖。\nconst Waterfall = withPlugins(WaterfallCore, [\n createDebounceLayoutPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
18
|
+
"features": [
|
|
19
|
+
"只影响布局时机,不影响渲染",
|
|
20
|
+
"可被 ThrottlePlugin 覆盖",
|
|
21
|
+
"对移动端软键盘弹出也有效"
|
|
22
|
+
],
|
|
23
|
+
"useCases": [
|
|
24
|
+
"可折叠侧栏",
|
|
25
|
+
"分栏宽度拖拽",
|
|
26
|
+
"横竖屏切换"
|
|
27
|
+
],
|
|
28
|
+
"notes": [
|
|
29
|
+
"delay 过大会让「展开后布局」明显滞后,建议 120–250ms。"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
;
|
|
33
|
+
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createDebounceLayoutPlugin as create, DebounceConfig } from './create';
|
|
2
|
+
import { PluginDoc } from '@vane/plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createDebounceLayoutPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { DebounceConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/DebounceLayoutPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,0BAA0B,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAwD,OAAO,MAAM,GAAG;IAC7G,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,cAAc,EAAE,CAAC"}
|