Skip to content

Commit

Permalink
merge with release/1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaiblaga89 committed Aug 17, 2023
2 parents 3de41a2 + ca0fd59 commit 78edc5c
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion packages/app-harness/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"version": "1.1.0-alpha.0",
"identifier": "io.flexn.app.harness",
"icon": "./static/icon.png"
}
}
2 changes: 1 addition & 1 deletion packages/app-harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@
"browserslist": [
"> 1%"
]
}
}
2 changes: 1 addition & 1 deletion packages/app-harness/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
}
},
"workspaceID": "flexn"
}
}
4 changes: 2 additions & 2 deletions packages/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"clean": "rm -rf ./lib && rm -rf tsconfig.tsbuildinfo",
"compile": "tsc -b tsconfig.json",
"watch": "tsc --watch --preserveWatchOutput",
"postinstall": "sh tools/overrideRNScrollView.sh"
"postinstall": "bash tools/overrideRNScrollView.sh"
},
"files": [
"lib",
Expand Down Expand Up @@ -52,4 +52,4 @@
"react": "*",
"react-native": ">= 0.67.2"
}
}
}
19 changes: 15 additions & 4 deletions packages/create/src/focusManager/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type {
ColorValue,
View as RNView,
} from 'react-native';
import type { MouseEvent, PointerEvent } from 'react';
import type { FlashListProps as FLProps, ListRenderItemInfo } from '@flexn/shopify-flash-list';

import FocusModel from './model/abstractFocusModel';
Expand Down Expand Up @@ -113,7 +114,17 @@ export type RecyclableListFocusOptions = {
autoLayoutSize?: number;
};

export interface ViewProps extends RNViewProps {
type MouseEvents = {
onMouseDown?: (e: MouseEvent) => void;
onMouseEnter?: (e: MouseEvent) => void;
onMouseLeave?: (e: MouseEvent) => void;
onMouseMove?: (e: MouseEvent) => void;
onMouseOver?: (e: MouseEvent) => void;
onMouseOut?: (e: MouseEvent) => void;
onMouseUp?: (e: MouseEvent) => void;
};

export interface ViewProps extends RNViewProps, MouseEvents {
focusOptions?: {
group?: string;
focusKey?: string;
Expand All @@ -140,7 +151,7 @@ export interface ViewGroupProps extends RNViewProps {
ref?: React.ForwardedRef<RNView> | React.MutableRefObject<RNView>;
}

export interface PressableProps extends RNPressableProps {
export interface PressableProps extends RNPressableProps, MouseEvents {
focus?: boolean;
focusOptions?: PressableFocusOptions;
focusContext?: FocusContext;
Expand All @@ -150,8 +161,8 @@ export interface PressableProps extends RNPressableProps {
onFocus?: () => void;
className?: string;
style?: ViewProps['style'];
onHoverIn?: null | ((event: MouseEvent) => void) | undefined;
onHoverOut?: null | ((event: MouseEvent) => void) | undefined;
onHoverIn?: (e: PointerEvent) => void;
onHoverOut?: (e: PointerEvent) => void;
}

export interface TouchableOpacityProps extends RNTouchableOpacityProps {
Expand Down
8 changes: 8 additions & 0 deletions packages/create/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@ export {
RemoteHandlerCallback,
ClassRemoteHandlerCallback,
} from './remoteHandler';

// Type declarations
import 'react-native';
declare module 'react-native' {
interface AccessibilityProps {
accessibilityLevel?: number;
}
}
8 changes: 3 additions & 5 deletions packages/create/tools/overrideRNScrollView.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -euo pipefail

Expand All @@ -7,16 +7,14 @@ RN_DIR="${CREATE_DIR}/../../../react-native"
RN_SCROLLVIEW_DIR="${RN_DIR}/Libraries/Components/ScrollView"
MIN_RN_VERSION="68"

echo "${RN_DIR}/package.json"

if [ -e "${RN_DIR}/package.json" ] ; then
PACKAGE_VERSION=$(cat ${RN_DIR}/package.json \
PACKAGE_VERSION=$(cat "${RN_DIR}"/package.json \
| grep version \
| head -1 \
| awk -F: '{print $2 }' \
| sed 's/[",]//g')

if [ -e $RN_SCROLLVIEW_DIR ] && [ "${PACKAGE_VERSION:3:2}" -ge "${MIN_RN_VERSION}" ] ; then
if [ -e "$RN_SCROLLVIEW_DIR" ] && [ "${PACKAGE_VERSION:3:2}" -ge "${MIN_RN_VERSION}" ] ; then
sed -i '' "s|'RCTScrollView'|Platform.isTV \&\& Platform.OS === 'android' ? 'RCTScrollViewTV' : 'RCTScrollView'|" "${RN_SCROLLVIEW_DIR}/ScrollViewNativeComponent.js"
echo "Overriding done."
else
Expand Down
2 changes: 1 addition & 1 deletion packages/template-starter/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"version": "1.1.0-alpha.0",
"identifier": "io.flexn.template",
"icon": "./static/icon.png"
}
}
2 changes: 1 addition & 1 deletion packages/template-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@
"browserslist": [
"> 2%"
]
}
}
2 changes: 1 addition & 1 deletion packages/template-starter/renative.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,4 @@
"source": "PROJECT_HOME/secrets/privateConfigs.enc"
}
}
}
}

0 comments on commit 78edc5c

Please sign in to comment.