Skip to content

Commit b4c7849

Browse files
committedMay 3, 2021
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"

‎src/ViewPagerElement.re

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

‎src/ViewPagerElement.res

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type element
2+
type ref = React.ref<Js.nullable<element>>
3+
4+
include ViewPagerMethods.Make({
5+
type t = element
6+
})

‎src/ViewPagerMethods.re

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

‎src/ViewPagerMethods.res

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Make = (
2+
T: {
3+
type t
4+
},
5+
) => {
6+
@send external setPage: (T.t, int) => unit = "setPage"
7+
@send
8+
external setPageWithoutAnimation: (T.t, int) => unit = "setPageWithoutAnimation"
9+
}

‎yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@
127127
dependencies:
128128
"@types/node" ">= 8"
129129

130+
"@rescript/react@^0.10.0":
131+
version "0.10.2"
132+
resolved "https://registry.yarnpkg.com/@rescript/react/-/react-0.10.2.tgz#170d2a5ff34ad09cd614d92467d5efad95202794"
133+
integrity sha512-Qe21P4WnrmrbhbEMQ4dpaXC1/iMMc7JmqjuSpZouSP+s41K5dCXUGY9sds30gajU74lSfJdG2PzSDYcNAcDyVA==
134+
130135
"@sindresorhus/df@^1.0.1":
131136
version "1.0.1"
132137
resolved "https://registry.yarnpkg.com/@sindresorhus/df/-/df-1.0.1.tgz#c69b66f52f6fcdd287c807df210305dbaf78500d"
@@ -251,10 +256,10 @@ braces@^3.0.1:
251256
dependencies:
252257
fill-range "^7.0.1"
253258

254-
bs-platform@^8.2.0:
255-
version "8.3.2"
256-
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-8.3.2.tgz#c307f1cc2d2397c3d088c7f3b62e9f493283cdcf"
257-
integrity sha512-iOTi5JIlNPoCPq31NS9ET79FLyCpwTL2JZbgHz35LzY9Bch1iDtbBR3FVGhRbjphxelAP4fLlFONfUNp5Y3a5g==
259+
bs-platform@^9.0.0:
260+
version "9.0.2"
261+
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-9.0.2.tgz#a6eac70eb8924a322556dacaccbfbc9b2a0d3a37"
262+
integrity sha512-Ye9JqJ4Oa7mcjjoOVRYI8Uc2Cf8N7jQLWDcdUplY7996d/YErSR7WitmV7XnSwr4EvdrbwjEsg1NxNjUQv3ChA==
258263

259264
callsites@^3.0.0:
260265
version "3.1.0"
@@ -1104,21 +1109,16 @@ readjson@^2.0.1:
11041109
dependencies:
11051110
try-catch "^3.0.0"
11061111

1107-
reason-react-native@^0.63.0:
1108-
version "0.63.0"
1109-
resolved "https://registry.yarnpkg.com/reason-react-native/-/reason-react-native-0.63.0.tgz#08de85136a41809b9a66cac066d4ea6975406000"
1110-
integrity sha512-rE1OOph5Jxceost2ahdvX+VXJ2RPNyefX9FMXa/OXgqmLKjFeZuyVOySUj41UoohOYyKmZWbgansDGccwYrdUQ==
1111-
1112-
reason-react@^0.9.0:
1113-
version "0.9.1"
1114-
resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.9.1.tgz#30a887158200b659aa03e2d75ff4cc54dc462bb0"
1115-
integrity sha512-nlH0O2TDy9KzOLOW+vlEQk4ExHOeciyzFdoLcsmmiit6hx6H5+CVDrwJ+8aiaLT/kqK5xFOjy4PS7PftWz4plA==
1116-
11171112
regenerator-runtime@^0.13.4:
11181113
version "0.13.5"
11191114
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697"
11201115
integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==
11211116

1117+
rescript-react-native@^0.64.3:
1118+
version "0.64.3"
1119+
resolved "https://registry.yarnpkg.com/rescript-react-native/-/rescript-react-native-0.64.3.tgz#8fd11a2681cfdd65c02f0ff620186e5adf0c6854"
1120+
integrity sha512-PjGDkV3RYiCTk4hCZyaKtZJV69By0AmJuzWyuHZONdeCB0q3DwjVJtA73gu6+jBrdl0OWon6UdXaVRXhhR47cQ==
1121+
11221122
resolve-from@^4.0.0:
11231123
version "4.0.0"
11241124
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"

0 commit comments

Comments
 (0)