Skip to content

Commit c0cff6f

Browse files
YoussefHennabluerssenTimothée Vialatoux
authored
Map and SwipeableView Fixes/Updates (v47.2.3) (#641)
* Fixed Picker crash on IOS * v46.7.8 * Added keyboard auto dismiss to Picker and DatePicker (#585) * Added keyboard auto dismiss to Picker and DatePicker * Minor change to trigger rebuild * Minor change to trigger rebuild * Fixed Picker double click to open issue on web (#586) * Fixed broken web version of example app * Updated Picker to properly show web picker --------- Co-authored-by: Brian Luerssen <[email protected]> * Fix border colors of datepicker (#587) Co-authored-by: Brian Luerssen <[email protected]> * Fixed number input defaultValue not being used + allowed to be empty to show placeholder (#588) Co-authored-by: Brian Luerssen <[email protected]> * Added Deck Swiper component + example in example app (#581) * Added deck swiper component Changes from #580 Copying changes manually - easier than rebasing * Small change to comment to trigger rebuild * Added export for DeckSwiper in ui package * Moved ui package export above deprecated comment * Minor edit to comment * Fixed issue where border radius of theme is undefined * Removed default border radius from theme * Added layout to mapping --------- Co-authored-by: Brian Luerssen <[email protected]> * v46.8.0 (#593) * Added Table components * Added example + minor fixes to Table * Added borderStyle prop * Added mappings * Added padding props to mapping * Added BottomSheet with example * Some fixes + packaged in library source code to fix its bugs * Added mapping * Updated ScreenContainer to use style background in SafeAreaView (#601) * Added support for renderItem in DeckSwiper (#599) * Added support for renderItem in DeckSwiper * Fixed undefined key error when swiper is empty --------- Co-authored-by: Brian Luerssen <[email protected]> * Missing Stylespanel Sections (#584) * Add StylesPanelSections to Swiper * Add StylesPanelSections to mappings without them * Update Stylesheets * Updated Picker to treat empty string as a non value (#594) + removed placeholder as selectable value Co-authored-by: Brian Luerssen <[email protected]> * v46.8.1 * Updated allowed FlashList styles (#602) Co-authored-by: Brian Luerssen <[email protected]> * Added Markdown component (#597) * Added Markdown component * Updated mapping * Updated component type * Updated default value --------- Co-authored-by: Brian Luerssen <[email protected]> * Add TabView Component (#595) * Added TabView (#368) With some changes * Added example and exports + minor fixes * Downgraded pager version Newer version fails to switch page with ref method * Final minor updated to TabView * Added mappings * Updated group of accessibility label * Updateed prop groups * Updated default value of scroll enabled * Added default title to tabs * Updated intepretion of styling props of tabview * Updated prop mapping to be more clear * Made icon smaller * Update tab view item type checking + does not render when no items * Updated styles * Revert "Updated styles" This reverts commit 97d993e. * Removed default style of tabview --------- Co-authored-by: Brian Luerssen <[email protected]> * Add shadow component (for v46) (#583) * Added Shadow component * Made props optional * Added children + example * Fixed example name * Typo in mapping * Fixed typo in tag in mappings * Updated style to be passed as containerStyle * Made paintInside false by default * Made stretch false by default * Undo default stretch prop * Updated mapping to include advanced props --------- Co-authored-by: Brian Luerssen <[email protected]> * v46.9.0 (#603) * Added gesture handler package to core * Remove gesture handler from example * Added reanimated package to core * Updated reanimated version * Fixed scrolling inside sheet * Update decription on prop * Simple change to trigger rebuild * Remove static array prop function * Updated reanimated a gesture handler to expo recomended versions * Removed default layout of bottom sheet * Only load maps script when not loaded * Refactored how props shared with children (using Context) * Added a way to include rows using 'renderItem' prop * Added header and scrolling capability * Removes unnecessary stylespanel sections * Updated table mappings * Updated default cell padding * Only take first header row even when several provided * Refactored header detection to find nested header within renderItem * Passed rest props to inner scroll view * Added show scroll indicator to mapping * Fix to nested children not being an array * Add YoutubePlayer Component (#596) * Added Youtube component As done in #367 * Added mapping * Removed default playlist (overrides video) * Removed default videoId * Only show default video when both playlist and video not provided * v46.10.0 * Update Lerna Method To Be Exact (#608) * Use Exact Versions * v46.10.1 * Fixed first item in picker not selectable (#605) Co-authored-by: Brian Luerssen <[email protected]> * Added mapping for native base layout components * Removed Row components (superseded by NativeBase) * Removed Row exports * Updated mapping descriptions * Squashed commit of the following: commit 0aef0ce Author: Youssef Henna <[email protected]> Date: Sun Feb 26 14:51:22 2023 +0200 Revert "Removed web-webview from example" This reverts commit 38378ae. commit 38378ae Author: Youssef Henna <[email protected]> Date: Sun Feb 26 14:32:19 2023 +0200 Removed web-webview from example commit d2c0456 Author: Youssef Henna <[email protected]> Date: Sun Feb 26 13:37:07 2023 +0200 Removed web-webview from being a core dependency commit 0933344 Author: Youssef Henna <[email protected]> Date: Sun Feb 26 13:29:22 2023 +0200 Removed webpack (no effect) commit 05f8994 Author: Youssef Henna <[email protected]> Date: Sun Feb 26 13:19:14 2023 +0200 Added webpack config to eslint ignore commit f92a40f Author: Youssef Henna <[email protected]> Date: Sun Feb 26 13:15:21 2023 +0200 Removed .eslintrc commit 5cf5fa9 Author: Youssef Henna <[email protected]> Date: Sun Feb 26 13:00:40 2023 +0200 Added webpack config for 3rd party libraries * Revert "Squashed commit of the following:" This reverts commit c032c85. * Replaced YoutubePlayer web impl to use https://www.npmjs.com/package/react-youtube * Refactored file structure to properly picked up by native and web + removed mute prop * Updated aspect ratio prop to be numerical * Updated mapping styles * v46.10.2 * Updated container props * Removed old Container mapping * Removed container example * Updated mapping for spacer * Removed direction and row of stack. Use style directly instead * Remove Container component * Remove Container component * Remove Container ui index * Updated mapping of Aspect ration to only include supported styles * Reworked how Maps script is loaded * Added comment * Removed comment * Revert "Removed comment" This reverts commit da0d785. * Change in core to attempt corrupt build fix * Change table file to attempt corrupt build fix * Revert "Change table file to attempt corrupt build fix" This reverts commit be4cf4b. * Revert "Change in core to attempt corrupt build fix" This reverts commit f1bb428. * Remove comment * Remove deprecated FAB * Remove deprecated Card Wrapper * Remove ProgressIndicator * Delete Card mappings * Refactored Table to reduce files * Removed theme from Table * Changed Table export to not be default * Revert "Changed Table export to not be default" This reverts commit 48afc09. * Revert "Removed theme from Table" This reverts commit ff93c5b. * Revert "Refactored Table to reduce files" This reverts commit 714d9a3. * Move Nativebase mappings out of folder * Revert "Move Nativebase mappings out of folder" This reverts commit 52c9e48. * Remove header mappings * Move mappings outside core * Revert "Move mappings outside core" This reverts commit a05942d. * lerna prepare concurrency 1 * Revert "lerna prepare concurrency 1" This reverts commit 31b4cd5. * Run ci on mac * Revert "Remove ProgressIndicator" This reverts commit d01bb61. * Revert "Delete Card mappings" This reverts commit bdd69c1. * Revert "Remove header mappings" This reverts commit 1ce355a. * Revert "Remove deprecated FAB" This reverts commit 35f9ee7. * Revert "Remove deprecated Card Wrapper" This reverts commit 5b5de36. * Add comment to map script loader * Revert to ubuntu in ci * Updated bob builder version * Updated core bob configuration * core readd configuration options * Remove bulder depenendcy from core * Reconfigured bob the builder using automatic configuration * Include source mappings in core * Only include source mappings in module * Replace \\ with / * Removed source mapping config entirley from core * Remove comment from MapScriptLoader * Revert "Removed Row components (superseded by NativeBase)" This reverts commit 7bd428f. * Revert "Removed Row exports" This reverts commit b68f423. * Revert "Removed old Container mapping" This reverts commit 7ea0f84. * Revert "Removed container example" This reverts commit 604d008. * Revert "Remove Container component" This reverts commit cf575f1. * Revert "Remove Container component" This reverts commit 23a66b3. * Revert "Remove Container ui index" This reverts commit d2fd894. * Remove Container from Nativebase * Deprecated old components replaced by Nativebase * v46.11.0 * Only use default elevation when undefined (not zero) * Added testing categrory to nativebase and table * Added onRegionChange trigger to maps * Added image as marker support for maps * Updated mapping to include image prop * Added ref to webview * Added utility function for extracting styles * Added SwipeableView components * Updated how styling is applied * Added simple example * Added bunch of props and fixed swip handling * Reordering of swipeable view * Reset to default swipe on open percent * Added mappings + removed some props * updated tag * Changed default TabView inactive to be darker shade of gray * Remove default placeholder at component level * Removed onValueChange from useEffect depenencies incase of anonymous function * Ignore useEffect dependencies * Updated how first value set to prevent useEffect issues * v46.11.1 * Updated default paintInside + updated how styles are handled * Fixed DeckSwiper sizing issue when aligned to center * Possible fix double height issue with deck swiper * Trigger rebuild * Revert "Possible fix double height issue with deck swiper" This reverts commit a6fbe8e. * Fix double height issue with deck swiper on draftbit * Trigger rebuild * Added missing style panel sections to deckswiper * Updated Shadow styles to support sizing * Updated styles of DeckSwiper to what actually works * Updated missed mapping * Remove nativebase and undeprecate old layout components * v46.11.2 (#630) * Added onRegion change trigger to map view mapping * Updated mapping for trigger * Updated pin image prop type * Updated proper usage of pin image and added pinImageSize prop * Added onPress trigger to map marker * v46.11.3 * Updated how image source is handled for maps pin * v46.11.4 * Added patch to address x offset not working on IOS * Updated bottom sheet props to be less technically involved * Add numeric form type to snap positions * Updated defauly snap values * Update custom snap points prop mapping * v46.11.5 * Revert "v46.11.5" This reverts commit 7097c1a. * Updated example name + made mapping category testing * Updated shared props variable name * Moved button and swipe handlers to testing category * v46.12.0 * Fix `FlatList` not working because of the forced `flex` style attribute Some testing in Snack showed that the `FlatList` component was not properly working, the main reason being that the `flex` style attribute was forced to `1` in the `FlatList` component. For whatever reason, when this settings is set, either the Webpreview fail to render the FLatlist, or the Appetize preview do. * Updated default disable of swipeable view * Update maps callback args to provide more inforamtion * Removed nullable on onPress and onSwipe Will only be rendered under SwipeableView when onPress/onSwipe provided * Fixed issue with size styles application for web on swipeable view * v46.12.1 * Remove duplicate in package.json * v47.2.3 * Removed state from MapView * Addressed PR comments --------- Co-authored-by: Brian Luerssen <[email protected]> Co-authored-by: Brian Luerssen <[email protected]> Co-authored-by: Timothée Vialatoux <[email protected]>
1 parent 602fa61 commit c0cff6f

File tree

20 files changed

+114
-54
lines changed

20 files changed

+114
-54
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ jobs:
7474
--yes \
7575
--no-verify-access
7676
77+
- name: Release packages (46)
78+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/46'
79+
env:
80+
NODE_AUTH_TOKEN: ${{ secrets.JIGSAW_AUTH_TOKEN }}
81+
run: |
82+
# Only publishes when finding a new `lerna version` was pushed to
83+
# the branch. But for purposes of _this_ action, that means master.
84+
# You have to manually run lerna version locally and get that PR
85+
# merged before this does anything.
86+
yarn lerna publish from-package \
87+
--ignore-scripts \
88+
--yes \
89+
--no-verify-access
90+
7791
- name: Release to Snack (PRs)
7892
if: github.event_name == 'pull_request'
7993
run: |

example/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@draftbit/example",
33
"description": "Example app for @draftbit/ui",
4-
"version": "47.2.2",
4+
"version": "47.2.3",
55
"private": true,
66
"main": "__generated__/AppEntry.js",
77
"scripts": {
@@ -15,8 +15,8 @@
1515
"clean:modules": "rimraf node_modules"
1616
},
1717
"dependencies": {
18-
"@draftbit/maps": "47.2.2",
19-
"@draftbit/ui": "47.2.2",
18+
"@draftbit/maps": "47.2.3",
19+
"@draftbit/ui": "47.2.3",
2020
"@expo/dev-server": "0.1.123",
2121
"@expo/webpack-config": "^0.17.2",
2222
"@react-navigation/drawer": "^5.12.9",

example/src/SwipeableViewExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ const SwipeableViewExample: React.FC = () => {
1515
<Text>Some Content</Text>
1616

1717
<SwipeableViewButton
18-
onPress={null}
18+
onPress={() => {}}
1919
side="left"
2020
title="Button"
2121
icon="add"
2222
/>
2323
<SwipeableViewButton
24-
onPress={null}
24+
onPress={() => {}}
2525
side="left"
2626
title="Button"
2727
icon="add"
2828
/>
2929
<SwipeableViewSwipeHandler
30-
onSwipe={null}
30+
onSwipe={() => {}}
3131
side="right"
3232
title="Swipe"
3333
icon="add"

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "47.2.2",
2+
"version": "47.2.3",
33
"npmClient": "yarn",
44
"useWorkspaces": true,
55
"packages": ["packages/*", "example"],

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@draftbit/core",
3-
"version": "47.2.2",
3+
"version": "47.2.3",
44
"description": "Core (non-native) Components",
55
"main": "lib/commonjs/index.js",
66
"module": "lib/module/index.js",
@@ -41,7 +41,7 @@
4141
"dependencies": {
4242
"@date-io/date-fns": "^1.3.13",
4343
"@draftbit/react-theme-provider": "^2.1.1",
44-
"@draftbit/types": "47.2.2",
44+
"@draftbit/types": "47.2.3",
4545
"@material-ui/core": "^4.11.0",
4646
"@material-ui/pickers": "^3.2.10",
4747
"@react-native-community/slider": "4.2.4",

packages/core/src/components/SwipeableView/SwipeableView.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,23 @@ const SwipeableView: React.FC<React.PropsWithChildren<SwipeableViewProps>> = ({
7777
const { borderStyles, marginStyles } =
7878
extractBorderAndMarginStyles(viewStyles);
7979

80+
const sizeStyles = extractSizeStyles(viewStyles);
81+
8082
const parentContainerStyles = StyleSheet.flatten([
8183
borderStyles,
8284
marginStyles,
8385
extractFlexItemStyles(viewStyles),
8486
extractPositionStyles(viewStyles),
8587
extractEffectStyles(viewStyles),
86-
extractSizeStyles(viewStyles),
88+
sizeStyles,
8789
]);
8890

8991
//Remove styles already consumed from viewStyles
9092
Object.keys(parentContainerStyles).forEach((key) => delete viewStyles[key]);
91-
const surfaceContainerStyles = viewStyles;
93+
const surfaceContainerStyles = StyleSheet.flatten([
94+
viewStyles,
95+
sizeStyles /* Size styles needs to be readded to surface container due to inconsistencies on web */,
96+
]);
9297

9398
const [componentWidth, setComponentWidth] = React.useState<number | null>(
9499
null
@@ -289,7 +294,7 @@ const styles = StyleSheet.create({
289294
surfaceContainer: {
290295
flexDirection: "row",
291296
width: "100%",
292-
height: "100%",
297+
minHeight: 50,
293298
padding: 10,
294299
alignItems: "center",
295300
overflow: "hidden",

packages/core/src/components/SwipeableView/SwipeableViewButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from "react";
33
export interface SwipeableViewButtonProps {
44
title: string;
55
side: "left" | "right";
6-
onPress: (() => void) | null; //Not optional in order to always exist in props
6+
onPress?: () => void;
77
icon?: string;
88
iconSize?: number;
99
backgroundColor?: string;

packages/core/src/components/SwipeableView/SwipeableViewSwipeHandler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from "react";
33
export interface SwipeableViewSwipeHandlerProps {
44
title: string;
55
side: "left" | "right";
6-
onSwipe: (() => void) | null; //Not optional in order to always exist in props
6+
onSwipe?: () => void;
77
icon?: string;
88
iconSize?: number;
99
backgroundColor?: string;

packages/core/src/mappings/SwipeableView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ export const SEED_DATA = [
8686
disableLeftSwipe: createBoolProp({
8787
label: "Disable left swipe",
8888
description: "Whether left swipe is enabled or not",
89-
defaultValue: true,
89+
defaultValue: false,
9090
}),
9191
disableRightSwipe: createBoolProp({
9292
label: "Disable right swipe",
9393
description: "Whether right swipe is enabled or not",
94-
defaultValue: true,
94+
defaultValue: false,
9595
}),
9696
leftOpenValue: createStaticNumberProp({
9797
label: "Left open value",

packages/core/src/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export function extractEffectStyles(
169169
return effectStyles;
170170
}
171171

172-
export const sizeStyleNames = ["width", "height"];
172+
export const sizeStyleNames = ["width", "height", "minWidth", "minHeight"];
173173

174174
export function extractSizeStyles(
175175
style: StyleProp<any>,

0 commit comments

Comments
 (0)