Skip to content

Commit b4c7849

Browse files
committed
ReScript
1 parent 042e85c commit b4c7849

15 files changed

+110
-119
lines changed

.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ node_modules
99
# npm unused lock file (we use yarn.lock)
1010
package-lock.json
1111

12-
# ReScript / Reason / Ocaml artifacts
13-
#*.bs.js # we do want this files to ensure zero-cost
12+
# ReScript artifacts
13+
# *.bs.js # we do want this files to ensure zero-cost
1414
.bsb.lock
1515
**/lib/bs
1616
**/lib/ocaml

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Changelog of `@reason-react-native/viewpager`
1+
# Changelog of `@rescript-react-native/viewpager`
22

33
## 4.0.0 - 2020-11-19
44

55
- 4.0.0 compat
66
- rescript 8.2
7-
- reason-react-native 0.63
7+
- rescript-react-native 0.63
88

99
## 3.3.0 - 2020-01-30
1010

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 @reason-react-native contributors
3+
Copyright (c) 2019 @rescript-react-native contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# `@reason-react-native/viewpager`
1+
# `@rescript-react-native/viewpager`
22

3-
[![Build Status](https://github.com/reason-react-native/viewpager/workflows/Build/badge.svg)](https://github.com/reason-react-native/viewpager/actions)
4-
[![Version](https://img.shields.io/npm/v/@reason-react-native/viewpager.svg)](https://www.npmjs.com/@reason-react-native/viewpager)
5-
[![Chat](https://img.shields.io/discord/235176658175262720.svg?logo=discord&colorb=blue)](https://reasonml-community.github.io/reason-react-native/discord/)
3+
[![Build Status](https://github.com/rescript-react-native/viewpager/workflows/Build/badge.svg)](https://github.com/rescript-react-native/viewpager/actions)
4+
[![Version](https://img.shields.io/npm/v/@rescript-react-native/viewpager.svg)](https://www.npmjs.com/@rescript-react-native/viewpager)
5+
[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f&label=ReScript%20Forum&server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)
66

7-
[ReScript](https://rescript-lang.org) / [Reason](https://reasonml.github.io) bindings for
7+
[ReScript](https://rescript-lang.org) bindings for
88
[`@react-native-community/viewpager`](https://github.com/callstack/react-native-viewpager).
99

1010
Exposed as `ReactNativeViewPager` module.
1111

12-
`@reason-react-native/viewpager` X.y.\* means it's compatible with
12+
`@rescript-react-native/viewpager` X.y.\* means it's compatible with
1313
`@react-native-community/viewpager` X.y.\*
1414

1515
## Installation
@@ -20,30 +20,30 @@ is properly installed & configured by following their installation instructions,
2020
you can install the bindings:
2121

2222
```console
23-
npm install @reason-react-native/viewpager
23+
npm install @rescript-react-native/viewpager
2424
# or
25-
yarn add @reason-react-native/viewpager
25+
yarn add @rescript-react-native/viewpager
2626
```
2727

28-
`@reason-react-native/viewpager` should be added to `bs-dependencies` in your
28+
`@rescript-react-native/viewpager` should be added to `bs-dependencies` in your
2929
`bsconfig.json`:
3030

3131
```diff
3232
{
3333
//...
3434
"bs-dependencies": [
35-
"reason-react",
36-
"reason-react-native",
35+
"@rescript/react",
36+
"rescript-react-native",
3737
// ...
38-
+ "@reason-react-native/viewpager"
38+
+ "@rescript-react-native/viewpager"
3939
],
4040
//...
4141
}
4242
```
4343

4444
## Usage
4545

46-
```reason
46+
```rescript
4747
[@react.component]
4848
let app = () =>
4949
<SafeAreaView style={styles##body}>
@@ -62,7 +62,7 @@ let app = () =>
6262

6363
#### `ReactNativeViewPager` props
6464

65-
```reason
65+
```rescript
6666
~ref: ref=?,
6767
~initialPage: int=?,
6868
~scrollEnabled: bool=?,
@@ -83,13 +83,13 @@ let app = () =>
8383

8484
#### `ReactNativeViewPager.setPage`
8585

86-
```reason
86+
```rescript
8787
setPage: (T.t, int) => unit = "setPage";
8888
```
8989

9090
#### `ReactNativeViewPager.setPage`
9191

92-
```reason
92+
```rescript
9393
setPageWithoutAnimation: (T.t, int) => unit =
9494
"setPageWithoutAnimation";
9595
```
@@ -106,11 +106,11 @@ releases.
106106
## Contribute
107107

108108
Read the
109-
[contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md)
109+
[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)
110110
before contributing.
111111

112112
## Code of Conduct
113113

114114
We want this community to be friendly and respectful to each other. Please read
115-
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
115+
[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)
116116
so that you can understand what actions will and will not be tolerated.

bsconfig.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"name": "@reason-react-native/viewpager",
3-
"refmt": 3,
4-
"reason": {
5-
"react-jsx": 3
6-
},
2+
"name": "@rescript-react-native/viewpager",
3+
"reason": { "react-jsx": 3 },
74
"package-specs": {
85
"module": "commonjs",
96
"in-source": true
@@ -19,5 +16,5 @@
1916
"warnings": {
2017
"error": true
2118
},
22-
"bs-dependencies": ["reason-react", "reason-react-native"]
19+
"bs-dependencies": ["@rescript/react", "rescript-react-native"]
2320
}

package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@reason-react-native/viewpager",
2+
"name": "@rescript-react-native/viewpager",
33
"description": "ReScript bindings for @react-native-community/viewpager.",
44
"version": "4.0.0",
55
"publishConfig": {
@@ -8,19 +8,17 @@
88
"peerDependencies": {
99
"@react-native-community/viewpager": "^4.0.0"
1010
},
11-
"repository": "https://github.com/reason-react-native/viewpager.git",
11+
"repository": "https://github.com/rescript-react-native/viewpager.git",
1212
"license": "MIT",
1313
"keywords": [
1414
"rescript",
15-
"reason",
16-
"reasonml",
17-
"bucklescript",
1815
"react-native"
1916
],
2017
"files": [
2118
"*.md",
2219
"bsconfig.json",
23-
"src/**/*.re",
20+
"src/**/*.res",
21+
"src/**/*.resi",
2422
"src/**/*.js",
2523
"!src/**/*.bs.js"
2624
],
@@ -37,13 +35,13 @@
3735
"release": "npmpub"
3836
},
3937
"devDependencies": {
40-
"bs-platform": "^8.2.0",
38+
"bs-platform": "^9.0.0",
4139
"husky": "^4.0.0",
4240
"lint-staged": "^10.0.0",
4341
"npmpub": "^5.0.0",
4442
"prettier": "^2.0.0",
45-
"reason-react": "^0.9.0",
46-
"reason-react-native": "^0.63.0"
43+
"@rescript/react": "^0.10.0",
44+
"rescript-react-native": "^0.64.3"
4745
},
4846
"prettier": {
4947
"trailingComma": "all"

src/ReactNativeViewPager.bs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
var ViewPagerElement = require("./ViewPagerElement.bs.js");
4-
var Event$ReactNative = require("reason-react-native/src/apis/Event.bs.js");
4+
var Event$ReactNative = require("rescript-react-native/src/apis/Event.bs.js");
55

66
Event$ReactNative.SyntheticEvent({});
77

src/ReactNativeViewPager.re

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/ReactNativeViewPager.res

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
open ReactNative
2+
include ViewPagerElement
3+
4+
module PageScrollEvent = {
5+
type payload = {
6+
position: int,
7+
offset: float,
8+
}
9+
include Event.SyntheticEvent({
10+
type _payload = payload
11+
})
12+
}
13+
14+
module PageSelectedEvent = {
15+
type payload = {position: float}
16+
include Event.SyntheticEvent({
17+
type _payload = payload
18+
})
19+
}
20+
21+
module PageScrollStateChangedEvent = {
22+
// new bs new polyvar encoding
23+
//type payload = {pageScrollState: [ | `idle | `dragging | `settling]};
24+
type payload = {pageScrollState: string}
25+
include Event.SyntheticEvent({
26+
type _payload = payload
27+
})
28+
}
29+
30+
@module("@react-native-community/viewpager") @react.component
31+
external make: (
32+
~ref: ref=?,
33+
~initialPage: int=?,
34+
~scrollEnabled: bool=?,
35+
~onPageScroll: PageScrollEvent.t => unit=?,
36+
~onPageSelected: PageSelectedEvent.t => unit=?,
37+
~onPageScrollStateChanged: PageScrollStateChangedEvent.t => unit=?,
38+
~keyboardDismissMode: @string [#none | @as("on-drag") #onDrag]=?,
39+
~pageMargin: int=?,
40+
~onMoveShouldSetResponderCapture: ReactNative.Event.pressEvent => bool=?,
41+
~style: ReactNative.Style.t=?,
42+
~children: React.element=?,
43+
~orientation: [#horizontal | #vertical]=?,
44+
~transitionStyle: [#scroll | #curl]=?,
45+
~showPageIndicator: bool=?,
46+
~overScrollMode: ScrollView.overScrollMode=?,
47+
) => React.element = "default"

0 commit comments

Comments
 (0)