├── .editorconfig ├── .github ├── release.yml └── workflows │ ├── coverage.yml │ ├── release.yml │ ├── require-label.yml │ └── validation.yml ├── .gitignore ├── .idea └── icon.svg ├── LICENSE ├── README.md ├── assets ├── cli_valkyrie.png ├── cli_valkyrie_iconpack.png ├── cli_valkyrie_svgxml2imagevector.png ├── iconpack_mode_existing_1.png ├── iconpack_mode_existing_2.png ├── iconpack_mode_new_1.png ├── iconpack_mode_new_2.png ├── imagevector_previewer.png ├── installation_button.svg ├── simple_mode_1.png ├── simple_mode_2.png └── simple_mode_3.png ├── build-logic ├── convention │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ ├── ComposePlugin.kt │ │ ├── KmpPlugin.kt │ │ ├── WasmResourcesPlugin.kt │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ ├── extension │ │ └── KotlinMultiplatformExtension.kt │ │ └── internal │ │ ├── Plugins.kt │ │ └── Project.kt └── settings.gradle.kts ├── build.gradle.kts ├── components ├── extensions │ ├── api │ │ ├── extensions.api │ │ └── extensions.klib.api │ ├── build.gradle.kts │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── extensions │ │ │ └── Any.kt │ │ └── jvmMain │ │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── extensions │ │ └── PathUtils.kt ├── generator │ ├── core │ │ ├── api │ │ │ ├── core.api │ │ │ └── core.klib.api │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── generator │ │ │ │ └── core │ │ │ │ ├── FloatFormatter.kt │ │ │ │ ├── IconPack.kt │ │ │ │ └── IconPackDsl.kt │ │ │ └── commonTest │ │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── generator │ │ │ └── core │ │ │ ├── FloatFormatterTest.kt │ │ │ ├── IconPackDslTest.kt │ │ │ └── IconPackTest.kt │ ├── iconpack │ │ ├── api │ │ │ ├── iconpack.api │ │ │ └── iconpack.klib.api │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── generator │ │ │ │ └── iconpack │ │ │ │ ├── IconPackGenerator.kt │ │ │ │ ├── IconPackGeneratorConfig.kt │ │ │ │ └── IconPackSpecOutput.kt │ │ │ ├── commonTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── generator │ │ │ │ └── iconpack │ │ │ │ ├── IconPackGeneratorTest.kt │ │ │ │ └── IconPackWithIndentTest.kt │ │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── generator │ │ │ │ └── iconpack │ │ │ │ ├── IconPackFileSpec.kt │ │ │ │ └── IconPackGenerator.jvm.kt │ │ │ └── wasmJsMain │ │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── generator │ │ │ └── iconpack │ │ │ └── IconPackGenerator.wasmJs.kt │ └── jvm │ │ ├── imagevector │ │ ├── api │ │ │ └── imagevector.api │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── main │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── generator │ │ │ │ └── jvm │ │ │ │ └── imagevector │ │ │ │ ├── ImageVectorFileSpec.kt │ │ │ │ ├── ImageVectorGenerator.kt │ │ │ │ ├── spec │ │ │ │ ├── BackingPropertySpec.kt │ │ │ │ ├── Common.kt │ │ │ │ ├── LazyPropertySpec.kt │ │ │ │ └── PathNodeSpec.kt │ │ │ │ └── util │ │ │ │ ├── BackingPropertySpec.kt │ │ │ │ ├── GroupBuilder.kt │ │ │ │ ├── ImageVectorBuilderSpec.kt │ │ │ │ ├── Names.kt │ │ │ │ ├── PathBuilder.kt │ │ │ │ └── PreviewSpec.kt │ │ │ └── test │ │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── generator │ │ │ └── jvm │ │ │ └── imagevector │ │ │ ├── BrokenSvgParsingTest.kt │ │ │ ├── CustomPackageTest.kt │ │ │ ├── ExplicitModeTest.kt │ │ │ ├── ImageVectorGeneratorPropertiesTest.kt │ │ │ ├── ImageVectorWithIndentTest.kt │ │ │ ├── ImageVectorWithPreviewTest.kt │ │ │ ├── SvgWithGradientToImageVectorTest.kt │ │ │ ├── TrailingCommaTest.kt │ │ │ ├── XmlToImageVectorTest.kt │ │ │ └── common │ │ │ ├── OutputFormatResource.kt │ │ │ └── TestImageVectorConfig.kt │ │ └── poet-extensions │ │ ├── api │ │ └── poet-extensions.api │ │ ├── build.gradle.kts │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── generator │ │ └── jvm │ │ └── ext │ │ ├── CodeBlock.kt │ │ ├── Spec.kt │ │ └── TypeName.kt ├── ir-compose │ ├── api │ │ ├── ir-compose.api │ │ └── ir-compose.klib.api │ ├── build.gradle.kts │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── ir │ │ └── compose │ │ └── IrToImageVector.kt ├── ir │ ├── api │ │ ├── ir.api │ │ └── ir.klib.api │ ├── build.gradle.kts │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── ir │ │ │ ├── IrColor.kt │ │ │ ├── IrFill.kt │ │ │ ├── IrImageVector.kt │ │ │ ├── IrPathFillType.kt │ │ │ ├── IrPathNode.kt │ │ │ ├── IrStroke.kt │ │ │ ├── IrStrokeLineCap.kt │ │ │ ├── IrStrokeLineJoin.kt │ │ │ ├── IrVectorNode.kt │ │ │ └── util │ │ │ ├── ColorClassification.kt │ │ │ └── IrImageVectorColor.kt │ │ └── commonTest │ │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── ir │ │ ├── HexParserTest.kt │ │ └── util │ │ ├── ColorClassificationTest.kt │ │ └── IrImageVectorColorTest.kt ├── parser │ ├── common │ │ ├── api │ │ │ ├── common.api │ │ │ └── common.klib.api │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── parser │ │ │ └── common │ │ │ ├── PathNode.kt │ │ │ └── PathParser.kt │ ├── jvm │ │ ├── svg │ │ │ ├── api │ │ │ │ └── svg.api │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── parser │ │ │ │ └── jvm │ │ │ │ └── svg │ │ │ │ └── SvgToXmlParser.kt │ │ └── xml │ │ │ ├── api │ │ │ └── xml.api │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── parser │ │ │ └── jvm │ │ │ └── xml │ │ │ ├── XmlToImageVectorParser.kt │ │ │ └── ext │ │ │ ├── Ir.kt │ │ │ └── XmlPullParser.kt │ ├── kmp │ │ ├── svg │ │ │ ├── api │ │ │ │ ├── svg.api │ │ │ │ └── svg.klib.api │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ │ ├── commonMain │ │ │ │ └── kotlin │ │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── composegears │ │ │ │ │ └── valkyrie │ │ │ │ │ └── parser │ │ │ │ │ └── kmp │ │ │ │ │ └── svg │ │ │ │ │ ├── KeywordColorParser.kt │ │ │ │ │ ├── SVG.kt │ │ │ │ │ ├── SVGDeserializer.kt │ │ │ │ │ ├── SVGParser.kt │ │ │ │ │ ├── SVGStroke.kt │ │ │ │ │ ├── Scale.kt │ │ │ │ │ ├── SvgColorParser.kt │ │ │ │ │ ├── SvgExtensions.kt │ │ │ │ │ └── Translation.kt │ │ │ │ └── commonTest │ │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── parser │ │ │ │ └── kmp │ │ │ │ └── svg │ │ │ │ ├── KeywordColorParserTest.kt │ │ │ │ ├── SVGDeserializerTest.kt │ │ │ │ ├── SVGParserTest.kt │ │ │ │ └── Utils.kt │ │ └── xml │ │ │ ├── api │ │ │ ├── xml.api │ │ │ └── xml.klib.api │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── parser │ │ │ │ └── kmp │ │ │ │ └── xml │ │ │ │ ├── AndroidColorParser.kt │ │ │ │ ├── VectorDrawable.kt │ │ │ │ ├── XmlDeserializer.kt │ │ │ │ └── XmlToImageVectorParser.kt │ │ │ └── commonTest │ │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── parser │ │ │ └── kmp │ │ │ └── xml │ │ │ ├── AndroidColorParserTest.kt │ │ │ ├── XmlDeserializerTest.kt │ │ │ └── XmlToImageVectorParserTest.kt │ └── unified │ │ ├── api │ │ ├── unified.api │ │ └── unified.klib.api │ │ ├── build.gradle.kts │ │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── parser │ │ │ └── unified │ │ │ ├── ParserType.kt │ │ │ ├── SvgXmlParser.kt │ │ │ ├── ext │ │ │ ├── Path.kt │ │ │ ├── RawSource.kt │ │ │ └── String.kt │ │ │ ├── model │ │ │ ├── IconParserOutput.kt │ │ │ └── IconType.kt │ │ │ └── util │ │ │ ├── IconNameFormatter.kt │ │ │ └── PackageExtractor.kt │ │ ├── commonTest │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── parser │ │ │ └── unified │ │ │ └── util │ │ │ ├── IconNameFormatterTest.kt │ │ │ └── PackageExtractorTest.kt │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── parser │ │ │ └── unified │ │ │ ├── SvgXmlParser.jvm.kt │ │ │ └── ext │ │ │ └── Path.jvm.kt │ │ ├── jvmTest │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── parser │ │ │ └── unified │ │ │ ├── SvgXmlParserTest.kt │ │ │ └── XmlToImageVectorTest.kt │ │ └── wasmJsMain │ │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── parser │ │ └── unified │ │ └── SvgXmlParser.wasmJs.kt ├── psi │ ├── iconpack │ │ ├── api │ │ │ └── iconpack.api │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── main │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── psi │ │ │ │ └── iconpack │ │ │ │ └── IconPackPsiParser.kt │ │ │ └── test │ │ │ ├── kotlin │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── composegears │ │ │ │ └── valkyrie │ │ │ │ └── psi │ │ │ │ └── iconpack │ │ │ │ └── IconPackPsiParserTest.kt │ │ │ └── resources │ │ │ ├── DataObjectIconPack.kt │ │ │ ├── NestedIconPack.kt │ │ │ └── SimpleIconPack.kt │ └── imagevector │ │ ├── api │ │ └── imagevector.api │ │ ├── build.gradle.kts │ │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── psi │ │ │ ├── extension │ │ │ └── PsiElement.kt │ │ │ └── imagevector │ │ │ ├── ImageVectorPsiParser.kt │ │ │ ├── common │ │ │ ├── FillParser.kt │ │ │ ├── KtCallExpression.kt │ │ │ └── PathNodeParser.kt │ │ │ └── parser │ │ │ ├── MaterialImageVectorPsiParser.kt │ │ │ └── RegularImageVectorPsiParser.kt │ │ └── test │ │ ├── kotlin │ │ ├── androidx │ │ │ └── compose │ │ │ │ └── material │ │ │ │ └── icons │ │ │ │ └── Icons.kt │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── psi │ │ │ └── imagevector │ │ │ ├── KtCallExpressionTests.kt │ │ │ ├── KtFileToImageVectorParserTest.kt │ │ │ ├── common │ │ │ ├── KtFile.kt │ │ │ └── ParseType.kt │ │ │ └── expected │ │ │ ├── AllGroupParams.kt │ │ │ ├── AllPathParams.kt │ │ │ ├── ClipPathGradient.kt │ │ │ ├── ComposeColor.kt │ │ │ ├── EmptyImageVector.kt │ │ │ ├── EmptyPaths.kt │ │ │ ├── IconWithGroup.kt │ │ │ ├── LinearGradient.kt │ │ │ ├── MaterialIcon.kt │ │ │ ├── RadialGradient.kt │ │ │ └── SinglePath.kt │ │ └── resources │ │ ├── backing │ │ ├── AllPathParams.kt │ │ ├── EmptyImageVector.kt │ │ ├── EmptyPaths.kt │ │ ├── IconWithGroup.kt │ │ ├── MaterialIcon.kt │ │ └── SinglePath.kt │ │ └── lazy │ │ ├── AllPathParams.kt │ │ ├── EmptyImageVector.kt │ │ ├── EmptyPaths.kt │ │ ├── IconWithGroup.kt │ │ └── SinglePath.kt └── test │ ├── coverage │ └── build.gradle.kts │ ├── resource-loader │ ├── api │ │ ├── resource-loader.api │ │ └── resource-loader.klib.api │ ├── build.gradle.kts │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── resource │ │ │ └── loader │ │ │ └── ResourceLoader.kt │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── io │ │ │ └── github │ │ │ └── composegears │ │ │ └── valkyrie │ │ │ └── resource │ │ │ └── loader │ │ │ └── ResourceLoader.jvm.kt │ │ └── wasmJsMain │ │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── resource │ │ └── loader │ │ └── ResourceLoader.wasmJs.kt │ └── sharedTestResources │ ├── iconpack │ ├── IconPack.explicit.kt │ ├── IconPack.kt │ ├── IconPack.nested.L2.kt │ ├── IconPack.nested.L3.kt │ ├── IconPack.nested.L4.kt │ ├── IconPack.nested.explicit.kt │ ├── IconPack.nested.indent1.kt │ ├── IconPack.nested.indent2.kt │ ├── IconPack.nested.indent3.kt │ └── IconPack.nested.indent6.kt │ └── imagevector │ ├── broken.svg │ ├── kt │ ├── backing │ │ ├── AllGroupParams.kt │ │ ├── AllGroupParams.trailing.kt │ │ ├── AllPathParams.kt │ │ ├── ClipPathGradient.kt │ │ ├── ComposeColor.kt │ │ ├── ComposeColor.linear.gradient.kt │ │ ├── ComposeColor.radial.gradient.kt │ │ ├── FillColorStroke.kt │ │ ├── FillColorStroke.trailing.kt │ │ ├── FlatPackage.kt │ │ ├── FlatPackage.pack.kt │ │ ├── FlatPackage.pack.nested.kt │ │ ├── IconWithNamedArgs.kt │ │ ├── IconWithShorthandColor.kt │ │ ├── LinearGradient.kt │ │ ├── LinearGradientWithStroke.kt │ │ ├── LinearRadialGradientWithOffset.kt │ │ ├── OnlyPath.kt │ │ ├── RadialGradient.kt │ │ ├── SeveralPath.kt │ │ ├── TransparentFillColor.kt │ │ ├── WithoutPath.explicit.kt │ │ ├── WithoutPath.indent1.kt │ │ ├── WithoutPath.indent2.kt │ │ ├── WithoutPath.indent3.kt │ │ ├── WithoutPath.indent6.kt │ │ ├── WithoutPath.kt │ │ ├── WithoutPath.pack.kt │ │ ├── WithoutPath.pack.nested.kt │ │ ├── WithoutPath.pack.nested.preview.androidx.kt │ │ ├── WithoutPath.pack.nested.preview.jetbrains.kt │ │ ├── WithoutPath.pack.package.kt │ │ ├── WithoutPath.pack.preview.androidx.kt │ │ ├── WithoutPath.pack.preview.jetbrains.kt │ │ ├── WithoutPath.preview.androidx.kt │ │ └── WithoutPath.preview.jetbrains.kt │ └── lazy │ │ ├── AllGroupParams.kt │ │ ├── AllGroupParams.trailing.kt │ │ ├── AllPathParams.kt │ │ ├── ClipPathGradient.kt │ │ ├── ComposeColor.kt │ │ ├── ComposeColor.linear.gradient.kt │ │ ├── ComposeColor.radial.gradient.kt │ │ ├── FillColorStroke.kt │ │ ├── FillColorStroke.trailing.kt │ │ ├── FlatPackage.kt │ │ ├── FlatPackage.pack.kt │ │ ├── FlatPackage.pack.nested.kt │ │ ├── IconWithNamedArgs.kt │ │ ├── IconWithShorthandColor.kt │ │ ├── LinearGradient.kt │ │ ├── LinearGradientWithStroke.kt │ │ ├── LinearRadialGradientWithOffset.kt │ │ ├── OnlyPath.kt │ │ ├── RadialGradient.kt │ │ ├── SeveralPath.kt │ │ ├── TransparentFillColor.kt │ │ ├── WithoutPath.explicit.kt │ │ ├── WithoutPath.indent1.kt │ │ ├── WithoutPath.indent2.kt │ │ ├── WithoutPath.indent3.kt │ │ ├── WithoutPath.indent6.kt │ │ ├── WithoutPath.kt │ │ ├── WithoutPath.pack.kt │ │ ├── WithoutPath.pack.nested.kt │ │ ├── WithoutPath.pack.nested.preview.androidx.kt │ │ ├── WithoutPath.pack.nested.preview.jetbrains.kt │ │ ├── WithoutPath.pack.package.kt │ │ ├── WithoutPath.pack.preview.androidx.kt │ │ ├── WithoutPath.pack.preview.jetbrains.kt │ │ ├── WithoutPath.preview.androidx.kt │ │ └── WithoutPath.preview.jetbrains.kt │ ├── svg │ ├── ic_clip_path_gradient.svg │ ├── ic_linear_gradient.svg │ ├── ic_linear_gradient_with_stroke.svg │ └── ic_radial_gradient.svg │ └── xml │ ├── ic_all_group_params.xml │ ├── ic_all_path_params.xml │ ├── ic_compose_color.xml │ ├── ic_compose_color_linear_gradient.xml │ ├── ic_compose_color_radial_gradient.xml │ ├── ic_fill_color_stroke.xml │ ├── ic_flat_package.xml │ ├── ic_linear_radial_gradient_with_offset.xml │ ├── ic_only_path.xml │ ├── ic_several_path.xml │ ├── ic_transparent_fill_color.xml │ ├── ic_without_path.xml │ ├── icon_with_named_args.xml │ └── icon_with_shorthand_color.xml ├── compose ├── core │ ├── api │ │ ├── core.api │ │ └── core.klib.api │ ├── build.gradle.kts │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── compose │ │ └── core │ │ ├── RememberMutableState.kt │ │ ├── animation │ │ └── ExpandedAnimatedContent.kt │ │ └── layout │ │ ├── Row.kt │ │ └── Spacer.kt ├── icons │ ├── api │ │ ├── icons.api │ │ └── icons.klib.api │ ├── build.gradle.kts │ └── src │ │ └── commonMain │ │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── compose │ │ └── icons │ │ ├── ValkyrieIcons.kt │ │ ├── colored │ │ └── PluginIcon.kt │ │ ├── filled │ │ └── Help.kt │ │ ├── idea │ │ ├── Notifications.kt │ │ └── Settings.kt │ │ └── outlined │ │ ├── Back.kt │ │ ├── Conversion.kt │ │ ├── Dark.kt │ │ ├── Light.kt │ │ └── Settings.kt └── ui │ ├── api │ ├── ui.api │ └── ui.klib.api │ ├── build.gradle.kts │ └── src │ └── commonMain │ └── kotlin │ └── io │ └── github │ └── composegears │ └── valkyrie │ └── compose │ └── ui │ ├── InfoCard.kt │ └── util │ └── Color.kt ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── renovate.json5 ├── settings.gradle.kts ├── shared ├── api │ ├── shared.api │ └── shared.klib.api ├── build.gradle.kts └── src │ └── commonMain │ └── kotlin │ └── io │ └── github │ └── composegears │ └── valkyrie │ └── shared │ └── Mode.kt ├── stability_config.conf └── tools ├── cli ├── build.gradle.kts ├── proguard-rules.pro └── src │ ├── main │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── cli │ │ ├── Main.kt │ │ ├── command │ │ ├── IconPackCommand.kt │ │ └── SvgXmlToImageVectorCommand.kt │ │ └── ext │ │ ├── Option.kt │ │ └── Outputs.kt │ └── test │ └── kotlin │ └── io │ └── github │ └── composegears │ └── valkyrie │ └── cli │ ├── IconPackCliTest.kt │ ├── SvgXmlToImageVectorCliTest.kt │ ├── command │ ├── IconPackCommandTest.kt │ └── SvgXmlToImageVectorCommandTest.kt │ └── common │ ├── CliTestType.kt │ ├── CommandLineTestRunner.kt │ └── OutputFormatResource.kt ├── compose-app ├── build.gradle.kts └── src │ ├── commonMain │ ├── composeResources │ │ └── values │ │ │ └── strings.xml │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ ├── ValkyrieApp.kt │ │ ├── screen │ │ ├── intro │ │ │ └── IntroScreen.kt │ │ └── mode │ │ │ └── simple │ │ │ └── SimpleConversionScreen.kt │ │ └── ui │ │ └── theme │ │ ├── LocalThemeConfig.kt │ │ └── ValkyrieTheme.kt │ ├── desktopMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── main.kt │ └── wasmJsMain │ ├── kotlin │ └── io │ │ └── github │ │ └── composegears │ │ └── valkyrie │ │ └── main.kt │ └── resources │ ├── images │ ├── logo_114.png │ ├── logo_256.png │ └── logo_512.png │ ├── index.html │ ├── manifest.json │ └── styles.css └── idea-plugin ├── build.gradle.kts └── src └── main ├── kotlin └── io │ └── github │ └── composegears │ └── valkyrie │ ├── ValkyrieToolWindow.kt │ ├── action │ ├── ActionUtil.kt │ ├── ExportHereAction.kt │ ├── ImportFromDirectoryOrFileAction.kt │ ├── RefreshPluginAction.kt │ └── dialog │ │ └── RequiredIconPackModeDialog.kt │ ├── editor │ ├── ImageVectorPreviewEditorProvider.kt │ ├── TextEditorWithImageVectorPreview.kt │ ├── VirtualFile.kt │ └── ui │ │ └── VirtualFileImageVector.kt │ ├── service │ ├── GlobalEventsHandler.kt │ └── PersistentSettings.kt │ ├── settings │ └── InMemorySettings.kt │ ├── ui │ ├── ValkyriePlugin.kt │ ├── common │ │ └── picker │ │ │ ├── PickerEvent.kt │ │ │ └── UniversalPicker.kt │ ├── di │ │ ├── CoreModule.kt │ │ ├── DI.kt │ │ └── IntellijPlatformModule.kt │ ├── domain │ │ ├── ParamUseCase.kt │ │ ├── model │ │ │ └── PreviewType.kt │ │ └── validation │ │ │ ├── IconPackValidationUseCase.kt │ │ │ ├── PackageValidationUseCase.kt │ │ │ └── ValidationUseCase.kt │ ├── extension │ │ ├── MutableStateFlow.kt │ │ └── String.kt │ ├── foundation │ │ ├── DragAndDropBox.kt │ │ ├── FocusableTextField.kt │ │ ├── HorizontalDivider.kt │ │ ├── IconButton.kt │ │ ├── InfoItem.kt │ │ ├── InputField.kt │ │ ├── Modifier.kt │ │ ├── PixelGrid.kt │ │ ├── ScrollableTabRow.kt │ │ ├── Scrollbar.kt │ │ ├── SegmentedButton.kt │ │ ├── Snackbar.kt │ │ ├── TextWithIcon.kt │ │ ├── TooltipButton.kt │ │ ├── TopAppBar.kt │ │ ├── components │ │ │ └── previewer │ │ │ │ ├── ImageVectorPreviewPanel.kt │ │ │ │ ├── PreviewParsingError.kt │ │ │ │ ├── TopActions.kt │ │ │ │ └── ZoomState.kt │ │ ├── compositionlocal │ │ │ └── LocalProject.kt │ │ ├── highlights │ │ │ ├── CodeViewerTooltip.kt │ │ │ ├── KotlinCodeViewer.kt │ │ │ └── core │ │ │ │ ├── CodeEditor.kt │ │ │ │ ├── CodeViewer.kt │ │ │ │ └── Common.kt │ │ ├── icons │ │ │ ├── ActualZoom.kt │ │ │ ├── AddFile.kt │ │ │ ├── ArrowDropDown.kt │ │ │ ├── Back.kt │ │ │ ├── Backspace.kt │ │ │ ├── BatchProcessing.kt │ │ │ ├── BlackCircle.kt │ │ │ ├── Checked.kt │ │ │ ├── Chessboard.kt │ │ │ ├── Close.kt │ │ │ ├── Copy.kt │ │ │ ├── Delete.kt │ │ │ ├── Edit.kt │ │ │ ├── Error.kt │ │ │ ├── ExternalLink.kt │ │ │ ├── FitContent.kt │ │ │ ├── Folder.kt │ │ │ ├── KotlinLogo.kt │ │ │ ├── MoreVert.kt │ │ │ ├── PlayForward.kt │ │ │ ├── Visibility.kt │ │ │ ├── Warning.kt │ │ │ ├── Watch.kt │ │ │ ├── WhiteCircle.kt │ │ │ ├── ZoomIn.kt │ │ │ └── ZoomOut.kt │ │ ├── previewbg │ │ │ ├── BgType.kt │ │ │ └── PreviewBackground.kt │ │ └── theme │ │ │ ├── CompositionLocal.kt │ │ │ ├── IntelliJTheme.kt │ │ │ └── Theme.kt │ ├── platform │ │ ├── Browser.kt │ │ ├── CopyPasteManager.kt │ │ ├── CurrentProject.kt │ │ ├── DragAndDropHandler.kt │ │ ├── JComponent.kt │ │ ├── Os.kt │ │ └── picker │ │ │ ├── DirectoryPicker.kt │ │ │ ├── FilePicker.kt │ │ │ ├── MultipleFilesPicker.kt │ │ │ └── Picker.kt │ └── screen │ │ ├── intro │ │ ├── IntroScreen.kt │ │ └── util │ │ │ └── PluginVersion.kt │ │ ├── mode │ │ ├── iconpack │ │ │ ├── conversion │ │ │ │ ├── IconPackConversionScreen.kt │ │ │ │ ├── IconPackConversionState.kt │ │ │ │ ├── IconPackConversionViewModel.kt │ │ │ │ └── ui │ │ │ │ │ ├── ClipboardEventColumn.kt │ │ │ │ │ ├── DragAndDropOverlay.kt │ │ │ │ │ ├── batch │ │ │ │ │ ├── BatchProcessingStateUi.kt │ │ │ │ │ ├── model │ │ │ │ │ │ └── BatchAction.kt │ │ │ │ │ └── ui │ │ │ │ │ │ ├── ExportIssues.kt │ │ │ │ │ │ ├── FileTypeBadge.kt │ │ │ │ │ │ └── IconPreviewBox.kt │ │ │ │ │ ├── picker │ │ │ │ │ └── IconPackPickerStateUi.kt │ │ │ │ │ └── util │ │ │ │ │ └── IconValidation.kt │ │ │ ├── creation │ │ │ │ ├── IconPackCreationScreen.kt │ │ │ │ └── common │ │ │ │ │ ├── inputhandler │ │ │ │ │ └── InputHandler.kt │ │ │ │ │ ├── packedit │ │ │ │ │ ├── model │ │ │ │ │ │ ├── InputChange.kt │ │ │ │ │ │ └── PackEditState.kt │ │ │ │ │ └── ui │ │ │ │ │ │ └── PackEditUi.kt │ │ │ │ │ └── util │ │ │ │ │ ├── IconPackTooltipContent.kt │ │ │ │ │ └── IconPackWriter.kt │ │ │ ├── existingpack │ │ │ │ ├── ExistingPackScreen.kt │ │ │ │ └── ui │ │ │ │ │ ├── foundation │ │ │ │ │ ├── ChooseExistingPackFile.kt │ │ │ │ │ └── ExistingPackEditor.kt │ │ │ │ │ ├── model │ │ │ │ │ ├── ExistingPackAction.kt │ │ │ │ │ ├── ExistingPackEvent.kt │ │ │ │ │ └── ExistingPackModeState.kt │ │ │ │ │ └── viewmodel │ │ │ │ │ ├── ExistingPackInputHandler.kt │ │ │ │ │ └── ExistingPackViewModel.kt │ │ │ └── newpack │ │ │ │ ├── NewPackScreen.kt │ │ │ │ └── ui │ │ │ │ ├── foundation │ │ │ │ ├── ChoosePackDirectory.kt │ │ │ │ └── NewPackCreation.kt │ │ │ │ ├── model │ │ │ │ ├── NewPackAction.kt │ │ │ │ ├── NewPackEvent.kt │ │ │ │ └── NewPackModeState.kt │ │ │ │ └── viewmodel │ │ │ │ ├── NewPackInputHandler.kt │ │ │ │ └── NewPackViewModel.kt │ │ └── simple │ │ │ ├── conversion │ │ │ ├── SimpleConversionScreen.kt │ │ │ ├── ui │ │ │ │ ├── SimpleConversionPickerStateUI.kt │ │ │ │ └── preview │ │ │ │ │ ├── SimpleConversionPreviewUi.kt │ │ │ │ │ └── action │ │ │ │ │ ├── ExpandedActions.kt │ │ │ │ │ └── ui │ │ │ │ │ ├── EditAction.kt │ │ │ │ │ └── PreviewAction.kt │ │ │ └── viewmodel │ │ │ │ ├── SimpleConversionAction.kt │ │ │ │ ├── SimpleConversionState.kt │ │ │ │ └── SimpleConversionViewModel.kt │ │ │ └── setup │ │ │ ├── SimpleModeSetupScreen.kt │ │ │ ├── SimpleModeSetupViewModel.kt │ │ │ └── util │ │ │ └── PackageTooltipContent.kt │ │ ├── preview │ │ └── CodePreviewScreen.kt │ │ └── settings │ │ ├── SettingsScreen.kt │ │ ├── SettingsViewModel.kt │ │ ├── model │ │ └── SettingsAction.kt │ │ └── tabs │ │ ├── AboutSettingsScreen.kt │ │ ├── GeneralSettingsScreen.kt │ │ ├── export │ │ ├── ImageVectorExportSettingsScreen.kt │ │ ├── IndentSizeSection.kt │ │ ├── OutputFormatSection.kt │ │ ├── PreviewAnnotationSection.kt │ │ └── ui │ │ │ ├── SelectableCard.kt │ │ │ └── SwitchOption.kt │ │ └── preview │ │ ├── ImageVectorPreviewSettingsScreen.kt │ │ └── PreviewBgSection.kt │ └── util │ ├── Stub.kt │ ├── TiamatSavedState.kt │ ├── ValkyrieStrings.kt │ └── extension │ ├── Uuid.kt │ └── VirtualFile.kt └── resources ├── META-INF ├── plugin.xml └── pluginIcon.svg ├── icons ├── ic_logo_tool_window.svg └── ic_logo_tool_window_dark.svg └── messages └── Valkyrie.properties /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_size = 2 6 | indent_style = space 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [*.{kt,kts}] 11 | indent_size = 4 12 | ij_kotlin_imports_layout = * 13 | ij_kotlin_allow_trailing_comma = true 14 | ij_kotlin_allow_trailing_comma_on_call_site = true 15 | ij_kotlin_line_break_after_multiline_when_entry = false 16 | ij_kotlin_name_count_to_use_star_import = 2147483647 17 | ij_kotlin_name_count_to_use_star_import_for_members = 2147483647 18 | ij_kotlin_packages_to_use_import_on_demand = unset 19 | ktlint_code_style = intellij_idea 20 | ktlint_function_naming_ignore_when_annotated_with = Composable 21 | ktlint_standard_function-expression-body = disabled 22 | 23 | [*.md] 24 | trim_trailing_whitespace = false 25 | 26 | [*.xml] 27 | indent_size = 4 28 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | # Release template for GitHub Releases 2 | 3 | changelog: 4 | categories: 5 | - title: 🖥️✨ CLI features 6 | labels: 7 | - feature-cli 8 | - title: 🖥️🐛 CLI bugfixes 9 | labels: 10 | - bugfix-cli 11 | - title: 🔌✨ Plugin features 12 | labels: 13 | - feature-plugin 14 | - title: 🔌🐛 Plugin bugfixes 15 | labels: 16 | - bugfix-plugin 17 | - title: ✨ Features 18 | labels: 19 | - feature 20 | - title: 🐛 Bugfixes 21 | labels: 22 | - bugfix 23 | - title: 🧹 Housekeeping 24 | labels: 25 | - housekeeping 26 | - title: ⬆️ Dependencies 27 | labels: 28 | - dependencies 29 | - title: ✏️ Others 30 | labels: 31 | - '*' 32 | exclude: 33 | labels: 34 | - bugfix-cli 35 | - bugfix-plugin 36 | - bugfix 37 | - feature-cli 38 | - feature-plugin 39 | - feature 40 | - housekeeping 41 | - dependencies 42 | -------------------------------------------------------------------------------- /.github/workflows/coverage.yml: -------------------------------------------------------------------------------- 1 | name: Test coverage 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Setup Java 17 | uses: actions/setup-java@v4 18 | with: 19 | distribution: temurin 20 | java-version: 21 21 | 22 | - name: Generate test coverage 23 | shell: bash 24 | run: | 25 | COVERAGE=$(./gradlew components:test:coverage:koverLog | grep "application line coverage:" | tail -n1 | cut -d ":" -f 2 | tr -d '[:space:]%') 26 | echo "COVERAGE=$COVERAGE" 27 | echo "COVERAGE=$COVERAGE" >> $GITHUB_ENV 28 | 29 | - name: Update dynamic badge gist 30 | uses: schneegans/dynamic-badges-action@v1.7.0 31 | with: 32 | auth: ${{ secrets.GIST_SECRET }} 33 | gistID: ae91ef6fa6f1837ef39b4f4ac21e91d2 34 | filename: valkyrie-coverage.json 35 | label: coverage 36 | message: ${{ env.COVERAGE }}% 37 | valColorRange: ${{ env.COVERAGE }} 38 | minColorRange: 0 39 | maxColorRange: 100 40 | -------------------------------------------------------------------------------- /.github/workflows/require-label.yml: -------------------------------------------------------------------------------- 1 | name: Require Label 2 | 3 | on: 4 | pull_request: 5 | types: [opened, edited, labeled, unlabeled, synchronize] 6 | 7 | jobs: 8 | check-label: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Check for Label 12 | uses: actions/github-script@v7 13 | with: 14 | github-token: ${{ secrets.GITHUB_TOKEN }} 15 | script: | 16 | const requiredLabels = ['housekeeping', 'feature', 'bugfix', 'dependencies', 'feature-cli', 'feature-plugin', 'bugfix-cli', 'bugfix-plugin']; 17 | const labels = context.payload.pull_request.labels.map(label => label.name); 18 | const hasRequiredLabel = labels.some(label => requiredLabels.includes(label)); 19 | if (!hasRequiredLabel) { 20 | core.setFailed(`The PR must have at least one of the following labels: ${requiredLabels.join(', ')}.`); 21 | } 22 | -------------------------------------------------------------------------------- /.github/workflows/validation.yml: -------------------------------------------------------------------------------- 1 | name: Validation 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | check-links: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v4 19 | 20 | - name: Run linkspector 21 | uses: umbrelladocs/action-linkspector@v1 22 | with: 23 | reporter: github-pr-check 24 | fail_on_error: true 25 | filter_mode: nofilter 26 | fail_level: any 27 | 28 | build: 29 | strategy: 30 | matrix: 31 | # os: [ ubuntu-latest, windows-latest ] 32 | os: [ ubuntu-latest ] 33 | runs-on: ${{ matrix.os }} 34 | 35 | steps: 36 | - uses: actions/checkout@v4 37 | 38 | - name: Setup Java 39 | uses: actions/setup-java@v4 40 | with: 41 | distribution: temurin 42 | java-version: 21 43 | 44 | - uses: gradle/actions/setup-gradle@v4 45 | with: 46 | cache-disabled: true 47 | 48 | - name: Run build 49 | run: ./gradlew build 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | !**/src/main/**/build/ 5 | !**/src/test/**/build/ 6 | 7 | ### IntelliJ IDEA ### 8 | .idea/ 9 | .intellijPlatform 10 | *.iws 11 | *.iml 12 | *.ipr 13 | out/ 14 | !**/src/main/**/out/ 15 | !**/src/test/**/out/ 16 | 17 | ### Eclipse ### 18 | .apt_generated 19 | .classpath 20 | .factorypath 21 | .project 22 | .settings 23 | .springBeans 24 | .sts4-cache 25 | bin/ 26 | !**/src/main/**/bin/ 27 | !**/src/test/**/bin/ 28 | 29 | ### NetBeans ### 30 | /nbproject/private/ 31 | /nbbuild/ 32 | /dist/ 33 | /nbdist/ 34 | /.nb-gradle/ 35 | 36 | ### VS Code ### 37 | .vscode/ 38 | 39 | ### Mac OS ### 40 | .DS_Store 41 | .kotlin 42 | local.properties 43 | kotlin-js-store/ 44 | -------------------------------------------------------------------------------- /assets/cli_valkyrie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/cli_valkyrie.png -------------------------------------------------------------------------------- /assets/cli_valkyrie_iconpack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/cli_valkyrie_iconpack.png -------------------------------------------------------------------------------- /assets/cli_valkyrie_svgxml2imagevector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/cli_valkyrie_svgxml2imagevector.png -------------------------------------------------------------------------------- /assets/iconpack_mode_existing_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/iconpack_mode_existing_1.png -------------------------------------------------------------------------------- /assets/iconpack_mode_existing_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/iconpack_mode_existing_2.png -------------------------------------------------------------------------------- /assets/iconpack_mode_new_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/iconpack_mode_new_1.png -------------------------------------------------------------------------------- /assets/iconpack_mode_new_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/iconpack_mode_new_2.png -------------------------------------------------------------------------------- /assets/imagevector_previewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/imagevector_previewer.png -------------------------------------------------------------------------------- /assets/simple_mode_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/simple_mode_1.png -------------------------------------------------------------------------------- /assets/simple_mode_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/simple_mode_2.png -------------------------------------------------------------------------------- /assets/simple_mode_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/assets/simple_mode_3.png -------------------------------------------------------------------------------- /build-logic/convention/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | group = "io.github.composegears.valkyrie" 6 | 7 | dependencies { 8 | compileOnly(libs.kotlin.compose.compiler.plugin) 9 | compileOnly(libs.kotlin.gradle.plugin) 10 | } 11 | 12 | gradlePlugin { 13 | plugins { 14 | register("valkyrie.kmp") { 15 | id = "valkyrie.kmp" 16 | implementationClass = "KmpPlugin" 17 | } 18 | register("valkyrie.compose") { 19 | id = "valkyrie.compose" 20 | implementationClass = "ComposePlugin" 21 | } 22 | register("valkyrie.wasm.resources") { 23 | id = "valkyrie.wasm.resources" 24 | implementationClass = "WasmResourcesPlugin" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /build-logic/convention/src/main/kotlin/ComposePlugin.kt: -------------------------------------------------------------------------------- 1 | 2 | import io.github.composegears.valkyrie.internal.composeCompiler 3 | import io.github.composegears.valkyrie.internal.jetbrainsComposePluginId 4 | import io.github.composegears.valkyrie.internal.kotlinComposePluginId 5 | import org.gradle.api.Plugin 6 | import org.gradle.api.Project 7 | import org.gradle.kotlin.dsl.apply 8 | 9 | class ComposePlugin : Plugin { 10 | 11 | override fun apply(target: Project) = with(target) { 12 | apply(plugin = jetbrainsComposePluginId) 13 | apply(plugin = kotlinComposePluginId) 14 | 15 | composeCompiler { 16 | stabilityConfigurationFiles.add { 17 | rootDir.resolve("stability_config.conf") 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /build-logic/convention/src/main/kotlin/KmpPlugin.kt: -------------------------------------------------------------------------------- 1 | import io.github.composegears.valkyrie.extension.applyTargets 2 | import io.github.composegears.valkyrie.internal.kmpExtension 3 | import io.github.composegears.valkyrie.internal.kotlinMultiplatformPluginId 4 | import org.gradle.api.Plugin 5 | import org.gradle.api.Project 6 | import org.gradle.kotlin.dsl.apply 7 | 8 | class KmpPlugin : Plugin { 9 | 10 | override fun apply(target: Project) = with(target) { 11 | apply(plugin = kotlinMultiplatformPluginId) 12 | 13 | kmpExtension { 14 | applyTargets() 15 | 16 | compilerOptions { 17 | extraWarnings.set(true) 18 | freeCompilerArgs.add("-Xexpect-actual-classes") 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /build-logic/convention/src/main/kotlin/io/github/composegears/valkyrie/extension/KotlinMultiplatformExtension.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.extension 2 | 3 | import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl 4 | import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension 5 | 6 | fun KotlinMultiplatformExtension.applyTargets() { 7 | jvm() 8 | 9 | @OptIn(ExperimentalWasmDsl::class) 10 | wasmJs { 11 | browser() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /build-logic/convention/src/main/kotlin/io/github/composegears/valkyrie/internal/Plugins.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.internal 2 | 3 | import libs 4 | import org.gradle.api.Project 5 | 6 | internal val Project.kotlinMultiplatformPluginId 7 | get() = libs.plugins.kotlin.multiplatform.get().pluginId 8 | 9 | internal val Project.jetbrainsComposePluginId 10 | get() = libs.plugins.jetbrains.compose.get().pluginId 11 | 12 | internal val Project.kotlinComposePluginId 13 | get() = libs.plugins.kotlin.compose.get().pluginId 14 | -------------------------------------------------------------------------------- /build-logic/convention/src/main/kotlin/io/github/composegears/valkyrie/internal/Project.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.internal 2 | 3 | import org.gradle.api.Project 4 | import org.gradle.kotlin.dsl.configure 5 | import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension 6 | import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension 7 | 8 | internal fun Project.kmpExtension(action: KotlinMultiplatformExtension.() -> Unit) = 9 | extensions.configure(action) 10 | 11 | fun Project.composeCompiler(block: ComposeCompilerGradlePluginExtension.() -> Unit) = 12 | extensions.configure(block) 13 | -------------------------------------------------------------------------------- /build-logic/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | plugins { 9 | id("dev.panuszewski.typesafe-conventions") version "0.7.3" 10 | } 11 | 12 | rootProject.name = "build-logic" 13 | include(":convention") 14 | -------------------------------------------------------------------------------- /components/extensions/api/extensions.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/extensions/PathUtilsKt { 2 | public static final fun writeToKt (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)V 3 | public static synthetic fun writeToKt$default (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZILjava/lang/Object;)V 4 | } 5 | 6 | -------------------------------------------------------------------------------- /components/extensions/api/extensions.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [wasmJs] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final inline fun <#A: reified kotlin/Any> (kotlin/Any?).io.github.composegears.valkyrie.extensions/cast(): #A // io.github.composegears.valkyrie.extensions/cast|cast@kotlin.Any?(){0§}[0] 10 | final inline fun <#A: reified kotlin/Any> (kotlin/Any?).io.github.composegears.valkyrie.extensions/safeAs(): #A? // io.github.composegears.valkyrie.extensions/safeAs|safeAs@kotlin.Any?(){0§}[0] 11 | -------------------------------------------------------------------------------- /components/extensions/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | } 4 | -------------------------------------------------------------------------------- /components/extensions/src/commonMain/kotlin/io/github/composegears/valkyrie/extensions/Any.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.extensions 2 | 3 | inline fun Any?.safeAs(): T? = this as? T 4 | 5 | inline fun Any?.cast(): T = this as T 6 | -------------------------------------------------------------------------------- /components/extensions/src/jvmMain/kotlin/io/github/composegears/valkyrie/extensions/PathUtils.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.extensions 2 | 3 | import java.io.IOException 4 | import kotlin.io.path.Path 5 | import kotlin.io.path.createParentDirectories 6 | import kotlin.io.path.deleteIfExists 7 | import kotlin.io.path.writeText 8 | 9 | @Throws(IOException::class) 10 | fun String.writeToKt( 11 | outputDir: String, 12 | nameWithoutExtension: String, 13 | deleteIfExists: Boolean = true, 14 | createParents: Boolean = true, 15 | ) { 16 | val outputPath = Path(outputDir, "$nameWithoutExtension.kt") 17 | 18 | if (deleteIfExists) { 19 | outputPath.deleteIfExists() 20 | } 21 | if (createParents) { 22 | outputPath.createParentDirectories() 23 | } 24 | outputPath.writeText(this) 25 | } 26 | -------------------------------------------------------------------------------- /components/generator/core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.kover) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonTest.dependencies { 9 | implementation(libs.assertk) 10 | implementation(libs.kotlin.test) 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /components/generator/core/src/commonMain/kotlin/io/github/composegears/valkyrie/generator/core/FloatFormatter.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.core 2 | 3 | fun Float.trimTrailingZero(): String = toString().removeSuffix(".0") 4 | 5 | fun Float.formatFloat(): String = "${trimTrailingZero()}f" 6 | -------------------------------------------------------------------------------- /components/generator/core/src/commonMain/kotlin/io/github/composegears/valkyrie/generator/core/IconPackDsl.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.core 2 | 3 | @DslMarker 4 | annotation class IconPackDsl 5 | 6 | @IconPackDsl 7 | fun iconpack(name: String, init: PackBuilder.() -> Unit = {}): IconPack { 8 | val builder = PackBuilder(name) 9 | builder.init() 10 | return builder.build() 11 | } 12 | 13 | @IconPackDsl 14 | class PackBuilder(private val name: String) { 15 | private val nestedPacks = mutableListOf() 16 | 17 | fun pack(name: String, init: PackBuilder.() -> Unit = {}) { 18 | val builder = PackBuilder(name) 19 | builder.init() 20 | nestedPacks.add(builder.build()) 21 | } 22 | 23 | internal fun build(): IconPack = IconPack(name, nestedPacks) 24 | } 25 | -------------------------------------------------------------------------------- /components/generator/core/src/commonTest/kotlin/io/github/composegears/valkyrie/generator/core/FloatFormatterTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.core 2 | 3 | import assertk.assertThat 4 | import assertk.assertions.isEqualTo 5 | import kotlin.test.Test 6 | 7 | class FloatFormatterTest { 8 | 9 | @Test 10 | fun `formatValue for floats`() { 11 | assertThat(24f.trimTrailingZero()).isEqualTo("24") 12 | assertThat(24.0f.trimTrailingZero()).isEqualTo("24") 13 | assertThat(24.00002f.trimTrailingZero()).isEqualTo("24.00002") 14 | 15 | assertThat(24f.formatFloat()).isEqualTo("24f") 16 | assertThat(24.0f.formatFloat()).isEqualTo("24f") 17 | assertThat(24.00002f.formatFloat()).isEqualTo("24.00002f") 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /components/generator/iconpack/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.valkyrie.wasm.resources) 4 | alias(libs.plugins.kover) 5 | } 6 | 7 | kotlin { 8 | sourceSets { 9 | commonMain.dependencies { 10 | implementation(projects.components.generator.core) 11 | } 12 | jvmMain.dependencies { 13 | implementation(projects.components.generator.jvm.poetExtensions) 14 | implementation(libs.kotlinpoet) 15 | } 16 | commonTest { 17 | resources.srcDir("$rootDir/components/test/sharedTestResources") 18 | 19 | dependencies { 20 | implementation(projects.components.test.resourceLoader) 21 | 22 | implementation(libs.assertk) 23 | implementation(libs.kotlin.test) 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /components/generator/iconpack/src/commonMain/kotlin/io/github/composegears/valkyrie/generator/iconpack/IconPackGenerator.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.iconpack 2 | 3 | expect object IconPackGenerator { 4 | fun create(config: IconPackGeneratorConfig): IconPackSpecOutput 5 | } 6 | -------------------------------------------------------------------------------- /components/generator/iconpack/src/commonMain/kotlin/io/github/composegears/valkyrie/generator/iconpack/IconPackGeneratorConfig.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.iconpack 2 | 3 | import io.github.composegears.valkyrie.generator.core.IconPack 4 | 5 | data class IconPackGeneratorConfig( 6 | val packageName: String, 7 | val iconPack: IconPack, 8 | val useExplicitMode: Boolean, 9 | val indentSize: Int, 10 | ) 11 | -------------------------------------------------------------------------------- /components/generator/iconpack/src/commonMain/kotlin/io/github/composegears/valkyrie/generator/iconpack/IconPackSpecOutput.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.iconpack 2 | 3 | data class IconPackSpecOutput( 4 | val content: String, 5 | val name: String, 6 | ) 7 | -------------------------------------------------------------------------------- /components/generator/iconpack/src/jvmMain/kotlin/io/github/composegears/valkyrie/generator/iconpack/IconPackGenerator.jvm.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.iconpack 2 | 3 | actual object IconPackGenerator { 4 | actual fun create(config: IconPackGeneratorConfig): IconPackSpecOutput { 5 | return IconPackFileSpec(config).createSpec() 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /components/generator/jvm/imagevector/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.kotlin.jvm) 3 | alias(libs.plugins.kover) 4 | } 5 | 6 | sourceSets { 7 | test { 8 | resources.srcDir("$rootDir/components/test/sharedTestResources") 9 | } 10 | } 11 | 12 | dependencies { 13 | implementation(projects.components.extensions) 14 | api(projects.components.generator.jvm.poetExtensions) 15 | api(projects.components.generator.core) 16 | implementation(projects.components.ir) 17 | 18 | implementation(libs.kotlinpoet) 19 | 20 | testImplementation(projects.components.parser.unified) 21 | testImplementation(projects.components.test.resourceLoader) 22 | testImplementation(libs.bundles.test) 23 | testRuntimeOnly(libs.junit.launcher) 24 | } 25 | -------------------------------------------------------------------------------- /components/generator/jvm/imagevector/src/main/kotlin/io/github/composegears/valkyrie/generator/jvm/imagevector/util/BackingPropertySpec.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.jvm.imagevector.util 2 | 3 | import com.squareup.kotlinpoet.AnnotationSpec 4 | import com.squareup.kotlinpoet.KModifier 5 | import com.squareup.kotlinpoet.TypeName 6 | import io.github.composegears.valkyrie.generator.jvm.ext.nullable 7 | import io.github.composegears.valkyrie.generator.jvm.ext.propertySpecBuilder 8 | 9 | internal fun String.backingPropertyName() = "_$this" 10 | 11 | internal fun backingPropertySpec( 12 | name: String, 13 | type: TypeName, 14 | ) = propertySpecBuilder(name = name, type = type.nullable()) { 15 | addAnnotation(suppressNamingAnnotation) 16 | mutable() 17 | addModifiers(KModifier.PRIVATE) 18 | initializer("null") 19 | } 20 | 21 | private val suppressNamingAnnotation = AnnotationSpec.builder(ClassNames.Suppress) 22 | .addMember("%S", "ObjectPropertyName") 23 | .build() 24 | -------------------------------------------------------------------------------- /components/generator/jvm/imagevector/src/test/kotlin/io/github/composegears/valkyrie/generator/jvm/imagevector/BrokenSvgParsingTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.jvm.imagevector 2 | 3 | import assertk.assertFailure 4 | import assertk.assertions.isInstanceOf 5 | import io.github.composegears.valkyrie.parser.unified.ParserType 6 | import io.github.composegears.valkyrie.parser.unified.SvgXmlParser 7 | import io.github.composegears.valkyrie.parser.unified.ext.toIOPath 8 | import io.github.composegears.valkyrie.resource.loader.ResourceLoader.getResourcePath 9 | import java.io.EOFException 10 | import org.junit.jupiter.api.Test 11 | 12 | class BrokenSvgParsingTest { 13 | 14 | @Test 15 | fun `parsing broken svg`() { 16 | val icon = getResourcePath("imagevector/broken.svg").toIOPath() 17 | 18 | assertFailure { 19 | SvgXmlParser.toIrImageVector(parser = ParserType.Jvm, path = icon) 20 | }.isInstanceOf(EOFException::class) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/generator/jvm/imagevector/src/test/kotlin/io/github/composegears/valkyrie/generator/jvm/imagevector/common/OutputFormatResource.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.jvm.imagevector.common 2 | 3 | import io.github.composegears.valkyrie.generator.jvm.imagevector.OutputFormat 4 | import io.github.composegears.valkyrie.generator.jvm.imagevector.OutputFormat.BackingProperty 5 | import io.github.composegears.valkyrie.generator.jvm.imagevector.OutputFormat.LazyProperty 6 | import io.github.composegears.valkyrie.resource.loader.ResourceLoader.getResourceText 7 | 8 | fun OutputFormat.toResourceText( 9 | pathToBackingProperty: String, 10 | pathToLazyProperty: String, 11 | ): String = when (this) { 12 | BackingProperty -> getResourceText(pathToBackingProperty) 13 | LazyProperty -> getResourceText(pathToLazyProperty) 14 | } 15 | -------------------------------------------------------------------------------- /components/generator/jvm/poet-extensions/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.kotlin.jvm) 3 | alias(libs.plugins.kover) 4 | } 5 | 6 | dependencies { 7 | implementation(libs.kotlinpoet) 8 | 9 | testImplementation(libs.bundles.test) 10 | testRuntimeOnly(libs.junit.launcher) 11 | } 12 | -------------------------------------------------------------------------------- /components/generator/jvm/poet-extensions/src/main/kotlin/io/github/composegears/valkyrie/generator/jvm/ext/CodeBlock.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.jvm.ext 2 | 3 | import com.squareup.kotlinpoet.CodeBlock 4 | 5 | fun CodeBlock.Builder.argumentBlock( 6 | argumentFlow: String, 7 | vararg args: Any?, 8 | isNested: Boolean = false, 9 | block: CodeBlock.Builder.() -> Unit, 10 | ) { 11 | add("$argumentFlow\n", *args) 12 | indention(block) 13 | newLine() 14 | add(")") 15 | if (isNested) { 16 | add(",") 17 | newLine() 18 | } 19 | } 20 | 21 | fun CodeBlock.Builder.builderBlock( 22 | argumentFlow: String, 23 | vararg args: Any?, 24 | block: CodeBlock.Builder.() -> Unit, 25 | ) { 26 | add("$argumentFlow\n", *args) 27 | indention(block) 28 | add("}") 29 | } 30 | 31 | fun CodeBlock.Builder.indention(block: CodeBlock.Builder.() -> Unit) { 32 | indent() 33 | block() 34 | unindent() 35 | } 36 | 37 | fun CodeBlock.Builder.newLine() { 38 | add("\n") 39 | } 40 | 41 | fun CodeBlock.Builder.trailingComma() { 42 | add(",") 43 | newLine() 44 | } 45 | -------------------------------------------------------------------------------- /components/generator/jvm/poet-extensions/src/main/kotlin/io/github/composegears/valkyrie/generator/jvm/ext/TypeName.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.generator.jvm.ext 2 | 3 | import com.squareup.kotlinpoet.TypeName 4 | 5 | fun TypeName.nullable() = copy(nullable = true) 6 | -------------------------------------------------------------------------------- /components/ir-compose/api/ir-compose.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/ir/compose/IrToImageVectorKt { 2 | public static final fun toComposeImageVector-VpY3zN4 (Lio/github/composegears/valkyrie/ir/IrImageVector;FF)Landroidx/compose/ui/graphics/vector/ImageVector; 3 | public static synthetic fun toComposeImageVector-VpY3zN4$default (Lio/github/composegears/valkyrie/ir/IrImageVector;FFILjava/lang/Object;)Landroidx/compose/ui/graphics/vector/ImageVector; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /components/ir-compose/api/ir-compose.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [wasmJs] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final fun (io.github.composegears.valkyrie.ir/IrImageVector).io.github.composegears.valkyrie.ir.compose/toComposeImageVector(androidx.compose.ui.unit/Dp = ..., androidx.compose.ui.unit/Dp = ...): androidx.compose.ui.graphics.vector/ImageVector // io.github.composegears.valkyrie.ir.compose/toComposeImageVector|toComposeImageVector@io.github.composegears.valkyrie.ir.IrImageVector(androidx.compose.ui.unit.Dp;androidx.compose.ui.unit.Dp){}[0] 10 | -------------------------------------------------------------------------------- /components/ir-compose/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.valkyrie.compose) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | api(projects.components.ir) 10 | 11 | implementation(compose.ui) 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /components/ir/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.kover) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonTest.dependencies { 9 | implementation(libs.assertk) 10 | implementation(libs.kotlin.test) 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /components/ir/src/commonMain/kotlin/io/github/composegears/valkyrie/ir/IrFill.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ir 2 | 3 | sealed interface IrFill { 4 | data class Color(val irColor: IrColor) : IrFill 5 | 6 | data class LinearGradient( 7 | val startY: Float, 8 | val startX: Float, 9 | val endY: Float, 10 | val endX: Float, 11 | val colorStops: MutableList = mutableListOf(), 12 | ) : IrFill 13 | 14 | data class RadialGradient( 15 | val radius: Float, 16 | val centerX: Float, 17 | val centerY: Float, 18 | val colorStops: MutableList = mutableListOf(), 19 | ) : IrFill 20 | 21 | data class ColorStop( 22 | val offset: Float, 23 | val irColor: IrColor, 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /components/ir/src/commonMain/kotlin/io/github/composegears/valkyrie/ir/IrImageVector.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ir 2 | 3 | data class IrImageVector( 4 | val name: String = "", 5 | val autoMirror: Boolean = false, 6 | val defaultWidth: Float, 7 | val defaultHeight: Float, 8 | val viewportWidth: Float, 9 | val viewportHeight: Float, 10 | val nodes: List, 11 | ) 12 | -------------------------------------------------------------------------------- /components/ir/src/commonMain/kotlin/io/github/composegears/valkyrie/ir/IrPathFillType.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ir 2 | 3 | enum class IrPathFillType { 4 | EvenOdd, 5 | NonZero, 6 | } 7 | -------------------------------------------------------------------------------- /components/ir/src/commonMain/kotlin/io/github/composegears/valkyrie/ir/IrStroke.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ir 2 | 3 | sealed interface IrStroke { 4 | data class Color(val irColor: IrColor) : IrStroke 5 | } 6 | -------------------------------------------------------------------------------- /components/ir/src/commonMain/kotlin/io/github/composegears/valkyrie/ir/IrStrokeLineCap.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ir 2 | 3 | enum class IrStrokeLineCap { 4 | Butt, 5 | Round, 6 | Square, 7 | } 8 | -------------------------------------------------------------------------------- /components/ir/src/commonMain/kotlin/io/github/composegears/valkyrie/ir/IrStrokeLineJoin.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ir 2 | 3 | enum class IrStrokeLineJoin { 4 | Miter, 5 | Round, 6 | Bevel, 7 | } 8 | -------------------------------------------------------------------------------- /components/ir/src/commonMain/kotlin/io/github/composegears/valkyrie/ir/IrVectorNode.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ir 2 | 3 | sealed interface IrVectorNode { 4 | data class IrGroup( 5 | val name: String = "", 6 | val rotate: Float = 0f, 7 | val pivotX: Float = 0f, 8 | val pivotY: Float = 0f, 9 | val scaleX: Float = 1f, 10 | val scaleY: Float = 1f, 11 | val translationX: Float = 0f, 12 | val translationY: Float = 0f, 13 | val clipPathData: MutableList, 14 | val nodes: MutableList, 15 | ) : IrVectorNode 16 | 17 | data class IrPath( 18 | val name: String = "", 19 | val fill: IrFill? = null, 20 | val fillAlpha: Float = 1f, 21 | val stroke: IrStroke? = null, 22 | val strokeAlpha: Float = 1f, 23 | val strokeLineWidth: Float = 0f, 24 | val strokeLineCap: IrStrokeLineCap = IrStrokeLineCap.Butt, 25 | val strokeLineJoin: IrStrokeLineJoin = IrStrokeLineJoin.Miter, 26 | val strokeLineMiter: Float = 4f, 27 | val pathFillType: IrPathFillType = IrPathFillType.NonZero, 28 | val paths: List, 29 | ) : IrVectorNode 30 | } 31 | -------------------------------------------------------------------------------- /components/ir/src/commonMain/kotlin/io/github/composegears/valkyrie/ir/util/IrImageVectorColor.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ir.util 2 | 3 | import io.github.composegears.valkyrie.ir.IrColor 4 | import io.github.composegears.valkyrie.ir.IrFill 5 | import io.github.composegears.valkyrie.ir.IrImageVector 6 | import io.github.composegears.valkyrie.ir.IrStroke 7 | import io.github.composegears.valkyrie.ir.IrVectorNode 8 | 9 | fun IrImageVector.iconColors(): List { 10 | val colors = mutableSetOf() 11 | 12 | nodes.onEach { node -> 13 | visitNode(node = node, colors = colors) 14 | } 15 | 16 | return colors.toList() 17 | } 18 | 19 | private fun visitNode(node: IrVectorNode, colors: MutableSet) { 20 | when (node) { 21 | is IrVectorNode.IrGroup -> { 22 | node.nodes.forEach { 23 | visitNode(node = it, colors = colors) 24 | } 25 | } 26 | is IrVectorNode.IrPath -> visitPath(node, colors) 27 | } 28 | } 29 | 30 | private fun visitPath( 31 | node: IrVectorNode.IrPath, 32 | colors: MutableSet, 33 | ) { 34 | when (val fill = node.fill) { 35 | is IrFill.Color -> colors += fill.irColor 36 | is IrFill.LinearGradient -> colors += fill.colorStops.map { it.irColor } 37 | is IrFill.RadialGradient -> colors += fill.colorStops.map { it.irColor } 38 | null -> {} 39 | } 40 | when (val stroke = node.stroke) { 41 | is IrStroke.Color -> colors += stroke.irColor 42 | null -> {} 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /components/parser/common/api/common.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/parser/common/PathParser { 2 | public static final field INSTANCE Lio/github/composegears/valkyrie/parser/common/PathParser; 3 | public final fun parsePathString (Ljava/lang/String;)Ljava/util/List; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /components/parser/common/api/common.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [wasmJs] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final object io.github.composegears.valkyrie.parser.common/PathParser { // io.github.composegears.valkyrie.parser.common/PathParser|null[0] 10 | final fun parsePathString(kotlin/String): kotlin.collections/List // io.github.composegears.valkyrie.parser.common/PathParser.parsePathString|parsePathString(kotlin.String){}[0] 11 | } 12 | -------------------------------------------------------------------------------- /components/parser/common/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.kover) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(projects.components.ir) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /components/parser/jvm/svg/api/svg.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/parser/jvm/svg/SvgToXmlParser { 2 | public static final field INSTANCE Lio/github/composegears/valkyrie/parser/jvm/svg/SvgToXmlParser; 3 | public final fun parse (Ljava/lang/String;)Ljava/lang/String; 4 | public final fun parse (Ljava/nio/file/Path;)Ljava/lang/String; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /components/parser/jvm/svg/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.kotlin.jvm) 3 | alias(libs.plugins.kover) 4 | } 5 | 6 | dependencies { 7 | implementation(libs.android.build.tools) 8 | } 9 | -------------------------------------------------------------------------------- /components/parser/jvm/svg/src/main/kotlin/io/github/composegears/valkyrie/parser/jvm/svg/SvgToXmlParser.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.jvm.svg 2 | 3 | import com.android.ide.common.vectordrawable.Svg2Vector 4 | import java.nio.file.Path 5 | import kotlin.io.path.createTempFile 6 | import kotlin.io.path.outputStream 7 | import kotlin.io.path.readText 8 | import kotlin.io.path.writeText 9 | 10 | object SvgToXmlParser { 11 | 12 | fun parse(path: Path): String { 13 | val tmpPath = createTempFile() 14 | parse(path, tmpPath) 15 | return tmpPath.readText() 16 | } 17 | 18 | fun parse(input: String): String { 19 | val tmpInPath = createTempFile().apply { writeText(input) } 20 | val tmpOutPath = createTempFile() 21 | 22 | parse(tmpInPath, tmpOutPath) 23 | return tmpOutPath.readText() 24 | } 25 | 26 | private fun parse(input: Path, output: Path) { 27 | Svg2Vector.parseSvgToXml(input, output.outputStream()) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /components/parser/jvm/xml/api/xml.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/parser/jvm/xml/XmlToImageVectorParser { 2 | public static final field INSTANCE Lio/github/composegears/valkyrie/parser/jvm/xml/XmlToImageVectorParser; 3 | public final fun parse (Ljava/lang/String;)Lio/github/composegears/valkyrie/ir/IrImageVector; 4 | } 5 | 6 | public final class io/github/composegears/valkyrie/parser/jvm/xml/XmlToImageVectorParserKt { 7 | public static final field PIVOT_X Ljava/lang/String; 8 | public static final field PIVOT_Y Ljava/lang/String; 9 | public static final field ROTATION Ljava/lang/String; 10 | public static final field SCALE_X Ljava/lang/String; 11 | public static final field SCALE_Y Ljava/lang/String; 12 | public static final field TRANSLATE_X Ljava/lang/String; 13 | public static final field TRANSLATE_Y Ljava/lang/String; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /components/parser/jvm/xml/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.kotlin.jvm) 3 | alias(libs.plugins.kover) 4 | } 5 | 6 | dependencies { 7 | implementation(projects.components.ir) 8 | implementation(projects.components.parser.common) 9 | implementation(libs.xpp3) 10 | } 11 | -------------------------------------------------------------------------------- /components/parser/jvm/xml/src/main/kotlin/io/github/composegears/valkyrie/parser/jvm/xml/ext/XmlPullParser.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.jvm.xml.ext 2 | 3 | import org.xmlpull.v1.XmlPullParser 4 | import org.xmlpull.v1.XmlPullParser.END_DOCUMENT 5 | import org.xmlpull.v1.XmlPullParser.END_TAG 6 | import org.xmlpull.v1.XmlPullParser.START_TAG 7 | import org.xmlpull.v1.XmlPullParserException 8 | 9 | internal fun XmlPullParser.dpValueAsFloat(name: String): Float? { 10 | return getAttribute(name) 11 | ?.removeSuffix("dp") 12 | ?.toFloatOrNull() 13 | } 14 | 15 | internal fun XmlPullParser.valueAsBoolean(name: String): Boolean? = getAttribute(name)?.toBooleanStrictOrNull() 16 | 17 | internal fun XmlPullParser.valueAsString(name: String): String? = getAttribute(name) 18 | 19 | internal fun XmlPullParser.valueAsFloat(name: String): Float? = getAttribute(name)?.toFloatOrNull() 20 | 21 | internal fun XmlPullParser.getAttribute(name: String): String? = getAttributeValue(null, name) 22 | 23 | internal fun XmlPullParser.seekToStartTag(): XmlPullParser { 24 | var type = next() 25 | while (type != START_TAG && type != END_DOCUMENT) { 26 | // Empty loop 27 | type = next() 28 | } 29 | if (type != START_TAG) { 30 | throw XmlPullParserException("No start tag found") 31 | } 32 | return this 33 | } 34 | 35 | internal fun XmlPullParser.isAtEnd() = eventType == END_DOCUMENT || (depth < 1 && eventType == END_TAG) 36 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/api/svg.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/parser/kmp/svg/SVGParser { 2 | public static final field INSTANCE Lio/github/composegears/valkyrie/parser/kmp/svg/SVGParser; 3 | public final fun parse (Ljava/lang/String;)Lio/github/composegears/valkyrie/ir/IrImageVector; 4 | } 5 | 6 | public final class io/github/composegears/valkyrie/parser/kmp/svg/SvgColorParser { 7 | public static final field INSTANCE Lio/github/composegears/valkyrie/parser/kmp/svg/SvgColorParser; 8 | public final fun parse-A7oVHJ0 (Ljava/lang/String;)Lio/github/composegears/valkyrie/ir/IrColor; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/api/svg.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [wasmJs] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final object io.github.composegears.valkyrie.parser.kmp.svg/SVGParser { // io.github.composegears.valkyrie.parser.kmp.svg/SVGParser|null[0] 10 | final fun parse(kotlin/String): io.github.composegears.valkyrie.ir/IrImageVector // io.github.composegears.valkyrie.parser.kmp.svg/SVGParser.parse|parse(kotlin.String){}[0] 11 | } 12 | 13 | final object io.github.composegears.valkyrie.parser.kmp.svg/SvgColorParser { // io.github.composegears.valkyrie.parser.kmp.svg/SvgColorParser|null[0] 14 | final fun parse(kotlin/String): io.github.composegears.valkyrie.ir/IrColor? // io.github.composegears.valkyrie.parser.kmp.svg/SvgColorParser.parse|parse(kotlin.String){}[0] 15 | } 16 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.kotlin.serialization) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(projects.components.ir) 10 | implementation(projects.components.parser.common) 11 | implementation(libs.xmlutil) 12 | } 13 | commonTest.dependencies { 14 | implementation(libs.assertk) 15 | implementation(libs.kotlin.test) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/kmp/svg/SVGDeserializer.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.kmp.svg 2 | 3 | import kotlinx.serialization.decodeFromString 4 | import kotlinx.serialization.modules.SerializersModule 5 | import kotlinx.serialization.modules.polymorphic 6 | import kotlinx.serialization.modules.subclass 7 | import nl.adaptivity.xmlutil.ExperimentalXmlUtilApi 8 | import nl.adaptivity.xmlutil.serialization.UnknownChildHandler 9 | import nl.adaptivity.xmlutil.serialization.XML 10 | 11 | internal object SVGDeserializer { 12 | 13 | private val polyModule = SerializersModule { 14 | polymorphic(baseClass = SVG.Child::class) { 15 | subclass(SVG.Circle::class) 16 | subclass(SVG.Group::class) 17 | subclass(SVG.Ellipse::class) 18 | subclass(SVG.Path::class) 19 | subclass(SVG.Polygon::class) 20 | subclass(SVG.Rectangle::class) 21 | } 22 | } 23 | 24 | @OptIn(ExperimentalXmlUtilApi::class) 25 | private val xmlConfig = XML(serializersModule = polyModule) { 26 | autoPolymorphic = true 27 | defaultPolicy { 28 | pedantic = false 29 | repairNamespaces = true 30 | unknownChildHandler = UnknownChildHandler { _, _, _, _, _ -> emptyList() } 31 | } 32 | } 33 | 34 | fun deserialize(content: String): SVG = xmlConfig.decodeFromString(content) 35 | } 36 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/kmp/svg/Scale.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.kmp.svg 2 | 3 | import kotlin.jvm.JvmInline 4 | 5 | @JvmInline 6 | internal value class Scale(private val args: List) { 7 | companion object { 8 | val Default = Scale(listOf(1f, 1f)) 9 | } 10 | 11 | val x get() = args[0] 12 | val y get() = args.getOrElse(1) { x } 13 | } 14 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/kmp/svg/SvgColorParser.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.kmp.svg 2 | 3 | import io.github.composegears.valkyrie.ir.IrColor 4 | 5 | object SvgColorParser { 6 | fun parse(colorValue: String): IrColor? { 7 | if (colorValue == "none") return null 8 | return KeywordColorParser.parse(colorValue) ?: IrColor(colorValue) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/kmp/svg/SvgExtensions.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.kmp.svg 2 | 3 | import io.github.composegears.valkyrie.ir.IrPathFillType 4 | import io.github.composegears.valkyrie.ir.IrStrokeLineCap 5 | import io.github.composegears.valkyrie.ir.IrStrokeLineJoin 6 | 7 | internal fun SVG.Child.getSVGStrokeWithDefaults(): SVGStroke = SVGStroke( 8 | color = strokeColor?.let { SvgColorParser.parse(it) }, 9 | alpha = strokeAlpha?.toFloat() ?: 1f, 10 | width = strokeWidth?.toFloat() ?: 0f, 11 | cap = strokeLineCap?.let { SVGStroke.Cap(it) } ?: SVGStroke.Cap.Butt, 12 | join = strokeLineJoin?.let { SVGStroke.Join(it) } ?: SVGStroke.Join.Miter, 13 | miter = strokeMiter?.toFloat() ?: 4f, 14 | ) 15 | 16 | internal fun SVGStroke.Cap.toIrStrokeLineCap(): IrStrokeLineCap = when (this) { 17 | SVGStroke.Cap.Butt -> IrStrokeLineCap.Butt 18 | SVGStroke.Cap.Round -> IrStrokeLineCap.Round 19 | SVGStroke.Cap.Square -> IrStrokeLineCap.Square 20 | } 21 | 22 | internal fun SVGStroke.Join.toIrStrokeLineJoin(): IrStrokeLineJoin = when (this) { 23 | SVGStroke.Join.Bevel -> IrStrokeLineJoin.Bevel 24 | SVGStroke.Join.Miter -> IrStrokeLineJoin.Miter 25 | SVGStroke.Join.Round -> IrStrokeLineJoin.Round 26 | } 27 | 28 | internal fun String.getPathFillType(): IrPathFillType = when (this.lowercase()) { 29 | "evenodd" -> IrPathFillType.EvenOdd 30 | else -> IrPathFillType.NonZero 31 | } 32 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/kmp/svg/Translation.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.kmp.svg 2 | 3 | import kotlin.jvm.JvmInline 4 | 5 | @JvmInline 6 | internal value class Translation(private val args: List) { 7 | companion object { 8 | val Default = Translation(listOf(0f, 0f)) 9 | } 10 | 11 | val x get() = args[0] 12 | val y get() = args.getOrElse(1) { 0f } 13 | } 14 | -------------------------------------------------------------------------------- /components/parser/kmp/svg/src/commonTest/kotlin/io/github/composegears/valkyrie/parser/kmp/svg/Utils.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.kmp.svg 2 | 3 | internal fun testSVG( 4 | height: String = "24px", 5 | viewBox: String = "0 0 24 24", 6 | width: String = "24px", 7 | fill: String = "#000000", 8 | children: List, 9 | ) = SVG( 10 | width = width, 11 | height = height, 12 | viewBox = viewBox, 13 | fill = fill, 14 | children = children, 15 | ) 16 | 17 | internal inline fun svg( 18 | width: String = "24px", 19 | height: String = "24px", 20 | viewBox: String? = "0 0 24 24", 21 | fill: String = "#000000", 22 | block: () -> String, 23 | ): String { 24 | return buildString { 25 | // NOTE: The supported SVGs must have the documented namespace: https://www.w3.org/TR/SVG/struct.html#Namespace 26 | appendLine("""""") 31 | appendLine(block()) 32 | appendLine("") 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /components/parser/kmp/xml/api/xml.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/parser/kmp/xml/XmlToImageVectorParser { 2 | public static final field INSTANCE Lio/github/composegears/valkyrie/parser/kmp/xml/XmlToImageVectorParser; 3 | public final fun parse (Ljava/lang/String;)Lio/github/composegears/valkyrie/ir/IrImageVector; 4 | } 5 | 6 | -------------------------------------------------------------------------------- /components/parser/kmp/xml/api/xml.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [wasmJs] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final object io.github.composegears.valkyrie.parser.kmp.xml/XmlToImageVectorParser { // io.github.composegears.valkyrie.parser.kmp.xml/XmlToImageVectorParser|null[0] 10 | final fun parse(kotlin/String): io.github.composegears.valkyrie.ir/IrImageVector // io.github.composegears.valkyrie.parser.kmp.xml/XmlToImageVectorParser.parse|parse(kotlin.String){}[0] 11 | } 12 | -------------------------------------------------------------------------------- /components/parser/kmp/xml/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.kover) 4 | alias(libs.plugins.kotlin.serialization) 5 | } 6 | 7 | kotlin { 8 | sourceSets { 9 | commonMain.dependencies { 10 | implementation(projects.components.ir) 11 | implementation(projects.components.parser.common) 12 | implementation(libs.xmlutil) 13 | } 14 | commonTest { 15 | dependencies { 16 | implementation(libs.assertk) 17 | implementation(libs.kotlin.test) 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /components/parser/kmp/xml/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/kmp/xml/XmlDeserializer.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.kmp.xml 2 | 3 | import kotlinx.serialization.decodeFromString 4 | import kotlinx.serialization.modules.SerializersModule 5 | import kotlinx.serialization.modules.polymorphic 6 | import kotlinx.serialization.modules.subclass 7 | import nl.adaptivity.xmlutil.ExperimentalXmlUtilApi 8 | import nl.adaptivity.xmlutil.serialization.UnknownChildHandler 9 | import nl.adaptivity.xmlutil.serialization.XML 10 | 11 | internal object XmlDeserializer { 12 | private val baseModule = SerializersModule { 13 | polymorphic(VectorDrawable.Child::class) { 14 | subclass(VectorDrawable.Group::class) 15 | subclass(VectorDrawable.Path::class) 16 | } 17 | } 18 | 19 | @OptIn(ExperimentalXmlUtilApi::class) 20 | private val xmlConfig = XML(baseModule) { 21 | autoPolymorphic = true 22 | defaultPolicy { 23 | pedantic = false 24 | repairNamespaces = true 25 | unknownChildHandler = UnknownChildHandler { _, _, _, _, _ -> emptyList() } 26 | } 27 | } 28 | 29 | fun deserialize(content: String): VectorDrawable = xmlConfig.decodeFromString(content) 30 | } 31 | -------------------------------------------------------------------------------- /components/parser/kmp/xml/src/commonTest/kotlin/io/github/composegears/valkyrie/parser/kmp/xml/AndroidColorParserTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.kmp.xml 2 | 3 | import assertk.assertThat 4 | import assertk.assertions.isEqualTo 5 | import io.github.composegears.valkyrie.ir.IrColor 6 | import kotlin.test.Test 7 | 8 | class AndroidColorParserTest { 9 | 10 | @Test 11 | fun `test parsing xml android colors`() { 12 | val colorMap = AndroidColorParser.androidColorsMap 13 | 14 | colorMap.forEach { (colorName, hexValue) -> 15 | val androidColorName = "@android:color/$colorName" 16 | 17 | assertThat(actual = AndroidColorParser.parse(androidColorName)).isEqualTo(IrColor(hexValue)) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /components/parser/unified/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.kover) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(projects.components.ir) 10 | 11 | api(libs.kotlin.io) 12 | } 13 | jvmMain.dependencies { 14 | implementation(projects.components.parser.jvm.svg) 15 | implementation(projects.components.parser.jvm.xml) 16 | implementation(projects.components.parser.kmp.svg) 17 | implementation(projects.components.parser.kmp.xml) 18 | } 19 | jvmTest { 20 | resources.srcDir("$rootDir/components/test/sharedTestResources") 21 | 22 | dependencies { 23 | implementation(projects.components.test.resourceLoader) 24 | 25 | implementation(libs.bundles.test) 26 | } 27 | } 28 | wasmJsMain.dependencies { 29 | implementation(projects.components.parser.kmp.svg) 30 | implementation(projects.components.parser.kmp.xml) 31 | } 32 | commonTest.dependencies { 33 | implementation(libs.assertk) 34 | implementation(libs.kotlin.test) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /components/parser/unified/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/unified/ParserType.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.unified 2 | 3 | enum class ParserType { 4 | Jvm, 5 | Kmp, 6 | } 7 | -------------------------------------------------------------------------------- /components/parser/unified/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/unified/SvgXmlParser.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.unified 2 | 3 | import io.github.composegears.valkyrie.parser.unified.model.IconParserOutput 4 | import kotlinx.io.files.Path 5 | 6 | expect object SvgXmlParser { 7 | 8 | val availableParsers: List 9 | 10 | @Throws(IllegalStateException::class) 11 | fun toIrImageVector( 12 | parser: ParserType, 13 | path: Path, 14 | ): IconParserOutput 15 | 16 | @Throws(IllegalStateException::class) 17 | fun toIrImageVector( 18 | parser: ParserType, 19 | value: String, 20 | iconName: String, 21 | ): IconParserOutput 22 | } 23 | -------------------------------------------------------------------------------- /components/parser/unified/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/unified/ext/Path.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.unified.ext 2 | 3 | import kotlinx.io.files.Path 4 | import kotlinx.io.files.SystemFileSystem 5 | 6 | val Path.extension: String 7 | get() = name.substringAfterLast('.', "") 8 | 9 | internal fun Path.readText(): String { 10 | return SystemFileSystem.source(this).readText() 11 | } 12 | 13 | inline val Path.isSvg: Boolean 14 | get() = extension.isSvgExtension 15 | 16 | inline val Path.isXml: Boolean 17 | get() = extension.isXmlExtension 18 | -------------------------------------------------------------------------------- /components/parser/unified/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/unified/ext/RawSource.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.unified.ext 2 | 3 | import kotlinx.io.RawSource 4 | import kotlinx.io.buffered 5 | import kotlinx.io.readByteArray 6 | 7 | internal fun RawSource.readText() = use { 8 | it.buffered().readByteArray().decodeToString() 9 | } 10 | -------------------------------------------------------------------------------- /components/parser/unified/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/unified/ext/String.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.unified.ext 2 | 3 | import io.github.composegears.valkyrie.parser.unified.model.IconType 4 | 5 | fun String.removePrefix(prefix: CharSequence): String { 6 | if (startsWith(prefix, ignoreCase = true)) { 7 | return substring(prefix.length) 8 | } 9 | return this 10 | } 11 | 12 | fun String.capitalized(): String = replaceFirstChar { 13 | if (it.isLowerCase()) it.titlecase() else it.toString() 14 | } 15 | 16 | inline val String.isSvgExtension: Boolean 17 | get() = equals(other = IconType.SVG.extension, ignoreCase = true) 18 | 19 | inline val String.isXmlExtension: Boolean 20 | get() = equals(other = IconType.XML.extension, ignoreCase = true) 21 | -------------------------------------------------------------------------------- /components/parser/unified/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/unified/model/IconParserOutput.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.unified.model 2 | 3 | import io.github.composegears.valkyrie.ir.IrImageVector 4 | 5 | data class IconParserOutput( 6 | val iconType: IconType, 7 | val irImageVector: IrImageVector, 8 | val iconName: String, 9 | ) 10 | -------------------------------------------------------------------------------- /components/parser/unified/src/commonMain/kotlin/io/github/composegears/valkyrie/parser/unified/model/IconType.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.parser.unified.model 2 | 3 | import io.github.composegears.valkyrie.parser.unified.ext.isSvg 4 | import io.github.composegears.valkyrie.parser.unified.ext.isXml 5 | import kotlinx.io.files.Path 6 | 7 | enum class IconType(val extension: String) { 8 | SVG("svg"), 9 | XML("xml"), 10 | ; 11 | 12 | companion object { 13 | fun from(path: Path): IconType? = when { 14 | path.isSvg -> SVG 15 | path.isXml -> XML 16 | else -> null 17 | } 18 | 19 | fun from(text: String): IconType? = when { 20 | text.isSvg -> SVG 21 | text.isXml -> XML 22 | else -> null 23 | } 24 | } 25 | } 26 | 27 | private val String.isSvg: Boolean 28 | get() = contains(" (Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)V 3 | public final fun component1 ()Ljava/lang/String; 4 | public final fun component2 ()Ljava/lang/String; 5 | public final fun component3 ()Ljava/util/List; 6 | public final fun copy (Ljava/lang/String;Ljava/lang/String;Ljava/util/List;)Lio/github/composegears/valkyrie/psi/iconpack/IconPackInfo; 7 | public static synthetic fun copy$default (Lio/github/composegears/valkyrie/psi/iconpack/IconPackInfo;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ILjava/lang/Object;)Lio/github/composegears/valkyrie/psi/iconpack/IconPackInfo; 8 | public fun equals (Ljava/lang/Object;)Z 9 | public final fun getIconPack ()Ljava/lang/String; 10 | public final fun getNestedPacks ()Ljava/util/List; 11 | public final fun getPackageName ()Ljava/lang/String; 12 | public fun hashCode ()I 13 | public fun toString ()Ljava/lang/String; 14 | } 15 | 16 | public final class io/github/composegears/valkyrie/psi/iconpack/IconPackPsiParser { 17 | public static final field INSTANCE Lio/github/composegears/valkyrie/psi/iconpack/IconPackPsiParser; 18 | public final fun extractIconPack (Ljava/nio/file/Path;Lcom/intellij/openapi/project/Project;)Lio/github/composegears/valkyrie/psi/iconpack/IconPackInfo; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /components/psi/iconpack/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.intellij.platform.gradle.TestFrameworkType 2 | 3 | plugins { 4 | alias(libs.plugins.kotlin.jvm) 5 | alias(libs.plugins.jetbrains.intellij.module) 6 | alias(libs.plugins.kover) 7 | } 8 | 9 | dependencies { 10 | implementation(projects.components.extensions) 11 | 12 | testImplementation(projects.components.test.resourceLoader) 13 | testImplementation(libs.bundles.test) 14 | testRuntimeOnly(libs.junit.launcher) 15 | // https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#junit5-test-framework-refers-to-junit4 16 | testRuntimeOnly(libs.junit4) 17 | 18 | intellijPlatform { 19 | testFramework(TestFrameworkType.Platform) 20 | testFramework(TestFrameworkType.JUnit5) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /components/psi/iconpack/src/test/resources/DataObjectIconPack.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi 2 | 3 | data object DataObjectIconPack 4 | -------------------------------------------------------------------------------- /components/psi/iconpack/src/test/resources/NestedIconPack.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi 2 | 3 | object NestedIconPack { 4 | object Filled 5 | 6 | object Outlined 7 | 8 | object TwoTone 9 | 10 | object Sharp 11 | 12 | object Round 13 | } 14 | -------------------------------------------------------------------------------- /components/psi/iconpack/src/test/resources/SimpleIconPack.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi 2 | 3 | object SimpleIconPack 4 | -------------------------------------------------------------------------------- /components/psi/imagevector/api/imagevector.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/psi/imagevector/ImageVectorPsiParser { 2 | public static final field $stable I 3 | public static final field INSTANCE Lio/github/composegears/valkyrie/psi/imagevector/ImageVectorPsiParser; 4 | public final fun parseToIrImageVector (Lorg/jetbrains/kotlin/psi/KtFile;)Lio/github/composegears/valkyrie/ir/IrImageVector; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /components/psi/imagevector/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.intellij.platform.gradle.TestFrameworkType 2 | 3 | plugins { 4 | alias(libs.plugins.kotlin.jvm) 5 | alias(libs.plugins.valkyrie.compose) 6 | alias(libs.plugins.jetbrains.intellij.module) 7 | alias(libs.plugins.kover) 8 | } 9 | 10 | sourceSets { 11 | test { 12 | resources.srcDir("$rootDir/components/test/sharedTestResources") 13 | } 14 | } 15 | 16 | configurations { 17 | testImplementation { 18 | exclude(group = "org.jetbrains.kotlinx") 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation(projects.components.extensions) 24 | implementation(projects.components.ir) 25 | 26 | compileOnly(compose.runtime) 27 | 28 | testImplementation(compose.ui) 29 | testImplementation(projects.components.irCompose) 30 | testImplementation(projects.components.test.resourceLoader) 31 | testImplementation(libs.bundles.test) 32 | testRuntimeOnly(libs.junit.launcher) 33 | 34 | // https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#junit5-test-framework-refers-to-junit4 35 | testRuntimeOnly(libs.junit4) 36 | 37 | intellijPlatform { 38 | testFramework(TestFrameworkType.Platform) 39 | testFramework(TestFrameworkType.JUnit5) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/main/kotlin/io/github/composegears/valkyrie/psi/extension/PsiElement.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.extension 2 | 3 | import com.intellij.psi.PsiElement 4 | import com.intellij.psi.util.PsiTreeUtil 5 | 6 | inline fun PsiElement.childrenOfType(): Collection { 7 | return PsiTreeUtil.findChildrenOfType(this, T::class.java) 8 | } 9 | 10 | inline fun PsiElement.childOfType(): T? { 11 | return PsiTreeUtil.findChildOfType(this, T::class.java) 12 | } 13 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/main/kotlin/io/github/composegears/valkyrie/psi/imagevector/ImageVectorPsiParser.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector 2 | 3 | import io.github.composegears.valkyrie.ir.IrImageVector 4 | import io.github.composegears.valkyrie.psi.imagevector.parser.MaterialImageVectorPsiParser 5 | import io.github.composegears.valkyrie.psi.imagevector.parser.RegularImageVectorPsiParser 6 | import org.jetbrains.kotlin.psi.KtFile 7 | import org.jetbrains.kotlin.psi.KtImportList 8 | 9 | object ImageVectorPsiParser { 10 | 11 | fun parseToIrImageVector(ktFile: KtFile): IrImageVector? { 12 | val isMaterial = ktFile.importList?.isMaterial() ?: return null 13 | 14 | return when { 15 | isMaterial -> MaterialImageVectorPsiParser.parse(ktFile) 16 | else -> RegularImageVectorPsiParser.parse(ktFile) 17 | } 18 | } 19 | 20 | private fun KtImportList.isMaterial(): Boolean { 21 | return imports.any { 22 | val fqName = it.importedFqName 23 | 24 | fqName?.asString() == "androidx.compose.material.icons.materialPath" || 25 | fqName?.asString() == "androidx.compose.material.icons.materialFilled" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/psi/imagevector/common/KtFile.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector.common 2 | 3 | import com.intellij.openapi.project.Project 4 | import com.intellij.psi.PsiManager 5 | import com.intellij.testFramework.LightVirtualFile 6 | import io.github.composegears.valkyrie.extensions.cast 7 | import io.github.composegears.valkyrie.resource.loader.ResourceLoader.getResourceText 8 | import org.jetbrains.kotlin.idea.KotlinFileType 9 | import org.jetbrains.kotlin.psi.KtFile 10 | 11 | fun Project.createKtFile(from: String): KtFile { 12 | return PsiManager.getInstance(this) 13 | .findFile(LightVirtualFile("", KotlinFileType.INSTANCE, getResourceText(from))) 14 | .cast() 15 | } 16 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/psi/imagevector/common/ParseType.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector.common 2 | 3 | import com.intellij.openapi.project.Project 4 | import org.jetbrains.kotlin.psi.KtFile 5 | 6 | enum class ParseType { 7 | Lazy, 8 | Backing, 9 | } 10 | 11 | fun ParseType.toKtFile( 12 | project: Project, 13 | pathToLazy: String, 14 | pathToBacking: String, 15 | ): KtFile = when (this) { 16 | ParseType.Lazy -> project.createKtFile(pathToLazy) 17 | ParseType.Backing -> project.createKtFile(pathToBacking) 18 | } 19 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/psi/imagevector/expected/EmptyImageVector.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector.expected 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ExpectedEmptyImageVector = ImageVector.Builder( 7 | name = "EmptyImageVector", 8 | defaultWidth = 24.dp, 9 | defaultHeight = 24.dp, 10 | viewportWidth = 18f, 11 | viewportHeight = 18f, 12 | ).build() 13 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/psi/imagevector/expected/EmptyPaths.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector.expected 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.graphics.vector.path 5 | import androidx.compose.ui.unit.dp 6 | 7 | val ExpectedEmptyPaths = ImageVector.Builder( 8 | name = "EmptyPaths", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f, 13 | ).apply { 14 | path { } 15 | path { } 16 | path { } 17 | }.build() 18 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/psi/imagevector/expected/IconWithGroup.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector.expected 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | import androidx.compose.ui.graphics.vector.group 7 | import androidx.compose.ui.graphics.vector.path 8 | import androidx.compose.ui.unit.dp 9 | 10 | val ExpectedIconWithGroup = ImageVector.Builder( 11 | name = "IconWithGroup", 12 | defaultWidth = 48.dp, 13 | defaultHeight = 48.dp, 14 | viewportWidth = 512f, 15 | viewportHeight = 512f, 16 | ).apply { 17 | group { 18 | path(fill = SolidColor(Color(0xFFD80027))) { 19 | moveTo(0f, 0f) 20 | horizontalLineToRelative(512f) 21 | verticalLineToRelative(167f) 22 | lineToRelative(-23.2f, 89.7f) 23 | lineTo(512f, 345f) 24 | verticalLineToRelative(167f) 25 | horizontalLineTo(0f) 26 | verticalLineTo(345f) 27 | lineToRelative(29.4f, -89f) 28 | lineTo(0f, 167f) 29 | close() 30 | } 31 | path(fill = SolidColor(Color(0xFFEEEEEE))) { 32 | moveTo(0f, 167f) 33 | horizontalLineToRelative(512f) 34 | verticalLineToRelative(178f) 35 | horizontalLineTo(0f) 36 | close() 37 | } 38 | } 39 | }.build() 40 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/psi/imagevector/expected/MaterialIcon.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector.expected 2 | 3 | import androidx.compose.material.icons.materialIcon 4 | import androidx.compose.material.icons.materialPath 5 | import androidx.compose.ui.graphics.PathFillType 6 | 7 | val ExpectedMaterialIcon = materialIcon(name = "Filled.Settings", autoMirror = true) { 8 | materialPath( 9 | fillAlpha = 0.5f, 10 | strokeAlpha = 0.6f, 11 | pathFillType = PathFillType.EvenOdd, 12 | ) { 13 | moveTo(19.14f, 12.94f) 14 | close() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/psi/imagevector/expected/RadialGradient.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector.expected 2 | 3 | import androidx.compose.ui.geometry.Offset 4 | import androidx.compose.ui.graphics.Brush 5 | import androidx.compose.ui.graphics.Color 6 | import androidx.compose.ui.graphics.vector.ImageVector 7 | import androidx.compose.ui.graphics.vector.path 8 | import androidx.compose.ui.unit.dp 9 | 10 | val ExpectedRadialGradient = ImageVector.Builder( 11 | name = "RadialGradient", 12 | defaultWidth = 100.dp, 13 | defaultHeight = 20.dp, 14 | viewportWidth = 100f, 15 | viewportHeight = 20f, 16 | ).apply { 17 | path( 18 | fill = Brush.radialGradient( 19 | colorStops = arrayOf( 20 | 0.19f to Color(0xFFD53A42), 21 | 0.39f to Color(0xFFDF7A40), 22 | 0.59f to Color(0xFFF0A941), 23 | 1f to Color(0xFFFFFFF0), 24 | ), 25 | center = Offset(0f, 10f), 26 | radius = 100f, 27 | ), 28 | ) { 29 | moveTo(0f, 0f) 30 | horizontalLineToRelative(100f) 31 | verticalLineToRelative(20f) 32 | horizontalLineToRelative(-100f) 33 | close() 34 | } 35 | }.build() 36 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/kotlin/io/github/composegears/valkyrie/psi/imagevector/expected/SinglePath.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.psi.imagevector.expected 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | import androidx.compose.ui.graphics.vector.path 7 | import androidx.compose.ui.unit.dp 8 | 9 | val ExpectedSinglePath = ImageVector.Builder( 10 | name = "SinglePath", 11 | defaultWidth = 24.dp, 12 | defaultHeight = 24.dp, 13 | viewportWidth = 24f, 14 | viewportHeight = 24f, 15 | ).apply { 16 | path(fill = SolidColor(Color(0xFF232F34))) { 17 | moveTo(19f, 13f) 18 | lineTo(13f, 13f) 19 | lineTo(13f, 19f) 20 | lineTo(11f, 19f) 21 | lineTo(11f, 13f) 22 | lineTo(5f, 13f) 23 | lineTo(5f, 11f) 24 | lineTo(11f, 11f) 25 | lineTo(11f, 5f) 26 | lineTo(13f, 5f) 27 | lineTo(13f, 11f) 28 | lineTo(19f, 11f) 29 | lineTo(19f, 13f) 30 | close() 31 | } 32 | }.build() 33 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/resources/backing/EmptyImageVector.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ValkyrieIcons.EmptyImageVector: ImageVector 7 | get() { 8 | if (_EmptyImageVector != null) { 9 | return _EmptyImageVector!! 10 | } 11 | _EmptyImageVector = ImageVector.Builder( 12 | name = "EmptyImageVector", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f, 17 | ).build() 18 | 19 | return _EmptyImageVector!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _EmptyImageVector: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/resources/backing/EmptyPaths.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.graphics.vector.path 5 | import androidx.compose.ui.unit.dp 6 | 7 | val ValkyrieIcons.EmptyPaths: ImageVector 8 | get() { 9 | if (_EmptyPaths != null) { 10 | return _EmptyPaths!! 11 | } 12 | _EmptyPaths = ImageVector.Builder( 13 | name = "EmptyPaths", 14 | defaultWidth = 24.0.dp, 15 | defaultHeight = 24.0.dp, 16 | viewportWidth = 18.0f, 17 | viewportHeight = 18.0f 18 | ).apply { 19 | path { } 20 | path { } 21 | path { } 22 | }.build() 23 | 24 | return _EmptyPaths!! 25 | } 26 | 27 | @Suppress("ObjectPropertyName") 28 | private var _EmptyPaths: ImageVector? = null 29 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/resources/backing/MaterialIcon.kt: -------------------------------------------------------------------------------- 1 | package androidx.compose.material.icons.filled 2 | 3 | import androidx.compose.material.icons.Icons 4 | import androidx.compose.material.icons.materialIcon 5 | import androidx.compose.material.icons.materialPath 6 | import androidx.compose.ui.graphics.PathFillType 7 | import androidx.compose.ui.graphics.vector.ImageVector 8 | 9 | public val Icons.Filled.Settings: ImageVector 10 | get() { 11 | if (_settings != null) { 12 | return _settings!! 13 | } 14 | _settings = materialIcon(name = "Filled.Settings", autoMirror = true) { 15 | materialPath( 16 | fillAlpha = 0.5f, 17 | strokeAlpha = 0.6f, 18 | pathFillType = PathFillType.EvenOdd 19 | ) { 20 | moveTo(19.14f, 12.94f) 21 | close() 22 | } 23 | } 24 | return _settings!! 25 | } 26 | 27 | private var _settings: ImageVector? = null 28 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/resources/backing/SinglePath.kt: -------------------------------------------------------------------------------- 1 | import androidx.compose.ui.graphics.Color 2 | import androidx.compose.ui.graphics.SolidColor 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.graphics.vector.path 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Outlined.SinglePath: ImageVector 8 | get() { 9 | if (_SinglePath != null) { 10 | return _SinglePath!! 11 | } 12 | _SinglePath = ImageVector.Builder( 13 | name = "SinglePath", 14 | defaultWidth = 24.dp, 15 | defaultHeight = 24.dp, 16 | viewportWidth = 24f, 17 | viewportHeight = 24f, 18 | ).apply { 19 | path(fill = SolidColor(Color(0xFF232F34))) { 20 | moveTo(19f, 13f) 21 | lineTo(13f, 13f) 22 | lineTo(13f, 19f) 23 | lineTo(11f, 19f) 24 | lineTo(11f, 13f) 25 | lineTo(5f, 13f) 26 | lineTo(5f, 11f) 27 | lineTo(11f, 11f) 28 | lineTo(11f, 5f) 29 | lineTo(13f, 5f) 30 | lineTo(13f, 11f) 31 | lineTo(19f, 11f) 32 | lineTo(19f, 13f) 33 | close() 34 | } 35 | }.build() 36 | 37 | return _SinglePath!! 38 | 39 | } 40 | 41 | @Suppress("ObjectPropertyName") 42 | private var _SinglePath: ImageVector? = null 43 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/resources/lazy/EmptyImageVector.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ValkyrieIcons.EmptyImageVector: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "EmptyImageVector", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f, 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/resources/lazy/EmptyPaths.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.graphics.vector.path 5 | import androidx.compose.ui.unit.dp 6 | 7 | val ValkyrieIcons.EmptyPaths: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 8 | ImageVector.Builder( 9 | name = "EmptyPaths", 10 | defaultWidth = 24.0.dp, 11 | defaultHeight = 24.0.dp, 12 | viewportWidth = 18.0f, 13 | viewportHeight = 18.0f, 14 | ).apply { 15 | path { } 16 | path { } 17 | path { } 18 | }.build() 19 | } 20 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/resources/lazy/IconWithGroup.kt: -------------------------------------------------------------------------------- 1 | import androidx.compose.ui.graphics.vector.ImageVector 2 | import androidx.compose.ui.unit.dp 3 | import androidx.compose.ui.graphics.vector.group 4 | import androidx.compose.ui.graphics.vector.path 5 | 6 | val ValkyrieIcons.IconWithGroup: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "IconWithGroup", 9 | defaultWidth = 48.dp, 10 | defaultHeight = 48.dp, 11 | viewportWidth = 512f, 12 | viewportHeight = 512f, 13 | ).apply { 14 | group { 15 | path(fill = SolidColor(Color(0xFFD80027))) { 16 | moveTo(0f, 0f) 17 | horizontalLineToRelative(512f) 18 | verticalLineToRelative(167f) 19 | lineToRelative(-23.2f, 89.7f) 20 | lineTo(512f, 345f) 21 | verticalLineToRelative(167f) 22 | horizontalLineTo(0f) 23 | verticalLineTo(345f) 24 | lineToRelative(29.4f, -89f) 25 | lineTo(0f, 167f) 26 | close() 27 | } 28 | path(fill = SolidColor(Color(0xFFEEEEEE))) { 29 | moveTo(0f, 167f) 30 | horizontalLineToRelative(512f) 31 | verticalLineToRelative(178f) 32 | horizontalLineTo(0f) 33 | close() 34 | } 35 | } 36 | }.build() 37 | } 38 | -------------------------------------------------------------------------------- /components/psi/imagevector/src/test/resources/lazy/SinglePath.kt: -------------------------------------------------------------------------------- 1 | import androidx.compose.ui.graphics.Color 2 | import androidx.compose.ui.graphics.SolidColor 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.graphics.vector.path 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Outlined.SinglePath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 8 | ImageVector.Builder( 9 | name = "SinglePath", 10 | defaultWidth = 24.dp, 11 | defaultHeight = 24.dp, 12 | viewportWidth = 24f, 13 | viewportHeight = 24f 14 | ).apply { 15 | path(fill = SolidColor(Color(0xFF232F34))) { 16 | moveTo(19f, 13f) 17 | lineTo(13f, 13f) 18 | lineTo(13f, 19f) 19 | lineTo(11f, 19f) 20 | lineTo(11f, 13f) 21 | lineTo(5f, 13f) 22 | lineTo(5f, 11f) 23 | lineTo(11f, 11f) 24 | lineTo(11f, 5f) 25 | lineTo(13f, 5f) 26 | lineTo(13f, 11f) 27 | lineTo(19f, 11f) 28 | lineTo(19f, 13f) 29 | close() 30 | } 31 | }.build() 32 | } 33 | -------------------------------------------------------------------------------- /components/test/coverage/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.kover) 3 | } 4 | 5 | dependencies { 6 | // include only necessary dependencies for the test coverage 7 | kover(projects.tools.cli) 8 | kover(projects.components.generator.core) 9 | kover(projects.components.generator.jvm.poetExtensions) 10 | kover(projects.components.generator.iconpack) 11 | kover(projects.components.generator.jvm.imagevector) 12 | kover(projects.components.ir) 13 | kover(projects.components.parser.common) 14 | kover(projects.components.parser.jvm.svg) 15 | kover(projects.components.parser.jvm.xml) 16 | kover(projects.components.parser.kmp.xml) 17 | kover(projects.components.parser.unified) 18 | kover(projects.components.psi.iconpack) 19 | kover(projects.components.psi.imagevector) 20 | } 21 | -------------------------------------------------------------------------------- /components/test/resource-loader/api/resource-loader.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/resource/loader/ResourceLoader { 2 | public static final field INSTANCE Lio/github/composegears/valkyrie/resource/loader/ResourceLoader; 3 | public final fun getResourcePath (Ljava/lang/String;)Ljava/nio/file/Path; 4 | public final fun getResourceText (Ljava/lang/String;)Ljava/lang/String; 5 | } 6 | 7 | -------------------------------------------------------------------------------- /components/test/resource-loader/api/resource-loader.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [wasmJs] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final object io.github.composegears.valkyrie.resource.loader/ResourceLoader { // io.github.composegears.valkyrie.resource.loader/ResourceLoader|null[0] 10 | final fun getResourceText(kotlin/String): kotlin/String // io.github.composegears.valkyrie.resource.loader/ResourceLoader.getResourceText|getResourceText(kotlin.String){}[0] 11 | } 12 | -------------------------------------------------------------------------------- /components/test/resource-loader/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | } 4 | 5 | kotlin { 6 | sourceSets { 7 | wasmJsMain.dependencies { 8 | implementation(libs.kotlinx.browser) 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /components/test/resource-loader/src/commonMain/kotlin/io/github/composegears/valkyrie/resource/loader/ResourceLoader.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.resource.loader 2 | 3 | expect object ResourceLoader { 4 | 5 | fun getResourceText(name: String): String 6 | } 7 | -------------------------------------------------------------------------------- /components/test/resource-loader/src/jvmMain/kotlin/io/github/composegears/valkyrie/resource/loader/ResourceLoader.jvm.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.resource.loader 2 | 3 | import java.nio.file.Path 4 | import kotlin.io.path.readText 5 | import kotlin.io.path.toPath 6 | 7 | actual object ResourceLoader { 8 | actual fun getResourceText(name: String): String = getResourcePath(name).readText().replace(System.lineSeparator(), "\n") 9 | 10 | fun getResourcePath(name: String): Path { 11 | val resource = ResourceLoader::class.java.classLoader.getResource(name) ?: error("Resource $name not found") 12 | return resource.toURI().toPath() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /components/test/resource-loader/src/wasmJsMain/kotlin/io/github/composegears/valkyrie/resource/loader/ResourceLoader.wasmJs.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.resource.loader 2 | 3 | import org.w3c.xhr.XMLHttpRequest 4 | 5 | actual object ResourceLoader { 6 | 7 | actual fun getResourceText(name: String): String { 8 | val request = request(name) 9 | 10 | return when (request.status) { 11 | in 200..299 -> request.responseText 12 | else -> error("Resource $name not found") 13 | } 14 | } 15 | 16 | private fun request(path: String) = XMLHttpRequest().apply { 17 | open("GET", path, false) 18 | send() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.explicit.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | public object ValkyrieIcons 4 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | object ValkyrieIcons 4 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.nested.L2.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | object ValkyrieIcons { 4 | object Filled 5 | 6 | object Colored 7 | } 8 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.nested.L3.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | object ValkyrieIcons { 4 | object Rounded { 5 | object Filled 6 | } 7 | 8 | object Sharp { 9 | object Colored 10 | 11 | object Dark 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.nested.L4.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | object ValkyrieIcons { 4 | object Material { 5 | object Rounded { 6 | object Filled 7 | 8 | object Outlined 9 | } 10 | } 11 | 12 | object Custom { 13 | object Brand 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.nested.explicit.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | public object ValkyrieIcons { 4 | public object Filled 5 | 6 | public object Colored 7 | } 8 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.nested.indent1.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | object ValkyrieIcons { 4 | object Filled 5 | 6 | object Colored 7 | } 8 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.nested.indent2.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | object ValkyrieIcons { 4 | object Filled 5 | 6 | object Colored 7 | } 8 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.nested.indent3.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | object ValkyrieIcons { 4 | object Filled 5 | 6 | object Colored 7 | } 8 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/iconpack/IconPack.nested.indent6.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | object ValkyrieIcons { 4 | object Filled 5 | 6 | object Colored 7 | } 8 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/broken.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/FillColorStroke.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | import androidx.compose.ui.graphics.vector.path 7 | import androidx.compose.ui.unit.dp 8 | 9 | val ValkyrieIcons.FillColorStroke: ImageVector 10 | get() { 11 | if (_FillColorStroke != null) { 12 | return _FillColorStroke!! 13 | } 14 | _FillColorStroke = ImageVector.Builder( 15 | name = "FillColorStroke", 16 | defaultWidth = 24.dp, 17 | defaultHeight = 24.dp, 18 | viewportWidth = 18f, 19 | viewportHeight = 18f 20 | ).apply { 21 | path( 22 | fill = SolidColor(Color(0xFF232F34)), 23 | strokeLineWidth = 1f 24 | ) { 25 | moveTo(6.75f, 12.127f) 26 | lineTo(3.623f, 9f) 27 | lineTo(2.558f, 10.057f) 28 | lineTo(6.75f, 14.25f) 29 | lineTo(15.75f, 5.25f) 30 | lineTo(14.693f, 4.192f) 31 | lineTo(6.75f, 12.127f) 32 | close() 33 | } 34 | }.build() 35 | 36 | return _FillColorStroke!! 37 | } 38 | 39 | @Suppress("ObjectPropertyName") 40 | private var _FillColorStroke: ImageVector? = null 41 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/FillColorStroke.trailing.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | import androidx.compose.ui.graphics.vector.path 7 | import androidx.compose.ui.unit.dp 8 | 9 | val ValkyrieIcons.FillColorStroke: ImageVector 10 | get() { 11 | if (_FillColorStroke != null) { 12 | return _FillColorStroke!! 13 | } 14 | _FillColorStroke = ImageVector.Builder( 15 | name = "FillColorStroke", 16 | defaultWidth = 24.dp, 17 | defaultHeight = 24.dp, 18 | viewportWidth = 18f, 19 | viewportHeight = 18f, 20 | ).apply { 21 | path( 22 | fill = SolidColor(Color(0xFF232F34)), 23 | strokeLineWidth = 1f, 24 | ) { 25 | moveTo(6.75f, 12.127f) 26 | lineTo(3.623f, 9f) 27 | lineTo(2.558f, 10.057f) 28 | lineTo(6.75f, 14.25f) 29 | lineTo(15.75f, 5.25f) 30 | lineTo(14.693f, 4.192f) 31 | lineTo(6.75f, 12.127f) 32 | close() 33 | } 34 | }.build() 35 | 36 | return _FillColorStroke!! 37 | } 38 | 39 | @Suppress("ObjectPropertyName") 40 | private var _FillColorStroke: ImageVector? = null 41 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/FlatPackage.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val FlatPackage: ImageVector 7 | get() { 8 | if (_FlatPackage != null) { 9 | return _FlatPackage!! 10 | } 11 | _FlatPackage = ImageVector.Builder( 12 | name = "FlatPackage", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _FlatPackage!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _FlatPackage: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/FlatPackage.pack.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ValkyrieIcons.FlatPackage: ImageVector 7 | get() { 8 | if (_FlatPackage != null) { 9 | return _FlatPackage!! 10 | } 11 | _FlatPackage = ImageVector.Builder( 12 | name = "FlatPackage", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _FlatPackage!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _FlatPackage: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/FlatPackage.pack.nested.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ValkyrieIcons.Filled.FlatPackage: ImageVector 7 | get() { 8 | if (_FlatPackage != null) { 9 | return _FlatPackage!! 10 | } 11 | _FlatPackage = ImageVector.Builder( 12 | name = "Filled.FlatPackage", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _FlatPackage!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _FlatPackage: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/OnlyPath.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.graphics.vector.path 5 | import androidx.compose.ui.unit.dp 6 | 7 | val ValkyrieIcons.OnlyPath: ImageVector 8 | get() { 9 | if (_OnlyPath != null) { 10 | return _OnlyPath!! 11 | } 12 | _OnlyPath = ImageVector.Builder( 13 | name = "OnlyPath", 14 | defaultWidth = 24.dp, 15 | defaultHeight = 24.dp, 16 | viewportWidth = 18f, 17 | viewportHeight = 18f 18 | ).apply { 19 | path { 20 | moveTo(6.75f, 12.127f) 21 | lineTo(3.623f, 9f) 22 | lineTo(2.558f, 10.057f) 23 | lineTo(6.75f, 14.25f) 24 | lineTo(15.75f, 5.25f) 25 | lineTo(14.693f, 4.192f) 26 | lineTo(6.75f, 12.127f) 27 | close() 28 | } 29 | }.build() 30 | 31 | return _OnlyPath!! 32 | } 33 | 34 | @Suppress("ObjectPropertyName") 35 | private var _OnlyPath: ImageVector? = null 36 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.explicit.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | public val WithoutPath: ImageVector 7 | get() { 8 | if (_WithoutPath != null) { 9 | return _WithoutPath!! 10 | } 11 | _WithoutPath = ImageVector.Builder( 12 | name = "WithoutPath", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _WithoutPath!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _WithoutPath: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.indent1.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector 7 | get() { 8 | if (_WithoutPath != null) { 9 | return _WithoutPath!! 10 | } 11 | _WithoutPath = ImageVector.Builder( 12 | name = "WithoutPath", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _WithoutPath!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _WithoutPath: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.indent2.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector 7 | get() { 8 | if (_WithoutPath != null) { 9 | return _WithoutPath!! 10 | } 11 | _WithoutPath = ImageVector.Builder( 12 | name = "WithoutPath", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _WithoutPath!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _WithoutPath: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.indent3.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector 7 | get() { 8 | if (_WithoutPath != null) { 9 | return _WithoutPath!! 10 | } 11 | _WithoutPath = ImageVector.Builder( 12 | name = "WithoutPath", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _WithoutPath!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _WithoutPath: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.indent6.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector 7 | get() { 8 | if (_WithoutPath != null) { 9 | return _WithoutPath!! 10 | } 11 | _WithoutPath = ImageVector.Builder( 12 | name = "WithoutPath", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _WithoutPath!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _WithoutPath: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector 7 | get() { 8 | if (_WithoutPath != null) { 9 | return _WithoutPath!! 10 | } 11 | _WithoutPath = ImageVector.Builder( 12 | name = "WithoutPath", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _WithoutPath!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _WithoutPath: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.pack.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ValkyrieIcons.WithoutPath: ImageVector 7 | get() { 8 | if (_WithoutPath != null) { 9 | return _WithoutPath!! 10 | } 11 | _WithoutPath = ImageVector.Builder( 12 | name = "WithoutPath", 13 | defaultWidth = 24.dp, 14 | defaultHeight = 24.dp, 15 | viewportWidth = 18f, 16 | viewportHeight = 18f 17 | ).build() 18 | 19 | return _WithoutPath!! 20 | } 21 | 22 | @Suppress("ObjectPropertyName") 23 | private var _WithoutPath: ImageVector? = null 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.pack.nested.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons.colored 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | import io.github.composegears.valkyrie.icons.ValkyrieIcons 6 | 7 | val ValkyrieIcons.Colored.WithoutPath: ImageVector 8 | get() { 9 | if (_WithoutPath != null) { 10 | return _WithoutPath!! 11 | } 12 | _WithoutPath = ImageVector.Builder( 13 | name = "Colored.WithoutPath", 14 | defaultWidth = 24.dp, 15 | defaultHeight = 24.dp, 16 | viewportWidth = 18f, 17 | viewportHeight = 18f 18 | ).build() 19 | 20 | return _WithoutPath!! 21 | } 22 | 23 | @Suppress("ObjectPropertyName") 24 | private var _WithoutPath: ImageVector? = null 25 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.pack.nested.preview.androidx.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons.filled 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.layout.Box 5 | import androidx.compose.foundation.layout.padding 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Modifier 8 | import androidx.compose.ui.graphics.vector.ImageVector 9 | import androidx.compose.ui.tooling.preview.Preview 10 | import androidx.compose.ui.unit.dp 11 | import io.github.composegears.valkyrie.icons.ValkyrieIcons 12 | 13 | val ValkyrieIcons.Filled.WithoutPath: ImageVector 14 | get() { 15 | if (_WithoutPath != null) { 16 | return _WithoutPath!! 17 | } 18 | _WithoutPath = ImageVector.Builder( 19 | name = "Filled.WithoutPath", 20 | defaultWidth = 24.dp, 21 | defaultHeight = 24.dp, 22 | viewportWidth = 18f, 23 | viewportHeight = 18f 24 | ).build() 25 | 26 | return _WithoutPath!! 27 | } 28 | 29 | @Suppress("ObjectPropertyName") 30 | private var _WithoutPath: ImageVector? = null 31 | 32 | @Preview 33 | @Composable 34 | private fun WithoutPathPreview() { 35 | Box(modifier = Modifier.padding(12.dp)) { 36 | Image(imageVector = ValkyrieIcons.Filled.WithoutPath, contentDescription = null) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.pack.nested.preview.jetbrains.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons.filled 2 | 3 | import androidx.compose.desktop.ui.tooling.preview.Preview 4 | import androidx.compose.foundation.Image 5 | import androidx.compose.foundation.layout.Box 6 | import androidx.compose.foundation.layout.padding 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.ui.Modifier 9 | import androidx.compose.ui.graphics.vector.ImageVector 10 | import androidx.compose.ui.unit.dp 11 | import io.github.composegears.valkyrie.icons.ValkyrieIcons 12 | 13 | val ValkyrieIcons.Filled.WithoutPath: ImageVector 14 | get() { 15 | if (_WithoutPath != null) { 16 | return _WithoutPath!! 17 | } 18 | _WithoutPath = ImageVector.Builder( 19 | name = "Filled.WithoutPath", 20 | defaultWidth = 24.dp, 21 | defaultHeight = 24.dp, 22 | viewportWidth = 18f, 23 | viewportHeight = 18f 24 | ).build() 25 | 26 | return _WithoutPath!! 27 | } 28 | 29 | @Suppress("ObjectPropertyName") 30 | private var _WithoutPath: ImageVector? = null 31 | 32 | @Preview 33 | @Composable 34 | private fun WithoutPathPreview() { 35 | Box(modifier = Modifier.padding(12.dp)) { 36 | Image(imageVector = ValkyrieIcons.Filled.WithoutPath, contentDescription = null) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.pack.package.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.material.icons.Icons 4 | import androidx.compose.ui.graphics.vector.ImageVector 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Icons.Filled.WithoutPath: ImageVector 8 | get() { 9 | if (_WithoutPath != null) { 10 | return _WithoutPath!! 11 | } 12 | _WithoutPath = ImageVector.Builder( 13 | name = "Filled.WithoutPath", 14 | defaultWidth = 24.dp, 15 | defaultHeight = 24.dp, 16 | viewportWidth = 18f, 17 | viewportHeight = 18f 18 | ).build() 19 | 20 | return _WithoutPath!! 21 | } 22 | 23 | @Suppress("ObjectPropertyName") 24 | private var _WithoutPath: ImageVector? = null 25 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.pack.preview.androidx.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.layout.Box 5 | import androidx.compose.foundation.layout.padding 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Modifier 8 | import androidx.compose.ui.graphics.vector.ImageVector 9 | import androidx.compose.ui.tooling.preview.Preview 10 | import androidx.compose.ui.unit.dp 11 | 12 | val ValkyrieIcons.WithoutPath: ImageVector 13 | get() { 14 | if (_WithoutPath != null) { 15 | return _WithoutPath!! 16 | } 17 | _WithoutPath = ImageVector.Builder( 18 | name = "WithoutPath", 19 | defaultWidth = 24.dp, 20 | defaultHeight = 24.dp, 21 | viewportWidth = 18f, 22 | viewportHeight = 18f 23 | ).build() 24 | 25 | return _WithoutPath!! 26 | } 27 | 28 | @Suppress("ObjectPropertyName") 29 | private var _WithoutPath: ImageVector? = null 30 | 31 | @Preview 32 | @Composable 33 | private fun WithoutPathPreview() { 34 | Box(modifier = Modifier.padding(12.dp)) { 35 | Image(imageVector = ValkyrieIcons.WithoutPath, contentDescription = null) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.pack.preview.jetbrains.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.desktop.ui.tooling.preview.Preview 4 | import androidx.compose.foundation.Image 5 | import androidx.compose.foundation.layout.Box 6 | import androidx.compose.foundation.layout.padding 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.ui.Modifier 9 | import androidx.compose.ui.graphics.vector.ImageVector 10 | import androidx.compose.ui.unit.dp 11 | 12 | val ValkyrieIcons.WithoutPath: ImageVector 13 | get() { 14 | if (_WithoutPath != null) { 15 | return _WithoutPath!! 16 | } 17 | _WithoutPath = ImageVector.Builder( 18 | name = "WithoutPath", 19 | defaultWidth = 24.dp, 20 | defaultHeight = 24.dp, 21 | viewportWidth = 18f, 22 | viewportHeight = 18f 23 | ).build() 24 | 25 | return _WithoutPath!! 26 | } 27 | 28 | @Suppress("ObjectPropertyName") 29 | private var _WithoutPath: ImageVector? = null 30 | 31 | @Preview 32 | @Composable 33 | private fun WithoutPathPreview() { 34 | Box(modifier = Modifier.padding(12.dp)) { 35 | Image(imageVector = ValkyrieIcons.WithoutPath, contentDescription = null) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.preview.androidx.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.layout.Box 5 | import androidx.compose.foundation.layout.padding 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Modifier 8 | import androidx.compose.ui.graphics.vector.ImageVector 9 | import androidx.compose.ui.tooling.preview.Preview 10 | import androidx.compose.ui.unit.dp 11 | 12 | val WithoutPath: ImageVector 13 | get() { 14 | if (_WithoutPath != null) { 15 | return _WithoutPath!! 16 | } 17 | _WithoutPath = ImageVector.Builder( 18 | name = "WithoutPath", 19 | defaultWidth = 24.dp, 20 | defaultHeight = 24.dp, 21 | viewportWidth = 18f, 22 | viewportHeight = 18f 23 | ).build() 24 | 25 | return _WithoutPath!! 26 | } 27 | 28 | @Suppress("ObjectPropertyName") 29 | private var _WithoutPath: ImageVector? = null 30 | 31 | @Preview 32 | @Composable 33 | private fun WithoutPathPreview() { 34 | Box(modifier = Modifier.padding(12.dp)) { 35 | Image(imageVector = WithoutPath, contentDescription = null) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/backing/WithoutPath.preview.jetbrains.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.desktop.ui.tooling.preview.Preview 4 | import androidx.compose.foundation.Image 5 | import androidx.compose.foundation.layout.Box 6 | import androidx.compose.foundation.layout.padding 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.ui.Modifier 9 | import androidx.compose.ui.graphics.vector.ImageVector 10 | import androidx.compose.ui.unit.dp 11 | 12 | val WithoutPath: ImageVector 13 | get() { 14 | if (_WithoutPath != null) { 15 | return _WithoutPath!! 16 | } 17 | _WithoutPath = ImageVector.Builder( 18 | name = "WithoutPath", 19 | defaultWidth = 24.dp, 20 | defaultHeight = 24.dp, 21 | viewportWidth = 18f, 22 | viewportHeight = 18f 23 | ).build() 24 | 25 | return _WithoutPath!! 26 | } 27 | 28 | @Suppress("ObjectPropertyName") 29 | private var _WithoutPath: ImageVector? = null 30 | 31 | @Preview 32 | @Composable 33 | private fun WithoutPathPreview() { 34 | Box(modifier = Modifier.padding(12.dp)) { 35 | Image(imageVector = WithoutPath, contentDescription = null) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/FillColorStroke.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | import androidx.compose.ui.graphics.vector.path 7 | import androidx.compose.ui.unit.dp 8 | 9 | val ValkyrieIcons.FillColorStroke: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 10 | ImageVector.Builder( 11 | name = "FillColorStroke", 12 | defaultWidth = 24.dp, 13 | defaultHeight = 24.dp, 14 | viewportWidth = 18f, 15 | viewportHeight = 18f 16 | ).apply { 17 | path( 18 | fill = SolidColor(Color(0xFF232F34)), 19 | strokeLineWidth = 1f 20 | ) { 21 | moveTo(6.75f, 12.127f) 22 | lineTo(3.623f, 9f) 23 | lineTo(2.558f, 10.057f) 24 | lineTo(6.75f, 14.25f) 25 | lineTo(15.75f, 5.25f) 26 | lineTo(14.693f, 4.192f) 27 | lineTo(6.75f, 12.127f) 28 | close() 29 | } 30 | }.build() 31 | } 32 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/FillColorStroke.trailing.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | import androidx.compose.ui.graphics.vector.path 7 | import androidx.compose.ui.unit.dp 8 | 9 | val ValkyrieIcons.FillColorStroke: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 10 | ImageVector.Builder( 11 | name = "FillColorStroke", 12 | defaultWidth = 24.dp, 13 | defaultHeight = 24.dp, 14 | viewportWidth = 18f, 15 | viewportHeight = 18f, 16 | ).apply { 17 | path( 18 | fill = SolidColor(Color(0xFF232F34)), 19 | strokeLineWidth = 1f, 20 | ) { 21 | moveTo(6.75f, 12.127f) 22 | lineTo(3.623f, 9f) 23 | lineTo(2.558f, 10.057f) 24 | lineTo(6.75f, 14.25f) 25 | lineTo(15.75f, 5.25f) 26 | lineTo(14.693f, 4.192f) 27 | lineTo(6.75f, 12.127f) 28 | close() 29 | } 30 | }.build() 31 | } 32 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/FlatPackage.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val FlatPackage: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "FlatPackage", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/FlatPackage.pack.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ValkyrieIcons.FlatPackage: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "FlatPackage", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/FlatPackage.pack.nested.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ValkyrieIcons.Filled.FlatPackage: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "Filled.FlatPackage", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/OnlyPath.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.graphics.vector.path 5 | import androidx.compose.ui.unit.dp 6 | 7 | val ValkyrieIcons.OnlyPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 8 | ImageVector.Builder( 9 | name = "OnlyPath", 10 | defaultWidth = 24.dp, 11 | defaultHeight = 24.dp, 12 | viewportWidth = 18f, 13 | viewportHeight = 18f 14 | ).apply { 15 | path { 16 | moveTo(6.75f, 12.127f) 17 | lineTo(3.623f, 9f) 18 | lineTo(2.558f, 10.057f) 19 | lineTo(6.75f, 14.25f) 20 | lineTo(15.75f, 5.25f) 21 | lineTo(14.693f, 4.192f) 22 | lineTo(6.75f, 12.127f) 23 | close() 24 | } 25 | }.build() 26 | } 27 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/RadialGradient.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.geometry.Offset 4 | import androidx.compose.ui.graphics.Brush 5 | import androidx.compose.ui.graphics.Color 6 | import androidx.compose.ui.graphics.vector.ImageVector 7 | import androidx.compose.ui.graphics.vector.path 8 | import androidx.compose.ui.unit.dp 9 | 10 | val RadialGradient: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 11 | ImageVector.Builder( 12 | name = "RadialGradient", 13 | defaultWidth = 100.dp, 14 | defaultHeight = 20.dp, 15 | viewportWidth = 100f, 16 | viewportHeight = 20f 17 | ).apply { 18 | path( 19 | fill = Brush.radialGradient( 20 | colorStops = arrayOf( 21 | 0.19f to Color(0xFFD53A42), 22 | 0.39f to Color(0xFFDF7A40), 23 | 0.59f to Color(0xFFF0A941), 24 | 1f to Color(0xFFFFFFF0) 25 | ), 26 | center = Offset(0f, 10f), 27 | radius = 100f 28 | ) 29 | ) { 30 | moveTo(0f, 0f) 31 | horizontalLineToRelative(100f) 32 | verticalLineToRelative(20f) 33 | horizontalLineToRelative(-100f) 34 | close() 35 | } 36 | }.build() 37 | } 38 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/SeveralPath.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | import androidx.compose.ui.graphics.vector.path 7 | import androidx.compose.ui.unit.dp 8 | 9 | val ValkyrieIcons.SeveralPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 10 | ImageVector.Builder( 11 | name = "SeveralPath", 12 | defaultWidth = 24.dp, 13 | defaultHeight = 24.dp, 14 | viewportWidth = 18f, 15 | viewportHeight = 18f 16 | ).apply { 17 | path(fill = SolidColor(Color(0xFFE676FF))) { 18 | moveTo(6.75f, 12.127f) 19 | lineTo(3.623f, 9f) 20 | lineTo(2.558f, 10.057f) 21 | lineTo(6.75f, 14.25f) 22 | lineTo(15.75f, 5.25f) 23 | lineTo(14.693f, 4.192f) 24 | lineTo(6.75f, 12.127f) 25 | close() 26 | } 27 | path(fill = SolidColor(Color(0xFFFF00FF))) { 28 | moveTo(6.75f, 12.127f) 29 | lineTo(3.623f, 9f) 30 | lineTo(2.558f, 10.057f) 31 | lineTo(6.75f, 14.25f) 32 | lineTo(15.75f, 5.25f) 33 | lineTo(14.693f, 4.192f) 34 | lineTo(6.75f, 12.127f) 35 | close() 36 | } 37 | }.build() 38 | } 39 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.explicit.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | public val WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "WithoutPath", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.indent1.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "WithoutPath", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.indent2.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "WithoutPath", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.indent3.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "WithoutPath", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.indent6.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "WithoutPath", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "WithoutPath", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.pack.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | 6 | val ValkyrieIcons.WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 7 | ImageVector.Builder( 8 | name = "WithoutPath", 9 | defaultWidth = 24.dp, 10 | defaultHeight = 24.dp, 11 | viewportWidth = 18f, 12 | viewportHeight = 18f 13 | ).build() 14 | } 15 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.pack.nested.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons.colored 2 | 3 | import androidx.compose.ui.graphics.vector.ImageVector 4 | import androidx.compose.ui.unit.dp 5 | import io.github.composegears.valkyrie.icons.ValkyrieIcons 6 | 7 | val ValkyrieIcons.Colored.WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 8 | ImageVector.Builder( 9 | name = "Colored.WithoutPath", 10 | defaultWidth = 24.dp, 11 | defaultHeight = 24.dp, 12 | viewportWidth = 18f, 13 | viewportHeight = 18f 14 | ).build() 15 | } 16 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.pack.nested.preview.androidx.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons.filled 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.layout.Box 5 | import androidx.compose.foundation.layout.padding 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Modifier 8 | import androidx.compose.ui.graphics.vector.ImageVector 9 | import androidx.compose.ui.tooling.preview.Preview 10 | import androidx.compose.ui.unit.dp 11 | import io.github.composegears.valkyrie.icons.ValkyrieIcons 12 | 13 | val ValkyrieIcons.Filled.WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 14 | ImageVector.Builder( 15 | name = "Filled.WithoutPath", 16 | defaultWidth = 24.dp, 17 | defaultHeight = 24.dp, 18 | viewportWidth = 18f, 19 | viewportHeight = 18f 20 | ).build() 21 | } 22 | 23 | @Preview 24 | @Composable 25 | private fun WithoutPathPreview() { 26 | Box(modifier = Modifier.padding(12.dp)) { 27 | Image(imageVector = ValkyrieIcons.Filled.WithoutPath, contentDescription = null) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.pack.nested.preview.jetbrains.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons.filled 2 | 3 | import androidx.compose.desktop.ui.tooling.preview.Preview 4 | import androidx.compose.foundation.Image 5 | import androidx.compose.foundation.layout.Box 6 | import androidx.compose.foundation.layout.padding 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.ui.Modifier 9 | import androidx.compose.ui.graphics.vector.ImageVector 10 | import androidx.compose.ui.unit.dp 11 | import io.github.composegears.valkyrie.icons.ValkyrieIcons 12 | 13 | val ValkyrieIcons.Filled.WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 14 | ImageVector.Builder( 15 | name = "Filled.WithoutPath", 16 | defaultWidth = 24.dp, 17 | defaultHeight = 24.dp, 18 | viewportWidth = 18f, 19 | viewportHeight = 18f 20 | ).build() 21 | } 22 | 23 | @Preview 24 | @Composable 25 | private fun WithoutPathPreview() { 26 | Box(modifier = Modifier.padding(12.dp)) { 27 | Image(imageVector = ValkyrieIcons.Filled.WithoutPath, contentDescription = null) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.pack.package.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.material.icons.Icons 4 | import androidx.compose.ui.graphics.vector.ImageVector 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Icons.Filled.WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 8 | ImageVector.Builder( 9 | name = "Filled.WithoutPath", 10 | defaultWidth = 24.dp, 11 | defaultHeight = 24.dp, 12 | viewportWidth = 18f, 13 | viewportHeight = 18f 14 | ).build() 15 | } 16 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.pack.preview.androidx.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.layout.Box 5 | import androidx.compose.foundation.layout.padding 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Modifier 8 | import androidx.compose.ui.graphics.vector.ImageVector 9 | import androidx.compose.ui.tooling.preview.Preview 10 | import androidx.compose.ui.unit.dp 11 | 12 | val ValkyrieIcons.WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 13 | ImageVector.Builder( 14 | name = "WithoutPath", 15 | defaultWidth = 24.dp, 16 | defaultHeight = 24.dp, 17 | viewportWidth = 18f, 18 | viewportHeight = 18f 19 | ).build() 20 | } 21 | 22 | @Preview 23 | @Composable 24 | private fun WithoutPathPreview() { 25 | Box(modifier = Modifier.padding(12.dp)) { 26 | Image(imageVector = ValkyrieIcons.WithoutPath, contentDescription = null) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.pack.preview.jetbrains.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.desktop.ui.tooling.preview.Preview 4 | import androidx.compose.foundation.Image 5 | import androidx.compose.foundation.layout.Box 6 | import androidx.compose.foundation.layout.padding 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.ui.Modifier 9 | import androidx.compose.ui.graphics.vector.ImageVector 10 | import androidx.compose.ui.unit.dp 11 | 12 | val ValkyrieIcons.WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 13 | ImageVector.Builder( 14 | name = "WithoutPath", 15 | defaultWidth = 24.dp, 16 | defaultHeight = 24.dp, 17 | viewportWidth = 18f, 18 | viewportHeight = 18f 19 | ).build() 20 | } 21 | 22 | @Preview 23 | @Composable 24 | private fun WithoutPathPreview() { 25 | Box(modifier = Modifier.padding(12.dp)) { 26 | Image(imageVector = ValkyrieIcons.WithoutPath, contentDescription = null) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.preview.androidx.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.layout.Box 5 | import androidx.compose.foundation.layout.padding 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Modifier 8 | import androidx.compose.ui.graphics.vector.ImageVector 9 | import androidx.compose.ui.tooling.preview.Preview 10 | import androidx.compose.ui.unit.dp 11 | 12 | val WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 13 | ImageVector.Builder( 14 | name = "WithoutPath", 15 | defaultWidth = 24.dp, 16 | defaultHeight = 24.dp, 17 | viewportWidth = 18f, 18 | viewportHeight = 18f 19 | ).build() 20 | } 21 | 22 | @Preview 23 | @Composable 24 | private fun WithoutPathPreview() { 25 | Box(modifier = Modifier.padding(12.dp)) { 26 | Image(imageVector = WithoutPath, contentDescription = null) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/kt/lazy/WithoutPath.preview.jetbrains.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.icons 2 | 3 | import androidx.compose.desktop.ui.tooling.preview.Preview 4 | import androidx.compose.foundation.Image 5 | import androidx.compose.foundation.layout.Box 6 | import androidx.compose.foundation.layout.padding 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.ui.Modifier 9 | import androidx.compose.ui.graphics.vector.ImageVector 10 | import androidx.compose.ui.unit.dp 11 | 12 | val WithoutPath: ImageVector by lazy(LazyThreadSafetyMode.NONE) { 13 | ImageVector.Builder( 14 | name = "WithoutPath", 15 | defaultWidth = 24.dp, 16 | defaultHeight = 24.dp, 17 | viewportWidth = 18f, 18 | viewportHeight = 18f 19 | ).build() 20 | } 21 | 22 | @Preview 23 | @Composable 24 | private fun WithoutPathPreview() { 25 | Box(modifier = Modifier.padding(12.dp)) { 26 | Image(imageVector = WithoutPath, contentDescription = null) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/svg/ic_radial_gradient.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/ic_all_group_params.xml: -------------------------------------------------------------------------------- 1 | 6 | 15 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/ic_all_path_params.xml: -------------------------------------------------------------------------------- 1 | 7 | 19 | 20 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/ic_fill_color_stroke.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/ic_flat_package.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/ic_only_path.xml: -------------------------------------------------------------------------------- 1 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/ic_several_path.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/ic_transparent_fill_color.xml: -------------------------------------------------------------------------------- 1 | 6 | 12 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/ic_without_path.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/icon_with_named_args.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /components/test/sharedTestResources/imagevector/xml/icon_with_shorthand_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /compose/core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.valkyrie.compose) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(compose.foundation) 10 | implementation(compose.runtime) 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /compose/core/src/commonMain/kotlin/io/github/composegears/valkyrie/compose/core/layout/Row.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.compose.core.layout 2 | 3 | import androidx.compose.foundation.layout.Arrangement 4 | import androidx.compose.foundation.layout.Row 5 | import androidx.compose.foundation.layout.RowScope 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Alignment 8 | import androidx.compose.ui.Modifier 9 | 10 | @Composable 11 | inline fun CenterVerticalRow( 12 | modifier: Modifier = Modifier, 13 | horizontalArrangement: Arrangement.Horizontal = Arrangement.Start, 14 | content: @Composable RowScope.() -> Unit, 15 | ) = Row( 16 | verticalAlignment = Alignment.CenterVertically, 17 | horizontalArrangement = horizontalArrangement, 18 | modifier = modifier, 19 | content = content, 20 | ) 21 | -------------------------------------------------------------------------------- /compose/icons/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.valkyrie.compose) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(compose.ui) 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /compose/icons/src/commonMain/kotlin/io/github/composegears/valkyrie/compose/icons/ValkyrieIcons.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.compose.icons 2 | 3 | object ValkyrieIcons { 4 | object Outlined 5 | 6 | object Filled 7 | 8 | object Colored 9 | 10 | object Idea 11 | } 12 | -------------------------------------------------------------------------------- /compose/icons/src/commonMain/kotlin/io/github/composegears/valkyrie/compose/icons/outlined/Back.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.compose.icons.outlined 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | import androidx.compose.ui.graphics.vector.path 7 | import androidx.compose.ui.unit.dp 8 | import io.github.composegears.valkyrie.compose.icons.ValkyrieIcons 9 | 10 | val ValkyrieIcons.Outlined.Back: ImageVector 11 | get() { 12 | if (_Back != null) { 13 | return _Back!! 14 | } 15 | _Back = ImageVector.Builder( 16 | name = "Outlined.Back", 17 | defaultWidth = 24.dp, 18 | defaultHeight = 24.dp, 19 | viewportWidth = 960f, 20 | viewportHeight = 960f, 21 | ).apply { 22 | path(fill = SolidColor(Color(0xFFFFFFFF))) { 23 | moveTo(640f, 852.31f) 24 | lineTo(267.69f, 480f) 25 | lineTo(640f, 107.69f) 26 | lineToRelative(42.54f, 42.54f) 27 | lineTo(352.77f, 480f) 28 | lineToRelative(329.77f, 329.77f) 29 | lineTo(640f, 852.31f) 30 | close() 31 | } 32 | }.build() 33 | 34 | return _Back!! 35 | } 36 | 37 | @Suppress("ObjectPropertyName") 38 | private var _Back: ImageVector? = null 39 | -------------------------------------------------------------------------------- /compose/ui/api/ui.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/compose/ui/InfoCardKt { 2 | public static final fun InfoCard (Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/graphics/vector/ImageVector;Ljava/lang/String;Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V 3 | } 4 | 5 | public final class io/github/composegears/valkyrie/compose/ui/util/ColorKt { 6 | public static final fun dim-8_81llA (J)J 7 | public static final fun disabled-8_81llA (J)J 8 | } 9 | 10 | -------------------------------------------------------------------------------- /compose/ui/api/ui.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [wasmJs] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final fun (androidx.compose.ui.graphics/Color).io.github.composegears.valkyrie.compose.ui.util/dim(): androidx.compose.ui.graphics/Color // io.github.composegears.valkyrie.compose.ui.util/dim|dim@androidx.compose.ui.graphics.Color(){}[0] 10 | final fun (androidx.compose.ui.graphics/Color).io.github.composegears.valkyrie.compose.ui.util/disabled(): androidx.compose.ui.graphics/Color // io.github.composegears.valkyrie.compose.ui.util/disabled|disabled@androidx.compose.ui.graphics.Color(){}[0] 11 | final fun io.github.composegears.valkyrie.compose.ui/InfoCard(kotlin/Function0, androidx.compose.ui.graphics.vector/ImageVector, kotlin/String, kotlin/String, androidx.compose.ui/Modifier?, androidx.compose.runtime/Composer?, kotlin/Int, kotlin/Int) // io.github.composegears.valkyrie.compose.ui/InfoCard|InfoCard(kotlin.Function0;androidx.compose.ui.graphics.vector.ImageVector;kotlin.String;kotlin.String;androidx.compose.ui.Modifier?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0] 12 | -------------------------------------------------------------------------------- /compose/ui/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | alias(libs.plugins.valkyrie.compose) 4 | } 5 | 6 | kotlin { 7 | sourceSets { 8 | commonMain.dependencies { 9 | implementation(projects.compose.core) 10 | 11 | implementation(compose.material3) 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /compose/ui/src/commonMain/kotlin/io/github/composegears/valkyrie/compose/ui/util/Color.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.compose.ui.util 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | fun Color.disabled(): Color = copy(alpha = 0.38f) 6 | 7 | fun Color.dim(): Color = copy(alpha = 0.6f) 8 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.caching=true 2 | org.gradle.configuration-cache=true 3 | org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx4g 4 | org.gradle.parallel=true 5 | 6 | # https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library 7 | # need to be embedded due to plugin uses Compose Multiplatform which requires compatible Kotlin version 8 | kotlin.stdlib.default.dependency=true 9 | kotlin.code.style=official 10 | 11 | android.useAndroidX=true 12 | 13 | GROUP=io.github.composegears 14 | VERSION_NAME=0.15.0-SNAPSHOT 15 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "labels": [ 4 | "dependencies", 5 | ], 6 | "extends": [ 7 | "config:recommended", 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /shared/api/shared.api: -------------------------------------------------------------------------------- 1 | public final class io/github/composegears/valkyrie/shared/Mode : java/lang/Enum { 2 | public static final field IconPack Lio/github/composegears/valkyrie/shared/Mode; 3 | public static final field Simple Lio/github/composegears/valkyrie/shared/Mode; 4 | public static final field Unspecified Lio/github/composegears/valkyrie/shared/Mode; 5 | public static fun getEntries ()Lkotlin/enums/EnumEntries; 6 | public static fun valueOf (Ljava/lang/String;)Lio/github/composegears/valkyrie/shared/Mode; 7 | public static fun values ()[Lio/github/composegears/valkyrie/shared/Mode; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /shared/api/shared.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [wasmJs] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final enum class io.github.composegears.valkyrie.shared/Mode : kotlin/Enum { // io.github.composegears.valkyrie.shared/Mode|null[0] 10 | enum entry IconPack // io.github.composegears.valkyrie.shared/Mode.IconPack|null[0] 11 | enum entry Simple // io.github.composegears.valkyrie.shared/Mode.Simple|null[0] 12 | enum entry Unspecified // io.github.composegears.valkyrie.shared/Mode.Unspecified|null[0] 13 | 14 | final val entries // io.github.composegears.valkyrie.shared/Mode.entries|#static{}entries[0] 15 | final fun (): kotlin.enums/EnumEntries // io.github.composegears.valkyrie.shared/Mode.entries.|#static(){}[0] 16 | 17 | final fun valueOf(kotlin/String): io.github.composegears.valkyrie.shared/Mode // io.github.composegears.valkyrie.shared/Mode.valueOf|valueOf#static(kotlin.String){}[0] 18 | final fun values(): kotlin/Array // io.github.composegears.valkyrie.shared/Mode.values|values#static(){}[0] 19 | } 20 | -------------------------------------------------------------------------------- /shared/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | alias(libs.plugins.valkyrie.kmp) 3 | } 4 | -------------------------------------------------------------------------------- /shared/src/commonMain/kotlin/io/github/composegears/valkyrie/shared/Mode.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.shared 2 | 3 | enum class Mode { 4 | Simple, 5 | IconPack, 6 | Unspecified, 7 | } 8 | -------------------------------------------------------------------------------- /stability_config.conf: -------------------------------------------------------------------------------- 1 | kotlin.collections.* 2 | java.nio.file.Path -------------------------------------------------------------------------------- /tools/cli/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -allowaccessmodification 2 | -dontobfuscate 3 | -keepattributes SourceFile, LineNumberTable 4 | 5 | -keep class io.github.composegears.valkyrie.cli.MainKt { 6 | public static void main(java.lang.String[]); 7 | } 8 | 9 | -keepclassmembers enum * { 10 | public static **[] values(); 11 | public static ** valueOf(java.lang.String); 12 | } 13 | 14 | -keep class org.xmlpull.v1.XmlPullParser { *; } 15 | -keep class * extends org.xmlpull.v1.XmlPullParser { 16 | (...); 17 | ; 18 | } 19 | 20 | -dontwarn org.xmlpull.mxp1.** 21 | -------------------------------------------------------------------------------- /tools/cli/src/main/kotlin/io/github/composegears/valkyrie/cli/Main.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.cli 2 | 3 | import com.github.ajalt.clikt.core.CliktCommand 4 | import com.github.ajalt.clikt.core.main 5 | import com.github.ajalt.clikt.core.subcommands 6 | import com.github.ajalt.clikt.parameters.options.versionOption 7 | import io.github.composegears.valkyrie.cli.command.IconPackCommand 8 | import io.github.composegears.valkyrie.cli.command.SvgXmlToImageVectorCommand 9 | 10 | fun main(vararg args: String) = ValkyrieCli() 11 | .subcommands(SvgXmlToImageVectorCommand(), IconPackCommand()) 12 | .versionOption(BuildConfig.VERSION_NAME, names = setOf("-v", "--version")) 13 | .main(args) 14 | 15 | class ValkyrieCli : CliktCommand(name = "valkyrie") { 16 | 17 | override val printHelpOnEmptyArgs: Boolean = true 18 | 19 | override fun run() = Unit 20 | } 21 | -------------------------------------------------------------------------------- /tools/cli/src/main/kotlin/io/github/composegears/valkyrie/cli/ext/Outputs.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.cli.ext 2 | 3 | import com.github.ajalt.mordant.rendering.TextColors 4 | import com.github.ajalt.mordant.terminal.Terminal 5 | import kotlin.system.exitProcess 6 | 7 | internal fun outputInfo(message: Any) { 8 | output(message.toString(), TextColors.green) 9 | } 10 | 11 | internal fun outputError(message: Any): Nothing { 12 | output("Error: $message", TextColors.red, true) 13 | exitProcess(1) 14 | } 15 | 16 | private fun output(message: String, color: TextColors, stderr: Boolean = false) { 17 | terminal.println(message = color(message), stderr = stderr) 18 | } 19 | 20 | private val terminal = Terminal() 21 | -------------------------------------------------------------------------------- /tools/cli/src/test/kotlin/io/github/composegears/valkyrie/cli/command/IconPackCommandTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.cli.command 2 | 3 | import assertk.assertThat 4 | import assertk.assertions.contains 5 | import assertk.assertions.isNotEmpty 6 | import com.github.ajalt.clikt.testing.test 7 | import kotlin.test.Test 8 | 9 | class IconPackCommandTest { 10 | 11 | @Test 12 | fun `help formatter should include required option marker and default values`() { 13 | val helpMessage = IconPackCommand().test("--help").output 14 | 15 | assertThat(helpMessage).isNotEmpty() 16 | assertThat(helpMessage).contains("* --output-path") 17 | assertThat(helpMessage).contains("(default: 4)") 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tools/cli/src/test/kotlin/io/github/composegears/valkyrie/cli/common/CliTestType.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.cli.common 2 | 3 | enum class CliTestType { 4 | DirectMain, 5 | JarTerminal, 6 | } 7 | -------------------------------------------------------------------------------- /tools/cli/src/test/kotlin/io/github/composegears/valkyrie/cli/common/CommandLineTestRunner.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.cli.common 2 | 3 | class CommandLineTestRunner( 4 | private var commands: List, 5 | ) : Runnable { 6 | 7 | override fun run() { 8 | val process = ProcessBuilder(cliCommand(commands)).start() 9 | val exitCode = process.waitFor() 10 | 11 | val err = process.errorStream.readBytes().toString(Charsets.UTF_8) 12 | 13 | if (exitCode != 0 || err.isNotEmpty()) { 14 | error("Error occurred when running command line: $err") 15 | } 16 | } 17 | 18 | companion object { 19 | private val isWindows = System.getProperty("os.name").startsWith("Windows") 20 | private val cliPath = System.getProperty("CLI_PATH") ?: error("CLI_PATH must not be null.") 21 | 22 | private fun cliCommand(arguments: List) = buildList { 23 | if (isWindows) { 24 | add("$cliPath/valkyrie.bat") 25 | } else { 26 | add("$cliPath/valkyrie") 27 | } 28 | addAll(arguments) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tools/cli/src/test/kotlin/io/github/composegears/valkyrie/cli/common/OutputFormatResource.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.cli.common 2 | 3 | import io.github.composegears.valkyrie.generator.jvm.imagevector.OutputFormat 4 | import io.github.composegears.valkyrie.generator.jvm.imagevector.OutputFormat.BackingProperty 5 | import io.github.composegears.valkyrie.generator.jvm.imagevector.OutputFormat.LazyProperty 6 | import io.github.composegears.valkyrie.resource.loader.ResourceLoader.getResourceText 7 | 8 | fun OutputFormat.toResourceText( 9 | pathToBackingProperty: String, 10 | pathToLazyProperty: String, 11 | ): String = when (this) { 12 | BackingProperty -> getResourceText(pathToBackingProperty) 13 | LazyProperty -> getResourceText(pathToLazyProperty) 14 | } 15 | -------------------------------------------------------------------------------- /tools/compose-app/src/commonMain/composeResources/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Welcome to Valkyrie 4 | Choose conversion mode 5 | Simple 6 | One-click conversion from SVG/XML into ImageVector 7 | 8 | -------------------------------------------------------------------------------- /tools/compose-app/src/commonMain/kotlin/io/github/composegears/valkyrie/ui/theme/LocalThemeConfig.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("ktlint:compose:compositionlocal-allowlist") 2 | 3 | package io.github.composegears.valkyrie.ui.theme 4 | 5 | import androidx.compose.runtime.getValue 6 | import androidx.compose.runtime.mutableStateOf 7 | import androidx.compose.runtime.setValue 8 | import androidx.compose.runtime.staticCompositionLocalOf 9 | 10 | val LocalTheme = staticCompositionLocalOf { LocalThemeConfig() } 11 | 12 | class LocalThemeConfig { 13 | var isDarkTheme by mutableStateOf(false) 14 | 15 | fun toggle() { 16 | isDarkTheme = !isDarkTheme 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tools/compose-app/src/desktopMain/kotlin/io/github/composegears/valkyrie/main.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("ktlint:standard:filename") 2 | 3 | package io.github.composegears.valkyrie 4 | 5 | import androidx.compose.ui.window.Window 6 | import androidx.compose.ui.window.application 7 | 8 | fun main() = application { 9 | Window( 10 | onCloseRequest = ::exitApplication, 11 | title = "Valkyrie", 12 | ) { 13 | ValkyrieApp() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tools/compose-app/src/wasmJsMain/kotlin/io/github/composegears/valkyrie/main.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("ktlint:standard:filename") 2 | 3 | package io.github.composegears.valkyrie 4 | 5 | import androidx.compose.runtime.LaunchedEffect 6 | import androidx.compose.ui.ExperimentalComposeUiApi 7 | import androidx.compose.ui.window.ComposeViewport 8 | import io.github.composegears.valkyrie.extensions.safeAs 9 | import kotlinx.browser.document 10 | import org.w3c.dom.HTMLElement 11 | 12 | @OptIn(ExperimentalComposeUiApi::class) 13 | fun main() { 14 | ComposeViewport(document.body!!) { 15 | LaunchedEffect(Unit) { 16 | hideLoader() 17 | } 18 | ValkyrieApp() 19 | } 20 | } 21 | 22 | private fun hideLoader() { 23 | document.getElementById("loader").safeAs()?.run { style.display = "none" } 24 | document.getElementById("app").safeAs()?.run { style.display = "block" } 25 | } 26 | -------------------------------------------------------------------------------- /tools/compose-app/src/wasmJsMain/resources/images/logo_114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/tools/compose-app/src/wasmJsMain/resources/images/logo_114.png -------------------------------------------------------------------------------- /tools/compose-app/src/wasmJsMain/resources/images/logo_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/tools/compose-app/src/wasmJsMain/resources/images/logo_256.png -------------------------------------------------------------------------------- /tools/compose-app/src/wasmJsMain/resources/images/logo_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposeGears/Valkyrie/056fc38a69ed588887bc1e80ca6532773aa438a9/tools/compose-app/src/wasmJsMain/resources/images/logo_512.png -------------------------------------------------------------------------------- /tools/compose-app/src/wasmJsMain/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Valkyrie 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |
18 | 19 | 20 | 21 |
22 | 23 |
24 | 25 | -------------------------------------------------------------------------------- /tools/compose-app/src/wasmJsMain/resources/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Valkyrie", 3 | "short_name": "Valkyrie", 4 | "description": "SVG/XML to Compose ImageVector converter", 5 | "start_url": "/Valkyrie", 6 | "display": "standalone", 7 | "background_color": "white", 8 | "icons": [ 9 | { 10 | "src": "images/logo_114.png", 11 | "sizes": "114x114", 12 | "type": "image/png" 13 | }, 14 | { 15 | "src": "images/logo_256.png", 16 | "sizes": "256x256", 17 | "type": "image/png" 18 | }, 19 | { 20 | "src": "images/logo_512.png", 21 | "sizes": "512x512", 22 | "type": "image/png" 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /tools/compose-app/src/wasmJsMain/resources/styles.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | width: 100%; 3 | height: 100%; 4 | margin: 0; 5 | padding: 0; 6 | overflow: hidden; 7 | } 8 | 9 | /* Loader container: full screen, centered, and above all content */ 10 | #loader { 11 | position: fixed; 12 | top: 0; 13 | left: 0; 14 | width: 100%; 15 | height: 100%; 16 | background: #121212; /* Dark background */ 17 | display: flex; 18 | justify-content: center; 19 | align-items: center; 20 | z-index: 9999; /* Ensure the loader is on top of everything */ 21 | } 22 | 23 | /* Spinner styling */ 24 | .spinner { 25 | width: 60px; 26 | height: 60px; 27 | border: 8px solid #333; /* Dark gray ring */ 28 | border-top: 8px solid #FFFFFF; /* Accent ring (white) */ 29 | border-radius: 50%; 30 | animation: spin 1s linear infinite; 31 | } 32 | 33 | /* Spin animation */ 34 | @keyframes spin { 35 | 0% { 36 | transform: rotate(0deg); 37 | } 38 | 100% { 39 | transform: rotate(360deg); 40 | } 41 | } 42 | 43 | /* Main application content, hidden by default */ 44 | #app { 45 | display: none; 46 | } 47 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/action/ActionUtil.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.action 2 | 3 | import io.github.composegears.valkyrie.service.PersistentSettings 4 | import io.github.composegears.valkyrie.shared.Mode 5 | 6 | val PersistentSettings.ValkyrieState.isIconPackRequired: Boolean 7 | get() = mode == Mode.Unspecified || mode == Mode.Simple 8 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/action/RefreshPluginAction.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.action 2 | 3 | import com.intellij.icons.AllIcons 4 | import com.intellij.openapi.actionSystem.AnAction 5 | import com.intellij.openapi.actionSystem.AnActionEvent 6 | import io.github.composegears.valkyrie.service.GlobalEventsHandler.Companion.globalEventsHandler 7 | import io.github.composegears.valkyrie.service.GlobalEventsHandler.PluginEvents 8 | 9 | class RefreshPluginAction : AnAction() { 10 | 11 | init { 12 | templatePresentation.text = "Refresh Plugin" 13 | templatePresentation.icon = AllIcons.Actions.Refresh 14 | templatePresentation.description = "Refresh plugin to last used mode" 15 | } 16 | 17 | override fun actionPerformed(e: AnActionEvent) { 18 | val project = e.project ?: return 19 | 20 | project.globalEventsHandler.send(PluginEvents.RefreshPlugin) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/editor/VirtualFile.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.editor 2 | 3 | import com.intellij.openapi.project.Project 4 | import com.intellij.openapi.vfs.VirtualFile 5 | import com.intellij.psi.PsiFileFactory 6 | import io.github.composegears.valkyrie.extensions.safeAs 7 | import org.jetbrains.kotlin.idea.KotlinFileType 8 | import org.jetbrains.kotlin.psi.KtFile 9 | 10 | internal fun VirtualFile.toKtFile(project: Project): KtFile? { 11 | val fileContent = contentsToByteArray().toString(Charsets.UTF_8) 12 | 13 | return PsiFileFactory.getInstance(project) 14 | .createFileFromText(name, KotlinFileType.INSTANCE, fileContent) 15 | .safeAs() 16 | } 17 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/service/GlobalEventsHandler.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.service 2 | 3 | import com.intellij.openapi.components.service 4 | import com.intellij.openapi.project.Project 5 | import java.nio.file.Path 6 | import kotlinx.coroutines.ExperimentalCoroutinesApi 7 | import kotlinx.coroutines.flow.MutableSharedFlow 8 | import kotlinx.coroutines.flow.asSharedFlow 9 | 10 | class GlobalEventsHandler { 11 | 12 | private val _events = MutableSharedFlow(replay = 1) 13 | val events = _events.asSharedFlow() 14 | 15 | fun send(event: PluginEvents) { 16 | _events.tryEmit(event) 17 | } 18 | 19 | @OptIn(ExperimentalCoroutinesApi::class) 20 | fun resetCache() { 21 | _events.resetReplayCache() 22 | } 23 | 24 | sealed interface PluginEvents { 25 | data object RefreshPlugin : PluginEvents 26 | data class ImportIcons(val pathData: PendingPathData) : PluginEvents 27 | data class SetupIconPackMode(val pathData: PendingPathData) : PluginEvents 28 | } 29 | 30 | data class PendingPathData(val paths: List = emptyList()) 31 | 32 | companion object { 33 | @JvmStatic 34 | val Project.globalEventsHandler: GlobalEventsHandler 35 | get() = service() 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/common/picker/PickerEvent.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.common.picker 2 | 3 | import java.nio.file.Path 4 | 5 | sealed interface PickerEvent { 6 | data class PickDirectory(val path: Path) : PickerEvent 7 | data class PickFiles(val paths: List) : PickerEvent 8 | data class ClipboardText(val text: String) : PickerEvent 9 | } 10 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/di/CoreModule.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.di 2 | 3 | import com.composegears.leviathan.Dependency 4 | import com.composegears.leviathan.Leviathan 5 | import io.github.composegears.valkyrie.settings.InMemorySettings 6 | 7 | fun coreModule(): CoreModule = CoreModuleImpl 8 | 9 | interface CoreModule { 10 | val inMemorySettings: Dependency 11 | } 12 | 13 | private object CoreModuleImpl : Leviathan(), CoreModule { 14 | 15 | private val platformModule = intellijPlatformModule() 16 | 17 | override val inMemorySettings by instanceOf { InMemorySettings(platformModule.project.get()) } 18 | } 19 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/di/DI.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.di 2 | 3 | import com.intellij.openapi.project.Project 4 | 5 | object DI { 6 | private val platformModule = intellijPlatformModule() 7 | 8 | val core = coreModule() 9 | 10 | fun initWith(project: Project) { 11 | platformModule.project.provides { project } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/di/IntellijPlatformModule.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.di 2 | 3 | import com.composegears.leviathan.LateInitDependency 4 | import com.composegears.leviathan.Leviathan 5 | import com.intellij.openapi.project.Project 6 | 7 | fun intellijPlatformModule(): IntellijPlatformModule = IntellijPlatformModuleImpl 8 | 9 | interface IntellijPlatformModule { 10 | val project: LateInitDependency 11 | } 12 | 13 | private object IntellijPlatformModuleImpl : Leviathan(), IntellijPlatformModule { 14 | 15 | override val project by lateInitInstance() 16 | } 17 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/domain/ParamUseCase.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.domain 2 | 3 | interface ParamUseCase { 4 | suspend operator fun invoke(params: Params): Success 5 | } 6 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/domain/model/PreviewType.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.domain.model 2 | 3 | enum class PreviewType { 4 | Black, 5 | White, 6 | Pixel, 7 | Auto, 8 | } 9 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/domain/validation/IconPackValidationUseCase.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.domain.validation 2 | 3 | class IconPackValidationUseCase : ValidationUseCase { 4 | 5 | private val iconPackRegex = "^[A-Za-z]*$".toRegex() 6 | 7 | override suspend fun invoke(params: String): ValidationResult { 8 | return when { 9 | params.isEmpty() -> ValidationResult.Error(errorCriteria = ErrorCriteria.EMPTY) 10 | params.first().isLowerCase() -> ValidationResult.Error(errorCriteria = ErrorCriteria.FIRST_LETTER_LOWER_CASE) 11 | !params.matches(iconPackRegex) -> ValidationResult.Error(errorCriteria = ErrorCriteria.INCONSISTENT_FORMAT) 12 | else -> ValidationResult.Success 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/domain/validation/PackageValidationUseCase.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.domain.validation 2 | 3 | class PackageValidationUseCase : ValidationUseCase { 4 | 5 | private val packageRegex = "^([A-Za-z][A-Za-z\\d_]*\\.)*[A-Za-z][A-Za-z\\d_]*$".toRegex() 6 | 7 | override suspend fun invoke(params: String): ValidationResult { 8 | return when { 9 | params.isEmpty() -> ValidationResult.Error(errorCriteria = ErrorCriteria.EMPTY) 10 | !params.matches(packageRegex) -> ValidationResult.Error(errorCriteria = ErrorCriteria.INCONSISTENT_FORMAT) 11 | else -> ValidationResult.Success 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/domain/validation/ValidationUseCase.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.domain.validation 2 | 3 | import io.github.composegears.valkyrie.ui.domain.ParamUseCase 4 | 5 | interface ValidationUseCase : ParamUseCase 6 | 7 | sealed interface ValidationResult { 8 | data object None : ValidationResult 9 | data object Success : ValidationResult 10 | data class Error(val errorCriteria: ErrorCriteria) : ValidationResult 11 | } 12 | 13 | enum class ErrorCriteria { 14 | EMPTY, 15 | INCONSISTENT_FORMAT, 16 | FIRST_LETTER_LOWER_CASE, 17 | } 18 | 19 | data class InputState( 20 | val text: String = "", 21 | val enabled: Boolean = true, 22 | val validationResult: ValidationResult = ValidationResult.Success, 23 | ) 24 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/extension/MutableStateFlow.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.extension 2 | 3 | import kotlinx.coroutines.flow.MutableStateFlow 4 | import kotlinx.coroutines.flow.update 5 | 6 | /** 7 | * This is a variant of [MutableStateFlow.update] but using `this` as receiver in [function]. 8 | */ 9 | inline fun MutableStateFlow.updateState(function: T.() -> T) { 10 | update(function) 11 | } 12 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/extension/String.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("NOTHING_TO_INLINE") 2 | 3 | package io.github.composegears.valkyrie.ui.extension 4 | 5 | inline fun String?.or(default: String): String = this ?: default 6 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/HorizontalDivider.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation 2 | 3 | import androidx.compose.material3.HorizontalDivider 4 | import androidx.compose.material3.MaterialTheme 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.ui.Modifier 7 | import androidx.compose.ui.unit.Dp 8 | 9 | @Composable 10 | fun HorizontalDivider(modifier: Modifier = Modifier) { 11 | HorizontalDivider( 12 | modifier = modifier, 13 | color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.1f), 14 | thickness = Dp.Hairline, 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/IconButton.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation 2 | 3 | import androidx.compose.foundation.layout.size 4 | import androidx.compose.material3.Icon 5 | import androidx.compose.material3.IconButton 6 | import androidx.compose.material3.IconButtonColors 7 | import androidx.compose.material3.IconButtonDefaults 8 | import androidx.compose.runtime.Composable 9 | import androidx.compose.ui.Modifier 10 | import androidx.compose.ui.graphics.vector.ImageVector 11 | import androidx.compose.ui.unit.Dp 12 | 13 | @Composable 14 | fun IconButton( 15 | imageVector: ImageVector, 16 | modifier: Modifier = Modifier, 17 | enabled: Boolean = true, 18 | colors: IconButtonColors = IconButtonDefaults.iconButtonColors(), 19 | iconSize: Dp = Dp.Unspecified, 20 | onClick: () -> Unit, 21 | ) { 22 | IconButton( 23 | colors = colors, 24 | modifier = modifier, 25 | onClick = onClick, 26 | enabled = enabled, 27 | ) { 28 | Icon( 29 | modifier = Modifier.size(iconSize), 30 | imageVector = imageVector, 31 | contentDescription = null, 32 | ) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/SegmentedButton.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation 2 | 3 | import androidx.compose.material3.MaterialTheme 4 | import androidx.compose.material3.SegmentedButton 5 | import androidx.compose.material3.SegmentedButtonDefaults 6 | import androidx.compose.material3.SingleChoiceSegmentedButtonRowScope 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.ui.graphics.Shape 9 | 10 | @Composable 11 | fun SingleChoiceSegmentedButtonRowScope.SegmentedButton( 12 | selected: Boolean, 13 | onClick: () -> Unit, 14 | shape: Shape, 15 | label: @Composable () -> Unit, 16 | ) { 17 | SegmentedButton( 18 | shape = shape, 19 | onClick = onClick, 20 | selected = selected, 21 | colors = SegmentedButtonDefaults.colors().copy( 22 | activeContainerColor = MaterialTheme.colorScheme.primary, 23 | activeContentColor = MaterialTheme.colorScheme.onPrimary, 24 | activeBorderColor = MaterialTheme.colorScheme.primary, 25 | ), 26 | icon = {}, 27 | label = label, 28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/components/previewer/ZoomState.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation.components.previewer 2 | 3 | import androidx.compose.animation.core.Animatable 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.runtime.getValue 6 | import androidx.compose.runtime.mutableStateOf 7 | import androidx.compose.runtime.remember 8 | import androidx.compose.runtime.setValue 9 | import androidx.compose.ui.unit.Dp 10 | 11 | @Composable 12 | fun rememberZoomState() = remember { ZoomState() } 13 | 14 | class ZoomState { 15 | var maxPreviewSize by mutableStateOf(Dp.Unspecified) 16 | 17 | private val animatable = Animatable(0f) 18 | val scale by animatable.asState() 19 | 20 | suspend fun animateToScale(targetScale: Float) { 21 | animatable.animateTo(targetScale) 22 | } 23 | 24 | suspend fun setScale(targetScale: Float) { 25 | animatable.snapTo(targetScale) 26 | } 27 | 28 | suspend fun zoomIn() { 29 | animateToScale(scale + 1f) 30 | } 31 | 32 | suspend fun zoomOut() { 33 | if (scale - 1f > 0f) { 34 | animateToScale(scale - 1f) 35 | } 36 | } 37 | 38 | suspend fun reset() = animateToScale(1f) 39 | } 40 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/compositionlocal/LocalProject.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("ktlint:compose:compositionlocal-allowlist") 2 | 3 | package io.github.composegears.valkyrie.ui.foundation.compositionlocal 4 | 5 | import androidx.compose.runtime.staticCompositionLocalOf 6 | import com.intellij.openapi.project.Project 7 | 8 | val LocalProject = staticCompositionLocalOf { ProjectWrapper.Stub } 9 | 10 | /** 11 | * Wrapper for the IntelliJ [Project] instance to avoid "class not found exception" in Compose Preview functions 12 | */ 13 | sealed interface ProjectWrapper { 14 | val current: Project 15 | 16 | class Platform(override val current: Project) : ProjectWrapper 17 | 18 | data object Stub : ProjectWrapper { 19 | override val current: Project 20 | get() = error("Stub wrapper should be used only for Preview") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/icons/Back.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.StrokeCap 6 | import androidx.compose.ui.graphics.vector.ImageVector 7 | import androidx.compose.ui.graphics.vector.path 8 | import androidx.compose.ui.unit.dp 9 | import io.github.composegears.valkyrie.compose.icons.ValkyrieIcons 10 | 11 | val ValkyrieIcons.Back: ImageVector 12 | get() { 13 | if (_Back != null) { 14 | return _Back!! 15 | } 16 | _Back = ImageVector.Builder( 17 | name = "Back", 18 | defaultWidth = 16.dp, 19 | defaultHeight = 16.dp, 20 | viewportWidth = 16f, 21 | viewportHeight = 16f, 22 | ).apply { 23 | path( 24 | stroke = SolidColor(Color(0xFF6C707E)), 25 | strokeLineWidth = 1f, 26 | strokeLineCap = StrokeCap.Round, 27 | ) { 28 | moveTo(10f, 12.5f) 29 | lineTo(5.5f, 8f) 30 | lineTo(10f, 3.5f) 31 | } 32 | }.build() 33 | 34 | return _Back!! 35 | } 36 | 37 | @Suppress("ObjectPropertyName") 38 | private var _Back: ImageVector? = null 39 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/icons/Checked.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.StrokeCap 6 | import androidx.compose.ui.graphics.StrokeJoin 7 | import androidx.compose.ui.graphics.vector.ImageVector 8 | import androidx.compose.ui.graphics.vector.path 9 | import androidx.compose.ui.unit.dp 10 | import io.github.composegears.valkyrie.compose.icons.ValkyrieIcons 11 | 12 | val ValkyrieIcons.Checked: ImageVector 13 | get() { 14 | if (_Checked != null) { 15 | return _Checked!! 16 | } 17 | _Checked = ImageVector.Builder( 18 | name = "Checked", 19 | defaultWidth = 16.dp, 20 | defaultHeight = 16.dp, 21 | viewportWidth = 16f, 22 | viewportHeight = 16f, 23 | ).apply { 24 | path( 25 | stroke = SolidColor(Color(0xFF6C707E)), 26 | strokeLineWidth = 1f, 27 | strokeLineCap = StrokeCap.Round, 28 | strokeLineJoin = StrokeJoin.Round, 29 | ) { 30 | moveTo(2.5f, 8.25f) 31 | lineTo(6f, 11.75f) 32 | lineTo(13.5f, 4.25f) 33 | } 34 | }.build() 35 | 36 | return _Checked!! 37 | } 38 | 39 | @Suppress("ObjectPropertyName") 40 | private var _Checked: ImageVector? = null 41 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/icons/Close.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.StrokeCap 6 | import androidx.compose.ui.graphics.vector.ImageVector 7 | import androidx.compose.ui.graphics.vector.path 8 | import androidx.compose.ui.unit.dp 9 | import io.github.composegears.valkyrie.compose.icons.ValkyrieIcons 10 | 11 | val ValkyrieIcons.Close: ImageVector 12 | get() { 13 | if (_Close != null) { 14 | return _Close!! 15 | } 16 | _Close = ImageVector.Builder( 17 | name = "Close", 18 | defaultWidth = 16.dp, 19 | defaultHeight = 16.dp, 20 | viewportWidth = 16f, 21 | viewportHeight = 16f, 22 | ).apply { 23 | path( 24 | stroke = SolidColor(Color(0xFF6C707E)), 25 | strokeLineWidth = 1f, 26 | strokeLineCap = StrokeCap.Round, 27 | ) { 28 | moveTo(2.5f, 13.5f) 29 | lineTo(13.5f, 2.5f) 30 | moveTo(13.5f, 13.5f) 31 | lineTo(2.5f, 2.5f) 32 | } 33 | }.build() 34 | 35 | return _Close!! 36 | } 37 | 38 | @Suppress("ObjectPropertyName") 39 | private var _Close: ImageVector? = null 40 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/icons/PlayForward.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation.icons 2 | 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.ui.graphics.SolidColor 5 | import androidx.compose.ui.graphics.StrokeCap 6 | import androidx.compose.ui.graphics.vector.ImageVector 7 | import androidx.compose.ui.graphics.vector.path 8 | import androidx.compose.ui.unit.dp 9 | import io.github.composegears.valkyrie.compose.icons.ValkyrieIcons 10 | 11 | val ValkyrieIcons.PlayForward: ImageVector 12 | get() { 13 | if (_PlayForward != null) { 14 | return _PlayForward!! 15 | } 16 | _PlayForward = ImageVector.Builder( 17 | name = "PlayForward", 18 | defaultWidth = 16.dp, 19 | defaultHeight = 16.dp, 20 | viewportWidth = 16f, 21 | viewportHeight = 16f, 22 | ).apply { 23 | path( 24 | stroke = SolidColor(Color(0xFF6C707E)), 25 | strokeLineWidth = 1f, 26 | strokeLineCap = StrokeCap.Round, 27 | ) { 28 | moveTo(6f, 12.5f) 29 | lineTo(10.5f, 8f) 30 | lineTo(6f, 3.5f) 31 | } 32 | }.build() 33 | 34 | return _PlayForward!! 35 | } 36 | 37 | @Suppress("ObjectPropertyName") 38 | private var _PlayForward: ImageVector? = null 39 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/previewbg/BgType.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.foundation.previewbg 2 | 3 | enum class BgType { 4 | Black, 5 | White, 6 | PixelGrid, 7 | ; 8 | 9 | fun next(): BgType = ordinal.let { entries[(it + 1) % entries.size] } 10 | } 11 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/theme/CompositionLocal.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("ktlint:compose:compositionlocal-allowlist") 2 | 3 | package io.github.composegears.valkyrie.ui.foundation.theme 4 | 5 | import androidx.compose.runtime.staticCompositionLocalOf 6 | import java.awt.Component 7 | 8 | val LocalComponent = staticCompositionLocalOf { error("LocalComponent not provided") } 9 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/platform/Browser.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.platform 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.platform.LocalInspectionMode 5 | import com.intellij.ide.BrowserUtil 6 | 7 | @Composable 8 | fun rememberBrowser(): Browser { 9 | if (LocalInspectionMode.current) return NoOpBrowser 10 | 11 | return BrowserImpl 12 | } 13 | 14 | interface Browser { 15 | fun open(url: String) 16 | } 17 | 18 | private object NoOpBrowser : Browser { 19 | override fun open(url: String) = Unit 20 | } 21 | 22 | private object BrowserImpl : Browser { 23 | override fun open(url: String) = BrowserUtil.browse(url) 24 | } 25 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/platform/CopyPasteManager.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.platform 2 | 3 | import com.intellij.openapi.ide.CopyPasteManager 4 | import io.github.composegears.valkyrie.extensions.cast 5 | import java.awt.datatransfer.DataFlavor 6 | import java.awt.datatransfer.StringSelection 7 | import java.io.File 8 | import java.nio.file.Path 9 | 10 | fun copyInClipboard(text: String) { 11 | CopyPasteManager.getInstance().setContents(StringSelection(text)) 12 | } 13 | 14 | fun pasteFromClipboard(): ClipboardDataType? { 15 | val clipboardContents = CopyPasteManager.getInstance().contents ?: return null 16 | 17 | if (clipboardContents.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { 18 | val files = clipboardContents 19 | .getTransferData(DataFlavor.javaFileListFlavor) 20 | .cast>() 21 | .filterIsInstance() 22 | .map(File::toPath) 23 | 24 | if (files.isNotEmpty()) { 25 | return ClipboardDataType.Files(files) 26 | } 27 | } 28 | 29 | if (clipboardContents.isDataFlavorSupported(DataFlavor.stringFlavor)) { 30 | val text = clipboardContents.getTransferData(DataFlavor.stringFlavor).cast() 31 | return ClipboardDataType.Text(text) 32 | } 33 | 34 | return null 35 | } 36 | 37 | sealed interface ClipboardDataType { 38 | data class Text(val text: String) : ClipboardDataType 39 | data class Files(val paths: List) : ClipboardDataType 40 | } 41 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/platform/CurrentProject.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.platform 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.platform.LocalInspectionMode 5 | import com.intellij.openapi.project.ProjectManager 6 | 7 | @Composable 8 | fun rememberCurrentProject(): CurrentProject { 9 | if (LocalInspectionMode.current) return NoOpCurrentProject 10 | 11 | return CurrentProjectImpl 12 | } 13 | 14 | interface CurrentProject { 15 | val path: String? 16 | } 17 | 18 | private object NoOpCurrentProject : CurrentProject { 19 | override val path: String? = null 20 | } 21 | 22 | private object CurrentProjectImpl : CurrentProject { 23 | 24 | override val path: String? 25 | get() = ProjectManager.getInstance().openProjects.firstOrNull()?.basePath 26 | } 27 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/platform/JComponent.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.platform 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.awt.ComposePanel 5 | import javax.swing.JComponent 6 | 7 | fun buildComposePanel( 8 | height: Int = 800, 9 | width: Int = 800, 10 | y: Int = 0, 11 | x: Int = 0, 12 | content: @Composable ComposePanel.() -> Unit, 13 | ): JComponent = ComposePanel().apply { 14 | setBounds(x = x, y = y, width = width, height = height) 15 | setContent { 16 | content() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/platform/Os.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.platform 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.ui.platform.LocalInspectionMode 5 | 6 | @Composable 7 | fun rememberCurrentOs(): Os { 8 | if (LocalInspectionMode.current) return Os.MacOS 9 | 10 | val osProperty = System.getProperty("os.name") 11 | 12 | return when { 13 | osProperty.contains("mac", ignoreCase = true) -> Os.MacOS 14 | osProperty.contains("win", ignoreCase = true) -> Os.Windows 15 | osProperty.contains("nux", ignoreCase = true) -> Os.Linux 16 | else -> Os.Unknown 17 | } 18 | } 19 | 20 | enum class Os { 21 | MacOS, 22 | Windows, 23 | Linux, 24 | Unknown, 25 | } 26 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/platform/picker/Picker.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.platform.picker 2 | 3 | interface Picker { 4 | 5 | suspend fun launch(): T 6 | } 7 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/intro/util/PluginVersion.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.intro.util 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.compose.runtime.remember 5 | import androidx.compose.ui.platform.LocalInspectionMode 6 | import com.intellij.ide.plugins.PluginManagerCore 7 | import com.intellij.openapi.extensions.PluginId 8 | 9 | @Composable 10 | fun rememberPluginVersion(): String { 11 | if (LocalInspectionMode.current) return "1.0.0" 12 | 13 | return remember { 14 | val pluginId = PluginId.getId("io.github.composegears.valkyrie") 15 | PluginManagerCore.getPlugin(pluginId)?.version.toString() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/ui/batch/model/BatchAction.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.conversion.ui.batch.model 2 | 3 | import io.github.composegears.valkyrie.ui.screen.mode.iconpack.conversion.IconName 4 | import io.github.composegears.valkyrie.ui.screen.mode.iconpack.conversion.ValidationError 5 | 6 | sealed interface BatchAction { 7 | 8 | data class ExportIssues(val issues: Map>) : BatchAction 9 | data object None : BatchAction 10 | } 11 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/conversion/ui/batch/ui/FileTypeBadge.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.conversion.ui.batch.ui 2 | 3 | import androidx.compose.foundation.background 4 | import androidx.compose.foundation.layout.padding 5 | import androidx.compose.foundation.shape.RoundedCornerShape 6 | import androidx.compose.material3.MaterialTheme 7 | import androidx.compose.material3.Text 8 | import androidx.compose.runtime.Composable 9 | import androidx.compose.ui.Modifier 10 | import androidx.compose.ui.unit.dp 11 | import androidx.compose.ui.unit.sp 12 | 13 | @Composable 14 | fun FileTypeBadge( 15 | text: String, 16 | modifier: Modifier = Modifier, 17 | ) { 18 | Text( 19 | modifier = modifier 20 | .background( 21 | color = MaterialTheme.colorScheme.primary.copy(alpha = 0.8f), 22 | shape = RoundedCornerShape(16.dp), 23 | ) 24 | .padding(horizontal = 8.dp, vertical = 2.dp), 25 | text = text, 26 | color = MaterialTheme.colorScheme.onPrimary, 27 | style = MaterialTheme.typography.bodySmall.copy(fontSize = 11.sp), 28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/creation/common/packedit/model/InputChange.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.creation.common.packedit.model 2 | 3 | sealed interface InputChange { 4 | data class PackageName(val text: String) : InputChange 5 | data class IconPackName(val text: String) : InputChange 6 | data class NestedPackName(val id: String, val text: String) : InputChange 7 | } 8 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/existingpack/ui/model/ExistingPackAction.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.existingpack.ui.model 2 | 3 | import com.intellij.openapi.project.Project 4 | import io.github.composegears.valkyrie.ui.screen.mode.iconpack.creation.common.packedit.model.NestedPack 5 | import java.nio.file.Path 6 | 7 | sealed interface ExistingPackAction { 8 | data class SelectKotlinFile(val path: Path, val project: Project) : ExistingPackAction 9 | 10 | data object AddNestedPack : ExistingPackAction 11 | data class RemoveNestedPack(val nestedPack: NestedPack) : ExistingPackAction 12 | 13 | data object PreviewPackObject : ExistingPackAction 14 | data object SavePack : ExistingPackAction 15 | } 16 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/existingpack/ui/model/ExistingPackEvent.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.existingpack.ui.model 2 | 3 | sealed interface ExistingPackEvent { 4 | data class PreviewIconPackObject(val code: String) : ExistingPackEvent 5 | data object OnSettingsUpdated : ExistingPackEvent 6 | } 7 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/existingpack/ui/model/ExistingPackModeState.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.existingpack.ui.model 2 | 3 | import io.github.composegears.valkyrie.ui.screen.mode.iconpack.creation.common.packedit.model.PackEditState 4 | 5 | sealed interface ExistingPackModeState { 6 | data object ChooserState : ExistingPackModeState 7 | 8 | data class ExistingPackEditState( 9 | val packEditState: PackEditState = PackEditState(), 10 | val exportDirectory: String = "", 11 | val nextAvailable: Boolean = true, 12 | ) : ExistingPackModeState 13 | } 14 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/existingpack/ui/viewmodel/ExistingPackInputHandler.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.existingpack.ui.viewmodel 2 | 3 | import io.github.composegears.valkyrie.settings.ValkyriesSettings 4 | import io.github.composegears.valkyrie.ui.domain.validation.InputState 5 | import io.github.composegears.valkyrie.ui.screen.mode.iconpack.creation.common.inputhandler.BasicInputHandler 6 | import io.github.composegears.valkyrie.ui.screen.mode.iconpack.creation.common.packedit.model.InputFieldState 7 | 8 | class ExistingPackInputHandler : BasicInputHandler(initialState = existingPackInputFieldState) { 9 | 10 | override fun provideInputFieldState( 11 | settings: ValkyriesSettings, 12 | ): InputFieldState = existingPackInputFieldState 13 | 14 | companion object { 15 | private val existingPackInputFieldState: InputFieldState 16 | get() = InputFieldState( 17 | iconPackName = InputState(), 18 | packageName = InputState(), 19 | nestedPacks = emptyList(), 20 | ) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/newpack/ui/model/NewPackAction.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.newpack.ui.model 2 | 3 | import io.github.composegears.valkyrie.ui.screen.mode.iconpack.creation.common.packedit.model.NestedPack 4 | import java.nio.file.Path 5 | 6 | sealed interface NewPackAction { 7 | data class SelectDestinationFolder(val path: Path) : NewPackAction 8 | data object SaveDestination : NewPackAction 9 | 10 | data object AddNestedPack : NewPackAction 11 | data class RemoveNestedPack(val nestedPack: NestedPack) : NewPackAction 12 | 13 | data object PreviewPackObject : NewPackAction 14 | data object SavePack : NewPackAction 15 | 16 | data class UseMaterialPack(val value: Boolean) : NewPackAction 17 | } 18 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/newpack/ui/model/NewPackEvent.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.newpack.ui.model 2 | 3 | sealed interface NewPackEvent { 4 | data class PreviewIconPackObject(val code: String) : NewPackEvent 5 | data object OnSettingsUpdated : NewPackEvent 6 | } 7 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/newpack/ui/model/NewPackModeState.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.iconpack.newpack.ui.model 2 | 3 | import io.github.composegears.valkyrie.ui.screen.mode.iconpack.creation.common.packedit.model.PackEditState 4 | 5 | sealed interface NewPackModeState { 6 | data class ChooseExportDirectoryState( 7 | val iconPackDestination: String, 8 | val predictedPackage: String, 9 | val nextAvailable: Boolean, 10 | ) : NewPackModeState 11 | 12 | data class PickedState( 13 | val packEditState: PackEditState = PackEditState(), 14 | val useMaterialPack: Boolean = false, 15 | val nextAvailable: Boolean = true, 16 | ) : NewPackModeState 17 | } 18 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/simple/conversion/ui/preview/action/ExpandedActions.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.ui.preview.action 2 | 3 | enum class ExpandedActions { 4 | Edit, 5 | Preview, 6 | None, 7 | } 8 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/simple/conversion/viewmodel/SimpleConversionAction.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.viewmodel 2 | 3 | import java.nio.file.Path 4 | 5 | sealed interface SimpleConversionAction { 6 | 7 | data object Back : SimpleConversionAction 8 | data object OpenSettings : SimpleConversionAction 9 | data object OpenFilePicker : SimpleConversionAction 10 | data object ClosePreview : SimpleConversionAction 11 | data class OnPasteFromClipboard(val text: String) : SimpleConversionAction 12 | data class OnDragAndDropPath(val path: Path) : SimpleConversionAction 13 | data class OnCopyInClipboard(val text: String) : SimpleConversionAction 14 | data class OnIconNaneChange(val name: String) : SimpleConversionAction 15 | } 16 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/simple/conversion/viewmodel/SimpleConversionState.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.viewmodel 2 | 3 | import io.github.composegears.valkyrie.ir.IrImageVector 4 | import java.nio.file.Path 5 | 6 | sealed interface SimpleConversionState { 7 | data object PickerState : SimpleConversionState 8 | 9 | data class ConversionState( 10 | val iconSource: IconSource, 11 | val iconContent: IconContent, 12 | ) : SimpleConversionState 13 | } 14 | 15 | sealed interface IconSource { 16 | data class FileBasedIcon(val path: Path) : IconSource 17 | data class StringBasedIcon(val text: String) : IconSource 18 | } 19 | 20 | data class IconContent( 21 | val name: String, 22 | val code: String, 23 | val irImageVector: IrImageVector, 24 | ) 25 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/simple/setup/util/PackageTooltipContent.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.mode.simple.setup.util 2 | 3 | import androidx.compose.runtime.Composable 4 | import dev.snipme.highlights.Highlights 5 | import io.github.composegears.valkyrie.ui.foundation.highlights.core.getEmphasisLocations 6 | import io.github.composegears.valkyrie.ui.foundation.highlights.core.rememberCodeHighlight 7 | 8 | @Composable 9 | fun buildPackageHighlight(packageName: String): Highlights { 10 | val packagePlaceholder = packageName.ifEmpty { "com.test.iconpack" } 11 | val codeBlock = """ 12 | package $packagePlaceholder 13 | 14 | val MyIcon: ImageVector 15 | get() { 16 | if (_MyIcon != null) { 17 | return _MyIcon!! 18 | } 19 | ... 20 | } 21 | """.trimIndent() 22 | 23 | return rememberCodeHighlight( 24 | codeBlock = codeBlock, 25 | emphasisLocation = getEmphasisLocations( 26 | codeBlock = codeBlock, 27 | highlightText = packagePlaceholder, 28 | ), 29 | ) 30 | } 31 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/preview/CodePreviewScreen.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.preview 2 | 3 | import androidx.compose.foundation.layout.Column 4 | import androidx.compose.foundation.layout.fillMaxSize 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.ui.Modifier 7 | import com.composegears.tiamat.navArgs 8 | import com.composegears.tiamat.navController 9 | import com.composegears.tiamat.navDestination 10 | import io.github.composegears.valkyrie.ui.foundation.BackAction 11 | import io.github.composegears.valkyrie.ui.foundation.TopAppBar 12 | import io.github.composegears.valkyrie.ui.foundation.highlights.KotlinCodeViewer 13 | 14 | val CodePreviewScreen by navDestination { 15 | val navController = navController() 16 | val navArgs = navArgs() 17 | 18 | CodePreviewUi( 19 | code = navArgs, 20 | onBack = navController::back, 21 | ) 22 | } 23 | 24 | @Composable 25 | private fun CodePreviewUi( 26 | code: String, 27 | onBack: () -> Unit, 28 | ) { 29 | Column { 30 | TopAppBar { 31 | BackAction(onBack = onBack) 32 | } 33 | KotlinCodeViewer( 34 | modifier = Modifier.fillMaxSize(), 35 | text = code, 36 | ) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/model/SettingsAction.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.ui.screen.settings.model 2 | 3 | import io.github.composegears.valkyrie.generator.jvm.imagevector.OutputFormat 4 | import io.github.composegears.valkyrie.generator.jvm.imagevector.PreviewAnnotationType 5 | import io.github.composegears.valkyrie.ui.domain.model.PreviewType 6 | 7 | sealed interface SettingsAction { 8 | data class UpdateOutputFormat(val outputFormat: OutputFormat) : SettingsAction 9 | data class UpdateUseComposeColors(val useComposeColor: Boolean) : SettingsAction 10 | data class UpdateFlatPackage(val useFlatPackage: Boolean) : SettingsAction 11 | data class UpdateExplicitMode(val useExplicitMode: Boolean) : SettingsAction 12 | data class UpdateAddTrailingComma(val addTrailingComma: Boolean) : SettingsAction 13 | data class UpdatePreviewGeneration(val generate: Boolean) : SettingsAction 14 | data class UpdatePreviewAnnotationType(val annotationType: PreviewAnnotationType) : SettingsAction 15 | data class UpdateIndentSize(val indent: Int) : SettingsAction 16 | 17 | data class UpdateImageVectorPreview(val enabled: Boolean) : SettingsAction 18 | data class UpdatePreviewType(val previewType: PreviewType) : SettingsAction 19 | } 20 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/util/Stub.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.util 2 | 3 | import io.github.composegears.valkyrie.ir.IrColor 4 | import io.github.composegears.valkyrie.ir.IrImageVector 5 | import io.github.composegears.valkyrie.ir.IrPathNode 6 | import io.github.composegears.valkyrie.ir.IrStroke 7 | import io.github.composegears.valkyrie.ir.IrStrokeLineCap 8 | import io.github.composegears.valkyrie.ir.IrVectorNode 9 | 10 | val IR_STUB = IrImageVector( 11 | name = "", 12 | defaultWidth = 16.0f, 13 | defaultHeight = 16.0f, 14 | viewportWidth = 16.0f, 15 | viewportHeight = 16.0f, 16 | nodes = listOf( 17 | IrVectorNode.IrPath( 18 | stroke = IrStroke.Color(irColor = IrColor("0xFF000000")), 19 | strokeLineWidth = 2f, 20 | strokeLineCap = IrStrokeLineCap.Round, 21 | paths = listOf( 22 | IrPathNode.MoveTo(x = 2.5f, y = 13.5f), 23 | IrPathNode.LineTo(x = 13.5f, y = 2.5f), 24 | IrPathNode.MoveTo(x = 13.5f, y = 13.5f), 25 | IrPathNode.LineTo(x = 2.5f, y = 2.5f), 26 | ), 27 | ), 28 | ), 29 | ) 30 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/util/TiamatSavedState.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.util 2 | 3 | import com.composegears.tiamat.SavedState 4 | import io.github.composegears.valkyrie.extensions.safeAs 5 | 6 | inline fun SavedState.getOrNull(key: String): T? = get(key).safeAs() 7 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/util/ValkyrieStrings.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("ktlint:standard:argument-list-wrapping", "ktlint:standard:annotation") 2 | 3 | package io.github.composegears.valkyrie.util 4 | 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.runtime.ReadOnlyComposable 7 | import androidx.compose.ui.platform.LocalInspectionMode 8 | import com.intellij.DynamicBundle 9 | import org.jetbrains.annotations.NonNls 10 | import org.jetbrains.annotations.PropertyKey 11 | 12 | @NonNls 13 | private const val BUNDLE_NAME = "messages.Valkyrie" 14 | 15 | @Composable 16 | @ReadOnlyComposable 17 | fun stringResource(key: @PropertyKey(resourceBundle = BUNDLE_NAME) String): String { 18 | if (LocalInspectionMode.current) return key 19 | 20 | return ValkyrieBundle.message(key) 21 | } 22 | 23 | object ValkyrieStrings { 24 | 25 | fun getString(key: @PropertyKey(resourceBundle = BUNDLE_NAME) String): String { 26 | return ValkyrieBundle.message(key) 27 | } 28 | } 29 | 30 | private object ValkyrieBundle : DynamicBundle(BUNDLE_NAME) { 31 | 32 | @JvmStatic 33 | fun message(@PropertyKey(resourceBundle = BUNDLE_NAME) key: String, vararg params: Any) = getMessage(key, *params) 34 | } 35 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/util/extension/Uuid.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.util.extension 2 | 3 | import kotlin.uuid.ExperimentalUuidApi 4 | import kotlin.uuid.Uuid 5 | 6 | object Uuid { 7 | 8 | @OptIn(ExperimentalUuidApi::class) 9 | fun random() = Uuid.random().toString() 10 | } 11 | -------------------------------------------------------------------------------- /tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/util/extension/VirtualFile.kt: -------------------------------------------------------------------------------- 1 | package io.github.composegears.valkyrie.util.extension 2 | 3 | import com.intellij.openapi.vfs.VirtualFile 4 | import io.github.composegears.valkyrie.parser.unified.ext.isSvgExtension 5 | import io.github.composegears.valkyrie.parser.unified.ext.isXmlExtension 6 | 7 | inline val VirtualFile.isSvg: Boolean 8 | get() = extension?.isSvgExtension ?: false 9 | 10 | inline val VirtualFile.isXml: Boolean 11 | get() = extension?.isXmlExtension ?: false 12 | --------------------------------------------------------------------------------