@tamagui/scroll-view 3.0.0-beta.669.1 → 3.0.0-beta.728.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/dist/cjs/ScrollView.cjs +0 -1
- package/dist/cjs/ScrollView.native.cjs +0 -1
- package/dist/cjs/ScrollView.native.js +0 -1
- package/dist/cjs/ScrollView.native.js.map +1 -1
- package/dist/cjs/WebScrollView.cjs +0 -1
- package/dist/cjs/WebScrollView.native.cjs +0 -1
- package/dist/cjs/WebScrollView.native.js +0 -1
- package/dist/cjs/WebScrollView.native.js.map +1 -1
- package/dist/cjs/index.cjs +0 -1
- package/dist/cjs/index.native.cjs +0 -1
- package/dist/cjs/index.native.js +0 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/web.cjs +0 -1
- package/dist/esm/WebScrollView.mjs.map +1 -1
- package/dist/esm/WebScrollView.native.js.map +1 -1
- package/dist/jsx/ScrollView.native.cjs +0 -1
- package/dist/jsx/ScrollView.native.js +0 -1
- package/dist/jsx/ScrollView.native.js.map +1 -1
- package/dist/jsx/WebScrollView.mjs.map +1 -1
- package/dist/jsx/WebScrollView.native.cjs +0 -1
- package/dist/jsx/WebScrollView.native.js +0 -1
- package/dist/jsx/WebScrollView.native.js.map +1 -1
- package/dist/jsx/index.native.cjs +0 -1
- package/dist/jsx/index.native.js +0 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/ScrollView.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollView.native.js","names":[],"sources":["cjs/ScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar ScrollView_native_exports = {};\n__export(ScrollView_native_exports, {\n ScrollView: () => ScrollView\n});\nmodule.exports = __toCommonJS(ScrollView_native_exports);\nvar import_web = require(\"@tamagui/web\");\nvar import_react_native = require(\"react-native\");\nvar ScrollView = (0, import_web.styled)(import_react_native.ScrollView, {\n displayName: \"ScrollView\",\n scrollEnabled: true\n}, {\n neverFlatten: true,\n accept: {\n contentContainerStyle: \"style\"\n }\n});\n//# sourceMappingURL=ScrollView.native.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScrollView.native.js","names":[],"sources":["cjs/ScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar ScrollView_native_exports = {};\n__export(ScrollView_native_exports, {\n ScrollView: () => ScrollView\n});\nmodule.exports = __toCommonJS(ScrollView_native_exports);\nvar import_web = require(\"@tamagui/web\");\nvar import_react_native = require(\"react-native\");\nvar ScrollView = (0, import_web.styled)(import_react_native.ScrollView, {\n displayName: \"ScrollView\",\n scrollEnabled: true\n}, {\n neverFlatten: true,\n accept: {\n contentContainerStyle: \"style\"\n }\n});\n//# sourceMappingURL=ScrollView.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,4BAA4B,CAAC;AACjC,SAAS,2BAA2B,EAClC,kBAAkB,WACpB,CAAC;AACD,OAAO,UAAU,aAAa,yBAAyB;AACvD,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,sBAAsB,QAAQ,cAAc;AAChD,IAAI,cAAc,GAAG,WAAW,OAAM,CAAE,oBAAoB,YAAY;CACtE,aAAa;CACb,eAAe;AACjB,GAAG;CACD,cAAc;CACd,QAAQ,EACN,uBAAuB,QACzB;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebScrollView.native.js","names":[],"sources":["cjs/WebScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar WebScrollView_exports = {};\n__export(WebScrollView_exports, {\n WebScrollView: () => WebScrollView\n});\nmodule.exports = __toCommonJS(WebScrollView_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar View = import_web.View;\nfunction mergeRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n return function(node) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = refs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var ref = _step.value;\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n var target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n var timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles() {\n for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {\n inputs[_key] = arguments[_key];\n }\n var style = {};\n var classNames = [];\n var walk = function(s) {\n if (!s) return;\n if (Array.isArray(s)) {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = s[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var item = _step2.value;\n walk(item);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return;\n }\n if (s.$$css) {\n for (var k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = inputs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var input = _step.value;\n walk(input);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return {\n style,\n className: classNames.join(\" \")\n };\n}\nfunction joinClassNames() {\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n var joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nvar commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nvar styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nvar WebScrollView = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {\n var {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n var { dataSet, ...domRest } = rest;\n var dataAttrs = {};\n if (dataSet) {\n for (var key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n var scrollNodeRef = React.useRef(null);\n var innerViewRef = React.useRef(null);\n var scrollState = React.useRef({\n isScrolling: false,\n scrollLastTick: 0\n });\n var scrollTimeout = React.useRef(null);\n var scrollTo = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({\n top: y,\n left: x,\n behavior: animated ? \"smooth\" : \"auto\"\n });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n var scrollToEnd = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var animated = (options && options.animated) !== false;\n var x = horizontal ? node.scrollWidth : 0;\n var y = horizontal ? 0 : node.scrollHeight;\n scrollTo({\n x,\n y,\n animated\n });\n };\n var setScrollNodeRef = React.useCallback(function(node) {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = function() {\n return node;\n };\n node.getScrollableNode = function() {\n return node;\n };\n node.getInnerViewNode = function() {\n return innerViewRef.current;\n };\n node.getInnerViewRef = function() {\n return innerViewRef.current;\n };\n node.getNativeScrollRef = function() {\n return node;\n };\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = function() {\n };\n }\n mergeRefs(forwardedRef)(node);\n }, [\n forwardedRef,\n horizontal\n ]);\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(function() {\n scrollState.current.isScrolling = false;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n }\n var handleContentLayout = onContentSizeChange ? function(e) {\n var { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n var renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, function(child, i) {\n var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n var resolved = resolveStyles(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n });\n }\n return child;\n }) : children;\n var contentResolved = resolveStyles(horizontal && styles.contentContainerHorizontal, centerContent && styles.contentContainerCenterContent, contentContainerStyle);\n var contentContainer = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n });\n var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n var hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n var hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n var extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n var scrollResolved = resolveStyles(baseStyle, pagingEnabled && pagingEnabledStyle, style, !scrollEnabled && styles.scrollDisabled);\n var scrollView = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(domRest.className, scrollResolved.className, extraClassName),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n });\n if (refreshControl) {\n var refreshResolved = resolveStyles(baseStyle, style);\n return /* @__PURE__ */ React.cloneElement(refreshControl, {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n }, scrollView);\n }\n return scrollView;\n});\nWebScrollView.displayName = \"ScrollView\";\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,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Ae,WAAW,cAAc;EACrF,KAAK;EACL,UAAU;EACV,OAAO,eAAe;EACtB,UAAU;CACZ,CAAC;CACD,IAAI,gBAAgB;EAClB,IAAI,kBAAkB,cAAc,WAAW,KAAK;EACpD,OAAuB,sBAAM,aAAa,gBAAgB;GACxD,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GAAG,UAAU;CACf;CACA,OAAO;AACT,CAAC;AACD,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"WebScrollView.native.js","names":[],"sources":["cjs/WebScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar WebScrollView_exports = {};\n__export(WebScrollView_exports, {\n WebScrollView: () => WebScrollView\n});\nmodule.exports = __toCommonJS(WebScrollView_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar View = import_web.View;\nfunction mergeRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n return function(node) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = refs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var ref = _step.value;\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n var target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n var timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles() {\n for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {\n inputs[_key] = arguments[_key];\n }\n var style = {};\n var classNames = [];\n var walk = function(s) {\n if (!s) return;\n if (Array.isArray(s)) {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = s[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var item = _step2.value;\n walk(item);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return;\n }\n if (s.$$css) {\n for (var k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = inputs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var input = _step.value;\n walk(input);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return {\n style,\n className: classNames.join(\" \")\n };\n}\nfunction joinClassNames() {\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n var joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nvar commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nvar styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nvar WebScrollView = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {\n var {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n var { dataSet, ...domRest } = rest;\n var dataAttrs = {};\n if (dataSet) {\n for (var key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n var scrollNodeRef = React.useRef(null);\n var innerViewRef = React.useRef(null);\n var scrollState = React.useRef({\n isScrolling: false,\n scrollLastTick: 0\n });\n var scrollTimeout = React.useRef(null);\n var scrollTo = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({\n top: y,\n left: x,\n behavior: animated ? \"smooth\" : \"auto\"\n });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n var scrollToEnd = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var animated = (options && options.animated) !== false;\n var x = horizontal ? node.scrollWidth : 0;\n var y = horizontal ? 0 : node.scrollHeight;\n scrollTo({\n x,\n y,\n animated\n });\n };\n var setScrollNodeRef = React.useCallback(function(node) {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = function() {\n return node;\n };\n node.getScrollableNode = function() {\n return node;\n };\n node.getInnerViewNode = function() {\n return innerViewRef.current;\n };\n node.getInnerViewRef = function() {\n return innerViewRef.current;\n };\n node.getNativeScrollRef = function() {\n return node;\n };\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = function() {\n };\n }\n mergeRefs(forwardedRef)(node);\n }, [\n forwardedRef,\n horizontal\n ]);\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(function() {\n scrollState.current.isScrolling = false;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n }\n var handleContentLayout = onContentSizeChange ? function(e) {\n var { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n var renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, function(child, i) {\n var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n var resolved = resolveStyles(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n });\n }\n return child;\n }) : children;\n var contentResolved = resolveStyles(horizontal && styles.contentContainerHorizontal, centerContent && styles.contentContainerCenterContent, contentContainerStyle);\n var contentContainer = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n });\n var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n var hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n var hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n var extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n var scrollResolved = resolveStyles(baseStyle, pagingEnabled && pagingEnabledStyle, style, !scrollEnabled && styles.scrollDisabled);\n var scrollView = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(domRest.className, scrollResolved.className, extraClassName),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n });\n if (refreshControl) {\n var refreshResolved = resolveStyles(baseStyle, style);\n return /* @__PURE__ */ React.cloneElement(refreshControl, {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n }, scrollView);\n }\n return scrollView;\n});\nWebScrollView.displayName = \"ScrollView\";\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAA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SAAS;EACnD,UAAU;CACZ,CAAC;CACD,IAAI,YAAY,aAAa,OAAO,iBAAiB,OAAO;CAC5D,IAAI,qBAAqB,aAAa,OAAO,0BAA0B,OAAO;CAC9E,IAAI,0BAA0B,mCAAmC;CACjE,IAAI,wBAAwB,iCAAiC;CAC7D,IAAI,kBAAkB,0BAA0B,YAAY,OAAO,wBAAwB,YAAY;CACvG,IAAI,iBAAiB,cAAc,WAAW,iBAAiB,oBAAoB,OAAO,CAAC,iBAAiB,OAAO,cAAc;CACjI,IAAI,aAA6B,iBAAC,GAAG,mBAAmB,IAAG,CAAE,MAAM;EACjE,GAAG;EACH,GAAG;EACH,WAAW,eAAe,QAAQ,WAAW,eAAe,WAAW,cAAc;EACrF,KAAK;EACL,UAAU;EACV,OAAO,eAAe;EACtB,UAAU;CACZ,CAAC;CACD,IAAI,gBAAgB;EAClB,IAAI,kBAAkB,cAAc,WAAW,KAAK;EACpD,OAAuB,sBAAM,aAAa,gBAAgB;GACxD,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GAAG,UAAU;CACf;CACA,OAAO;AACT,CAAC;AACD,cAAc,cAAc"}
|
package/dist/cjs/index.cjs
CHANGED
package/dist/cjs/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./ScrollView\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./ScrollView\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,wBAAc,GAAG,OAAO,OAAO"}
|
package/dist/cjs/web.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebScrollView.js","names":["View","TamaguiView"],"sources":["esm/WebScrollView.js"],"sourcesContent":["import { View as TamaguiView } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst View = TamaguiView;\nfunction mergeRefs(...refs) {\n return (node) => {\n for (const ref of refs) {\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n const target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n const timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles(...inputs) {\n const style = {};\n const classNames = [];\n const walk = (s) => {\n if (!s) return;\n if (Array.isArray(s)) {\n for (const item of s) walk(item);\n return;\n }\n if (s.$$css) {\n for (const k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n for (const input of inputs) walk(input);\n return { style, className: classNames.join(\" \") };\n}\nfunction joinClassNames(...parts) {\n const joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nconst commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nconst styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nconst WebScrollView = React.forwardRef(\n (props, forwardedRef) => {\n const {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n const { dataSet, ...domRest } = rest;\n const dataAttrs = {};\n if (dataSet) {\n for (const key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n const scrollNodeRef = React.useRef(null);\n const innerViewRef = React.useRef(null);\n const scrollState = React.useRef({ isScrolling: false, scrollLastTick: 0 });\n const scrollTimeout = React.useRef(null);\n const scrollTo = (options) => {\n const node = scrollNodeRef.current;\n if (node == null) return;\n const { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({ top: y, left: x, behavior: animated ? \"smooth\" : \"auto\" });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n const scrollToEnd = (options) => {\n const node = scrollNodeRef.current;\n if (node == null) return;\n const animated = (options && options.animated) !== false;\n const x = horizontal ? node.scrollWidth : 0;\n const y = horizontal ? 0 : node.scrollHeight;\n scrollTo({ x, y, animated });\n };\n const setScrollNodeRef = React.useCallback(\n (node) => {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = () => node;\n node.getScrollableNode = () => node;\n node.getInnerViewNode = () => innerViewRef.current;\n node.getInnerViewRef = () => innerViewRef.current;\n node.getNativeScrollRef = () => node;\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = () => {\n };\n }\n mergeRefs(forwardedRef)(node);\n },\n [forwardedRef, horizontal]\n );\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(() => {\n scrollState.current.isScrolling = false;\n onScroll?.(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll?.(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll?.(normalizeScrollEvent(e));\n }\n }\n const handleContentLayout = onContentSizeChange ? (e) => {\n const { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n const hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n const renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, (child, i) => {\n const isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n const resolved = resolveStyles(\n isSticky && styles.stickyHeader,\n pagingEnabled && styles.pagingEnabledChild\n );\n return /* @__PURE__ */ jsx(\n View,\n {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n }\n );\n }\n return child;\n }) : children;\n const contentResolved = resolveStyles(\n horizontal && styles.contentContainerHorizontal,\n centerContent && styles.contentContainerCenterContent,\n contentContainerStyle\n );\n const contentContainer = /* @__PURE__ */ jsx(\n View,\n {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n }\n );\n const baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n const pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n const hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n const hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n const extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n const scrollResolved = resolveStyles(\n baseStyle,\n pagingEnabled && pagingEnabledStyle,\n style,\n !scrollEnabled && styles.scrollDisabled\n );\n const scrollView = /* @__PURE__ */ jsx(\n View,\n {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(\n domRest.className,\n scrollResolved.className,\n extraClassName\n ),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n }\n );\n if (refreshControl) {\n const refreshResolved = resolveStyles(baseStyle, style);\n return React.cloneElement(\n refreshControl,\n {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n },\n scrollView\n );\n }\n return scrollView;\n }\n);\nWebScrollView.displayName = \"ScrollView\";\nexport {\n WebScrollView\n};\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;;;AAGA,MAAMA,SAAOC;AACb,SAAS,UAAU,GAAG,MAAM;CAC1B,QAAQ,SAAS;EACf,KAAK,MAAM,OAAO,MAAM;GACtB,IAAI,CAAC,KAAK;GACV,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;QAClC,IAAI,UAAU;EACrB;CACF;AACF;AACA,SAAS,qBAAqB,GAAG;CAC/B,MAAM,SAAS,EAAE;CACjB,OAAO;EACL,aAAa;GACX,eAAe;IACb,IAAI,IAAI;KACN,OAAO,OAAO;IAChB;IACA,IAAI,IAAI;KACN,OAAO,OAAO;IAChB;GACF;GACA,aAAa;IACX,IAAI,SAAS;KACX,OAAO,OAAO;IAChB;IACA,IAAI,QAAQ;KACV,OAAO,OAAO;IAChB;GACF;GACA,mBAAmB;IACjB,IAAI,SAAS;KACX,OAAO,OAAO;IAChB;IACA,IAAI,QAAQ;KACV,OAAO,OAAO;IAChB;GACF;EACF;EACA,WAAW,KAAK,IAAI;CACtB;AACF;AACA,SAAS,sBAAsB,UAAU,eAAe;CACtD,MAAM,oBAAoB,KAAK,IAAI,IAAI;CACvC,OAAO,gBAAgB,KAAK,qBAAqB;AACnD;AACA,SAAS,cAAc,GAAG,QAAQ;CAChC,MAAM,QAAQ,CAAC;CACf,MAAM,aAAa,CAAC;CACpB,MAAM,QAAQ,MAAM;EAClB,IAAI,CAAC,GAAG;EACR,IAAI,MAAM,QAAQ,CAAC,GAAG;GACpB,KAAK,MAAM,QAAQ,GAAG,KAAK,IAAI;GAC/B;EACF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,OAAO,iBAAiB,OAAO;CAC9D,MAAM,qBAAqB,aAAa,OAAO,0BAA0B,OAAO;CAChF,MAAM,0BAA0B,mCAAmC;CACnE,MAAM,wBAAwB,iCAAiC;CAC/D,MAAM,kBAAkB,0BAA0B,YAAY,OAAO,wBAAwB,YAAY;CACzG,MAAM,iBAAiB,cACrB,WACA,iBAAiB,oBACjB,OACA,CAAC,iBAAiB,OAAO,cAC3B;CACA,MAAM,aAA6B,oBACjCA,QACA;EACE,GAAG;EACH,GAAG;EACH,WAAW,eACT,QAAQ,WACR,eAAe,WACf,cACF;EACA,KAAK;EACL,UAAU;EACV,OAAO,eAAe;EACtB,UAAU;CACZ,CACF;CACA,IAAI,gBAAgB;EAClB,MAAM,kBAAkB,cAAc,WAAW,KAAK;EACtD,OAAO,MAAM,aACX,gBACA;GACE,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GACA,UACF;CACF;CACA,OAAO;AACT,CACF;AACA,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"WebScrollView.js","names":["View","TamaguiView"],"sources":["esm/WebScrollView.js"],"sourcesContent":["import { View as TamaguiView } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst View = TamaguiView;\nfunction mergeRefs(...refs) {\n return (node) => {\n for (const ref of refs) {\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n const target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n const timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles(...inputs) {\n const style = {};\n const classNames = [];\n const walk = (s) => {\n if (!s) return;\n if (Array.isArray(s)) {\n for (const item of s) walk(item);\n return;\n }\n if (s.$$css) {\n for (const k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n for (const input of inputs) walk(input);\n return { style, className: classNames.join(\" \") };\n}\nfunction joinClassNames(...parts) {\n const joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nconst commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nconst styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nconst WebScrollView = React.forwardRef(\n (props, forwardedRef) => {\n const {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n const { dataSet, ...domRest } = rest;\n const dataAttrs = {};\n if (dataSet) {\n for (const key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n const scrollNodeRef = React.useRef(null);\n const innerViewRef = React.useRef(null);\n const scrollState = React.useRef({ isScrolling: false, scrollLastTick: 0 });\n const scrollTimeout = React.useRef(null);\n const scrollTo = (options) => {\n const node = scrollNodeRef.current;\n if (node == null) return;\n const { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({ top: y, left: x, behavior: animated ? \"smooth\" : \"auto\" });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n const scrollToEnd = (options) => {\n const node = scrollNodeRef.current;\n if (node == null) return;\n const animated = (options && options.animated) !== false;\n const x = horizontal ? node.scrollWidth : 0;\n const y = horizontal ? 0 : node.scrollHeight;\n scrollTo({ x, y, animated });\n };\n const setScrollNodeRef = React.useCallback(\n (node) => {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = () => node;\n node.getScrollableNode = () => node;\n node.getInnerViewNode = () => innerViewRef.current;\n node.getInnerViewRef = () => innerViewRef.current;\n node.getNativeScrollRef = () => node;\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = () => {\n };\n }\n mergeRefs(forwardedRef)(node);\n },\n [forwardedRef, horizontal]\n );\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(() => {\n scrollState.current.isScrolling = false;\n onScroll?.(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll?.(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll?.(normalizeScrollEvent(e));\n }\n }\n const handleContentLayout = onContentSizeChange ? (e) => {\n const { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n const hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n const renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, (child, i) => {\n const isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n const resolved = resolveStyles(\n isSticky && styles.stickyHeader,\n pagingEnabled && styles.pagingEnabledChild\n );\n return /* @__PURE__ */ jsx(\n View,\n {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n }\n );\n }\n return child;\n }) : children;\n const contentResolved = resolveStyles(\n horizontal && styles.contentContainerHorizontal,\n centerContent && styles.contentContainerCenterContent,\n contentContainerStyle\n );\n const contentContainer = /* @__PURE__ */ jsx(\n View,\n {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n }\n );\n const baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n const pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n const hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n const hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n const extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n const scrollResolved = resolveStyles(\n baseStyle,\n pagingEnabled && pagingEnabledStyle,\n style,\n !scrollEnabled && styles.scrollDisabled\n );\n const scrollView = /* @__PURE__ */ jsx(\n View,\n {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(\n domRest.className,\n scrollResolved.className,\n extraClassName\n ),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n }\n );\n if (refreshControl) {\n const refreshResolved = resolveStyles(baseStyle, style);\n return React.cloneElement(\n refreshControl,\n {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n },\n scrollView\n );\n }\n return scrollView;\n }\n);\nWebScrollView.displayName = \"ScrollView\";\nexport {\n WebScrollView\n};\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;;;AAGA,MAAMA,SAAOC;AACb,SAAS,UAAU,GAAG,MAAM;CAC1B,QAAQ,SAAS;EACf,KAAK,MAAM,OAAO,MAAM;GACtB,IAAI,CAAC,KAAK;GACV,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;QAClC,IAAI,UAAU;EACrB;CACF;AACF;AACA,SAAS,qBAAqB,GAAG;CAC/B,MAAM,SAAS,EAAE;CACjB,OAAO;EACL,aAAa;GACX,eAAe;IACb,IAAI,IAAI;KACN,OAAO,OAAO;IAChB;IACA,IAAI,IAAI;KACN,OAAO,OAAO;IAChB;GACF;GACA,aAAa;IACX,IAAI,SAAS;KACX,OAAO,OAAO;IAChB;IACA,IAAI,QAAQ;KACV,OAAO,OAAO;IAChB;GACF;GACA,mBAAmB;IACjB,IAAI,SAAS;KACX,OAAO,OAAO;IAChB;IACA,IAAI,QAAQ;KACV,OAAO,OAAO;IAChB;GACF;EACF;EACA,WAAW,KAAK,IAAI;CACtB;AACF;AACA,SAAS,sBAAsB,UAAU,eAAe;CACtD,MAAM,oBAAoB,KAAK,IAAI,IAAI;CACvC,OAAO,gBAAgB,KAAK,qBAAqB;AACnD;AACA,SAA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AAI;CACL,MAAM,kBAAkB,cACtB,cAAc,OAAO,4BACrB,iBAAiB,OAAO,+BACxB,qBACF;CACA,MAAM,mBAAmC,oBACvCA,QACA;EACE,KAAK;EACL,UAAU;EACV,OAAO,gBAAgB;EACvB,WAAW,eAAe,gBAAgB,SAAS;EACnD,UAAU;CACZ,CACF;CACA,MAAM,YAAY,aAAa,OAAO,iBAAiB,OAAO;CAC9D,MAAM,qBAAqB,aAAa,OAAO,0BAA0B,OAAO;CAChF,MAAM,0BAA0B,mCAAmC;CACnE,MAAM,wBAAwB,iCAAiC;CAC/D,MAAM,kBAAkB,0BAA0B,YAAY,OAAO,wBAAwB,YAAY;CACzG,MAAM,iBAAiB,cACrB,WACA,iBAAiB,oBACjB,OACA,CAAC,iBAAiB,OAAO,cAC3B;CACA,MAAM,aAA6B,oBACjCA,QACA;EACE,GAAG;EACH,GAAG;EACH,WAAW,eACT,QAAQ,WACR,eAAe,WACf,cACF;EACA,KAAK;EACL,UAAU;EACV,OAAO,eAAe;EACtB,UAAU;CACZ,CACF;CACA,IAAI,gBAAgB;EAClB,MAAM,kBAAkB,cAAc,WAAW,KAAK;EACtD,OAAO,MAAM,aACX,gBACA;GACE,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GACA,UACF;CACF;CACA,OAAO;AACT,CACF;AACA,cAAc,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebScrollView.native.js","names":["View","TamaguiView"],"sources":["esm/WebScrollView.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { View as TamaguiView } from \"@tamagui/web\";\nimport * as React from \"react\";\nvar View = TamaguiView;\nfunction mergeRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n return function(node) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = refs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var ref = _step.value;\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n var target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n var timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles() {\n for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {\n inputs[_key] = arguments[_key];\n }\n var style = {};\n var classNames = [];\n var walk = function(s) {\n if (!s) return;\n if (Array.isArray(s)) {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = s[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var item = _step2.value;\n walk(item);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return;\n }\n if (s.$$css) {\n for (var k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = inputs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var input = _step.value;\n walk(input);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return {\n style,\n className: classNames.join(\" \")\n };\n}\nfunction joinClassNames() {\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n var joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nvar commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nvar styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nvar WebScrollView = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {\n var {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n var { dataSet, ...domRest } = rest;\n var dataAttrs = {};\n if (dataSet) {\n for (var key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n var scrollNodeRef = React.useRef(null);\n var innerViewRef = React.useRef(null);\n var scrollState = React.useRef({\n isScrolling: false,\n scrollLastTick: 0\n });\n var scrollTimeout = React.useRef(null);\n var scrollTo = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({\n top: y,\n left: x,\n behavior: animated ? \"smooth\" : \"auto\"\n });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n var scrollToEnd = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var animated = (options && options.animated) !== false;\n var x = horizontal ? node.scrollWidth : 0;\n var y = horizontal ? 0 : node.scrollHeight;\n scrollTo({\n x,\n y,\n animated\n });\n };\n var setScrollNodeRef = React.useCallback(function(node) {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = function() {\n return node;\n };\n node.getScrollableNode = function() {\n return node;\n };\n node.getInnerViewNode = function() {\n return innerViewRef.current;\n };\n node.getInnerViewRef = function() {\n return innerViewRef.current;\n };\n node.getNativeScrollRef = function() {\n return node;\n };\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = function() {\n };\n }\n mergeRefs(forwardedRef)(node);\n }, [\n forwardedRef,\n horizontal\n ]);\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(function() {\n scrollState.current.isScrolling = false;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n }\n var handleContentLayout = onContentSizeChange ? function(e) {\n var { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n var renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, function(child, i) {\n var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n var resolved = resolveStyles(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild);\n return /* @__PURE__ */ _jsx(View, {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n });\n }\n return child;\n }) : children;\n var contentResolved = resolveStyles(horizontal && styles.contentContainerHorizontal, centerContent && styles.contentContainerCenterContent, contentContainerStyle);\n var contentContainer = /* @__PURE__ */ _jsx(View, {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n });\n var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n var hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n var hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n var extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n var scrollResolved = resolveStyles(baseStyle, pagingEnabled && pagingEnabledStyle, style, !scrollEnabled && styles.scrollDisabled);\n var scrollView = /* @__PURE__ */ _jsx(View, {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(domRest.className, scrollResolved.className, extraClassName),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n });\n if (refreshControl) {\n var refreshResolved = resolveStyles(baseStyle, style);\n return /* @__PURE__ */ React.cloneElement(refreshControl, {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n }, scrollView);\n }\n return scrollView;\n});\nWebScrollView.displayName = \"ScrollView\";\nexport {\n WebScrollView\n};\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;;;AAGA,IAAIA,SAAOC;AACX,SAAS,YAAY;CACnB,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,QAAQ;EACvF,KAAK,QAAQ,UAAU;CACzB;CACA,OAAO,SAAS,MAAM;EACpB,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACF,KAAK,IAAI,YAAY,KAAK,OAAO,UAAU,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,GAAG,OAAO,4BAA4B,MAAM;IACrJ,IAAI,MAAM,MAAM;IAChB,IAAI,CAAC,KAAK;IACV,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;SAClC,IAAI,UAAU;GACrB;EACF,SAAS,K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;CACjI,IAAI,aAA6B,oBAAKA,QAAM;EAC1C,GAAG;EACH,GAAG;EACH,WAAW,eAAe,QAAQ,WAAW,eAAe,WAAW,cAAc;EACrF,KAAK;EACL,UAAU;EACV,OAAO,eAAe;EACtB,UAAU;CACZ,CAAC;CACD,IAAI,gBAAgB;EAClB,IAAI,kBAAkB,cAAc,WAAW,KAAK;EACpD,OAAuB,sBAAM,aAAa,gBAAgB;GACxD,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GAAG,UAAU;CACf;CACA,OAAO;AACT,CAAC;AACD,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"WebScrollView.native.js","names":["View","TamaguiView"],"sources":["esm/WebScrollView.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { View as TamaguiView } from \"@tamagui/web\";\nimport * as React from \"react\";\nvar View = TamaguiView;\nfunction mergeRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n return function(node) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = refs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var ref = _step.value;\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n var target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n var timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles() {\n for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {\n inputs[_key] = arguments[_key];\n }\n var style = {};\n var classNames = [];\n var walk = function(s) {\n if (!s) return;\n if (Array.isArray(s)) {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = s[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var item = _step2.value;\n walk(item);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return;\n }\n if (s.$$css) {\n for (var k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = inputs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var input = _step.value;\n walk(input);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return {\n style,\n className: classNames.join(\" \")\n };\n}\nfunction joinClassNames() {\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n var joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nvar commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nvar styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nvar WebScrollView = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {\n var {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n var { dataSet, ...domRest } = rest;\n var dataAttrs = {};\n if (dataSet) {\n for (var key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n var scrollNodeRef = React.useRef(null);\n var innerViewRef = React.useRef(null);\n var scrollState = React.useRef({\n isScrolling: false,\n scrollLastTick: 0\n });\n var scrollTimeout = React.useRef(null);\n var scrollTo = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({\n top: y,\n left: x,\n behavior: animated ? \"smooth\" : \"auto\"\n });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n var scrollToEnd = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var animated = (options && options.animated) !== false;\n var x = horizontal ? node.scrollWidth : 0;\n var y = horizontal ? 0 : node.scrollHeight;\n scrollTo({\n x,\n y,\n animated\n });\n };\n var setScrollNodeRef = React.useCallback(function(node) {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = function() {\n return node;\n };\n node.getScrollableNode = function() {\n return node;\n };\n node.getInnerViewNode = function() {\n return innerViewRef.current;\n };\n node.getInnerViewRef = function() {\n return innerViewRef.current;\n };\n node.getNativeScrollRef = function() {\n return node;\n };\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = function() {\n };\n }\n mergeRefs(forwardedRef)(node);\n }, [\n forwardedRef,\n horizontal\n ]);\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(function() {\n scrollState.current.isScrolling = false;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n }\n var handleContentLayout = onContentSizeChange ? function(e) {\n var { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n var renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, function(child, i) {\n var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n var resolved = resolveStyles(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild);\n return /* @__PURE__ */ _jsx(View, {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n });\n }\n return child;\n }) : children;\n var contentResolved = resolveStyles(horizontal && styles.contentContainerHorizontal, centerContent && styles.contentContainerCenterContent, contentContainerStyle);\n var contentContainer = /* @__PURE__ */ _jsx(View, {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n });\n var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n var hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n var hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n var extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n var scrollResolved = resolveStyles(baseStyle, pagingEnabled && pagingEnabledStyle, style, !scrollEnabled && styles.scrollDisabled);\n var scrollView = /* @__PURE__ */ _jsx(View, {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(domRest.className, scrollResolved.className, extraClassName),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n });\n if (refreshControl) {\n var refreshResolved = resolveStyles(baseStyle, style);\n return /* @__PURE__ */ React.cloneElement(refreshControl, {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n }, scrollView);\n }\n return scrollView;\n});\nWebScrollView.displayName = \"ScrollView\";\nexport {\n WebScrollView\n};\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;;;AAGA,IAAIA,SAAOC;AACX,SAAS,YAAY;CACnB,KAAK,IAAI,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,MAAM,QAAQ;EACvF,KAAK,QAAQ,UAAU;CACzB;CACA,OAAO,SAAS,MAAM;EACpB,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACF,KAAK,IAAI,YAAY,KAAK,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IACrJ,IAAI,MAAM,MAAM;IAChB,IAAI,CAAC,KAAK;IACV,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;SAClC,IAAI,UAAU;GACrB;EACF,SAAS,KAAK;GACZ,oBAAoB;GACpB,iBAAiB;EACnB,UAAU;GACR,IAAI;IACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;KAC1D,UAAU,OAAO;IACnB;GACF,UAAU;IACR,IAAI,mBAAmB;KACrB,MAAM;IACR;GACF;EACF;CACF;AACF;AACA,SAAS,qBAAqB,GAAG;CAC/B,IAAI,SAAS,EAAE;CACf,OAAO;EACL,aAAa;GACX,eAAe;IACb,IAAI,IAAI;KACN,OAAO,OAAO;IAChB;IACA,IAAI,IAAI;KACN,OAAO,OAAO;IAChB;GACF;GACA,aAAa;IACX,IAAI,SAAS;KACX,OAAO,OAAO;IAChB;IACA,IAAI,QAAQ;KACV,OAAO,OAAO;IAChB;GACF;GACA,mBAAmB;IACjB,IA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.js","names":[],"sources":["jsx/ScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar ScrollView_native_exports = {};\n__export(ScrollView_native_exports, {\n ScrollView: () => ScrollView\n});\nmodule.exports = __toCommonJS(ScrollView_native_exports);\nvar import_web = require(\"@tamagui/web\");\nvar import_react_native = require(\"react-native\");\nvar ScrollView = (0, import_web.styled)(import_react_native.ScrollView, {\n displayName: \"ScrollView\",\n scrollEnabled: true\n}, {\n neverFlatten: true,\n accept: {\n contentContainerStyle: \"style\"\n }\n});\n//# sourceMappingURL=ScrollView.native.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScrollView.native.js","names":[],"sources":["jsx/ScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar ScrollView_native_exports = {};\n__export(ScrollView_native_exports, {\n ScrollView: () => ScrollView\n});\nmodule.exports = __toCommonJS(ScrollView_native_exports);\nvar import_web = require(\"@tamagui/web\");\nvar import_react_native = require(\"react-native\");\nvar ScrollView = (0, import_web.styled)(import_react_native.ScrollView, {\n displayName: \"ScrollView\",\n scrollEnabled: true\n}, {\n neverFlatten: true,\n accept: {\n contentContainerStyle: \"style\"\n }\n});\n//# sourceMappingURL=ScrollView.native.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,4BAA4B,CAAC;AACjC,SAAS,2BAA2B,EAClC,kBAAkB,WACpB,CAAC;AACD,OAAO,UAAU,aAAa,yBAAyB;AACvD,IAAI,aAAa,QAAQ,cAAc;AACvC,IAAI,sBAAsB,QAAQ,cAAc;AAChD,IAAI,cAAc,GAAG,WAAW,OAAM,CAAE,oBAAoB,YAAY;CACtE,aAAa;CACb,eAAe;AACjB,GAAG;CACD,cAAc;CACd,QAAQ,EACN,uBAAuB,QACzB;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebScrollView.js","names":["View","TamaguiView"],"sources":["jsx/WebScrollView.js"],"sourcesContent":["import { View as TamaguiView } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst View = TamaguiView;\nfunction mergeRefs(...refs) {\n return (node) => {\n for (const ref of refs) {\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n const target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n const timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles(...inputs) {\n const style = {};\n const classNames = [];\n const walk = (s) => {\n if (!s) return;\n if (Array.isArray(s)) {\n for (const item of s) walk(item);\n return;\n }\n if (s.$$css) {\n for (const k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n for (const input of inputs) walk(input);\n return { style, className: classNames.join(\" \") };\n}\nfunction joinClassNames(...parts) {\n const joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nconst commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nconst styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nconst WebScrollView = React.forwardRef(\n (props, forwardedRef) => {\n const {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n const { dataSet, ...domRest } = rest;\n const dataAttrs = {};\n if (dataSet) {\n for (const key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n const scrollNodeRef = React.useRef(null);\n const innerViewRef = React.useRef(null);\n const scrollState = React.useRef({ isScrolling: false, scrollLastTick: 0 });\n const scrollTimeout = React.useRef(null);\n const scrollTo = (options) => {\n const node = scrollNodeRef.current;\n if (node == null) return;\n const { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({ top: y, left: x, behavior: animated ? \"smooth\" : \"auto\" });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n const scrollToEnd = (options) => {\n const node = scrollNodeRef.current;\n if (node == null) return;\n const animated = (options && options.animated) !== false;\n const x = horizontal ? node.scrollWidth : 0;\n const y = horizontal ? 0 : node.scrollHeight;\n scrollTo({ x, y, animated });\n };\n const setScrollNodeRef = React.useCallback(\n (node) => {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = () => node;\n node.getScrollableNode = () => node;\n node.getInnerViewNode = () => innerViewRef.current;\n node.getInnerViewRef = () => innerViewRef.current;\n node.getNativeScrollRef = () => node;\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = () => {\n };\n }\n mergeRefs(forwardedRef)(node);\n },\n [forwardedRef, horizontal]\n );\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(() => {\n scrollState.current.isScrolling = false;\n onScroll?.(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll?.(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll?.(normalizeScrollEvent(e));\n }\n }\n const handleContentLayout = onContentSizeChange ? (e) => {\n const { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n const hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n const renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, (child, i) => {\n const isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n const resolved = resolveStyles(\n isSticky && styles.stickyHeader,\n pagingEnabled && styles.pagingEnabledChild\n );\n return /* @__PURE__ */ jsx(\n View,\n {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n }\n );\n }\n return child;\n }) : children;\n const contentResolved = resolveStyles(\n horizontal && styles.contentContainerHorizontal,\n centerContent && styles.contentContainerCenterContent,\n contentContainerStyle\n );\n const contentContainer = /* @__PURE__ */ jsx(\n View,\n {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n }\n );\n const baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n const pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n const hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n const hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n const extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n const scrollResolved = resolveStyles(\n baseStyle,\n pagingEnabled && pagingEnabledStyle,\n style,\n !scrollEnabled && styles.scrollDisabled\n );\n const scrollView = /* @__PURE__ */ jsx(\n View,\n {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(\n domRest.className,\n scrollResolved.className,\n extraClassName\n ),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n }\n );\n if (refreshControl) {\n const refreshResolved = resolveStyles(baseStyle, style);\n return React.cloneElement(\n refreshControl,\n {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n },\n scrollView\n );\n }\n return scrollView;\n }\n);\nWebScrollView.displayName = \"ScrollView\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AAC,iBAAiB,OAAO,cAC3B;CACA,MAAM,aAA6B,oBACjCA,QACA;EACE,GAAG;EACH,GAAG;EACH,WAAW,eACT,QAAQ,WACR,eAAe,WACf,cACF;EACA,KAAK;EACL,UAAU;EACV,OAAO,eAAe;EACtB,UAAU;CACZ,CACF;CACA,IAAI,gBAAgB;EAClB,MAAM,kBAAkB,cAAc,WAAW,KAAK;EACtD,OAAO,MAAM,aACX,gBACA;GACE,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GACA,UACF;CACF;CACA,OAAO;AACT,CACF;AACA,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"WebScrollView.js","names":["View","TamaguiView"],"sources":["jsx/WebScrollView.js"],"sourcesContent":["import { View as TamaguiView } from \"@tamagui/web\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nconst View = TamaguiView;\nfunction mergeRefs(...refs) {\n return (node) => {\n for (const ref of refs) {\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n const target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n const timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles(...inputs) {\n const style = {};\n const classNames = [];\n const walk = (s) => {\n if (!s) return;\n if (Array.isArray(s)) {\n for (const item of s) walk(item);\n return;\n }\n if (s.$$css) {\n for (const k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n for (const input of inputs) walk(input);\n return { style, className: classNames.join(\" \") };\n}\nfunction joinClassNames(...parts) {\n const joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nconst commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nconst styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nconst WebScrollView = React.forwardRef(\n (props, forwardedRef) => {\n const {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n const { dataSet, ...domRest } = rest;\n const dataAttrs = {};\n if (dataSet) {\n for (const key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n const scrollNodeRef = React.useRef(null);\n const innerViewRef = React.useRef(null);\n const scrollState = React.useRef({ isScrolling: false, scrollLastTick: 0 });\n const scrollTimeout = React.useRef(null);\n const scrollTo = (options) => {\n const node = scrollNodeRef.current;\n if (node == null) return;\n const { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({ top: y, left: x, behavior: animated ? \"smooth\" : \"auto\" });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n const scrollToEnd = (options) => {\n const node = scrollNodeRef.current;\n if (node == null) return;\n const animated = (options && options.animated) !== false;\n const x = horizontal ? node.scrollWidth : 0;\n const y = horizontal ? 0 : node.scrollHeight;\n scrollTo({ x, y, animated });\n };\n const setScrollNodeRef = React.useCallback(\n (node) => {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = () => node;\n node.getScrollableNode = () => node;\n node.getInnerViewNode = () => innerViewRef.current;\n node.getInnerViewRef = () => innerViewRef.current;\n node.getNativeScrollRef = () => node;\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = () => {\n };\n }\n mergeRefs(forwardedRef)(node);\n },\n [forwardedRef, horizontal]\n );\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(() => {\n scrollState.current.isScrolling = false;\n onScroll?.(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll?.(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll?.(normalizeScrollEvent(e));\n }\n }\n const handleContentLayout = onContentSizeChange ? (e) => {\n const { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n const hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n const renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, (child, i) => {\n const isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n const resolved = resolveStyles(\n isSticky && styles.stickyHeader,\n pagingEnabled && styles.pagingEnabledChild\n );\n return /* @__PURE__ */ jsx(\n View,\n {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n }\n );\n }\n return child;\n }) : children;\n const contentResolved = resolveStyles(\n horizontal && styles.contentContainerHorizontal,\n centerContent && styles.contentContainerCenterContent,\n contentContainerStyle\n );\n const contentContainer = /* @__PURE__ */ jsx(\n View,\n {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n }\n );\n const baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n const pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n const hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n const hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n const extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n const scrollResolved = resolveStyles(\n baseStyle,\n pagingEnabled && pagingEnabledStyle,\n style,\n !scrollEnabled && styles.scrollDisabled\n );\n const scrollView = /* @__PURE__ */ jsx(\n View,\n {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(\n domRest.className,\n scrollResolved.className,\n extraClassName\n ),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n }\n );\n if (refreshControl) {\n const refreshResolved = resolveStyles(baseStyle, style);\n return React.cloneElement(\n refreshControl,\n {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n },\n scrollView\n );\n }\n return scrollView;\n }\n);\nWebScrollView.displayName = \"ScrollView\";\nexport {\n WebScrollView\n};\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;;;AAGA,MAAMA,SAAOC;AACb,SAAS,UAAU,GAAG,MAAM;CAC1B,QAAQ,SAAS;EACf,KAAK,MAAM,OAAO,MAAM;GACtB,IAAI,CAAC,KAAK;GACV,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;QAClC,IAAI,UAAU;EACrB;CACF;AACF;AACA,SAAS,qBAAqB,GAAG;CAC/B,MAAM,SAAS,EAAE;CACjB,OAAO;EACL,aAAa;GACX,eAAe;IACb,IAAI,IAAI;KACN,OAAO,OAAO;IAChB;IACA,IAAI,IAAI;KACN,OAAO,OAAO;IAChB;GACF;GACA,aAAa;IACX,IAAI,SAAS;KACX,OAAO,OAAO;IAChB;IACA,IAAI,QAAQ;KACV,OAAO,OAAO;IAChB;GACF;GACA,mBAAmB;IACjB,IAAI,SAAS;KACX,OAAO,OAAO;IAChB;IACA,IAAI,QAAQ;KACV,OAAO,OAAO;IAChB;GACF;EACF;EACA,WAAW,KAAK,IAAI;CACtB;AACF;AACA,SAAS,sBAAsB,UAAU,eAAe;CACtD,MAAM,oBAAoB,KAAK,IAAI,IAAI;CACvC,OAAO,gBAAgB,KAAK,qBAAqB;AACnD;AACA,SAAS,cAAc,GAAG,QAAQ;CAChC,MAAM,QAAQ,CAAC;CACf,MAAM,aAAa,CAAC;CACpB,MAAM,QAAQ,MAAM;EAClB,IAAI,CAAC,GAAG;EACR,IAAI,MAAM,QAAQ,CAAC,GAAG;GACpB,KAAK,MAAM,QAAQ,GAAG,KAAK,IAAI;GAC/B;EACF;EACA,IAAI,EAAE,OAAO;GAC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BAAiB,OAAO;CAC9D,MAAM,qBAAqB,aAAa,OAAO,0BAA0B,OAAO;CAChF,MAAM,0BAA0B,mCAAmC;CACnE,MAAM,wBAAwB,iCAAiC;CAC/D,MAAM,kBAAkB,0BAA0B,YAAY,OAAO,wBAAwB,YAAY;CACzG,MAAM,iBAAiB,cACrB,WACA,iBAAiB,oBACjB,OACA,CAAC,iBAAiB,OAAO,cAC3B;CACA,MAAM,aAA6B,oBACjCA,QACA;EACE,GAAG;EACH,GAAG;EACH,WAAW,eACT,QAAQ,WACR,eAAe,WACf,cACF;EACA,KAAK;EACL,UAAU;EACV,OAAO,eAAe;EACtB,UAAU;CACZ,CACF;CACA,IAAI,gBAAgB;EAClB,MAAM,kBAAkB,cAAc,WAAW,KAAK;EACtD,OAAO,MAAM,aACX,gBACA;GACE,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GACA,UACF;CACF;CACA,OAAO;AACT,CACF;AACA,cAAc,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebScrollView.native.js","names":[],"sources":["jsx/WebScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar WebScrollView_exports = {};\n__export(WebScrollView_exports, {\n WebScrollView: () => WebScrollView\n});\nmodule.exports = __toCommonJS(WebScrollView_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar View = import_web.View;\nfunction mergeRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n return function(node) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = refs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var ref = _step.value;\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n var target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n var timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles() {\n for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {\n inputs[_key] = arguments[_key];\n }\n var style = {};\n var classNames = [];\n var walk = function(s) {\n if (!s) return;\n if (Array.isArray(s)) {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = s[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var item = _step2.value;\n walk(item);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return;\n }\n if (s.$$css) {\n for (var k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = inputs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var input = _step.value;\n walk(input);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return {\n style,\n className: classNames.join(\" \")\n };\n}\nfunction joinClassNames() {\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n var joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nvar commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nvar styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nvar WebScrollView = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {\n var {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n var { dataSet, ...domRest } = rest;\n var dataAttrs = {};\n if (dataSet) {\n for (var key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n var scrollNodeRef = React.useRef(null);\n var innerViewRef = React.useRef(null);\n var scrollState = React.useRef({\n isScrolling: false,\n scrollLastTick: 0\n });\n var scrollTimeout = React.useRef(null);\n var scrollTo = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({\n top: y,\n left: x,\n behavior: animated ? \"smooth\" : \"auto\"\n });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n var scrollToEnd = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var animated = (options && options.animated) !== false;\n var x = horizontal ? node.scrollWidth : 0;\n var y = horizontal ? 0 : node.scrollHeight;\n scrollTo({\n x,\n y,\n animated\n });\n };\n var setScrollNodeRef = React.useCallback(function(node) {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = function() {\n return node;\n };\n node.getScrollableNode = function() {\n return node;\n };\n node.getInnerViewNode = function() {\n return innerViewRef.current;\n };\n node.getInnerViewRef = function() {\n return innerViewRef.current;\n };\n node.getNativeScrollRef = function() {\n return node;\n };\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = function() {\n };\n }\n mergeRefs(forwardedRef)(node);\n }, [\n forwardedRef,\n horizontal\n ]);\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(function() {\n scrollState.current.isScrolling = false;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n }\n var handleContentLayout = onContentSizeChange ? function(e) {\n var { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n var renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, function(child, i) {\n var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n var resolved = resolveStyles(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n });\n }\n return child;\n }) : children;\n var contentResolved = resolveStyles(horizontal && styles.contentContainerHorizontal, centerContent && styles.contentContainerCenterContent, contentContainerStyle);\n var contentContainer = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n });\n var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n var hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n var hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n var extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n var scrollResolved = resolveStyles(baseStyle, pagingEnabled && pagingEnabledStyle, style, !scrollEnabled && styles.scrollDisabled);\n var scrollView = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(domRest.className, scrollResolved.className, extraClassName),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n });\n if (refreshControl) {\n var refreshResolved = resolveStyles(baseStyle, style);\n return /* @__PURE__ */ React.cloneElement(refreshControl, {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n }, scrollView);\n }\n return scrollView;\n});\nWebScrollView.displayName = \"ScrollView\";\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,wBAAwB,CAAC;AAC7B,SAAS,uBAAuB,EAC9B,qBAAqB,cACvB,CAAC;AACD,OAAO,UAAU,aAAa,qBAAqB;AACnD,IAAI,qBAAqB,QAAQ,mBAAmB;AACpD,IAAI,aAAa,QAAQ,cA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AW,eAAe,SAAS,SAAS;IAC5C,UAAU;GACZ,CAAC;EACH;EACA,OAAO;CACT,CAAC,IAAI;CACL,IAAI,kBAAkB,cAAc,cAAc,OAAO,4BAA4B,iBAAiB,OAAO,+BAA+B,qBAAqB;CACjK,IAAI,mBAAmC,iBAAC,GAAG,mBAAmB,KAAK,MAAM;EACvE,KAAK;EACL,UAAU;EACV,OAAO,gBAAgB;EACvB,WAAW,eAAe,gBAAgB,SAAS;EACnD,UAAU;CACZ,CAAC;CACD,IAAI,YAAY,aAAa,OAAO,iBAAiB,OAAO;CAC5D,IAAI,qBAAqB,aAAa,OAAO,0BAA0B,OAAO;CAC9E,IAAI,0BAA0B,mCAAmC;CACjE,IAAI,wBAAwB,iCAAiC;CAC7D,IAAI,kBAAkB,0BAA0B,YAAY,OAAO,wBAAwB,YAAY;CACvG,IAAI,iBAAiB,cAAc,WAAW,iBAAiB,oBAAoB,OAAO,CAAC,iBAAiB,OAAO,cAAc;CACjI,IAAI,aAA6B,iBAAC,GAAG,mBAAmB,KAAK,MAAM;EACjE,GAAG;EACH,GAAG;EACH,WAAW,eAAe,QAAQ,WAAW,eAAe,WAAW,cAAc;EACrF,KAAK;EACL,UAAU;EACV,OAAO,eAAe;EACtB,UAAU;CACZ,CAAC;CACD,IAAI,gBAAgB;EAClB,IAAI,kBAAkB,cAAc,WAAW,KAAK;EACpD,OAAuB,sBAAM,aAAa,gBAAgB;GACxD,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GAAG,UAAU;CACf;CACA,OAAO;AACT,CAAC;AACD,cAAc,cAAc"}
|
|
1
|
+
{"version":3,"file":"WebScrollView.native.js","names":[],"sources":["jsx/WebScrollView.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar WebScrollView_exports = {};\n__export(WebScrollView_exports, {\n WebScrollView: () => WebScrollView\n});\nmodule.exports = __toCommonJS(WebScrollView_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_web = require(\"@tamagui/web\");\nvar React = __toESM(require(\"react\"), 1);\nvar View = import_web.View;\nfunction mergeRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n return function(node) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = refs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var ref = _step.value;\n if (!ref) continue;\n if (typeof ref === \"function\") ref(node);\n else ref.current = node;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n };\n}\nfunction normalizeScrollEvent(e) {\n var target = e.target;\n return {\n nativeEvent: {\n contentOffset: {\n get x() {\n return target.scrollLeft;\n },\n get y() {\n return target.scrollTop;\n }\n },\n contentSize: {\n get height() {\n return target.scrollHeight;\n },\n get width() {\n return target.scrollWidth;\n }\n },\n layoutMeasurement: {\n get height() {\n return target.offsetHeight;\n },\n get width() {\n return target.offsetWidth;\n }\n }\n },\n timeStamp: Date.now()\n };\n}\nfunction shouldEmitScrollEvent(lastTick, eventThrottle) {\n var timeSinceLastTick = Date.now() - lastTick;\n return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\nfunction resolveStyles() {\n for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {\n inputs[_key] = arguments[_key];\n }\n var style = {};\n var classNames = [];\n var walk = function(s) {\n if (!s) return;\n if (Array.isArray(s)) {\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = s[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var item = _step2.value;\n walk(item);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return;\n }\n if (s.$$css) {\n for (var k in s) {\n if (k !== \"$$css\") classNames.push(s[k]);\n }\n } else {\n Object.assign(style, s);\n }\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = inputs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var input = _step.value;\n walk(input);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return {\n style,\n className: classNames.join(\" \")\n };\n}\nfunction joinClassNames() {\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n var joined = parts.filter(Boolean).join(\" \").trim();\n return joined || void 0;\n}\nvar commonStyle = {\n flexGrow: 1,\n flexShrink: 1\n};\nvar styles = {\n baseVertical: {\n ...commonStyle,\n flexDirection: \"column\",\n overflowX: \"hidden\",\n overflowY: \"auto\"\n },\n baseHorizontal: {\n ...commonStyle,\n flexDirection: \"row\",\n overflowX: \"auto\",\n overflowY: \"hidden\"\n },\n contentContainerHorizontal: {\n flexDirection: \"row\"\n },\n contentContainerCenterContent: {\n justifyContent: \"center\",\n flexGrow: 1\n },\n stickyHeader: {\n position: \"sticky\",\n top: 0,\n zIndex: 10\n },\n pagingEnabledHorizontal: {\n scrollSnapType: \"x mandatory\"\n },\n pagingEnabledVertical: {\n scrollSnapType: \"y mandatory\"\n },\n pagingEnabledChild: {\n scrollSnapAlign: \"start\"\n },\n scrollDisabled: {\n overflowX: \"hidden\",\n overflowY: \"hidden\",\n touchAction: \"none\"\n }\n};\nvar WebScrollView = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {\n var {\n children,\n contentContainerStyle,\n horizontal,\n onContentSizeChange,\n onScroll,\n refreshControl,\n stickyHeaderIndices,\n pagingEnabled,\n centerContent,\n scrollEnabled = true,\n scrollEventThrottle = 0,\n showsHorizontalScrollIndicator,\n showsVerticalScrollIndicator,\n style,\n // strip react-native-only props that shouldn't reach the DOM\n keyboardShouldPersistTaps,\n keyboardDismissMode,\n contentOffset,\n contentInset,\n contentInsetAdjustmentBehavior,\n decelerationRate,\n directionalLockEnabled,\n disableIntervalMomentum,\n disableScrollViewPanResponder,\n endFillColor,\n fadingEdgeLength,\n indicatorStyle,\n invertStickyHeaders,\n maintainVisibleContentPosition,\n maximumZoomScale,\n minimumZoomScale,\n nestedScrollEnabled,\n onScrollToTop,\n overScrollMode,\n pinchGestureEnabled,\n removeClippedSubviews,\n scrollIndicatorInsets,\n scrollPerfTag,\n scrollToOverflowEnabled,\n snapToAlignment,\n snapToEnd,\n snapToInterval,\n snapToOffsets,\n snapToStart,\n bounces,\n ...rest\n } = props;\n var { dataSet, ...domRest } = rest;\n var dataAttrs = {};\n if (dataSet) {\n for (var key in dataSet) {\n dataAttrs[`data-${key}`] = dataSet[key];\n }\n }\n var scrollNodeRef = React.useRef(null);\n var innerViewRef = React.useRef(null);\n var scrollState = React.useRef({\n isScrolling: false,\n scrollLastTick: 0\n });\n var scrollTimeout = React.useRef(null);\n var scrollTo = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var { x = 0, y = 0, animated = true } = options || {};\n if (typeof node.scroll === \"function\") {\n node.scroll({\n top: y,\n left: x,\n behavior: animated ? \"smooth\" : \"auto\"\n });\n } else {\n node.scrollLeft = x;\n node.scrollTop = y;\n }\n };\n var scrollToEnd = function(options) {\n var node = scrollNodeRef.current;\n if (node == null) return;\n var animated = (options && options.animated) !== false;\n var x = horizontal ? node.scrollWidth : 0;\n var y = horizontal ? 0 : node.scrollHeight;\n scrollTo({\n x,\n y,\n animated\n });\n };\n var setScrollNodeRef = React.useCallback(function(node) {\n scrollNodeRef.current = node;\n if (node != null) {\n node.getScrollResponder = function() {\n return node;\n };\n node.getScrollableNode = function() {\n return node;\n };\n node.getInnerViewNode = function() {\n return innerViewRef.current;\n };\n node.getInnerViewRef = function() {\n return innerViewRef.current;\n };\n node.getNativeScrollRef = function() {\n return node;\n };\n node.scrollTo = scrollTo;\n node.scrollToEnd = scrollToEnd;\n node.flashScrollIndicators = function() {\n };\n }\n mergeRefs(forwardedRef)(node);\n }, [\n forwardedRef,\n horizontal\n ]);\n function handleScroll(e) {\n e.stopPropagation();\n if (e.target !== scrollNodeRef.current) return;\n if (scrollTimeout.current != null) {\n clearTimeout(scrollTimeout.current);\n }\n scrollTimeout.current = setTimeout(function() {\n scrollState.current.isScrolling = false;\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }, 100);\n if (scrollState.current.isScrolling) {\n if (shouldEmitScrollEvent(scrollState.current.scrollLastTick, scrollEventThrottle)) {\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n } else {\n scrollState.current.isScrolling = true;\n scrollState.current.scrollLastTick = Date.now();\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(normalizeScrollEvent(e));\n }\n }\n var handleContentLayout = onContentSizeChange ? function(e) {\n var { width, height } = e.nativeEvent.layout;\n onContentSizeChange(width, height);\n } : void 0;\n var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);\n var renderedChildren = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(children, function(child, i) {\n var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n if (child != null && (isSticky || pagingEnabled)) {\n var resolved = resolveStyles(isSticky && styles.stickyHeader, pagingEnabled && styles.pagingEnabledChild);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n style: resolved.style,\n className: joinClassNames(resolved.className),\n children: child\n });\n }\n return child;\n }) : children;\n var contentResolved = resolveStyles(horizontal && styles.contentContainerHorizontal, centerContent && styles.contentContainerCenterContent, contentContainerStyle);\n var contentContainer = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n ref: innerViewRef,\n onLayout: handleContentLayout,\n style: contentResolved.style,\n className: joinClassNames(contentResolved.className),\n children: renderedChildren\n });\n var baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n var pagingEnabledStyle = horizontal ? styles.pagingEnabledHorizontal : styles.pagingEnabledVertical;\n var hideHorizontalScrollbar = showsHorizontalScrollIndicator === false;\n var hideVerticalScrollbar = showsVerticalScrollIndicator === false;\n var extraClassName = (hideHorizontalScrollbar ? \" _hsb-x\" : \"\") + (hideVerticalScrollbar ? \" _hsb-y\" : \"\");\n var scrollResolved = resolveStyles(baseStyle, pagingEnabled && pagingEnabledStyle, style, !scrollEnabled && styles.scrollDisabled);\n var scrollView = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(View, {\n ...domRest,\n ...dataAttrs,\n className: joinClassNames(domRest.className, scrollResolved.className, extraClassName),\n ref: setScrollNodeRef,\n onScroll: handleScroll,\n style: scrollResolved.style,\n children: contentContainer\n });\n if (refreshControl) {\n var refreshResolved = resolveStyles(baseStyle, style);\n return /* @__PURE__ */ React.cloneElement(refreshControl, {\n style: refreshResolved.style,\n className: joinClassNames(refreshResolved.className)\n }, scrollView);\n }\n return scrollView;\n});\nWebScrollView.displayName = \"ScrollView\";\n//# sourceMappingURL=WebScrollView.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC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AAgB;EAClB,IAAI,kBAAkB,cAAc,WAAW,KAAK;EACpD,OAAuB,sBAAM,aAAa,gBAAgB;GACxD,OAAO,gBAAgB;GACvB,WAAW,eAAe,gBAAgB,SAAS;EACrD,GAAG,UAAU;CACf;CACA,OAAO;AACT,CAAC;AACD,cAAc,cAAc"}
|
package/dist/jsx/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":[],"sources":["jsx/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./ScrollView\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.js","names":[],"sources":["jsx/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./ScrollView\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,wBAAc,GAAG,OAAO,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/scroll-view",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.728.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"clean:build": "tamagui-build clean:build"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@tamagui/web": "3.0.0-beta.
|
|
46
|
+
"@tamagui/web": "3.0.0-beta.728.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@tamagui/build": "3.0.0-beta.
|
|
50
|
-
"react": "
|
|
49
|
+
"@tamagui/build": "3.0.0-beta.728.1",
|
|
50
|
+
"react": "19.2.3",
|
|
51
51
|
"react-native": "0.86.2"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|