Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API: Upgrade to dombuilder 0.2, update README
- Loading branch information
Showing
36 changed files
with
271 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
The MIT License (MIT) | ||
# The MIT License (MIT) | ||
|
||
Copyright 2017 Nikita Gazarov | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.raquo.laminar | ||
|
||
import com.raquo.dombuilder.jsdom.domapi.{JsCommentApi, JsElementApi, JsEventApi, JsTextApi, JsTreeApi} | ||
import com.raquo.laminar.nodes.ReactiveNode | ||
|
||
trait DomApi { | ||
implicit val elementApi: JsElementApi[ReactiveNode] = DomApi.elementApi | ||
implicit val eventApi: JsEventApi[ReactiveNode] = DomApi.eventApi | ||
implicit val commentApi: JsCommentApi[ReactiveNode] = DomApi.commentApi | ||
implicit val textApi: JsTextApi[ReactiveNode] = DomApi.textApi | ||
implicit val treeApi: JsTreeApi[ReactiveNode] = DomApi.treeApi | ||
} | ||
|
||
object DomApi { | ||
val elementApi: JsElementApi[ReactiveNode] = new JsElementApi[ReactiveNode] {} | ||
val eventApi: JsEventApi[ReactiveNode] = new JsEventApi[ReactiveNode] {} | ||
val commentApi: JsCommentApi[ReactiveNode] = new JsCommentApi[ReactiveNode] {} | ||
val textApi: JsTextApi[ReactiveNode] = new JsTextApi[ReactiveNode] {} | ||
val treeApi: JsTreeApi[ReactiveNode] = new JsTreeApi[ReactiveNode] {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
src/main/scala/com/raquo/laminar/builders/ReactiveCommentBuilder.scala
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/scala/com/raquo/laminar/builders/ReactiveTextBuilder.scala
This file was deleted.
Oops, something went wrong.
3 changes: 2 additions & 1 deletion
3
src/main/scala/com/raquo/laminar/example/components/Counter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/scala/com/raquo/laminar/example/components/Table.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/main/scala/com/raquo/laminar/example/components/Toggle.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/main/scala/com/raquo/laminar/example/pseudotests/Children.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/main/scala/com/raquo/laminar/example/pseudotests/MultiSetters.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/scala/com/raquo/laminar/example/pseudotests/MultiStyleProp.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
src/main/scala/com/raquo/laminar/example/pseudotests/NestedStyleProp.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/main/scala/com/raquo/laminar/example/pseudotests/NodeTypeChange.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
src/main/scala/com/raquo/laminar/nodes/ReactiveChildNode.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 14 additions & 4 deletions
18
src/main/scala/com/raquo/laminar/nodes/ReactiveComment.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package com.raquo.laminar.nodes | ||
|
||
import com.raquo.dombuilder.jsdom | ||
import com.raquo.dombuilder.generic | ||
import com.raquo.dombuilder.jsdom.domapi.JsTreeApi | ||
import com.raquo.laminar.DomApi | ||
import org.scalajs.dom | ||
|
||
class ReactiveComment(override protected[this] var _text: String) | ||
extends ReactiveChildNode[dom.Comment] | ||
with jsdom.nodes.Comment | ||
class ReactiveComment(val text: String) | ||
extends ReactiveNode | ||
with ReactiveChildNode[dom.Comment] | ||
with generic.nodes.Comment[ReactiveNode, dom.Comment, dom.Node] { | ||
|
||
override val treeApi: JsTreeApi[ReactiveNode] = DomApi.treeApi | ||
|
||
override val ref: dom.Comment = DomApi.commentApi.createNode | ||
|
||
setText(text)(DomApi.commentApi) | ||
} | ||
|
22 changes: 15 additions & 7 deletions
22
src/main/scala/com/raquo/laminar/nodes/ReactiveElement.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
package com.raquo.laminar.nodes | ||
|
||
import com.raquo.dombuilder.jsdom | ||
import com.raquo.dombuilder.generic | ||
import com.raquo.dombuilder.jsdom.JsCallback | ||
import com.raquo.dombuilder.jsdom.domapi.JsTreeApi | ||
import com.raquo.laminar.DomApi | ||
import org.scalajs.dom | ||
|
||
class ReactiveElement[+Ref <: dom.Element]( | ||
override val tagName: String, | ||
override val void: Boolean = false | ||
) | ||
extends ReactiveChildNode[Ref] | ||
with jsdom.nodes.Element[Ref] | ||
with jsdom.nodes.ParentNode[ReactiveNode, Ref] | ||
with jsdom.nodes.EventfulNode[ReactiveNode, Ref] | ||
override val void: Boolean | ||
) extends ReactiveNode | ||
with ReactiveChildNode[Ref] | ||
with generic.nodes.Element[ReactiveNode, Ref, dom.Node] | ||
with generic.nodes.EventfulNode[ReactiveNode, Ref, dom.Element, dom.Node, dom.Event, JsCallback] | ||
with generic.nodes.ParentNode[ReactiveNode, Ref, dom.Node] { | ||
|
||
override val treeApi: JsTreeApi[ReactiveNode] = DomApi.treeApi | ||
|
||
override val ref: Ref = DomApi.elementApi.createNode(this) | ||
} |
Oops, something went wrong.