From 64ac3546fd2bf60e71ba1abfc34489dc3b7d4c48 Mon Sep 17 00:00:00 2001 From: kigawa Date: Sun, 17 Aug 2025 19:46:02 +0900 Subject: [PATCH 1/2] add: introduce various content category interfaces for enhanced type safety and update `NativeGenerator` to include unused categories like `EventTarget` --- generate/src/jvmMain/kotlin/tagCategories.kt | 2 +- .../net/kigawa/renlin/w3c/category/ContentCategory.kt | 6 +----- .../net/kigawa/renlin/w3c/category/native/FlowContent.kt | 4 ++-- .../src/commonMain/kotlin/net/kigawa/renlin/sample/Sub.kt | 2 ++ 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/generate/src/jvmMain/kotlin/tagCategories.kt b/generate/src/jvmMain/kotlin/tagCategories.kt index 9c972d3..a5ae984 100644 --- a/generate/src/jvmMain/kotlin/tagCategories.kt +++ b/generate/src/jvmMain/kotlin/tagCategories.kt @@ -5,7 +5,7 @@ import model.TagInfo // カテゴリーの親子関係を定義 val categoryParents = mapOf( "PhrasingContent" to "P", - "FlowContent" to "P, Div", + "FlowContent" to "P, Div, EventTarget", "FlowPhrasing" to "FlowContent, PhrasingContent", "HeadingContent" to "FlowContent", "SectioningContent" to "FlowContent", diff --git a/renlin/src/commonMain/kotlin/net/kigawa/renlin/w3c/category/ContentCategory.kt b/renlin/src/commonMain/kotlin/net/kigawa/renlin/w3c/category/ContentCategory.kt index 3037ce3..1083871 100644 --- a/renlin/src/commonMain/kotlin/net/kigawa/renlin/w3c/category/ContentCategory.kt +++ b/renlin/src/commonMain/kotlin/net/kigawa/renlin/w3c/category/ContentCategory.kt @@ -1,8 +1,5 @@ package net.kigawa.renlin.w3c.category -import net.kigawa.renlin.w3c.category.native.FlowContent -import net.kigawa.renlin.w3c.category.native.PhrasingContent - interface ContentCategory { // fun newContentDsl(): DSL // fun component( @@ -16,5 +13,4 @@ interface ContentCategory { // } } -interface AllContentCategory : ContentCategory, FlowContent, PhrasingContent -interface DslContentCategory> \ No newline at end of file +interface DslContentCategory> \ No newline at end of file diff --git a/renlin/src/commonMain/kotlin/net/kigawa/renlin/w3c/category/native/FlowContent.kt b/renlin/src/commonMain/kotlin/net/kigawa/renlin/w3c/category/native/FlowContent.kt index 6e61de8..a2f330a 100644 --- a/renlin/src/commonMain/kotlin/net/kigawa/renlin/w3c/category/native/FlowContent.kt +++ b/renlin/src/commonMain/kotlin/net/kigawa/renlin/w3c/category/native/FlowContent.kt @@ -117,6 +117,6 @@ import net.kigawa.renlin.w3c.category.native.TemplateCategory /** * FlowContent represents elements that are part of the flow content category. - * Parent: P, Div + * Parent: P, Div, EventTarget */ -interface FlowContent : ContentCategory, P, Div, HtmlCategory, HeadCategory, LinkCategory, MetaCategory, BodyCategory, AddressCategory, ArticleCategory, AsideCategory, FooterCategory, HeaderCategory, H1Category, H2Category, H3Category, H4Category, H5Category, H6Category, HgroupCategory, MainCategory, NavCategory, SectionCategory, SearchCategory, BlockquoteCategory, DdCategory, DivCategory, DlCategory, DtCategory, FigcaptionCategory, FigureCategory, HrCategory, LiCategory, MenuCategory, OlCategory, PCategory, PreCategory, UlCategory, ACategory, AbbrCategory, BCategory, BdiCategory, BdoCategory, BrCategory, CiteCategory, CodeCategory, DataCategory, DfnCategory, EmCategory, ICategory, KbdCategory, MarkCategory, QCategory, RpCategory, RtCategory, RubyCategory, SCategory, SampCategory, SmallCategory, SpanCategory, StrongCategory, SubCategory, SupCategory, TimeCategory, UCategory, VarCategory, WbrCategory, AreaCategory, AudioCategory, ImgCategory, MapCategory, TrackCategory, VideoCategory, EmbedCategory, FencedframeCategory, IframeCategory, ObjectCategory, PictureCategory, SourceCategory, SvgCategory, MathCategory, CanvasCategory, NoscriptCategory, ScriptCategory, DelCategory, InsCategory, CaptionCategory, ColCategory, ColgroupCategory, TableCategory, TbodyCategory, TdCategory, TfootCategory, ThCategory, TheadCategory, TrCategory, ButtonCategory, DatalistCategory, FieldsetCategory, FormCategory, InputCategory, LabelCategory, LegendCategory, MeterCategory, OptgroupCategory, OptionCategory, OutputCategory, ProgressCategory, SelectCategory, SelectedcontentCategory, TextareaCategory, DetailsCategory, DialogCategory, SummaryCategory, SlotCategory, TemplateCategory \ No newline at end of file +interface FlowContent : ContentCategory, P, Div, EventTarget, HtmlCategory, HeadCategory, LinkCategory, MetaCategory, BodyCategory, AddressCategory, ArticleCategory, AsideCategory, FooterCategory, HeaderCategory, H1Category, H2Category, H3Category, H4Category, H5Category, H6Category, HgroupCategory, MainCategory, NavCategory, SectionCategory, SearchCategory, BlockquoteCategory, DdCategory, DivCategory, DlCategory, DtCategory, FigcaptionCategory, FigureCategory, HrCategory, LiCategory, MenuCategory, OlCategory, PCategory, PreCategory, UlCategory, ACategory, AbbrCategory, BCategory, BdiCategory, BdoCategory, BrCategory, CiteCategory, CodeCategory, DataCategory, DfnCategory, EmCategory, ICategory, KbdCategory, MarkCategory, QCategory, RpCategory, RtCategory, RubyCategory, SCategory, SampCategory, SmallCategory, SpanCategory, StrongCategory, SubCategory, SupCategory, TimeCategory, UCategory, VarCategory, WbrCategory, AreaCategory, AudioCategory, ImgCategory, MapCategory, TrackCategory, VideoCategory, EmbedCategory, FencedframeCategory, IframeCategory, ObjectCategory, PictureCategory, SourceCategory, SvgCategory, MathCategory, CanvasCategory, NoscriptCategory, ScriptCategory, DelCategory, InsCategory, CaptionCategory, ColCategory, ColgroupCategory, TableCategory, TbodyCategory, TdCategory, TfootCategory, ThCategory, TheadCategory, TrCategory, ButtonCategory, DatalistCategory, FieldsetCategory, FormCategory, InputCategory, LabelCategory, LegendCategory, MeterCategory, OptgroupCategory, OptionCategory, OutputCategory, ProgressCategory, SelectCategory, SelectedcontentCategory, TextareaCategory, DetailsCategory, DialogCategory, SummaryCategory, SlotCategory, TemplateCategory \ No newline at end of file diff --git a/sample/src/commonMain/kotlin/net/kigawa/renlin/sample/Sub.kt b/sample/src/commonMain/kotlin/net/kigawa/renlin/sample/Sub.kt index 2b8cdd9..f174a9e 100644 --- a/sample/src/commonMain/kotlin/net/kigawa/renlin/sample/Sub.kt +++ b/sample/src/commonMain/kotlin/net/kigawa/renlin/sample/Sub.kt @@ -14,6 +14,7 @@ import net.kigawa.renlin.w3c.category.integration.FlowPhrasingIntegration import net.kigawa.renlin.w3c.category.native.FlowContent import net.kigawa.renlin.w3c.category.native.PhrasingContent import net.kigawa.renlin.w3c.category.t +import net.kigawa.renlin.w3c.event.tag.onClick class Sub { @@ -38,6 +39,7 @@ class Sub { alignItems = AlignItems.CENTER justifyContent = JustifyContent.CENTER } + onClick { } } div("content-section") { From fb84d605f01405dca746372965c60b816862bac8 Mon Sep 17 00:00:00 2001 From: kigawa Date: Sun, 17 Aug 2025 19:47:23 +0900 Subject: [PATCH 2/2] add: introduce various content category interfaces for enhanced type safety and update `NativeGenerator` to include unused categories like `EventTarget` --- .github/workflows/deploy_maven_central.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/deploy_maven_central.yml b/.github/workflows/deploy_maven_central.yml index c8f3501..d72658b 100644 --- a/.github/workflows/deploy_maven_central.yml +++ b/.github/workflows/deploy_maven_central.yml @@ -60,4 +60,21 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + + - name: Auto-merge PR on successful deployment + if: success() + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GIT_TOKEN }} + script: | + const pr = context.payload.pull_request; + if (pr) { + await github.rest.pulls.merge({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: pr.number, + merge_method: 'merge' + }); + console.log(`PR #${pr.number} has been automatically merged after successful deployment`); + } #####