@draftbit/core 49.4.4-7c77a4.2 → 49.4.4-b991fc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/lib/commonjs/Provider.js +1 -1
  2. package/lib/commonjs/components/AccordionGroup.js +1 -1
  3. package/lib/commonjs/components/ActionSheet/ActionSheet.js +1 -1
  4. package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js +1 -1
  5. package/lib/commonjs/components/ActionSheet/ActionSheetItem.js +1 -1
  6. package/lib/commonjs/components/ActionSheet/index.js +1 -1
  7. package/lib/commonjs/components/AspectRatio.js +1 -1
  8. package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
  9. package/lib/commonjs/components/BottomSheet/index.js +1 -1
  10. package/lib/commonjs/components/Button.js +1 -1
  11. package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
  12. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +1 -1
  13. package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -1
  14. package/lib/commonjs/components/Checkbox/context.js +1 -1
  15. package/lib/commonjs/components/Checkbox/index.js +1 -1
  16. package/lib/commonjs/components/Config.js +1 -1
  17. package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
  18. package/lib/commonjs/components/DatePicker/DatePickerComponent.js +1 -1
  19. package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +1 -1
  20. package/lib/commonjs/components/DatePicker/DatePickerComponentType.js +1 -1
  21. package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +1 -1
  22. package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +1 -1
  23. package/lib/commonjs/components/DeckSwiper/index.js +1 -1
  24. package/lib/commonjs/components/Divider.js +1 -1
  25. package/lib/commonjs/components/Elevation.js +1 -1
  26. package/lib/commonjs/components/FormRow.js +1 -1
  27. package/lib/commonjs/components/IconButton.js +1 -1
  28. package/lib/commonjs/components/Image.js +1 -1
  29. package/lib/commonjs/components/KeyboardAvoidingView.js +1 -1
  30. package/lib/commonjs/components/Layout/AspectRatio.js +1 -1
  31. package/lib/commonjs/components/Layout/Center.js +1 -1
  32. package/lib/commonjs/components/Layout/Circle.js +1 -1
  33. package/lib/commonjs/components/Layout/HStack.js +1 -1
  34. package/lib/commonjs/components/Layout/LayoutCommon.js +1 -1
  35. package/lib/commonjs/components/Layout/Spacer.js +1 -1
  36. package/lib/commonjs/components/Layout/Square.js +1 -1
  37. package/lib/commonjs/components/Layout/VStack.js +1 -1
  38. package/lib/commonjs/components/Layout/ZStack.js +1 -1
  39. package/lib/commonjs/components/Layout/index.js +1 -1
  40. package/lib/commonjs/components/Markdown.js +1 -1
  41. package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js +1 -1
  42. package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +1 -1
  43. package/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +1 -1
  44. package/lib/commonjs/components/MediaPlayer/AudioPlayer/index.js +1 -1
  45. package/lib/commonjs/components/MediaPlayer/MediaPlaybackWrapper.js +1 -1
  46. package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +1 -1
  47. package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
  48. package/lib/commonjs/components/MediaPlayer/VideoPlayer/index.js +1 -1
  49. package/lib/commonjs/components/NumberInput.js +1 -1
  50. package/lib/commonjs/components/Picker/NativePicker.js +1 -1
  51. package/lib/commonjs/components/Picker/PickerCommon.js +1 -1
  52. package/lib/commonjs/components/Picker/PickerInputContainer.js +1 -1
  53. package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +1 -1
  54. package/lib/commonjs/components/Picker/dropdown/MultiSelectPicker.js +1 -1
  55. package/lib/commonjs/components/Picker/dropdown/PickerItem.js +1 -1
  56. package/lib/commonjs/components/Picker/index.js +1 -1
  57. package/lib/commonjs/components/PinInput/CustomPinInputCell.js +1 -1
  58. package/lib/commonjs/components/PinInput/PinInput.js +1 -1
  59. package/lib/commonjs/components/PinInput/PinInputText.js +1 -1
  60. package/lib/commonjs/components/PinInput/index.js +1 -1
  61. package/lib/commonjs/components/Portal/Portal.js +1 -1
  62. package/lib/commonjs/components/Portal/PortalConsumer.js +1 -1
  63. package/lib/commonjs/components/Portal/PortalHost.js +1 -1
  64. package/lib/commonjs/components/Portal/PortalManager.js +1 -1
  65. package/lib/commonjs/components/Pressable.js +1 -1
  66. package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +1 -1
  67. package/lib/commonjs/components/Progress/CircularProgress/index.js +1 -1
  68. package/lib/commonjs/components/Progress/IndeterminateProgress.js +1 -1
  69. package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +1 -1
  70. package/lib/commonjs/components/Progress/LinearProgress/index.js +1 -1
  71. package/lib/commonjs/components/Progress/ProgressCommon.js +1 -1
  72. package/lib/commonjs/components/ProgressIndicator.js +1 -1
  73. package/lib/commonjs/components/RadioButton/RadioButton.js +1 -1
  74. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +1 -1
  75. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
  76. package/lib/commonjs/components/RadioButton/context.js +1 -1
  77. package/lib/commonjs/components/RadioButton/index.js +1 -1
  78. package/lib/commonjs/components/Row.js +1 -1
  79. package/lib/commonjs/components/SVG.js +1 -1
  80. package/lib/commonjs/components/SVG.native.js +1 -1
  81. package/lib/commonjs/components/ScreenContainer.js +1 -1
  82. package/lib/commonjs/components/SectionList/SectionHeader.js +1 -1
  83. package/lib/commonjs/components/SectionList/SectionList.js +1 -1
  84. package/lib/commonjs/components/SectionList/index.js +1 -1
  85. package/lib/commonjs/components/Shadow.js +1 -1
  86. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlashList.js +1 -1
  87. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
  88. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +1 -1
  89. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +1 -1
  90. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleScrollView.js +1 -1
  91. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSectionList.js +1 -1
  92. package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +1 -1
  93. package/lib/commonjs/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +1 -1
  94. package/lib/commonjs/components/Slider.js +1 -1
  95. package/lib/commonjs/components/StarRating.js +1 -1
  96. package/lib/commonjs/components/StepIndicator.js +1 -1
  97. package/lib/commonjs/components/Stepper.js +1 -1
  98. package/lib/commonjs/components/Surface.js +1 -1
  99. package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +1 -1
  100. package/lib/commonjs/components/SwipeableItem/SwipeableItemButton.js +1 -1
  101. package/lib/commonjs/components/SwipeableItem/SwipeableItemCommon.js +1 -1
  102. package/lib/commonjs/components/SwipeableItem/SwipeableList.js +1 -1
  103. package/lib/commonjs/components/SwipeableItem/index.js +1 -1
  104. package/lib/commonjs/components/Swiper/Swiper.js +1 -1
  105. package/lib/commonjs/components/Swiper/SwiperItem.js +1 -1
  106. package/lib/commonjs/components/Swiper/index.js +1 -1
  107. package/lib/commonjs/components/Switch.js +1 -1
  108. package/lib/commonjs/components/TabView/TabView.js +1 -1
  109. package/lib/commonjs/components/TabView/TabViewItem.js +1 -1
  110. package/lib/commonjs/components/TabView/index.js +1 -1
  111. package/lib/commonjs/components/Table/Table.js +1 -1
  112. package/lib/commonjs/components/Table/TableCell.js +1 -1
  113. package/lib/commonjs/components/Table/TableCommon.js +1 -1
  114. package/lib/commonjs/components/Table/TableRow.js +1 -1
  115. package/lib/commonjs/components/Table/index.js +1 -1
  116. package/lib/commonjs/components/Text.js +1 -1
  117. package/lib/commonjs/components/TextField.js +1 -1
  118. package/lib/commonjs/components/TextInput.js +1 -1
  119. package/lib/commonjs/components/Touchable.js +1 -1
  120. package/lib/commonjs/components/Touchable.web.js +1 -1
  121. package/lib/commonjs/components/Typography.js +1 -1
  122. package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.js +1 -1
  123. package/lib/commonjs/components/YoutubePlayer/YoutubePlayer.native.js +2 -2
  124. package/lib/commonjs/components/YoutubePlayer/YoutubePlayerProps.js +1 -1
  125. package/lib/commonjs/components/YoutubePlayer/index.js +1 -1
  126. package/lib/commonjs/components/useAuthState.js +1 -1
  127. package/lib/commonjs/constants.js +1 -1
  128. package/lib/commonjs/deprecated-components/AccordionItem.js +1 -1
  129. package/lib/commonjs/deprecated-components/AnimatedCircularProgress.js +1 -1
  130. package/lib/commonjs/deprecated-components/AvatarEdit.js +1 -1
  131. package/lib/commonjs/deprecated-components/AvoidKeyboardView.js +1 -1
  132. package/lib/commonjs/deprecated-components/Banner.js +1 -1
  133. package/lib/commonjs/deprecated-components/Card.js +1 -1
  134. package/lib/commonjs/deprecated-components/CheckboxGroup.js +1 -1
  135. package/lib/commonjs/deprecated-components/CircleImage.js +1 -1
  136. package/lib/commonjs/deprecated-components/CircularProgress.js +1 -1
  137. package/lib/commonjs/deprecated-components/Container.js +1 -1
  138. package/lib/commonjs/deprecated-components/DeprecatedButton.js +1 -1
  139. package/lib/commonjs/deprecated-components/DeprecatedCardWrapper.js +1 -1
  140. package/lib/commonjs/deprecated-components/DeprecatedFAB.js +1 -1
  141. package/lib/commonjs/deprecated-components/FAB.js +1 -1
  142. package/lib/commonjs/deprecated-components/FieldSearchBarFull.js +1 -1
  143. package/lib/commonjs/deprecated-components/Layout.js +1 -1
  144. package/lib/commonjs/deprecated-components/ProgressBar.js +1 -1
  145. package/lib/commonjs/deprecated-components/ProgressCircle.js +1 -1
  146. package/lib/commonjs/deprecated-components/RadioButtonFieldGroup.js +1 -1
  147. package/lib/commonjs/deprecated-components/RowBodyIcon.js +1 -1
  148. package/lib/commonjs/deprecated-components/RowHeadlineImageCaption.js +1 -1
  149. package/lib/commonjs/deprecated-components/RowHeadlineImageIcon.js +1 -1
  150. package/lib/commonjs/deprecated-components/ToggleButton.js +1 -1
  151. package/lib/commonjs/hooks.js +1 -1
  152. package/lib/commonjs/index.js +1 -1
  153. package/lib/commonjs/interfaces/Icon.js +1 -1
  154. package/lib/commonjs/styles/DarkTheme.js +1 -1
  155. package/lib/commonjs/styles/DefaultTheme.js +1 -1
  156. package/lib/commonjs/styles/fonts.js +1 -1
  157. package/lib/commonjs/styles/overlay.js +1 -1
  158. package/lib/commonjs/styles/shadow.js +1 -1
  159. package/lib/commonjs/theming.js +1 -1
  160. package/lib/commonjs/utilities.js +1 -1
  161. package/lib/typescript/src/index.js +3 -0
  162. package/lib/typescript/src/index.js.map +1 -1
  163. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  164. package/package.json +4 -4
  165. package/src/index.js +3 -0
  166. package/src/index.js.map +1 -1
  167. package/src/index.tsx +4 -0
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _Pressable=_interopRequireDefault(require("../Pressable"));var _utilities=require("../../utilities");var _reactNativeSwipeListView=require("react-native-swipe-list-view");var _theming=require("../../theming");var _SwipeableItemButton=_interopRequireDefault(require("./SwipeableItemButton"));var _SwipeableList=require("./SwipeableList");var _SwipeableItemCommon=require("./SwipeableItemCommon");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["theme","style","children","Icon","closeOnPress","leftOpenValue","rightOpenValue","leftActivationValue","rightActivationValue","swipeActivationPercentage","stopLeftSwipe","stopRightSwipe","friction","disableLeftSwipe","disableRightSwipe"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableItem.tsx";var SwipeableItem=function SwipeableItem(_ref){var theme=_ref.theme,style=_ref.style,childrenProp=_ref.children,Icon=_ref.Icon,closeOnPress=_ref.closeOnPress,leftOpenValue=_ref.leftOpenValue,rightOpenValue=_ref.rightOpenValue,leftActivationValue=_ref.leftActivationValue,rightActivationValue=_ref.rightActivationValue,_ref$swipeActivationP=_ref.swipeActivationPercentage,swipeActivationPercentage=_ref$swipeActivationP===void 0?80:_ref$swipeActivationP,stopLeftSwipe=_ref.stopLeftSwipe,stopRightSwipe=_ref.stopRightSwipe,_ref$friction=_ref.friction,friction=_ref$friction===void 0?20:_ref$friction,disableLeftSwipe=_ref.disableLeftSwipe,disableRightSwipe=_ref.disableRightSwipe,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var isEmptyObject=function isEmptyObject(object){return Object.keys(object).length===0;};var _React$useContext=_react.default.useContext(_SwipeableList.SwipeableListContext),onStartSwiping=_React$useContext.onStartSwiping,onStopSwiping=_React$useContext.onStopSwiping;var swipeableRef=_react.default.useRef(null);var _extractStyles=(0,_utilities.extractStyles)(style),viewStyles=_extractStyles.viewStyles,textStyles=_extractStyles.textStyles;var _extractBorderAndMarg=(0,_utilities.extractBorderAndMarginStyles)(viewStyles),borderStyles=_extractBorderAndMarg.borderStyles,marginStyles=_extractBorderAndMarg.marginStyles;var sizeStyles=(0,_utilities.extractSizeStyles)(viewStyles);var parentContainerStyles=_reactNative.StyleSheet.flatten([borderStyles,marginStyles,(0,_utilities.extractFlexItemStyles)(viewStyles),(0,_utilities.extractPositionStyles)(viewStyles),(0,_utilities.extractEffectStyles)(viewStyles),sizeStyles]);Object.keys(parentContainerStyles).forEach(function(key){return delete viewStyles[key];});var surfaceContainerStyles=_reactNative.StyleSheet.flatten([viewStyles,sizeStyles]);var _React$useState=_react.default.useState(null),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),componentWidth=_React$useState2[0],setComponentWidth=_React$useState2[1];var children=_react.default.useMemo(function(){return(0,_utilities.flattenReactFragments)(_react.default.Children.toArray(childrenProp));},[childrenProp]);var leftSwipeButtons=_react.default.useMemo(function(){return children.filter(function(child){return _react.default.isValidElement(child)&&child.type===_SwipeableItemButton.default&&child.props.revealSwipeDirection==="left";});},[children]);var rightSwipeButtons=_react.default.useMemo(function(){return children.filter(function(child){return _react.default.isValidElement(child)&&child.type===_SwipeableItemButton.default&&child.props.revealSwipeDirection==="right";});},[children]);var remainingChildren=_react.default.useMemo(function(){return _react.default.Children.toArray(children).filter(function(child){return _react.default.isValidElement(child)&&child.type!==_SwipeableItemButton.default;});},[children]);var leftSwipe=(0,_SwipeableItemCommon.extractLeftSwipeProps)(rest);var rightSwipe=(0,_SwipeableItemCommon.extractRightSwipeProps)(rest);var isLeftSwipeHandled=!isEmptyObject(leftSwipe);var isRightSwipeHandled=!isEmptyObject(rightSwipe);if(leftSwipeButtons.length>2||rightSwipeButtons.length>2){throw Error("Cannot have more than 2 SwipeableItemButton(s) per side");}if(leftSwipeButtons.length&&isLeftSwipeHandled||rightSwipeButtons.length&&isRightSwipeHandled){throw Error("Colliding configuration in SwipeableItem. You cannot have SwipeableItemButton(s) on the swipe direction where swipe handling is configured. Either reset swipe configuration or remove the button(s).");}var renderBehindItem=function renderBehindItem(item,index){return(0,_jsxRuntime.jsxs)(_Pressable.default,{testID:"swipeable-behind-item",onPress:function onPress(){item.onPress==null?void 0:item.onPress();if(item.closeOnPress!==false){var _swipeableRef$current;(_swipeableRef$current=swipeableRef.current)==null?void 0:_swipeableRef$current.closeRow();}},style:[styles.buttonContainer,{backgroundColor:item.backgroundColor||theme.colors.primary}],children:[item.icon&&(0,_jsxRuntime.jsx)(Icon,{name:item.icon,size:item.iconSize||25,color:item.color||theme.colors.surface}),item.title&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[textStyles,{color:item.color||theme.colors.surface}],children:item.title})]},index.toString());};var defaultLeftOpenValue=componentWidth?componentWidth/2:0;var defaultRightOpenValue=componentWidth?-componentWidth/2:0;return(0,_jsxRuntime.jsx)(_reactNative.View,{onLayout:function onLayout(event){setComponentWidth(event.nativeEvent.layout.width);},style:[styles.parentContainer,parentContainerStyles],children:(0,_jsxRuntime.jsxs)(_reactNativeSwipeListView.SwipeRow,Object.assign({ref:swipeableRef,leftOpenValue:isRightSwipeHandled?0:leftOpenValue||defaultLeftOpenValue,rightOpenValue:isLeftSwipeHandled?0:rightOpenValue||defaultRightOpenValue,leftActivationValue:leftActivationValue||isRightSwipeHandled?defaultLeftOpenValue*(swipeActivationPercentage/100):defaultLeftOpenValue,rightActivationValue:rightActivationValue||isLeftSwipeHandled?defaultRightOpenValue*(swipeActivationPercentage/100):defaultRightOpenValue,stopLeftSwipe:stopRightSwipe||defaultLeftOpenValue,stopRightSwipe:stopLeftSwipe||defaultRightOpenValue,onLeftAction:isRightSwipeHandled?function(){return rightSwipe.onSwipedRight==null?void 0:rightSwipe.onSwipedRight();}:undefined,onRightAction:isLeftSwipeHandled?function(){return leftSwipe.onSwipedLeft==null?void 0:leftSwipe.onSwipedLeft();}:undefined,swipeGestureBegan:onStartSwiping,swipeGestureEnded:onStopSwiping,closeOnRowPress:closeOnPress,friction:friction,disableLeftSwipe:disableRightSwipe,disableRightSwipe:disableLeftSwipe},rest,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.behindContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.behindContainerItem,children:isRightSwipeHandled?renderBehindItem((0,_SwipeableItemCommon.rightSwipeToSwipeableItemBehindItem)(rightSwipe),0):rightSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.behindContainerItem,children:isLeftSwipeHandled?renderBehindItem((0,_SwipeableItemCommon.leftSwipeToSwipeableItemBehindItem)(leftSwipe),0):leftSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.surfaceContainer,{backgroundColor:theme.colors.background},surfaceContainerStyles],children:remainingChildren})]}))});};var styles=_reactNative.StyleSheet.create({parentContainer:{overflow:"hidden",minHeight:50},behindContainer:{flex:1,width:"100%",height:"100%",flexDirection:"row"},behindContainerItem:{flex:1,flexDirection:"row"},buttonContainer:{flex:1,alignItems:"center",justifyContent:"center"},surfaceContainer:{width:"100%",minHeight:50,overflow:"hidden"}});var _default=(0,_theming.withTheme)(SwipeableItem);exports.default=_default;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","style","children","Icon","closeOnPress","leftOpenValue","rightOpenValue","leftActivationValue","rightActivationValue","swipeActivationPercentage","stopLeftSwipe","stopRightSwipe","friction","disableLeftSwipe","disableRightSwipe"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableItem.tsx";import React from"react";import{View,StyleSheet,Text}from"react-native";import Pressable from"../Pressable";import{extractBorderAndMarginStyles,extractEffectStyles,extractFlexItemStyles,extractPositionStyles,extractSizeStyles,extractStyles,flattenReactFragments}from"../../utilities";import{SwipeRow}from"react-native-swipe-list-view";import{withTheme}from"../../theming";import SwipeableItemButton from"./SwipeableItemButton";import{SwipeableListContext}from"./SwipeableList";import{leftSwipeToSwipeableItemBehindItem,rightSwipeToSwipeableItemBehindItem,extractLeftSwipeProps,extractRightSwipeProps}from"./SwipeableItemCommon";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var SwipeableItem=function SwipeableItem(_ref){var theme=_ref.theme,style=_ref.style,childrenProp=_ref.children,Icon=_ref.Icon,closeOnPress=_ref.closeOnPress,leftOpenValue=_ref.leftOpenValue,rightOpenValue=_ref.rightOpenValue,leftActivationValue=_ref.leftActivationValue,rightActivationValue=_ref.rightActivationValue,_ref$swipeActivationP=_ref.swipeActivationPercentage,swipeActivationPercentage=_ref$swipeActivationP===void 0?80:_ref$swipeActivationP,stopLeftSwipe=_ref.stopLeftSwipe,stopRightSwipe=_ref.stopRightSwipe,_ref$friction=_ref.friction,friction=_ref$friction===void 0?20:_ref$friction,disableLeftSwipe=_ref.disableLeftSwipe,disableRightSwipe=_ref.disableRightSwipe,rest=_objectWithoutProperties(_ref,_excluded);var isEmptyObject=function isEmptyObject(object){return Object.keys(object).length===0;};var _React$useContext=React.useContext(SwipeableListContext),onStartSwiping=_React$useContext.onStartSwiping,onStopSwiping=_React$useContext.onStopSwiping;var swipeableRef=React.useRef(null);var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles,textStyles=_extractStyles.textStyles;var _extractBorderAndMarg=extractBorderAndMarginStyles(viewStyles),borderStyles=_extractBorderAndMarg.borderStyles,marginStyles=_extractBorderAndMarg.marginStyles;var sizeStyles=extractSizeStyles(viewStyles);var parentContainerStyles=StyleSheet.flatten([borderStyles,marginStyles,extractFlexItemStyles(viewStyles),extractPositionStyles(viewStyles),extractEffectStyles(viewStyles),sizeStyles]);Object.keys(parentContainerStyles).forEach(function(key){return delete viewStyles[key];});var surfaceContainerStyles=StyleSheet.flatten([viewStyles,sizeStyles]);var _React$useState=React.useState(null),_React$useState2=_slicedToArray(_React$useState,2),componentWidth=_React$useState2[0],setComponentWidth=_React$useState2[1];var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp));},[childrenProp]);var leftSwipeButtons=React.useMemo(function(){return children.filter(function(child){return React.isValidElement(child)&&child.type===SwipeableItemButton&&child.props.revealSwipeDirection==="left";});},[children]);var rightSwipeButtons=React.useMemo(function(){return children.filter(function(child){return React.isValidElement(child)&&child.type===SwipeableItemButton&&child.props.revealSwipeDirection==="right";});},[children]);var remainingChildren=React.useMemo(function(){return React.Children.toArray(children).filter(function(child){return React.isValidElement(child)&&child.type!==SwipeableItemButton;});},[children]);var leftSwipe=extractLeftSwipeProps(rest);var rightSwipe=extractRightSwipeProps(rest);var isLeftSwipeHandled=!isEmptyObject(leftSwipe);var isRightSwipeHandled=!isEmptyObject(rightSwipe);if(leftSwipeButtons.length>2||rightSwipeButtons.length>2){throw Error("Cannot have more than 2 SwipeableItemButton(s) per side");}if(leftSwipeButtons.length&&isLeftSwipeHandled||rightSwipeButtons.length&&isRightSwipeHandled){throw Error("Colliding configuration in SwipeableItem. You cannot have SwipeableItemButton(s) on the swipe direction where swipe handling is configured. Either reset swipe configuration or remove the button(s).");}var renderBehindItem=function renderBehindItem(item,index){return _jsxs(Pressable,{testID:"swipeable-behind-item",onPress:function onPress(){item.onPress==null?void 0:item.onPress();if(item.closeOnPress!==false){var _swipeableRef$current;(_swipeableRef$current=swipeableRef.current)==null?void 0:_swipeableRef$current.closeRow();}},style:[styles.buttonContainer,{backgroundColor:item.backgroundColor||theme.colors.primary}],children:[item.icon&&_jsx(Icon,{name:item.icon,size:item.iconSize||25,color:item.color||theme.colors.surface}),item.title&&_jsx(Text,{style:[textStyles,{color:item.color||theme.colors.surface}],children:item.title})]},index.toString());};var defaultLeftOpenValue=componentWidth?componentWidth/2:0;var defaultRightOpenValue=componentWidth?-componentWidth/2:0;return _jsx(View,{onLayout:function onLayout(event){setComponentWidth(event.nativeEvent.layout.width);},style:[styles.parentContainer,parentContainerStyles],children:_jsxs(SwipeRow,Object.assign({ref:swipeableRef,leftOpenValue:isRightSwipeHandled?0:leftOpenValue||defaultLeftOpenValue,rightOpenValue:isLeftSwipeHandled?0:rightOpenValue||defaultRightOpenValue,leftActivationValue:leftActivationValue||isRightSwipeHandled?defaultLeftOpenValue*(swipeActivationPercentage/100):defaultLeftOpenValue,rightActivationValue:rightActivationValue||isLeftSwipeHandled?defaultRightOpenValue*(swipeActivationPercentage/100):defaultRightOpenValue,stopLeftSwipe:stopRightSwipe||defaultLeftOpenValue,stopRightSwipe:stopLeftSwipe||defaultRightOpenValue,onLeftAction:isRightSwipeHandled?function(){return rightSwipe.onSwipedRight==null?void 0:rightSwipe.onSwipedRight();}:undefined,onRightAction:isLeftSwipeHandled?function(){return leftSwipe.onSwipedLeft==null?void 0:leftSwipe.onSwipedLeft();}:undefined,swipeGestureBegan:onStartSwiping,swipeGestureEnded:onStopSwiping,closeOnRowPress:closeOnPress,friction:friction,disableLeftSwipe:disableRightSwipe,disableRightSwipe:disableLeftSwipe},rest,{children:[_jsxs(View,{style:styles.behindContainer,children:[_jsx(View,{style:styles.behindContainerItem,children:isRightSwipeHandled?renderBehindItem(rightSwipeToSwipeableItemBehindItem(rightSwipe),0):rightSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})}),_jsx(View,{style:styles.behindContainerItem,children:isLeftSwipeHandled?renderBehindItem(leftSwipeToSwipeableItemBehindItem(leftSwipe),0):leftSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})})]}),_jsx(View,{style:[styles.surfaceContainer,{backgroundColor:theme.colors.background},surfaceContainerStyles],children:remainingChildren})]}))});};var styles=StyleSheet.create({parentContainer:{overflow:"hidden",minHeight:50},behindContainer:{flex:1,width:"100%",height:"100%",flexDirection:"row"},behindContainerItem:{flex:1,flexDirection:"row"},buttonContainer:{flex:1,alignItems:"center",justifyContent:"center"},surfaceContainer:{width:"100%",minHeight:50,overflow:"hidden"}});export default withTheme(SwipeableItem);
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var SwipeableItemButton=function SwipeableItemButton(){return null;};var _default=SwipeableItemButton;exports.default=_default;
1
+ var SwipeableItemButton=function SwipeableItemButton(){return null;};export default SwipeableItemButton;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.extractLeftSwipeProps=extractLeftSwipeProps;exports.extractRightSwipeProps=extractRightSwipeProps;exports.leftSwipeToSwipeableItemBehindItem=leftSwipeToSwipeableItemBehindItem;exports.rightSwipeToSwipeableItemBehindItem=rightSwipeToSwipeableItemBehindItem;var _lodash=require("lodash");function extractRightSwipeProps(object){return(0,_lodash.pick)(object,["onSwipedRight","rightSwipeTitle","rightSwipeIcon","rightSwipeIconSize","rightSwipeBackgroundColor","rightSwipeColor"]);}function extractLeftSwipeProps(object){return(0,_lodash.pick)(object,["onSwipedLeft","leftSwipeTitle","leftSwipeIcon","leftSwipeIconSize","leftSwipeBackgroundColor","leftSwipeColor"]);}function rightSwipeToSwipeableItemBehindItem(swipe){return{title:swipe.rightSwipeTitle||"",revealSwipeDirection:"right",onSwipe:swipe.onSwipedRight,icon:swipe.rightSwipeIcon,iconSize:swipe.rightSwipeIconSize,backgroundColor:swipe.rightSwipeBackgroundColor,color:swipe.rightSwipeColor};}function leftSwipeToSwipeableItemBehindItem(swipe){return{title:swipe.leftSwipeTitle||"",revealSwipeDirection:"left",onSwipe:swipe.onSwipedLeft,icon:swipe.leftSwipeIcon,iconSize:swipe.leftSwipeIconSize,backgroundColor:swipe.leftSwipeBackgroundColor,color:swipe.leftSwipeColor};}
1
+ import{pick}from"lodash";export function extractRightSwipeProps(object){return pick(object,["onSwipedRight","rightSwipeTitle","rightSwipeIcon","rightSwipeIconSize","rightSwipeBackgroundColor","rightSwipeColor"]);}export function extractLeftSwipeProps(object){return pick(object,["onSwipedLeft","leftSwipeTitle","leftSwipeIcon","leftSwipeIconSize","leftSwipeBackgroundColor","leftSwipeColor"]);}export function rightSwipeToSwipeableItemBehindItem(swipe){return{title:swipe.rightSwipeTitle||"",revealSwipeDirection:"right",onSwipe:swipe.onSwipedRight,icon:swipe.rightSwipeIcon,iconSize:swipe.rightSwipeIconSize,backgroundColor:swipe.rightSwipeBackgroundColor,color:swipe.rightSwipeColor};}export function leftSwipeToSwipeableItemBehindItem(swipe){return{title:swipe.leftSwipeTitle||"",revealSwipeDirection:"left",onSwipe:swipe.onSwipedLeft,icon:swipe.leftSwipeIcon,iconSize:swipe.leftSwipeIconSize,backgroundColor:swipe.leftSwipeBackgroundColor,color:swipe.leftSwipeColor};}
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.SwipeableListContext=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _flashList=require("@shopify/flash-list");var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["disableScrollWhenSwiping","listComponent"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableList.tsx";var SwipeableListContext=_react.default.createContext({onStartSwiping:function onStartSwiping(){},onStopSwiping:function onStopSwiping(){}});exports.SwipeableListContext=SwipeableListContext;var SwipeableList=function SwipeableList(_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=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _React$useState=_react.default.useState(false),_React$useState2=(0,_slicedToArray2.default)(_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(0,_jsxRuntime.jsx)(_reactNative.FlatList,Object.assign({},rest));case"FlashList":return(0,_jsxRuntime.jsx)(_flashList.FlashList,Object.assign({},rest));}};return(0,_jsxRuntime.jsx)(SwipeableListContext.Provider,{value:{onStartSwiping:onStartSwiping,onStopSwiping:onStopSwiping},children:(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:renderListComponent()})});};var _default=SwipeableList;exports.default=_default;
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}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export var SwipeableListContext=React.createContext({onStartSwiping:function onStartSwiping(){},onStopSwiping:function onStopSwiping(){}});var SwipeableList=function SwipeableList(_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({},rest));case"FlashList":return _jsx(FlashList,Object.assign({},rest));}};return _jsx(SwipeableListContext.Provider,{value:{onStartSwiping:onStartSwiping,onStopSwiping:onStopSwiping},children:_jsx(_Fragment,{children:renderListComponent()})});};export default SwipeableList;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"SwipeableItem",{enumerable:true,get:function get(){return _SwipeableItem.default;}});Object.defineProperty(exports,"SwipeableItemButton",{enumerable:true,get:function get(){return _SwipeableItemButton.default;}});Object.defineProperty(exports,"SwipeableList",{enumerable:true,get:function get(){return _SwipeableList.default;}});var _SwipeableItem=_interopRequireDefault(require("./SwipeableItem"));var _SwipeableItemButton=_interopRequireDefault(require("./SwipeableItemButton"));var _SwipeableList=_interopRequireDefault(require("./SwipeableList"));
1
+ export{default as SwipeableItem}from"./SwipeableItem";export{default as SwipeableItemButton}from"./SwipeableItemButton";export{default as SwipeableList}from"./SwipeableList";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _reactNativeWebSwiper=_interopRequireDefault(require("react-native-web-swiper"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Swiper/Swiper.tsx";var Swiper=function Swiper(_ref){var _data$length;var _ref$vertical=_ref.vertical,vertical=_ref$vertical===void 0?false:_ref$vertical,_ref$loop=_ref.loop,loop=_ref$loop===void 0?false:_ref$loop,_ref$timeout=_ref.timeout,timeout=_ref$timeout===void 0?0:_ref$timeout,_ref$from=_ref.from,from=_ref$from===void 0?0:_ref$from,_ref$prevTitle=_ref.prevTitle,prevTitle=_ref$prevTitle===void 0?"":_ref$prevTitle,_ref$nextTitle=_ref.nextTitle,nextTitle=_ref$nextTitle===void 0?"":_ref$nextTitle,prevTitleColor=_ref.prevTitleColor,nextTitleColor=_ref.nextTitleColor,_ref$dotsTouchable=_ref.dotsTouchable,dotsTouchable=_ref$dotsTouchable===void 0?true:_ref$dotsTouchable,dotColor=_ref.dotColor,dotActiveColor=_ref.dotActiveColor,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,onIndexChangedProp=_ref.onIndexChanged,onSwipe=_ref.onSwipe,onSwipedNext=_ref.onSwipedNext,onSwipedPrevious=_ref.onSwipedPrevious,minDistanceForAction=_ref.minDistanceForAction,minDistanceToCapture=_ref.minDistanceToCapture,style=_ref.style;var _React$useState=_react.default.useState(0),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),currentIndex=_React$useState2[0],setCurrentIndex=_React$useState2[1];var numberOfItems=(_data$length=data==null?void 0:data.length)!=null?_data$length:_react.default.Children.count(childrenProp);var swiperRef=_react.default.useRef(null);var onIndexChanged=function onIndexChanged(index){var previous=currentIndex;var current=index;onIndexChangedProp==null?void 0:onIndexChangedProp(index);setCurrentIndex(index);if(previous===numberOfItems-1&&current===0){onSwipedNext==null?void 0:onSwipedNext(previous);}else if(previous===0&&current===numberOfItems-1){onSwipedPrevious==null?void 0:onSwipedPrevious(previous);}else if(current>previous){onSwipedNext==null?void 0:onSwipedNext(previous);}else if(current<previous){onSwipedPrevious==null?void 0:onSwipedPrevious(previous);}onSwipe==null?void 0:onSwipe(previous);};var children=_react.default.useMemo(function(){return Array.isArray(data)&&renderItem?data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index;return _react.default.cloneElement(component,{key:key});}):childrenProp;},[childrenProp,data,renderItem,keyExtractor]);_react.default.useEffect(function(){var _swiperRef$current,_swiperRef$current$pr;var childrenArray=_react.default.Children.toArray((_swiperRef$current=swiperRef.current)==null?void 0:(_swiperRef$current$pr=_swiperRef$current.props)==null?void 0:_swiperRef$current$pr.children);if(swiperRef.current){swiperRef.current.children=childrenArray;swiperRef.current.count=childrenArray.length;swiperRef.current.forceUpdate();}},[children]);return(0,_jsxRuntime.jsx)(_reactNative.View,{style:style,children:(0,_jsxRuntime.jsx)(_reactNativeWebSwiper.default,{ref:swiperRef,from:from,loop:loop,timeout:timeout,vertical:vertical,onIndexChanged:onIndexChanged,minDistanceForAction:minDistanceForAction,minDistanceToCapture:minDistanceToCapture,controlsProps:Object.assign({prevTitle:prevTitle,nextTitle:nextTitle,prevTitleStyle:{color:prevTitleColor},nextTitleStyle:{color:nextTitleColor},dotsTouchable:dotsTouchable},dotColor?{dotProps:{badgeStyle:{backgroundColor:dotColor}}}:{},dotActiveColor?{dotActiveStyle:{backgroundColor:dotActiveColor}}:{}),children:children})});};var _default=Swiper;exports.default=_default;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Swiper/Swiper.tsx";import React from"react";import{View}from"react-native";import SwiperComponent from"react-native-web-swiper";import{jsx as _jsx}from"react/jsx-runtime";var Swiper=function Swiper(_ref){var _data$length;var _ref$vertical=_ref.vertical,vertical=_ref$vertical===void 0?false:_ref$vertical,_ref$loop=_ref.loop,loop=_ref$loop===void 0?false:_ref$loop,_ref$timeout=_ref.timeout,timeout=_ref$timeout===void 0?0:_ref$timeout,_ref$from=_ref.from,from=_ref$from===void 0?0:_ref$from,_ref$prevTitle=_ref.prevTitle,prevTitle=_ref$prevTitle===void 0?"":_ref$prevTitle,_ref$nextTitle=_ref.nextTitle,nextTitle=_ref$nextTitle===void 0?"":_ref$nextTitle,prevTitleColor=_ref.prevTitleColor,nextTitleColor=_ref.nextTitleColor,_ref$dotsTouchable=_ref.dotsTouchable,dotsTouchable=_ref$dotsTouchable===void 0?true:_ref$dotsTouchable,dotColor=_ref.dotColor,dotActiveColor=_ref.dotActiveColor,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,onIndexChangedProp=_ref.onIndexChanged,onSwipe=_ref.onSwipe,onSwipedNext=_ref.onSwipedNext,onSwipedPrevious=_ref.onSwipedPrevious,minDistanceForAction=_ref.minDistanceForAction,minDistanceToCapture=_ref.minDistanceToCapture,style=_ref.style;var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),currentIndex=_React$useState2[0],setCurrentIndex=_React$useState2[1];var numberOfItems=(_data$length=data==null?void 0:data.length)!=null?_data$length:React.Children.count(childrenProp);var swiperRef=React.useRef(null);var onIndexChanged=function onIndexChanged(index){var previous=currentIndex;var current=index;onIndexChangedProp==null?void 0:onIndexChangedProp(index);setCurrentIndex(index);if(previous===numberOfItems-1&&current===0){onSwipedNext==null?void 0:onSwipedNext(previous);}else if(previous===0&&current===numberOfItems-1){onSwipedPrevious==null?void 0:onSwipedPrevious(previous);}else if(current>previous){onSwipedNext==null?void 0:onSwipedNext(previous);}else if(current<previous){onSwipedPrevious==null?void 0:onSwipedPrevious(previous);}onSwipe==null?void 0:onSwipe(previous);};var children=React.useMemo(function(){return Array.isArray(data)&&renderItem?data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index;return React.cloneElement(component,{key:key});}):childrenProp;},[childrenProp,data,renderItem,keyExtractor]);React.useEffect(function(){var _swiperRef$current,_swiperRef$current$pr;var childrenArray=React.Children.toArray((_swiperRef$current=swiperRef.current)==null?void 0:(_swiperRef$current$pr=_swiperRef$current.props)==null?void 0:_swiperRef$current$pr.children);if(swiperRef.current){swiperRef.current.children=childrenArray;swiperRef.current.count=childrenArray.length;swiperRef.current.forceUpdate();}},[children]);return _jsx(View,{style:style,children:_jsx(SwiperComponent,{ref:swiperRef,from:from,loop:loop,timeout:timeout,vertical:vertical,onIndexChanged:onIndexChanged,minDistanceForAction:minDistanceForAction,minDistanceToCapture:minDistanceToCapture,controlsProps:Object.assign({prevTitle:prevTitle,nextTitle:nextTitle,prevTitleStyle:{color:prevTitleColor},nextTitleStyle:{color:nextTitleColor},dotsTouchable:dotsTouchable},dotColor?{dotProps:{badgeStyle:{backgroundColor:dotColor}}}:{},dotActiveColor?{dotActiveStyle:{backgroundColor:dotActiveColor}}:{}),children:children})});};export default Swiper;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Swiper/SwiperItem.tsx";var styles=_reactNative.StyleSheet.create({wrapper:{flex:1}});var SwiperItem=function SwiperItem(_ref){var children=_ref.children,style=_ref.style;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.wrapper,style],children:children});};var _default=SwiperItem;exports.default=_default;
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Swiper/SwiperItem.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var styles=StyleSheet.create({wrapper:{flex:1}});var SwiperItem=function SwiperItem(_ref){var children=_ref.children,style=_ref.style;return _jsx(View,{style:[styles.wrapper,style],children:children});};export default SwiperItem;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Swiper",{enumerable:true,get:function get(){return _Swiper.default;}});Object.defineProperty(exports,"SwiperItem",{enumerable:true,get:function get(){return _SwiperItem.default;}});var _Swiper=_interopRequireDefault(require("./Swiper"));var _SwiperItem=_interopRequireDefault(require("./SwiperItem"));
1
+ export{default as Swiper}from"./Swiper";export{default as SwiperItem}from"./SwiperItem";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.SwitchRow=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _theming=require("../theming");var _FormRow=_interopRequireDefault(require("./FormRow"));var _types=require("@draftbit/types");var _hooks=require("../hooks");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Switch.tsx";var _excluded=["value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme","style"],_excluded2=["label","direction","style","value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function Switch(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,disabled=_ref.disabled,_onValueChange=_ref.onValueChange,activeTrackColor=_ref.activeTrackColor,inactiveTrackColor=_ref.inactiveTrackColor,activeThumbColor=_ref.activeThumbColor,inactiveThumbColor=_ref.inactiveThumbColor,theme=_ref.theme,style=_ref.style,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var activeTrackThemeColor=activeTrackColor||theme.colors.primary;var inactiveTrackThemeColor=inactiveTrackColor||"#EEE";var activeThumbThemeColor=activeThumbColor||"#FFF";var inactiveThumbThemeColor=inactiveThumbColor||"#FFF";var _React$useState=React.useState(value||defaultValue),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),checked=_React$useState2[0],setChecked=_React$useState2[1];React.useEffect(function(){if(value!=null&&value!==checked){setChecked(value);}},[value,checked]);var previousDefaultValue=(0,_hooks.usePrevious)(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setChecked(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);return(0,_jsxRuntime.jsx)(_reactNative.Switch,Object.assign({value:checked,disabled:disabled,trackColor:{false:inactiveTrackThemeColor,true:activeTrackThemeColor},thumbColor:value?activeThumbThemeColor:inactiveThumbThemeColor,activeThumbColor:activeThumbThemeColor,ios_backgroundColor:inactiveTrackThemeColor,style:style,onValueChange:function onValueChange(bool){setChecked(bool);_onValueChange&&_onValueChange(bool);}},rest));}function Row(_ref2){var _ref2$label=_ref2.label,label=_ref2$label===void 0?"Label":_ref2$label,_ref2$direction=_ref2.direction,direction=_ref2$direction===void 0?_types.RowDirection.Row:_ref2$direction,style=_ref2.style,value=_ref2.value,defaultValue=_ref2.defaultValue,disabled=_ref2.disabled,onValueChange=_ref2.onValueChange,activeTrackColor=_ref2.activeTrackColor,inactiveTrackColor=_ref2.inactiveTrackColor,activeThumbColor=_ref2.activeThumbColor,inactiveThumbColor=_ref2.inactiveThumbColor,theme=_ref2.theme,rest=(0,_objectWithoutProperties2.default)(_ref2,_excluded2);var _React$useState3=React.useState(value!=null?value:defaultValue),_React$useState4=(0,_slicedToArray2.default)(_React$useState3,2),checked=_React$useState4[0],setChecked=_React$useState4[1];React.useEffect(function(){if(value!=null){setChecked(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setChecked(defaultValue);}},[defaultValue]);return(0,_jsxRuntime.jsx)(_FormRow.default,Object.assign({disabled:disabled,onPress:function onPress(){setChecked(!checked);onValueChange&&onValueChange(!checked);},label:label,direction:direction,style:style},rest,{children:(0,_jsxRuntime.jsx)(Switch,{theme:theme,value:checked,disabled:disabled,onValueChange:onValueChange,activeTrackColor:activeTrackColor,inactiveTrackColor:inactiveTrackColor,activeThumbColor:activeThumbColor,inactiveThumbColor:inactiveThumbColor})}));}var SwitchRow=(0,_theming.withTheme)(Row);exports.SwitchRow=SwitchRow;var _default=(0,_theming.withTheme)(Switch);exports.default=_default;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Switch.tsx";var _excluded=["value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme","style"],_excluded2=["label","direction","style","value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme"];import*as React from"react";import{Switch as NativeSwitch}from"react-native";import{withTheme}from"../theming";import FormRow from"./FormRow";import{RowDirection}from"@draftbit/types";import{usePrevious}from"../hooks";import{jsx as _jsx}from"react/jsx-runtime";function Switch(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,disabled=_ref.disabled,_onValueChange=_ref.onValueChange,activeTrackColor=_ref.activeTrackColor,inactiveTrackColor=_ref.inactiveTrackColor,activeThumbColor=_ref.activeThumbColor,inactiveThumbColor=_ref.inactiveThumbColor,theme=_ref.theme,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var activeTrackThemeColor=activeTrackColor||theme.colors.primary;var inactiveTrackThemeColor=inactiveTrackColor||"#EEE";var activeThumbThemeColor=activeThumbColor||"#FFF";var inactiveThumbThemeColor=inactiveThumbColor||"#FFF";var _React$useState=React.useState(value||defaultValue),_React$useState2=_slicedToArray(_React$useState,2),checked=_React$useState2[0],setChecked=_React$useState2[1];React.useEffect(function(){if(value!=null&&value!==checked){setChecked(value);}},[value,checked]);var previousDefaultValue=usePrevious(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setChecked(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);return _jsx(NativeSwitch,Object.assign({value:checked,disabled:disabled,trackColor:{false:inactiveTrackThemeColor,true:activeTrackThemeColor},thumbColor:value?activeThumbThemeColor:inactiveThumbThemeColor,activeThumbColor:activeThumbThemeColor,ios_backgroundColor:inactiveTrackThemeColor,style:style,onValueChange:function onValueChange(bool){setChecked(bool);_onValueChange&&_onValueChange(bool);}},rest));}function Row(_ref2){var _ref2$label=_ref2.label,label=_ref2$label===void 0?"Label":_ref2$label,_ref2$direction=_ref2.direction,direction=_ref2$direction===void 0?RowDirection.Row:_ref2$direction,style=_ref2.style,value=_ref2.value,defaultValue=_ref2.defaultValue,disabled=_ref2.disabled,onValueChange=_ref2.onValueChange,activeTrackColor=_ref2.activeTrackColor,inactiveTrackColor=_ref2.inactiveTrackColor,activeThumbColor=_ref2.activeThumbColor,inactiveThumbColor=_ref2.inactiveThumbColor,theme=_ref2.theme,rest=_objectWithoutProperties(_ref2,_excluded2);var _React$useState3=React.useState(value!=null?value:defaultValue),_React$useState4=_slicedToArray(_React$useState3,2),checked=_React$useState4[0],setChecked=_React$useState4[1];React.useEffect(function(){if(value!=null){setChecked(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setChecked(defaultValue);}},[defaultValue]);return _jsx(FormRow,Object.assign({disabled:disabled,onPress:function onPress(){setChecked(!checked);onValueChange&&onValueChange(!checked);},label:label,direction:direction,style:style},rest,{children:_jsx(Switch,{theme:theme,value:checked,disabled:disabled,onValueChange:onValueChange,activeTrackColor:activeTrackColor,inactiveTrackColor:inactiveTrackColor,activeThumbColor:activeThumbColor,inactiveThumbColor:inactiveThumbColor})}));}var SwitchRow=withTheme(Row);export{SwitchRow};export default withTheme(Switch);
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var React=_interopRequireWildcard(require("react"));var _reactNativeTabView=require("react-native-tab-view");var _TabViewItem=_interopRequireDefault(require("./TabViewItem"));var _theming=require("../../theming");var _utilities=require("../../utilities");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabView.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var TabViewComponent=function TabViewComponent(_ref){var Icon=_ref.Icon,onIndexChanged=_ref.onIndexChanged,onEndReached=_ref.onEndReached,_ref$initialTabIndex=_ref.initialTabIndex,initialTabIndex=_ref$initialTabIndex===void 0?0:_ref$initialTabIndex,tabBarPosition=_ref.tabBarPosition,keyboardDismissMode=_ref.keyboardDismissMode,swipeEnabled=_ref.swipeEnabled,scrollEnabled=_ref.scrollEnabled,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,pressColor=_ref.pressColor,indicatorColor=_ref.indicatorColor,tabsBackgroundColor=_ref.tabsBackgroundColor,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?16:_ref$iconSize,style=_ref.style,theme=_ref.theme,childrenProp=_ref.children;var _React$useState=React.useState(initialTabIndex),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),index=_React$useState2[0],setIndex=_React$useState2[1];var _React$useState3=React.useState([]),_React$useState4=(0,_slicedToArray2.default)(_React$useState3,2),routes=_React$useState4[0],setRoutes=_React$useState4[1];var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var children=React.useMemo(function(){return(0,_utilities.flattenReactFragments)(React.Children.toArray(childrenProp)).filter(function(child){return React.isValidElement(child)&&child.type===_TabViewItem.default;});},[childrenProp]);React.useEffect(function(){var newRoutes=[];children.forEach(function(item,idx){var child=item;newRoutes.push({key:idx.toString(),title:child.props.title,icon:child.props.icon,accessibilityLabel:child.props.accessibilityLabel});});setRoutes(newRoutes);},[children]);var indexChangeHandler=function indexChangeHandler(i){setIndex(i);onIndexChanged==null?void 0:onIndexChanged(i);if(i===routes.length){onEndReached==null?void 0:onEndReached();}};var renderTabBar=function renderTabBar(props){return(0,_jsxRuntime.jsx)(_reactNativeTabView.TabBar,Object.assign({},props,{activeColor:activeColor||theme.colors.primary,inactiveColor:inactiveColor||"rgb(200,200,200)",pressColor:pressColor||theme.colors.primary,scrollEnabled:scrollEnabled,indicatorStyle:{backgroundColor:indicatorColor||theme.colors.primary},labelStyle:[{textTransform:"none"},textStyles],renderIcon:function renderIcon(_ref2){var route=_ref2.route,color=_ref2.color;return route!=null&&route.icon?(0,_jsxRuntime.jsx)(Icon,{name:route.icon,color:color,size:iconSize}):null;},style:{backgroundColor:tabsBackgroundColor||theme.colors.background}}));};var renderScene=function renderScene(_ref3){var route=_ref3.route;var index=Number(route.key);return children[index];};if(!routes.length){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{});}return(0,_jsxRuntime.jsx)(_reactNativeTabView.TabView,{style:viewStyles,navigationState:{index:index,routes:routes},renderScene:renderScene,renderTabBar:renderTabBar,onIndexChange:indexChangeHandler,tabBarPosition:tabBarPosition,keyboardDismissMode:keyboardDismissMode,swipeEnabled:swipeEnabled});};var _default=(0,_theming.withTheme)(TabViewComponent);exports.default=_default;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabView.tsx";import*as React from"react";import{TabView,TabBar}from"react-native-tab-view";import TabViewItem from"./TabViewItem";import{withTheme}from"../../theming";import{flattenReactFragments,extractStyles}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var TabViewComponent=function TabViewComponent(_ref){var Icon=_ref.Icon,onIndexChanged=_ref.onIndexChanged,onEndReached=_ref.onEndReached,_ref$initialTabIndex=_ref.initialTabIndex,initialTabIndex=_ref$initialTabIndex===void 0?0:_ref$initialTabIndex,tabBarPosition=_ref.tabBarPosition,keyboardDismissMode=_ref.keyboardDismissMode,swipeEnabled=_ref.swipeEnabled,scrollEnabled=_ref.scrollEnabled,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,pressColor=_ref.pressColor,indicatorColor=_ref.indicatorColor,tabsBackgroundColor=_ref.tabsBackgroundColor,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?16:_ref$iconSize,style=_ref.style,theme=_ref.theme,childrenProp=_ref.children;var _React$useState=React.useState(initialTabIndex),_React$useState2=_slicedToArray(_React$useState,2),index=_React$useState2[0],setIndex=_React$useState2[1];var _React$useState3=React.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),routes=_React$useState4[0],setRoutes=_React$useState4[1];var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp)).filter(function(child){return React.isValidElement(child)&&child.type===TabViewItem;});},[childrenProp]);React.useEffect(function(){var newRoutes=[];children.forEach(function(item,idx){var child=item;newRoutes.push({key:idx.toString(),title:child.props.title,icon:child.props.icon,accessibilityLabel:child.props.accessibilityLabel});});setRoutes(newRoutes);},[children]);var indexChangeHandler=function indexChangeHandler(i){setIndex(i);onIndexChanged==null?void 0:onIndexChanged(i);if(i===routes.length){onEndReached==null?void 0:onEndReached();}};var renderTabBar=function renderTabBar(props){return _jsx(TabBar,Object.assign({},props,{activeColor:activeColor||theme.colors.primary,inactiveColor:inactiveColor||"rgb(200,200,200)",pressColor:pressColor||theme.colors.primary,scrollEnabled:scrollEnabled,indicatorStyle:{backgroundColor:indicatorColor||theme.colors.primary},labelStyle:[{textTransform:"none"},textStyles],renderIcon:function renderIcon(_ref2){var route=_ref2.route,color=_ref2.color;return route!=null&&route.icon?_jsx(Icon,{name:route.icon,color:color,size:iconSize}):null;},style:{backgroundColor:tabsBackgroundColor||theme.colors.background}}));};var renderScene=function renderScene(_ref3){var route=_ref3.route;var index=Number(route.key);return children[index];};if(!routes.length){return _jsx(_Fragment,{});}return _jsx(TabView,{style:viewStyles,navigationState:{index:index,routes:routes},renderScene:renderScene,renderTabBar:renderTabBar,onIndexChange:indexChangeHandler,tabBarPosition:tabBarPosition,keyboardDismissMode:keyboardDismissMode,swipeEnabled:swipeEnabled});};export default withTheme(TabViewComponent);
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabViewItem.tsx";var TabViewItem=function TabViewItem(_ref){var style=_ref.style,children=_ref.children;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.parentContainer,style],children:children});};var styles=_reactNative.StyleSheet.create({parentContainer:{flex:1}});var _default=TabViewItem;exports.default=_default;
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabViewItem.tsx";import React from"react";import{StyleSheet,View}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var TabViewItem=function TabViewItem(_ref){var style=_ref.style,children=_ref.children;return _jsx(View,{style:[styles.parentContainer,style],children:children});};var styles=StyleSheet.create({parentContainer:{flex:1}});export default TabViewItem;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"TabView",{enumerable:true,get:function get(){return _TabView.default;}});Object.defineProperty(exports,"TabViewItem",{enumerable:true,get:function get(){return _TabViewItem.default;}});var _TabView=_interopRequireDefault(require("./TabView"));var _TabViewItem=_interopRequireDefault(require("./TabViewItem"));
1
+ export{default as TabView}from"./TabView";export{default as TabViewItem}from"./TabViewItem";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _theming=require("../../theming");var _TableCommon=require("./TableCommon");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["theme","borderWidth","borderColor","borderStyle","drawTopBorder","drawBottomBorder","drawStartBorder","drawEndBorder","cellVerticalPadding","cellHorizontalPadding","data","keyExtractor","renderItem","children","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/Table.tsx";var Table=function Table(_ref){var theme=_ref.theme,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,_ref$borderColor=_ref.borderColor,borderColor=_ref$borderColor===void 0?theme.colors.divider:_ref$borderColor,_ref$borderStyle=_ref.borderStyle,borderStyle=_ref$borderStyle===void 0?"solid":_ref$borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?true:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,_ref$cellVerticalPadd=_ref.cellVerticalPadding,cellVerticalPadding=_ref$cellVerticalPadd===void 0?10:_ref$cellVerticalPadd,_ref$cellHorizontalPa=_ref.cellHorizontalPadding,cellHorizontalPadding=_ref$cellHorizontalPa===void 0?10:_ref$cellHorizontalPa,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,style=_ref.style,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);if(data&&!renderItem||renderItem&&!data){throw new Error("'renderItem' and 'data' need to both be provided to render from 'data'. Either remove them entirley or include both");}if(data&&renderItem&&childrenProp){console.warn("'children' of Table ignored due to usage of 'data' and 'renderItem'");}var isTableHeader=_react.default.useCallback(function(object){return object.isTableHeader;},[]);var isRenderItem=Array.isArray(data)&&renderItem;var dataAsChildren=_react.default.useMemo(function(){if(!isRenderItem)return[];return data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index.toString();return _react.default.cloneElement(component,{key:key});});},[data,renderItem,keyExtractor,isRenderItem]);var children=isRenderItem?dataAsChildren:_react.default.Children.toArray(childrenProp);var validChildren=_react.default.useMemo(function(){return children.filter(function(item){return _react.default.isValidElement(item);});},[children]);var childrenWithoutHeader=_react.default.useMemo(function(){var flattenedWithoutNestedHeaders=validChildren.map(function(item){var nestedChildren=_react.default.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return _react.default.cloneElement(item,{children:nestedChildren.filter(function(child){return!isTableHeader(child.props);})});}return item;});return flattenedWithoutNestedHeaders.filter(function(item){return!isTableHeader(item.props);});},[validChildren,isTableHeader]);var header=_react.default.useMemo(function(){var flattenedPossibleHeaders=validChildren.map(function(item){var nestedChildren=_react.default.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return nestedHeaders[0];}return item;});var allHeaders=flattenedPossibleHeaders.filter(function(item){return isTableHeader(item.props);});if(allHeaders.length){return allHeaders[0];}return null;},[validChildren,isTableHeader]);var contextValue={borderColor:borderColor,borderStyle:borderStyle,borderWidth:borderWidth,cellHorizontalPadding:cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding};var borderViewStyle=(0,_TableCommon.generateBorderStyles)({borderColor:borderColor,borderWidth:borderWidth,borderStyle:borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});return(0,_jsxRuntime.jsx)(_TableCommon.TableStyleContext.Provider,{value:contextValue,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.container,borderViewStyle,style],children:[(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:header}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,Object.assign({},rest,{children:childrenWithoutHeader}))]})});};var styles=_reactNative.StyleSheet.create({container:{flex:1}});var _default=(0,_theming.withTheme)(Table);exports.default=_default;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","borderWidth","borderColor","borderStyle","drawTopBorder","drawBottomBorder","drawStartBorder","drawEndBorder","cellVerticalPadding","cellHorizontalPadding","data","keyExtractor","renderItem","children","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/Table.tsx";import React from"react";import{ScrollView,View,StyleSheet}from"react-native";import{withTheme}from"../../theming";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Table=function Table(_ref){var theme=_ref.theme,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,_ref$borderColor=_ref.borderColor,borderColor=_ref$borderColor===void 0?theme.colors.divider:_ref$borderColor,_ref$borderStyle=_ref.borderStyle,borderStyle=_ref$borderStyle===void 0?"solid":_ref$borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?true:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,_ref$cellVerticalPadd=_ref.cellVerticalPadding,cellVerticalPadding=_ref$cellVerticalPadd===void 0?10:_ref$cellVerticalPadd,_ref$cellHorizontalPa=_ref.cellHorizontalPadding,cellHorizontalPadding=_ref$cellHorizontalPa===void 0?10:_ref$cellHorizontalPa,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);if(data&&!renderItem||renderItem&&!data){throw new Error("'renderItem' and 'data' need to both be provided to render from 'data'. Either remove them entirley or include both");}if(data&&renderItem&&childrenProp){console.warn("'children' of Table ignored due to usage of 'data' and 'renderItem'");}var isTableHeader=React.useCallback(function(object){return object.isTableHeader;},[]);var isRenderItem=Array.isArray(data)&&renderItem;var dataAsChildren=React.useMemo(function(){if(!isRenderItem)return[];return data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index.toString();return React.cloneElement(component,{key:key});});},[data,renderItem,keyExtractor,isRenderItem]);var children=isRenderItem?dataAsChildren:React.Children.toArray(childrenProp);var validChildren=React.useMemo(function(){return children.filter(function(item){return React.isValidElement(item);});},[children]);var childrenWithoutHeader=React.useMemo(function(){var flattenedWithoutNestedHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return React.cloneElement(item,{children:nestedChildren.filter(function(child){return!isTableHeader(child.props);})});}return item;});return flattenedWithoutNestedHeaders.filter(function(item){return!isTableHeader(item.props);});},[validChildren,isTableHeader]);var header=React.useMemo(function(){var flattenedPossibleHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return nestedHeaders[0];}return item;});var allHeaders=flattenedPossibleHeaders.filter(function(item){return isTableHeader(item.props);});if(allHeaders.length){return allHeaders[0];}return null;},[validChildren,isTableHeader]);var contextValue={borderColor:borderColor,borderStyle:borderStyle,borderWidth:borderWidth,cellHorizontalPadding:cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding};var borderViewStyle=generateBorderStyles({borderColor:borderColor,borderWidth:borderWidth,borderStyle:borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});return _jsx(TableStyleContext.Provider,{value:contextValue,children:_jsxs(View,{style:[styles.container,borderViewStyle,style],children:[_jsx(_Fragment,{children:header}),_jsx(ScrollView,Object.assign({},rest,{children:childrenWithoutHeader}))]})});};var styles=StyleSheet.create({container:{flex:1}});export default withTheme(Table);
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _TableCommon=require("./TableCommon");var _Pressable=_interopRequireDefault(require("../Pressable"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/TableCell.tsx";var TableCell=function TableCell(_ref){var borderWidth=_ref.borderWidth,borderColor=_ref.borderColor,borderStyle=_ref.borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?false:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?true:_ref$drawEndBorder,cellVerticalPadding=_ref.cellVerticalPadding,cellHorizontalPadding=_ref.cellHorizontalPadding,children=_ref.children,onPress=_ref.onPress,style=_ref.style;var parentContextValue=_react.default.useContext(_TableCommon.TableStyleContext);var borderViewStyle=(0,_TableCommon.generateBorderStyles)({borderColor:borderColor||parentContextValue.borderColor,borderWidth:borderWidth||parentContextValue.borderWidth,borderStyle:borderStyle||parentContextValue.borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});var ContainerComponent=onPress?_Pressable.default:_reactNative.View;return(0,_jsxRuntime.jsx)(ContainerComponent,{onPress:onPress,style:[styles.cellContainer,borderViewStyle,{paddingVertical:cellVerticalPadding||parentContextValue.cellVerticalPadding,paddingHorizontal:cellHorizontalPadding||parentContextValue.cellHorizontalPadding},style],children:children});};var styles=_reactNative.StyleSheet.create({cellContainer:{flex:1,flexDirection:"row"}});var _default=TableCell;exports.default=_default;
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/TableCell.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import Pressable from"../Pressable";import{jsx as _jsx}from"react/jsx-runtime";var TableCell=function TableCell(_ref){var borderWidth=_ref.borderWidth,borderColor=_ref.borderColor,borderStyle=_ref.borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?false:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?true:_ref$drawEndBorder,cellVerticalPadding=_ref.cellVerticalPadding,cellHorizontalPadding=_ref.cellHorizontalPadding,children=_ref.children,onPress=_ref.onPress,style=_ref.style;var parentContextValue=React.useContext(TableStyleContext);var borderViewStyle=generateBorderStyles({borderColor:borderColor||parentContextValue.borderColor,borderWidth:borderWidth||parentContextValue.borderWidth,borderStyle:borderStyle||parentContextValue.borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});var ContainerComponent=onPress?Pressable:View;return _jsx(ContainerComponent,{onPress:onPress,style:[styles.cellContainer,borderViewStyle,{paddingVertical:cellVerticalPadding||parentContextValue.cellVerticalPadding,paddingHorizontal:cellHorizontalPadding||parentContextValue.cellHorizontalPadding},style],children:children});};var styles=StyleSheet.create({cellContainer:{flex:1,flexDirection:"row"}});export default TableCell;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.TableStyleContext=void 0;exports.generateBorderStyles=generateBorderStyles;var _react=_interopRequireDefault(require("react"));var TableStyleContext=_react.default.createContext({});exports.TableStyleContext=TableStyleContext;function generateBorderStyles(_ref){var borderColor=_ref.borderColor,borderWidth=_ref.borderWidth,borderStyle=_ref.borderStyle,drawTopBorder=_ref.drawTopBorder,drawBottomBorder=_ref.drawBottomBorder,drawStartBorder=_ref.drawStartBorder,drawEndBorder=_ref.drawEndBorder;return{borderColor:borderColor,borderStyle:borderStyle,borderTopWidth:drawTopBorder?borderWidth:0,borderBottomWidth:drawBottomBorder?borderWidth:0,borderStartWidth:drawStartBorder?borderWidth:0,borderEndWidth:drawEndBorder?borderWidth:0};}
1
+ import React from"react";export var TableStyleContext=React.createContext({});export function generateBorderStyles(_ref){var borderColor=_ref.borderColor,borderWidth=_ref.borderWidth,borderStyle=_ref.borderStyle,drawTopBorder=_ref.drawTopBorder,drawBottomBorder=_ref.drawBottomBorder,drawStartBorder=_ref.drawStartBorder,drawEndBorder=_ref.drawEndBorder;return{borderColor:borderColor,borderStyle:borderStyle,borderTopWidth:drawTopBorder?borderWidth:0,borderBottomWidth:drawBottomBorder?borderWidth:0,borderStartWidth:drawStartBorder?borderWidth:0,borderEndWidth:drawEndBorder?borderWidth:0};}
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _TableCommon=require("./TableCommon");var _theming=require("../../theming");var _Pressable=_interopRequireDefault(require("../Pressable"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/TableRow.tsx";var TableRow=function TableRow(_ref){var borderWidth=_ref.borderWidth,borderColor=_ref.borderColor,borderStyle=_ref.borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?false:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?true:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?true:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,cellVerticalPadding=_ref.cellVerticalPadding,cellHorizontalPadding=_ref.cellHorizontalPadding,_ref$isTableHeader=_ref.isTableHeader,isTableHeader=_ref$isTableHeader===void 0?false:_ref$isTableHeader,children=_ref.children,onPress=_ref.onPress,style=_ref.style,theme=_ref.theme;var parentContextValue=_react.default.useContext(_TableCommon.TableStyleContext);var contextValue={borderColor:borderColor||parentContextValue.borderColor,borderStyle:borderStyle||parentContextValue.borderStyle,borderWidth:borderWidth||parentContextValue.borderWidth,cellHorizontalPadding:cellHorizontalPadding||parentContextValue.cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding||parentContextValue.cellVerticalPadding};var borderViewStyle=(0,_TableCommon.generateBorderStyles)({borderColor:contextValue.borderColor,borderWidth:contextValue.borderWidth,borderStyle:contextValue.borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});var ContainerComponent=onPress?_Pressable.default:_reactNative.View;return(0,_jsxRuntime.jsx)(_TableCommon.TableStyleContext.Provider,{value:contextValue,children:(0,_jsxRuntime.jsx)(ContainerComponent,{onPress:onPress,style:[borderViewStyle,isTableHeader?{backgroundColor:theme.colors.primary}:{},style,styles.cellsContainer],children:children})});};var styles=_reactNative.StyleSheet.create({cellsContainer:{flexDirection:"row"}});var _default=(0,_theming.withTheme)(TableRow);exports.default=_default;
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/TableRow.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{withTheme}from"../../theming";import Pressable from"../Pressable";import{jsx as _jsx}from"react/jsx-runtime";var TableRow=function TableRow(_ref){var borderWidth=_ref.borderWidth,borderColor=_ref.borderColor,borderStyle=_ref.borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?false:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?true:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?true:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,cellVerticalPadding=_ref.cellVerticalPadding,cellHorizontalPadding=_ref.cellHorizontalPadding,_ref$isTableHeader=_ref.isTableHeader,isTableHeader=_ref$isTableHeader===void 0?false:_ref$isTableHeader,children=_ref.children,onPress=_ref.onPress,style=_ref.style,theme=_ref.theme;var parentContextValue=React.useContext(TableStyleContext);var contextValue={borderColor:borderColor||parentContextValue.borderColor,borderStyle:borderStyle||parentContextValue.borderStyle,borderWidth:borderWidth||parentContextValue.borderWidth,cellHorizontalPadding:cellHorizontalPadding||parentContextValue.cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding||parentContextValue.cellVerticalPadding};var borderViewStyle=generateBorderStyles({borderColor:contextValue.borderColor,borderWidth:contextValue.borderWidth,borderStyle:contextValue.borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});var ContainerComponent=onPress?Pressable:View;return _jsx(TableStyleContext.Provider,{value:contextValue,children:_jsx(ContainerComponent,{onPress:onPress,style:[borderViewStyle,isTableHeader?{backgroundColor:theme.colors.primary}:{},style,styles.cellsContainer],children:children})});};var styles=StyleSheet.create({cellsContainer:{flexDirection:"row"}});export default withTheme(TableRow);
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Table",{enumerable:true,get:function get(){return _Table.default;}});Object.defineProperty(exports,"TableCell",{enumerable:true,get:function get(){return _TableCell.default;}});Object.defineProperty(exports,"TableRow",{enumerable:true,get:function get(){return _TableRow.default;}});var _Table=_interopRequireDefault(require("./Table"));var _TableRow=_interopRequireDefault(require("./TableRow"));var _TableCell=_interopRequireDefault(require("./TableCell"));
1
+ export{default as Table}from"./Table";export{default as TableRow}from"./TableRow";export{default as TableCell}from"./TableCell";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.Link=exports.BaseLink=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _theming=require("../theming");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Text.tsx",_this2=this;var _excluded=["style"],_excluded2=["style","theme","title"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var Text=function(_React$Component){(0,_inherits2.default)(Text,_React$Component);var _super=_createSuper(Text);function Text(){(0,_classCallCheck2.default)(this,Text);return _super.apply(this,arguments);}(0,_createClass2.default)(Text,[{key:"render",value:function render(){var _this=this;var _this$props=this.props,style=_this$props.style,rest=(0,_objectWithoutProperties2.default)(_this$props,_excluded);var writingDirection=_reactNative.I18nManager.isRTL?"rtl":"ltr";return(0,_jsxRuntime.jsx)(_reactNative.Text,Object.assign({},rest,{ref:function ref(c){_this._root=c;},style:[{textAlign:"left",writingDirection:writingDirection},style]}));}}]);return Text;}(React.Component);var BaseLink=function BaseLink(_ref){var style=_ref.style,theme=_ref.theme,title=_ref.title,props=(0,_objectWithoutProperties2.default)(_ref,_excluded2);return(0,_jsxRuntime.jsx)(Text,Object.assign({hitSlop:8,style:[{color:theme.colors.primary},style],theme:theme},props,{children:title}));};exports.BaseLink=BaseLink;var Link=(0,_theming.withTheme)(BaseLink);exports.Link=Link;var _default=(0,_theming.withTheme)(Text);exports.default=_default;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Text.tsx",_this2=this;var _excluded=["style"],_excluded2=["style","theme","title"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{Text as NativeText,I18nManager}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";var Text=function(_React$Component){_inherits(Text,_React$Component);var _super=_createSuper(Text);function Text(){_classCallCheck(this,Text);return _super.apply(this,arguments);}_createClass(Text,[{key:"render",value:function render(){var _this=this;var _this$props=this.props,style=_this$props.style,rest=_objectWithoutProperties(_this$props,_excluded);var writingDirection=I18nManager.isRTL?"rtl":"ltr";return _jsx(NativeText,Object.assign({},rest,{ref:function ref(c){_this._root=c;},style:[{textAlign:"left",writingDirection:writingDirection},style]}));}}]);return Text;}(React.Component);export var BaseLink=function BaseLink(_ref){var style=_ref.style,theme=_ref.theme,title=_ref.title,props=_objectWithoutProperties(_ref,_excluded2);return _jsx(Text,Object.assign({hitSlop:8,style:[{color:theme.colors.primary},style],theme:theme},props,{children:title}));};var Link=withTheme(BaseLink);export{Link};export default withTheme(Text);
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _theming=require("../theming");var _utilities=require("../utilities");var _TextInput=_interopRequireDefault(require("./TextInput"));var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextField.tsx";var _excluded=["theme","Icon","type","disabled","editable","label","error","leftIconName","leftIconMode","rightIconName","iconColor","iconSize","assistiveText","underlineColor","activeBorderColor","multiline","numberOfLines","style","render"],_excluded2=["lineHeight"],_excluded3=["backgroundColor","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor"];function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=(0,_getPrototypeOf2.default)(Derived),result;if(hasNativeReflectConstruct){var NewTarget=(0,_getPrototypeOf2.default)(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return(0,_possibleConstructorReturn2.default)(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}var AnimatedText=_reactNative.Animated.createAnimatedComponent(_reactNative.Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var TextField=function(_React$Component){(0,_inherits2.default)(TextField,_React$Component);var _super=_createSuper(TextField);function TextField(){var _this;(0,_classCallCheck2.default)(this,TextField);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={labeled:new _reactNative.Animated.Value(_this.props.value||_this.props.error?0:1),focused:false,placeholder:_this.props.error?_this.props.placeholder:"",labelLayout:{measured:false,width:0}};_this._timer=setTimeout(function(){},0);_this._showPlaceholder=function(){clearTimeout(_this._timer);_this._timer=setTimeout(function(){return _this.setState({placeholder:_this.props.placeholder});},50);};_this._hidePlaceholder=function(){return _this.setState({placeholder:""});};_this._restoreLabel=function(){return _reactNative.Animated.timing(_this.state.labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:_reactNative.Platform.OS!=="web"}).start();};_this._minmizeLabel=function(){return _reactNative.Animated.timing(_this.state.labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:_reactNative.Platform.OS!=="web"}).start();};_this._handleFocus=function(){if(_this.props.disabled){return;}_this.setState({focused:true});};_this._handleBlur=function(){if(_this.props.disabled){return;}_this.setState({focused:false});};_this._handleChangeText=function(value){if(_this.props.disabled){return;}if(typeof value==="string"){_this.setState({value:value});_this.props.onChangeText&&_this.props.onChangeText(value);}else{_this.setState({value:value.nativeEvent.text});_this.props.onChangeText&&_this.props.onChangeText(value.nativeEvent.text);}};_this._root=undefined;return _this;}(0,_createClass2.default)(TextField,[{key:"componentDidMount",value:function componentDidMount(){if(this.props.defaultValue){this._handleChangeText(this.props.defaultValue);}if(this.props.placeholder){this._minmizeLabel();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(prevState.focused!==this.state.focused||prevState.value!==this.state.value){if(this.state.value||this.state.focused||this.props.error||this.props.placeholder){this._minmizeLabel();}else{this._restoreLabel();}}if(prevState.focused!==this.state.focused||prevProps.label!==this.props.label){if(this.state.focused||this.props.error||!this.props.label){this._showPlaceholder();}else{this._hidePlaceholder();}}}},{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this._timer);}},{key:"toggleFocus",value:function toggleFocus(){this.setState(function(prevState){return{focused:!prevState.focused};});}},{key:"isFocused",value:function isFocused(){return this._root&&this._root.isFocused();}},{key:"clear",value:function clear(){return this._root&&this._root.clear();}},{key:"focus",value:function focus(){return this._root&&this._root.focus();}},{key:"blur",value:function blur(){return this._root&&this._root.blur();}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,_this$props$theme=_this$props.theme,colors=_this$props$theme.colors,typography=_this$props$theme.typography,roundness=_this$props$theme.roundness,disabledOpacity=_this$props$theme.disabledOpacity,Icon=_this$props.Icon,_this$props$type=_this$props.type,type=_this$props$type===void 0?"underline":_this$props$type,_this$props$disabled=_this$props.disabled,disabled=_this$props$disabled===void 0?false:_this$props$disabled,_this$props$editable=_this$props.editable,editable=_this$props$editable===void 0?true:_this$props$editable,label=_this$props.label,_this$props$error=_this$props.error,error=_this$props$error===void 0?false:_this$props$error,leftIconName=_this$props.leftIconName,leftIconMode=_this$props.leftIconMode,rightIconName=_this$props.rightIconName,iconColor=_this$props.iconColor,iconSize=_this$props.iconSize,assistiveText=_this$props.assistiveText,underlineColorProp=_this$props.underlineColor,_this$props$activeBor=_this$props.activeBorderColor,activeBorderColorProp=_this$props$activeBor===void 0?colors.primary:_this$props$activeBor,_this$props$multiline=_this$props.multiline,multiline=_this$props$multiline===void 0?false:_this$props$multiline,_this$props$numberOfL=_this$props.numberOfLines,numberOfLines=_this$props$numberOfL===void 0?4:_this$props$numberOfL,style=_this$props.style,_this$props$render=_this$props.render,render=_this$props$render===void 0?function(props){return(0,_jsxRuntime.jsx)(_TextInput.default,Object.assign({},props));}:_this$props$render,rest=(0,_objectWithoutProperties2.default)(_this$props,_excluded);var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=typography.caption.fontSize;var hasActiveOutline=this.state.focused||error;var inputTextColor,activeColor,underlineColor,borderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=error?colors.error:activeBorderColorProp;placeholderColor=borderColor=colors.light;underlineColor=underlineColorProp||colors.light;backgroundColor=colors.background;}if(rest.placeholderTextColor){placeholderColor=rest.placeholderTextColor;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=(0,_objectWithoutProperties2.default)(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1);if(!multiline){inputStyle.height=lineHeight;}var assistiveTextLeftMargin;if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8;}else{assistiveTextLeftMargin=0;}}else{containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:1,paddingTop:label?16*1.5:16,paddingBottom:label?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};if(leftIconName&&leftIconMode==="inset"){assistiveTextLeftMargin=16+4;}else if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8+12;}else{assistiveTextLeftMargin=12;}}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(iconColor){leftIconColor=iconColor;}else if(error){leftIconColor=colors.error;}else if(this.state.focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var labelStyle=Object.assign({},typography.subtitle1,type==="solid"?{marginHorizontal:12}:{},{top:type==="solid"?16:0,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,transform:[{translateY:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(this.state.labelLayout.width/2),0]})}]});var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles;var inputStyles=(0,_utilities.applyStyles)([styles.input,inputStyle,type==="solid"?{marginHorizontal:16}:{marginHorizontal:6}],textStyles);var _ref=_reactNative.StyleSheet.flatten(style||{}),bgColor=_ref.backgroundColor,padding=_ref.padding,paddingTop=_ref.paddingTop,paddingBottom=_ref.paddingBottom,paddingLeft=_ref.paddingLeft,paddingRight=_ref.paddingRight,borderRadius=_ref.borderRadius,borderWidth=_ref.borderWidth,borderTopWidth=_ref.borderTopWidth,borderRightWidth=_ref.borderRightWidth,borderBottomWidth=_ref.borderBottomWidth,borderLeftWidth=_ref.borderLeftWidth,borderCol=_ref.borderColor,styleProp=(0,_objectWithoutProperties2.default)(_ref,_excluded3);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.container,styleProp],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:(0,_utilities.applyStyles)([containerStyle],{height:styleProp.height,backgroundColor:bgColor,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,borderRadius:borderRadius,borderWidth:borderWidth,borderTopWidth:borderTopWidth,borderRightWidth:borderRightWidth,borderBottomWidth:borderBottomWidth,borderLeftWidth:borderLeftWidth,borderColor:borderCol}),children:[type==="underline"?(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:[styles.underline,{backgroundColor:bgColor||(error?colors.error:this.state.focused?activeColor:underlineColor),transform:[{scaleY:this.state.focused?1:0.5}]}]}):null,label?(0,_jsxRuntime.jsxs)(_reactNative.View,{pointerEvents:"none",style:[_reactNative.StyleSheet.absoluteFill,{opacity:this.state.value||this.state.focused?this.state.labelLayout.measured?1:0:1}],children:[(0,_jsxRuntime.jsx)(AnimatedText,{onLayout:function onLayout(e){return _this2.setState({labelLayout:{width:e.nativeEvent.layout.width,measured:true}});},style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),(0,_jsxRuntime.jsx)(AnimatedText,{style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:hasActiveOutline?this.state.labeled:1}],numberOfLines:1,children:label})]}):null,render(Object.assign({ref:function ref(c){_this2._root=c;},onChange:this._handleChangeText,placeholder:label?this.state.placeholder:this.props.placeholder,placeholderTextColor:placeholderColor,editable:!disabled&&editable,selectionColor:activeColor,multiline:multiline,numberOfLines:numberOfLines,onFocus:this._handleFocus,onBlur:this._handleBlur,underlineColorAndroid:"transparent",style:inputStyles},rest,{value:this.state.value}))]}),leftIconName?(0,_jsxRuntime.jsx)(Icon,{size:iconSize||ICON_SIZE,color:leftIconColor||colors.light,name:leftIconName,style:{position:"absolute",left:leftIconMode==="inset"&&type==="solid"?16:0,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,rightIconName?(0,_jsxRuntime.jsx)(Icon,{name:rightIconName,size:iconSize||ICON_SIZE,color:iconColor||colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,assistiveText?(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[{color:error?colors.error:colors.light,marginTop:8,marginLeft:assistiveTextLeftMargin}],children:assistiveText}):null]});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){return{value:typeof nextProps.value!=="undefined"?nextProps.value:prevState.value};}}]);return TextField;}(React.Component);var _default=(0,_theming.withTheme)(TextField);exports.default=_default;var styles=_reactNative.StyleSheet.create({container:{alignSelf:"stretch"},placeholder:{position:"absolute",left:0},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:_reactNative.I18nManager.isRTL?"right":"left"}});
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextField.tsx";var _excluded=["theme","Icon","type","disabled","editable","label","error","leftIconName","leftIconMode","rightIconName","iconColor","iconSize","assistiveText","underlineColor","activeBorderColor","multiline","numberOfLines","style","render"],_excluded2=["lineHeight"],_excluded3=["backgroundColor","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{View,Animated,StyleSheet,Text,I18nManager,Platform}from"react-native";import{withTheme}from"../theming";import{applyStyles,extractStyles}from"../utilities";import TextInput from"./TextInput";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AnimatedText=Animated.createAnimatedComponent(Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var TextField=function(_React$Component){_inherits(TextField,_React$Component);var _super=_createSuper(TextField);function TextField(){var _this;_classCallCheck(this,TextField);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={labeled:new Animated.Value(_this.props.value||_this.props.error?0:1),focused:false,placeholder:_this.props.error?_this.props.placeholder:"",labelLayout:{measured:false,width:0}};_this._timer=setTimeout(function(){},0);_this._showPlaceholder=function(){clearTimeout(_this._timer);_this._timer=setTimeout(function(){return _this.setState({placeholder:_this.props.placeholder});},50);};_this._hidePlaceholder=function(){return _this.setState({placeholder:""});};_this._restoreLabel=function(){return Animated.timing(_this.state.labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._minmizeLabel=function(){return Animated.timing(_this.state.labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._handleFocus=function(){if(_this.props.disabled){return;}_this.setState({focused:true});};_this._handleBlur=function(){if(_this.props.disabled){return;}_this.setState({focused:false});};_this._handleChangeText=function(value){if(_this.props.disabled){return;}if(typeof value==="string"){_this.setState({value:value});_this.props.onChangeText&&_this.props.onChangeText(value);}else{_this.setState({value:value.nativeEvent.text});_this.props.onChangeText&&_this.props.onChangeText(value.nativeEvent.text);}};_this._root=undefined;return _this;}_createClass(TextField,[{key:"componentDidMount",value:function componentDidMount(){if(this.props.defaultValue){this._handleChangeText(this.props.defaultValue);}if(this.props.placeholder){this._minmizeLabel();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(prevState.focused!==this.state.focused||prevState.value!==this.state.value){if(this.state.value||this.state.focused||this.props.error||this.props.placeholder){this._minmizeLabel();}else{this._restoreLabel();}}if(prevState.focused!==this.state.focused||prevProps.label!==this.props.label){if(this.state.focused||this.props.error||!this.props.label){this._showPlaceholder();}else{this._hidePlaceholder();}}}},{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this._timer);}},{key:"toggleFocus",value:function toggleFocus(){this.setState(function(prevState){return{focused:!prevState.focused};});}},{key:"isFocused",value:function isFocused(){return this._root&&this._root.isFocused();}},{key:"clear",value:function clear(){return this._root&&this._root.clear();}},{key:"focus",value:function focus(){return this._root&&this._root.focus();}},{key:"blur",value:function blur(){return this._root&&this._root.blur();}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,_this$props$theme=_this$props.theme,colors=_this$props$theme.colors,typography=_this$props$theme.typography,roundness=_this$props$theme.roundness,disabledOpacity=_this$props$theme.disabledOpacity,Icon=_this$props.Icon,_this$props$type=_this$props.type,type=_this$props$type===void 0?"underline":_this$props$type,_this$props$disabled=_this$props.disabled,disabled=_this$props$disabled===void 0?false:_this$props$disabled,_this$props$editable=_this$props.editable,editable=_this$props$editable===void 0?true:_this$props$editable,label=_this$props.label,_this$props$error=_this$props.error,error=_this$props$error===void 0?false:_this$props$error,leftIconName=_this$props.leftIconName,leftIconMode=_this$props.leftIconMode,rightIconName=_this$props.rightIconName,iconColor=_this$props.iconColor,iconSize=_this$props.iconSize,assistiveText=_this$props.assistiveText,underlineColorProp=_this$props.underlineColor,_this$props$activeBor=_this$props.activeBorderColor,activeBorderColorProp=_this$props$activeBor===void 0?colors.primary:_this$props$activeBor,_this$props$multiline=_this$props.multiline,multiline=_this$props$multiline===void 0?false:_this$props$multiline,_this$props$numberOfL=_this$props.numberOfLines,numberOfLines=_this$props$numberOfL===void 0?4:_this$props$numberOfL,style=_this$props.style,_this$props$render=_this$props.render,render=_this$props$render===void 0?function(props){return _jsx(TextInput,Object.assign({},props));}:_this$props$render,rest=_objectWithoutProperties(_this$props,_excluded);var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=typography.caption.fontSize;var hasActiveOutline=this.state.focused||error;var inputTextColor,activeColor,underlineColor,borderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=error?colors.error:activeBorderColorProp;placeholderColor=borderColor=colors.light;underlineColor=underlineColorProp||colors.light;backgroundColor=colors.background;}if(rest.placeholderTextColor){placeholderColor=rest.placeholderTextColor;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=_objectWithoutProperties(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1);if(!multiline){inputStyle.height=lineHeight;}var assistiveTextLeftMargin;if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8;}else{assistiveTextLeftMargin=0;}}else{containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:1,paddingTop:label?16*1.5:16,paddingBottom:label?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};if(leftIconName&&leftIconMode==="inset"){assistiveTextLeftMargin=16+4;}else if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8+12;}else{assistiveTextLeftMargin=12;}}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(iconColor){leftIconColor=iconColor;}else if(error){leftIconColor=colors.error;}else if(this.state.focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var labelStyle=Object.assign({},typography.subtitle1,type==="solid"?{marginHorizontal:12}:{},{top:type==="solid"?16:0,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,transform:[{translateY:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(this.state.labelLayout.width/2),0]})}]});var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles;var inputStyles=applyStyles([styles.input,inputStyle,type==="solid"?{marginHorizontal:16}:{marginHorizontal:6}],textStyles);var _ref=StyleSheet.flatten(style||{}),bgColor=_ref.backgroundColor,padding=_ref.padding,paddingTop=_ref.paddingTop,paddingBottom=_ref.paddingBottom,paddingLeft=_ref.paddingLeft,paddingRight=_ref.paddingRight,borderRadius=_ref.borderRadius,borderWidth=_ref.borderWidth,borderTopWidth=_ref.borderTopWidth,borderRightWidth=_ref.borderRightWidth,borderBottomWidth=_ref.borderBottomWidth,borderLeftWidth=_ref.borderLeftWidth,borderCol=_ref.borderColor,styleProp=_objectWithoutProperties(_ref,_excluded3);return _jsxs(View,{style:[styles.container,styleProp],children:[_jsxs(View,{style:applyStyles([containerStyle],{height:styleProp.height,backgroundColor:bgColor,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,borderRadius:borderRadius,borderWidth:borderWidth,borderTopWidth:borderTopWidth,borderRightWidth:borderRightWidth,borderBottomWidth:borderBottomWidth,borderLeftWidth:borderLeftWidth,borderColor:borderCol}),children:[type==="underline"?_jsx(Animated.View,{style:[styles.underline,{backgroundColor:bgColor||(error?colors.error:this.state.focused?activeColor:underlineColor),transform:[{scaleY:this.state.focused?1:0.5}]}]}):null,label?_jsxs(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{opacity:this.state.value||this.state.focused?this.state.labelLayout.measured?1:0:1}],children:[_jsx(AnimatedText,{onLayout:function onLayout(e){return _this2.setState({labelLayout:{width:e.nativeEvent.layout.width,measured:true}});},style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),_jsx(AnimatedText,{style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:hasActiveOutline?this.state.labeled:1}],numberOfLines:1,children:label})]}):null,render(Object.assign({ref:function ref(c){_this2._root=c;},onChange:this._handleChangeText,placeholder:label?this.state.placeholder:this.props.placeholder,placeholderTextColor:placeholderColor,editable:!disabled&&editable,selectionColor:activeColor,multiline:multiline,numberOfLines:numberOfLines,onFocus:this._handleFocus,onBlur:this._handleBlur,underlineColorAndroid:"transparent",style:inputStyles},rest,{value:this.state.value}))]}),leftIconName?_jsx(Icon,{size:iconSize||ICON_SIZE,color:leftIconColor||colors.light,name:leftIconName,style:{position:"absolute",left:leftIconMode==="inset"&&type==="solid"?16:0,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,rightIconName?_jsx(Icon,{name:rightIconName,size:iconSize||ICON_SIZE,color:iconColor||colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,assistiveText?_jsx(Text,{style:[{color:error?colors.error:colors.light,marginTop:8,marginLeft:assistiveTextLeftMargin}],children:assistiveText}):null]});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){return{value:typeof nextProps.value!=="undefined"?nextProps.value:prevState.value};}}]);return TextField;}(React.Component);export default withTheme(TextField);var styles=StyleSheet.create({container:{alignSelf:"stretch"},placeholder:{position:"absolute",left:0},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:I18nManager.isRTL?"right":"left"}});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _hooks=require("../hooks");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onChangeTextDelayed","changeTextDelay","webShowOutline","style","disabled","editable","value"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextInput.tsx";var TextInput=_react.default.forwardRef(function(_ref,ref){var onChangeTextDelayed=_ref.onChangeTextDelayed,_ref$changeTextDelay=_ref.changeTextDelay,changeTextDelay=_ref$changeTextDelay===void 0?500:_ref$changeTextDelay,_ref$webShowOutline=_ref.webShowOutline,webShowOutline=_ref$webShowOutline===void 0?true:_ref$webShowOutline,style=_ref.style,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$editable=_ref.editable,editable=_ref$editable===void 0?true:_ref$editable,value=_ref.value,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var delayedValue=(0,_hooks.useDebounce)(value,changeTextDelay);(0,_hooks.useOnUpdate)(function(){if(delayedValue!==undefined){onChangeTextDelayed==null?void 0:onChangeTextDelayed(delayedValue);}},[delayedValue]);return(0,_jsxRuntime.jsx)(_reactNative.TextInput,Object.assign({testID:"native-text-input",ref:ref,value:value,editable:!disabled&&editable,style:[_reactNative.Platform.OS==="web"&&!webShowOutline?{outlineWidth:0}:{},style]},rest));});var _default=TextInput;exports.default=_default;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onChangeTextDelayed","changeTextDelay","webShowOutline","style","disabled","editable","value"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextInput.tsx";import React from"react";import{TextInput as NativeTextInput,Platform}from"react-native";import{useDebounce,useOnUpdate}from"../hooks";import{jsx as _jsx}from"react/jsx-runtime";var TextInput=React.forwardRef(function(_ref,ref){var onChangeTextDelayed=_ref.onChangeTextDelayed,_ref$changeTextDelay=_ref.changeTextDelay,changeTextDelay=_ref$changeTextDelay===void 0?500:_ref$changeTextDelay,_ref$webShowOutline=_ref.webShowOutline,webShowOutline=_ref$webShowOutline===void 0?true:_ref$webShowOutline,style=_ref.style,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$editable=_ref.editable,editable=_ref$editable===void 0?true:_ref$editable,value=_ref.value,rest=_objectWithoutProperties(_ref,_excluded);var delayedValue=useDebounce(value,changeTextDelay);useOnUpdate(function(){if(delayedValue!==undefined){onChangeTextDelayed==null?void 0:onChangeTextDelayed(delayedValue);}},[delayedValue]);return _jsx(NativeTextInput,Object.assign({testID:"native-text-input",ref:ref,value:value,editable:!disabled&&editable,style:[Platform.OS==="web"&&!webShowOutline?{outlineWidth:0}:{},style]},rest));});export default TextInput;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=Touchable;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Touchable.tsx";var _excluded=["children","disabled","onPress","activeOpacity","disabledOpacity","delayLongPress","hitSlop","style"];function Touchable(_ref){var children=_ref.children,disabled=_ref.disabled,onPress=_ref.onPress,_ref$activeOpacity=_ref.activeOpacity,activeOpacity=_ref$activeOpacity===void 0?0.8:_ref$activeOpacity,_ref$disabledOpacity=_ref.disabledOpacity,disabledOpacity=_ref$disabledOpacity===void 0?0.8:_ref$disabledOpacity,delayLongPress=_ref.delayLongPress,hitSlop=_ref.hitSlop,_style=_ref.style,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_reactNative.Pressable,Object.assign({disabled:disabled,onPress:onPress,delayLongPress:delayLongPress?delayLongPress:500,hitSlop:hitSlop?hitSlop:8,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?activeOpacity:disabled?disabledOpacity:1},_style];}},props,{children:children}));}
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Touchable.tsx";var _excluded=["children","disabled","onPress","activeOpacity","disabledOpacity","delayLongPress","hitSlop","style"];import React from"react";import{Pressable}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";export default function Touchable(_ref){var children=_ref.children,disabled=_ref.disabled,onPress=_ref.onPress,_ref$activeOpacity=_ref.activeOpacity,activeOpacity=_ref$activeOpacity===void 0?0.8:_ref$activeOpacity,_ref$disabledOpacity=_ref.disabledOpacity,disabledOpacity=_ref$disabledOpacity===void 0?0.8:_ref$disabledOpacity,delayLongPress=_ref.delayLongPress,hitSlop=_ref.hitSlop,_style=_ref.style,props=_objectWithoutProperties(_ref,_excluded);return _jsx(Pressable,Object.assign({disabled:disabled,onPress:onPress,delayLongPress:delayLongPress?delayLongPress:500,hitSlop:hitSlop?hitSlop:8,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?activeOpacity:disabled?disabledOpacity:1},_style];}},props,{children:children}));}
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var _default=_reactNative.TouchableOpacity;exports.default=_default;
1
+ import{TouchableOpacity}from"react-native";export default TouchableOpacity;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Title=exports.Subtitle=exports.Caption=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _theming=require("../theming");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Typography.tsx";var Title=(0,_theming.withTheme)(function(_ref){var text=_ref.text,theme=_ref.theme,style=_ref.style;return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[{fontSize:20,letterSpacing:0,lineHeight:26,color:theme.colors.text},style],children:text});});exports.Title=Title;var Subtitle=(0,_theming.withTheme)(function(_ref2){var text=_ref2.text,theme=_ref2.theme,style=_ref2.style;return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[{fontSize:14,letterSpacing:0,lineHeight:16,color:theme.colors.medium},style],children:text});});exports.Subtitle=Subtitle;var Caption=(0,_theming.withTheme)(function(_ref3){var text=_ref3.text,theme=_ref3.theme,style=_ref3.style;return(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[{fontSize:12,letterSpacing:0,lineHeight:14,color:theme.colors.light},style],children:text});});exports.Caption=Caption;
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Typography.tsx";import React from"react";import{Text}from"react-native";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";export var Title=withTheme(function(_ref){var text=_ref.text,theme=_ref.theme,style=_ref.style;return _jsx(Text,{style:[{fontSize:20,letterSpacing:0,lineHeight:26,color:theme.colors.text},style],children:text});});export var Subtitle=withTheme(function(_ref2){var text=_ref2.text,theme=_ref2.theme,style=_ref2.style;return _jsx(Text,{style:[{fontSize:14,letterSpacing:0,lineHeight:16,color:theme.colors.medium},style],children:text});});export var Caption=withTheme(function(_ref3){var text=_ref3.text,theme=_ref3.theme,style=_ref3.style;return _jsx(Text,{style:[{fontSize:12,letterSpacing:0,lineHeight:14,color:theme.colors.light},style],children:text});});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _utilities=require("../../utilities");var _reactYoutube=_interopRequireDefault(require("react-youtube"));var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/YoutubePlayer/YoutubePlayer.tsx";var YoutubePlayer=function YoutubePlayer(_ref){var videoId=_ref.videoId,playlist=_ref.playlist,_ref$autoplay=_ref.autoplay,autoplay=_ref$autoplay===void 0?false:_ref$autoplay,style=_ref.style;var _extractStyles=(0,_utilities.extractStyles)(style),viewStyles=_extractStyles.viewStyles;var defaultVideoId="nwMUpDESXrI";var options={width:viewStyles.width,height:viewStyles.height,playerVars:{autoplay:autoplay?1:0,list:playlist,listType:"playlist"}};return(0,_jsxRuntime.jsx)(_reactNative.View,{style:viewStyles,children:(0,_jsxRuntime.jsx)(_reactYoutube.default,{style:{flex:1},videoId:!videoId&&!playlist?defaultVideoId:videoId,opts:options})});};var _default=YoutubePlayer;exports.default=_default;
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/YoutubePlayer/YoutubePlayer.tsx";import React from"react";import{View}from"react-native";import{extractStyles}from"../../utilities";import YouTube from"react-youtube";import{jsx as _jsx}from"react/jsx-runtime";var YoutubePlayer=function YoutubePlayer(_ref){var videoId=_ref.videoId,playlist=_ref.playlist,_ref$autoplay=_ref.autoplay,autoplay=_ref$autoplay===void 0?false:_ref$autoplay,style=_ref.style;var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles;var defaultVideoId="nwMUpDESXrI";var options={width:viewStyles.width,height:viewStyles.height,playerVars:{autoplay:autoplay?1:0,list:playlist,listType:"playlist"}};return _jsx(View,{style:viewStyles,children:_jsx(YouTube,{style:{flex:1},videoId:!videoId&&!playlist?defaultVideoId:videoId,opts:options})});};export default YoutubePlayer;
@@ -1,5 +1,5 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _reactNativeYoutubeIframe=_interopRequireDefault(require("react-native-youtube-iframe"));var _utilities=require("../../utilities");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/YoutubePlayer/YoutubePlayer.native.tsx";var YoutubePlayer=function YoutubePlayer(_ref){var videoId=_ref.videoId,playlist=_ref.playlist,_ref$autoplay=_ref.autoplay,autoplay=_ref$autoplay===void 0?false:_ref$autoplay,style=_ref.style;var _extractStyles=(0,_utilities.extractStyles)(style),viewStyles=_extractStyles.viewStyles;var defaultVideoId="nwMUpDESXrI";return(0,_jsxRuntime.jsx)(_reactNativeYoutubeIframe.default,{width:viewStyles.width,height:viewStyles.height,play:autoplay,videoId:!videoId&&!playlist?defaultVideoId:videoId,playList:playlist,webViewStyle:[viewStyles,{opacity:viewStyles.opacity<0.99?viewStyles.opacity:0.99}],webViewProps:{injectedJavaScript:`
1
+ var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/YoutubePlayer/YoutubePlayer.native.tsx";import React from"react";import YoutubePlayerIFrame from"react-native-youtube-iframe";import{extractStyles}from"../../utilities";import{jsx as _jsx}from"react/jsx-runtime";var YoutubePlayer=function YoutubePlayer(_ref){var videoId=_ref.videoId,playlist=_ref.playlist,_ref$autoplay=_ref.autoplay,autoplay=_ref$autoplay===void 0?false:_ref$autoplay,style=_ref.style;var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles;var defaultVideoId="nwMUpDESXrI";return _jsx(YoutubePlayerIFrame,{width:viewStyles.width,height:viewStyles.height,play:autoplay,videoId:!videoId&&!playlist?defaultVideoId:videoId,playList:playlist,webViewStyle:[viewStyles,{opacity:viewStyles.opacity<0.99?viewStyles.opacity:0.99}],webViewProps:{injectedJavaScript:`
2
2
  var element = document.getElementsByClassName('container')[0];
3
3
  element.style.position = 'unset';
4
4
  true;
5
- `}});};var _default=YoutubePlayer;exports.default=_default;
5
+ `}});};export default YoutubePlayer;
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});
1
+ export{};
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"YoutubePlayer",{enumerable:true,get:function get(){return _YoutubePlayer.default;}});var _YoutubePlayer=_interopRequireDefault(require("./YoutubePlayer"));
1
+ export{default as YoutubePlayer}from"./YoutubePlayer";
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.useAuthState=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var React=_interopRequireWildcard(require("react"));function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var useAuthState=function useAuthState(auth){var _React$useState=React.useState(),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),error=_React$useState2[0],setError=_React$useState2[1];var _React$useState3=React.useState(auth.currentUser),_React$useState4=(0,_slicedToArray2.default)(_React$useState3,2),value=_React$useState4[0],setValue=_React$useState4[1];React.useEffect(function(){var list=auth.onAuthStateChanged(setValue,setError);return function(){list();};},[auth]);var signInWithEmailAndPassword=function signInWithEmailAndPassword(user,password){auth.signInWithEmailAndPassword(user,password).then(setValue).catch(setError);};var createUserWithEmailAndPassword=function createUserWithEmailAndPassword(user,password){auth.signInWithEmailAndPassword(user,password).then(setValue).catch(setError);};var signOut=function signOut(){return auth.signOut();};return[value,error,signInWithEmailAndPassword,signOut,createUserWithEmailAndPassword];};exports.useAuthState=useAuthState;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import*as React from"react";export var useAuthState=function useAuthState(auth){var _React$useState=React.useState(),_React$useState2=_slicedToArray(_React$useState,2),error=_React$useState2[0],setError=_React$useState2[1];var _React$useState3=React.useState(auth.currentUser),_React$useState4=_slicedToArray(_React$useState3,2),value=_React$useState4[0],setValue=_React$useState4[1];React.useEffect(function(){var list=auth.onAuthStateChanged(setValue,setError);return function(){list();};},[auth]);var signInWithEmailAndPassword=function signInWithEmailAndPassword(user,password){auth.signInWithEmailAndPassword(user,password).then(setValue).catch(setError);};var createUserWithEmailAndPassword=function createUserWithEmailAndPassword(user,password){auth.signInWithEmailAndPassword(user,password).then(setValue).catch(setError);};var signOut=function signOut(){return auth.signOut();};return[value,error,signInWithEmailAndPassword,signOut,createUserWithEmailAndPassword];};
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:true});exports.APPROX_STATUSBAR_HEIGHT=void 0;var _reactNative=require("react-native");var expo=global.__expo;var DEFAULT_STATUSBAR_HEIGHT_EXPO=expo!=null&&expo.Constants?expo.Constants.statusBarHeight:0;var APPROX_STATUSBAR_HEIGHT=_reactNative.Platform.select({android:DEFAULT_STATUSBAR_HEIGHT_EXPO,ios:_reactNative.Platform.Version<11?DEFAULT_STATUSBAR_HEIGHT_EXPO:0});exports.APPROX_STATUSBAR_HEIGHT=APPROX_STATUSBAR_HEIGHT;
1
+ import{Platform}from"react-native";var expo=global.__expo;var DEFAULT_STATUSBAR_HEIGHT_EXPO=expo!=null&&expo.Constants?expo.Constants.statusBarHeight:0;export var APPROX_STATUSBAR_HEIGHT=Platform.select({android:DEFAULT_STATUSBAR_HEIGHT_EXPO,ios:Platform.Version<11?DEFAULT_STATUSBAR_HEIGHT_EXPO:0});
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Text=_interopRequireDefault(require("../components/Text"));var _utilities=require("../utilities");var _theming=require("../theming");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["Icon","icon","label","style","iconColor","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AccordionItem.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var AccordionItem=function AccordionItem(_ref){var Icon=_ref.Icon,icon=_ref.icon,label=_ref.label,style=_ref.style,iconColor=_ref.iconColor,theme=_ref.theme,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _extractStyles=(0,_utilities.extractStyles)(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return(0,_jsxRuntime.jsx)(_reactNative.Pressable,Object.assign({style:[styles.container,viewStyles]},rest,{children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[icon?(0,_jsxRuntime.jsx)(Icon,{name:icon,size:24,color:iconColor||theme.colors.primary}):null,(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.item,styles.content],children:(0,_jsxRuntime.jsx)(_Text.default,{selectable:false,style:textStyles,children:label})})]})}));};var styles=_reactNative.StyleSheet.create({container:{padding:8},row:{flexDirection:"row",alignItems:"center",paddingLeft:8},item:{marginVertical:6,paddingLeft:8},content:{flex:1,justifyContent:"center"}});var _default=(0,_theming.withTheme)(AccordionItem);exports.default=_default;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","label","style","iconColor","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AccordionItem.tsx";import*as React from"react";import{Pressable,StyleSheet,View}from"react-native";import Text from"../components/Text";import{extractStyles}from"../utilities";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function AccordionItem(_ref){var Icon=_ref.Icon,icon=_ref.icon,label=_ref.label,style=_ref.style,iconColor=_ref.iconColor,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsx(Pressable,Object.assign({style:[styles.container,viewStyles]},rest,{children:_jsxs(View,{style:styles.row,children:[icon?_jsx(Icon,{name:icon,size:24,color:iconColor||theme.colors.primary}):null,_jsx(View,{style:[styles.item,styles.content],children:_jsx(Text,{selectable:false,style:textStyles,children:label})})]})}));};var styles=StyleSheet.create({container:{padding:8},row:{flexDirection:"row",alignItems:"center",paddingLeft:8},item:{marginVertical:6,paddingLeft:8},content:{flex:1,justifyContent:"center"}});export default withTheme(AccordionItem);
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _CircularProgress=_interopRequireDefault(require("./CircularProgress"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["duration","easing","fill","prefill","useNativeDriver","tintColorSecondary","onAnimationComplete","tintColor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AnimatedCircularProgress.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var AnimatedProgress=_reactNative.Animated.createAnimatedComponent(_CircularProgress.default);var AnimatedCircularProgress=function AnimatedCircularProgress(_ref){var _ref$duration=_ref.duration,duration=_ref$duration===void 0?500:_ref$duration,_ref$easing=_ref.easing,easing=_ref$easing===void 0?_reactNative.Easing.out(_reactNative.Easing.ease):_ref$easing,fill=_ref.fill,_ref$prefill=_ref.prefill,prefill=_ref$prefill===void 0?0:_ref$prefill,_ref$useNativeDriver=_ref.useNativeDriver,useNativeDriver=_ref$useNativeDriver===void 0?false:_ref$useNativeDriver,tintColorSecondary=_ref.tintColorSecondary,onAnimationComplete=_ref.onAnimationComplete,_ref$tintColor=_ref.tintColor,tintColor=_ref$tintColor===void 0?"black":_ref$tintColor,other=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _React$useState=React.useState(new _reactNative.Animated.Value(prefill)),_React$useState2=(0,_slicedToArray2.default)(_React$useState,1),fillAnimation=_React$useState2[0];var animate=React.useCallback(function(){var toVal=arguments.length>0&&arguments[0]!==undefined?arguments[0]:-1;var dur=arguments.length>1?arguments[1]:undefined;var ease=arguments.length>2?arguments[2]:undefined;var toValue=toVal>=0?toVal:fill;var dura=dur||duration;var eas=ease||easing;var useNative=useNativeDriver;var anim=_reactNative.Animated.timing(fillAnimation,{useNativeDriver:useNative,toValue:toValue,easing:eas,duration:dura});anim.start(onAnimationComplete);return anim;},[duration,easing,fill,useNativeDriver,fillAnimation,onAnimationComplete]);var animateColor=function animateColor(){if(!tintColorSecondary){return tintColor;}var tintAnimation=fillAnimation.interpolate({inputRange:[0,100],outputRange:[tintColor,tintColorSecondary]});return tintAnimation;};React.useEffect(function(){animate();},[fill,animate]);return(0,_jsxRuntime.jsx)(AnimatedProgress,Object.assign({},other,{style:other.style,childrenContainerStyle:other.childrenContainerStyle,fill:fillAnimation,tintColor:animateColor()}));};var _default=AnimatedCircularProgress;exports.default=_default;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["duration","easing","fill","prefill","useNativeDriver","tintColorSecondary","onAnimationComplete","tintColor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AnimatedCircularProgress.tsx";import*as React from"react";import{Animated,Easing}from"react-native";import CircularProgress from"./CircularProgress";import{jsx as _jsx}from"react/jsx-runtime";var AnimatedProgress=Animated.createAnimatedComponent(CircularProgress);var AnimatedCircularProgress=function AnimatedCircularProgress(_ref){var _ref$duration=_ref.duration,duration=_ref$duration===void 0?500:_ref$duration,_ref$easing=_ref.easing,easing=_ref$easing===void 0?Easing.out(Easing.ease):_ref$easing,fill=_ref.fill,_ref$prefill=_ref.prefill,prefill=_ref$prefill===void 0?0:_ref$prefill,_ref$useNativeDriver=_ref.useNativeDriver,useNativeDriver=_ref$useNativeDriver===void 0?false:_ref$useNativeDriver,tintColorSecondary=_ref.tintColorSecondary,onAnimationComplete=_ref.onAnimationComplete,_ref$tintColor=_ref.tintColor,tintColor=_ref$tintColor===void 0?"black":_ref$tintColor,other=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(new Animated.Value(prefill)),_React$useState2=_slicedToArray(_React$useState,1),fillAnimation=_React$useState2[0];var animate=React.useCallback(function(){var toVal=arguments.length>0&&arguments[0]!==undefined?arguments[0]:-1;var dur=arguments.length>1?arguments[1]:undefined;var ease=arguments.length>2?arguments[2]:undefined;var toValue=toVal>=0?toVal:fill;var dura=dur||duration;var eas=ease||easing;var useNative=useNativeDriver;var anim=Animated.timing(fillAnimation,{useNativeDriver:useNative,toValue:toValue,easing:eas,duration:dura});anim.start(onAnimationComplete);return anim;},[duration,easing,fill,useNativeDriver,fillAnimation,onAnimationComplete]);var animateColor=function animateColor(){if(!tintColorSecondary){return tintColor;}var tintAnimation=fillAnimation.interpolate({inputRange:[0,100],outputRange:[tintColor,tintColorSecondary]});return tintAnimation;};React.useEffect(function(){animate();},[fill,animate]);return _jsx(AnimatedProgress,Object.assign({},other,{style:other.style,childrenContainerStyle:other.childrenContainerStyle,fill:fillAnimation,tintColor:animateColor()}));};export default AnimatedCircularProgress;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Touchable=_interopRequireDefault(require("../components/Touchable"));var _CircleImage=_interopRequireDefault(require("./CircleImage"));var _theming=require("../theming");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["Icon","image","size","onPress","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvatarEdit.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var AvatarEdit=function AvatarEdit(_ref){var Icon=_ref.Icon,image=_ref.image,_ref$size=_ref.size,size=_ref$size===void 0?80:_ref$size,_ref$onPress=_ref.onPress,onPress=_ref$onPress===void 0?function(){}:_ref$onPress,style=_ref.style,theme=_ref.theme,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var colorStyles={editBackgroundColor:theme.colors.primary,editIconColor:theme.colors.surface,editBorderColor:theme.colors.surface};var dimensions={width:size,height:size};return(0,_jsxRuntime.jsx)(_reactNative.View,Object.assign({style:[style,dimensions]},rest,{children:(0,_jsxRuntime.jsxs)(_Touchable.default,{onPress:onPress,children:[(0,_jsxRuntime.jsx)(_CircleImage.default,{source:image,size:size}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:{position:"absolute",top:-3,right:-3,borderColor:colorStyles.editBorderColor,backgroundColor:colorStyles.editBackgroundColor,borderRadius:size*(3/16),padding:size*(3/32)},children:(0,_jsxRuntime.jsx)(Icon,{name:"MaterialIcons/edit",color:colorStyles.editIconColor,size:size*(3/16)})})]})}));};var _default=(0,_theming.withTheme)(AvatarEdit);exports.default=_default;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","image","size","onPress","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvatarEdit.tsx";import*as React from"react";import{View}from"react-native";import Touchable from"../components/Touchable";import CircleImage from"./CircleImage";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AvatarEdit=function AvatarEdit(_ref){var Icon=_ref.Icon,image=_ref.image,_ref$size=_ref.size,size=_ref$size===void 0?80:_ref$size,_ref$onPress=_ref.onPress,onPress=_ref$onPress===void 0?function(){}:_ref$onPress,style=_ref.style,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var colorStyles={editBackgroundColor:theme.colors.primary,editIconColor:theme.colors.surface,editBorderColor:theme.colors.surface};var dimensions={width:size,height:size};return _jsx(View,Object.assign({style:[style,dimensions]},rest,{children:_jsxs(Touchable,{onPress:onPress,children:[_jsx(CircleImage,{source:image,size:size}),_jsx(View,{style:{position:"absolute",top:-3,right:-3,borderColor:colorStyles.editBorderColor,backgroundColor:colorStyles.editBackgroundColor,borderRadius:size*(3/16),padding:size*(3/32)},children:_jsx(Icon,{name:"MaterialIcons/edit",color:colorStyles.editIconColor,size:size*(3/16)})})]})}));};export default withTheme(AvatarEdit);
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onKeyboardHidden","onKeyboardShown"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvoidKeyboardView.tsx";var AvoidSoftInput=null;var AvoidSoftInputView=null;try{var avoidSoftInputPackage=require("react-native-avoid-softinput");AvoidSoftInput=avoidSoftInputPackage.AvoidSoftInput;AvoidSoftInputView=avoidSoftInputPackage.AvoidSoftInputView;}catch(_){console.warn("AvoidKeyboardView: `react-native-avoid-softinput` is not installed, falling back to `View`. No keyboard avoiding capabilties will be used.");}var AvoidKeyboardView=function AvoidKeyboardView(_ref){var onKeyboardHidden=_ref.onKeyboardHidden,onKeyboardShown=_ref.onKeyboardShown,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);_react.default.useEffect(function(){if(AvoidSoftInput){AvoidSoftInput.setShouldMimicIOSBehavior(true);}return function(){if(AvoidSoftInput){AvoidSoftInput.setShouldMimicIOSBehavior(false);}};},[]);if(AvoidSoftInputView){return(0,_jsxRuntime.jsx)(AvoidSoftInputView,Object.assign({onSoftInputHidden:onKeyboardHidden,onSoftInputShown:onKeyboardShown},rest));}else{return(0,_jsxRuntime.jsx)(_reactNative.View,Object.assign({},rest));}};var _default=AvoidKeyboardView;exports.default=_default;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onKeyboardHidden","onKeyboardShown"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvoidKeyboardView.tsx";import React from"react";import{View}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";var AvoidSoftInput=null;var AvoidSoftInputView=null;try{var avoidSoftInputPackage=require("react-native-avoid-softinput");AvoidSoftInput=avoidSoftInputPackage.AvoidSoftInput;AvoidSoftInputView=avoidSoftInputPackage.AvoidSoftInputView;}catch(_){console.warn("AvoidKeyboardView: `react-native-avoid-softinput` is not installed, falling back to `View`. No keyboard avoiding capabilties will be used.");}var AvoidKeyboardView=function AvoidKeyboardView(_ref){var onKeyboardHidden=_ref.onKeyboardHidden,onKeyboardShown=_ref.onKeyboardShown,rest=_objectWithoutProperties(_ref,_excluded);React.useEffect(function(){if(AvoidSoftInput){AvoidSoftInput.setShouldMimicIOSBehavior(true);}return function(){if(AvoidSoftInput){AvoidSoftInput.setShouldMimicIOSBehavior(false);}};},[]);if(AvoidSoftInputView){return _jsx(AvoidSoftInputView,Object.assign({onSoftInputHidden:onKeyboardHidden,onSoftInputShown:onKeyboardShown},rest));}else{return _jsx(View,Object.assign({},rest));}};export default AvoidKeyboardView;
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var React=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _Surface=_interopRequireDefault(require("../components/Surface"));var _shadow=_interopRequireDefault(require("../styles/shadow"));var _theming=require("../theming");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Banner.tsx";function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap();var cacheNodeInterop=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop;})(nodeInterop);}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj;}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj};}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj);}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc);}else{newObj[key]=obj[key];}}}newObj.default=obj;if(cache){cache.set(obj,newObj);}return newObj;}var ELEVATION=1;var DEFAULT_MAX_WIDTH=960;var Banner=function Banner(_ref){var _ref$initiallyVisible=_ref.initiallyVisible,initiallyVisible=_ref$initiallyVisible===void 0?true:_ref$initiallyVisible,_ref$dismissable=_ref.dismissable,dismissable=_ref$dismissable===void 0?true:_ref$dismissable,icon=_ref.icon,buttonColor=_ref.buttonColor,content=_ref.content,contentStyle=_ref.contentStyle,style=_ref.style,theme=_ref.theme,Icon=_ref.Icon,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _React$useState=React.useState(initiallyVisible),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),visible=_React$useState2[0],setVisible=_React$useState2[1];React.useEffect(function(){if(initiallyVisible){setVisible(true);}},[initiallyVisible]);var _React$useRef=React.useRef(new _reactNative.Animated.Value(visible?1:0)),position=_React$useRef.current;var _React$useState3=React.useState({height:0,measured:false}),_React$useState4=(0,_slicedToArray2.default)(_React$useState3,2),layout=_React$useState4[0],setLayout=_React$useState4[1];React.useEffect(function(){if(visible){_reactNative.Animated.timing(position,{duration:250,toValue:1,useNativeDriver:false}).start();}else{_reactNative.Animated.timing(position,{duration:200,toValue:0,useNativeDriver:false}).start();}},[visible,position]);var handleLayout=function handleLayout(_ref2){var nativeEvent=_ref2.nativeEvent;var height=nativeEvent.layout.height;setLayout({height:height,measured:true});};var height=_reactNative.Animated.multiply(position,layout.height);var translateY=_reactNative.Animated.multiply(_reactNative.Animated.add(position,-1),layout.height);return(0,_jsxRuntime.jsx)(_Surface.default,Object.assign({},rest,{style:[styles.container,(0,_shadow.default)(ELEVATION),style],children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.wrapper,contentStyle],children:[(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{height:height}}),(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{onLayout:handleLayout,style:[layout.measured||!visible?[styles.absolute,{transform:[{translateY:translateY}]}]:null,!layout.measured&&!visible?{opacity:0}:null],children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.content,{marginBottom:dismissable?0:16}],children:[icon?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.icon,children:(0,_jsxRuntime.jsx)(Icon,{name:icon,size:40})}):null,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.message,{color:theme.colors.text}],accessibilityLiveRegion:visible?"polite":"none",accessibilityRole:"alert",children:content})]}),dismissable?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.actions,children:(0,_jsxRuntime.jsx)(_reactNative.Button,{color:buttonColor||theme.colors.primary,title:"Close",onPress:function onPress(){return setVisible(false);}})}):null]})]})}));};var styles=_reactNative.StyleSheet.create({container:{elevation:ELEVATION},wrapper:{overflow:"hidden",alignSelf:"center",width:"100%",maxWidth:DEFAULT_MAX_WIDTH},absolute:{position:"absolute",top:0,width:"100%"},content:{flexDirection:"row",justifyContent:"flex-start",marginHorizontal:8,marginTop:16,marginBottom:0},icon:{margin:8},message:{flex:1,margin:8},actions:{flexDirection:"row",justifyContent:"flex-end",margin:8}});var _default=(0,_theming.withTheme)(Banner);exports.default=_default;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Banner.tsx";import*as React from"react";import{Button,Text,View,StyleSheet,Animated}from"react-native";import Surface from"../components/Surface";import shadow from"../styles/shadow";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ELEVATION=1;var DEFAULT_MAX_WIDTH=960;var Banner=function Banner(_ref){var _ref$initiallyVisible=_ref.initiallyVisible,initiallyVisible=_ref$initiallyVisible===void 0?true:_ref$initiallyVisible,_ref$dismissable=_ref.dismissable,dismissable=_ref$dismissable===void 0?true:_ref$dismissable,icon=_ref.icon,buttonColor=_ref.buttonColor,content=_ref.content,contentStyle=_ref.contentStyle,style=_ref.style,theme=_ref.theme,Icon=_ref.Icon,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(initiallyVisible),_React$useState2=_slicedToArray(_React$useState,2),visible=_React$useState2[0],setVisible=_React$useState2[1];React.useEffect(function(){if(initiallyVisible){setVisible(true);}},[initiallyVisible]);var _React$useRef=React.useRef(new Animated.Value(visible?1:0)),position=_React$useRef.current;var _React$useState3=React.useState({height:0,measured:false}),_React$useState4=_slicedToArray(_React$useState3,2),layout=_React$useState4[0],setLayout=_React$useState4[1];React.useEffect(function(){if(visible){Animated.timing(position,{duration:250,toValue:1,useNativeDriver:false}).start();}else{Animated.timing(position,{duration:200,toValue:0,useNativeDriver:false}).start();}},[visible,position]);var handleLayout=function handleLayout(_ref2){var nativeEvent=_ref2.nativeEvent;var height=nativeEvent.layout.height;setLayout({height:height,measured:true});};var height=Animated.multiply(position,layout.height);var translateY=Animated.multiply(Animated.add(position,-1),layout.height);return _jsx(Surface,Object.assign({},rest,{style:[styles.container,shadow(ELEVATION),style],children:_jsxs(View,{style:[styles.wrapper,contentStyle],children:[_jsx(Animated.View,{style:{height:height}}),_jsxs(Animated.View,{onLayout:handleLayout,style:[layout.measured||!visible?[styles.absolute,{transform:[{translateY:translateY}]}]:null,!layout.measured&&!visible?{opacity:0}:null],children:[_jsxs(View,{style:[styles.content,{marginBottom:dismissable?0:16}],children:[icon?_jsx(View,{style:styles.icon,children:_jsx(Icon,{name:icon,size:40})}):null,_jsx(Text,{style:[styles.message,{color:theme.colors.text}],accessibilityLiveRegion:visible?"polite":"none",accessibilityRole:"alert",children:content})]}),dismissable?_jsx(View,{style:styles.actions,children:_jsx(Button,{color:buttonColor||theme.colors.primary,title:"Close",onPress:function onPress(){return setVisible(false);}})}):null]})]})}));};var styles=StyleSheet.create({container:{elevation:ELEVATION},wrapper:{overflow:"hidden",alignSelf:"center",width:"100%",maxWidth:DEFAULT_MAX_WIDTH},absolute:{position:"absolute",top:0,width:"100%"},content:{flexDirection:"row",justifyContent:"flex-start",marginHorizontal:8,marginTop:16,marginBottom:0},icon:{margin:8},message:{flex:1,margin:8},actions:{flexDirection:"row",justifyContent:"flex-end",margin:8}});export default withTheme(Banner);
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.TopRightCircleIcon=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _Image=_interopRequireDefault(require("../components/Image"));var _Surface=_interopRequireDefault(require("../components/Surface"));var _Typography=require("../components/Typography");var _theming=require("../theming");var _Config=_interopRequireDefault(require("../components/Config"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["backgroundColor","padding"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Card.tsx";var ICON_SIZE=_Config.default.cardIconSize;var ICON_CONTAINER_SIZE=_Config.default.cardIconSize*2;var ICON_CONTAINER_PADDING=_Config.default.cardIconSize/2-1;var ICON_ELEVATION=_Config.default.cardIconElevation;var TopRightCircleIcon=(0,_theming.withTheme)(function(_ref){var Icon=_ref.Icon,icon=_ref.icon,theme=_ref.theme,onPress=_ref.onPress;return(0,_jsxRuntime.jsx)(_Surface.default,{style:{justifyContent:"center",alignItems:"center",elevation:ICON_ELEVATION,position:"absolute",top:12,right:12,width:ICON_CONTAINER_SIZE,height:ICON_CONTAINER_SIZE,padding:ICON_CONTAINER_PADDING,borderRadius:ICON_CONTAINER_SIZE,backgroundColor:"rgba(0, 0, 0, 0.1)"},children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?0.8:1}];},children:(0,_jsxRuntime.jsx)(Icon,{name:icon,size:ICON_SIZE,color:theme.colors.surface})})});});exports.TopRightCircleIcon=TopRightCircleIcon;var Card=function Card(_ref3){var Icon=_ref3.Icon,_ref3$image=_ref3.image,image=_ref3$image===void 0?_Config.default.cardImageUrl:_ref3$image,title=_ref3.title,subtitle=_ref3.subtitle,description=_ref3.description,textCentered=_ref3.textCentered,icon=_ref3.icon,_ref3$aspectRatio=_ref3.aspectRatio,aspectRatio=_ref3$aspectRatio===void 0?1.5:_ref3$aspectRatio,_ref3$elevation=_ref3.elevation,elevation=_ref3$elevation===void 0?2:_ref3$elevation,style=_ref3.style,onPress=_ref3.onPress,onPressIcon=_ref3.onPressIcon,titleStyle=_ref3.titleStyle,subtitleStyle=_ref3.subtitleStyle,descriptionStyle=_ref3.descriptionStyle,theme=_ref3.theme,children=_ref3.children;var _StyleSheet$flatten=_reactNative.StyleSheet.flatten(style||{}),bgColor=_StyleSheet$flatten.backgroundColor,padding=_StyleSheet$flatten.padding,styles=(0,_objectWithoutProperties2.default)(_StyleSheet$flatten,_excluded);var backgroundColor=bgColor?bgColor:theme.colors.surface;var innerPadding=padding?padding:12;return(0,_jsxRuntime.jsx)(_Surface.default,{style:[{elevation:elevation,backgroundColor:backgroundColor},styles],children:(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref4){var pressed=_ref4.pressed;return[{opacity:pressed?0.8:1}];},children:[(0,_jsxRuntime.jsx)(_Image.default,{style:{aspectRatio:aspectRatio},source:typeof image==="string"?{uri:image}:image,resizeMode:"cover"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:{padding:innerPadding},children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:{alignItems:textCentered?"center":"flex-start"},children:[title||title&&title!==""?(0,_jsxRuntime.jsx)(_Typography.Title,{text:title,style:titleStyle}):null,subtitle||subtitle&&subtitle!==""?(0,_jsxRuntime.jsx)(_Typography.Subtitle,{text:subtitle,style:subtitleStyle}):null,description||description&&description!==""?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{marginTop:4},children:(0,_jsxRuntime.jsx)(_Typography.Caption,{text:description,style:descriptionStyle})}):null,children]})}),icon?(0,_jsxRuntime.jsx)(TopRightCircleIcon,{Icon:Icon,icon:icon,onPress:onPressIcon}):null]})});};var _default=(0,_theming.withTheme)(Card);exports.default=_default;
1
+ import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["backgroundColor","padding"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Card.tsx";import React from"react";import{StyleSheet,View,Pressable}from"react-native";import Image from"../components/Image";import Surface from"../components/Surface";import{Title,Subtitle,Caption}from"../components/Typography";import{withTheme}from"../theming";import Config from"../components/Config";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ICON_SIZE=Config.cardIconSize;var ICON_CONTAINER_SIZE=Config.cardIconSize*2;var ICON_CONTAINER_PADDING=Config.cardIconSize/2-1;var ICON_ELEVATION=Config.cardIconElevation;export var TopRightCircleIcon=withTheme(function(_ref){var Icon=_ref.Icon,icon=_ref.icon,theme=_ref.theme,onPress=_ref.onPress;return _jsx(Surface,{style:{justifyContent:"center",alignItems:"center",elevation:ICON_ELEVATION,position:"absolute",top:12,right:12,width:ICON_CONTAINER_SIZE,height:ICON_CONTAINER_SIZE,padding:ICON_CONTAINER_PADDING,borderRadius:ICON_CONTAINER_SIZE,backgroundColor:"rgba(0, 0, 0, 0.1)"},children:_jsx(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?0.8:1}];},children:_jsx(Icon,{name:icon,size:ICON_SIZE,color:theme.colors.surface})})});});var Card=function Card(_ref3){var Icon=_ref3.Icon,_ref3$image=_ref3.image,image=_ref3$image===void 0?Config.cardImageUrl:_ref3$image,title=_ref3.title,subtitle=_ref3.subtitle,description=_ref3.description,textCentered=_ref3.textCentered,icon=_ref3.icon,_ref3$aspectRatio=_ref3.aspectRatio,aspectRatio=_ref3$aspectRatio===void 0?1.5:_ref3$aspectRatio,_ref3$elevation=_ref3.elevation,elevation=_ref3$elevation===void 0?2:_ref3$elevation,style=_ref3.style,onPress=_ref3.onPress,onPressIcon=_ref3.onPressIcon,titleStyle=_ref3.titleStyle,subtitleStyle=_ref3.subtitleStyle,descriptionStyle=_ref3.descriptionStyle,theme=_ref3.theme,children=_ref3.children;var _StyleSheet$flatten=StyleSheet.flatten(style||{}),bgColor=_StyleSheet$flatten.backgroundColor,padding=_StyleSheet$flatten.padding,styles=_objectWithoutProperties(_StyleSheet$flatten,_excluded);var backgroundColor=bgColor?bgColor:theme.colors.surface;var innerPadding=padding?padding:12;return _jsx(Surface,{style:[{elevation:elevation,backgroundColor:backgroundColor},styles],children:_jsxs(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref4){var pressed=_ref4.pressed;return[{opacity:pressed?0.8:1}];},children:[_jsx(Image,{style:{aspectRatio:aspectRatio},source:typeof image==="string"?{uri:image}:image,resizeMode:"cover"}),_jsx(View,{style:{padding:innerPadding},children:_jsxs(View,{style:{alignItems:textCentered?"center":"flex-start"},children:[title||title&&title!==""?_jsx(Title,{text:title,style:titleStyle}):null,subtitle||subtitle&&subtitle!==""?_jsx(Subtitle,{text:subtitle,style:subtitleStyle}):null,description||description&&description!==""?_jsx(View,{style:{marginTop:4},children:_jsx(Caption,{text:description,style:descriptionStyle})}):null,children]})}),icon?_jsx(TopRightCircleIcon,{Icon:Icon,icon:icon,onPress:onPressIcon}):null]})});};export default withTheme(Card);