Skip to content

Commit

Permalink
Popover. Popover
Browse files Browse the repository at this point in the history
  • Loading branch information
turansky committed Dec 27, 2024
1 parent 864077d commit 95f6702
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/karakum/browser/Generator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ private val DEFAULT_IMPORTS = Imports(
"web.permissions.Permissions",
"web.pip.PictureInPictureEvent",
"web.pip.PictureInPictureWindow",
"web.popover.Popover",
"web.push.PushManager",
"web.ranges.AbstractRange",
"web.ranges.Range",
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/karakum/browser/Html.kt
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ internal fun htmlDeclarations(

return interfaces
.plus(formTypes())
.plus(popoverTypes())
.plus(customElementTypes())
.plus(
ConversionResult(
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/karakum/browser/Patches.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ internal fun String.applyPatches(): String {
.patchInterfaces("Request", "RequestInit", "XMLHttpRequest") {
it.replace(Regex("""([( ]method\??: )string([;,])"""), "$1$REQUEST_METHOD$2")
}
.patchInterface("HTMLElement") {
it.replace(" popover: string | null;", " popover: $POPOVER | null;")
}
.patchInterface("HTMLFormElement") {
it.replace(" method: string;", " method: $FORM_METHOD;")
.replace(" enctype: string;", " enctype: $FORM_ENCTYPE;")
Expand Down
17 changes: 17 additions & 0 deletions buildSrc/src/main/kotlin/karakum/browser/Popover.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package karakum.browser

import karakum.common.unionBody

internal const val POPOVER = "Popover"

internal fun popoverTypes(): Sequence<ConversionResult> =
sequenceOf(
ConversionResult(
POPOVER,
unionBody(
name = POPOVER,
values = listOf("auto", "manual"),
),
pkg = "web.popover",
),
)

0 comments on commit 95f6702

Please sign in to comment.