vane-waterfall 1.0.5 → 2.0.1
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 +221 -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,11 @@
|
|
|
1
|
+
import { createInfiniteScrollPlugin as create, InfiniteScrollConfig } from './create';
|
|
2
|
+
import { PluginDoc } from 'vane-plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createInfiniteScrollPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { InfiniteScrollConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/InfiniteScrollPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,0BAA0B,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAwD,OAAO,MAAM,GAAG;IAC7G,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type PaginationConfig = {
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type PaginationConfig = {
|
|
3
3
|
/** 每页数量 */
|
|
4
4
|
pageSize?: number;
|
|
5
5
|
/** 翻页后自动滚动到顶部 */
|
|
@@ -12,4 +12,4 @@ type PaginationConfig = {
|
|
|
12
12
|
* 支持通过 config.pageSize 设定默认每页数量
|
|
13
13
|
*/
|
|
14
14
|
export declare function createPaginationPlugin<T = any>(config?: PaginationConfig): WaterfallPlugin<T>;
|
|
15
|
-
|
|
15
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/PaginationPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,gBAAqB,GAAG,eAAe,CAAC,CAAC,CAAC,CA+BjG"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "PaginationPlugin",
|
|
3
|
+
"description": "读 `props.pageIndex`(1 基)与 `props.pageSize` 切片。放在数据管线最末端,保证切的是「过滤 + 排序 + 搜索」之后的结果。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"data",
|
|
7
|
+
"数据管线",
|
|
8
|
+
"分页"
|
|
9
|
+
],
|
|
10
|
+
"config": [
|
|
11
|
+
{
|
|
12
|
+
"name": "pageSize",
|
|
13
|
+
"type": "number",
|
|
14
|
+
"default": "props.pageSize ?? 20",
|
|
15
|
+
"description": "每页条数"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "scrollToTop",
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"default": "false",
|
|
21
|
+
"description": "翻页后回顶"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "scrollBehavior",
|
|
25
|
+
"type": "\"auto\" | \"smooth\"",
|
|
26
|
+
"default": "\"auto\"",
|
|
27
|
+
"description": "回顶行为"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"example": "// 按 props.pageIndex / pageSize 切片,页码从 1 开始。\nconst Waterfall = withPlugins(WaterfallCore, [\n createPaginationPlugin({\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
31
|
+
"conflicts": [
|
|
32
|
+
"InfiniteScrollPlugin"
|
|
33
|
+
],
|
|
34
|
+
"features": [
|
|
35
|
+
"1 基页码(与 UI 分页器一致)",
|
|
36
|
+
"pageIndex 非法值自动夹到 1",
|
|
37
|
+
"翻页自动回顶可选"
|
|
38
|
+
],
|
|
39
|
+
"useCases": [
|
|
40
|
+
"后台列表分页",
|
|
41
|
+
"搜索结果分页",
|
|
42
|
+
"与 URLSyncPlugin 配合做可分享链接"
|
|
43
|
+
],
|
|
44
|
+
"notes": [
|
|
45
|
+
"pageSize 优先级:props.pageSize > 工厂 config.pageSize > 20。"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
;
|
|
49
|
+
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createPaginationPlugin as create, PaginationConfig } from './create';
|
|
2
|
+
import { PluginDoc } from 'vane-plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createPaginationPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { PaginationConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/PaginationPlugin/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,kBAAkB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAwD,OAAO,MAAM,GAAG;IACzG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type PinItemConfig = {
|
|
3
|
+
/** 要钉在顶部的项索引(建议用 0 起的小索引) */
|
|
4
|
+
pinnedIndices: number[];
|
|
5
|
+
/** 钉到第几列,默认 0(最左列) */
|
|
6
|
+
column?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* PinItemPlugin - 把指定项钉在顶部指定列,其余项从置顶块下方继续排。
|
|
10
|
+
*
|
|
11
|
+
* 旧版这里是个空转插件:全部逻辑压在 `calculateItemPosition` 上,而 Core 里
|
|
12
|
+
* **没有任何地方执行这个钩子**(tasks/07 · 4.5 的死钩子清单),`renderOverlay`
|
|
13
|
+
* 又返回 null —— 上线至今什么都没做。D1-A 把钩子接上后这里才是真的实现。
|
|
14
|
+
*
|
|
15
|
+
* 语义与限制(写在这里,避免变成"看起来能用"的坑):
|
|
16
|
+
* - 置顶项在**同列普通项之前**被布局时最干净(通常 pinnedIndices 是 0..n)。
|
|
17
|
+
* 若置顶项的索引大于该列已排好的项,它会按 floor 规则把后续项往下推,
|
|
18
|
+
* 但已布局的项不会回退,视觉上会重叠。
|
|
19
|
+
* - 置顶项不参与列轮转,永远落在 `config.column`。
|
|
20
|
+
* - 同一列多条置顶按 pinnedIndices 顺序纵向堆叠。
|
|
21
|
+
*/
|
|
22
|
+
export declare function createPinItemPlugin<T = any>(config: PinItemConfig): WaterfallPlugin<T>;
|
|
23
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/PinItemPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG;IAC1B,6BAA6B;IAC7B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,aAAa,GAAG,eAAe,CAAC,CAAC,CAAC,CAiDtF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "PinItemPlugin",
|
|
3
|
+
"description": "把若干索引的项钉在顶部指定列,其余项从它们下方继续排。走 D1-A 布局钩子(calculateItemPosition),是旧版宣称但从未生效的能力。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"layout",
|
|
7
|
+
"layout-hook",
|
|
8
|
+
"置顶"
|
|
9
|
+
],
|
|
10
|
+
"config": [
|
|
11
|
+
{
|
|
12
|
+
"name": "pinnedIndices",
|
|
13
|
+
"type": "number[]",
|
|
14
|
+
"default": "[]",
|
|
15
|
+
"description": "要钉住的项索引"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "column",
|
|
19
|
+
"type": "number",
|
|
20
|
+
"default": "0",
|
|
21
|
+
"description": "钉到第几列"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"example": "// 把指定索引的项钉在顶部同一列,不参与常规列高推进(广告位 / 公告卡)。\nconst Waterfall = withPlugins(WaterfallCore, [\n createPinItemPlugin({\n pinnedIndices: [],\n column: 0,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
25
|
+
"features": [
|
|
26
|
+
"置顶项不占常规列高:后续项从置顶块下方开始",
|
|
27
|
+
"支持多列分别置顶(column 可不同)",
|
|
28
|
+
"每次布局前重置偏移,items 变化后不会累加错位"
|
|
29
|
+
],
|
|
30
|
+
"useCases": [
|
|
31
|
+
"信息流首位的推广卡",
|
|
32
|
+
"公告 / 置顶帖",
|
|
33
|
+
"需要固定在左上角的活动位"
|
|
34
|
+
],
|
|
35
|
+
"notes": [
|
|
36
|
+
"置顶项之间按 pinnedIndices 顺序纵向堆叠,同一列多条会依次往下排。",
|
|
37
|
+
"置顶会挤掉该列的正常网格位置,pinnedIndices 建议控制在 1~2 条。",
|
|
38
|
+
"换列后的 x 由布局引擎按本轮列宽补齐,插件只返回 column 即可 —— 自己用「列宽 + 间距」反推 x 会在间距由其它插件(GapPlugin)注入时算错。"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
;
|
|
42
|
+
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createPinItemPlugin as create, PinItemConfig } from './create';
|
|
2
|
+
import { PluginDoc } from 'vane-plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createPinItemPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { PinItemConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/PinItemPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAwD,OAAO,MAAM,GAAG;IACtG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type RecycleConfig = {
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type RecycleConfig = {
|
|
3
3
|
/** 视口外隐藏项以降低渲染压力(最大可见项数,近似控制) */
|
|
4
4
|
poolSize: number;
|
|
5
5
|
};
|
|
@@ -9,4 +9,4 @@ type RecycleConfig = {
|
|
|
9
9
|
* - 当项进入视口时,恢复为 `visibility:visible`
|
|
10
10
|
*/
|
|
11
11
|
export declare function createRecyclePlugin<T = any>(config: RecycleConfig): WaterfallPlugin<T>;
|
|
12
|
-
|
|
12
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/RecyclePlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,aAAa,GAAG;IAC1B,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,EAAE,aAAa,GAAG,eAAe,CAAC,CAAC,CAAC,CAmCtF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "RecyclePlugin",
|
|
3
|
+
"description": "纯绘制层优化:项离开视口就 `visibility: hidden`,回来再显示。DOM 节点不销毁,滚动位置与已加载的图片都保留,适合「项里有视频/Canvas,重建代价高」的场景。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"interaction",
|
|
7
|
+
"性能"
|
|
8
|
+
],
|
|
9
|
+
"config": [
|
|
10
|
+
{
|
|
11
|
+
"name": "poolSize",
|
|
12
|
+
"type": "number",
|
|
13
|
+
"default": "—",
|
|
14
|
+
"description": "同时保持可见的项数上限(超出则回收最早的)"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"example": "// 视口外的项设 `visibility: hidden`,降低长列表的绘制压力。\nconst Waterfall = withPlugins(WaterfallCore, [\n createRecyclePlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
18
|
+
"features": [
|
|
19
|
+
"不销毁 DOM,只隐藏",
|
|
20
|
+
"项内媒体不重新加载",
|
|
21
|
+
"与虚拟化正交(一个省绘制、一个省节点)"
|
|
22
|
+
],
|
|
23
|
+
"useCases": [
|
|
24
|
+
"项内含视频 / canvas",
|
|
25
|
+
"长列表滚动发虚",
|
|
26
|
+
"低端设备省电"
|
|
27
|
+
],
|
|
28
|
+
"notes": [
|
|
29
|
+
"与 Core 的 `virtualize` 同开会让项被卸载又隐藏,收益互相抵消,建议只选一个。",
|
|
30
|
+
"只改 visibility 不改布局,所以不会引起重排。"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
;
|
|
34
|
+
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRecyclePlugin as create, RecycleConfig } from './create';
|
|
2
|
+
import { PluginDoc } from 'vane-plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createRecyclePlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { RecycleConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/RecyclePlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAwD,OAAO,MAAM,GAAG;IACtG,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type ReducedMotionConfig = {
|
|
3
|
+
/** 当用户偏好减少动画时,是否禁用 transform 定位 */
|
|
4
|
+
disableTransform?: boolean;
|
|
5
|
+
/** 当用户偏好减少动画时,是否移除项过渡效果 */
|
|
6
|
+
removeTransitions?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* ReducedMotionPlugin - 尊重系统的减少动画偏好
|
|
10
|
+
*
|
|
11
|
+
* 两条「为什么」值得记下来:
|
|
12
|
+
*
|
|
13
|
+
* 1. **只改 `itemStyle` 不够**:TransitionPlugin 这类插件会在 `onItemMount` / `onLayout`
|
|
14
|
+
* 里直接写元素的 `style.transition`,内联样式晚于 `itemStyle` 生效。`onLayoutComplete`
|
|
15
|
+
* 在全部 `onLayout` 之后执行,必须在这里再清一次才真的「没有过渡」。
|
|
16
|
+
*
|
|
17
|
+
* 2. **偏好要能运行时切换**:以前在工厂创建时把 `mq.matches` 求值存成常量,用户中途改
|
|
18
|
+
* 系统设置必须刷新页面。现在监听 `change`,并且自己维护一份已挂载元素表 ——
|
|
19
|
+
* 偏好变了并不会触发布局,插件没有别的入口能遍历到那些元素。
|
|
20
|
+
*
|
|
21
|
+
* 定位方式(`useTransform`)是 props 层的,运行时切换要等下一次重渲染才生效;
|
|
22
|
+
* 过渡效果则是即时生效的。
|
|
23
|
+
*/
|
|
24
|
+
export declare function createReducedMotionPlugin<T = any>(config?: ReducedMotionConfig): WaterfallPlugin<T>;
|
|
25
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/ReducedMotionPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,mBAAmB,GAAG;IAChC,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2BAA2B;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAIF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,GAAG,GAAG,EAC/C,MAAM,GAAE,mBAAwB,GAC/B,eAAe,CAAC,CAAC,CAAC,CA6FpB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "ReducedMotionPlugin",
|
|
3
|
+
"description": "检测 `prefers-reduced-motion: reduce`,命中后把 useTransform 关掉并清掉项上的 transition。前庭功能敏感用户不会因为滚动时的位置微动而不适。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"perf",
|
|
7
|
+
"a11y"
|
|
8
|
+
],
|
|
9
|
+
"config": [
|
|
10
|
+
{
|
|
11
|
+
"name": "disableTransform",
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"default": "true",
|
|
14
|
+
"description": "命中偏好时改用 left/top 定位"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "removeTransitions",
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": "true",
|
|
20
|
+
"description": "命中偏好时清掉项过渡"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"example": "// 尊重系统「减少动画」偏好:关掉 transform 定位与项过渡。\nconst Waterfall = withPlugins(WaterfallCore, [\n createReducedMotionPlugin({\n disableTransform: true,\n removeTransitions: true,\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
24
|
+
"features": [
|
|
25
|
+
"系统偏好驱动,零配置生效",
|
|
26
|
+
"两项能力可分别关闭",
|
|
27
|
+
"与 TransitionPlugin 同装时优先生效"
|
|
28
|
+
],
|
|
29
|
+
"useCases": [
|
|
30
|
+
"政务 / 医疗类站点",
|
|
31
|
+
"无障碍合规要求",
|
|
32
|
+
"低性能设备"
|
|
33
|
+
],
|
|
34
|
+
"notes": [
|
|
35
|
+
"偏好由 matchMedia 驱动,并监听 change:运行中改系统设置即时生效(定位方式要等下一次重渲染才切过来)。",
|
|
36
|
+
"只压 `transition-duration`,不写 `transition: none` —— 写简写会把 TransitionPlugin 的过渡整条覆盖,撤销偏好后无从还原。",
|
|
37
|
+
"与 TransitionPlugin 同装不是冲突:ReducedMotion 优先级更高,会先执行并压住过渡。"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
;
|
|
41
|
+
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createReducedMotionPlugin as create, ReducedMotionConfig } from './create';
|
|
2
|
+
import { PluginDoc } from 'vane-plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createReducedMotionPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { ReducedMotionConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/ReducedMotionPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,yBAAyB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAwD,OAAO,MAAM,GAAG;IAC5G,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
type Breakpoint = {
|
|
3
|
+
width: number;
|
|
4
|
+
columns: number;
|
|
5
|
+
};
|
|
6
|
+
type Breakpoints = Record<string, Breakpoint>;
|
|
7
|
+
type ResponsiveColumnsConfig = {
|
|
8
|
+
/** 断点表:键名随意,按 width 升序匹配,命中哪档用哪档 */
|
|
9
|
+
breakpoints: Breakpoints;
|
|
10
|
+
/** 未命中任何断点时回退到几列(默认取 props.columns ?? 3) */
|
|
11
|
+
fallbackColumns?: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* ResponsiveColumnsPlugin - 按断点表决定列数。
|
|
15
|
+
*
|
|
16
|
+
* 走 D1-A 布局钩子 `calculateColumns`:拿到的是**容器**宽度(不是 window.innerWidth),
|
|
17
|
+
* 所以同一个组件嵌在侧边栏或全宽区域里都能算对。旧版走 transformProps + window 宽度,
|
|
18
|
+
* 在「窄容器 + 宽视口」的组合下会给出偏大的列数。
|
|
19
|
+
*/
|
|
20
|
+
export declare function createResponsiveColumnsPlugin<T = any>(config: ResponsiveColumnsConfig): WaterfallPlugin<T>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/ResponsiveColumnsPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAExD,KAAK,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACrD,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAE9C,KAAK,uBAAuB,GAAG;IAC7B,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,GAAG,GAAG,EACnD,MAAM,EAAE,uBAAuB,GAC9B,eAAe,CAAC,CAAC,CAAC,CAmBpB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "ResponsiveColumnsPlugin",
|
|
3
|
+
"description": "用一张断点表控制列数,命中哪档用哪档。走 D1-A 布局钩子(calculateColumns),按容器宽度匹配断点。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"layout",
|
|
7
|
+
"layout-hook",
|
|
8
|
+
"响应式"
|
|
9
|
+
],
|
|
10
|
+
"config": [
|
|
11
|
+
{
|
|
12
|
+
"name": "breakpoints",
|
|
13
|
+
"type": "Record<string, { width: number; columns: number }>",
|
|
14
|
+
"default": "—",
|
|
15
|
+
"description": "断点表,按 width 升序匹配"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"example": "// 按断点表决定列数(如 640 → 2 列、1024 → 3 列、1440 → 4 列)。\nconst Waterfall = withPlugins(WaterfallCore, [\n createResponsiveColumnsPlugin(),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
19
|
+
"conflicts": [
|
|
20
|
+
"AutoColumnPlugin"
|
|
21
|
+
],
|
|
22
|
+
"features": [
|
|
23
|
+
"断点表驱动,设计稿几档就写几档",
|
|
24
|
+
"按容器宽度而非视口宽度匹配",
|
|
25
|
+
"未命中任何断点时回退到 props.columns"
|
|
26
|
+
],
|
|
27
|
+
"useCases": [
|
|
28
|
+
"严格对齐设计断点的站点",
|
|
29
|
+
"同一个组件嵌在不同宽度的容器里"
|
|
30
|
+
],
|
|
31
|
+
"notes": [
|
|
32
|
+
"与 AutoColumnPlugin 互斥。"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
;
|
|
36
|
+
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createResponsiveColumnsPlugin as create } from './create';
|
|
2
|
+
import { PluginDoc } from 'vane-plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createResponsiveColumnsPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/ResponsiveColumnsPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,6BAA6B,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAwD,OAAO,MAAM,GAAG;IAChH,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type ScrollAnchorConfig<T = any> = {
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type ScrollAnchorConfig<T = any> = {
|
|
3
3
|
/** 通过此函数提取锚点 id(默认使用 item.id) */
|
|
4
4
|
getAnchorId?: (item: T, index: number) => string | number | undefined;
|
|
5
5
|
};
|
|
@@ -9,4 +9,4 @@ type ScrollAnchorConfig<T = any> = {
|
|
|
9
9
|
* - 支持通过 bus 事件 anchor:scrollToId 跳转
|
|
10
10
|
*/
|
|
11
11
|
export declare function createScrollAnchorPlugin<T = any>(config?: ScrollAnchorConfig<T>): WaterfallPlugin<T>;
|
|
12
|
-
|
|
12
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/ScrollAnchorPlugin/create.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI;IACxC,iCAAiC;IACjC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACvE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,GAAE,kBAAkB,CAAC,CAAC,CAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAmBxG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "ScrollAnchorPlugin",
|
|
3
|
+
"description": "不需要自己算索引:外部只管 `bus.emit(\"anchor:scrollToId\", { id })`,插件用 getAnchorId 找到对应项并滚过去。适合「从消息跳到某条内容」。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"interaction",
|
|
7
|
+
"滚动"
|
|
8
|
+
],
|
|
9
|
+
"config": [
|
|
10
|
+
{
|
|
11
|
+
"name": "getAnchorId",
|
|
12
|
+
"type": "(item, index) => string | number | undefined",
|
|
13
|
+
"default": "item.id",
|
|
14
|
+
"description": "从项里取锚点 id"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"example": "// 监听 `anchor:scrollToId` 事件,按业务 id 滚动到对应项。\nconst Waterfall = withPlugins(WaterfallCore, [\n createScrollAnchorPlugin({\n getAnchorId: \"item.id\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
18
|
+
"features": [
|
|
19
|
+
"按业务 id 定位,不用算下标",
|
|
20
|
+
"onMount 订阅 / onUnmount 退订(不泄漏)",
|
|
21
|
+
"平滑滚动"
|
|
22
|
+
],
|
|
23
|
+
"useCases": [
|
|
24
|
+
"从通知跳转到具体卡片",
|
|
25
|
+
"目录点击定位",
|
|
26
|
+
"外链深链定位"
|
|
27
|
+
],
|
|
28
|
+
"notes": [
|
|
29
|
+
"目标项必须已在 items 里;分页场景请先切到对应页再发事件。"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
;
|
|
33
|
+
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createScrollAnchorPlugin as create, ScrollAnchorConfig } from './create';
|
|
2
|
+
import { PluginDoc } from 'vane-plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createScrollAnchorPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { ScrollAnchorConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/ScrollAnchorPlugin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,wBAAwB,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAwD,OAAO,MAAM,GAAG;IAC3G,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WaterfallPlugin } from '../../plugins/types';
|
|
2
|
-
type SearchConfig<T = any> = {
|
|
1
|
+
import { WaterfallPlugin } from '../../components/WaterfallPlugin/plugins/types';
|
|
2
|
+
export type SearchConfig<T = any> = {
|
|
3
3
|
/** 要搜索的字段名列表(仅用于对象项) */
|
|
4
4
|
fields?: (keyof T)[];
|
|
5
5
|
/** 条件变化后自动滚动到顶部 */
|
|
@@ -12,4 +12,4 @@ type SearchConfig<T = any> = {
|
|
|
12
12
|
* 仅在对象项中按指定字段进行大小写不敏感的包含匹配
|
|
13
13
|
*/
|
|
14
14
|
export declare function createSearchPlugin<T = any>(config?: SearchConfig<T>): WaterfallPlugin<T>;
|
|
15
|
-
|
|
15
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/custom-plugins/SearchPlugin/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,GAAG,IAAI;IAClC,wBAAwB;IACxB,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IACrB,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,CAqC5F"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"name": "SearchPlugin",
|
|
3
|
+
"description": "读取 `props.searchQuery`,在指定字段上做大小写不敏感的 `includes` 匹配。没指定字段就对对象的全部自有字段匹配。",
|
|
4
|
+
"since": "2.0.0",
|
|
5
|
+
"tags": [
|
|
6
|
+
"data",
|
|
7
|
+
"数据管线",
|
|
8
|
+
"搜索"
|
|
9
|
+
],
|
|
10
|
+
"config": [
|
|
11
|
+
{
|
|
12
|
+
"name": "fields",
|
|
13
|
+
"type": "(keyof T)[]",
|
|
14
|
+
"default": "[]",
|
|
15
|
+
"description": "参与匹配的字段;空则匹配全部自有字段"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "scrollToTop",
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"default": "false",
|
|
21
|
+
"description": "关键词变化后回顶"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "scrollBehavior",
|
|
25
|
+
"type": "\"auto\" | \"smooth\"",
|
|
26
|
+
"default": "\"auto\"",
|
|
27
|
+
"description": "回顶行为"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"example": "// 按 props.searchQuery 做大小写不敏感的多字段包含匹配。\nconst Waterfall = withPlugins(WaterfallCore, [\n createSearchPlugin({\n fields: [],\n scrollToTop: false,\n scrollBehavior: \"auto\",\n }),\n]);\n\n<Waterfall items={items} renderItem={(item) => <Card data={item} />} />;",
|
|
31
|
+
"features": [
|
|
32
|
+
"大小写不敏感",
|
|
33
|
+
"多字段 OR 匹配",
|
|
34
|
+
"空关键词直接放行(不触发过滤)"
|
|
35
|
+
],
|
|
36
|
+
"useCases": [
|
|
37
|
+
"站内搜索结果页",
|
|
38
|
+
"后台列表即时搜索",
|
|
39
|
+
"商品名 / 店铺名联合搜索"
|
|
40
|
+
],
|
|
41
|
+
"notes": [
|
|
42
|
+
"纯前端 `includes`,不排序也不做拼音;要相关性排序请在 Search 之后接 SortPlugin。"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
;
|
|
46
|
+
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createSearchPlugin as create, SearchConfig } from './create';
|
|
2
|
+
import { PluginDoc } from 'vane-plugin-core';
|
|
3
|
+
/**
|
|
4
|
+
* 工厂 + `.meta`:`typeof create` 保留原工厂的泛型签名,
|
|
5
|
+
* `.meta` 供 docs:plugins 与 demo 工坊读取配置项。
|
|
6
|
+
*/
|
|
7
|
+
export declare const createSearchPlugin: typeof create & {
|
|
8
|
+
meta: PluginDoc;
|
|
9
|
+
};
|
|
10
|
+
export type { SearchConfig };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|