Skip to content

Commit c3dce60

Browse files
committed
new home
0 parents  commit c3dce60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3935
-0
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.js linguist-vendored
2+
3+
*.java linguist-vendored
4+
5+
*.m linguist-vendored

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
*.class
2+
*.log
3+
4+
# sbt specific
5+
.cache/
6+
.history/
7+
.lib/
8+
dist/*
9+
target/
10+
lib_managed/
11+
src_managed/
12+
project/boot/
13+
project/plugins/project/
14+
15+
# Scala-IDE specific
16+
.scala_dependencies
17+
.worksheet
18+
19+
#Intellij
20+
.idea
21+
*.iml
22+
23+
#mac
24+
.DS_Store
25+
26+
27+
28+
#node
29+
30+
node_modules/
31+
npm-debug.log
32+
33+
34+
#project

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# TODO

build.sbt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name := "universal"
2+
3+
version := "2017.1.15"
4+
5+
enablePlugins(ScalaJSPlugin)
6+
7+
val scala211 = "2.11.8"
8+
9+
val scala212 = "2.12.0"
10+
11+
scalaVersion := scala211
12+
13+
crossScalaVersions := Seq(scala211,scala212)
14+
15+
scalacOptions ++= Seq(
16+
"-feature",
17+
"-deprecation",
18+
"-unchecked",
19+
"-language:implicitConversions"
20+
)
21+
22+
//Dependencies
23+
libraryDependencies += "scalajs-react-universe" %%% "core" % "2017.1.15"
24+
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.9.1"
25+
26+
27+
//bintray
28+
resolvers += Resolver.jcenterRepo
29+
30+
organization := "scalajs-react-universe"
31+
32+
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html"))
33+
34+
bintrayOrganization := Some("scalajs-react-universe")
35+
36+
bintrayRepository := "maven"
37+
38+
bintrayVcsUrl := Some("[email protected]:scalajs-react-universe/universal.git")
39+
40+
publishArtifact in Test := false
41+
42+
//Test
43+
resolvers += Resolver.bintrayRepo("scalajs-react-universe", "maven")
44+
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.0" % Test
45+
//libraryDependencies += "scalajs-react-universe" %%% "enzyme" % "2017.1.0" % Test
46+
scalaJSStage in Global := FastOptStage

project/DepsVerifyPlugin.scala

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import sbt._
2+
import Keys._
3+
4+
object DepsVerifyPlugin extends sbt.AutoPlugin {
5+
override def requires = plugins.JvmPlugin
6+
override def trigger = allRequirements
7+
override def projectSettings = Seq(
8+
publishConfiguration := {
9+
val old = publishConfiguration.value
10+
val ur = update.value
11+
ur.configuration("compile") foreach { compileReport =>
12+
val allModules = compileReport.allModules
13+
val snapshotDeps = allModules filter { _.revision contains "SNAPSHOT" }
14+
if (snapshotDeps.nonEmpty) {
15+
sys.error(
16+
"SNAPSHOT found in classpath:\n" +
17+
snapshotDeps.mkString("\n")
18+
)
19+
}
20+
}
21+
old
22+
}
23+
)
24+
}

project/build.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sbt.version=0.13.11
2+

project/plugins.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14")
2+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
3+
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package sri.universal
2+
3+
import scala.scalajs.js
4+
import scala.scalajs.js.annotation.ScalaJSDefined
5+
import scala.scalajs.js.{UndefOr => U}
6+
7+
8+
9+
@ScalaJSDefined
10+
trait XYValueLiteral extends js.Object {
11+
var x: Double
12+
var y: Double
13+
}
14+
15+
16+
@ScalaJSDefined
17+
trait WidthHeightLiteral extends js.Object {
18+
var width: Double
19+
var height: Double
20+
}
21+
22+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package sri.universal
2+
3+
import scala.scalajs.js
4+
5+
@js.native
6+
trait ReactEvent[T <: js.Object] extends js.Object {
7+
8+
val nativeEvent: T = js.native
9+
}
10+
11+
@js.native
12+
trait TextInputEvent extends js.Object {
13+
14+
val text: String = js.native
15+
16+
val contentSize: TextInputContentSize = js.native
17+
18+
val contentOffset: TextContentOffset = js.native
19+
}
20+
21+
@js.native
22+
trait TextInputContentSize extends js.Object {
23+
24+
val width: Double = js.native
25+
26+
val height: Double = js.native
27+
}
28+
29+
@js.native
30+
trait TextContentOffset extends js.Object {
31+
32+
val x: Double = js.native
33+
34+
val y: Double = js.native
35+
}
36+
37+
@js.native
38+
trait ImageEvent extends js.Object {
39+
40+
}
41+
42+
@js.native
43+
trait WebViewEvent extends js.Object {
44+
val data: String = js.native
45+
}
46+
47+
48+
@js.native
49+
trait SyntheticEvent extends js.Object {
50+
51+
}
52+
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package sri.universal
2+
3+
import sri.core.ReactClass
4+
import sri.universal.apis.{Animated, AppRegistry, AsyncStorageJS, DeviceEventEmitter, Keyboard, PanResponder, PixelRatio, ReactPlatForm, StyleSheet}
5+
6+
import scala.scalajs.js
7+
8+
9+
@js.native
10+
trait ReactUniversal extends js.Object {
11+
//components
12+
val Text: ReactClass = js.native
13+
val View: ReactClass = js.native
14+
val KeyboardAvoidingView: ReactClass = js.native
15+
val TextInput: ReactClass = js.native
16+
val TouchableWithoutFeedback: ReactClass = js.native
17+
val TouchableHighlight: ReactClass = js.native
18+
val TouchableOpacity: ReactClass = js.native
19+
val Image: ReactClass = js.native
20+
val ScrollView: ReactClass = js.native
21+
val ListView: ReactClass = js.native
22+
val SwipeableListView: ReactClass = js.native
23+
val Navigator: ReactClass = js.native
24+
val Picker: ReactClass = js.native
25+
val Modal: ReactClass = js.native
26+
val Switch: ReactClass = js.native
27+
val Button: ReactClass = js.native
28+
val RefreshControl: ReactClass = js.native
29+
val WindowedListView: ReactClass = js.native
30+
val Slider: ReactClass = js.native
31+
val ActivityIndicator: ReactClass = js.native
32+
33+
34+
val NavigationExperimental: js.Dynamic = js.native
35+
36+
37+
// apis
38+
//
39+
val StyleSheet: StyleSheet = js.native
40+
val AsyncStorage: AsyncStorageJS = js.native
41+
val AppRegistry: AppRegistry = js.native
42+
val Keyboard: Keyboard = js.native
43+
// val CameraRoll: CameraRoll = js.native
44+
// val InteractionManager: InteractionManager = js.native
45+
// val LinkingIOS: LinkingIOS = js.native
46+
// val NetInfo: NetInfo = js.native
47+
// val LayoutAnimation: js.Dynamic = js.native
48+
val PixelRatio: PixelRatio = js.native
49+
val DeviceEventEmitter: DeviceEventEmitter = js.native
50+
val Animated: Animated = js.native
51+
// val PushNotificationIOS: PushNotificationIOS = js.native
52+
val PanResponder: PanResponder = js.native
53+
// val StatusBarIOS: js.Dynamic = js.native
54+
// val VibrationIOS: VibrationIOS = js.native
55+
// val Dimensions: js.Dynamic = js.native
56+
57+
//misc
58+
val Platform: ReactPlatForm = js.native
59+
60+
}
61+
62+
//@js.native
63+
//@JSImport("react-native", JSImport.Namespace)
64+
//object ReactUniversal extends ReactUniversal
65+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package sri.universal.apis
2+
3+
import scala.scalajs.js
4+
import scala.scalajs.js.Dynamic.{literal => json}
5+
import scala.scalajs.js.annotation.{JSImport, ScalaJSDefined}
6+
7+
@js.native
8+
trait Alert extends js.Object {
9+
def alert(title: String = ???, message: String = ???, buttons: js.Array[AlertButton] = ???, options: AlertOptions = ???, `type`: String = "default"): Unit = js.native
10+
}
11+
12+
@js.native
13+
@JSImport("react-native","Alert")
14+
object Alert extends Alert
15+
16+
@ScalaJSDefined
17+
trait AlertButton extends js.Object {
18+
var text: js.UndefOr[String] = js.undefined
19+
var onPress: js.UndefOr[js.Function] = js.undefined
20+
var style: js.UndefOr[String] = js.undefined
21+
}
22+
23+
@ScalaJSDefined
24+
trait AlertOptions extends js.Object {
25+
var cancelable: js.UndefOr[Boolean] = js.undefined
26+
}
27+
28+
object AlertTypes {
29+
val DEFAULT = "default"
30+
val PLAIN_TEXT = "plain-text"
31+
val SECURE_TEXT = "secure-text"
32+
val LOGIN_PASSWORD = "login-password"
33+
}
34+
35+
object AlertButtonStyles {
36+
37+
val DEFAULT = "default"
38+
39+
val CANCEL = "cancel"
40+
41+
val DESTRUCTIVE = "destructive"
42+
43+
}
44+

0 commit comments

Comments
 (0)