Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
483 changes: 477 additions & 6 deletions example-web/package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions example-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject"
"eject": "craco eject",
"refresh-package": "rimraf ./node_modules/@react-native-community/slider && npx copyfiles -u 2 \"./../package/**/*\" ./node_modules/@react-native-community/slider && rimraf ./node_modules/@react-native-community/slider/node_modules"
},
"eslintConfig": {
"extends": [
Expand All @@ -43,7 +44,9 @@
},
"devDependencies": {
"@craco/craco": "^5.9.0",
"@dealmore/craco-plugin-babel-include": "^1.0.0"
"@dealmore/craco-plugin-babel-include": "^1.0.0",
"copyfiles": "^2.4.1",
"rimraf": "^6.0.1"
},
"overrides": {
"react-scripts": {
Expand Down
18 changes: 8 additions & 10 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16,479 changes: 6,620 additions & 9,859 deletions package/package-lock.json

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native-community/eslint-config": "^3.2.0",
"@react-native/babel-preset": "0.76.3",
"@react-native/eslint-config": "0.76.3",
"@react-native/metro-config": "0.76.3",
"@react-native/typescript-config": "0.76.3",
"@react-native/babel-preset": "^0.81.1",
"@react-native/eslint-config": "^0.81.1",
"@react-native/metro-config": "^0.81.1",
"@react-native/typescript-config": "^0.81.1",
"@types/jest": "^28.1.8",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"@types/react": "^19.2.0",
"babel-jest": "^29.7.0",
"babel-plugin-module-resolver": "5.0.0",
"copyfiles": "^2.4.1",
Expand All @@ -48,10 +47,9 @@
"flow-bin": "^0.163.0",
"jest": "^29.5.0",
"prettier": "2.8.8",
"react": "^18.3.1",
"react-native": "^0.76.3",
"react-native-windows": "^0.76.2",
"react-test-renderer": "^18.3.1",
"react": "^19.2.0",
"react-native": "^0.81.4",
"react-test-renderer": "^19.2.0",
"typescript": "^5.0.4"
},
"repository": {
Expand Down
4 changes: 1 addition & 3 deletions package/src/RNCSliderNativeComponent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type {ColorValue, HostComponent, ViewProps} from 'react-native';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
//@ts-ignore
import type {ImageSource} from 'react-native/Libraries/Image/ImageSource';
import {ImageSource, codegenNativeComponent} from 'react-native';
import type {
Float,
WithDefault,
Expand Down
5 changes: 3 additions & 2 deletions package/src/RNCSliderNativeComponent.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
GestureResponderEvent,
LayoutChangeEvent,
Image,
ImageSourcePropType,
} from 'react-native';
//@ts-ignore
import type {ImageSource} from 'react-native/Libraries/Image/ImageSource';
Expand Down Expand Up @@ -79,7 +80,7 @@ const RCTSliderWebComponent = React.forwardRef(
const containerRef = forwardedRef || React.createRef();
const containerPositionInvalidated = React.useRef(false);
const [value, setValue] = React.useState(initialValue || minimumValue);
const lastInitialValue = React.useRef<number>();
const lastInitialValue = React.useRef<number>(0);
const animationValues = React.useRef<AnimationValues>({
val: new Animated.Value(value),
min: new Animated.Value(minimumValue),
Expand Down Expand Up @@ -364,7 +365,7 @@ const RCTSliderWebComponent = React.forwardRef(
<View pointerEvents="none" style={thumbViewStyle}>
{thumbImage !== undefined ? (
<Image
source={thumbImage}
source={thumbImage as ImageSourcePropType}
style={{width: '100%', height: '100%'}}
/>
) : null}
Expand Down
8 changes: 4 additions & 4 deletions package/src/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import {
NativeSyntheticEvent,
StyleProp,
View,
ImageSource,
ImageSourcePropType,
} from 'react-native';
import RCTSliderNativeComponent from './index';
//@ts-ignore
import type {ImageSource} from 'react-native/Libraries/Image/ImageSource';

import type {FC, Ref} from 'react';
import {MarkerProps} from './components/TrackMark';
Expand Down Expand Up @@ -317,9 +317,9 @@ const SliderComponent = (
thumbImage={
Platform.OS === 'web'
? props.thumbImage
: props.StepMarker
: props.StepMarker || !props.thumbImage
? undefined
: Image.resolveAssetSource(props.thumbImage)
: Image.resolveAssetSource(props.thumbImage as ImageSourcePropType)
}
ref={forwardedRef}
style={[
Expand Down
89 changes: 0 additions & 89 deletions package/src/__tests__/Slider.test.tsx

This file was deleted.

Loading
Loading