Skip to content

Commit 6930cd5

Browse files
authored
Merge branch 'scala-js:main' into add/#621
2 parents e5596c1 + c70fba0 commit 6930cd5

23 files changed

+522
-41
lines changed

.github/workflows/ghpages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
run: sbt readme/run
2020

2121
- name: Deploy
22-
uses: JamesIves/[email protected].0
22+
uses: JamesIves/[email protected].1
2323
with:
2424
token: ${{ secrets.GITHUB_TOKEN }}
2525
branch: gh-pages

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.5.9
1+
version = 3.6.1
22
runner.dialect = scala213source3
33
project.git = true
44
style = Scala.js

api-reports/2_12.txt

Lines changed: 187 additions & 8 deletions
Large diffs are not rendered by default.

api-reports/2_13.txt

Lines changed: 187 additions & 8 deletions
Large diffs are not rendered by default.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/**
6+
* Helps distinguish whether apps "pasting" a clipboard item should insert the contents of an appropriate representation inline at the point of paste or if it should be treated as an attachment.
7+
* See [[https://w3c.github.io/clipboard-apis/#enumdef-presentationstyle PresentationStyle enum]]
8+
*/
9+
@js.native
10+
sealed trait PresentationStyle extends js.Any
11+
12+
object PresentationStyle{
13+
val unspecified: PresentationStyle = "unspecified".asInstanceOf[PresentationStyle]
14+
val inline: PresentationStyle = "inline".asInstanceOf[PresentationStyle]
15+
val attachment: PresentationStyle = "attachment".asInstanceOf[PresentationStyle]
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/**
6+
* Helps distinguish whether apps "pasting" a clipboard item should insert the contents of an appropriate representation inline at the point of paste or if it should be treated as an attachment.
7+
* See [[https://w3c.github.io/clipboard-apis/#enumdef-presentationstyle PresentationStyle enum]]
8+
*/
9+
opaque type PresentationStyle <: String = String
10+
11+
object PresentationStyle {
12+
val unspecified: PresentationStyle = "unspecified"
13+
val inline: PresentationStyle = "inline"
14+
val attachment: PresentationStyle = "attachment"
15+
}

dom/src/main/scala/org/scalajs/dom/Body.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ trait Body extends js.Object {
2222
/** Takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object. */
2323
def formData(): js.Promise[FormData] = js.native
2424

25-
/** Takes a Response stream and reads it to completion. It returns a promise that resolves with a JSON object. //todo:
26-
* define the JSON type, and return a Promise[JSON] as per spec
27-
*/
25+
/** Takes a Response stream and reads it to completion. It returns a promise that resolves with a JSON object. */
2826
def json(): js.Promise[js.Any] = js.native
2927

3028
/** Takes a Response stream and reads it to completion. It returns a promise that resolves with a USVString (text). */

dom/src/main/scala/org/scalajs/dom/Clipboard.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ trait Clipboard extends EventTarget {
2525
*
2626
* To read from the clipboard, you must first have the "clipboard-read" permission.
2727
*/
28-
def read(): js.Promise[DataTransfer] = js.native
28+
def read(): js.Promise[js.Array[ClipboardItem]] = js.native
2929

3030
/** The readText() method returns a Promise which resolves with a copy of the textual contents of the system
3131
* clipboard.
@@ -38,7 +38,7 @@ trait Clipboard extends EventTarget {
3838
* Before you can write to the clipboard, you need to use the Permissions API to get the "clipboard-write"
3939
* permission.
4040
*/
41-
def write(data: DataTransfer): js.Promise[Unit] = js.native
41+
def write(data: js.Array[ClipboardItem]): js.Promise[Unit] = js.native
4242

4343
/** The writeText() method writes the specified text string to the system clipboard. */
4444
def writeText(newClipText: String): js.Promise[Unit] = js.native
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API
2+
* and available under the Creative Commons Attribution-ShareAlike v2.5 or later.
3+
* http://creativecommons.org/licenses/by-sa/2.5/
4+
*
5+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
6+
*/
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
import scala.scalajs.js.annotation._
11+
12+
/** A clipboard item is conceptually data that the user has expressed a desire to make shareable by invoking a "cut" or
13+
* "copy" command
14+
*/
15+
@js.native
16+
@JSGlobal
17+
class ClipboardItem(items: js.Dictionary[ClipboardItemData], options: ClipboardItemOptions = js.native)
18+
extends js.Object {
19+
def presentationStyle: PresentationStyle = js.native
20+
21+
/** Returns an Array of MIME types available within the ClipboardItem. */
22+
def types: FrozenArray[String] = js.native
23+
24+
/** Returns a Promise that resolves with a Blob of the requested MIME type, or an error if the MIME type is not found.
25+
*/
26+
def getType(`type`: String): js.Promise[Blob] = js.native
27+
28+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** All documentation for facades is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API
2+
* and available under the Creative Commons Attribution-ShareAlike v2.5 or later.
3+
* http://creativecommons.org/licenses/by-sa/2.5/
4+
*
5+
* Everything else is under the MIT License http://opensource.org/licenses/MIT
6+
*/
7+
package org.scalajs.dom
8+
9+
import scala.scalajs.js
10+
11+
trait ClipboardItemOptions extends js.Object {
12+
def presentationStyle: js.UndefOr[PresentationStyle] = js.undefined
13+
}

0 commit comments

Comments
 (0)