@draftbit/core 50.2.4-573471.2 → 50.2.4-d4510d.2
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/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/SectionList/SectionList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlashList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableList.js +1 -1
- package/lib/commonjs/utilities.js +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js +1 -12
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/typescript/src/components/SectionList/SectionList.d.ts +2 -2
- package/lib/typescript/src/components/SectionList/SectionList.js +1 -1
- package/lib/typescript/src/components/SectionList/SectionList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.d.ts +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.d.ts +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.d.ts +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.d.ts +1 -0
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +47 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.d.ts +2 -2
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.js +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.js.map +1 -1
- package/lib/typescript/src/utilities.d.ts +1 -0
- package/lib/typescript/src/utilities.js +11 -0
- package/lib/typescript/src/utilities.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/BottomSheet/BottomSheet.js +1 -12
- package/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/src/components/BottomSheet/BottomSheet.tsx +1 -13
- package/src/components/SectionList/SectionList.js +1 -1
- package/src/components/SectionList/SectionList.js.map +1 -1
- package/src/components/SectionList/SectionList.tsx +3 -4
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +2 -2
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx +2 -2
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx +2 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +2 -2
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx +2 -2
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx +1 -1
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +47 -2
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +1 -1
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.ts +55 -2
- package/src/components/SwipeableItem/SwipeableList.js +1 -1
- package/src/components/SwipeableItem/SwipeableList.js.map +1 -1
- package/src/components/SwipeableItem/SwipeableList.tsx +3 -4
- package/src/utilities.js +11 -0
- package/src/utilities.js.map +1 -1
- package/src/utilities.ts +12 -0
- package/lib/commonjs/components/FlatList.js +0 -1
- package/lib/typescript/src/components/FlatList.d.ts +0 -5
- package/lib/typescript/src/components/FlatList.js +0 -7
- package/lib/typescript/src/components/FlatList.js.map +0 -1
- package/src/components/FlatList.js +0 -7
- package/src/components/FlatList.js.map +0 -1
- package/src/components/FlatList.tsx +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["snapPoints","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","topBorderRadius","borderWidth","borderColor","onSettle","style","children"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/BottomSheet/BottomSheet.tsx";import React from"react";import{StyleSheet,Dimensions}from"react-native";import BottomSheetComponent,{BottomSheetScrollView}from"@gorhom/bottom-sheet";import{useTheme}from"@draftbit/theme";import{useDeepCompareMemo}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";var windowHeight=Dimensions.get("window").height;var BottomSheet=React.forwardRef(function(_ref,ref){var snapPointsProp=_ref.snapPoints,_ref$topSnapPosition=_ref.topSnapPosition,topSnapPosition=_ref$topSnapPosition===void 0?"10%":_ref$topSnapPosition,_ref$middleSnapPositi=_ref.middleSnapPosition,middleSnapPosition=_ref$middleSnapPositi===void 0?"50%":_ref$middleSnapPositi,_ref$bottomSnapPositi=_ref.bottomSnapPosition,bottomSnapPosition=_ref$bottomSnapPositi===void 0?"80%":_ref$bottomSnapPositi,initialSnapIndex=_ref.initialSnapIndex,_ref$initialSnapPosit=_ref.initialSnapPosition,initialSnapPosition=_ref$initialSnapPosit===void 0?"bottom":_ref$initialSnapPosit,_ref$showHandle=_ref.showHandle,showHandle=_ref$showHandle===void 0?true:_ref$showHandle,handleColor=_ref.handleColor,_ref$topBorderRadius=_ref.topBorderRadius,topBorderRadius=_ref$topBorderRadius===void 0?20:_ref$topBorderRadius,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,borderColor=_ref.borderColor,onSettle=_ref.onSettle,style=_ref.style,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var theme=useTheme();var backgroundColor=(style==null?void 0:style.backgroundColor)||theme.colors.background.brand;var snapPoints=snapPointsProp!=null?snapPointsProp:[topSnapPosition,middleSnapPosition,bottomSnapPosition];var mappedSnapPoints=useDeepCompareMemo(function(){return convertSnapPointsForNewImplementation(snapPoints);},snapPoints);var getSnapIndexFromPosition=function getSnapIndexFromPosition(position){switch(position){case"bottom":return 0;case"middle":return 1;case"top":return 2;}};return _jsx(BottomSheetComponent,{ref:ref,snapPoints:mappedSnapPoints,index:initialSnapIndex!==undefined?mappedSnapPoints.length-initialSnapIndex-1:getSnapIndexFromPosition(initialSnapPosition),handleIndicatorStyle:[{backgroundColor:handleColor!=null?handleColor:theme.colors.border.brand},!showHandle?{display:"none"}:{}],backgroundStyle:{backgroundColor:backgroundColor,borderTopLeftRadius:topBorderRadius,borderTopRightRadius:topBorderRadius,borderWidth:borderWidth,borderColor:borderColor!=null?borderColor:theme.colors.border.brand},onChange:function onChange(index){return onSettle==null?void 0:onSettle(mappedSnapPoints.length-index-1);},children:_jsx(BottomSheetScrollView,Object.assign({contentContainerStyle:[styles.contentContainerStyle,style]},rest,{children:children}))});});function convertSnapPointsForNewImplementation(snapPoints){var reversedSnapPoints=_toConsumableArray(snapPoints).reverse();return reversedSnapPoints.map(function(point){if(typeof point==="string"){var percentNumber=extractPercentNumber(point);if(percentNumber!==undefined){return`${100-percentNumber}%`;}return point;}else if(typeof point==="number"){return windowHeight-point;}else{return point;}});}
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["snapPoints","topSnapPosition","middleSnapPosition","bottomSnapPosition","initialSnapIndex","initialSnapPosition","showHandle","handleColor","topBorderRadius","borderWidth","borderColor","onSettle","style","children"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/BottomSheet/BottomSheet.tsx";import React from"react";import{StyleSheet,Dimensions}from"react-native";import BottomSheetComponent,{BottomSheetScrollView}from"@gorhom/bottom-sheet";import{useTheme}from"@draftbit/theme";import{extractPercentNumber,useDeepCompareMemo}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";var windowHeight=Dimensions.get("window").height;var BottomSheet=React.forwardRef(function(_ref,ref){var snapPointsProp=_ref.snapPoints,_ref$topSnapPosition=_ref.topSnapPosition,topSnapPosition=_ref$topSnapPosition===void 0?"10%":_ref$topSnapPosition,_ref$middleSnapPositi=_ref.middleSnapPosition,middleSnapPosition=_ref$middleSnapPositi===void 0?"50%":_ref$middleSnapPositi,_ref$bottomSnapPositi=_ref.bottomSnapPosition,bottomSnapPosition=_ref$bottomSnapPositi===void 0?"80%":_ref$bottomSnapPositi,initialSnapIndex=_ref.initialSnapIndex,_ref$initialSnapPosit=_ref.initialSnapPosition,initialSnapPosition=_ref$initialSnapPosit===void 0?"bottom":_ref$initialSnapPosit,_ref$showHandle=_ref.showHandle,showHandle=_ref$showHandle===void 0?true:_ref$showHandle,handleColor=_ref.handleColor,_ref$topBorderRadius=_ref.topBorderRadius,topBorderRadius=_ref$topBorderRadius===void 0?20:_ref$topBorderRadius,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,borderColor=_ref.borderColor,onSettle=_ref.onSettle,style=_ref.style,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var theme=useTheme();var backgroundColor=(style==null?void 0:style.backgroundColor)||theme.colors.background.brand;var snapPoints=snapPointsProp!=null?snapPointsProp:[topSnapPosition,middleSnapPosition,bottomSnapPosition];var mappedSnapPoints=useDeepCompareMemo(function(){return convertSnapPointsForNewImplementation(snapPoints);},snapPoints);var getSnapIndexFromPosition=function getSnapIndexFromPosition(position){switch(position){case"bottom":return 0;case"middle":return 1;case"top":return 2;}};return _jsx(BottomSheetComponent,{ref:ref,snapPoints:mappedSnapPoints,index:initialSnapIndex!==undefined?mappedSnapPoints.length-initialSnapIndex-1:getSnapIndexFromPosition(initialSnapPosition),handleIndicatorStyle:[{backgroundColor:handleColor!=null?handleColor:theme.colors.border.brand},!showHandle?{display:"none"}:{}],backgroundStyle:{backgroundColor:backgroundColor,borderTopLeftRadius:topBorderRadius,borderTopRightRadius:topBorderRadius,borderWidth:borderWidth,borderColor:borderColor!=null?borderColor:theme.colors.border.brand},onChange:function onChange(index){return onSettle==null?void 0:onSettle(mappedSnapPoints.length-index-1);},children:_jsx(BottomSheetScrollView,Object.assign({contentContainerStyle:[styles.contentContainerStyle,style]},rest,{children:children}))});});function convertSnapPointsForNewImplementation(snapPoints){var reversedSnapPoints=_toConsumableArray(snapPoints).reverse();return reversedSnapPoints.map(function(point){if(typeof point==="string"){var percentNumber=extractPercentNumber(point);if(percentNumber!==undefined){return`${100-percentNumber}%`;}return point;}else if(typeof point==="number"){return windowHeight-point;}else{return point;}});}var styles=StyleSheet.create({contentContainerStyle:{paddingHorizontal:16,paddingVertical:10}});export default BottomSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["sectionKey","stickyHeader","listComponent","data","renderItem","keyExtractor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SectionList/SectionList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import SectionHeader,{DefaultSectionHeader}from"./SectionHeader";import{flattenReactFragments}from"../../utilities";import
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["sectionKey","stickyHeader","listComponent","data","renderItem","keyExtractor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SectionList/SectionList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import{FlatList}from"react-native";import SectionHeader,{DefaultSectionHeader}from"./SectionHeader";import{flattenReactFragments}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";export var DEFAULT_SECTION="Uncategorized";var SectionList=React.forwardRef(function(_ref,ref){var sectionKey=_ref.sectionKey,_ref$stickyHeader=_ref.stickyHeader,stickyHeader=_ref$stickyHeader===void 0?false:_ref$stickyHeader,_ref$listComponent=_ref.listComponent,listComponent=_ref$listComponent===void 0?"FlatList":_ref$listComponent,dataProp=_ref.data,renderItemProp=_ref.renderItem,keyExtractorProp=_ref.keyExtractor,rest=_objectWithoutProperties(_ref,_excluded);var data=React.useMemo(function(){return Array.isArray(dataProp)?dataProp:[];},[dataProp]);var dataWithSections=React.useMemo(function(){var result=[];var sectionDataItems={};for(var _item of data){var _item$sectionKey;var section=((_item$sectionKey=_item[sectionKey])==null?void 0:_item$sectionKey.toString())||DEFAULT_SECTION;if(sectionDataItems[section]){sectionDataItems[section].push(_item);}else{sectionDataItems[section]=[_item];}}for(var _section in sectionDataItems){result.push({type:"SECTION_ITEM",title:_section});var sectionItems=sectionDataItems[_section].map(function(item){return{type:"DATA_ITEM",data:item};});result.push.apply(result,_toConsumableArray(sectionItems));}return result;},[data,sectionKey]);var sectionHeaderIndicies=React.useMemo(function(){return stickyHeader?dataWithSections.filter(function(item){return item.type==="SECTION_ITEM";}).map(function(item){return dataWithSections.indexOf(item);}):undefined;},[dataWithSections,stickyHeader]);var extractSectionHeader=function extractSectionHeader(element){if(!element){return null;}var props=element.props||{};var children=flattenReactFragments(React.Children.toArray(props.children));if(element.type===SectionHeader){return element;}else{for(var child of children){if(child.type===SectionHeader){return child;}}}return null;};var extractRemainingNonSectionHeader=function extractRemainingNonSectionHeader(element){if(!element){return null;}var props=element.props||{};var children=flattenReactFragments(React.Children.toArray(props.children));if(element.type===SectionHeader){return null;}else{var newChildren=[];for(var child of children){if(child.type!==SectionHeader){newChildren.push(child);}}return React.cloneElement(element,Object.assign({},props,{children:newChildren}));}};var renderItem=function renderItem(_ref2){var item=_ref2.item,index=_ref2.index;switch(item.type){case"SECTION_ITEM":{var renderedItem=renderItemProp({index:index,section:item.title});return extractSectionHeader(renderedItem)||_jsx(DefaultSectionHeader,{title:item.title});}case"DATA_ITEM":{var _renderedItem=renderItemProp({item:item.data,index:index,section:item.data[sectionKey]||DEFAULT_SECTION});return extractRemainingNonSectionHeader(_renderedItem);}}};var keyExtractor=function keyExtractor(item,index){switch(item.type){case"SECTION_ITEM":{return`section_${index.toString()}`;}case"DATA_ITEM":{return(keyExtractorProp==null?void 0:keyExtractorProp(item.data,index))||index.toString();}}};switch(listComponent){case"FlatList":return _jsx(FlatList,Object.assign({ref:ref,stickyHeaderIndices:sectionHeaderIndicies},rest,{data:dataWithSections,renderItem:renderItem,keyExtractor:keyExtractor}));case"FlashList":return _jsx(FlashList,Object.assign({ref:ref,stickyHeaderIndices:sectionHeaderIndicies},rest,{data:dataWithSections,renderItem:renderItem,keyExtractor:keyExtractor}));}});export default SectionList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import{useFlashListSplitContentContainerStyles}from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleFlashList=React.forwardRef(function(_ref,ref){var styleProp=_ref.style,data=_ref.data,rest=_objectWithoutProperties(_ref,_excluded);var _useFlashListSplitCon=useFlashListSplitContentContainerStyles(styleProp),style=_useFlashListSplitCon.style,contentContainerStyle=_useFlashListSplitCon.contentContainerStyle;return _jsx(FlashList,Object.assign({ref:ref,style:style,contentContainerStyle:contentContainerStyle,data:data},rest));});export default SimpleStyleFlashList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx";import React from"react";import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx";import React from"react";import{FlatList}from"react-native";import useSplitContentContainerStyles from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleFlatList=React.forwardRef(function(_ref,ref){var styleProp=_ref.style,data=_ref.data,rest=_objectWithoutProperties(_ref,_excluded);var _useSplitContentConta=useSplitContentContainerStyles(styleProp),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;return _jsx(FlatList,Object.assign({ref:ref,style:style,contentContainerStyle:contentContainerStyle,data:data},rest));});export default SimpleStyleFlatList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx";import React from"react";import{MasonryFlashList}from"@shopify/flash-list";import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx";import React from"react";import{MasonryFlashList}from"@shopify/flash-list";import{useFlashListSplitContentContainerStyles}from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleMasonryFlashList=React.forwardRef(function(_ref,ref){var styleProp=_ref.style,data=_ref.data,rest=_objectWithoutProperties(_ref,_excluded);var _useFlashListSplitCon=useFlashListSplitContentContainerStyles(styleProp),style=_useFlashListSplitCon.style,contentContainerStyle=_useFlashListSplitCon.contentContainerStyle;return _jsx(MasonryFlashList,Object.assign({ref:ref,style:style,contentContainerStyle:contentContainerStyle,data:data},rest));});export default SimpleStyleMasonryFlashList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{StyleSheet}from"react-native";import{pick,omit}from"lodash";import{useDeepCompareMemo}from"../../utilities";export var contentContainerStyleNames=["padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","justifyContent","alignItems","alignContent","flexDirection","flexWrap","gap","columnGap","rowGap"];export default function useSplitContentContainerStyles(originalStyle){return useDeepCompareMemo(function(){var flattenedStyle=StyleSheet.flatten(originalStyle);var contentContainerStyle=pick(flattenedStyle,contentContainerStyleNames);contentContainerStyle.flexGrow=1;var style=omit(flattenedStyle,contentContainerStyleNames);if(style.flex===undefined){style=Object.assign({flexGrow:0},style);}else if(style.flexGrow===undefined){style=Object.assign({flexGrow:style.flex},style);}return{style:style,contentContainerStyle:contentContainerStyle};},[originalStyle]);}
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{StyleSheet,Dimensions}from"react-native";import{pick,omit}from"lodash";import{extractPercentNumber,useDeepCompareMemo}from"../../utilities";var DEVICE_WIDTH=Dimensions.get("window").width;var DEVICE_HEIGHT=Dimensions.get("window").width;export var contentContainerStyleNames=["padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","justifyContent","alignItems","alignContent","flexDirection","flexWrap","gap","columnGap","rowGap"];export default function useSplitContentContainerStyles(originalStyle){return useDeepCompareMemo(function(){var flattenedStyle=StyleSheet.flatten(originalStyle);var contentContainerStyle=pick(flattenedStyle,contentContainerStyleNames);contentContainerStyle.flexGrow=1;var style=omit(flattenedStyle,contentContainerStyleNames);if(style.flex===undefined){style=Object.assign({flexGrow:0},style);}else if(style.flexGrow===undefined){style=Object.assign({flexGrow:style.flex},style);}return{style:style,contentContainerStyle:contentContainerStyle};},[originalStyle]);}export function useFlashListSplitContentContainerStyles(originalStyle){var _useSplitContentConta=useSplitContentContainerStyles(originalStyle),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;var flashListContentContainerStyle=pick(contentContainerStyle,["backgroundColor","paddingTop","paddingLeft","paddingRight","paddingBottom","padding","paddingVertical","paddingHorizontal"]);for(var _ref of Object.entries(flashListContentContainerStyle)){var _ref2=_slicedToArray(_ref,2);var _key=_ref2[0];var value=_ref2[1];if(typeof value==="string"&&_key.includes("padding")){var asNumber=extractPercentNumber(value);if(asNumber!==undefined){switch(_key){case"padding":case"paddingLeft":case"paddingRight":case"paddingHorizontal":flashListContentContainerStyle[_key]=DEVICE_WIDTH*(asNumber/100);break;case"paddingTop":case"paddingBottom":case"paddingVertical":flashListContentContainerStyle[_key]=DEVICE_HEIGHT*(asNumber/100);break;}}}}return{style:style,contentContainerStyle:flashListContentContainerStyle};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disableScrollWhenSwiping","listComponent"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disableScrollWhenSwiping","listComponent"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import{FlatList}from"react-native";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";export var SwipeableListContext=React.createContext({onStartSwiping:function onStartSwiping(){},onStopSwiping:function onStopSwiping(){}});var SwipeableList=React.forwardRef(function(_ref,ref){var _ref$disableScrollWhe=_ref.disableScrollWhenSwiping,disableScrollWhenSwiping=_ref$disableScrollWhe===void 0?true:_ref$disableScrollWhe,_ref$listComponent=_ref.listComponent,listComponent=_ref$listComponent===void 0?"FlatList":_ref$listComponent,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isSwiping=_React$useState2[0],setIsSwiping=_React$useState2[1];var onStartSwiping=function onStartSwiping(){setIsSwiping(true);};var onStopSwiping=function onStopSwiping(){setIsSwiping(false);};rest.scrollEnabled=disableScrollWhenSwiping?!isSwiping:true;var renderListComponent=function renderListComponent(){switch(listComponent){case"FlatList":return _jsx(FlatList,Object.assign({ref:ref},rest));case"FlashList":return _jsx(FlashList,Object.assign({ref:ref},rest));}};return _jsx(SwipeableListContext.Provider,{value:{onStartSwiping:onStartSwiping,onStopSwiping:onStopSwiping},children:_jsx(_Fragment,{children:renderListComponent()})});});export default SwipeableList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle"];import React from"react";import{StyleSheet}from"react-native";import{isString,isNumber,pick,pickBy,identity,isEqual}from"lodash";export function extractStyles(style){var _StyleSheet$flatten=StyleSheet.flatten(style||{}),color=_StyleSheet$flatten.color,fontFamily=_StyleSheet$flatten.fontFamily,fontWeight=_StyleSheet$flatten.fontWeight,fontSize=_StyleSheet$flatten.fontSize,lineHeight=_StyleSheet$flatten.lineHeight,letterSpacing=_StyleSheet$flatten.letterSpacing,textTransform=_StyleSheet$flatten.textTransform,textAlign=_StyleSheet$flatten.textAlign,textDecorationLine=_StyleSheet$flatten.textDecorationLine,textDecorationColor=_StyleSheet$flatten.textDecorationColor,textDecorationStyle=_StyleSheet$flatten.textDecorationStyle,viewStyles=_objectWithoutProperties(_StyleSheet$flatten,_excluded);var textStyles={color:color,fontFamily:fontFamily,fontWeight:fontWeight,fontSize:fontSize,lineHeight:lineHeight,letterSpacing:letterSpacing,textTransform:textTransform,textAlign:textAlign,textDecorationLine:textDecorationLine,textDecorationColor:textDecorationColor,textDecorationStyle:textDecorationStyle};for(var key in textStyles){var styleKey=key;if(textStyles[styleKey]===undefined){delete textStyles[styleKey];}}return{viewStyles:viewStyles,textStyles:textStyles};}export var borderStyleNames=["borderRadius","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderEndColor","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStyle","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth"];export var marginStyleNames=["margin","marginBottom","marginEnd","marginHorizontal","marginLeft","marginRight","marginStart","marginTop","marginVertical"];export var paddingStyleNames=["padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical"];export function extractBorderAndMarginStyles(style,additionalBorderStyles,additionalMarginStyles){var flatStyle=StyleSheet.flatten(style||{});var borderStyles=pickBy(pick(flatStyle,[].concat(borderStyleNames,_toConsumableArray(additionalBorderStyles?additionalBorderStyles:[]))),identity);var marginStyles=pickBy(pick(flatStyle,[].concat(marginStyleNames,_toConsumableArray(additionalMarginStyles?additionalMarginStyles:[]))),identity);return{borderStyles:borderStyles,marginStyles:marginStyles};}export var flexItemStyleNames=["alignSelf","flexBasis","flexShrink","flexGrow","flex"];export function extractFlexItemStyles(style,additionalFlexItemStyles){var flatStyle=StyleSheet.flatten(style||{});var flexItemStyles=pickBy(pick(flatStyle,[].concat(flexItemStyleNames,_toConsumableArray(additionalFlexItemStyles?additionalFlexItemStyles:[]))),identity);return flexItemStyles;}export var positionStyleNames=["position","left","right","top","bottom","zIndex","overflow"];export function extractPositionStyles(style,additionalPositionStyles){var flatStyle=StyleSheet.flatten(style||{});var positionStyles=pickBy(pick(flatStyle,[].concat(positionStyleNames,_toConsumableArray(additionalPositionStyles?additionalPositionStyles:[]))),identity);return positionStyles;}export var effectsStyleNames=["opacity","elevation"];export function extractEffectStyles(style,additionalEffectStyles){var flatStyle=StyleSheet.flatten(style||{});var effectStyles=pickBy(pick(flatStyle,[].concat(effectsStyleNames,_toConsumableArray(additionalEffectStyles?additionalEffectStyles:[]))),identity);return effectStyles;}export var sizeStyleNames=["width","height","minWidth","minHeight"];export function extractSizeStyles(style,additionalSizeStyles){var flatStyle=StyleSheet.flatten(style||{});var sizeStyles=pickBy(pick(flatStyle,[].concat(sizeStyleNames,_toConsumableArray(additionalSizeStyles?additionalSizeStyles:[]))),identity);return sizeStyles;}export function applyStyles(baseStyles,stylesToApply){if(!stylesToApply){return;}var flattenedStyles=StyleSheet.flatten(baseStyles);for(var _ref of Object.entries(stylesToApply)){var _ref2=_slicedToArray(_ref,2);var key=_ref2[0];var value=_ref2[1];if(value!=null){flattenedStyles[key]=value;}}return flattenedStyles;}export function getValueForRadioButton(value){if(isString(value)){return value;}else if(isNumber(value)){return String(value);}else{throw new Error(`Invalid value: ${value}`);}}export function flattenReactFragments(components){var flattened=[];for(var component of components){if(component.type===React.Fragment){var _component$props;var children=React.Children.toArray((_component$props=component.props)==null?void 0:_component$props.children);for(var child of children){flattened.push.apply(flattened,_toConsumableArray(flattenReactFragments([child])));}}else{flattened.push(component);}}return flattened;}function useDeepCompareMemoize(value){var ref=React.useRef();if(!isEqual(value,ref.current)){ref.current=value;}return ref.current;}export function useDeepCompareMemo(factory,deps){return React.useMemo(factory,deps==null?void 0:deps.map(useDeepCompareMemoize));}export function useDeepCompareEffect(effect,deps){return React.useEffect(effect,deps==null?void 0:deps.map(useDeepCompareMemoize));}
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle"];import React from"react";import{StyleSheet}from"react-native";import{isString,isNumber,pick,pickBy,identity,isEqual}from"lodash";export function extractStyles(style){var _StyleSheet$flatten=StyleSheet.flatten(style||{}),color=_StyleSheet$flatten.color,fontFamily=_StyleSheet$flatten.fontFamily,fontWeight=_StyleSheet$flatten.fontWeight,fontSize=_StyleSheet$flatten.fontSize,lineHeight=_StyleSheet$flatten.lineHeight,letterSpacing=_StyleSheet$flatten.letterSpacing,textTransform=_StyleSheet$flatten.textTransform,textAlign=_StyleSheet$flatten.textAlign,textDecorationLine=_StyleSheet$flatten.textDecorationLine,textDecorationColor=_StyleSheet$flatten.textDecorationColor,textDecorationStyle=_StyleSheet$flatten.textDecorationStyle,viewStyles=_objectWithoutProperties(_StyleSheet$flatten,_excluded);var textStyles={color:color,fontFamily:fontFamily,fontWeight:fontWeight,fontSize:fontSize,lineHeight:lineHeight,letterSpacing:letterSpacing,textTransform:textTransform,textAlign:textAlign,textDecorationLine:textDecorationLine,textDecorationColor:textDecorationColor,textDecorationStyle:textDecorationStyle};for(var key in textStyles){var styleKey=key;if(textStyles[styleKey]===undefined){delete textStyles[styleKey];}}return{viewStyles:viewStyles,textStyles:textStyles};}export var borderStyleNames=["borderRadius","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderEndColor","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStyle","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth"];export var marginStyleNames=["margin","marginBottom","marginEnd","marginHorizontal","marginLeft","marginRight","marginStart","marginTop","marginVertical"];export var paddingStyleNames=["padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical"];export function extractBorderAndMarginStyles(style,additionalBorderStyles,additionalMarginStyles){var flatStyle=StyleSheet.flatten(style||{});var borderStyles=pickBy(pick(flatStyle,[].concat(borderStyleNames,_toConsumableArray(additionalBorderStyles?additionalBorderStyles:[]))),identity);var marginStyles=pickBy(pick(flatStyle,[].concat(marginStyleNames,_toConsumableArray(additionalMarginStyles?additionalMarginStyles:[]))),identity);return{borderStyles:borderStyles,marginStyles:marginStyles};}export var flexItemStyleNames=["alignSelf","flexBasis","flexShrink","flexGrow","flex"];export function extractFlexItemStyles(style,additionalFlexItemStyles){var flatStyle=StyleSheet.flatten(style||{});var flexItemStyles=pickBy(pick(flatStyle,[].concat(flexItemStyleNames,_toConsumableArray(additionalFlexItemStyles?additionalFlexItemStyles:[]))),identity);return flexItemStyles;}export var positionStyleNames=["position","left","right","top","bottom","zIndex","overflow"];export function extractPositionStyles(style,additionalPositionStyles){var flatStyle=StyleSheet.flatten(style||{});var positionStyles=pickBy(pick(flatStyle,[].concat(positionStyleNames,_toConsumableArray(additionalPositionStyles?additionalPositionStyles:[]))),identity);return positionStyles;}export var effectsStyleNames=["opacity","elevation"];export function extractEffectStyles(style,additionalEffectStyles){var flatStyle=StyleSheet.flatten(style||{});var effectStyles=pickBy(pick(flatStyle,[].concat(effectsStyleNames,_toConsumableArray(additionalEffectStyles?additionalEffectStyles:[]))),identity);return effectStyles;}export var sizeStyleNames=["width","height","minWidth","minHeight"];export function extractSizeStyles(style,additionalSizeStyles){var flatStyle=StyleSheet.flatten(style||{});var sizeStyles=pickBy(pick(flatStyle,[].concat(sizeStyleNames,_toConsumableArray(additionalSizeStyles?additionalSizeStyles:[]))),identity);return sizeStyles;}export function applyStyles(baseStyles,stylesToApply){if(!stylesToApply){return;}var flattenedStyles=StyleSheet.flatten(baseStyles);for(var _ref of Object.entries(stylesToApply)){var _ref2=_slicedToArray(_ref,2);var key=_ref2[0];var value=_ref2[1];if(value!=null){flattenedStyles[key]=value;}}return flattenedStyles;}export function getValueForRadioButton(value){if(isString(value)){return value;}else if(isNumber(value)){return String(value);}else{throw new Error(`Invalid value: ${value}`);}}export function flattenReactFragments(components){var flattened=[];for(var component of components){if(component.type===React.Fragment){var _component$props;var children=React.Children.toArray((_component$props=component.props)==null?void 0:_component$props.children);for(var child of children){flattened.push.apply(flattened,_toConsumableArray(flattenReactFragments([child])));}}else{flattened.push(component);}}return flattened;}function useDeepCompareMemoize(value){var ref=React.useRef();if(!isEqual(value,ref.current)){ref.current=value;}return ref.current;}export function useDeepCompareMemo(factory,deps){return React.useMemo(factory,deps==null?void 0:deps.map(useDeepCompareMemoize));}export function useDeepCompareEffect(effect,deps){return React.useEffect(effect,deps==null?void 0:deps.map(useDeepCompareMemoize));}export function extractPercentNumber(percentString){var percentRegex=/(\d+)?%/;var matches=percentString.match(percentRegex);if(matches!=null&&matches.length){var percentNumber=Number(matches[1]);if(!isNaN(percentNumber)){return percentNumber;}}return undefined;}
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { StyleSheet, Dimensions, } from "react-native";
|
|
3
3
|
import BottomSheetComponent, { BottomSheetScrollView, } from "@gorhom/bottom-sheet";
|
|
4
4
|
import { useTheme } from "@draftbit/theme";
|
|
5
|
-
import { useDeepCompareMemo } from "../../utilities";
|
|
5
|
+
import { extractPercentNumber, useDeepCompareMemo } from "../../utilities";
|
|
6
6
|
const windowHeight = Dimensions.get("window").height;
|
|
7
7
|
// Clarification:
|
|
8
8
|
// Input of snap points is sorted top -> bottom where each value represents distance from top
|
|
@@ -61,17 +61,6 @@ function convertSnapPointsForNewImplementation(snapPoints) {
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
function extractPercentNumber(percentString) {
|
|
65
|
-
const percentRegex = /(\d+)?%/;
|
|
66
|
-
const matches = percentString.match(percentRegex);
|
|
67
|
-
if (matches === null || matches === void 0 ? void 0 : matches.length) {
|
|
68
|
-
const percentNumber = Number(matches[1]);
|
|
69
|
-
if (!isNaN(percentNumber)) {
|
|
70
|
-
return percentNumber;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return undefined;
|
|
74
|
-
}
|
|
75
64
|
const styles = StyleSheet.create({
|
|
76
65
|
contentContainerStyle: {
|
|
77
66
|
paddingHorizontal: 16,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.js","sourceRoot":"","sources":["../../../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EAIV,UAAU,GACX,MAAM,cAAc,CAAC;AAEtB,OAAO,oBAAoB,EAAE,EAC3B,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CA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EF,6FAA6F;AAC7F,SAAS,qCAAqC,CAC5C,UAA+B;IAE/B,qGAAqG;IACrG,MAAM,kBAAkB,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;IAErD,oHAAoH;IACpH,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACtC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,MAAM,aAAa,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAClD,IAAI,aAAa,KAAK,SAAS,EAAE;gBAC/B,OAAO,GAAG,GAAG,GAAG,aAAa,GAAG,CAAC;aAClC;YACD,OAAO,KAAK,CAAC;SACd;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,OAAO,YAAY,GAAG,KAAK,CAAC;SAC7B;aAAM;YACL,OAAO,KAAK,CAAC;SACd;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,qBAAqB,EAAE;QACrB,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,EAAE;KACpB;CACF,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashListProps, FlashList } from "@shopify/flash-list";
|
|
3
|
-
import { FlatListProps, FlatList
|
|
3
|
+
import { FlatListProps, FlatList } from "react-native";
|
|
4
4
|
declare type ListComponentType = "FlatList" | "FlashList";
|
|
5
5
|
interface AdditionalSectionListProps<T> {
|
|
6
6
|
sectionKey: string;
|
|
@@ -20,5 +20,5 @@ declare const SectionList: React.ForwardRefExoticComponent<(FlatListSectionListP
|
|
|
20
20
|
[key: string]: any;
|
|
21
21
|
}> | FlashListSectionListProps<{
|
|
22
22
|
[key: string]: any;
|
|
23
|
-
}>) & React.RefAttributes<
|
|
23
|
+
}>) & React.RefAttributes<FlatList<any> | FlashList<any>>>;
|
|
24
24
|
export default SectionList;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashList } from "@shopify/flash-list";
|
|
3
|
+
import { FlatList } from "react-native";
|
|
3
4
|
import SectionHeader, { DefaultSectionHeader } from "./SectionHeader";
|
|
4
5
|
import { flattenReactFragments } from "../../utilities";
|
|
5
|
-
import FlatList from "../FlatList";
|
|
6
6
|
export const DEFAULT_SECTION = "Uncategorized";
|
|
7
7
|
const SectionList = React.forwardRef(({ sectionKey, stickyHeader = false, listComponent = "FlatList", data: dataProp, renderItem: renderItemProp, keyExtractor: keyExtractorProp, ...rest }, ref) => {
|
|
8
8
|
const data = React.useMemo(() => (Array.isArray(dataProp) ? dataProp : []), [dataProp]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionList.js","sourceRoot":"","sources":["../../../../../src/components/SectionList/SectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SectionList.js","sourceRoot":"","sources":["../../../../../src/components/SectionList/SectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAiB,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,aAAa,EAAE,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAqCxD,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,UAAU,EACV,YAAY,GAAG,KAAK,EACpB,aAAa,GAAG,UAAU,EAC1B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,c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B,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,KAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;aACjE;SACF;IACH,CAAC,CAAC;IAEF,QAAQ,aAAa,EAAE;QACrB,KAAK,UAAU;YACb,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,GAA0B,EAC/B,mBAAmB,EAAE,qBAAqB,KACrC,IAA0C,EAC/C,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;QACJ,KAAK,WAAW;YACd,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAA+C,EACpD,mBAAmB,EAAE,qBAAqB,KACrC,IAA2C,EAChD,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;KACL;AACH,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashList } from "@shopify/flash-list";
|
|
3
|
-
import
|
|
3
|
+
import { useFlashListSplitContentContainerStyles } from "./useSplitContentContainerStyles";
|
|
4
4
|
/**
|
|
5
5
|
* A FlashList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleFlashList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
|
-
const { style, contentContainerStyle } =
|
|
9
|
+
const { style, contentContainerStyle } = useFlashListSplitContentContainerStyles(styleProp);
|
|
10
10
|
return (React.createElement(FlashList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
11
|
});
|
|
12
12
|
export default SimpleStyleFlashList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,uCAAuC,EAAE,MAAM,kCAAkC,CAAC;AAE3F;;;GAGG;AACH,MAAM,oBAAoB,GAAG,KAAK,CAAC,UAAU,CAC3C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAC0C,EACnD,GAA8B,EAC9B,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,uCAAuC,CAAC,SAAS,CAAC,CAAC;IAErD,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { FlatList
|
|
2
|
+
import { FlatList } from "react-native";
|
|
3
3
|
import type { FlatListProps } from "react-native";
|
|
4
4
|
/**
|
|
5
5
|
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
declare const SimpleStyleFlatList: React.ForwardRefExoticComponent<Omit<FlatListProps<unknown>, "contentContainerStyle"> & React.RefAttributes<
|
|
8
|
+
declare const SimpleStyleFlatList: React.ForwardRefExoticComponent<Omit<FlatListProps<unknown>, "contentContainerStyle"> & React.RefAttributes<FlatList<any>>>;
|
|
9
9
|
export default SimpleStyleFlatList;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import FlatList from "
|
|
2
|
+
import { FlatList } from "react-native";
|
|
3
3
|
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
4
|
/**
|
|
5
5
|
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACyC,EAClD,GAAwB,EACxB,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MasonryFlashList } from "@shopify/flash-list";
|
|
3
|
-
import
|
|
3
|
+
import { useFlashListSplitContentContainerStyles } from "./useSplitContentContainerStyles";
|
|
4
4
|
/**
|
|
5
5
|
* A MasonryFlashList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleMasonryFlashList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
|
-
const { style, contentContainerStyle } =
|
|
9
|
+
const { style, contentContainerStyle } = useFlashListSplitContentContainerStyles(styleProp);
|
|
10
10
|
return (React.createElement(MasonryFlashList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
11
|
});
|
|
12
12
|
export default SimpleStyleMasonryFlashList;
|
package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleMasonryFlashList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAMvD,OAAO,
|
|
1
|
+
{"version":3,"file":"SimpleStyleMasonryFlashList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAMvD,OAAO,EAAE,uCAAuC,EAAE,MAAM,kCAAkC,CAAC;AAE3F;;;GAGG;AACH,MAAM,2BAA2B,GAAG,KAAK,CAAC,UAAU,CAClD,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACiD,EAC1D,GAAwC,EACxC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,uCAAuC,CAAC,SAAS,CAAC,CAAC;IAErD,OAAO,CACL,oBAAC,gBAAgB,IACf,GAAG,EAAE,GAAU,EACf,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { FlatListSectionListProps, FlashListSectionListProps } from "../SectionList";
|
|
3
|
-
import { FlatList } from "react-native";
|
|
3
|
+
import { FlatList } from "react-native-gesture-handler";
|
|
4
4
|
import { FlashList } from "@shopify/flash-list";
|
|
5
5
|
/**
|
|
6
6
|
* A SectionList wrapper that takes a single `style` prop and internally extracts
|
|
@@ -10,5 +10,5 @@ declare const SimpleStyleSectionList: React.ForwardRefExoticComponent<Omit<FlatL
|
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
}> | FlashListSectionListProps<{
|
|
12
12
|
[key: string]: any;
|
|
13
|
-
}>, "contentContainerStyle"> & React.RefAttributes<
|
|
13
|
+
}>, "contentContainerStyle"> & React.RefAttributes<FlashList<any> | FlatList<any>>>;
|
|
14
14
|
export default SimpleStyleSectionList;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { FlashListSwipeableListProps, FlatListSwipeableListProps } from "../SwipeableItem";
|
|
3
|
-
import { FlatList } from "react-native";
|
|
3
|
+
import { FlatList } from "react-native-gesture-handler";
|
|
4
4
|
import { FlashList } from "@shopify/flash-list";
|
|
5
5
|
/**
|
|
6
6
|
* A SwipeableList wrapper that takes a single `style` prop and internally extracts
|
|
@@ -10,5 +10,5 @@ declare const SimpleStyleSwipeableList: React.ForwardRefExoticComponent<Omit<Fla
|
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
}> | FlatListSwipeableListProps<{
|
|
12
12
|
[key: string]: any;
|
|
13
|
-
}>, "contentContainerStyle"> & React.RefAttributes<
|
|
13
|
+
}>, "contentContainerStyle"> & React.RefAttributes<FlashList<any> | FlatList<any>>>;
|
|
14
14
|
export default SimpleStyleSwipeableList;
|
package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ interface Styles {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const contentContainerStyleNames: string[];
|
|
7
7
|
export default function useSplitContentContainerStyles(originalStyle: StyleProp<ViewStyle>): Styles;
|
|
8
|
+
export declare function useFlashListSplitContentContainerStyles(originalStyle: StyleProp<ViewStyle>): Styles;
|
|
8
9
|
export {};
|
package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { StyleSheet } from "react-native";
|
|
1
|
+
import { StyleSheet, Dimensions } from "react-native";
|
|
2
2
|
import { pick, omit } from "lodash";
|
|
3
|
-
import { useDeepCompareMemo } from "../../utilities";
|
|
3
|
+
import { extractPercentNumber, useDeepCompareMemo } from "../../utilities";
|
|
4
|
+
const DEVICE_WIDTH = Dimensions.get("window").width;
|
|
5
|
+
const DEVICE_HEIGHT = Dimensions.get("window").width;
|
|
4
6
|
export const contentContainerStyleNames = [
|
|
5
7
|
"padding",
|
|
6
8
|
"paddingBottom",
|
|
@@ -41,4 +43,47 @@ export default function useSplitContentContainerStyles(originalStyle) {
|
|
|
41
43
|
};
|
|
42
44
|
}, [originalStyle]);
|
|
43
45
|
}
|
|
46
|
+
export function useFlashListSplitContentContainerStyles(originalStyle) {
|
|
47
|
+
const { style, contentContainerStyle } = useSplitContentContainerStyles(originalStyle);
|
|
48
|
+
// FlashList only supports a subset of contentContainerStyles
|
|
49
|
+
// See https://shopify.github.io/flash-list/docs/usage/#contentcontainerstyle
|
|
50
|
+
const flashListContentContainerStyle = pick(contentContainerStyle, [
|
|
51
|
+
"backgroundColor",
|
|
52
|
+
"paddingTop",
|
|
53
|
+
"paddingLeft",
|
|
54
|
+
"paddingRight",
|
|
55
|
+
"paddingBottom",
|
|
56
|
+
"padding",
|
|
57
|
+
"paddingVertical",
|
|
58
|
+
"paddingHorizontal",
|
|
59
|
+
]);
|
|
60
|
+
// FlashList percentage paddings cause it to freeze and crash
|
|
61
|
+
// This converts them to numbers based on device width/height
|
|
62
|
+
for (const [key, value] of Object.entries(flashListContentContainerStyle)) {
|
|
63
|
+
if (typeof value === "string" && key.includes("padding")) {
|
|
64
|
+
const asNumber = extractPercentNumber(value);
|
|
65
|
+
if (asNumber !== undefined) {
|
|
66
|
+
switch (key) {
|
|
67
|
+
case "padding":
|
|
68
|
+
case "paddingLeft":
|
|
69
|
+
case "paddingRight":
|
|
70
|
+
case "paddingHorizontal":
|
|
71
|
+
flashListContentContainerStyle[key] =
|
|
72
|
+
DEVICE_WIDTH * (asNumber / 100);
|
|
73
|
+
break;
|
|
74
|
+
case "paddingTop":
|
|
75
|
+
case "paddingBottom":
|
|
76
|
+
case "paddingVertical":
|
|
77
|
+
flashListContentContainerStyle[key] =
|
|
78
|
+
DEVICE_HEIGHT * (asNumber / 100);
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
style,
|
|
86
|
+
contentContainerStyle: flashListContentContainerStyle,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
44
89
|
//# sourceMappingURL=useSplitContentContainerStyles.js.map
|
package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSplitContentContainerStyles.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/useSplitContentContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"useSplitContentContainerStyles.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/useSplitContentContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;AACpD,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;AAOrD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS;IACT,eAAe;IACf,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,eAAe;IACf,UAAU;IACV,KAAK;IACL,WAAW;IACX,QAAQ;CACT,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,8BAA8B,CACpD,aAAmC;IAEnC,OAAO,kBAAkB,CAAS,GAAG,EAAE;QACrC,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAEzD,MAAM,qBAAqB,GAAG,IAAI,CAChC,cAAc,EACd,0BAA0B,CAC3B,CAAC;QAEF,qIAAqI;QACrI,qBAAqB,CAAC,QAAQ,GAAG,CAAC,CAAC;QAEnC,IAAI,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;QAE7D,kIAAkI;QAClI,4DAA4D;QAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;YAC5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e,CAAC;oBACrB,KAAK,iBAAiB;wBACpB,8BAA8B,CAAC,GAAG,CAAC;4BACjC,aAAa,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;wBACnC,MAAM;iBACT;aACF;SACF;KACF;IAED,OAAO;QACL,KAAK;QACL,qBAAqB,EAAE,8BAA8B;KACtD,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashListProps, FlashList } from "@shopify/flash-list";
|
|
3
|
-
import { FlatListProps, FlatList
|
|
3
|
+
import { FlatListProps, FlatList } from "react-native";
|
|
4
4
|
declare type ListComponentType = "FlatList" | "FlashList";
|
|
5
5
|
interface AdditionalSwipeableListProps {
|
|
6
6
|
disableScrollWhenSwiping?: boolean;
|
|
@@ -13,5 +13,5 @@ declare type SwipeableListContextType = {
|
|
|
13
13
|
onStopSwiping: () => void;
|
|
14
14
|
};
|
|
15
15
|
export declare const SwipeableListContext: React.Context<SwipeableListContextType>;
|
|
16
|
-
declare const SwipeableList: React.ForwardRefExoticComponent<(FlashListSwipeableListProps<object> | FlatListSwipeableListProps<object>) & React.RefAttributes<
|
|
16
|
+
declare const SwipeableList: React.ForwardRefExoticComponent<(FlashListSwipeableListProps<object> | FlatListSwipeableListProps<object>) & React.RefAttributes<FlatList<any> | FlashList<any>>>;
|
|
17
17
|
export default SwipeableList;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashList } from "@shopify/flash-list";
|
|
3
|
-
import FlatList from "
|
|
3
|
+
import { FlatList } from "react-native";
|
|
4
4
|
export const SwipeableListContext = React.createContext({
|
|
5
5
|
onStartSwiping: () => { },
|
|
6
6
|
onStopSwiping: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableList.js","sourceRoot":"","sources":["../../../../../src/components/SwipeableItem/SwipeableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM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AAE,GAA8B,KAC9B,IAA0B,GAC/B,CACH,CAAC;SACL;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,cAAc,EAAE,aAAa,EAAE;QACrE,0CAAG,mBAAmB,EAAE,CAAI,CACE,CACjC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -47,3 +47,4 @@ export declare function useDeepCompareMemo<T>(factory: () => T, deps: React.Depe
|
|
|
47
47
|
* useMemo counterpart that does a deep compare on the dependency list
|
|
48
48
|
*/
|
|
49
49
|
export declare function useDeepCompareEffect(effect: React.EffectCallback, deps: React.DependencyList): void;
|
|
50
|
+
export declare function extractPercentNumber(percentString: string): number | undefined;
|
|
@@ -209,4 +209,15 @@ export function useDeepCompareEffect(effect, deps) {
|
|
|
209
209
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
210
210
|
return React.useEffect(effect, deps === null || deps === void 0 ? void 0 : deps.map(useDeepCompareMemoize));
|
|
211
211
|
}
|
|
212
|
+
export function extractPercentNumber(percentString) {
|
|
213
|
+
const percentRegex = /(\d+)?%/;
|
|
214
|
+
const matches = percentString.match(percentRegex);
|
|
215
|
+
if (matches === null || matches === void 0 ? void 0 : matches.length) {
|
|
216
|
+
const percentNumber = Number(matches[1]);
|
|
217
|
+
if (!isNaN(percentNumber)) {
|
|
218
|
+
return percentNumber;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
212
223
|
//# sourceMappingURL=utilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EA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