From a78d669e1a416717c81d5477105a20f01e70d545 Mon Sep 17 00:00:00 2001 From: viraj-10 Date: Wed, 26 Jun 2024 14:53:42 +0530 Subject: [PATCH 1/2] chore: @gluestack-ui/themed version bump to 1.1.31 --- example/storybook-nativewind/package.json | 2 +- packages/config/package.json | 4 ++-- packages/themed/CHANGELOG.md | 6 ++++++ packages/themed/package.json | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/example/storybook-nativewind/package.json b/example/storybook-nativewind/package.json index d1271029b..b7e2d2f96 100644 --- a/example/storybook-nativewind/package.json +++ b/example/storybook-nativewind/package.json @@ -32,7 +32,7 @@ "@gluestack-style/animation-resolver": "^1.0.4", "@gluestack-style/react": "^1.0.56", "@gluestack-ui/config": "^1.1.18", - "@gluestack-ui/themed": "^1.1.30", + "@gluestack-ui/themed": "^1.1.31", "@gluestack/design-system": "^0.5.36", "@legendapp/motion": "^2.2.0", "@react-aria/button": "^3.7.0", diff --git a/packages/config/package.json b/packages/config/package.json index 8d39dfff2..5c4085c12 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -66,14 +66,14 @@ "@gluestack-ui/switch": "0.1.21", "@gluestack-ui/tabs": "0.1.16", "@gluestack-ui/textarea": "0.1.22", - "@gluestack-ui/themed": "1.1.30", + "@gluestack-ui/themed": "1.1.31", "@gluestack-ui/toast": "1.0.4", "@gluestack-ui/tooltip": "0.1.30", "@legendapp/motion": "latest" }, "peerDependencies": { "@gluestack-style/react": ">=1.0.56", - "@gluestack-ui/themed": ">=1.1.30" + "@gluestack-ui/themed": ">=1.1.31" }, "release-it": { "git": { diff --git a/packages/themed/CHANGELOG.md b/packages/themed/CHANGELOG.md index d04a2289d..115f8935c 100644 --- a/packages/themed/CHANGELOG.md +++ b/packages/themed/CHANGELOG.md @@ -1,5 +1,11 @@ # @gluestack-ui/themed +## 1.1.31 + +### Patch Changes + +- TextArea Typing Issue + ## 1.1.30 ### Patch Changes diff --git a/packages/themed/package.json b/packages/themed/package.json index 1e7dd3719..4c4a4da13 100644 --- a/packages/themed/package.json +++ b/packages/themed/package.json @@ -1,6 +1,6 @@ { "name": "@gluestack-ui/themed", - "version": "1.1.30", + "version": "1.1.31", "main": "build/index.js", "types": "build/index.d.ts", "module": "build/index", From eee9d8c11f3cd08d1fc3c4ca00b53325d1815f39 Mon Sep 17 00:00:00 2001 From: ankit-tailor Date: Wed, 26 Jun 2024 15:01:31 +0530 Subject: [PATCH 2/2] fix: useBreakPointValue hook --- .../utils/useBreakpointValue/index.tsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/nativewind/utils/useBreakpointValue/index.tsx b/packages/nativewind/utils/useBreakpointValue/index.tsx index 208fb6ab3..5a72870e9 100644 --- a/packages/nativewind/utils/useBreakpointValue/index.tsx +++ b/packages/nativewind/utils/useBreakpointValue/index.tsx @@ -1,9 +1,5 @@ import { Dimensions, useWindowDimensions } from 'react-native'; import { useEffect, useState } from 'react'; -type BreakPointValue = Partial<{ - // @ts-ignore - [key]: any; -}>; import DefaultTheme from 'tailwindcss/defaultConfig'; import resolveConfig from 'tailwindcss/resolveConfig'; @@ -11,6 +7,10 @@ import resolveConfig from 'tailwindcss/resolveConfig'; const TailwindTheme = resolveConfig(DefaultTheme); const screenSize = TailwindTheme.theme.screens; +type breakpoints = keyof typeof screenSize | 'default'; + +type BreakPointValue = Partial>; + const resolveScreenWidth: any = { default: 0, }; @@ -23,7 +23,13 @@ export const getBreakPointValue = (values: any, width: any) => { if (typeof values !== 'object') return values; let finalBreakPointResolvedValue: any; - const mediaQueriesBreakpoints: any = []; + const mediaQueriesBreakpoints: any = [ + { + key: 'default', + breakpoint: 0, + isValid: true, + }, + ]; Object.keys(resolveScreenWidth).forEach((key) => { const isValid = isValidBreakpoint(resolveScreenWidth[key], width); @@ -40,7 +46,8 @@ export const getBreakPointValue = (values: any, width: any) => { breakpoint.value = values.hasOwnProperty(breakpoint.key) ? // @ts-ignore values[breakpoint.key] - : mediaQueriesBreakpoints[index - 1].value; + : mediaQueriesBreakpoints[index - 1]?.value || + mediaQueriesBreakpoints[0]?.value; }); const lastValidObject = getLastValidObject(mediaQueriesBreakpoints); @@ -48,7 +55,7 @@ export const getBreakPointValue = (values: any, width: any) => { if (!lastValidObject) { finalBreakPointResolvedValue = values; } else { - finalBreakPointResolvedValue = lastValidObject.value; + finalBreakPointResolvedValue = lastValidObject?.value; } return finalBreakPointResolvedValue; };