@tarojs/components-react 4.1.12-beta.17 → 4.1.12-beta.19

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 (35) hide show
  1. package/dist/components/map/MapContext.js +342 -0
  2. package/dist/components/map/MapContext.js.map +1 -0
  3. package/dist/components/map/MapCustomCallout.js +91 -0
  4. package/dist/components/map/MapCustomCallout.js.map +1 -0
  5. package/dist/components/map/common.js +4 -0
  6. package/dist/components/map/common.js.map +1 -0
  7. package/dist/components/map/createMapContext.js +34 -0
  8. package/dist/components/map/createMapContext.js.map +1 -0
  9. package/dist/components/map/handler.js +50 -0
  10. package/dist/components/map/handler.js.map +1 -0
  11. package/dist/components/map/index.js +316 -0
  12. package/dist/components/map/index.js.map +1 -0
  13. package/dist/components/scroll-view/index.js +10 -9
  14. package/dist/components/scroll-view/index.js.map +1 -1
  15. package/dist/index.js +3 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/original/components/map/MapContext.js +342 -0
  18. package/dist/original/components/map/MapContext.js.map +1 -0
  19. package/dist/original/components/map/MapCustomCallout.js +91 -0
  20. package/dist/original/components/map/MapCustomCallout.js.map +1 -0
  21. package/dist/original/components/map/common.js +4 -0
  22. package/dist/original/components/map/common.js.map +1 -0
  23. package/dist/original/components/map/createMapContext.js +34 -0
  24. package/dist/original/components/map/createMapContext.js.map +1 -0
  25. package/dist/original/components/map/handler.js +50 -0
  26. package/dist/original/components/map/handler.js.map +1 -0
  27. package/dist/original/components/map/index.js +316 -0
  28. package/dist/original/components/map/index.js.map +1 -0
  29. package/dist/original/components/scroll-view/index.js +10 -9
  30. package/dist/original/components/scroll-view/index.js.map +1 -1
  31. package/dist/original/index.js +3 -1
  32. package/dist/original/index.js.map +1 -1
  33. package/dist/solid/components/scroll-view/index.js +10 -9
  34. package/dist/solid/components/scroll-view/index.js.map +1 -1
  35. package/package.json +8 -6
@@ -0,0 +1,316 @@
1
+ import React__default, { useState, useEffect, Children } from 'react';
2
+ import { TMap, MultiMarker, MultiPolyline } from 'tlbs-map-react';
3
+ import { createForwardRefComponent } from '../../utils/index.js';
4
+ import { logPrefix } from './common.js';
5
+ import { registerMapInstance, unregisterMapInstance } from './MapContext.js';
6
+ import MapCustomCallout from './MapCustomCallout.js';
7
+ import { jsxs, jsx } from 'react/jsx-runtime';
8
+ export { createMapContext } from './createMapContext.js';
9
+
10
+ /* eslint-disable no-console */
11
+ function Map(props) {
12
+ const {
13
+ forwardedRef,
14
+ id,
15
+ className,
16
+ style,
17
+ authKey,
18
+ longitude,
19
+ latitude,
20
+ scale,
21
+ minScale,
22
+ maxScale,
23
+ enableRotate,
24
+ markers,
25
+ polyline,
26
+ onTap,
27
+ onAuthSuccess,
28
+ onError
29
+ } = props;
30
+ // eslint-disable-next-line no-console
31
+ console.log(logPrefix, 'props', props);
32
+ /** ************************处理 style********************** */
33
+ const styleObj = typeof style === 'string' || style === undefined ? {} : style;
34
+ /** ************************处理 marker********************** */
35
+ const normalizedMarkers = markers !== null && markers !== void 0 ? markers : [];
36
+ const markerStyles = {};
37
+ const markerGeometries = [];
38
+ normalizedMarkers.forEach((m, index) => {
39
+ var _a;
40
+ const markerId = String((_a = m.id) !== null && _a !== void 0 ? _a : index);
41
+ const styleId = `marker-${markerId}`;
42
+ // Taro: iconPath (string);tlbs-map-react: styles 中指定图标
43
+ // Taro: width, height (number|string);tlbs-map-react: width, height
44
+ // Taro: rotate (number);tlbs-map-react: rotation
45
+ // Taro: alpha (number 0-1);tlbs-map-react: opacity (0-1)
46
+ // Taro: zIndex (number);tlbs-map-react: zIndex
47
+ // 解析宽高,支持数字和字符串(如 '20px')
48
+ const parseSize = size => {
49
+ if (typeof size === 'number') return size;
50
+ if (typeof size === 'string') {
51
+ const parsed = parseInt(size, 10);
52
+ return isNaN(parsed) ? 20 : parsed;
53
+ }
54
+ return 20; // 默认宽度
55
+ };
56
+ const markerWidth = parseSize(m.width);
57
+ const markerHeight = parseSize(m.height);
58
+ markerStyles[styleId] = Object.assign(Object.assign(Object.assign(Object.assign({
59
+ width: markerWidth,
60
+ height: markerHeight,
61
+ anchor: {
62
+ x: markerWidth / 2,
63
+ y: markerHeight
64
+ }
65
+ }, m.iconPath && {
66
+ src: m.iconPath
67
+ }), typeof m.rotate === 'number' && {
68
+ rotation: m.rotate
69
+ }), typeof m.alpha === 'number' && {
70
+ opacity: m.alpha
71
+ }), typeof m.zIndex === 'number' && {
72
+ zIndex: m.zIndex
73
+ });
74
+ markerGeometries.push({
75
+ id: markerId,
76
+ styleId,
77
+ position: {
78
+ lat: m.latitude,
79
+ lng: m.longitude
80
+ }
81
+ });
82
+ });
83
+ /** ************************处理 polyline********************** */
84
+ const normalizedPolylines = polyline !== null && polyline !== void 0 ? polyline : [];
85
+ const polylineStyles = {};
86
+ const polylineGeometries = [];
87
+ normalizedPolylines.forEach((line, lineIndex) => {
88
+ var _a;
89
+ if (!line.points || line.points.length === 0) return;
90
+ const styleId = `polyline-${lineIndex}`;
91
+ // Taro: color (hex);腾讯地图: color
92
+ // Taro: width (number);腾讯地图: width
93
+ // Taro: dottedLine (boolean);腾讯地图: dashArray ([10,10]虚线, [0,0]实线)
94
+ polylineStyles[styleId] = {
95
+ color: line.color || '#3777FF',
96
+ width: (_a = line.width) !== null && _a !== void 0 ? _a : 3,
97
+ // 虚线:[10, 10] 表示10像素实线 + 10像素空白;实线:[0, 0]
98
+ dashArray: line.dottedLine ? [10, 10] : [0, 0]
99
+ };
100
+ // Taro: points 是 {latitude, longitude}[] 数组
101
+ // tlbs-map-react: geometries 需要路径点数组
102
+ polylineGeometries.push({
103
+ id: String(lineIndex),
104
+ styleId,
105
+ paths: line.points.map(point => ({
106
+ lat: point.latitude,
107
+ lng: point.longitude
108
+ }))
109
+ });
110
+ });
111
+ /** ************************适配options参数********************** */
112
+ const hasCenter = typeof latitude === 'number' && typeof longitude === 'number';
113
+ const mergedOptions = Object.assign(Object.assign({}, hasCenter ? {
114
+ center: {
115
+ lat: latitude,
116
+ lng: longitude
117
+ }
118
+ } : {}), {
119
+ zoom: scale !== null && scale !== void 0 ? scale : 13,
120
+ minZoom: minScale !== null && minScale !== void 0 ? minScale : 3,
121
+ maxZoom: maxScale !== null && maxScale !== void 0 ? maxScale : 20,
122
+ rotatable: enableRotate !== null && enableRotate !== void 0 ? enableRotate : false
123
+ });
124
+ /** ************************处理事件********************** */
125
+ // Taro: onTap;腾讯地图: click
126
+ // 腾讯地图事件返回: MapEvent { latLng: LatLng, point: {x, y}, type, target, originalEvent }
127
+ // Taro 事件格式: BaseEventOrig { type, timeStamp, target, currentTarget, detail, ... }
128
+ const handleMapClick = e => {
129
+ console.log(logPrefix, 'source click e:', e);
130
+ if (typeof onTap === 'function') {
131
+ onTap({
132
+ type: e.type,
133
+ timeStamp: Date.now(),
134
+ target: {
135
+ id: id || '',
136
+ tagName: 'map',
137
+ dataset: {}
138
+ },
139
+ currentTarget: {
140
+ id: id || '',
141
+ tagName: 'map',
142
+ dataset: {}
143
+ },
144
+ detail: {
145
+ latitude: e.latLng.lat,
146
+ longitude: e.latLng.lng
147
+ },
148
+ preventDefault: () => {},
149
+ stopPropagation: () => {}
150
+ });
151
+ }
152
+ };
153
+ // 存储地图实例,用于 H5 端自定义气泡
154
+ const [mapInstance, setMapInstance] = useState(null);
155
+ // 地图初始化成功
156
+ const handleMapInited = instance => {
157
+ console.log(logPrefix, '地图初始化成功', instance);
158
+ setMapInstance(instance);
159
+ // 注册地图实例到全局存储
160
+ if (id) {
161
+ registerMapInstance(id, instance);
162
+ console.log(logPrefix, '已注册地图实例到 MapContext, id:', id);
163
+ }
164
+ let settled = false;
165
+ instance.on('tilesloaded', _res => {
166
+ // TODO: 临时先这么简单处理鉴权成功
167
+ if (!settled && typeof onAuthSuccess === 'function') {
168
+ settled = true;
169
+ onAuthSuccess({
170
+ type: 'authsuccess',
171
+ timeStamp: Date.now(),
172
+ target: {
173
+ id: id || '',
174
+ tagName: 'map',
175
+ dataset: {}
176
+ },
177
+ currentTarget: {
178
+ id: id || '',
179
+ tagName: 'map',
180
+ dataset: {}
181
+ },
182
+ detail: {
183
+ errCode: 0,
184
+ errMsg: 'ok'
185
+ },
186
+ preventDefault: () => {},
187
+ stopPropagation: () => {}
188
+ });
189
+ }
190
+ });
191
+ setTimeout(() => {
192
+ if (!settled && typeof onError === 'function') {
193
+ settled = true;
194
+ onError({
195
+ type: 'error',
196
+ timeStamp: Date.now(),
197
+ target: {
198
+ id: id || '',
199
+ tagName: 'map',
200
+ dataset: {}
201
+ },
202
+ currentTarget: {
203
+ id: id || '',
204
+ tagName: 'map',
205
+ dataset: {}
206
+ },
207
+ detail: {
208
+ errCode: 1001,
209
+ errMsg: 'timeout'
210
+ },
211
+ preventDefault: () => {},
212
+ stopPropagation: () => {}
213
+ });
214
+ }
215
+ }, 3000);
216
+ };
217
+ // 组件卸载时清理地图实例
218
+ useEffect(() => {
219
+ return () => {
220
+ if (id) {
221
+ unregisterMapInstance(id);
222
+ console.log(logPrefix, '已注销地图实例, id:', id);
223
+ }
224
+ };
225
+ }, [id]);
226
+ return /*#__PURE__*/jsxs(TMap, {
227
+ id: id,
228
+ ref: forwardedRef,
229
+ className: className,
230
+ style: styleObj,
231
+ apiKey: authKey !== null && authKey !== void 0 ? authKey : '',
232
+ options: mergedOptions,
233
+ onClick: handleMapClick,
234
+ onMapInited: handleMapInited,
235
+ children: [normalizedMarkers.length > 0 ? /*#__PURE__*/jsx(MultiMarker, {
236
+ id: "taro-markers",
237
+ styles: markerStyles,
238
+ geometries: markerGeometries
239
+ }) : null, polylineGeometries.length > 0 ? /*#__PURE__*/jsx(MultiPolyline, {
240
+ id: "taro-polylines",
241
+ styles: polylineStyles,
242
+ geometries: polylineGeometries
243
+ }) : null, process.env.TARO_ENV === 'h5' ? renderH5CustomCallouts() : props.children]
244
+ });
245
+ /**
246
+ * H5 端渲染自定义气泡
247
+ * 拦截 slot="callout" 的 CoverView,转换为自定义 Overlay
248
+ */
249
+ function renderH5CustomCallouts() {
250
+ if (!mapInstance) return null;
251
+ // 1. 遍历 props.children,找到 slot="callout" 的 CoverView
252
+ const childrenArray = Children.toArray(props.children);
253
+ const calloutSlot = childrenArray.find(child => {
254
+ var _a;
255
+ return /*#__PURE__*/React__default.isValidElement(child) && ((_a = child.props) === null || _a === void 0 ? void 0 : _a.slot) === 'callout';
256
+ });
257
+ if (!calloutSlot || ! /*#__PURE__*/React__default.isValidElement(calloutSlot)) {
258
+ return null;
259
+ }
260
+ // 2. 遍历内层的 CoverView,提取 markerId 和内容
261
+ const innerCoverViews = Children.toArray(calloutSlot.props.children);
262
+ return innerCoverViews.map(child => {
263
+ var _a, _b, _c, _d, _e, _f, _g;
264
+ if (! /*#__PURE__*/React__default.isValidElement(child)) return null;
265
+ const markerId = (_a = child.props) === null || _a === void 0 ? void 0 : _a.markerId;
266
+ if (!markerId) return null;
267
+ // 3. 找到对应的 marker 信息
268
+ const marker = normalizedMarkers.find(m => m.id === markerId);
269
+ if (!marker) {
270
+ console.warn(logPrefix, `未找到 markerId=${markerId} 对应的 marker`);
271
+ return null;
272
+ }
273
+ // 4. 渲染自定义气泡
274
+ return /*#__PURE__*/jsx(MapCustomCallout, {
275
+ map: mapInstance,
276
+ markerId: markerId,
277
+ position: {
278
+ lat: marker.latitude,
279
+ lng: marker.longitude
280
+ },
281
+ anchorX: (_c = (_b = marker.customCallout) === null || _b === void 0 ? void 0 : _b.anchorX) !== null && _c !== void 0 ? _c : 0,
282
+ anchorY: (_e = (_d = marker.customCallout) === null || _d === void 0 ? void 0 : _d.anchorY) !== null && _e !== void 0 ? _e : 0,
283
+ display: (_g = (_f = marker.customCallout) === null || _f === void 0 ? void 0 : _f.display) !== null && _g !== void 0 ? _g : 'ALWAYS',
284
+ onCalloutTap: id => {
285
+ // 触发 onCalloutTap 事件
286
+ if (typeof props.onCalloutTap === 'function') {
287
+ props.onCalloutTap({
288
+ type: 'callouttap',
289
+ timeStamp: Date.now(),
290
+ target: {
291
+ id: id || '',
292
+ tagName: 'callout',
293
+ dataset: {}
294
+ },
295
+ currentTarget: {
296
+ id: id || '',
297
+ tagName: 'callout',
298
+ dataset: {}
299
+ },
300
+ detail: {
301
+ markerId: id
302
+ },
303
+ preventDefault: () => {},
304
+ stopPropagation: () => {}
305
+ });
306
+ }
307
+ },
308
+ children: child.props.children
309
+ }, markerId);
310
+ });
311
+ }
312
+ }
313
+ var index = createForwardRefComponent(Map);
314
+
315
+ export { index as default };
316
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/map/index.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport React, { Children, useEffect, useState } from 'react'\nimport { MultiMarker, MultiPolyline, TMap } from 'tlbs-map-react'\n\nimport { createForwardRefComponent } from '../../utils'\nimport { logPrefix } from './common'\nimport { registerMapInstance, unregisterMapInstance } from './MapContext'\nimport MapCustomCallout from './MapCustomCallout'\n\nimport type { MapProps as TaroMapProps } from '@tarojs/components'\nimport type MapTypes from 'tmap-gl-types'\n\nexport interface MapProps extends Omit<TaroMapProps, 'onError'> {\n forwardedRef?: React.MutableRefObject<any>\n authKey?: string\n onError?: (e: any) => void\n}\n\nfunction Map (props: MapProps) {\n const {\n forwardedRef,\n id,\n className,\n style,\n authKey,\n longitude,\n latitude,\n scale,\n minScale,\n maxScale,\n enableRotate,\n markers,\n polyline,\n onTap,\n onAuthSuccess,\n onError,\n } = props\n // eslint-disable-next-line no-console\n console.log(logPrefix, 'props', props)\n\n /** ************************处理 style********************** */\n const styleObj = typeof style === 'string' || style === undefined ? {} : (style as Record<string, string>)\n\n /** ************************处理 marker********************** */\n const normalizedMarkers = markers ?? []\n const markerStyles: Record<string, any> = {}\n const markerGeometries: any[] = []\n\n normalizedMarkers.forEach((m, index) => {\n const markerId = String(m.id ?? index)\n const styleId = `marker-${markerId}`\n\n // Taro: iconPath (string);tlbs-map-react: styles 中指定图标\n // Taro: width, height (number|string);tlbs-map-react: width, height\n // Taro: rotate (number);tlbs-map-react: rotation\n // Taro: alpha (number 0-1);tlbs-map-react: opacity (0-1)\n // Taro: zIndex (number);tlbs-map-react: zIndex\n\n // 解析宽高,支持数字和字符串(如 '20px')\n const parseSize = (size: number | string | undefined): number => {\n if (typeof size === 'number') return size\n if (typeof size === 'string') {\n const parsed = parseInt(size, 10)\n return isNaN(parsed) ? 20 : parsed\n }\n return 20 // 默认宽度\n }\n\n const markerWidth = parseSize(m.width)\n const markerHeight = parseSize(m.height)\n\n markerStyles[styleId] = {\n width: markerWidth,\n height: markerHeight,\n anchor: { x: markerWidth / 2, y: markerHeight }, // 默认底部中心为锚点\n ...(m.iconPath && { src: m.iconPath }),\n ...(typeof m.rotate === 'number' && { rotation: m.rotate }),\n ...(typeof m.alpha === 'number' && { opacity: m.alpha }),\n ...(typeof m.zIndex === 'number' && { zIndex: m.zIndex }),\n }\n\n markerGeometries.push({\n id: markerId,\n styleId,\n position: { lat: m.latitude, lng: m.longitude },\n })\n })\n\n /** ************************处理 polyline********************** */\n const normalizedPolylines = polyline ?? []\n const polylineStyles: Record<string, any> = {}\n const polylineGeometries: any[] = []\n\n normalizedPolylines.forEach((line, lineIndex) => {\n if (!line.points || line.points.length === 0) return\n\n const styleId = `polyline-${lineIndex}`\n\n // Taro: color (hex);腾讯地图: color\n // Taro: width (number);腾讯地图: width\n // Taro: dottedLine (boolean);腾讯地图: dashArray ([10,10]虚线, [0,0]实线)\n polylineStyles[styleId] = {\n color: line.color || '#3777FF',\n width: line.width ?? 3,\n // 虚线:[10, 10] 表示10像素实线 + 10像素空白;实线:[0, 0]\n dashArray: line.dottedLine ? [10, 10] : [0, 0],\n }\n\n // Taro: points 是 {latitude, longitude}[] 数组\n // tlbs-map-react: geometries 需要路径点数组\n polylineGeometries.push({\n id: String(lineIndex),\n styleId,\n paths: line.points.map((point) => ({\n lat: point.latitude,\n lng: point.longitude,\n })),\n })\n })\n\n /** ************************适配options参数********************** */\n const hasCenter = typeof latitude === 'number' && typeof longitude === 'number'\n const mergedOptions = {\n ...(hasCenter ? { center: { lat: latitude, lng: longitude } } : {}),\n zoom: scale ?? 13,\n minZoom: minScale ?? 3,\n maxZoom: maxScale ?? 20,\n rotatable: enableRotate ?? false, // Taro: enableRotate;tlbs-map-react: options.rotatable\n }\n\n /** ************************处理事件********************** */\n // Taro: onTap;腾讯地图: click\n // 腾讯地图事件返回: MapEvent { latLng: LatLng, point: {x, y}, type, target, originalEvent }\n // Taro 事件格式: BaseEventOrig { type, timeStamp, target, currentTarget, detail, ... }\n const handleMapClick = (e: MapTypes.MapEvent) => {\n console.log(logPrefix, 'source click e:', e)\n if (typeof onTap === 'function') {\n onTap({\n type: e.type,\n timeStamp: Date.now(),\n target: {\n id: id || '',\n tagName: 'map',\n dataset: {},\n },\n currentTarget: {\n id: id || '',\n tagName: 'map',\n dataset: {},\n },\n detail: {\n latitude: e.latLng.lat,\n longitude: e.latLng.lng,\n },\n preventDefault: () => {},\n stopPropagation: () => {},\n })\n }\n }\n\n // 存储地图实例,用于 H5 端自定义气泡\n const [mapInstance, setMapInstance] = useState<MapTypes.Map | null>(null)\n\n // 地图初始化成功\n const handleMapInited = (instance: MapTypes.Map) => {\n console.log(logPrefix, '地图初始化成功', instance)\n setMapInstance(instance)\n\n // 注册地图实例到全局存储\n if (id) {\n registerMapInstance(id, instance)\n console.log(logPrefix, '已注册地图实例到 MapContext, id:', id)\n }\n\n let settled = false\n instance.on('tilesloaded', (_res) => { /** 瓦片加载完成,地图真正可用 */\n // TODO: 临时先这么简单处理鉴权成功\n if (!settled && typeof onAuthSuccess === 'function') {\n settled = true\n onAuthSuccess({\n type: 'authsuccess',\n timeStamp: Date.now(),\n target: {\n id: id || '',\n tagName: 'map',\n dataset: {},\n },\n currentTarget: {\n id: id || '',\n tagName: 'map',\n dataset: {},\n },\n detail: {\n errCode: 0,\n errMsg: 'ok',\n },\n preventDefault: () => {},\n stopPropagation: () => {},\n })\n }\n })\n setTimeout(() => {\n if (!settled && typeof onError === 'function') {\n settled = true\n onError({\n type: 'error',\n timeStamp: Date.now(),\n target: {\n id: id || '',\n tagName: 'map',\n dataset: {},\n },\n currentTarget: {\n id: id || '',\n tagName: 'map',\n dataset: {},\n },\n detail: {\n errCode: 1001,\n errMsg: 'timeout',\n },\n preventDefault: () => {},\n stopPropagation: () => {},\n })\n }\n }, 3000)\n }\n\n // 组件卸载时清理地图实例\n useEffect(() => {\n return () => {\n if (id) {\n unregisterMapInstance(id)\n console.log(logPrefix, '已注销地图实例, id:', id)\n }\n }\n }, [id])\n\n return (\n <TMap\n id={id}\n ref={forwardedRef}\n className={className}\n style={styleObj}\n apiKey={authKey ?? ''}\n options={mergedOptions}\n onClick={handleMapClick}\n onMapInited={handleMapInited}\n >\n {normalizedMarkers.length > 0 ? (\n <MultiMarker id=\"taro-markers\" styles={markerStyles} geometries={markerGeometries} />\n ) : null}\n {polylineGeometries.length > 0 ? (\n <MultiPolyline id=\"taro-polylines\" styles={polylineStyles} geometries={polylineGeometries} />\n ) : null}\n\n {/* H5 端:自动处理 slot=\"callout\" 的 CoverView */}\n {process.env.TARO_ENV === 'h5' ? renderH5CustomCallouts() : props.children}\n </TMap>\n )\n\n /**\n * H5 端渲染自定义气泡\n * 拦截 slot=\"callout\" 的 CoverView,转换为自定义 Overlay\n */\n function renderH5CustomCallouts() {\n if (!mapInstance) return null\n\n // 1. 遍历 props.children,找到 slot=\"callout\" 的 CoverView\n const childrenArray = Children.toArray(props.children)\n const calloutSlot = childrenArray.find((child: any) =>\n React.isValidElement(child) && child.props?.slot === 'callout'\n )\n\n if (!calloutSlot || !React.isValidElement(calloutSlot)) {\n return null\n }\n\n // 2. 遍历内层的 CoverView,提取 markerId 和内容\n const innerCoverViews = Children.toArray(calloutSlot.props.children)\n\n return innerCoverViews.map((child: any) => {\n if (!React.isValidElement(child)) return null\n\n const markerId = child.props?.markerId\n if (!markerId) return null\n\n // 3. 找到对应的 marker 信息\n const marker = normalizedMarkers.find((m: any) => m.id === markerId)\n if (!marker) {\n console.warn(logPrefix, `未找到 markerId=${markerId} 对应的 marker`)\n return null\n }\n\n // 4. 渲染自定义气泡\n return (\n <MapCustomCallout\n key={markerId}\n map={mapInstance}\n markerId={markerId}\n position={{ lat: marker.latitude, lng: marker.longitude }}\n anchorX={marker.customCallout?.anchorX ?? 0}\n anchorY={marker.customCallout?.anchorY ?? 0}\n display={marker.customCallout?.display ?? 'ALWAYS'}\n onCalloutTap={(id) => {\n // 触发 onCalloutTap 事件\n if (typeof props.onCalloutTap === 'function') {\n props.onCalloutTap({\n type: 'callouttap',\n timeStamp: Date.now(),\n target: {\n id: id || '',\n tagName: 'callout',\n dataset: {},\n },\n currentTarget: {\n id: id || '',\n tagName: 'callout',\n dataset: {},\n },\n detail: { markerId: id },\n preventDefault: () => {},\n stopPropagation: () => {},\n })\n }\n }}\n >\n {child.props.children}\n </MapCustomCallout>\n )\n })\n }\n}\n\nexport default createForwardRefComponent(Map)\n\n/**\n * @deprecated 请使用 Taro.createMapContext 代替\n *\n * 此导出仅用于向后兼容,将在未来版本中移除。\n *\n * 推荐用法:\n * ```tsx\n * import Taro from '@tarojs/taro'\n *\n * const mapCtx = Taro.createMapContext('mapId')\n * ```\n */\nexport { createMapContext } from './createMapContext'\n"],"names":["Map","props","forwardedRef","id","className","style","authKey","longitude","latitude","scale","minScale","maxScale","enableRotate","markers","polyline","onTap","onAuthSuccess","onError","console","log","logPrefix","styleObj","undefined","normalizedMarkers","markerStyles","markerGeometries","forEach","m","index","markerId","String","_a","styleId","parseSize","size","parsed","parseInt","isNaN","markerWidth","width","markerHeight","height","anchor","x","y","iconPath","src","rotate","rotation","alpha","opacity","zIndex","push","position","lat","lng","normalizedPolylines","polylineStyles","polylineGeometries","line","lineIndex","points","length","color","dashArray","dottedLine","paths","map","point","hasCenter","mergedOptions","Object","assign","center","zoom","minZoom","maxZoom","rotatable","handleMapClick","e","type","timeStamp","Date","now","target","tagName","dataset","currentTarget","detail","latLng","preventDefault","stopPropagation","mapInstance","setMapInstance","useState","handleMapInited","instance","registerMapInstance","settled","on","_res","errCode","errMsg","setTimeout","useEffect","unregisterMapInstance","_jsxs","TMap","ref","apiKey","options","onClick","onMapInited","children","_jsx","MultiMarker","styles","geometries","MultiPolyline","process","env","TARO_ENV","renderH5CustomCallouts","childrenArray","Children","toArray","calloutSlot","find","child","React","isValidElement","slot","innerCoverViews","marker","warn","MapCustomCallout","anchorX","_c","_b","customCallout","anchorY","_e","_d","display","_g","_f","onCalloutTap","createForwardRefComponent"],"mappings":";;;;;;;;;AAAA;AAkBA,SAASA,GAAGA,CAAEC,KAAe,EAAA;EAC3B,MAAM;IACJC,YAAY;IACZC,EAAE;IACFC,SAAS;IACTC,KAAK;IACLC,OAAO;IACPC,SAAS;IACTC,QAAQ;IACRC,KAAK;IACLC,QAAQ;IACRC,QAAQ;IACRC,YAAY;IACZC,OAAO;IACPC,QAAQ;IACRC,KAAK;IACLC,aAAa;AACbC,IAAAA;AACD,GAAA,GAAGhB,KAAK;AACT;EACAiB,OAAO,CAACC,GAAG,CAACC,SAAS,EAAE,OAAO,EAAEnB,KAAK,CAAC;AAEtC;AACA,EAAA,MAAMoB,QAAQ,GAAG,OAAOhB,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAKiB,SAAS,GAAG,EAAE,GAAIjB,KAAgC;AAE1G;AACA,EAAA,MAAMkB,iBAAiB,GAAGV,OAAO,KAAA,IAAA,IAAPA,OAAO,KAAP,KAAA,CAAA,GAAAA,OAAO,GAAI,EAAE;EACvC,MAAMW,YAAY,GAAwB,EAAE;EAC5C,MAAMC,gBAAgB,GAAU,EAAE;AAElCF,EAAAA,iBAAiB,CAACG,OAAO,CAAC,CAACC,CAAC,EAAEC,KAAK,KAAI;;IACrC,MAAMC,QAAQ,GAAGC,MAAM,CAAC,CAAAC,EAAA,GAAAJ,CAAC,CAACxB,EAAE,MAAA,IAAA,IAAA4B,EAAA,KAAA,KAAA,CAAA,GAAAA,EAAA,GAAIH,KAAK,CAAC;AACtC,IAAA,MAAMI,OAAO,GAAG,CAAUH,OAAAA,EA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AA,EAEDe,KAAK,CAAC/H,KAAK,CAACgH;AAAQ,OAAA,EA9BhBpF,QA+BW,CAAC;AAEvB,KAAC,CAAC;AACJ;AACF;AAEA,YAAesH,yBAAyB,CAACnJ,GAAG,CAAC;;;;"}
@@ -31,16 +31,18 @@ function easeOutScroll() {
31
31
  }
32
32
  step();
33
33
  }
34
+ /** 未开启的滚动轴使用 nearest 避免原生 scrollIntoView 沿该轴滚动整页 */
34
35
  function scrollIntoView() {
35
36
  let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
36
- let isHorizontal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
37
- let animated = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
38
- let scrollIntoViewAlignment = arguments.length > 3 ? arguments[3] : undefined;
37
+ let animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
38
+ let scrollX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
39
+ let scrollY = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
40
+ let scrollIntoViewAlignment = arguments.length > 4 ? arguments[4] : undefined;
39
41
  var _a;
40
42
  (_a = document.querySelector(`#${id}`)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
41
43
  behavior: animated ? 'smooth' : 'auto',
42
- block: !isHorizontal ? scrollIntoViewAlignment || 'center' : 'center',
43
- inline: isHorizontal ? scrollIntoViewAlignment || 'start' : 'start'
44
+ block: scrollY ? scrollIntoViewAlignment || 'center' : 'nearest',
45
+ inline: scrollX ? scrollIntoViewAlignment || 'start' : 'nearest'
44
46
  });
45
47
  }
46
48
  function scrollVertical(container, scrollTop, top, isAnimation) {
@@ -79,11 +81,10 @@ function ScrollView(props) {
79
81
  let isInit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
80
82
  // scrollIntoView
81
83
  if (props.scrollIntoView && typeof props.scrollIntoView === 'string' && document && document.querySelector && document.querySelector(`#${props.scrollIntoView}`)) {
82
- const isHorizontal = props.scrollX && !props.scrollY;
83
84
  if (isInit) {
84
- setTimeout(() => scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, isHorizontal, props.scrollIntoViewAlignment), 500);
85
+ setTimeout(() => scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, !!props.scrollX, !!props.scrollY, props.scrollIntoViewAlignment), 500);
85
86
  } else {
86
- scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, isHorizontal, props.scrollIntoViewAlignment);
87
+ scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, !!props.scrollX, !!props.scrollY, props.scrollIntoViewAlignment);
87
88
  }
88
89
  } else {
89
90
  const isAnimation = !!props.scrollWithAnimation;
@@ -106,7 +107,7 @@ function ScrollView(props) {
106
107
  if (isInitializedRef.current && container.current) {
107
108
  handleScroll(props, false);
108
109
  }
109
- }, [props.scrollTop, props.scrollLeft, props.scrollIntoView]);
110
+ }, [props.scrollTop, props.scrollLeft, props.scrollIntoView, props.scrollIntoViewAlignment, props.scrollWithAnimation, props.scrollX, props.scrollY]);
110
111
  const {
111
112
  className,
112
113
  style = {},
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/scroll-view/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport { isFunction } from '@tarojs/shared'\nimport classNames from 'classnames'\n\nimport { ScrollElementContext } from '../../contexts/ScrollElementContext'\nimport { createForwardRefComponent, throttle } from '../../utils'\nimport { useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\nfunction easeOutScroll (from = 0, to = 0, callback) {\n if (from === to || typeof from !== 'number') {\n return\n }\n const change = to - from\n const dur = 500\n const sTime = +new Date()\n function linear (t, b, c, d) {\n return (c * t) / d + b\n }\n const isLarger = to >= from\n\n function step () {\n from = linear(+new Date() - sTime, from, change, dur)\n if ((isLarger && from >= to) || (!isLarger && to >= from)) {\n callback(to)\n return\n }\n callback(from)\n requestAnimationFrame(step)\n }\n step()\n}\n\nfunction scrollIntoView (id = '', isHorizontal = false, animated = true, scrollIntoViewAlignment?: ScrollLogicalPosition) {\n document.querySelector(`#${id}`)?.scrollIntoView({\n behavior: animated ? 'smooth' : 'auto',\n block: !isHorizontal ? (scrollIntoViewAlignment || 'center') : 'center',\n inline: isHorizontal ? (scrollIntoViewAlignment || 'start') : 'start'\n })\n}\n\nfunction scrollVertical (container, scrollTop, top, isAnimation) {\n if (isAnimation) {\n easeOutScroll(scrollTop.current, top, pos => {\n if (container.current) container.current.scrollTop = pos\n })\n } else {\n if (container.current) container.current.scrollTop = top\n }\n scrollTop.current = top\n}\n\nfunction scrollHorizontal (container, scrollLeft, left, isAnimation) {\n if (isAnimation) {\n easeOutScroll(scrollLeft.current, left, pos => {\n if (container.current) container.current.scrollLeft = pos\n })\n } else {\n if (container.current) container.current.scrollLeft = left\n }\n scrollLeft.current = left\n}\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n scrollX: boolean\n scrollY: boolean\n upperThreshold: number\n lowerThreshold: number\n scrollTop: number\n scrollLeft: number\n scrollIntoView?: string\n scrollIntoViewAlignment?: ScrollLogicalPosition\n scrollWithAnimation: boolean\n enableBackToTop?: boolean\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n onScrollToUpper: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollToLower: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScroll: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollStart?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollEnd?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchMove: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchStart?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchEnd?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n showScrollbar?: boolean // 新增参数,默认true\n enhanced?: boolean // 新增参数,默认false\n /** 嵌套滚动:内容在滚动容器中的起始偏移(固定头部等场景) */\n startOffset?: number\n}\n\nfunction ScrollView (props: IProps) {\n const _scrollTop = useRef<any>(null)\n const _scrollLeft = useRef<any>(null)\n const container = useRef<any>(null)\n const scrollEndTimerRef = useRef<NodeJS.Timeout | null>(null)\n const isScrollingRef = useRef<boolean>(false)\n const isInitializedRef = useRef<boolean>(false)\n const [containerHeight, setContainerHeight] = useState(0)\n const onTouchMove = (e) => {\n e.stopPropagation()\n }\n\n const handleScroll = (props: IProps, isInit = false) => {\n // scrollIntoView\n if (\n props.scrollIntoView &&\n typeof props.scrollIntoView === 'string' &&\n document &&\n document.querySelector &&\n document.querySelector(`#${props.scrollIntoView}`)\n ) {\n const isHorizontal = props.scrollX && !props.scrollY\n if (isInit) {\n setTimeout(() => scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, isHorizontal, props.scrollIntoViewAlignment), 500)\n } else {\n scrollIntoView(props.scrollIntoView, props.scrollWithAnimation, isHorizontal, props.scrollIntoViewAlignment)\n }\n } else {\n const isAnimation = !!props.scrollWithAnimation\n // Y 轴滚动\n if (props.scrollY && typeof props.scrollTop === 'number' && props.scrollTop !== _scrollTop.current) {\n setTimeout(() => scrollVertical(container, _scrollTop, props.scrollTop, isAnimation), 10)\n }\n // X 轴滚动\n if (props.scrollX && typeof props.scrollLeft === 'number' && props.scrollLeft !== _scrollLeft.current) {\n setTimeout(() => scrollHorizontal(container, _scrollLeft, props.scrollLeft, isAnimation), 10)\n }\n }\n }\n\n useEffect(() => {\n handleScroll(props, true)\n isInitializedRef.current = true\n }, [])\n\n // 监听 scrollTop、scrollLeft、scrollIntoView 的变化(排除初始化)\n useEffect(() => {\n if (isInitializedRef.current && container.current) {\n handleScroll(props, false)\n }\n }, [props.scrollTop, props.scrollLeft, props.scrollIntoView])\n\n const {\n className,\n style = {},\n onScroll,\n onScrollToUpper,\n onScrollToLower,\n scrollX,\n scrollY,\n showScrollbar = true, // 默认显示滚动条\n enhanced = false // 默认不增强\n } = props\n let { upperThreshold = 50, lowerThreshold = 50 } = props\n const cls = classNames(\n 'taro-scroll',\n {\n 'taro-scroll-view__scroll-x': scrollX,\n 'taro-scroll-view__scroll-y': scrollY,\n 'taro-scroll--hidebar': enhanced === true && showScrollbar === false,\n 'taro-scroll--enhanced': enhanced === true\n },\n className\n )\n upperThreshold = Number(upperThreshold)\n lowerThreshold = Number(lowerThreshold)\n const upperAndLower = e => {\n if (!container.current) return\n const { offsetWidth, offsetHeight, scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current\n if (\n onScrollToLower &&\n ((props.scrollY && offsetHeight + scrollTop + lowerThreshold >= scrollHeight) ||\n (props.scrollX && offsetWidth + scrollLeft + lowerThreshold >= scrollWidth))\n ) {\n onScrollToLower(e)\n }\n if (\n onScrollToUpper &&\n ((props.scrollY && scrollTop <= upperThreshold) || (props.scrollX && scrollLeft <= upperThreshold))\n ) {\n onScrollToUpper(e)\n }\n }\n const upperAndLowerThrottle = throttle(upperAndLower, 200)\n const _onScroll = e => {\n const { scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current\n _scrollLeft.current = scrollLeft\n _scrollTop.current = scrollTop\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n scrollLeft,\n scrollTop,\n scrollHeight,\n scrollWidth\n }\n })\n\n // 处理滚动开始\n if (!isScrollingRef.current) {\n isScrollingRef.current = true\n if (props.onScrollStart) {\n props.onScrollStart(e)\n }\n }\n\n // 清除滚动结束定时器\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n scrollEndTimerRef.current = null\n }\n\n // 设置滚动结束定时器(150ms 无滚动事件后触发)\n if (props.onScrollEnd) {\n scrollEndTimerRef.current = setTimeout(() => {\n if (isScrollingRef.current) {\n isScrollingRef.current = false\n props.onScrollEnd?.(e)\n }\n scrollEndTimerRef.current = null\n }, 150)\n }\n\n upperAndLowerThrottle(e)\n onScroll && onScroll(e)\n }\n const _onTouchMove = e => {\n isFunction(props.onTouchMove) ? props.onTouchMove(e) : onTouchMove(e)\n }\n const _onTouchStart = e => {\n if (isFunction(props.onTouchStart)) {\n props.onTouchStart(e)\n }\n }\n const _onTouchEnd = e => {\n if (isFunction(props.onTouchEnd)) {\n props.onTouchEnd(e)\n }\n }\n // 清理定时器\n useEffect(() => {\n return () => {\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n scrollEndTimerRef.current = null\n }\n }\n }, [])\n\n // ScrollElementContext:嵌套滚动时向子组件提供 scrollRef、containerHeight、startOffset\n useEffect(() => {\n const el = container.current\n if (!el) return\n const update = () => {\n if (container.current) {\n setContainerHeight(container.current.clientHeight)\n }\n }\n update()\n const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(update) : null\n if (ro) {\n ro.observe(el)\n return () => ro.disconnect()\n }\n }, [])\n\n const scrollElementContextValue = {\n scrollRef: container,\n containerHeight,\n startOffset: props.startOffset ?? 0,\n }\n\n return (\n <ScrollElementContext.Provider value={scrollElementContextValue}>\n <div\n ref={e => {\n if (e) {\n container.current = e\n if (props.forwardedRef) props.forwardedRef.current = e\n }\n }}\n style={style}\n className={cls}\n onScroll={_onScroll}\n onTouchMove={_onTouchMove}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n >\n {props.children}\n </div>\n </ScrollElementContext.Provider>\n )\n}\n\nexport default createForwardRefComponent(ScrollView)\n"],"names":["easeOutScroll","from","arguments","length","undefined","to","callback","change","dur","sTime","Date","linear","t","b","c","d","isLarger","step","requestAnimationFrame","scrollIntoView","id","isHorizontal","animated","scrollIntoViewAlignment","_a","document","querySelector","behavior","block","inline","scrollVertical","container","scrollTop","top","isAnimation","current","pos","scrollHorizontal","scrollLeft","left","ScrollView","props","_scrollTop","useRef","_scrollLeft","scrollEndTimerRef","isScrollingRef","isInitializedRef","containerHeight","setContainerHeight","useState","onTouchMove","e","stopPropagation","handleScroll","isInit","scrollX","scrollY","setTimeout","scrollWithAnimation","useEffect","className","style","onScroll","onScrollToUpper","onScrollToLower","showScrollbar","enhanced","upperThreshold","lowerThreshold","cls","classNames","Number","upperAndLower","offsetWidth","offsetHeight","scrollHeight","scrollWidth","upperAndLowerThrottle","throttle","_onScroll","Object","defineProperty","enumerable","writable","value","onScrollStart","clearTimeout","onScrollEnd","call","_onTouchMove","isFunction","_onTouchStart","onTouchStart","_onTouchEnd","onTouchEnd","el","update","clientHeight","ro","ResizeObserver","observe","disconnect","scrollElementContextValue","scrollRef","startOffset","_jsx","ScrollElementContext","Provider","children","ref","forwardedRef","createForwardRefComponent"],"mappings":";;;;;;;;AAWA,SAASA,aAAaA,GAA4B;AAAA,EAAA,IAA1BC,IAAI,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAAC;AAAA,EAAA,IAAEG,EAAE,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAAC;EAAA,IAAEI,QAAQ,GAAAJ,SAAA,CAAAC,MAAA,GAAAD,CAAAA,GAAAA,SAAA,MAAAE,SAAA;EAChD,IAAIH,IAAI,KAAKI,EAAE,IAAI,OAAOJ,IAAI,KAAK,QAAQ,EAAE;AAC3C,IAAA;AACF;AACA,EAAA,MAAMM,MAAM,GAAGF,EAAE,GAAGJ,IAAI;EACxB,MAAMO,GAAG,GAAG,GAAG;AACf,EAAA,MAAMC,KAAK,GAAG,CAAC,IAAIC,IAAI,EAAE;EACzB,SAASC,MAAMA,CAAEC,CAAC,EAAEC,CAAC,EAAEC,CAAC,EAAEC,CAAC,EAAA;AACzB,IAAA,OAAQD,CAAC,GAAGF,CAAC,GAAIG,CAAC,GAAGF,CAAC;AACxB;AACA,EAAA,MAAMG,QAAQ,GAAGX,EAAE,IAAIJ,IAAI;EAE3B,SAASgB,IAAIA,GAAA;AACXhB,IAAAA,IAAI,GAAGU,MAAM,CA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AAMG,EAAE,CAACG,UAAU,EAAE;AAC9B;GACD,EAAE,EAAE,CAAC;AAEN,EAAA,MAAMC,yBAAyB,GAAG;AAChCC,IAAAA,SAAS,EAAEzE,SAAS;IACpBiB,eAAe;AACfyD,IAAAA,WAAW,EAAE,CAAAjF,EAAA,GAAAiB,KAAK,CAACgE,WAAW,mCAAI;GACnC;AAED,EAAA,oBACEC,GAAA,CAACC,oBAAoB,CAACC,QAAQ,EAAA;AAACvB,IAAAA,KAAK,EAAEkB,yBAA0B;AAAAM,IAAAA,QAAA,eAC9DH,GAAA,CAAA,KAAA,EAAA;MACEI,GAAG,EAAE1D,CAAC,IAAG;AACP,QAAA,IAAIA,CAAC,EAAE;UACLrB,SAAS,CAACI,OAAO,GAAGiB,CAAC;UACrB,IAAIX,KAAK,CAACsE,YAAY,EAAEtE,KAAK,CAACsE,YAAY,CAAC5E,OAAO,GAAGiB,CAAC;AACxD;OACA;AACFU,MAAAA,KAAK,EAAEA,KAAM;AACbD,MAAAA,SAAS,EAAES,GAAI;AACfP,MAAAA,QAAQ,EAAEiB,SAAU;AACpB7B,MAAAA,WAAW,EAAEuC,YAAa;AAC1BG,MAAAA,YAAY,EAAED,aAAc;AAC5BG,MAAAA,UAAU,EAAED,WAAY;MAAAe,QAAA,EAEvBpE,KAAK,CAACoE;KACJ;AACP,GAA+B,CAAC;AAEpC;AAEA,YAAeG,yBAAyB,CAACxE,UAAU,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/scroll-view/index.tsx"],"sourcesContent":["import './style/index.scss'\n\nimport { isFunction } from '@tarojs/shared'\nimport classNames from 'classnames'\n\nimport { ScrollElementContext } from '../../contexts/ScrollElementContext'\nimport { createForwardRefComponent, throttle } from '../../utils'\nimport { useEffect, useRef, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\nfunction easeOutScroll (from = 0, to = 0, callback) {\n if (from === to || typeof from !== 'number') {\n return\n }\n const change = to - from\n const dur = 500\n const sTime = +new Date()\n function linear (t, b, c, d) {\n return (c * t) / d + b\n }\n const isLarger = to >= from\n\n function step () {\n from = linear(+new Date() - sTime, from, change, dur)\n if ((isLarger && from >= to) || (!isLarger && to >= from)) {\n callback(to)\n return\n }\n callback(from)\n requestAnimationFrame(step)\n }\n step()\n}\n\n/** 未开启的滚动轴使用 nearest 避免原生 scrollIntoView 沿该轴滚动整页 */\nfunction scrollIntoView (\n id = '',\n animated = true,\n scrollX = false,\n scrollY = false,\n scrollIntoViewAlignment?: ScrollLogicalPosition\n) {\n document.querySelector(`#${id}`)?.scrollIntoView({\n behavior: animated ? 'smooth' : 'auto',\n block: scrollY ? (scrollIntoViewAlignment || 'center') : 'nearest',\n inline: scrollX ? (scrollIntoViewAlignment || 'start') : 'nearest'\n })\n}\n\nfunction scrollVertical (container, scrollTop, top, isAnimation) {\n if (isAnimation) {\n easeOutScroll(scrollTop.current, top, pos => {\n if (container.current) container.current.scrollTop = pos\n })\n } else {\n if (container.current) container.current.scrollTop = top\n }\n scrollTop.current = top\n}\n\nfunction scrollHorizontal (container, scrollLeft, left, isAnimation) {\n if (isAnimation) {\n easeOutScroll(scrollLeft.current, left, pos => {\n if (container.current) container.current.scrollLeft = pos\n })\n } else {\n if (container.current) container.current.scrollLeft = left\n }\n scrollLeft.current = left\n}\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n scrollX: boolean\n scrollY: boolean\n upperThreshold: number\n lowerThreshold: number\n scrollTop: number\n scrollLeft: number\n scrollIntoView?: string\n scrollIntoViewAlignment?: ScrollLogicalPosition\n scrollWithAnimation: boolean\n enableBackToTop?: boolean\n forwardedRef?: React.MutableRefObject<HTMLDivElement>\n onScrollToUpper: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollToLower: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScroll: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollStart?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onScrollEnd?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchMove: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchStart?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n onTouchEnd?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void\n showScrollbar?: boolean // 新增参数,默认true\n enhanced?: boolean // 新增参数,默认false\n /** 嵌套滚动:内容在滚动容器中的起始偏移(固定头部等场景) */\n startOffset?: number\n}\n\nfunction ScrollView (props: IProps) {\n const _scrollTop = useRef<any>(null)\n const _scrollLeft = useRef<any>(null)\n const container = useRef<any>(null)\n const scrollEndTimerRef = useRef<NodeJS.Timeout | null>(null)\n const isScrollingRef = useRef<boolean>(false)\n const isInitializedRef = useRef<boolean>(false)\n const [containerHeight, setContainerHeight] = useState(0)\n const onTouchMove = (e) => {\n e.stopPropagation()\n }\n\n const handleScroll = (props: IProps, isInit = false) => {\n // scrollIntoView\n if (\n props.scrollIntoView &&\n typeof props.scrollIntoView === 'string' &&\n document &&\n document.querySelector &&\n document.querySelector(`#${props.scrollIntoView}`)\n ) {\n if (isInit) {\n setTimeout(\n () =>\n scrollIntoView(\n props.scrollIntoView,\n props.scrollWithAnimation,\n !!props.scrollX,\n !!props.scrollY,\n props.scrollIntoViewAlignment\n ),\n 500\n )\n } else {\n scrollIntoView(\n props.scrollIntoView,\n props.scrollWithAnimation,\n !!props.scrollX,\n !!props.scrollY,\n props.scrollIntoViewAlignment\n )\n }\n } else {\n const isAnimation = !!props.scrollWithAnimation\n // Y 轴滚动\n if (props.scrollY && typeof props.scrollTop === 'number' && props.scrollTop !== _scrollTop.current) {\n setTimeout(() => scrollVertical(container, _scrollTop, props.scrollTop, isAnimation), 10)\n }\n // X 轴滚动\n if (props.scrollX && typeof props.scrollLeft === 'number' && props.scrollLeft !== _scrollLeft.current) {\n setTimeout(() => scrollHorizontal(container, _scrollLeft, props.scrollLeft, isAnimation), 10)\n }\n }\n }\n\n useEffect(() => {\n handleScroll(props, true)\n isInitializedRef.current = true\n }, [])\n\n // 监听 scrollTop、scrollLeft、scrollIntoView 的变化(排除初始化)\n useEffect(() => {\n if (isInitializedRef.current && container.current) {\n handleScroll(props, false)\n }\n }, [\n props.scrollTop,\n props.scrollLeft,\n props.scrollIntoView,\n props.scrollIntoViewAlignment,\n props.scrollWithAnimation,\n props.scrollX,\n props.scrollY\n ])\n\n const {\n className,\n style = {},\n onScroll,\n onScrollToUpper,\n onScrollToLower,\n scrollX,\n scrollY,\n showScrollbar = true, // 默认显示滚动条\n enhanced = false // 默认不增强\n } = props\n let { upperThreshold = 50, lowerThreshold = 50 } = props\n const cls = classNames(\n 'taro-scroll',\n {\n 'taro-scroll-view__scroll-x': scrollX,\n 'taro-scroll-view__scroll-y': scrollY,\n 'taro-scroll--hidebar': enhanced === true && showScrollbar === false,\n 'taro-scroll--enhanced': enhanced === true\n },\n className\n )\n upperThreshold = Number(upperThreshold)\n lowerThreshold = Number(lowerThreshold)\n const upperAndLower = e => {\n if (!container.current) return\n const { offsetWidth, offsetHeight, scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current\n if (\n onScrollToLower &&\n ((props.scrollY && offsetHeight + scrollTop + lowerThreshold >= scrollHeight) ||\n (props.scrollX && offsetWidth + scrollLeft + lowerThreshold >= scrollWidth))\n ) {\n onScrollToLower(e)\n }\n if (\n onScrollToUpper &&\n ((props.scrollY && scrollTop <= upperThreshold) || (props.scrollX && scrollLeft <= upperThreshold))\n ) {\n onScrollToUpper(e)\n }\n }\n const upperAndLowerThrottle = throttle(upperAndLower, 200)\n const _onScroll = e => {\n const { scrollLeft, scrollTop, scrollHeight, scrollWidth } = container.current\n _scrollLeft.current = scrollLeft\n _scrollTop.current = scrollTop\n Object.defineProperty(e, 'detail', {\n enumerable: true,\n writable: true,\n value: {\n scrollLeft,\n scrollTop,\n scrollHeight,\n scrollWidth\n }\n })\n\n // 处理滚动开始\n if (!isScrollingRef.current) {\n isScrollingRef.current = true\n if (props.onScrollStart) {\n props.onScrollStart(e)\n }\n }\n\n // 清除滚动结束定时器\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n scrollEndTimerRef.current = null\n }\n\n // 设置滚动结束定时器(150ms 无滚动事件后触发)\n if (props.onScrollEnd) {\n scrollEndTimerRef.current = setTimeout(() => {\n if (isScrollingRef.current) {\n isScrollingRef.current = false\n props.onScrollEnd?.(e)\n }\n scrollEndTimerRef.current = null\n }, 150)\n }\n\n upperAndLowerThrottle(e)\n onScroll && onScroll(e)\n }\n const _onTouchMove = e => {\n isFunction(props.onTouchMove) ? props.onTouchMove(e) : onTouchMove(e)\n }\n const _onTouchStart = e => {\n if (isFunction(props.onTouchStart)) {\n props.onTouchStart(e)\n }\n }\n const _onTouchEnd = e => {\n if (isFunction(props.onTouchEnd)) {\n props.onTouchEnd(e)\n }\n }\n // 清理定时器\n useEffect(() => {\n return () => {\n if (scrollEndTimerRef.current) {\n clearTimeout(scrollEndTimerRef.current)\n scrollEndTimerRef.current = null\n }\n }\n }, [])\n\n // ScrollElementContext:嵌套滚动时向子组件提供 scrollRef、containerHeight、startOffset\n useEffect(() => {\n const el = container.current\n if (!el) return\n const update = () => {\n if (container.current) {\n setContainerHeight(container.current.clientHeight)\n }\n }\n update()\n const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(update) : null\n if (ro) {\n ro.observe(el)\n return () => ro.disconnect()\n }\n }, [])\n\n const scrollElementContextValue = {\n scrollRef: container,\n containerHeight,\n startOffset: props.startOffset ?? 0,\n }\n\n return (\n <ScrollElementContext.Provider value={scrollElementContextValue}>\n <div\n ref={e => {\n if (e) {\n container.current = e\n if (props.forwardedRef) props.forwardedRef.current = e\n }\n }}\n style={style}\n className={cls}\n onScroll={_onScroll}\n onTouchMove={_onTouchMove}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n >\n {props.children}\n </div>\n </ScrollElementContext.Provider>\n )\n}\n\nexport default createForwardRefComponent(ScrollView)\n"],"names":["easeOutScroll","from","arguments","length","undefined","to","callback","change","dur","sTime","Date","linear","t","b","c","d","isLarger","step","requestAnimationFrame","scrollIntoView","id","animated","scrollX","scrollY","scrollIntoViewAlignment","_a","document","querySelector","behavior","block","inline","scrollVertical","container","scrollTop","top","isAnimation","current","pos","scrollHorizontal","scrollLeft","left","ScrollView","props","_scrollTop","useRef","_scrollLeft","scrollEndTimerRef","isScrollingRef","isInitializedRef","containerHeight","setContainerHeight","useState","onTouchMove","e","stopPropagation","handleScroll","isInit","setTimeout","scrollWithAnimation","useEffect","className","style","onScroll","onScrollToUpper","onScrollToLower","showScrollbar","enhanced","upperThreshold","lowerThreshold","cls","classNames","Number","upperAndLower","offsetWidth","offsetHeight","scrollHeight","scrollWidth","upperAndLowerThrottle","throttle","_onScroll","Object","defineProperty","enumerable","writable","value","onScrollStart","clearTimeout","onScrollEnd","call","_onTouchMove","isFunction","_onTouchStart","onTouchStart","_onTouchEnd","onTouchEnd","el","update","clientHeight","ro","ResizeObserver","observe","disconnect","scrollElementContextValue","scrollRef","startOffset","_jsx","ScrollElementContext","Provider","children","ref","forwardedRef","createForwardRefComponent"],"mappings":";;;;;;;;AAWA,SAASA,aAAaA,GAA4B;AAAA,EAAA,IAA1BC,IAAI,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAAC;AAAA,EAAA,IAAEG,EAAE,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,CAAC;EAAA,IAAEI,QAAQ,GAAAJ,SAAA,CAAAC,MAAA,GAAAD,CAAAA,GAAAA,SAAA,MAAAE,SAAA;EAChD,IAAIH,IAAI,KAAKI,EAAE,IAAI,OAAOJ,IAAI,KAAK,QAAQ,EAAE;AAC3C,IAAA;AACF;AACA,EAAA,MAAMM,MAAM,G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E,OAAO,GAAGiB,CAAC;AACxD;OACA;AACFQ,MAAAA,KAAK,EAAEA,KAAM;AACbD,MAAAA,SAAS,EAAES,GAAI;AACfP,MAAAA,QAAQ,EAAEiB,SAAU;AACpB3B,MAAAA,WAAW,EAAEqC,YAAa;AAC1BG,MAAAA,YAAY,EAAED,aAAc;AAC5BG,MAAAA,UAAU,EAAED,WAAY;MAAAe,QAAA,EAEvBlE,KAAK,CAACkE;KACJ;AACP,GAA+B,CAAC;AAEpC;AAEA,YAAeG,yBAAyB,CAACtE,UAAU,CAAC;;;;"}
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
- export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, Map, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span, Switch, Tabs, Textarea, Video, VoipRoom, WebView } from '@tarojs/components/lib/react';
1
+ export { Ad, AdCustom, AnimationVideo, AnimationView, ArCamera, Audio, AwemeData, Block, Camera, Canvas, ChannelLive, ChannelVideo, Checkbox, CheckboxGroup, CommentDetail, CommentList, ContactButton, CoverImage, CoverView, CustomWrapper, DraggableSheet, Editor, FollowSwan, Form, FunctionalPageNavigator, GridBuilder, GridView, InlinePaymentPanel, KeyboardAccessory, Label, Lifestyle, Like, ListBuilder, ListView, LivePlayer, LivePusher, Login, Lottie, MatchMedia, MovableArea, MovableView, NativeSlot, NavigationBar, Navigator, NestedScrollBody, NestedScrollHeader, OfficialAccount, OpenContainer, OpenData, PageContainer, PageMeta, PickerView, PickerViewColumn, Progress, Radio, RadioGroup, RichText, RootPortal, RtcRoom, RtcRoomItem, Script, ShareElement, Slider, Slot, Snapshot, Span, Switch, Tabs, Textarea, Video, VoipRoom, WebView } from '@tarojs/components/lib/react';
2
2
  export { default as Button } from './components/button/index.js';
3
3
  export { default as Icon } from './components/icon/index.js';
4
4
  export { default as Image } from './components/image/index.js';
5
5
  export { default as Input } from './components/input/index.js';
6
+ export { default as Map } from './components/map/index.js';
6
7
  export { default as Picker } from './components/picker/index.js';
7
8
  export { default as PullDownRefresh } from './components/pull-down-refresh/index.js';
8
9
  export { Refresher } from './components/refresher/index.js';
@@ -11,6 +12,7 @@ export { default as ScrollView } from './components/scroll-view/index.js';
11
12
  export { Swiper, SwiperItem } from './components/swiper/index.js';
12
13
  export { default as Text } from './components/text/index.js';
13
14
  export { default as View } from './components/view/index.js';
15
+ export { createMapContext } from './components/map/createMapContext.js';
14
16
 
15
17
  /* eslint-disable simple-import-sort/exports */
16
18
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { Map } from '@tarojs/components/lib/react'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { default as Refresher, type RefresherProps } from './components/refresher'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { ScrollElementContext, type ScrollElementContextValue } from './contexts/ScrollElementContext'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { Switch } from '@tarojs/components/lib/react'\nexport { Tabs } from '@tarojs/components/lib/react'\nexport { default as Text } from './components/text'\nexport { Textarea } from '@tarojs/components/lib/react'\nexport { Video } from '@tarojs/components/lib/react'\nexport { default as View } from './components/view'\nexport { VoipRoom } from '@tarojs/components/lib/react'\nexport { WebView } from '@tarojs/components/lib/react'\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.react.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nexport { Ad } from '@tarojs/components/lib/react'\nexport { AdCustom } from '@tarojs/components/lib/react'\nexport { AnimationVideo } from '@tarojs/components/lib/react'\nexport { AnimationView } from '@tarojs/components/lib/react'\nexport { ArCamera } from '@tarojs/components/lib/react'\nexport { Audio } from '@tarojs/components/lib/react'\nexport { AwemeData } from '@tarojs/components/lib/react'\nexport { Block } from '@tarojs/components/lib/react'\nexport { default as Button } from './components/button'\nexport { Camera } from '@tarojs/components/lib/react'\nexport { Canvas } from '@tarojs/components/lib/react'\nexport { ChannelLive } from '@tarojs/components/lib/react'\nexport { ChannelVideo } from '@tarojs/components/lib/react'\nexport { Checkbox, CheckboxGroup } from '@tarojs/components/lib/react'\nexport { CommentDetail, CommentList } from '@tarojs/components/lib/react'\nexport { ContactButton } from '@tarojs/components/lib/react'\nexport { CoverImage } from '@tarojs/components/lib/react'\nexport { CoverView } from '@tarojs/components/lib/react'\nexport { CustomWrapper } from '@tarojs/components/lib/react'\nexport { DraggableSheet } from '@tarojs/components/lib/react'\nexport { Editor } from '@tarojs/components/lib/react'\nexport { FollowSwan } from '@tarojs/components/lib/react'\nexport { Form } from '@tarojs/components/lib/react'\nexport { FunctionalPageNavigator } from '@tarojs/components/lib/react'\nexport { GridView } from '@tarojs/components/lib/react'\nexport { GridBuilder } from '@tarojs/components/lib/react'\nexport { default as Icon } from './components/icon'\nexport { default as Image } from './components/image'\nexport { InlinePaymentPanel } from '@tarojs/components/lib/react'\nexport { default as Input } from './components/input'\nexport { KeyboardAccessory } from '@tarojs/components/lib/react'\nexport { Label } from '@tarojs/components/lib/react'\nexport { Lifestyle } from '@tarojs/components/lib/react'\nexport { Like } from '@tarojs/components/lib/react'\nexport { LivePlayer } from '@tarojs/components/lib/react'\nexport { LivePusher } from '@tarojs/components/lib/react'\nexport { ListBuilder } from '@tarojs/components/lib/react'\nexport { ListView } from '@tarojs/components/lib/react'\nexport { Login } from '@tarojs/components/lib/react'\nexport { Lottie } from '@tarojs/components/lib/react'\nexport { default as Map, type MapProps } from './components/map'\nexport { createMapContext } from './components/map'\nexport { MatchMedia } from '@tarojs/components/lib/react'\nexport { MovableArea, MovableView } from '@tarojs/components/lib/react'\nexport { NavigationBar } from '@tarojs/components/lib/react'\nexport { Navigator } from '@tarojs/components/lib/react'\nexport { NestedScrollBody } from '@tarojs/components/lib/react'\nexport { NestedScrollHeader } from '@tarojs/components/lib/react'\nexport { OfficialAccount } from '@tarojs/components/lib/react'\nexport { OpenData } from '@tarojs/components/lib/react'\nexport { OpenContainer } from '@tarojs/components/lib/react'\nexport { PageContainer } from '@tarojs/components/lib/react'\nexport { PageMeta } from '@tarojs/components/lib/react'\nexport { default as Picker } from './components/picker'\nexport { PickerView, PickerViewColumn } from '@tarojs/components/lib/react'\nexport { Progress } from '@tarojs/components/lib/react'\nexport { default as PullDownRefresh } from './components/pull-down-refresh'\n// export { PullToRefresh } from '@tarojs/components/lib/react'\nexport { default as Refresher, type RefresherProps } from './components/refresher'\nexport { Radio, RadioGroup } from '@tarojs/components/lib/react'\nexport { RichText } from '@tarojs/components/lib/react'\nexport { RootPortal } from '@tarojs/components/lib/react'\nexport { RtcRoom, RtcRoomItem } from '@tarojs/components/lib/react'\nexport { Script } from '@tarojs/components/lib/react'\nexport { ScrollElementContext, type ScrollElementContextValue } from './contexts/ScrollElementContext'\nexport { default as ScrollView } from './components/scroll-view'\nexport { ShareElement } from '@tarojs/components/lib/react'\nexport { Slider } from '@tarojs/components/lib/react'\nexport { Snapshot } from '@tarojs/components/lib/react'\nexport { Span } from '@tarojs/components/lib/react'\nexport { NativeSlot, Slot } from '@tarojs/components/lib/react'\nexport { Swiper, SwiperItem } from './components/swiper'\nexport { Switch } from '@tarojs/components/lib/react'\nexport { Tabs } from '@tarojs/components/lib/react'\nexport { default as Text } from './components/text'\nexport { Textarea } from '@tarojs/components/lib/react'\nexport { Video } from '@tarojs/components/lib/react'\nexport { default as View } from './components/view'\nexport { VoipRoom } from '@tarojs/components/lib/react'\nexport { WebView } from '@tarojs/components/lib/react'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA"}