mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-02 15:00:08 +00:00
Compare commits
No commits in common. "36f4e7ec37f93b0620dc1cfa54fda355e0eac37d" and "43232afa621a7e1aaca68bc4e4bf9efac91c9534" have entirely different histories.
36f4e7ec37
...
43232afa62
@ -1,13 +1,5 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 0.10.6
|
|
||||||
|
|
||||||
* `Versions`
|
|
||||||
* `Ktor`: `2.0.1` -> `2.0.2`
|
|
||||||
* `Common`
|
|
||||||
* `JS`:
|
|
||||||
* Add `ResizeObserver` functionality
|
|
||||||
|
|
||||||
## 0.10.5
|
## 0.10.5
|
||||||
|
|
||||||
* `Versions`
|
* `Versions`
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
package dev.inmo.micro_utils.common
|
|
||||||
|
|
||||||
import org.w3c.dom.*
|
|
||||||
import kotlin.js.Json
|
|
||||||
import kotlin.js.json
|
|
||||||
|
|
||||||
external class ResizeObserver(
|
|
||||||
callback: (Array<ResizeObserverEntry>, ResizeObserver) -> Unit
|
|
||||||
) {
|
|
||||||
fun observe(target: Element, options: Json = definedExternally)
|
|
||||||
|
|
||||||
fun unobserve(target: Element)
|
|
||||||
|
|
||||||
fun disconnect()
|
|
||||||
}
|
|
||||||
|
|
||||||
external interface ResizeObserverSize {
|
|
||||||
val blockSize: Float
|
|
||||||
val inlineSize: Float
|
|
||||||
}
|
|
||||||
|
|
||||||
external interface ResizeObserverEntry {
|
|
||||||
val borderBoxSize: Array<ResizeObserverSize>
|
|
||||||
val contentBoxSize: Array<ResizeObserverSize>
|
|
||||||
val devicePixelContentBoxSize: Array<ResizeObserverSize>
|
|
||||||
val contentRect: DOMRectReadOnly
|
|
||||||
val target: Element
|
|
||||||
}
|
|
||||||
|
|
||||||
fun ResizeObserver.observe(target: Element, options: ResizeObserverObserveOptions) = observe(
|
|
||||||
target,
|
|
||||||
json(
|
|
||||||
"box" to options.box ?.name
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
class ResizeObserverObserveOptions(
|
|
||||||
val box: Box? = null
|
|
||||||
) {
|
|
||||||
sealed interface Box {
|
|
||||||
val name: String
|
|
||||||
|
|
||||||
object Content : Box {
|
|
||||||
override val name: String
|
|
||||||
get() = "content-box"
|
|
||||||
}
|
|
||||||
|
|
||||||
object Border : Box {
|
|
||||||
override val name: String
|
|
||||||
get() = "border-box"
|
|
||||||
}
|
|
||||||
|
|
||||||
object DevicePixelContent : Box {
|
|
||||||
override val name: String
|
|
||||||
get() = "device-pixel-content-box"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,5 +14,5 @@ crypto_js_version=4.1.1
|
|||||||
# Project data
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.10.6
|
version=0.10.5
|
||||||
android_code_version=121
|
android_code_version=120
|
||||||
|
@ -11,7 +11,7 @@ jb-dokka = "1.6.21"
|
|||||||
klock = "2.7.0"
|
klock = "2.7.0"
|
||||||
uuid = "0.4.0"
|
uuid = "0.4.0"
|
||||||
|
|
||||||
ktor = "2.0.2"
|
ktor = "2.0.1"
|
||||||
|
|
||||||
gh-release = "2.3.7"
|
gh-release = "2.3.7"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user