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.
Files changed (246) hide show
  1. package/README.md +174 -365
  2. package/dist/chunks/WaterfallCore-BSXw7bl_.js +581 -0
  3. package/dist/chunks/doc-3Fpag2G8.js +84 -0
  4. package/dist/chunks/doc-78xF08vt.js +82 -0
  5. package/dist/chunks/doc-B-7dugGv.js +79 -0
  6. package/dist/chunks/doc-B6kLfMPv.js +121 -0
  7. package/dist/chunks/doc-BCGQ8Cp5.js +114 -0
  8. package/dist/chunks/doc-BIzjYAZW.js +50 -0
  9. package/dist/chunks/doc-BP0DmB7-.js +91 -0
  10. package/dist/chunks/doc-BXElhF2h.js +138 -0
  11. package/dist/chunks/doc-BXSy2aPP.js +59 -0
  12. package/dist/chunks/doc-BfWnfTst.js +83 -0
  13. package/dist/chunks/doc-BtzhgTYj.js +85 -0
  14. package/dist/chunks/doc-C5xrHNoC.js +70 -0
  15. package/dist/chunks/doc-CBHjiDG7.js +88 -0
  16. package/dist/chunks/doc-CTUoMe7o.js +79 -0
  17. package/dist/chunks/doc-CcPFavOs.js +56 -0
  18. package/dist/chunks/doc-CraXjOaA.js +68 -0
  19. package/dist/chunks/doc-DElLNjIc.js +61 -0
  20. package/dist/chunks/doc-DJjxOYzW.js +111 -0
  21. package/dist/chunks/doc-DukOmDCo.js +95 -0
  22. package/dist/chunks/doc-DzvTrZ13.js +60 -0
  23. package/dist/chunks/doc-NhL4Ux8q.js +125 -0
  24. package/dist/chunks/doc-bTHwfIVb.js +78 -0
  25. package/dist/chunks/doc-f4Uijujv.js +102 -0
  26. package/dist/chunks/doc-gTAsLjVx.js +55 -0
  27. package/dist/chunks/doc-j4W9SUrY.js +76 -0
  28. package/dist/chunks/doc-kTbJE7rY.js +92 -0
  29. package/dist/chunks/index-BAWlVYr3.js +5 -0
  30. package/dist/chunks/index-COaun3nf.js +15 -0
  31. package/dist/chunks/index-DXAtA2f6.js +11 -0
  32. package/dist/chunks/index-DsRLmBW-.js +13 -0
  33. package/dist/chunks/index-gjoCq0yC.js +21 -0
  34. package/dist/chunks/index-wLI6UXkY.js +5 -0
  35. package/dist/chunks/withPlugins-DLoKg4AP.js +559 -0
  36. package/dist/components/WaterfallPlugin/WaterfallCore.d.ts +124 -0
  37. package/dist/components/WaterfallPlugin/WaterfallCore.d.ts.map +1 -0
  38. package/dist/components/WaterfallPlugin/index.d.ts +9 -10
  39. package/dist/components/WaterfallPlugin/index.d.ts.map +1 -0
  40. package/dist/components/WaterfallPlugin/layout.d.ts +41 -0
  41. package/dist/components/WaterfallPlugin/layout.d.ts.map +1 -0
  42. package/dist/components/WaterfallPlugin/plugins/types.d.ts +76 -380
  43. package/dist/components/WaterfallPlugin/plugins/types.d.ts.map +1 -0
  44. package/dist/components/WaterfallPlugin/virtualize.d.ts +62 -0
  45. package/dist/components/WaterfallPlugin/virtualize.d.ts.map +1 -0
  46. package/dist/components/WaterfallPlugin/{plugins/withPlugins.d.ts → withPlugins.d.ts} +4 -2
  47. package/dist/components/WaterfallPlugin/withPlugins.d.ts.map +1 -0
  48. package/dist/custom-plugins/A11yPlugin/create.d.ts +23 -0
  49. package/dist/custom-plugins/A11yPlugin/create.d.ts.map +1 -0
  50. package/dist/custom-plugins/A11yPlugin/doc.json.d.ts +52 -0
  51. package/dist/custom-plugins/A11yPlugin/index.d.ts +11 -0
  52. package/dist/custom-plugins/A11yPlugin/index.d.ts.map +1 -0
  53. package/dist/custom-plugins/A11yPlugin/index.js +5 -0
  54. package/dist/{components/WaterfallPlugin/custom-plugins/Alignment/index.d.ts → custom-plugins/AlignmentPlugin/create.d.ts} +3 -3
  55. package/dist/custom-plugins/AlignmentPlugin/create.d.ts.map +1 -0
  56. package/dist/custom-plugins/AlignmentPlugin/doc.json.d.ts +34 -0
  57. package/dist/custom-plugins/AlignmentPlugin/index.d.ts +11 -0
  58. package/dist/custom-plugins/AlignmentPlugin/index.d.ts.map +1 -0
  59. package/dist/custom-plugins/AlignmentPlugin/index.js +5 -0
  60. package/dist/custom-plugins/AutoColumnPlugin/create.d.ts +18 -0
  61. package/dist/custom-plugins/AutoColumnPlugin/create.d.ts.map +1 -0
  62. package/dist/custom-plugins/AutoColumnPlugin/doc.json.d.ts +50 -0
  63. package/dist/custom-plugins/AutoColumnPlugin/index.d.ts +11 -0
  64. package/dist/custom-plugins/AutoColumnPlugin/index.d.ts.map +1 -0
  65. package/dist/custom-plugins/AutoColumnPlugin/index.js +5 -0
  66. package/dist/{components/WaterfallPlugin/custom-plugins/Bookmark/index.d.ts → custom-plugins/BookmarkPlugin/create.d.ts} +3 -3
  67. package/dist/custom-plugins/BookmarkPlugin/create.d.ts.map +1 -0
  68. package/dist/custom-plugins/BookmarkPlugin/doc.json.d.ts +41 -0
  69. package/dist/custom-plugins/BookmarkPlugin/index.d.ts +11 -0
  70. package/dist/custom-plugins/BookmarkPlugin/index.d.ts.map +1 -0
  71. package/dist/custom-plugins/BookmarkPlugin/index.js +5 -0
  72. package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts +25 -0
  73. package/dist/custom-plugins/ClickAnalyticsPlugin/create.d.ts.map +1 -0
  74. package/dist/custom-plugins/ClickAnalyticsPlugin/doc.json.d.ts +41 -0
  75. package/dist/custom-plugins/ClickAnalyticsPlugin/index.d.ts +11 -0
  76. package/dist/custom-plugins/ClickAnalyticsPlugin/index.d.ts.map +1 -0
  77. package/dist/custom-plugins/ClickAnalyticsPlugin/index.js +5 -0
  78. package/dist/{components/WaterfallPlugin/custom-plugins/DebounceLayout/index.d.ts → custom-plugins/DebounceLayoutPlugin/create.d.ts} +3 -3
  79. package/dist/custom-plugins/DebounceLayoutPlugin/create.d.ts.map +1 -0
  80. package/dist/custom-plugins/DebounceLayoutPlugin/doc.json.d.ts +34 -0
  81. package/dist/custom-plugins/DebounceLayoutPlugin/index.d.ts +11 -0
  82. package/dist/custom-plugins/DebounceLayoutPlugin/index.d.ts.map +1 -0
  83. package/dist/custom-plugins/DebounceLayoutPlugin/index.js +5 -0
  84. package/dist/custom-plugins/DragReorderPlugin/create.d.ts +33 -0
  85. package/dist/custom-plugins/DragReorderPlugin/create.d.ts.map +1 -0
  86. package/dist/custom-plugins/DragReorderPlugin/doc.json.d.ts +53 -0
  87. package/dist/custom-plugins/DragReorderPlugin/index.d.ts +11 -0
  88. package/dist/custom-plugins/DragReorderPlugin/index.d.ts.map +1 -0
  89. package/dist/custom-plugins/DragReorderPlugin/index.js +5 -0
  90. package/dist/{components/WaterfallPlugin/custom-plugins/Filter/index.d.ts → custom-plugins/FilterPlugin/create.d.ts} +3 -3
  91. package/dist/custom-plugins/FilterPlugin/create.d.ts.map +1 -0
  92. package/dist/custom-plugins/FilterPlugin/doc.json.d.ts +47 -0
  93. package/dist/custom-plugins/FilterPlugin/index.d.ts +11 -0
  94. package/dist/custom-plugins/FilterPlugin/index.d.ts.map +1 -0
  95. package/dist/custom-plugins/FilterPlugin/index.js +5 -0
  96. package/dist/{components/WaterfallPlugin/custom-plugins/FixedHeight/index.d.ts → custom-plugins/FixedHeightPlugin/create.d.ts} +3 -3
  97. package/dist/custom-plugins/FixedHeightPlugin/create.d.ts.map +1 -0
  98. package/dist/custom-plugins/FixedHeightPlugin/doc.json.d.ts +34 -0
  99. package/dist/custom-plugins/FixedHeightPlugin/index.d.ts +11 -0
  100. package/dist/custom-plugins/FixedHeightPlugin/index.d.ts.map +1 -0
  101. package/dist/custom-plugins/FixedHeightPlugin/index.js +5 -0
  102. package/dist/{components/WaterfallPlugin/custom-plugins/Gap/index.d.ts → custom-plugins/GapPlugin/create.d.ts} +3 -3
  103. package/dist/custom-plugins/GapPlugin/create.d.ts.map +1 -0
  104. package/dist/custom-plugins/GapPlugin/doc.json.d.ts +47 -0
  105. package/dist/custom-plugins/GapPlugin/index.d.ts +11 -0
  106. package/dist/custom-plugins/GapPlugin/index.d.ts.map +1 -0
  107. package/dist/custom-plugins/GapPlugin/index.js +5 -0
  108. package/dist/custom-plugins/GroupingPlugin/create.d.ts +16 -0
  109. package/dist/custom-plugins/GroupingPlugin/create.d.ts.map +1 -0
  110. package/dist/custom-plugins/GroupingPlugin/doc.json.d.ts +40 -0
  111. package/dist/custom-plugins/GroupingPlugin/index.d.ts +11 -0
  112. package/dist/custom-plugins/GroupingPlugin/index.d.ts.map +1 -0
  113. package/dist/custom-plugins/GroupingPlugin/index.js +5 -0
  114. package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts +31 -0
  115. package/dist/custom-plugins/HeatmapAnalyticsPlugin/create.d.ts.map +1 -0
  116. package/dist/custom-plugins/HeatmapAnalyticsPlugin/doc.json.d.ts +43 -0
  117. package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.d.ts +11 -0
  118. package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.d.ts.map +1 -0
  119. package/dist/custom-plugins/HeatmapAnalyticsPlugin/index.js +5 -0
  120. package/dist/custom-plugins/InfiniteScrollPlugin/create.d.ts +17 -0
  121. package/dist/custom-plugins/InfiniteScrollPlugin/create.d.ts.map +1 -0
  122. package/dist/custom-plugins/InfiniteScrollPlugin/doc.json.d.ts +44 -0
  123. package/dist/custom-plugins/InfiniteScrollPlugin/index.d.ts +11 -0
  124. package/dist/custom-plugins/InfiniteScrollPlugin/index.d.ts.map +1 -0
  125. package/dist/custom-plugins/InfiniteScrollPlugin/index.js +5 -0
  126. package/dist/{components/WaterfallPlugin/custom-plugins/Pagination/index.d.ts → custom-plugins/PaginationPlugin/create.d.ts} +3 -3
  127. package/dist/custom-plugins/PaginationPlugin/create.d.ts.map +1 -0
  128. package/dist/custom-plugins/PaginationPlugin/doc.json.d.ts +50 -0
  129. package/dist/custom-plugins/PaginationPlugin/index.d.ts +11 -0
  130. package/dist/custom-plugins/PaginationPlugin/index.d.ts.map +1 -0
  131. package/dist/custom-plugins/PaginationPlugin/index.js +5 -0
  132. package/dist/custom-plugins/PinItemPlugin/create.d.ts +23 -0
  133. package/dist/custom-plugins/PinItemPlugin/create.d.ts.map +1 -0
  134. package/dist/custom-plugins/PinItemPlugin/doc.json.d.ts +43 -0
  135. package/dist/custom-plugins/PinItemPlugin/index.d.ts +11 -0
  136. package/dist/custom-plugins/PinItemPlugin/index.d.ts.map +1 -0
  137. package/dist/custom-plugins/PinItemPlugin/index.js +5 -0
  138. package/dist/{components/WaterfallPlugin/custom-plugins/Recycle/index.d.ts → custom-plugins/RecyclePlugin/create.d.ts} +3 -3
  139. package/dist/custom-plugins/RecyclePlugin/create.d.ts.map +1 -0
  140. package/dist/custom-plugins/RecyclePlugin/doc.json.d.ts +35 -0
  141. package/dist/custom-plugins/RecyclePlugin/index.d.ts +11 -0
  142. package/dist/custom-plugins/RecyclePlugin/index.d.ts.map +1 -0
  143. package/dist/custom-plugins/RecyclePlugin/index.js +5 -0
  144. package/dist/custom-plugins/ReducedMotionPlugin/create.d.ts +25 -0
  145. package/dist/custom-plugins/ReducedMotionPlugin/create.d.ts.map +1 -0
  146. package/dist/custom-plugins/ReducedMotionPlugin/doc.json.d.ts +42 -0
  147. package/dist/custom-plugins/ReducedMotionPlugin/index.d.ts +11 -0
  148. package/dist/custom-plugins/ReducedMotionPlugin/index.d.ts.map +1 -0
  149. package/dist/custom-plugins/ReducedMotionPlugin/index.js +5 -0
  150. package/dist/custom-plugins/ResponsiveColumnsPlugin/create.d.ts +22 -0
  151. package/dist/custom-plugins/ResponsiveColumnsPlugin/create.d.ts.map +1 -0
  152. package/dist/custom-plugins/ResponsiveColumnsPlugin/doc.json.d.ts +37 -0
  153. package/dist/custom-plugins/ResponsiveColumnsPlugin/index.d.ts +10 -0
  154. package/dist/custom-plugins/ResponsiveColumnsPlugin/index.d.ts.map +1 -0
  155. package/dist/custom-plugins/ResponsiveColumnsPlugin/index.js +5 -0
  156. package/dist/{components/WaterfallPlugin/custom-plugins/ScrollAnchor/index.d.ts → custom-plugins/ScrollAnchorPlugin/create.d.ts} +3 -3
  157. package/dist/custom-plugins/ScrollAnchorPlugin/create.d.ts.map +1 -0
  158. package/dist/custom-plugins/ScrollAnchorPlugin/doc.json.d.ts +34 -0
  159. package/dist/custom-plugins/ScrollAnchorPlugin/index.d.ts +11 -0
  160. package/dist/custom-plugins/ScrollAnchorPlugin/index.d.ts.map +1 -0
  161. package/dist/custom-plugins/ScrollAnchorPlugin/index.js +5 -0
  162. package/dist/{components/WaterfallPlugin/custom-plugins/Search/index.d.ts → custom-plugins/SearchPlugin/create.d.ts} +3 -3
  163. package/dist/custom-plugins/SearchPlugin/create.d.ts.map +1 -0
  164. package/dist/custom-plugins/SearchPlugin/doc.json.d.ts +47 -0
  165. package/dist/custom-plugins/SearchPlugin/index.d.ts +11 -0
  166. package/dist/custom-plugins/SearchPlugin/index.d.ts.map +1 -0
  167. package/dist/custom-plugins/SearchPlugin/index.js +5 -0
  168. package/dist/{components/WaterfallPlugin/custom-plugins/Sort/index.d.ts → custom-plugins/SortPlugin/create.d.ts} +3 -3
  169. package/dist/custom-plugins/SortPlugin/create.d.ts.map +1 -0
  170. package/dist/custom-plugins/SortPlugin/doc.json.d.ts +46 -0
  171. package/dist/custom-plugins/SortPlugin/index.d.ts +11 -0
  172. package/dist/custom-plugins/SortPlugin/index.d.ts.map +1 -0
  173. package/dist/custom-plugins/SortPlugin/index.js +5 -0
  174. package/dist/{components/WaterfallPlugin/custom-plugins/StatePersistence/index.d.ts → custom-plugins/StatePersistencePlugin/create.d.ts} +3 -3
  175. package/dist/custom-plugins/StatePersistencePlugin/create.d.ts.map +1 -0
  176. package/dist/custom-plugins/StatePersistencePlugin/doc.json.d.ts +47 -0
  177. package/dist/custom-plugins/StatePersistencePlugin/index.d.ts +11 -0
  178. package/dist/custom-plugins/StatePersistencePlugin/index.d.ts.map +1 -0
  179. package/dist/custom-plugins/StatePersistencePlugin/index.js +5 -0
  180. package/dist/custom-plugins/StickyHeaderPlugin/create.d.ts +13 -0
  181. package/dist/custom-plugins/StickyHeaderPlugin/create.d.ts.map +1 -0
  182. package/dist/custom-plugins/StickyHeaderPlugin/doc.json.d.ts +40 -0
  183. package/dist/custom-plugins/StickyHeaderPlugin/index.d.ts +11 -0
  184. package/dist/custom-plugins/StickyHeaderPlugin/index.d.ts.map +1 -0
  185. package/dist/custom-plugins/StickyHeaderPlugin/index.js +5 -0
  186. package/dist/{components/WaterfallPlugin/custom-plugins/Throttle/index.d.ts → custom-plugins/ThrottlePlugin/create.d.ts} +3 -3
  187. package/dist/custom-plugins/ThrottlePlugin/create.d.ts.map +1 -0
  188. package/dist/custom-plugins/ThrottlePlugin/doc.json.d.ts +40 -0
  189. package/dist/custom-plugins/ThrottlePlugin/index.d.ts +11 -0
  190. package/dist/custom-plugins/ThrottlePlugin/index.d.ts.map +1 -0
  191. package/dist/custom-plugins/ThrottlePlugin/index.js +5 -0
  192. package/dist/{components/WaterfallPlugin/custom-plugins/Transition/index.d.ts → custom-plugins/TransitionPlugin/create.d.ts} +3 -3
  193. package/dist/custom-plugins/TransitionPlugin/create.d.ts.map +1 -0
  194. package/dist/custom-plugins/TransitionPlugin/doc.json.d.ts +43 -0
  195. package/dist/custom-plugins/TransitionPlugin/index.d.ts +11 -0
  196. package/dist/custom-plugins/TransitionPlugin/index.d.ts.map +1 -0
  197. package/dist/custom-plugins/TransitionPlugin/index.js +5 -0
  198. package/dist/{components/WaterfallPlugin/custom-plugins/URLSync/index.d.ts → custom-plugins/URLSyncPlugin/create.d.ts} +3 -3
  199. package/dist/custom-plugins/URLSyncPlugin/create.d.ts.map +1 -0
  200. package/dist/custom-plugins/URLSyncPlugin/doc.json.d.ts +41 -0
  201. package/dist/custom-plugins/URLSyncPlugin/index.d.ts +11 -0
  202. package/dist/custom-plugins/URLSyncPlugin/index.d.ts.map +1 -0
  203. package/dist/custom-plugins/URLSyncPlugin/index.js +5 -0
  204. package/dist/custom-plugins/index.d.ts +61 -0
  205. package/dist/custom-plugins/index.d.ts.map +1 -0
  206. package/dist/custom-plugins/index.js +34 -0
  207. package/dist/entries/core.d.ts +8 -0
  208. package/dist/entries/core.d.ts.map +1 -0
  209. package/dist/entries/core.js +7 -0
  210. package/dist/entries/plugins.d.ts +7 -0
  211. package/dist/entries/plugins.d.ts.map +1 -0
  212. package/dist/entries/plugins.js +36 -0
  213. package/dist/index.d.ts +14 -9
  214. package/dist/index.d.ts.map +1 -0
  215. package/dist/index.js +8 -0
  216. package/dist/presets/dashboard/index.d.ts +13 -0
  217. package/dist/presets/dashboard/index.d.ts.map +1 -0
  218. package/dist/presets/dashboard/index.js +21 -0
  219. package/dist/presets/photo-feed/index.d.ts +13 -0
  220. package/dist/presets/photo-feed/index.d.ts.map +1 -0
  221. package/dist/presets/photo-feed/index.js +17 -0
  222. package/dist/presets/product-feed/index.d.ts +9 -0
  223. package/dist/presets/product-feed/index.d.ts.map +1 -0
  224. package/dist/presets/product-feed/index.js +23 -0
  225. package/package.json +222 -82
  226. package/dist/404.jpg +0 -0
  227. package/dist/components/WaterfallPlugin/core/WaterfallCore.d.ts +0 -174
  228. package/dist/components/WaterfallPlugin/custom-plugins/A11y/index.d.ts +0 -16
  229. package/dist/components/WaterfallPlugin/custom-plugins/AutoColumn/index.d.ts +0 -17
  230. package/dist/components/WaterfallPlugin/custom-plugins/ClickAnalytics/index.d.ts +0 -12
  231. package/dist/components/WaterfallPlugin/custom-plugins/DragReorder/index.d.ts +0 -13
  232. package/dist/components/WaterfallPlugin/custom-plugins/Grouping/index.d.ts +0 -12
  233. package/dist/components/WaterfallPlugin/custom-plugins/HeatmapAnalytics/index.d.ts +0 -14
  234. package/dist/components/WaterfallPlugin/custom-plugins/InfiniteScroll/index.d.ts +0 -13
  235. package/dist/components/WaterfallPlugin/custom-plugins/PinItem/index.d.ts +0 -13
  236. package/dist/components/WaterfallPlugin/custom-plugins/ReducedMotion/index.d.ts +0 -13
  237. package/dist/components/WaterfallPlugin/custom-plugins/ResponsiveColumns/index.d.ts +0 -10
  238. package/dist/components/WaterfallPlugin/custom-plugins/StickyHeader/index.d.ts +0 -11
  239. package/dist/components/WaterfallPlugin/custom-plugins/VirtualWaterfall/index.d.ts +0 -12
  240. package/dist/components/WaterfallPlugin/custom-plugins/index.d.ts +0 -30
  241. package/dist/components/WaterfallPlugin/plugins/PluginBus.d.ts +0 -2
  242. package/dist/components/WaterfallPlugin/plugins/PluginManager.d.ts +0 -2
  243. package/dist/components/WaterfallPlugin/plugins/index.d.ts +0 -8
  244. package/dist/index.es.js +0 -2382
  245. package/dist/index.umd.js +0 -30
  246. package/dist/vite.svg +0 -1
@@ -0,0 +1,33 @@
1
+ import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
2
+ export type DragReorderConfig<T = any> = {
3
+ /** 是否启用(默认 true) */
4
+ enabled?: boolean;
5
+ /**
6
+ * 松手时的重排回调。插件只负责"拖"与"从哪到哪",
7
+ * 数组怎么改由调用方决定(就地 splice / 走接口 / 写回 store)。
8
+ */
9
+ onReorder?: (from: number, to: number, item: T | undefined) => void;
10
+ /** 是否显示虚线边框提示可拖(默认 false,接入真实版式时基本都要关) */
11
+ showHandle?: boolean;
12
+ /**
13
+ * 触屏长按多久进入拖拽(ms,默认 180)。
14
+ *
15
+ * 触摸设备上 `draggable` 不生效,必须走 pointer 事件;但 pointer 一动就是滚动,
16
+ * 所以用「长按」区分「想滚」和「想拖」。设 0 则不需要长按。
17
+ */
18
+ touchHoldMs?: number;
19
+ };
20
+ /**
21
+ * DragReorderPlugin - 拖拽重排。
22
+ *
23
+ * 两条输入路径,各管一半设备:
24
+ * - **鼠标**:原生 HTML5 `dragstart/dragover/drop`。别改它,改成 pointer 反而会
25
+ * 和 Core 的滚动、文本选择打架;
26
+ * - **触屏 / 触控笔**:`pointerdown` + 长按(默认 180ms)进入拖拽,移动时用
27
+ * `elementFromPoint` 找落点。触摸设备上 `draggable` 根本不触发,旧版因此在手机上完全失效。
28
+ *
29
+ * 旧版还有个大坑:只把 from/to 写进 sharedData 就结束了,`onReorder` 不存在,
30
+ * 页面拿不到任何回调(注释里写着"占位:仅记录")。这里补上真回调。
31
+ */
32
+ export declare function createDragReorderPlugin<T = any>(config?: DragReorderConfig<T>): WaterfallPlugin<T>;
33
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/DragReorderPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI;IACvC,oBAAoB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;IACpE,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAeF;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,GAAG,GAAG,EAC7C,MAAM,GAAE,iBAAiB,CAAC,CAAC,CAAM,GAChC,eAAe,CAAC,CAAC,CAAC,CA0HpB"}
@@ -0,0 +1,53 @@
1
+ declare const _default: {
2
+ "name": "DragReorderPlugin",
3
+ "description": "给每个项加拖拽能力,松手时回调 `onReorder(from, to)`,同时向 bus 发 `drag:reorder`。鼠标走原生 HTML5 拖拽,触屏走「长按 + pointer」——触摸设备上 `draggable` 根本不触发,旧版因此在手机上完全失效。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "interaction",
7
+ "拖拽"
8
+ ],
9
+ "config": [
10
+ {
11
+ "name": "enabled",
12
+ "type": "boolean",
13
+ "default": "true",
14
+ "description": "是否启用拖拽"
15
+ },
16
+ {
17
+ "name": "onReorder",
18
+ "type": "(from, to, item) => void",
19
+ "default": "—",
20
+ "description": "重排回调"
21
+ },
22
+ {
23
+ "name": "showHandle",
24
+ "type": "boolean",
25
+ "default": "false",
26
+ "description": "是否显示虚线边框提示可拖"
27
+ },
28
+ {
29
+ "name": "touchHoldMs",
30
+ "type": "number",
31
+ "default": "180",
32
+ "description": "触屏长按多久进入拖拽(ms),0 表示不需要长按"
33
+ }
34
+ ],
35
+ "example": "// 鼠标走 HTML5 draggable,触屏走长按 + pointer,松手时回调 onReorder(from, to)。\nconst Waterfall = withPlugins(WaterfallCore, [\n createDragReorderPlugin({\n enabled: true,\n showHandle: false,\n touchHoldMs: 180,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
36
+ "features": [
37
+ "鼠标:原生 HTML5 拖拽,无额外依赖",
38
+ "触屏:长按 180ms 后 pointer 拖拽(可配 touchHoldMs)",
39
+ "onReorder 回调真正可用,bus 发 `drag:reorder`"
40
+ ],
41
+ "useCases": [
42
+ "后台卡片排序",
43
+ "收藏夹手动排序",
44
+ "仪表盘组件排列"
45
+ ],
46
+ "notes": [
47
+ "插件只负责「拖」和「告诉你从哪到哪」,数组重排由调用方在 onReorder 里做。",
48
+ "触屏用长按区分「想滚」和「想拖」:不这样做,手指一滑就变成拖拽,页面滚不动。"
49
+ ]
50
+ }
51
+ ;
52
+
53
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { createDragReorderPlugin as create, DragReorderConfig } from './create';
2
+ import { PluginDoc } from '@vane/plugin-core';
3
+ /**
4
+ * 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
5
+ * `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
6
+ */
7
+ export declare const createDragReorderPlugin: typeof create & {
8
+ meta: PluginDoc;
9
+ };
10
+ export type { DragReorderConfig };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/DragReorderPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,uBAAuB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAwD,OAAO,MAAM,GAAG;IAC1G,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { c as e, d as r } from "../../chunks/doc-BXElhF2h.js";
2
+ const o = Object.assign(e, { meta: r });
3
+ export {
4
+ o as createDragReorderPlugin
5
+ };
@@ -1,5 +1,5 @@
1
- import { WaterfallPlugin } from '../../plugins/types';
2
- type FilterConfig<T = any> = {
1
+ import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
2
+ export type FilterConfig<T = any> = {
3
3
  /** 初始筛选函数,可被 props.filterFn 覆盖 */
4
4
  predicate?: (item: T, index: number) => boolean;
5
5
  /** 条件变化后自动滚动到顶部 */
@@ -12,4 +12,4 @@ type FilterConfig<T = any> = {
12
12
  * 优先使用 props.filterFn,其次使用创建插件时传入的 predicate
13
13
  */
14
14
  export declare function createFilterPlugin<T = any>(config?: FilterConfig<T>): WaterfallPlugin<T>;
15
- export {};
15
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/FilterPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,GAAG,IAAI;IAClC,kCAAkC;IAClC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAChD,mBAAmB;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,YAAY,CAAC,CAAC,CAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAiC5F"}
@@ -0,0 +1,47 @@
1
+ declare const _default: {
2
+ "name": "FilterPlugin",
3
+ "description": "用谓词函数过滤数据,优先读 `props.filterFn`,没有就用工厂里传入的 predicate。过滤条件变了可以自动滚回顶部(默认不开)。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "data",
7
+ "数据管线"
8
+ ],
9
+ "config": [
10
+ {
11
+ "name": "predicate",
12
+ "type": "(item, index) => boolean",
13
+ "default": "—",
14
+ "description": "默认谓词,可被 props.filterFn 覆盖"
15
+ },
16
+ {
17
+ "name": "scrollToTop",
18
+ "type": "boolean",
19
+ "default": "false",
20
+ "description": "条件变化后回顶"
21
+ },
22
+ {
23
+ "name": "scrollBehavior",
24
+ "type": "\"auto\" | \"smooth\"",
25
+ "default": "\"auto\"",
26
+ "description": "回顶行为"
27
+ }
28
+ ],
29
+ "example": "// 按谓词过滤 items,参数变化可自动回顶。\nconst Waterfall = withPlugins(WaterfallCore, [\n createFilterPlugin({\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
30
+ "features": [
31
+ "谓词抛错时按「保留」处理,不会整表消失",
32
+ "props.filterFn 优先,便于页面动态换过滤条件",
33
+ "可与 Sort / Search / Pagination 串联"
34
+ ],
35
+ "useCases": [
36
+ "分类 Tab 切换",
37
+ "只看有货 / 只看促销",
38
+ "价格区间筛选"
39
+ ],
40
+ "notes": [
41
+ "数据管线的执行顺序由 priority 决定:Filter(40) → Sort(30) → Search(20) → Pagination(10)。",
42
+ "先过滤再分页,页码总数才是过滤后的总数——顺序反了会出现「第 2 页空」。"
43
+ ]
44
+ }
45
+ ;
46
+
47
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { createFilterPlugin as create, FilterConfig } from './create';
2
+ import { PluginDoc } from '@vane/plugin-core';
3
+ /**
4
+ * 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
5
+ * `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
6
+ */
7
+ export declare const createFilterPlugin: typeof create & {
8
+ meta: PluginDoc;
9
+ };
10
+ export type { FilterConfig };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/FilterPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,kBAAkB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAwD,OAAO,MAAM,GAAG;IACrG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { c as e, d as t } from "../../chunks/doc-3Fpag2G8.js";
2
+ const a = Object.assign(e, { meta: t });
3
+ export {
4
+ a as createFilterPlugin
5
+ };
@@ -1,5 +1,5 @@
1
- import { WaterfallPlugin } from '../../plugins/types';
2
- type FixedHeightConfig = {
1
+ import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
2
+ export type FixedHeightConfig = {
3
3
  /** 固定项高度(像素) */
4
4
  itemHeight: number;
5
5
  };
@@ -8,4 +8,4 @@ type FixedHeightConfig = {
8
8
  * 通过 transformProps 生成新的 items,使得 renderItem 使用统一高度
9
9
  */
10
10
  export declare function createFixedHeightPlugin<T = any>(config: FixedHeightConfig): WaterfallPlugin<T>;
11
- export {};
11
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/FixedHeightPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gBAAgB;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,iBAAiB,GAAG,eAAe,CAAC,CAAC,CAAC,CAsB9F"}
@@ -0,0 +1,34 @@
1
+ declare const _default: {
2
+ "name": "FixedHeightPlugin",
3
+ "description": "把数据里带 height 字段的项统一改写为固定高度,瀑布流变成等高网格。适合「图少字多」的卡片流——等高反而更好扫读。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "layout",
7
+ "网格"
8
+ ],
9
+ "config": [
10
+ {
11
+ "name": "itemHeight",
12
+ "type": "number",
13
+ "default": "—",
14
+ "description": "统一项高 px(必填)"
15
+ }
16
+ ],
17
+ "example": "// 把项高度统一成固定值,瀑布流退化为等高网格。\nconst Waterfall = withPlugins(WaterfallCore, [\n createFixedHeightPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
18
+ "features": [
19
+ "等高网格(严格对齐)",
20
+ "只改数据里已有的 height 字段",
21
+ "与 Pagination / Filter 组合仍然成立"
22
+ ],
23
+ "useCases": [
24
+ "商品列表(图固定比例)",
25
+ "后台看板卡片",
26
+ "需要严格栅格对齐的页面"
27
+ ],
28
+ "notes": [
29
+ "数据里没有 height 字段时不会生效——高度由 renderItem 自己的内容决定。"
30
+ ]
31
+ }
32
+ ;
33
+
34
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { createFixedHeightPlugin as create, FixedHeightConfig } from './create';
2
+ import { PluginDoc } from '@vane/plugin-core';
3
+ /**
4
+ * 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
5
+ * `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
6
+ */
7
+ export declare const createFixedHeightPlugin: typeof create & {
8
+ meta: PluginDoc;
9
+ };
10
+ export type { FixedHeightConfig };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/FixedHeightPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,uBAAuB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAwD,OAAO,MAAM,GAAG;IAC1G,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { c as e, d as t } from "../../chunks/doc-CcPFavOs.js";
2
+ const a = Object.assign(e, { meta: t });
3
+ export {
4
+ a as createFixedHeightPlugin
5
+ };
@@ -1,5 +1,5 @@
1
- import { WaterfallPlugin } from '../../plugins/types';
2
- type GapConfig = {
1
+ import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
2
+ export type GapConfig = {
3
3
  /** 列间距(像素) */
4
4
  columnGap?: number;
5
5
  /** 行间距(像素) */
@@ -28,4 +28,4 @@ type GapConfig = {
28
28
  * GapPlugin - 控制瀑布流的列间距和行间距,支持响应式
29
29
  */
30
30
  export declare function createGapPlugin<T = any>(config: GapConfig): WaterfallPlugin<T>;
31
- export {};
31
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/GapPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,UAAU,CAAC,EAAE;QACX,EAAE,CAAC,EAAE;YAAE,SAAS,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7C,EAAE,CAAC,EAAE;YAAE,SAAS,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7C,EAAE,CAAC,EAAE;YAAE,SAAS,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7C,EAAE,CAAC,EAAE;YAAE,SAAS,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9C,CAAC;CACH,CAAC;AAeF;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,SAAS,GAAG,eAAe,CAAC,CAAC,CAAC,CAoB9E"}
@@ -0,0 +1,47 @@
1
+ declare const _default: {
2
+ "name": "GapPlugin",
3
+ "description": "把 rowGap / columnGap 收敛到一处配置,并支持按窗口宽度切换间距(窄屏 8px、宽屏 16px 这类)。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "layout",
7
+ "间距"
8
+ ],
9
+ "config": [
10
+ {
11
+ "name": "columnGap",
12
+ "type": "number",
13
+ "default": "props.columnGap",
14
+ "description": "列间距 px"
15
+ },
16
+ {
17
+ "name": "rowGap",
18
+ "type": "number",
19
+ "default": "props.rowGap",
20
+ "description": "行间距 px"
21
+ },
22
+ {
23
+ "name": "responsive",
24
+ "type": "{ sm?, md?, lg?, xl? }",
25
+ "default": "—",
26
+ "description": "断点覆盖(按 window 宽度)"
27
+ }
28
+ ],
29
+ "example": "// 统一控制行/列间距,支持按断点给不同间距。\nconst Waterfall = withPlugins(WaterfallCore, [\n createGapPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
30
+ "features": [
31
+ "行列间距一处配置",
32
+ "断点覆盖(sm/md/lg/xl)",
33
+ "不填则回退到 props"
34
+ ],
35
+ "useCases": [
36
+ "设计规范里间距随断点变化",
37
+ "同一组件在不同页面用不同密度"
38
+ ],
39
+ "notes": [
40
+ "断点判断用的是 window.innerWidth(间距通常跟视口走,与列数按容器算不一样)。",
41
+ "断点是「命中即覆盖」:桌面窗口 ≥1200 又配了 responsive.lg,那就一直是 lg 的值,config.columnGap/rowGap 在这档不起作用;想让手写值生效就别给该档位配 responsive。",
42
+ "sm 只在小屏(<768)生效,不会被当成兜底档套到桌面端。"
43
+ ]
44
+ }
45
+ ;
46
+
47
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { createGapPlugin as create, GapConfig } from './create';
2
+ import { PluginDoc } from '@vane/plugin-core';
3
+ /**
4
+ * 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
5
+ * `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
6
+ */
7
+ export declare const createGapPlugin: typeof create & {
8
+ meta: PluginDoc;
9
+ };
10
+ export type { GapConfig };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/GapPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAwD,OAAO,MAAM,GAAG;IAClG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { c as a, d as e } from "../../chunks/doc-j4W9SUrY.js";
2
+ const c = Object.assign(a, { meta: e });
3
+ export {
4
+ c as createGapPlugin
5
+ };
@@ -0,0 +1,16 @@
1
+ import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
2
+ export type GroupingConfig<T = any> = {
3
+ /** 分组函数,返回组键(默认取 item.category) */
4
+ groupBy?: (item: T, index: number) => string | number;
5
+ /** 是否显示分组统计角标(默认 false) */
6
+ showOverlay?: boolean;
7
+ };
8
+ /**
9
+ * GroupingPlugin - 按字段把项分组,结果写进 `sharedData.get("GROUPS")`。
10
+ *
11
+ * 旧版只在 `onPropsChange` 里算,而挂载时不会触发 props 变化 → **首屏永远拿不到分组**,
12
+ * 吸顶条只能显示写死的标题。这里改成挂载即算,并在 items 变化与布局完成时重算,
13
+ * 同时把结果 emit 出去(`grouping:change`),页面不用轮询 sharedData。
14
+ */
15
+ export declare function createGroupingPlugin<T = any>(config?: GroupingConfig<T>): WaterfallPlugin<T>;
16
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/GroupingPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,GAAG,IAAI;IACpC,mCAAmC;IACnC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC;IACtD,2BAA2B;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAC1C,MAAM,GAAE,cAAc,CAAC,CAAC,CAAM,GAC7B,eAAe,CAAC,CAAC,CAAC,CAiEpB"}
@@ -0,0 +1,40 @@
1
+ declare const _default: {
2
+ "name": "GroupingPlugin",
3
+ "description": "用 groupBy 把项按业务字段分组,结果放进 sharedData 的 `GROUPS`(Map<组键, 索引数组>),供 StickyHeaderPlugin、分组统计条等消费。挂载即算一次,之后 props 变化重算。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "ui",
7
+ "分组"
8
+ ],
9
+ "config": [
10
+ {
11
+ "name": "groupBy",
12
+ "type": "(item, index) => string | number",
13
+ "default": "item.category ?? \"default\"",
14
+ "description": "分组函数"
15
+ },
16
+ {
17
+ "name": "showOverlay",
18
+ "type": "boolean",
19
+ "default": "false",
20
+ "description": "是否显示分组统计角标"
21
+ }
22
+ ],
23
+ "example": "// 按字段把项分组,结果写进 sharedData(GROUPS) 供吸顶条 / 统计用。\nconst Waterfall = withPlugins(WaterfallCore, [\n createGroupingPlugin({\n groupBy: \"item.category ?? \\\"default\\\"\",\n showOverlay: false,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
24
+ "features": [
25
+ "挂载即计算(旧版只在 props 变化时算,首屏永远拿不到分组)",
26
+ "结果写 sharedData,跨插件可读",
27
+ "统计角标默认关闭"
28
+ ],
29
+ "useCases": [
30
+ "按分类分组的信息流",
31
+ "按日期分组的时间线",
32
+ "吸顶条显示当前分组"
33
+ ],
34
+ "notes": [
35
+ "分组只产出索引映射,不改变渲染顺序;要视觉分组请自己按分组建行。"
36
+ ]
37
+ }
38
+ ;
39
+
40
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { createGroupingPlugin as create, GroupingConfig } from './create';
2
+ import { PluginDoc } from '@vane/plugin-core';
3
+ /**
4
+ * 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
5
+ * `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
6
+ */
7
+ export declare const createGroupingPlugin: typeof create & {
8
+ meta: PluginDoc;
9
+ };
10
+ export type { GroupingConfig };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/GroupingPlugin/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,5 @@
1
+ import { c as e, d as o } from "../../chunks/doc-BCGQ8Cp5.js";
2
+ const t = Object.assign(e, { meta: o });
3
+ export {
4
+ t as createGroupingPlugin
5
+ };
@@ -0,0 +1,31 @@
1
+ import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
2
+ export type HeatmapAnalyticsConfig = {
3
+ /** 是否显示顶部统计汇总条(默认 false) */
4
+ showOverlay?: boolean;
5
+ /** 别名:示例页使用的 showOverlaySummary */
6
+ showOverlaySummary?: boolean;
7
+ };
8
+ /**
9
+ * `getStats()` 的返回形状:每项的曝光 / 点击次数。
10
+ *
11
+ * 只列「有数据」的项 —— 上千项时把全零项也吐出来没有意义。
12
+ */
13
+ export type HeatmapAnalyticsStats = {
14
+ totalViews: number;
15
+ totalClicks: number;
16
+ items: Array<{
17
+ index: number;
18
+ views: number;
19
+ clicks: number;
20
+ }>;
21
+ };
22
+ /**
23
+ * HeatmapAnalyticsPlugin - 点击/曝光热力分析(基础版)
24
+ * - 统计每项进入视口次数与点击次数
25
+ * - 可选在顶部显示统计摘要叠层
26
+ * - `getStats()` 把内存里的统计吐出来,方便接到自己的上报通道
27
+ */
28
+ export declare function createHeatmapAnalyticsPlugin<T = any>(config?: HeatmapAnalyticsConfig): WaterfallPlugin<T> & {
29
+ getStats: () => HeatmapAnalyticsStats;
30
+ };
31
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/HeatmapAnalyticsPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,sBAAsB,GAAG;IACnC,4BAA4B;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mCAAmC;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,GAAG,GAAG,EAClD,MAAM,GAAE,sBAA2B,GAClC,eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;CAAE,CA2EhE"}
@@ -0,0 +1,43 @@
1
+ declare const _default: {
2
+ "name": "HeatmapAnalyticsPlugin",
3
+ "description": "统计每项进入视口次数与点击次数,可选顶部汇总条,`getStats()` 取出每项明细。曝光是瀑布流里最容易统计错的东西(滚动时反复进出视口),交给插件比自己写 IntersectionObserver 少踩坑。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "interaction",
7
+ "埋点",
8
+ "曝光"
9
+ ],
10
+ "config": [
11
+ {
12
+ "name": "showOverlay",
13
+ "type": "boolean",
14
+ "default": "false",
15
+ "description": "是否显示顶部汇总条"
16
+ },
17
+ {
18
+ "name": "showOverlaySummary",
19
+ "type": "boolean",
20
+ "default": "—",
21
+ "description": "showOverlay 的旧别名"
22
+ }
23
+ ],
24
+ "example": "// 统计每项曝光次数与点击次数,可显示汇总条。\nconst Waterfall = withPlugins(WaterfallCore, [\n createHeatmapAnalyticsPlugin({\n showOverlay: false,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
25
+ "features": [
26
+ "按项的曝光 / 点击双计数",
27
+ "首屏曝光在 onLayoutComplete 补一次",
28
+ "getStats() 输出可上报的扁平结构"
29
+ ],
30
+ "useCases": [
31
+ "信息流曝光分析",
32
+ "广告位可见性验证",
33
+ "调试曝光策略"
34
+ ],
35
+ "notes": [
36
+ "首屏曝光靠 onLayoutComplete 补一次,否则第一帧显示 0。",
37
+ "真实上报要自己做去重与批次(插件只负责计数,不区分「同一项第几次进入」)。",
38
+ "计数只在内存里,刷新即清零 —— 定时取 getStats() 上报。"
39
+ ]
40
+ }
41
+ ;
42
+
43
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { createHeatmapAnalyticsPlugin as create, HeatmapAnalyticsConfig, HeatmapAnalyticsStats } from './create';
2
+ import { PluginDoc } from '@vane/plugin-core';
3
+ /**
4
+ * 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
5
+ * `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
6
+ */
7
+ export declare const createHeatmapAnalyticsPlugin: typeof create & {
8
+ meta: PluginDoc;
9
+ };
10
+ export type { HeatmapAnalyticsConfig, HeatmapAnalyticsStats };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/HeatmapAnalyticsPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,4BAA4B,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAwD,OAAO,MAAM,GAAG;IAC/G,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { c as a, d as t } from "../../chunks/doc-B6kLfMPv.js";
2
+ const c = Object.assign(a, { meta: t });
3
+ export {
4
+ c as createHeatmapAnalyticsPlugin
5
+ };
@@ -0,0 +1,17 @@
1
+ import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
2
+ export type InfiniteScrollConfig = {
3
+ /** 距底部多少像素开始预加载,默认 300(≈ 半屏,滚到底时数据已就位) */
4
+ threshold?: number;
5
+ /** 加载回调;不给则读 `props.onLoadMore` */
6
+ onLoadMore?: () => Promise<void> | void;
7
+ };
8
+ /**
9
+ * InfiniteScrollPlugin - 滚动到距底阈值内触发加载更多。
10
+ *
11
+ * 与旧版的三处差别:
12
+ * 1. 触发条件由 Core 的 `reachBottomOffset` 控制(旧版写死 100px,插件配 300 也不会提前触发);
13
+ * 2. 自带并发锁:上一次 onLoadMore 没 resolve 前不会重复触发(旧版每次滚动事件都会调);
14
+ * 3. `context.hasMore === false` 时直接停(配合页面 setState({ hasMore: false }))。
15
+ */
16
+ export declare function createInfiniteScrollPlugin<T = any>(config?: InfiniteScrollConfig): WaterfallPlugin<T>;
17
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/InfiniteScrollPlugin/create.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG;IACjC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,GAAG,GAAG,EAChD,MAAM,GAAE,oBAAyB,GAChC,eAAe,CAAC,CAAC,CAAC,CAmCpB"}
@@ -0,0 +1,44 @@
1
+ declare const _default: {
2
+ "name": "InfiniteScrollPlugin",
3
+ "description": "监听 Core 的 onReachBottom,在距底部 `threshold` 像素内触发 onLoadMore。自带并发锁:上一次还没结束不会重复触发。",
4
+ "since": "2.0.0",
5
+ "tags": [
6
+ "data",
7
+ "加载更多"
8
+ ],
9
+ "config": [
10
+ {
11
+ "name": "threshold",
12
+ "type": "number",
13
+ "default": "300",
14
+ "description": "触发距离 px"
15
+ },
16
+ {
17
+ "name": "onLoadMore",
18
+ "type": "() => void | Promise<void>",
19
+ "default": "props.onLoadMore",
20
+ "description": "加载回调"
21
+ }
22
+ ],
23
+ "example": "// 滚动到距底部阈值内触发加载更多,带并发锁防重复请求。\nconst Waterfall = withPlugins(WaterfallCore, [\n createInfiniteScrollPlugin({\n threshold: 300,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
24
+ "conflicts": [
25
+ "PaginationPlugin"
26
+ ],
27
+ "features": [
28
+ "距底 300px 预加载,滚到底时数据已就位",
29
+ "并发锁:加载中不重复触发",
30
+ "context.hasMore 为 false 时自动停"
31
+ ],
32
+ "useCases": [
33
+ "信息流无限滚动",
34
+ "画廊继续加载",
35
+ "搜索结果瀑布流"
36
+ ],
37
+ "notes": [
38
+ "阈值不要小于一屏(约 600px),否则用户滚到底会看到空白等待。",
39
+ "翻页类场景请用 PaginationPlugin,两者不要同装。"
40
+ ]
41
+ }
42
+ ;
43
+
44
+ export default _default;